Loading...
Searching...
No Matches
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_internal.h"`
`#include "xua_asp_fsm.h"`
`#include "xua_as_fsm.h"`

## Macros

#define | MAX_PC_STR_LEN 32

## Enumerations

enum | ss7_asp_ctr { SS7_ASP_CTR_PKT_RX_TOTAL , SS7_ASP_CTR_PKT_RX_UNKNOWN , SS7_ASP_CTR_PKT_TX_TOTAL }

## Functions

| LLIST_HEAD (osmo_ss7_instances)
static int | asp_proto_to_ip_proto (enum osmo_ss7_asp_protocol proto)
int | osmo_ss7_find_free_rctx (struct osmo_ss7_instance *inst)
static uint32_t | find_free_l_rk_id (struct osmo_ss7_instance *inst)
static int | strnappendchar (char *str, char c, size_t n)
static const char * | gen_pc_fmtstr (const struct osmo_ss7_pc_fmt *pc_fmt, unsigned int *num_comp_exp)
static unsigned int | num_pc_comp_exp (const struct osmo_ss7_pc_fmt *pc_fmt)
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)
static unsigned int | get_pc_comp_shift (const struct osmo_ss7_pc_fmt *pc_fmt, unsigned int comp_num)
static uint32_t | pc_comp_shift_and_mask (const struct osmo_ss7_pc_fmt *pc_fmt, unsigned int comp_num, uint32_t pc)
int | osmo_ss7_pointcode_parse (struct osmo_ss7_instance *inst, const char *str)
const char * | osmo_ss7_pointcode_print_buf (char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc)
const char * | osmo_ss7_pointcode_print (const struct osmo_ss7_instance *inst, uint32_t pc)
const char * | osmo_ss7_pointcode_print2 (const struct osmo_ss7_instance *inst, uint32_t pc)
int | osmo_ss7_pointcode_parse_mask_or_len (struct osmo_ss7_instance *inst, const char *in)
int | osmo_ss7_asp_protocol_port (enum osmo_ss7_asp_protocol prot)
struct osmo_ss7_instance * | osmo_ss7_instance_find (uint32_t id)
| Find a SS7 Instance with given ID.
struct osmo_ss7_instance * | osmo_ss7_instance_find_or_create (void *ctx, uint32_t id)
| Find or create a SS7 Instance.
void | osmo_ss7_instance_destroy (struct osmo_ss7_instance *inst)
| Destroy a SS7 Instance.
int | osmo_ss7_instance_set_pc_fmt (struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2)
| Set the point code format used in given SS7 instance.
struct osmo_sccp_instance * | osmo_ss7_ensure_sccp (struct osmo_ss7_instance *inst)
| Allocate an SCCP instance, if not present yet.
int | osmo_ss7_user_register (struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
| Register a MTP user for a given service indicator.
int | osmo_ss7_user_unregister (struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
| Unregister a MTP user for a given service indicator.
int | osmo_ss7_mtp_to_user (struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
void | osmo_ss7_linkset_destroy (struct osmo_ss7_linkset *lset)
| Destroy a SS7 Linkset.
struct osmo_ss7_linkset * | osmo_ss7_linkset_find_by_name (struct osmo_ss7_instance *inst, const char *name)
| Find SS7 Linkset by given name.
struct osmo_ss7_linkset * | osmo_ss7_linkset_find_or_create (struct osmo_ss7_instance *inst, const char *name, uint32_t pc)
| Find or allocate SS7 Linkset.
void | osmo_ss7_link_destroy (struct osmo_ss7_link *link)
| Destroy SS7 Link.
struct osmo_ss7_link * | osmo_ss7_link_find_or_create (struct osmo_ss7_linkset *lset, uint32_t id)
| Find or create SS7 Link with given ID in given Linkset.
struct osmo_ss7_route_table * | osmo_ss7_route_table_find (struct osmo_ss7_instance *inst, const char *name)
struct osmo_ss7_route_table * | osmo_ss7_route_table_find_or_create (struct osmo_ss7_instance *inst, const char *name)
void | osmo_ss7_route_table_destroy (struct osmo_ss7_route_table *rtbl)
struct osmo_ss7_route * | osmo_ss7_route_find_dpc (struct osmo_ss7_route_table *rtbl, uint32_t dpc)
| Find a SS7 route for given destination point code in given table.
struct osmo_ss7_route * | osmo_ss7_route_find_dpc_mask (struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask)
| Find a SS7 route for given destination point code + mask in given table.
struct osmo_ss7_route * | osmo_ss7_route_lookup (struct osmo_ss7_instance *inst, uint32_t dpc)
| Find a SS7 route for given destination point code in given SS7.
static void | route_insert_sorted (struct osmo_ss7_route_table *rtbl, struct osmo_ss7_route *cmp)
struct osmo_ss7_route * | osmo_ss7_route_create (struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask, const char *linkset_name)
| Create a new route in the given routing table.
void | osmo_ss7_route_destroy (struct osmo_ss7_route *rt)
| Destroy a given SS7 route.
static unsigned int | count_leading_one_bits (uint32_t inp, unsigned int nbits)
static int | u32_masklen (uint32_t mask, unsigned int nbits)
const char * | osmo_ss7_route_print (const struct osmo_ss7_route *rt)
struct osmo_ss7_as * | osmo_ss7_as_find_by_name (struct osmo_ss7_instance *inst, const char *name)
| Find Application Server by given name.
struct osmo_ss7_as * | osmo_ss7_as_find_by_rctx (struct osmo_ss7_instance *inst, uint32_t rctx)
| Find Application Server by given routing context.
struct osmo_ss7_as * | osmo_ss7_as_find_by_l_rk_id (struct osmo_ss7_instance *inst, uint32_t l_rk_id)
| Find Application Server by given local routing key ID.
struct osmo_ss7_as * | osmo_ss7_as_find_by_proto (struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto)
| Find Application Server (AS) by given protocol.
struct osmo_ss7_as * | osmo_ss7_as_find_or_create (struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
| Find or Create Application Server.
int | osmo_ss7_as_add_asp (struct osmo_ss7_as *as, const char *asp_name)
| Add given ASP to given AS.
int | osmo_ss7_as_del_asp (struct osmo_ss7_as *as, const char *asp_name)
| Delete given ASP from given AS.
void | osmo_ss7_as_destroy (struct osmo_ss7_as *as)
| Destroy given Application Server.
bool | osmo_ss7_as_has_asp (const struct osmo_ss7_as *as, const struct osmo_ss7_asp *asp)
| Determine if given AS contains ASP.
bool | osmo_ss7_as_active (const struct osmo_ss7_as *as)
| Determine if given AS is in the active state.
int | osmo_ss7_asp_peer_snprintf (char *buf, size_t buf_len, struct osmo_ss7_asp_peer *peer)
int | osmo_ss7_asp_peer_set_hosts (struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const *hosts, size_t host_cnt)
| Set (copy) addresses for a given ASP peer.
static bool | host_is_ip_anyaddr (const char *host, bool is_v6)
int | osmo_ss7_asp_peer_add_host (struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host)
| Append (copy) address to a given ASP peer.
static bool | ipv6_sctp_supported (const char *host, bool bind)
bool | osmo_ss7_asp_set_default_peer_hosts (struct osmo_ss7_asp *asp)
struct osmo_ss7_asp * | osmo_ss7_asp_find_by_name (struct osmo_ss7_instance *inst, const char *name)
static uint16_t | get_in_port (struct sockaddr *sa)
static void | chop_v4_mapped_on_v6_prefix (char *buf)
static struct osmo_ss7_asp * | osmo_ss7_asp_find_by_socket_addr (int fd)
| Find an ASP definition matching the local+remote IP/PORT of given fd.
struct osmo_ss7_asp * | osmo_ss7_asp_find_by_proto (struct osmo_ss7_as *as, enum osmo_ss7_asp_protocol proto)
| Find an ASP that matches the given protocol.
struct osmo_ss7_asp * | osmo_ss7_asp_find (struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto)
struct osmo_ss7_asp * | osmo_ss7_asp_find_or_create (struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto)
void | osmo_ss7_asp_destroy (struct osmo_ss7_asp *asp)
static int | xua_cli_read_cb (struct osmo_stream_cli *conn)
static int | ipa_cli_read_cb (struct osmo_stream_cli *conn)
static int | xua_cli_connect_cb (struct osmo_stream_cli *cli)
int | osmo_ss7_asp_restart (struct osmo_ss7_asp *asp)
bool | osmo_ss7_asp_active (const struct osmo_ss7_asp *asp)
static int | get_logevel_by_sn_type (int sn_type)
static void | log_sctp_notification (struct osmo_ss7_asp *asp, const char *pfx, union sctp_notification *notif)
static int | ipa_srv_conn_cb (struct osmo_stream_srv *conn)
static int | xua_srv_conn_cb (struct osmo_stream_srv *conn)
static void | xua_cli_close (struct osmo_stream_cli *cli)
static void | xua_cli_close_and_reconnect (struct osmo_stream_cli *cli)
static int | xua_srv_conn_closed_cb (struct osmo_stream_srv *srv)
static int | xua_accept_cb (struct osmo_stream_srv_link *link, int fd)
int | osmo_ss7_asp_send (struct osmo_ss7_asp *asp, struct msgb *msg)
| send a fully encoded msgb via a given ASP
void | osmo_ss7_asp_disconnect (struct osmo_ss7_asp *asp)
struct osmo_xua_server * | osmo_ss7_xua_server_find (struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port)
struct osmo_xua_server * | osmo_ss7_xua_server_create (struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port, const char *local_host)
| create a new xUA server configured with given ip/port
int | osmo_ss7_xua_server_bind (struct osmo_xua_server *xs)
| Set the xUA server to bind/listen to the currently configured ip/port.
int | osmo_ss7_xua_server_set_local_host (struct osmo_xua_server *xs, const char *local_host)
int | osmo_ss7_xua_server_set_local_hosts (struct osmo_xua_server *xs, const char **local_hosts, size_t local_host_cnt)
int | osmo_ss7_xua_server_add_local_host (struct osmo_xua_server *xs, const char *local_host)
bool | osmo_ss7_xua_server_set_default_local_hosts (struct osmo_xua_server *oxs)
void | osmo_ss7_xua_server_destroy (struct osmo_xua_server *xs)
bool | osmo_ss7_pc_is_local (struct osmo_ss7_instance *inst, uint32_t pc)
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)
bool | osmo_ss7_as_tmode_compatible_xua (struct osmo_ss7_as *as, uint32_t m3ua_tmt)
int | ss7_asp_rx_unknown (struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
int | osmo_ss7_asp_get_log_subsys (const struct osmo_ss7_asp *asp)
| Get the logging subsystem for a given ASP.
void | osmo_ss7_register_rx_unknown_cb (osmo_ss7_asp_rx_unknown_cb *cb)
| Register a call-back function for unknown SCTP PPID / IPA Stream ID.

## Variables

static bool | ss7_initialized = false
static int32_t | next_rctx = 1
static int32_t | next_l_rk_id = 1
const struct value_string | mtp_unavail_cause_vals []
struct value_string | osmo_ss7_as_traffic_mode_vals []
struct value_string | osmo_ss7_asp_protocol_vals []
const struct value_string | osmo_ss7_asp_role_names []
static const struct osmo_ss7_pc_fmt | default_pc_fmt
static const uint16_t | prot2port []
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
static const struct rate_ctr_desc | ss7_asp_rcd []
static const struct rate_ctr_group_desc | ss7_asp_rcgd
static unsigned int | g_ss7_asp_rcg_idx
static osmo_ss7_asp_rx_unknown_cb * | g_osmo_ss7_asp_rx_unknown_cb

## Macro Definition Documentation

## MAX_PC_STR_LEN

#define MAX_PC_STR_LEN 32

## Enumeration Type Documentation

## ss7_asp_ctr

enum ss7_asp_ctr

Enumerator
SS7_ASP_CTR_PKT_RX_TOTAL |
SS7_ASP_CTR_PKT_RX_UNKNOWN |
SS7_ASP_CTR_PKT_TX_TOTAL |

## Function Documentation

## asp_proto_to_ip_proto()

static int asp_proto_to_ip_proto | ( | enum osmo_ss7_asp_protocol | proto | ) |

static

References OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, and OSMO_SS7_ASP_PROT_SUA.

Referenced by osmo_ss7_asp_restart(), and osmo_ss7_xua_server_create().

## chop_v4_mapped_on_v6_prefix()

static void chop_v4_mapped_on_v6_prefix | ( | char * | buf | ) |

static

References len.

Referenced by osmo_ss7_asp_find_by_socket_addr().

## count_leading_one_bits()

static unsigned int count_leading_one_bits | ( | uint32_t | inp,
|  | unsigned int | nbits
| ) |  |

static

Referenced by u32_masklen().

## find_free_l_rk_id()

static uint32_t find_free_l_rk_id | ( | struct osmo_ss7_instance * | inst | ) |

static

References next_l_rk_id, and osmo_ss7_as_find_by_l_rk_id().

Referenced by osmo_ss7_as_find_or_create().

## gen_pc_fmtstr()

static const char * gen_pc_fmtstr | ( | const struct osmo_ss7_pc_fmt * | pc_fmt,
|  | unsigned int * | num_comp_exp
| ) |  |

static

References osmo_ss7_pc_fmt::component_len, osmo_ss7_pc_fmt::delimiter, MAX_PC_STR_LEN, and strnappendchar().

Referenced by osmo_ss7_pointcode_parse(), and osmo_ss7_pointcode_print_buf().

## get_in_port()

static uint16_t get_in_port | ( | struct sockaddr * | sa | ) |

static

Referenced by osmo_ss7_asp_find_by_socket_addr().

## get_logevel_by_sn_type()

static int get_logevel_by_sn_type | ( | int | sn_type | ) |

static

Referenced by log_sctp_notification().

## get_pc_comp_shift()

static unsigned int get_pc_comp_shift | ( | const struct osmo_ss7_pc_fmt * | pc_fmt,
|  | unsigned int | comp_num
| ) |  |

static

References osmo_ss7_pc_fmt::component_len, and osmo_ss7_pc_width().

Referenced by osmo_ss7_pointcode_parse(), and pc_comp_shift_and_mask().

## host_is_ip_anyaddr()

static bool host_is_ip_anyaddr | ( | const char * | host,
|  | bool | is_v6
| ) |  |

inline static

Referenced by osmo_ss7_asp_find_by_socket_addr(), and osmo_ss7_asp_peer_add_host().

## ipa_cli_read_cb()

static int ipa_cli_read_cb | ( | struct osmo_stream_cli * | conn | ) |

static

References osmo_ss7_asp::ctrg, ipa_rx_msg(), LOGPASP, osmo_ss7_asp::pending_msg, SS7_ASP_CTR_PKT_RX_TOTAL, and xua_cli_close_and_reconnect().

Referenced by osmo_ss7_asp_restart().

## ipa_srv_conn_cb()

static int ipa_srv_conn_cb | ( | struct osmo_stream_srv * | conn | ) |

static

References ipa_rx_msg(), LOGPASP, and osmo_ss7_asp::pending_msg.

Referenced by xua_accept_cb().

## ipv6_sctp_supported()

static bool ipv6_sctp_supported | ( | const char * | host,
|  | bool | bind
| ) |  |

static

Referenced by osmo_ss7_asp_set_default_peer_hosts(), and osmo_ss7_xua_server_set_default_local_hosts().

## LLIST_HEAD()

LLIST_HEAD | ( | osmo_ss7_instances |  | ) |

## log_sctp_notification()

static void log_sctp_notification | ( | struct osmo_ss7_asp * | asp,
|  | const char * | pfx,
|  | union sctp_notification * | notif
| ) |  |

static

References get_logevel_by_sn_type(), and LOGPASP.

Referenced by xua_cli_read_cb(), and xua_srv_conn_cb().

## num_pc_comp_exp()

static unsigned int num_pc_comp_exp | ( | const struct osmo_ss7_pc_fmt * | pc_fmt | ) |

static

References osmo_ss7_pc_fmt::component_len.

Referenced by osmo_ss7_pointcode_parse(), and osmo_ss7_pointcode_print_buf().

## 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] | as | Application Server.

Returns
  true in case as is active; false otherwise.

References osmo_ss7_route::as, 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] | as | Application Server to which asp is added
  [in] | asp | Application 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_as::inst, LOGPAS, osmo_ss7_asp::name, osmo_ss7_as_has_asp(), osmo_ss7_asp_find_by_name(), and ss7_initialized.

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] | as | Application Server from which asp is deleted
  [in] | asp | Application 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()

void osmo_ss7_as_destroy | ( | struct osmo_ss7_as * | as | ) |

Destroy given Application Server.

Parameters

  [in] | as | Application Server to destroy

References osmo_ss7_route::as, osmo_ss7_as::ctrg, osmo_ss7_route::dest, osmo_ss7_as::fi, osmo_ss7_as::inst, osmo_ss7_route::list, osmo_ss7_as::list, LOGPAS, osmo_ss7_route_destroy(), osmo_ss7_route_table::routes, osmo_ss7_instance::rtable_system, and ss7_initialized.

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

## osmo_ss7_as_find_by_l_rk_id()

struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id | ( | struct osmo_ss7_instance * | inst,
|  | uint32_t | l_rk_id
| ) |  |

Find Application Server by given local routing key ID.

Parameters

  [in] | inst | SS7 Instance on which we operate
  [in] | l_rk_id | Local Routing Key ID

Returns
  pointer to Application Server on success; NULL otherwise

References osmo_ss7_instance::as_list, osmo_ss7_as::cfg, osmo_ss7_as::inst, osmo_ss7_routing_key::l_rk_id, osmo_ss7_as::list, osmo_ss7_as::routing_key, and ss7_initialized.

Referenced by find_free_l_rk_id(), and handle_reg_conf().

## osmo_ss7_as_find_by_name()

struct osmo_ss7_as * osmo_ss7_as_find_by_name | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name
| ) |  |

Find Application Server by given name.

Parameters

  [in] | inst | SS7 Instance on which we operate
  [in] | name | Name of AS

Returns
  pointer to Application Server on success; NULL otherwise

References osmo_ss7_instance::as_list, osmo_ss7_as::cfg, osmo_ss7_as::inst, osmo_ss7_as::list, osmo_ss7_as::name, and ss7_initialized.

Referenced by DEFUN_ATTR(), ipa_asp_fsm_wait_id_resp(), osmo_ss7_as_find_or_create(), and osmo_ss7_route_create().

## osmo_ss7_as_find_by_proto()

struct osmo_ss7_as * osmo_ss7_as_find_by_proto | ( | struct osmo_ss7_instance * | inst,
|  | enum osmo_ss7_asp_protocol | proto
| ) |  |

Find Application Server (AS) by given protocol.

Parameters

  [in] | inst | SS7 Instance on which we operate
  [in] | proto | Protocol identifier that must match

Returns
  pointer to AS on success; NULL otherwise If an AS has an ASP also matching the given protocol, that AS is preferred. If there are multiple matches, return the first matching AS.

References osmo_ss7_instance::as_list, osmo_ss7_as::cfg, osmo_ss7_as::inst, osmo_ss7_as::list, osmo_ss7_asp_find_by_proto(), osmo_ss7_as::proto, and ss7_initialized.

Referenced by osmo_sccp_simple_client_on_ss7_id().

## osmo_ss7_as_find_by_rctx()

struct osmo_ss7_as * osmo_ss7_as_find_by_rctx | ( | struct osmo_ss7_instance * | inst,
|  | uint32_t | rctx
| ) |  |

Find Application Server by given routing context.

Parameters

  [in] | inst | SS7 Instance on which we operate
  [in] | rctx | Routing Context

Returns
  pointer to Application Server on success; NULL otherwise

References osmo_ss7_instance::as_list, osmo_ss7_as::cfg, osmo_ss7_routing_key::context, osmo_ss7_as::inst, osmo_ss7_as::list, osmo_ss7_as::routing_key, and ss7_initialized.

Referenced by handle_rkey_dereg(), handle_rkey_reg(), osmo_ss7_find_free_rctx(), xua_asp_fsm_inactive(), and xua_find_as_for_asp().

## osmo_ss7_as_find_or_create()

struct osmo_ss7_as * osmo_ss7_as_find_or_create | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | enum osmo_ss7_asp_protocol | proto
| ) |  |

