libosmo-sigtran  1.9.0.4-dc82
Osmocom SIGTRAN library
osmo_ss7_as.c File Reference
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <inttypes.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
#include "ss7_internal.h"
#include "xua_as_fsm.h"
#include "xua_asp_fsm.h"

Functions

struct osmo_ss7_asss7_as_alloc (struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
 Allocate an Application Server. 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...
 

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
 

Function Documentation

◆ osmo_ss7_as_active()

bool osmo_ss7_as_active ( const struct osmo_ss7_as as)

Determine if given AS is in the active state.

Parameters
[in]asApplication Server.
Returns
true in case as is active; false otherwise.

References osmo_ss7_as::fi, and XUA_AS_S_ACTIVE.

Referenced by DEFUN().

◆ osmo_ss7_as_add_asp()

int osmo_ss7_as_add_asp ( struct osmo_ss7_as as,
const char *  asp_name 
)

Add given ASP to given AS.

Parameters
[in]asApplication Server to which asp is added
[in]aspApplication Server Process to be added to as
Returns
0 on success; negative in case of error

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().

◆ osmo_ss7_as_del_asp()

int osmo_ss7_as_del_asp ( struct osmo_ss7_as as,
const char *  asp_name 
)

Delete given ASP from given AS.

Parameters
[in]asApplication Server from which asp is deleted
[in]aspApplication Server Process to delete from as
Returns
0 on success; negative in case of error

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().

◆ osmo_ss7_as_destroy()

◆ osmo_ss7_as_down()

bool osmo_ss7_as_down ( const struct osmo_ss7_as as)

Determine if given AS is in the down state.

Parameters
[in]asApplication Server.
Returns
true in case as is down; false otherwise.

References osmo_ss7_as::fi, and XUA_AS_S_DOWN.

Referenced by hmrt_message_for_routing().

◆ osmo_ss7_as_has_asp()

bool osmo_ss7_as_has_asp ( const struct osmo_ss7_as as,
const struct osmo_ss7_asp asp 
)

Determine if given AS contains ASP.

Parameters
[in]asApplication Server in which to look for asp
[in]aspApplication Server Process to look for in as
Returns
true in case asp is part of as; false otherwise

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().

◆ ss7_as_alloc()

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.

Parameters
[in]instSS7 Instance on which we operate
[in]nameName of Application Server
[in]protoProtocol of Application Server
Returns
pointer to Application Server on success; NULL otherwise

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().

Variable Documentation

◆ g_ss7_as_rcg_idx

unsigned int g_ss7_as_rcg_idx
static

Referenced by ss7_as_alloc().

◆ osmo_ss7_as_traffic_mode_vals

struct value_string osmo_ss7_as_traffic_mode_vals[]
Initial value:
= {
{ OSMO_SS7_AS_TMOD_BCAST, "broadcast" },
{ OSMO_SS7_AS_TMOD_LOADSHARE, "loadshare" },
{ OSMO_SS7_AS_TMOD_ROUNDROBIN, "round-robin" },
{ OSMO_SS7_AS_TMOD_OVERRIDE, "override" },
{ 0, NULL }
}
Definition: osmo_ss7.h:263
Definition: osmo_ss7.h:262
Definition: osmo_ss7.h:264
Definition: osmo_ss7.h:265

Referenced by DEFUN_USRATTR(), and osmo_ss7_as_traffic_mode_name().

◆ ss7_as_rcd

const struct rate_ctr_desc ss7_as_rcd[]
static
Initial value:
= {
[SS7_AS_CTR_RX_MSU_TOTAL] = { "rx:msu:total", "Total number of MSU received" },
[SS7_AS_CTR_TX_MSU_TOTAL] = { "tx:msu:total", "Total number of MSU transmitted" },
}
Definition: ss7_internal.h:45
Definition: ss7_internal.h:44

◆ ss7_as_rcgd

const struct rate_ctr_group_desc ss7_as_rcgd
static
Initial value:
= {
.group_name_prefix = "sigtran_as",
.group_description = "SIGTRAN Application Server",
.num_ctr = ARRAY_SIZE(ss7_as_rcd),
.ctr_desc = ss7_as_rcd,
}
static const struct rate_ctr_desc ss7_as_rcd[]
Definition: osmo_ss7_as.c:52

Referenced by ss7_as_alloc().