libosmo-sigtran 2.0.0.52-6412
Osmocom SIGTRAN library
osmo_ss7.c File Reference
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <inttypes.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/mtp_sap.h>
#include <osmocom/sigtran/protocol/mtp.h>
#include <osmocom/sigtran/protocol/sua.h>
#include <osmocom/sigtran/protocol/m3ua.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/select.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/sockaddr_str.h>
#include <osmocom/netif/stream.h>
#include <osmocom/netif/ipa.h>
#include <osmocom/netif/sctp.h>
#include "sccp_internal.h"
#include "xua_internal.h"
#include "ss7_as.h"
#include "ss7_asp.h"
#include "ss7_internal.h"
#include "ss7_linkset.h"
#include "ss7_route.h"
#include "ss7_route_table.h"
#include "xua_asp_fsm.h"
#include "xua_as_fsm.h"

Functions

 LLIST_HEAD (osmo_ss7_instances)
 
struct osmo_ss7_instanceosmo_ss7_instances_llist_entry (struct llist_head *list)
 
uint8_t osmo_ss7_pc_width (const struct osmo_ss7_pc_fmt *pc_fmt)
 
uint32_t osmo_ss7_pc_normalize (const struct osmo_ss7_pc_fmt *pc_fmt, uint32_t pc)
 
struct osmo_ss7_instanceosmo_ss7_instance_find (uint32_t id)
 Find a SS7 Instance with given ID. More...
 
struct osmo_ss7_instanceosmo_ss7_instance_find_or_create (void *ctx, uint32_t id)
 Find or create a SS7 Instance. More...
 
bool ss7_ipv6_sctp_supported (const char *host, bool bind)
 
int osmo_ss7_init (void)
 
int osmo_ss7_tmode_to_xua (enum osmo_ss7_as_traffic_mode tmod)
 
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua (uint32_t in)
 

Variables

bool ss7_initialized = false
 
const struct value_string mtp_unavail_cause_vals []
 

Function Documentation

◆ LLIST_HEAD()

LLIST_HEAD ( osmo_ss7_instances  )

◆ osmo_ss7_init()

int osmo_ss7_init ( void  )

◆ osmo_ss7_instance_find()

struct osmo_ss7_instance * osmo_ss7_instance_find ( uint32_t  id)

Find a SS7 Instance with given ID.

Parameters
[in]idID for which to search
Returns
osmo_ss7_instance on success; NULL on error

References osmo_ss7_instance::cfg, osmo_ss7_instance::id, osmo_ss7_instance::list, osmo_ss7_instances, and ss7_initialized.

Referenced by DEFUN(), osmo_sccp_simple_client_on_ss7_id(), osmo_ss7_instance_find_or_create(), show_asp(), show_asp_assoc_status(), and show_asp_remaddr().

◆ osmo_ss7_instance_find_or_create()

struct osmo_ss7_instance * osmo_ss7_instance_find_or_create ( void *  ctx,
uint32_t  id 
)

Find or create a SS7 Instance.

Parameters
[in]ctxtalloc allocation context to use for allocations
[in]idID of SS7 Instance
Returns
osmo_ss7_instance on success; NULL on error

References osmo_ss7_instance_find(), ss7_initialized, and ss7_instance_alloc().

Referenced by DEFUN_ATTR(), osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_on_ss7_id().

◆ osmo_ss7_instances_llist_entry()

struct osmo_ss7_instance * osmo_ss7_instances_llist_entry ( struct llist_head *  list)

◆ osmo_ss7_pc_normalize()

uint32_t osmo_ss7_pc_normalize ( const struct osmo_ss7_pc_fmt pc_fmt,
uint32_t  pc 
)

◆ osmo_ss7_pc_width()

◆ osmo_ss7_tmode_from_xua()

◆ osmo_ss7_tmode_to_xua()

◆ ss7_ipv6_sctp_supported()

bool ss7_ipv6_sctp_supported ( const char *  host,
bool  bind 
)

Variable Documentation

◆ mtp_unavail_cause_vals

const struct value_string mtp_unavail_cause_vals[]
Initial value:
= {
{ MTP_UNAVAIL_C_UNKNOWN, "unknown" },
{ MTP_UNAVAIL_C_UNEQUIP_REM_USER, "unequipped-remote-user" },
{ MTP_UNAVAIL_C_INACC_REM_USER, "inaccessible-remote-user" },
{ 0, NULL }
}
@ MTP_UNAVAIL_C_UNEQUIP_REM_USER
Definition: mtp.h:30
@ MTP_UNAVAIL_C_UNKNOWN
Definition: mtp.h:29
@ MTP_UNAVAIL_C_INACC_REM_USER
Definition: mtp.h:31

Referenced by mtp_unavail_cause_str().

◆ ss7_initialized