Find or Create Application Server.

Parameters

  [in] | inst | SS7 Instance on which we operate
  [in] | name | Name of Application Server
  [in] | proto | Protocol 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, find_free_l_rk_id(), g_ss7_as_rcg_idx, osmo_ss7_as::inst, osmo_ss7_routing_key::l_rk_id, osmo_ss7_as::list, LOGPAS, osmo_ss7_as::mode, osmo_ss7_as::name, osmo_ss7_as_find_by_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_initialized, and xua_as_fsm_start().

Referenced by DEFUN_ATTR(), handle_rkey_reg(), osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_add_clnt().

## 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] | as | Application Server in which to look for asp
  [in] | asp | Application Server Process to look for in as

Returns
  true in case asp is part of as; false otherwise

References osmo_ss7_route::as, osmo_ss7_as::asps, osmo_ss7_as::cfg, and ss7_initialized.

Referenced by determine_traf_mode(), dispatch_to_all_as(), find_as_for_asp(), find_single_as_for_asp(), get_all_rctx_for_asp(), handle_rkey_dereg(), 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().

## osmo_ss7_as_tmode_compatible_xua()

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

## osmo_ss7_asp_active()

bool osmo_ss7_asp_active | ( | const struct osmo_ss7_asp * | asp | ) |

References osmo_ss7_asp::fi, and XUA_ASP_S_ACTIVE.

