libosmo-sigtran 2.0.0.52-6412
Osmocom SIGTRAN library
|
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <inttypes.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/protocol/m3ua.h>
#include "ss7_as.h"
#include "ss7_asp.h"
#include "ss7_route.h"
#include "ss7_route_table.h"
#include "ss7_internal.h"
#include "xua_as_fsm.h"
#include "xua_asp_fsm.h"
Functions | |
struct osmo_ss7_as * | ss7_as_alloc (struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto) |
Allocate an Application Server. More... | |
enum osmo_ss7_asp_protocol | osmo_ss7_as_get_asp_protocol (const struct osmo_ss7_as *as) |
Get asp_protocol configuration of a given AS. More... | |
int | osmo_ss7_as_add_asp (struct osmo_ss7_as *as, const char *asp_name) |
Add given ASP to given AS. More... | |
int | osmo_ss7_as_del_asp (struct osmo_ss7_as *as, const char *asp_name) |
Delete given ASP from given AS. More... | |
void | osmo_ss7_as_destroy (struct osmo_ss7_as *as) |
Destroy given Application Server. More... | |
bool | osmo_ss7_as_has_asp (const struct osmo_ss7_as *as, const struct osmo_ss7_asp *asp) |
Determine if given AS contains ASP. More... | |
bool | osmo_ss7_as_active (const struct osmo_ss7_as *as) |
Determine if given AS is in the active state. More... | |
bool | osmo_ss7_as_down (const struct osmo_ss7_as *as) |
Determine if given AS is in the down state. More... | |
static struct osmo_ss7_asp * | ss7_as_select_asp_override (struct osmo_ss7_as *as) |
static struct osmo_ss7_asp * | ss7_as_select_asp_roundrobin (struct osmo_ss7_as *as) |
static struct osmo_ss7_asp * | ss7_as_select_asp_broadcast (struct osmo_ss7_as *as) |
struct osmo_ss7_asp * | osmo_ss7_as_select_asp (struct osmo_ss7_as *as) |
Select an AS to transmit a message, according to AS configuration and ASP availability. More... | |
bool | osmo_ss7_as_tmode_compatible_xua (struct osmo_ss7_as *as, uint32_t m3ua_tmt) |
Variables | |
struct value_string | osmo_ss7_as_traffic_mode_vals [] |
static const struct rate_ctr_desc | ss7_as_rcd [] |
static const struct rate_ctr_group_desc | ss7_as_rcgd |
static unsigned int | g_ss7_as_rcg_idx |
bool osmo_ss7_as_active | ( | const struct osmo_ss7_as * | as | ) |
Determine if given AS is in the active state.
[in] | as | Application Server. |
References osmo_ss7_as::fi, and XUA_AS_S_ACTIVE.
Referenced by DEFUN().
int osmo_ss7_as_add_asp | ( | struct osmo_ss7_as * | as, |
const char * | asp_name | ||
) |
Add given ASP to given AS.
[in] | as | Application Server to which asp is added |
[in] | asp | Application Server Process to be added to as |
References osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, osmo_ss7_asp::fi, osmo_ss7_as::inst, LOGPAS, osmo_ss7_asp::name, osmo_ss7_as_has_asp(), osmo_ss7_asp_find_by_name(), ss7_initialized, and XUA_ASP_E_AS_ASSIGNED.
Referenced by DEFUN_ATTR(), handle_rkey_reg(), ipa_asp_fsm_wait_id_resp(), osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_add_clnt().
int osmo_ss7_as_del_asp | ( | struct osmo_ss7_as * | as, |
const char * | asp_name | ||
) |
Delete given ASP from given AS.
[in] | as | Application Server from which asp is deleted |
[in] | asp | Application Server Process to delete from as |
References osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, osmo_ss7_as::inst, LOGPAS, osmo_ss7_asp::name, osmo_ss7_asp_find_by_name(), and ss7_initialized.
Referenced by DEFUN_ATTR(), and handle_rkey_dereg().
void osmo_ss7_as_destroy | ( | struct osmo_ss7_as * | as | ) |
Destroy given Application Server.
[in] | as | Application Server to destroy |
References osmo_ss7_as::ctrg, osmo_ss7_as::fi, osmo_ss7_as::inst, osmo_ss7_as::list, LOGPAS, osmo_ss7_instance::rtable_system, ss7_initialized, and ss7_route_table_del_routes_by_as().
Referenced by DEFUN_ATTR(), handle_rkey_dereg(), handle_rkey_reg(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), osmo_ss7_instance_destroy(), and xua_rkm_cleanup_dyn_as_for_asp().
bool osmo_ss7_as_down | ( | const struct osmo_ss7_as * | as | ) |
Determine if given AS is in the down state.
[in] | as | Application Server. |
References osmo_ss7_as::fi, and XUA_AS_S_DOWN.
Referenced by hmrt_message_for_routing().
enum osmo_ss7_asp_protocol osmo_ss7_as_get_asp_protocol | ( | const struct osmo_ss7_as * | as | ) |
Get asp_protocol configuration of a given AS.
[in] | as | Application Server in which to look for asp_protocol |
References osmo_ss7_as::cfg, and osmo_ss7_as::proto.
bool osmo_ss7_as_has_asp | ( | const struct osmo_ss7_as * | as, |
const struct osmo_ss7_asp * | asp | ||
) |
Determine if given AS contains ASP.
[in] | as | Application Server in which to look for asp |
[in] | asp | Application Server Process to look for in as |
References osmo_ss7_as::asps, osmo_ss7_as::cfg, and ss7_initialized.
Referenced by as_list_for_asp(), determine_traf_mode(), dispatch_to_all_as(), find_single_as_for_asp(), get_all_rctx_for_asp(), handle_rkey_dereg(), ipa_find_as_for_asp(), osmo_sccp_simple_client_on_ss7_id(), osmo_ss7_as_add_asp(), xua_asp_fsm_inactive(), xua_find_as_for_asp(), xua_msg_add_asp_rctx(), and xua_rkm_cleanup_dyn_as_for_asp().
struct osmo_ss7_asp * osmo_ss7_as_select_asp | ( | struct osmo_ss7_as * | as | ) |
Select an AS to transmit a message, according to AS configuration and ASP availability.
[in] | as | Application Server. |
This function returns NULL too if multiple ASPs would be selected, ie. AS is configured in broadcast mode and more than one ASP is configured.
References _NUM_OSMO_SS7_ASP_TMOD, osmo_ss7_as::cfg, osmo_ss7_as::fi, osmo_ss7_as::mode, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, OSMO_SS7_AS_TMOD_OVERRIDE, OSMO_SS7_AS_TMOD_ROUNDROBIN, ss7_as_select_asp_broadcast(), ss7_as_select_asp_override(), and ss7_as_select_asp_roundrobin().
Referenced by xua_as_transmit_msg().
bool osmo_ss7_as_tmode_compatible_xua | ( | struct osmo_ss7_as * | as, |
uint32_t | m3ua_tmt | ||
) |
References osmo_ss7_as::cfg, M3UA_TMOD_BCAST, M3UA_TMOD_LOADSHARE, M3UA_TMOD_OVERRIDE, osmo_ss7_as::mode, osmo_ss7_as::mode_set_by_peer, osmo_ss7_as::mode_set_by_vty, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, OSMO_SS7_AS_TMOD_OVERRIDE, and OSMO_SS7_AS_TMOD_ROUNDROBIN.
Referenced by handle_rkey_reg(), and xua_asp_fsm_inactive().
struct osmo_ss7_as * ss7_as_alloc | ( | struct osmo_ss7_instance * | inst, |
const char * | name, | ||
enum osmo_ss7_asp_protocol | proto | ||
) |
Allocate an Application Server.
[in] | inst | SS7 Instance on which we operate |
[in] | name | Name of Application Server |
[in] | proto | Protocol of Application Server |
References osmo_ss7_instance::as_list, osmo_ss7_as::cfg, osmo_ss7_as::ctrg, osmo_ss7_as::fi, g_ss7_as_rcg_idx, osmo_ss7_as::inst, osmo_ss7_routing_key::l_rk_id, osmo_ss7_as::list, osmo_ss7_as::mode, osmo_ss7_as::name, OSMO_SS7_AS_TMOD_OVERRIDE, osmo_ss7_as::proto, osmo_ss7_as::recovery_timeout_msec, osmo_ss7_as::routing_key, ss7_as_rcgd, ss7_find_free_l_rk_id(), and xua_as_fsm_start().
Referenced by osmo_ss7_as_find_or_create().
|
static |
References osmo_ss7_as::asps, osmo_ss7_as::cfg, and osmo_ss7_asp_active().
Referenced by osmo_ss7_as_select_asp().
|
static |
References osmo_ss7_as::asps, osmo_ss7_as::cfg, and osmo_ss7_asp_active().
Referenced by osmo_ss7_as_select_asp().
|
static |
References osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_as::last_asp_idx_sent, and osmo_ss7_asp_active().
Referenced by osmo_ss7_as_select_asp().
|
static |
Referenced by ss7_as_alloc().
struct value_string osmo_ss7_as_traffic_mode_vals[] |
Referenced by DEFUN_USRATTR(), and osmo_ss7_as_traffic_mode_name().
|
static |
|
static |
Referenced by ss7_as_alloc().