Referenced by notify_any_other_active_asp_as_inactive(), sua_snm_ssn_available(), xua_as_select_asp_override(), xua_as_select_asp_roundrobin(), xua_as_transmit_msg_broadcast(), xua_snm_pc_available(), xua_snm_scon(), and xua_snm_upu().

## osmo_ss7_asp_destroy()

void osmo_ss7_asp_destroy | ( | struct osmo_ss7_asp * | asp | ) |

References osmo_ss7_instance::as_list, osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::client, osmo_ss7_asp::ctrg, osmo_ss7_asp::fi, osmo_ss7_asp::inst, osmo_ss7_as::list, osmo_ss7_asp::list, LOGPASP, osmo_ss7_asp::server, osmo_ss7_asp::siblings, ss7_initialized, and osmo_ss7_asp::xua_server.

Referenced by DEFUN_ATTR(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), osmo_ss7_instance_destroy(), osmo_ss7_xua_server_destroy(), and xua_srv_conn_closed_cb().

## osmo_ss7_asp_disconnect()

void osmo_ss7_asp_disconnect | ( | struct osmo_ss7_asp * | asp | ) |

References osmo_ss7_asp::client, osmo_ss7_asp::server, and xua_cli_close_and_reconnect().

Referenced by ipa_asp_fsm_timer_cb(), ipa_asp_fsm_wait_id_resp(), and ipa_pong_timer_cb().

## osmo_ss7_asp_find()

struct osmo_ss7_asp * osmo_ss7_asp_find | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | uint16_t | remote_port,
|  | uint16_t | local_port,
|  | enum osmo_ss7_asp_protocol | proto
| ) |  |

References osmo_ss7_asp::cfg, osmo_ss7_asp::inst, osmo_ss7_asp::local, osmo_ss7_asp::name, osmo_ss7_asp_find_by_name(), osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, and ss7_initialized.

Referenced by DEFUN_ATTR().

## osmo_ss7_asp_find_by_name()

struct osmo_ss7_asp * osmo_ss7_asp_find_by_name | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name
| ) |  |

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, osmo_ss7_asp::inst, osmo_ss7_asp::list, osmo_ss7_asp::name, and ss7_initialized.

Referenced by DEFUN_ATTR(), osmo_ss7_as_add_asp(), osmo_ss7_as_del_asp(), osmo_ss7_asp_find(), and osmo_ss7_asp_find_or_create().

## osmo_ss7_asp_find_by_proto()

struct osmo_ss7_asp * osmo_ss7_asp_find_by_proto | ( | struct osmo_ss7_as * | as,
|  | enum osmo_ss7_asp_protocol | proto
| ) |  |

Find an ASP that matches the given protocol.

Parameters

  [in] | as | Application Server in which to look for asp

Returns
  SS7 ASP in case a matching one is found; NULL otherwise

References osmo_ss7_as::asps, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, and osmo_ss7_asp::proto.

Referenced by osmo_sccp_simple_client_on_ss7_id(), and osmo_ss7_as_find_by_proto().

## osmo_ss7_asp_find_by_socket_addr()

static struct osmo_ss7_asp * osmo_ss7_asp_find_by_socket_addr | ( | int | fd | ) |

static

Find an ASP definition matching the local+remote IP/PORT of given fd.

Parameters

  [in] | fd | socket descriptor of given socket

Returns
  SS7 ASP in case a matching one is found; NULL otherwise

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, chop_v4_mapped_on_v6_prefix(), get_in_port(), osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, host_is_ip_anyaddr(), osmo_ss7_asp::inst, osmo_ss7_asp::list, osmo_ss7_asp::local, osmo_ss7_instances, osmo_ss7_asp_peer::port, osmo_ss7_asp::remote, and ss7_initialized.

Referenced by xua_accept_cb().

## osmo_ss7_asp_find_or_create()

struct osmo_ss7_asp * osmo_ss7_asp_find_or_create | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | uint16_t | remote_port,
|  | uint16_t | local_port,
|  | enum osmo_ss7_asp_protocol | proto
| ) |  |

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, osmo_ss7_asp::ctrg, g_ss7_asp_rcg_idx, osmo_ss7_asp::inst, osmo_ss7_asp::list, osmo_ss7_asp::local, osmo_ss7_asp::name, osmo_ss7_asp_find_by_name(), OSMO_SS7_ASP_PROT_SUA, osmo_ss7_ensure_sccp(), osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, ss7_asp_rcgd, and ss7_initialized.

Referenced by DEFUN_ATTR(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), and xua_accept_cb().

## osmo_ss7_asp_get_log_subsys()

int osmo_ss7_asp_get_log_subsys | ( | const struct osmo_ss7_asp * | asp | ) |

Get the logging subsystem for a given ASP.

Used by generic code.

References osmo_ss7_asp::cfg, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, and osmo_ss7_asp::proto.

Referenced by xua_find_as_for_asp(), xua_snm_rx_daud(), xua_snm_rx_dava(), xua_snm_rx_duna(), xua_snm_rx_dupu(), and xua_snm_rx_scon().

## osmo_ss7_asp_peer_add_host()

int osmo_ss7_asp_peer_add_host | ( | struct osmo_ss7_asp_peer * | peer,
|  | void * | talloc_ctx,
|  | const char * | host
| ) |  |

Append (copy) address to a given ASP peer.

Previous addresses are kept.

Parameters

  [in] | peer | Application Server Process peer the address is appended to.
  [in] | talloc_ctx | talloc context used to allocate new address.
  [in] | host | string containing an IP addresses.

Returns
  0 on success; negative otherwise

References osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, and host_is_ip_anyaddr().

Referenced by DEFUN_ATTR(), DEFUN_ATTR(), osmo_sccp_simple_server_add_clnt(), osmo_ss7_asp_set_default_peer_hosts(), and osmo_ss7_xua_server_add_local_host().

## osmo_ss7_asp_peer_set_hosts()

int osmo_ss7_asp_peer_set_hosts | ( | struct osmo_ss7_asp_peer * | peer,
|  | void * | talloc_ctx,
|  | const char *const * | hosts,
|  | size_t | host_cnt
| ) |  |

Set (copy) addresses for a given ASP peer.

Previous addresses are freed.

Parameters

  [in] | peer | Application Server Process peer whose addresses are to be set.
  [in] | talloc_ctx | talloc context used to allocate new addresses.
  [in] | hosts | Array of strings containing IP addresses.
  [in] | host_cnt | Number of strings in hosts

Returns
  0 on success; negative otherwise

References osmo_ss7_asp_peer::host, and osmo_ss7_asp_peer::host_cnt.

Referenced by osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), osmo_ss7_xua_server_set_local_hosts(), and xua_accept_cb().

## osmo_ss7_asp_peer_snprintf()

int osmo_ss7_asp_peer_snprintf | ( | char * | buf,
|  | size_t | buf_len,
|  | struct osmo_ss7_asp_peer * | peer
| ) |  |

References osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, len, and osmo_ss7_asp_peer::port.

Referenced by DEFUN(), osmo_ss7_asp_restart(), osmo_ss7_xua_server_bind(), and vty_dump_xua_server().

## osmo_ss7_asp_protocol_port()

int osmo_ss7_asp_protocol_port | ( | enum osmo_ss7_asp_protocol | prot | ) |

References prot2port.

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

## osmo_ss7_asp_restart()

int osmo_ss7_asp_restart | ( | struct osmo_ss7_asp * | asp | ) |

References asp_proto_to_ip_proto(), osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp::fi, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, ipa_cli_read_cb(), osmo_ss7_asp::is_server, osmo_ss7_asp::local, LOGPASP, osmo_ss7_asp::name, osmo_ss7_asp_peer_snprintf(), OSMO_SS7_ASP_PROT_IPA, osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, osmo_ss7_asp::role, osmo_ss7_asp::server, ss7_initialized, xua_asp_fsm_start(), xua_cli_connect_cb(), and xua_cli_read_cb().

Referenced by osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), osmo_ss7_vty_go_parent(), restart_asp(), and xua_accept_cb().

## osmo_ss7_asp_send()

int osmo_ss7_asp_send | ( | struct osmo_ss7_asp * | asp,
|  | struct msgb * | msg
| ) |  |

send a fully encoded msgb via a given ASP

Parameters

  [in] | asp | Application Server Process through which to send
  [in] | msg | message buffer to transmit. Ownership transferred.

Returns
  0 on success; negative in case of error

References osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp::ctrg, osmo_ss7_asp::is_server, LOGPASP, M3UA_PPID, OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp::proto, osmo_ss7_asp::server, SS7_ASP_CTR_PKT_TX_TOTAL, ss7_initialized, and SUA_PPID.

Referenced by as_notify_all_asp(), ipa_asp_fsm_wait_id_get(), m3ua_rx_rkm_dereg_req(), m3ua_rx_rkm_reg_req(), m3ua_tx_xua_asp(), notify_any_other_active_asp_as_inactive(), peer_send(), peer_send_error(), sua_tx_xua_asp(), xua_as_transmit_msg(), xua_as_transmit_msg_broadcast(), xua_rkm_send_dereg_req(), and xua_rkm_send_reg_req().

## osmo_ss7_asp_set_default_peer_hosts()

bool osmo_ss7_asp_set_default_peer_hosts | ( | struct osmo_ss7_asp * | asp | ) |

References osmo_ss7_asp::cfg, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, ipv6_sctp_supported(), osmo_ss7_asp::local, osmo_ss7_asp_peer_add_host(), and osmo_ss7_asp::remote.

Referenced by osmo_sccp_simple_client_on_ss7_id(), and osmo_ss7_vty_go_parent().

## osmo_ss7_ensure_sccp()

struct osmo_sccp_instance * osmo_ss7_ensure_sccp | ( | struct osmo_ss7_instance * | inst | ) |

Allocate an SCCP instance, if not present yet.

Returns
  inst->sccp.

References LOGSS7, osmo_sccp_instance_create(), and osmo_ss7_instance::sccp.

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

## osmo_ss7_find_free_rctx()

int osmo_ss7_find_free_rctx | ( | struct osmo_ss7_instance * | inst | ) |

References next_rctx, and osmo_ss7_as_find_by_rctx().

Referenced by handle_rkey_reg().

## osmo_ss7_init()

int osmo_ss7_init | ( | void |  | ) |

References ipa_asp_fsm, sccp_scoc_fsm, ss7_initialized, xua_as_fsm, xua_asp_fsm, and xua_default_lm_fsm.

## osmo_ss7_instance_destroy()

void osmo_ss7_instance_destroy | ( | struct osmo_ss7_instance * | inst | ) |

Destroy a SS7 Instance.

Parameters

  [in] | inst | SS7 Instance to be destroyed

References osmo_ss7_instance::as_list, osmo_ss7_instance::asp_list, osmo_ss7_asp::inst, osmo_ss7_instance::linksets, osmo_ss7_instance::list, osmo_ss7_asp::list, LOGSS7, osmo_ss7_as_destroy(), osmo_ss7_asp_destroy(), osmo_ss7_linkset_destroy(), and ss7_initialized.

Referenced by osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_on_ss7_id().

## osmo_ss7_instance_find()

struct osmo_ss7_instance * osmo_ss7_instance_find | ( | uint32_t | id | ) |

Find a SS7 Instance with given ID.

Parameters

  [in] | id | ID 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(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), osmo_sccp_simple_client_on_ss7_id(), and osmo_ss7_instance_find_or_create().

## 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] | ctx | talloc allocation context to use for allocations
  [in] | id | ID of SS7 Instance

Returns
  osmo_ss7_instance on success; NULL on error

References osmo_ss7_instance::as_list, osmo_ss7_instance::asp_list, osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::component_len, osmo_ss7_pc_fmt::delimiter, osmo_ss7_instance::id, osmo_ss7_instance::linksets, osmo_ss7_instance::list, LOGSS7, osmo_ss7_instance_find(), osmo_ss7_instances, OSMO_SS7_PC_INVALID, osmo_ss7_route_table_find_or_create(), osmo_ss7_instance::pc_fmt, osmo_ss7_instance::primary_pc, osmo_ss7_instance::rtable_list, osmo_ss7_instance::rtable_system, osmo_ss7_instance::sccp_address_book, ss7_initialized, and osmo_ss7_instance::xua_servers.

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

## osmo_ss7_instance_set_pc_fmt()

int osmo_ss7_instance_set_pc_fmt | ( | struct osmo_ss7_instance * | inst,
|  | uint8_t | c0,
|  | uint8_t | c1,
|  | uint8_t | c2
| ) |  |

Set the point code format used in given SS7 instance.

References osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::component_len, osmo_ss7_asp::inst, LOGSS7, and osmo_ss7_instance::pc_fmt.

## osmo_ss7_link_destroy()

void osmo_ss7_link_destroy | ( | struct osmo_ss7_link * | link | ) |

Destroy SS7 Link.

Parameters

  [in] | link | SS7 Link to be destroyed

References osmo_ss7_link::cfg, osmo_ss7_linkset::cfg, osmo_ss7_link::id, osmo_ss7_linkset::inst, osmo_ss7_linkset::links, osmo_ss7_link::linkset, LOGSS7, osmo_ss7_linkset::name, and ss7_initialized.

Referenced by osmo_ss7_linkset_destroy().

## osmo_ss7_link_find_or_create()

struct osmo_ss7_link * osmo_ss7_link_find_or_create | ( | struct osmo_ss7_linkset * | lset,
|  | uint32_t | id
| ) |  |

Find or create SS7 Link with given ID in given Linkset.

Parameters

  [in] | lset | SS7 Linkset on which we operate
  [in] | id | Link number within Linkset

Returns
  pointer to SS7 Link on success; NULL on error

References osmo_ss7_link::cfg, osmo_ss7_linkset::cfg, osmo_ss7_link::id, osmo_ss7_linkset::inst, osmo_ss7_linkset::links, osmo_ss7_link::linkset, LOGSS7, osmo_ss7_linkset::name, and ss7_initialized.

## osmo_ss7_linkset_destroy()

void osmo_ss7_linkset_destroy | ( | struct osmo_ss7_linkset * | lset | ) |

Destroy a SS7 Linkset.

Parameters

  [in] | lset | Linkset to be destroyed

References osmo_ss7_linkset::cfg, osmo_ss7_route::dest, osmo_ss7_linkset::inst, osmo_ss7_linkset::links, osmo_ss7_route::linkset, osmo_ss7_linkset::list, osmo_ss7_route::list, LOGSS7, osmo_ss7_linkset::name, osmo_ss7_link_destroy(), osmo_ss7_route_destroy(), osmo_ss7_route_table::routes, osmo_ss7_instance::rtable_system, and ss7_initialized.

Referenced by osmo_ss7_instance_destroy().

## osmo_ss7_linkset_find_by_name()

struct osmo_ss7_linkset * osmo_ss7_linkset_find_by_name | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name
| ) |  |

Find SS7 Linkset by given name.

Parameters

  [in] | inst | SS7 Instance in which to look
  [in] | name | Name of SS7 Linkset

Returns
  pointer to linkset on success; NULL on error

References osmo_ss7_linkset::cfg, osmo_ss7_linkset::inst, osmo_ss7_instance::linksets, osmo_ss7_linkset::list, osmo_ss7_linkset::name, and ss7_initialized.

Referenced by osmo_ss7_linkset_find_or_create(), and osmo_ss7_route_create().

## osmo_ss7_linkset_find_or_create()

struct osmo_ss7_linkset * osmo_ss7_linkset_find_or_create | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | uint32_t | pc
| ) |  |

Find or allocate SS7 Linkset.

Parameters

  [in] | inst | SS7 Instance in which we operate
  [in] | name | Name of SS7 Linkset
  [in] | pc | Adjacent Pointcode

Returns
  pointer to Linkset on success; NULL on error

References osmo_ss7_linkset::adjacent_pc, osmo_ss7_linkset::cfg, osmo_ss7_linkset::inst, osmo_ss7_instance::linksets, osmo_ss7_linkset::list, LOGSS7, osmo_ss7_linkset::name, osmo_ss7_linkset_find_by_name(), and ss7_initialized.

## osmo_ss7_mtp_to_user()

int osmo_ss7_mtp_to_user | ( | struct osmo_ss7_instance * | inst,
|  | struct osmo_mtp_prim * | omp
| ) |  |

References osmo_ss7_user::inst, MTP_SAP_USER, osmo_ss7_user::name, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_ss7_user::prim_cb, osmo_ss7_user::priv, osmo_mtp_transfer_param::sio, osmo_mtp_prim::transfer, osmo_mtp_prim::u, and osmo_ss7_instance::user.

## osmo_ss7_pc_is_local()

bool osmo_ss7_pc_is_local | ( | struct osmo_ss7_instance * | inst,
|  | uint32_t | pc
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_asp::inst, osmo_ss7_pc_is_valid(), osmo_ss7_instance::primary_pc, and ss7_initialized.

Referenced by m3ua_hmdc_rx_from_l2(), sccp_sclc_rx_scrc_rout_fail(), scrc_local_out_common(), and scrc_translate_node_9().

## osmo_ss7_pc_normalize()

uint32_t osmo_ss7_pc_normalize | ( | const struct osmo_ss7_pc_fmt * | pc_fmt,
|  | uint32_t | pc
| ) |  |

References osmo_ss7_pc_width().

Referenced by osmo_ss7_route_create(), osmo_ss7_route_find_dpc(), and osmo_ss7_route_find_dpc_mask().

## osmo_ss7_pc_width()

uint8_t osmo_ss7_pc_width | ( | const struct osmo_ss7_pc_fmt * | pc_fmt | ) |

References osmo_ss7_pc_fmt::component_len.

Referenced by get_pc_comp_shift(), osmo_ss7_pc_normalize(), osmo_ss7_pointcode_parse_mask_or_len(), and osmo_ss7_route_print().

## osmo_ss7_pointcode_parse()

int osmo_ss7_pointcode_parse | ( | struct osmo_ss7_instance * | inst,
|  | const char * | str
| ) |  |

References osmo_ss7_instance::cfg, osmo_ss7_pc_fmt::component_len, default_pc_fmt, gen_pc_fmtstr(), get_pc_comp_shift(), LOGSS7, num_pc_comp_exp(), and osmo_ss7_instance::pc_fmt.

Referenced by _rout_key(), DEFUN_ATTR(), DEFUN_ATTR(), DEFUN_ATTR(), DEFUN_ATTR(), DEFUN_ATTR(), and osmo_ss7_pointcode_parse_mask_or_len().

## osmo_ss7_pointcode_parse_mask_or_len()

int osmo_ss7_pointcode_parse_mask_or_len | ( | struct osmo_ss7_instance * | inst,
|  | const char * | in
| ) |  |

References osmo_ss7_instance::cfg, default_pc_fmt, osmo_ss7_pc_width(), osmo_ss7_pointcode_parse(), and osmo_ss7_instance::pc_fmt.

Referenced by DEFUN_ATTR(), and DEFUN_ATTR().

## osmo_ss7_pointcode_print()

const char * osmo_ss7_pointcode_print | ( | const struct osmo_ss7_instance * | inst,
|  | uint32_t | pc
| ) |  |

References MAX_PC_STR_LEN, and osmo_ss7_pointcode_print_buf().

Referenced by DEFUN(), DEFUN(), format_affected_pcs_c(), handle_rkey_dereg(), handle_rkey_reg(), hmrt_message_for_routing(), ipa_del_route(), m3ua_hmdc_rx_from_l2(), m3ua_rx_xfer(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_user_unbind(), osmo_ss7_route_create(), osmo_ss7_route_destroy(), osmo_ss7_route_name(), osmo_ss7_route_print(), sccp_addr_to_str_buf(), sccp_scoc_rx_inval_opc(), sccp_user_bind_pc(), scrc_node_6(), show_user(), vty_show_connection(), write_one_as(), write_one_cs7(), write_one_rtable(), write_sccp_addressbook(), and xua_snm_rx_dupu().

## osmo_ss7_pointcode_print2()

const char * osmo_ss7_pointcode_print2 | ( | const struct osmo_ss7_instance * | inst,
|  | uint32_t | pc
| ) |  |

References MAX_PC_STR_LEN, and osmo_ss7_pointcode_print_buf().

Referenced by m3ua_rx_xfer(), osmo_ss7_route_name(), osmo_ss7_route_print(), sccp_scoc_rx_inval_opc(), and write_one_rtable().

## osmo_ss7_pointcode_print_buf()

const char * osmo_ss7_pointcode_print_buf | ( | char * | buf,
|  | size_t | len,
|  | const struct osmo_ss7_instance * | inst,
|  | uint32_t | pc
| ) |  |

References osmo_ss7_instance::cfg, default_pc_fmt, gen_pc_fmtstr(), len, num_pc_comp_exp(), osmo_ss7_pc_is_valid(), pc_comp_shift_and_mask(), and osmo_ss7_instance::pc_fmt.

Referenced by osmo_ss7_pointcode_print(), and osmo_ss7_pointcode_print2().

## osmo_ss7_register_rx_unknown_cb()

void osmo_ss7_register_rx_unknown_cb | ( | osmo_ss7_asp_rx_unknown_cb * | cb | ) |

Register a call-back function for unknown SCTP PPID / IPA Stream ID.

References g_osmo_ss7_asp_rx_unknown_cb.

## osmo_ss7_route_create()

struct osmo_ss7_route * osmo_ss7_route_create | ( | struct osmo_ss7_route_table * | rtbl,
|  | uint32_t | pc,
|  | uint32_t | mask,
|  | const char * | linkset_name
| ) |  |

Create a new route in the given routing table.

Parameters

  [in] | rtbl | Routing Table in which the route is to be created
  [in] | pc | Point Code of the destination of the route
  [in] | mask | Mask of the destination Point Code pc
  [in] | linkset_name | string name of the linkset to be used

Returns
  caller-allocated + initialized route, NULL on error

References osmo_ss7_route::as, osmo_ss7_instance::cfg, osmo_ss7_linkset::cfg, osmo_ss7_route::cfg, osmo_ss7_as::cfg, osmo_ss7_route::dest, osmo_ss7_route_table::inst, osmo_ss7_route::linkset, osmo_ss7_route::linkset_name, LOGSS7, osmo_ss7_route::mask, osmo_ss7_linkset::name, osmo_ss7_as::name, osmo_ss7_as_find_by_name(), osmo_ss7_linkset_find_by_name(), osmo_ss7_pc_normalize(), osmo_ss7_pointcode_print(), osmo_ss7_route_find_dpc_mask(), osmo_ss7_route::pc, osmo_ss7_instance::pc_fmt, route_insert_sorted(), osmo_ss7_route::rtable, and ss7_initialized.

Referenced by _rout_key(), DEFUN_ATTR(), handle_rkey_reg(), ipa_add_route(), osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_add_clnt().

## osmo_ss7_route_destroy()

void osmo_ss7_route_destroy | ( | struct osmo_ss7_route * | rt | ) |

Destroy a given SS7 route.

References osmo_ss7_route::cfg, osmo_ss7_route_table::inst, osmo_ss7_route::linkset_name, osmo_ss7_route::list, LOGSS7, osmo_ss7_route::mask, osmo_ss7_pointcode_print(), osmo_ss7_route::pc, osmo_ss7_route::rtable, and ss7_initialized.

Referenced by _rout_key(), DEFUN_ATTR(), handle_rkey_dereg(), handle_rkey_reg(), ipa_del_route(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), osmo_ss7_as_destroy(), and osmo_ss7_linkset_destroy().

## osmo_ss7_route_find_dpc()

struct osmo_ss7_route * osmo_ss7_route_find_dpc | ( | struct osmo_ss7_route_table * | rtbl,
|  | uint32_t | dpc
| ) |  |

Find a SS7 route for given destination point code in given table.

References osmo_ss7_instance::cfg, osmo_ss7_route::cfg, dpc, osmo_ss7_route_table::inst, osmo_ss7_route::list, osmo_ss7_route::mask, osmo_ss7_pc_normalize(), osmo_ss7_route::pc, osmo_ss7_instance::pc_fmt, osmo_ss7_route_table::routes, and ss7_initialized.

Referenced by handle_rkey_dereg(), and osmo_ss7_route_lookup().

## osmo_ss7_route_find_dpc_mask()

struct osmo_ss7_route * osmo_ss7_route_find_dpc_mask | ( | struct osmo_ss7_route_table * | rtbl,
|  | uint32_t | dpc,
|  | uint32_t | mask
| ) |  |

Find a SS7 route for given destination point code + mask in given table.

References osmo_ss7_instance::cfg, osmo_ss7_route::cfg, dpc, osmo_ss7_route_table::inst, osmo_ss7_route::list, osmo_ss7_route::mask, osmo_ss7_pc_normalize(), osmo_ss7_route::pc, osmo_ss7_instance::pc_fmt, osmo_ss7_route_table::routes, and ss7_initialized.

Referenced by _rout_key(), DEFUN_ATTR(), ipa_add_route(), ipa_del_route(), osmo_sccp_simple_client_on_ss7_id(), and osmo_ss7_route_create().

## osmo_ss7_route_lookup()

struct osmo_ss7_route * osmo_ss7_route_lookup | ( | struct osmo_ss7_instance * | inst,
|  | uint32_t | dpc
| ) |  |

Find a SS7 route for given destination point code in given SS7.

References dpc, osmo_ss7_route_find_dpc(), osmo_ss7_instance::rtable_system, and ss7_initialized.

Referenced by gen_mtp_transfer_req_xua(), hmrt_message_for_routing(), and xua_snm_rx_daud().

## osmo_ss7_route_print()

const char * osmo_ss7_route_print | ( | const struct osmo_ss7_route * | rt | ) |

References osmo_ss7_instance::cfg, osmo_ss7_route::cfg, osmo_ss7_route_table::inst, osmo_ss7_route::mask, osmo_ss7_pc_width(), osmo_ss7_pointcode_print(), osmo_ss7_pointcode_print2(), osmo_ss7_route::pc, osmo_ss7_instance::pc_fmt, osmo_ss7_route::rtable, and u32_masklen().

Referenced by vty_dump_rtable().

## osmo_ss7_route_table_destroy()

void osmo_ss7_route_table_destroy | ( | struct osmo_ss7_route_table * | rtbl | ) |

References osmo_ss7_route_table::list.

## osmo_ss7_route_table_find()

struct osmo_ss7_route_table * osmo_ss7_route_table_find | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name
| ) |  |

References osmo_ss7_route_table::cfg, osmo_ss7_route_table::inst, osmo_ss7_route_table::list, osmo_ss7_route_table::name, osmo_ss7_instance::rtable_list, and ss7_initialized.

Referenced by osmo_ss7_route_table_find_or_create().

## osmo_ss7_route_table_find_or_create()

struct osmo_ss7_route_table * osmo_ss7_route_table_find_or_create | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name
| ) |  |

References osmo_ss7_route_table::cfg, osmo_ss7_route_table::inst, osmo_ss7_route_table::list, LOGSS7, osmo_ss7_route_table::name, osmo_ss7_route_table_find(), osmo_ss7_route_table::routes, osmo_ss7_instance::rtable_list, and ss7_initialized.

Referenced by osmo_ss7_instance_find_or_create().

## osmo_ss7_tmode_from_xua()

enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua | ( | uint32_t | in | ) |

References M3UA_TMOD_BCAST, M3UA_TMOD_LOADSHARE, M3UA_TMOD_OVERRIDE, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, and OSMO_SS7_AS_TMOD_OVERRIDE.

Referenced by handle_rkey_reg(), and xua_asp_fsm_inactive().

## osmo_ss7_tmode_to_xua()

int osmo_ss7_tmode_to_xua | ( | enum osmo_ss7_as_traffic_mode | tmod | ) |

References M3UA_TMOD_BCAST, M3UA_TMOD_LOADSHARE, M3UA_TMOD_OVERRIDE, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, and OSMO_SS7_AS_TMOD_OVERRIDE.

Referenced by peer_send(), and xua_rkm_send_reg_req().

## osmo_ss7_user_register()

int osmo_ss7_user_register | ( | struct osmo_ss7_instance * | inst,
|  | uint8_t | service_ind,
|  | struct osmo_ss7_user * | user
| ) |  |

Register a MTP user for a given service indicator.

Parameters

  [in] | inst | SS7 instance for which we register the user
  [in] | service_ind | Service (ISUP, SCCP, ...)
  [in] | user | SS7 user (including primitive call-back)

Returns
  0 on success; negative on error

References osmo_ss7_user::inst, osmo_ss7_user::name, osmo_ss7_user::priv, and osmo_ss7_instance::user.

Referenced by osmo_sccp_instance_create().

## osmo_ss7_user_unregister()

int osmo_ss7_user_unregister | ( | struct osmo_ss7_instance * | inst,
|  | uint8_t | service_ind,
|  | struct osmo_ss7_user * | user
| ) |  |

Unregister a MTP user for a given service indicator.

Parameters

  [in] | inst | SS7 instance for which we register the user
  [in] | service_ind | Service (ISUP, SCCP, ...)
  [in] | user | (optional) SS7 user. If present, we will not unregister other users

Returns
  0 on success; negative on error

References osmo_ss7_user::inst, and osmo_ss7_instance::user.

Referenced by osmo_sccp_instance_destroy().

## osmo_ss7_xua_server_add_local_host()

int osmo_ss7_xua_server_add_local_host | ( | struct osmo_xua_server * | xs,
|  | const char * | local_host
| ) |  |

References osmo_xua_server::cfg, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, osmo_xua_server::local, osmo_ss7_asp_peer_add_host(), and osmo_xua_server::server.

Referenced by DEFUN_ATTR().

## osmo_ss7_xua_server_bind()

int osmo_ss7_xua_server_bind | ( | struct osmo_xua_server * | xs | ) |

Set the xUA server to bind/listen to the currently configured ip/port.

Parameters

  [in] | xs | xUA server to operate

Returns
  0 on success, negative value on error.

References osmo_xua_server::cfg, osmo_xua_server::local, osmo_ss7_asp_peer_snprintf(), osmo_ss7_asp_protocol_vals, osmo_xua_server::proto, and osmo_xua_server::server.

Referenced by osmo_sccp_simple_server_on_ss7_id(), and osmo_ss7_vty_go_parent().

## osmo_ss7_xua_server_create()

struct osmo_xua_server * osmo_ss7_xua_server_create | ( | struct osmo_ss7_instance * | inst,
|  | enum osmo_ss7_asp_protocol | proto,
|  | uint16_t | local_port,
|  | const char * | local_host
| ) |  |

create a new xUA server configured with given ip/port

Parameters

  [in] | ctx | talloc allocation context
  [in] | proto | protocol (xUA variant) to use
  [in] | local_port | local SCTP port to bind/listen to
  [in] | local_host | local IP address to bind/listen to (optional)

Returns
  callee-allocated osmo_xua_server in case of success

References osmo_xua_server::asp_list, asp_proto_to_ip_proto(), osmo_xua_server::cfg, osmo_xua_server::inst, osmo_xua_server::list, osmo_xua_server::local, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp_protocol_vals, osmo_ss7_ensure_sccp(), osmo_ss7_xua_server_set_local_host(), osmo_ss7_asp_peer::port, osmo_xua_server::proto, osmo_xua_server::server, ss7_initialized, xua_accept_cb(), and osmo_ss7_instance::xua_servers.

Referenced by DEFUN_ATTR(), and osmo_sccp_simple_server_on_ss7_id().

## osmo_ss7_xua_server_destroy()

void osmo_ss7_xua_server_destroy | ( | struct osmo_xua_server * | xs | ) |

References osmo_xua_server::asp_list, osmo_xua_server::list, osmo_ss7_asp_destroy(), osmo_xua_server::server, and osmo_ss7_asp::siblings.

Referenced by DEFUN_ATTR(), and osmo_sccp_simple_server_on_ss7_id().

## osmo_ss7_xua_server_find()

struct osmo_xua_server * osmo_ss7_xua_server_find | ( | struct osmo_ss7_instance * | inst,
|  | enum osmo_ss7_asp_protocol | proto,
|  | uint16_t | local_port
| ) |  |

References osmo_xua_server::cfg, osmo_xua_server::inst, osmo_xua_server::list, osmo_xua_server::local, osmo_ss7_asp_peer::port, osmo_xua_server::proto, ss7_initialized, and osmo_ss7_instance::xua_servers.

Referenced by DEFUN(), DEFUN_ATTR(), DEFUN_ATTR(), and osmo_sccp_simple_server_add_clnt().

## osmo_ss7_xua_server_set_default_local_hosts()

bool osmo_ss7_xua_server_set_default_local_hosts | ( | struct osmo_xua_server * | oxs | ) |

References osmo_xua_server::cfg, osmo_ss7_asp_peer::host_cnt, ipv6_sctp_supported(), osmo_xua_server::local, and osmo_ss7_xua_server_set_local_host().

Referenced by osmo_ss7_vty_go_parent().

## osmo_ss7_xua_server_set_local_host()

int osmo_ss7_xua_server_set_local_host | ( | struct osmo_xua_server * | xs,
|  | const char * | local_host
| ) |  |

References osmo_ss7_xua_server_set_local_hosts().

Referenced by osmo_ss7_xua_server_create(), and osmo_ss7_xua_server_set_default_local_hosts().

## osmo_ss7_xua_server_set_local_hosts()

int osmo_ss7_xua_server_set_local_hosts | ( | struct osmo_xua_server * | xs,
|  | const char ** | local_hosts,
|  | size_t | local_host_cnt
| ) |  |

References osmo_xua_server::cfg, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, osmo_xua_server::local, osmo_ss7_asp_peer_set_hosts(), osmo_xua_server::server, and ss7_initialized.

Referenced by DEFUN_ATTR(), and osmo_ss7_xua_server_set_local_host().

## pc_comp_shift_and_mask()

static uint32_t pc_comp_shift_and_mask | ( | const struct osmo_ss7_pc_fmt * | pc_fmt,
|  | unsigned int | comp_num,
|  | uint32_t | pc
| ) |  |

static

References osmo_ss7_pc_fmt::component_len, and get_pc_comp_shift().

Referenced by osmo_ss7_pointcode_print_buf().

## route_insert_sorted()

static void route_insert_sorted | ( | struct osmo_ss7_route_table * | rtbl,
|  | struct osmo_ss7_route * | cmp
| ) |  |

static

References osmo_ss7_route::cfg, osmo_ss7_route::list, osmo_ss7_route::mask, and osmo_ss7_route_table::routes.

Referenced by osmo_ss7_route_create().

## ss7_asp_rx_unknown()

int ss7_asp_rx_unknown | ( | struct osmo_ss7_asp * | asp,
|  | int | ppid_mux,
|  | struct msgb * | msg
| ) |  |

References osmo_ss7_asp::cfg, osmo_ss7_asp::ctrg, g_osmo_ss7_asp_rx_unknown_cb, LOGPASP, OSMO_SS7_ASP_PROT_IPA, osmo_ss7_asp::proto, and SS7_ASP_CTR_PKT_RX_UNKNOWN.

Referenced by ipa_rx_msg(), xua_cli_read_cb(), and xua_srv_conn_cb().

## strnappendchar()

static int strnappendchar | ( | char * | str,
|  | char | c,
|  | size_t | n
| ) |  |

static

Referenced by gen_pc_fmtstr().

## u32_masklen()

static int u32_masklen | ( | uint32_t | mask,
|  | unsigned int | nbits
| ) |  |

static

References count_leading_one_bits().

Referenced by osmo_ss7_route_print().

## xua_accept_cb()

static int xua_accept_cb | ( | struct osmo_stream_srv_link * | link,
|  | int | fd
| ) |  |

static

References osmo_xua_server::accept_dyn_reg, osmo_xua_server::asp_list, osmo_ss7_asp::cfg, osmo_xua_server::cfg, osmo_ss7_asp::dyn_allocated, osmo_ss7_asp::fi, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, osmo_xua_server::inst, ipa_srv_conn_cb(), osmo_ss7_asp::is_server, osmo_ss7_asp::local, osmo_xua_server::local, LOGPASP, osmo_ss7_asp::name, osmo_ss7_asp_find_by_socket_addr(), osmo_ss7_asp_find_or_create(), osmo_ss7_asp_peer_set_hosts(), OSMO_SS7_ASP_PROT_IPA, osmo_ss7_asp_protocol_vals, osmo_ss7_asp_restart(), OSMO_SS7_ASP_ROLE_SG, OSMO_XLM_PRIM_M_SCTP_ESTABLISH, osmo_ss7_asp_peer::port, osmo_xua_server::proto, osmo_ss7_asp::remote, osmo_ss7_asp::role, osmo_ss7_asp::server, osmo_ss7_asp::siblings, osmo_ss7_asp::sock_name, XUA_ASP_E_SCTP_EST_IND, xua_asp_send_xlm_prim_simple(), osmo_ss7_asp::xua_server, xua_srv_conn_cb(), and xua_srv_conn_closed_cb().

Referenced by osmo_ss7_xua_server_create().

## xua_cli_close()

static void xua_cli_close | ( | struct osmo_stream_cli * | cli | ) |

static

References osmo_ss7_asp::fi, OSMO_XLM_PRIM_M_SCTP_RELEASE, XUA_ASP_E_SCTP_COMM_DOWN_IND, and xua_asp_send_xlm_prim_simple().

Referenced by xua_cli_close_and_reconnect().

## xua_cli_close_and_reconnect()

static void xua_cli_close_and_reconnect | ( | struct osmo_stream_cli * | cli | ) |

static

References xua_cli_close().

Referenced by ipa_cli_read_cb(), osmo_ss7_asp_disconnect(), and xua_cli_read_cb().

## xua_cli_connect_cb()

static int xua_cli_connect_cb | ( | struct osmo_stream_cli * | cli | ) |

static

References osmo_ss7_asp::fi, osmo_ss7_asp::lm, LOGPASP, OSMO_XLM_PRIM_M_SCTP_ESTABLISH, osmo_xua_layer_manager::prim_cb, osmo_ss7_asp::sock_name, XUA_ASP_E_M_ASP_UP_REQ, and xua_asp_send_xlm_prim_simple().

Referenced by osmo_ss7_asp_restart().

## xua_cli_read_cb()

static int xua_cli_read_cb | ( | struct osmo_stream_cli * | conn | ) |

static

References osmo_ss7_asp::cfg, osmo_ss7_asp::ctrg, log_sctp_notification(), LOGPASP, m3ua_msgb_alloc(), M3UA_PPID, m3ua_rx_msg(), OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, OSMO_XLM_PRIM_M_SCTP_RESTART, osmo_ss7_asp::proto, SS7_ASP_CTR_PKT_RX_TOTAL, ss7_asp_rx_unknown(), SUA_PPID, sua_rx_msg(), xua_asp_send_xlm_prim_simple(), and xua_cli_close_and_reconnect().

Referenced by osmo_ss7_asp_restart().

## xua_srv_conn_cb()

static int xua_srv_conn_cb | ( | struct osmo_stream_srv * | conn | ) |

static

References osmo_ss7_asp::cfg, osmo_ss7_asp::ctrg, log_sctp_notification(), LOGPASP, m3ua_msgb_alloc(), M3UA_PPID, m3ua_rx_msg(), OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, OSMO_XLM_PRIM_M_SCTP_RESTART, osmo_ss7_asp::proto, SS7_ASP_CTR_PKT_RX_TOTAL, ss7_asp_rx_unknown(), SUA_PPID, sua_rx_msg(), and xua_asp_send_xlm_prim_simple().

Referenced by xua_accept_cb().

## xua_srv_conn_closed_cb()

static int xua_srv_conn_closed_cb | ( | struct osmo_stream_srv * | srv | ) |

static

References osmo_ss7_asp::cfg, osmo_ss7_asp::dyn_allocated, osmo_ss7_asp::fi, osmo_ss7_asp::name, osmo_ss7_asp_destroy(), OSMO_XLM_PRIM_M_SCTP_RELEASE, osmo_ss7_asp::server, XUA_ASP_E_SCTP_COMM_DOWN_IND, xua_asp_send_xlm_prim_simple(), and xua_rkm_cleanup_dyn_as_for_asp().

Referenced by xua_accept_cb().

## Variable Documentation

## default_pc_fmt

const struct osmo_ss7_pc_fmt default_pc_fmt

static

Initial value:
= {
.delimiter = '.',
.component_len = { 3, 8, 3},
}

Referenced by osmo_ss7_pointcode_parse(), osmo_ss7_pointcode_parse_mask_or_len(), and osmo_ss7_pointcode_print_buf().

## g_osmo_ss7_asp_rx_unknown_cb

osmo_ss7_asp_rx_unknown_cb* g_osmo_ss7_asp_rx_unknown_cb

static

Referenced by osmo_ss7_register_rx_unknown_cb(), and ss7_asp_rx_unknown().

## g_ss7_as_rcg_idx

unsigned int g_ss7_as_rcg_idx

static

Referenced by osmo_ss7_as_find_or_create().

## g_ss7_asp_rcg_idx

unsigned int g_ss7_asp_rcg_idx

static

Referenced by osmo_ss7_asp_find_or_create().

## 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
@ MTP_UNAVAIL_C_UNEQUIP_REM_USER
Definition mtp.h:30
MTP_UNAVAIL_C_UNKNOWN
@ MTP_UNAVAIL_C_UNKNOWN
Definition mtp.h:29
MTP_UNAVAIL_C_INACC_REM_USER
@ MTP_UNAVAIL_C_INACC_REM_USER
Definition mtp.h:31

Referenced by mtp_unavail_cause_str().

## next_l_rk_id

int32_t next_l_rk_id = 1

static

Referenced by find_free_l_rk_id().

## next_rctx

int32_t next_rctx = 1

static

Referenced by osmo_ss7_find_free_rctx().

## 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 }
}
OSMO_SS7_AS_TMOD_OVERRIDE
@ OSMO_SS7_AS_TMOD_OVERRIDE
Definition osmo_ss7.h:262
OSMO_SS7_AS_TMOD_ROUNDROBIN
@ OSMO_SS7_AS_TMOD_ROUNDROBIN
Definition osmo_ss7.h:265
OSMO_SS7_AS_TMOD_BCAST
@ OSMO_SS7_AS_TMOD_BCAST
Definition osmo_ss7.h:263
OSMO_SS7_AS_TMOD_LOADSHARE
@ OSMO_SS7_AS_TMOD_LOADSHARE
Definition osmo_ss7.h:264

Referenced by DEFUN_USRATTR(), and osmo_ss7_as_traffic_mode_name().

## osmo_ss7_asp_protocol_vals

struct value_string osmo_ss7_asp_protocol_vals[]

Initial value:
= {
{ OSMO_SS7_ASP_PROT_NONE, "none" },
{ OSMO_SS7_ASP_PROT_SUA, "sua" },
{ OSMO_SS7_ASP_PROT_M3UA, "m3ua" },
{ OSMO_SS7_ASP_PROT_IPA, "ipa" },
{ 0, NULL }
}
OSMO_SS7_ASP_PROT_SUA
@ OSMO_SS7_ASP_PROT_SUA
Definition osmo_ss7.h:279
OSMO_SS7_ASP_PROT_NONE
@ OSMO_SS7_ASP_PROT_NONE
Definition osmo_ss7.h:278
OSMO_SS7_ASP_PROT_IPA
@ OSMO_SS7_ASP_PROT_IPA
Definition osmo_ss7.h:281
OSMO_SS7_ASP_PROT_M3UA
@ OSMO_SS7_ASP_PROT_M3UA
Definition osmo_ss7.h:280

Referenced by DEFUN(), osmo_ss7_asp_protocol_name(), osmo_ss7_xua_server_bind(), osmo_ss7_xua_server_create(), parse_asp_proto(), vty_dump_xua_server(), write_one_xua(), and xua_accept_cb().

## osmo_ss7_asp_role_names

const struct value_string osmo_ss7_asp_role_names[]

Initial value:
= {
{ OSMO_SS7_ASP_ROLE_ASP, "ASP" },
{ OSMO_SS7_ASP_ROLE_SG, "SG" },
{ OSMO_SS7_ASP_ROLE_IPSP, "IPSP" },
{ 0, NULL }
}
OSMO_SS7_ASP_ROLE_SG
@ OSMO_SS7_ASP_ROLE_SG
Definition osmo_ss7.h:381
OSMO_SS7_ASP_ROLE_ASP
@ OSMO_SS7_ASP_ROLE_ASP
Definition osmo_ss7.h:380
OSMO_SS7_ASP_ROLE_IPSP
@ OSMO_SS7_ASP_ROLE_IPSP
Definition osmo_ss7.h:382

Referenced by write_one_asp().

## prot2port

const uint16_t prot2port[]

static

Initial value:
= {
[OSMO_SS7_ASP_PROT_NONE] = 0,
[OSMO_SS7_ASP_PROT_SUA] = SUA_PORT,
[OSMO_SS7_ASP_PROT_M3UA] = M3UA_PORT,
[OSMO_SS7_ASP_PROT_IPA] = 5000,
}
M3UA_PORT
#define M3UA_PORT
Definition m3ua.h:26
SUA_PORT
#define SUA_PORT
Definition sua.h:28

Referenced by osmo_ss7_asp_protocol_port().

## 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" },
}
SS7_AS_CTR_RX_MSU_TOTAL
@ SS7_AS_CTR_RX_MSU_TOTAL
Definition ss7_internal.h:12
SS7_AS_CTR_TX_MSU_TOTAL
@ SS7_AS_CTR_TX_MSU_TOTAL
Definition ss7_internal.h:13

## 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,
}
ss7_as_rcd
static const struct rate_ctr_desc ss7_as_rcd[]
Definition osmo_ss7.c:900

Referenced by osmo_ss7_as_find_or_create().

## ss7_asp_rcd

const struct rate_ctr_desc ss7_asp_rcd[]

static

Initial value:
= {
[SS7_ASP_CTR_PKT_RX_TOTAL] = { "rx:packets:total", "Total number of packets received" },
[SS7_ASP_CTR_PKT_RX_UNKNOWN] = { "rx:packets:unknown", "Number of packets received for unknown PPID" },
[SS7_ASP_CTR_PKT_TX_TOTAL] = { "tx:packets:total", "Total number of packets transmitted" },
}
SS7_ASP_CTR_PKT_TX_TOTAL
@ SS7_ASP_CTR_PKT_TX_TOTAL
Definition osmo_ss7.c:1153
SS7_ASP_CTR_PKT_RX_UNKNOWN
@ SS7_ASP_CTR_PKT_RX_UNKNOWN
Definition osmo_ss7.c:1152
SS7_ASP_CTR_PKT_RX_TOTAL
@ SS7_ASP_CTR_PKT_RX_TOTAL
Definition osmo_ss7.c:1151

## ss7_asp_rcgd

const struct rate_ctr_group_desc ss7_asp_rcgd

static

Initial value:
= {
.group_name_prefix = "sigtran_asp",
.group_description = "SIGTRAN Application Server Process",
.num_ctr = ARRAY_SIZE(ss7_asp_rcd),
.ctr_desc = ss7_asp_rcd,
}
ss7_asp_rcd
static const struct rate_ctr_desc ss7_asp_rcd[]
Definition osmo_ss7.c:1156

Referenced by osmo_ss7_asp_find_or_create().

## ss7_initialized

bool ss7_initialized = false

static

Referenced by osmo_ss7_as_add_asp(), osmo_ss7_as_del_asp(), osmo_ss7_as_destroy(), osmo_ss7_as_find_by_l_rk_id(), osmo_ss7_as_find_by_name(), osmo_ss7_as_find_by_proto(), osmo_ss7_as_find_by_rctx(), osmo_ss7_as_find_or_create(), osmo_ss7_as_has_asp(), osmo_ss7_asp_destroy(), osmo_ss7_asp_find(), osmo_ss7_asp_find_by_name(), osmo_ss7_asp_find_by_socket_addr(), osmo_ss7_asp_find_or_create(), osmo_ss7_asp_restart(), osmo_ss7_asp_send(), osmo_ss7_init(), osmo_ss7_instance_destroy(), osmo_ss7_instance_find(), osmo_ss7_instance_find_or_create(), osmo_ss7_link_destroy(), osmo_ss7_link_find_or_create(), osmo_ss7_linkset_destroy(), osmo_ss7_linkset_find_by_name(), osmo_ss7_linkset_find_or_create(), osmo_ss7_pc_is_local(), osmo_ss7_route_create(), osmo_ss7_route_destroy(), osmo_ss7_route_find_dpc(), osmo_ss7_route_find_dpc_mask(), osmo_ss7_route_lookup(), osmo_ss7_route_table_find(), osmo_ss7_route_table_find_or_create(), osmo_ss7_xua_server_create(), osmo_ss7_xua_server_find(), and osmo_ss7_xua_server_set_local_hosts().