osmo_ss7.h File Reference
`#include <stdint.h>`
`#include <stdbool.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/core/fsm.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/core/prim.h>`

Go to the source code of this file.

## Data Structures

struct | osmo_ss7_route_table
struct | osmo_ss7_pc_fmt
struct | osmo_ss7_instance
struct | osmo_ss7_user
struct | osmo_ss7_link
struct | osmo_ss7_linkset
struct | osmo_ss7_route
struct | osmo_ss7_routing_key
struct | osmo_ss7_as
struct | osmo_ss7_asp_peer
struct | osmo_ss7_asp
struct | osmo_xua_layer_manager
struct | osmo_xua_server

## Macros

#define | OSMO_SS7_PC_INVALID 0xffffffff
#define | LOGPASP(asp, subsys, level, fmt, args ...) LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)

## Typedefs

typedef int | osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
| Weak function to handle payload for unknown/unsupported PPID or IPA StreamID. More...

## Enumerations

enum | osmo_ss7_link_adm_state { OSMO_SS7_LS_SHUTDOWN, OSMO_SS7_LS_INHIBITED, OSMO_SS7_LS_ENABLED, _NUM_OSMO_SS7_LS }
enum | osmo_ss7_as_traffic_mode { OSMO_SS7_AS_TMOD_OVERRIDE = 0, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, OSMO_SS7_AS_TMOD_ROUNDROBIN, _NUM_OSMO_SS7_ASP_TMOD }
enum | osmo_ss7_asp_protocol { OSMO_SS7_ASP_PROT_NONE, OSMO_SS7_ASP_PROT_SUA, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_IPA, _NUM_OSMO_SS7_ASP_PROT }
enum | osmo_ss7_asp_admin_state { OSMO_SS7_ASP_ADM_S_SHUTDOWN, OSMO_SS7_ASP_ADM_S_BLOCKED, OSMO_SS7_ASP_ADM_S_ENABLED }

## Functions

int | osmo_ss7_init (void)
int | osmo_ss7_find_free_rctx (struct osmo_ss7_instance *inst)
bool | osmo_ss7_pc_is_local (struct osmo_ss7_instance *inst, uint32_t pc)
int | osmo_ss7_pointcode_parse (struct osmo_ss7_instance *inst, const char *str)
int | osmo_ss7_pointcode_parse_mask_or_len (struct osmo_ss7_instance *inst, const char *in)
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)
static bool | osmo_ss7_pc_is_valid (uint32_t pc)
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_instance * | osmo_ss7_instance_find (uint32_t id)
| Find a SS7 Instance with given ID. More...
struct osmo_ss7_instance * | osmo_ss7_instance_find_or_create (void *ctx, uint32_t id)
| Find or create a SS7 Instance. More...
void | osmo_ss7_instance_destroy (struct osmo_ss7_instance *inst)
| Destroy a SS7 Instance. More...
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. More...
int | osmo_ss7_instance_bind (struct osmo_ss7_instance *inst)
| bind all xUA servers belonging to an SS7 Instance More...
int | osmo_ss7_bind_all_instances ()
| bind all xUA servers on each of the stored SS7 instances More...
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. More...
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. More...
int | osmo_ss7_mtp_to_user (struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
int | osmo_ss7_user_mtp_xfer_req (struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
void | osmo_ss7_link_destroy (struct osmo_ss7_link *link)
| Destryo SS7 Link. More...
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. More...
void | osmo_ss7_linkset_destroy (struct osmo_ss7_linkset *lset)
| Destroy a SS7 Linkset. More...
struct osmo_ss7_linkset * | osmo_ss7_linkset_find_by_name (struct osmo_ss7_instance *inst, const char *name)
| Find SS7 Linkset by given name. More...
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. More...
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. More...
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. More...
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. More...
struct osmo_ss7_route * | osmo_ss7_route_create (struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, const char *linkset_name)
| Create a new route in the given routing table. More...
void | osmo_ss7_route_destroy (struct osmo_ss7_route *rt)
| Destroy a given SS7 route. More...
const char * | osmo_ss7_route_name (struct osmo_ss7_route *rt, bool list_asps)
| Return human readable representation of the route, in a static buffer. More...
static const char * | osmo_ss7_as_traffic_mode_name (enum osmo_ss7_as_traffic_mode mode)
static const char * | osmo_ss7_asp_protocol_name (enum osmo_ss7_asp_protocol mode)
int | osmo_ss7_asp_protocol_port (enum osmo_ss7_asp_protocol prot)
struct osmo_ss7_as * | osmo_ss7_as_find_by_name (struct osmo_ss7_instance *inst, const char *name)
| Find Application Server by given name. More...
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. More...
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. More...
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. More...
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. 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 (struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
| Determine if given AS contains ASP. More...
void | osmo_ss7_asp_disconnect (struct osmo_ss7_asp *asp)
struct osmo_ss7_asp * | osmo_ss7_asp_find_by_name (struct osmo_ss7_instance *inst, const char *name)
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. More...
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)
int | osmo_ss7_asp_send (struct osmo_ss7_asp *asp, struct msgb *msg)
| send a fully encoded msgb via a given ASP More...
int | osmo_ss7_asp_restart (struct osmo_ss7_asp *asp)
int | osmo_ss7_asp_use_default_lm (struct osmo_ss7_asp *asp, int log_level)
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. More...
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 More...
int | osmo_ss7_xua_server_bind (struct osmo_xua_server *xs)
| Set the xUA server to bind/listen to the currently configured ip/port. More...
int | osmo_ss7_xua_server_set_local_host (struct osmo_xua_server *xs, const char *local_host)
void | osmo_ss7_xua_server_destroy (struct osmo_xua_server *xs)
struct osmo_sccp_instance * | osmo_sccp_simple_client (void *ctx, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip)
| request an sccp client instance More...
struct osmo_sccp_instance * | osmo_sccp_simple_client_on_ss7_id (void *ctx, uint32_t ss7_id, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip)
| request an sccp client instance More...
struct osmo_sccp_instance * | osmo_sccp_simple_server (void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip)
struct osmo_sccp_instance * | osmo_sccp_simple_server_on_ss7_id (void *ctx, uint32_t ss7_id, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip)
struct osmo_sccp_instance * | osmo_sccp_simple_server_add_clnt (struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, int local_port, int remote_port, const char *remote_ip)
enum osmo_ss7_as_traffic_mode | osmo_ss7_tmode_from_xua (uint32_t in)
int | osmo_ss7_tmode_to_xua (enum osmo_ss7_as_traffic_mode tmod)
void | osmo_ss7_vty_init_asp (void *ctx)
void | osmo_ss7_vty_init_sg (void *ctx)
int | osmo_ss7_vty_go_parent (struct vty *vty)
int | osmo_ss7_is_config_node (struct vty *vty, int node)

## Variables

struct llist_head | osmo_ss7_instances
struct value_string | osmo_ss7_as_traffic_mode_vals []
struct value_string | osmo_ss7_asp_protocol_vals []

## Macro Definition Documentation

## LOGPASP

#define LOGPASP | ( |  | asp,
|  |  | subsys,
|  |  | level,
|  |  | fmt,
|  |  | args ...
| ) |  | LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)

Referenced by handle_rkey_dereg(), handle_rkey_dereg_resp(), handle_rkey_reg(), handle_rkey_reg_resp(), ipa_cli_read_cb(), ipa_rx_msg_ccm(), ipa_rx_msg_sccp(), ipa_srv_conn_cb(), log_sctp_notification(), m3ua_rx_mgmt_err(), m3ua_rx_mgmt_ntfy(), m3ua_rx_msg(), m3ua_rx_rkm(), m3ua_rx_rkm_reg_req(), m3ua_rx_xfer(), osmo_ss7_asp_send(), osmo_xlm_sap_down(), patch_sccp_with_pc(), ss7_asp_rx_unknown(), sua_rx_mgmt_err(), sua_rx_mgmt_ntfy(), sua_rx_msg(), xua_asp_send_xlm_prim(), xua_cli_connect_cb(), xua_cli_read_cb(), and xua_srv_conn_cb().

## OSMO_SS7_PC_INVALID

#define OSMO_SS7_PC_INVALID 0xffffffff

Referenced by osmo_sccp_user_bind(), osmo_ss7_instance_find_or_create(), and vty_show_connection().

## Typedef Documentation

## osmo_ss7_asp_rx_unknown_cb

typedef int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)

Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.

This function can be overridden by application code to implement whatever handling it wants for such additional payloads/streams.

Parameters

  [in] | asp | Application Server Process through which data was received
  [in] | ppid_sid | SCTP PPID (in sigtran case) or IPA Stream ID
  [in] | msg | Message buffer containing received data. Continues to be owned by caller!

Returns
  0 on success; negative on error

## Enumeration Type Documentation

## osmo_ss7_as_traffic_mode

enum osmo_ss7_as_traffic_mode

Enumerator
OSMO_SS7_AS_TMOD_OVERRIDE |
OSMO_SS7_AS_TMOD_BCAST |
OSMO_SS7_AS_TMOD_LOADSHARE |
OSMO_SS7_AS_TMOD_ROUNDROBIN |
_NUM_OSMO_SS7_ASP_TMOD |

## osmo_ss7_asp_admin_state

enum osmo_ss7_asp_admin_state

Enumerator
OSMO_SS7_ASP_ADM_S_SHUTDOWN | no SCTP association with peer
OSMO_SS7_ASP_ADM_S_BLOCKED | SCP association, but reject ASP-ACTIVE.
OSMO_SS7_ASP_ADM_S_ENABLED | in normal operation

## osmo_ss7_asp_protocol

enum osmo_ss7_asp_protocol

Enumerator
OSMO_SS7_ASP_PROT_NONE |
OSMO_SS7_ASP_PROT_SUA |
OSMO_SS7_ASP_PROT_M3UA |
OSMO_SS7_ASP_PROT_IPA |
_NUM_OSMO_SS7_ASP_PROT |

## osmo_ss7_link_adm_state

enum osmo_ss7_link_adm_state

Enumerator
OSMO_SS7_LS_SHUTDOWN |
OSMO_SS7_LS_INHIBITED |
OSMO_SS7_LS_ENABLED |
_NUM_OSMO_SS7_LS |

## Function Documentation

## osmo_sccp_simple_client()

struct osmo_sccp_instance* osmo_sccp_simple_client | ( | void * | ctx,
|  | const char * | name,
|  | uint32_t | default_pc,
|  | enum osmo_ss7_asp_protocol | prot,
|  | int | default_local_port,
|  | const char * | default_local_ip,
|  | int | default_remote_port,
|  | const char * | default_remote_ip
| ) |  |

request an sccp client instance

Parameters

  [in] | ctx | talloc context
  [in] | name | human readable name
  [in] | default_pc | pointcode to be used on missing VTY setting
  [in] | prot | protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA)
  [in] | default_local_port | local port to be usd on missing VTY setting
  [in] | default_local_ip | local IP-address to be usd on missing VTY setting
  [in] | default_remote_port | remote port to be usd on missing VTY setting
  [in] | default_remote_ip | remote IP-address to be usd on missing VTY setting

Returns
  callee-allocated SCCP instance on success; NULL on error

This is simplified version of osmo_sccp_simple_client_on_ss7_id(). the only difference is that the ID of the CS7 instance will be set to 1 statically

References osmo_sccp_simple_client_on_ss7_id().

## osmo_sccp_simple_client_on_ss7_id()

struct osmo_sccp_instance* osmo_sccp_simple_client_on_ss7_id | ( | void * | ctx,
|  | uint32_t | ss7_id,
|  | const char * | name,
|  | uint32_t | default_pc,
|  | enum osmo_ss7_asp_protocol | prot,
|  | int | default_local_port,
|  | const char * | default_local_ip,
|  | int | default_remote_port,
|  | const char * | default_remote_ip
| ) |  |

request an sccp client instance

Parameters

  [in] | ctx | talloc context
  [in] | ss7_id | of the SS7/CS7 instance
  [in] | name | human readable name
  [in] | default_pc | pointcode to be used on missing VTY setting
  [in] | prot | protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA)
  [in] | default_local_port | local port to be usd on missing VTY setting
  [in] | default_local_ip | local IP-address to be usd on missing VTY setting
  [in] | default_remote_port | remote port to be usd on missing VTY setting
  [in] | default_remote_ip | remote IP-address to be usd on missing VTY setting

Returns
  callee-allocated SCCP instance on success; NULL on error

The function will examine the given CS7 instance and its sub components (as, asp, etc.). If necessary it will allocate the missing components. If no CS7 instance can be detected under the caller supplied ID, a new instance will be created beforehand.

References osmo_ss7_instance::cfg, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, osmo_ss7_asp_peer::host, osmo_ss7_instance::id, osmo_ss7_asp::is_server, osmo_ss7_asp::local, osmo_ss7_as::name, osmo_ss7_asp::name, osmo_sccp_instance_create(), osmo_ss7_as_add_asp(), osmo_ss7_as_destroy(), osmo_ss7_as_find_by_proto(), osmo_ss7_as_find_or_create(), osmo_ss7_asp_destroy(), osmo_ss7_asp_find_by_name(), osmo_ss7_asp_find_by_proto(), osmo_ss7_asp_find_or_create(), OSMO_SS7_ASP_PROT_IPA, osmo_ss7_asp_protocol_port(), osmo_ss7_asp_restart(), osmo_ss7_asp_use_default_lm(), osmo_ss7_instance_destroy(), osmo_ss7_instance_find(), osmo_ss7_instance_find_or_create(), osmo_ss7_pc_is_valid(), osmo_ss7_pointcode_print(), osmo_ss7_route_create(), osmo_ss7_route_destroy(), osmo_ss7_route_find_dpc_mask(), osmo_ss7_routing_key::pc, osmo_ss7_instance::primary_pc, osmo_ss7_asp::remote, osmo_ss7_as::routing_key, osmo_ss7_instance::rtable_system, and osmo_ss7_instance::sccp.

Referenced by osmo_sccp_simple_client().

## osmo_sccp_simple_server()

struct osmo_sccp_instance* osmo_sccp_simple_server | ( | void * | ctx,
|  | uint32_t | pc,
|  | enum osmo_ss7_asp_protocol | prot,
|  | int | local_port,
|  | const char * | local_ip
| ) |  |

References osmo_sccp_simple_server_on_ss7_id().

## osmo_sccp_simple_server_add_clnt()

struct osmo_sccp_instance* osmo_sccp_simple_server_add_clnt | ( | struct osmo_sccp_instance * | inst,
|  | enum osmo_ss7_asp_protocol | prot,
|  | const char * | name,
|  | uint32_t | pc,
|  | int | local_port,
|  | int | remote_port,
|  | const char * | remote_ip
| ) |  |

References osmo_ss7_asp::cfg, osmo_ss7_asp::is_server, osmo_ss7_as_add_asp(), osmo_ss7_as_destroy(), osmo_ss7_as_find_or_create(), osmo_ss7_asp_find_or_create(), osmo_ss7_asp_protocol_port(), osmo_ss7_asp_restart(), osmo_ss7_route_create(), osmo_ss7_route_destroy(), osmo_ss7_instance::rtable_system, osmo_ss7_instance::sccp, and osmo_sccp_instance::ss7.

## osmo_sccp_simple_server_on_ss7_id()

struct osmo_sccp_instance* osmo_sccp_simple_server_on_ss7_id | ( | void * | ctx,
|  | uint32_t | ss7_id,
|  | uint32_t | pc,
|  | enum osmo_ss7_asp_protocol | prot,
|  | int | local_port,
|  | const char * | local_ip
| ) |  |

References osmo_ss7_instance::cfg, osmo_sccp_instance_create(), osmo_ss7_asp_protocol_port(), osmo_ss7_instance_destroy(), osmo_ss7_instance_find_or_create(), osmo_ss7_xua_server_bind(), osmo_ss7_xua_server_create(), osmo_ss7_xua_server_destroy(), osmo_sccp_addr::pc, osmo_ss7_instance::primary_pc, and osmo_ss7_instance::sccp.

Referenced by osmo_sccp_simple_server().

## 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, LOGSS7, osmo_ss7_as::name, osmo_ss7_asp::name, osmo_ss7_as_has_asp(), osmo_ss7_asp_find_by_name(), and ss7_initialized.

Referenced by DEFUN(), 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, LOGSS7, osmo_ss7_as::name, osmo_ss7_asp::name, osmo_ss7_asp_find_by_name(), and ss7_initialized.

Referenced by DEFUN(), 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::cfg, osmo_ss7_route::dest, osmo_ss7_as::fi, osmo_ss7_as::inst, osmo_ss7_route::list, osmo_ss7_as::list, LOGSS7, osmo_ss7_as::name, osmo_ss7_route_destroy(), osmo_ss7_route_table::routes, osmo_ss7_instance::rtable_system, and ss7_initialized.

Referenced by DEFUN(), 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_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::list, osmo_ss7_as::name, and ss7_initialized.

Referenced by DEFUN(), 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::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::list, osmo_ss7_as::routing_key, and ss7_initialized.

Referenced by handle_rkey_dereg(), handle_rkey_reg(), ipa_asp_fsm_cleanup(), ipa_asp_fsm_wait_id_ack2(), m3ua_rx_xfer(), osmo_ss7_find_free_rctx(), and xua_asp_fsm_inactive().

## 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 suuccess; NULL otherwise

References osmo_ss7_instance::as_list, osmo_ss7_as::cfg, osmo_ss7_as::fi, find_free_l_rk_id(), osmo_ss7_as::inst, osmo_ss7_routing_key::l_rk_id, osmo_ss7_as::list, LOGSS7, osmo_ss7_as::mode, osmo_ss7_as::name, osmo_ss7_as_find_by_name(), OSMO_SS7_AS_TMOD_LOADSHARE, osmo_ss7_as::proto, osmo_ss7_as::recovery_timeout_msec, osmo_ss7_as::routing_key, ss7_initialized, and xua_as_fsm_start().

Referenced by DEFUN(), 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 | ( | struct osmo_ss7_as * | as,
|  | 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_as::asps, osmo_ss7_as::cfg, and ss7_initialized.

Referenced by dispatch_to_all_as(), find_as_for_asp(), handle_rkey_dereg(), m3ua_rx_xfer(), osmo_ss7_as_add_asp(), and xua_rkm_cleanup_dyn_as_for_asp().

## osmo_ss7_as_traffic_mode_name()

static const char* osmo_ss7_as_traffic_mode_name | ( | enum osmo_ss7_as_traffic_mode | mode | ) |

inline static

References osmo_ss7_as_traffic_mode_vals.

Referenced by write_one_as().

## 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::cfg, osmo_ss7_asp::client, osmo_ss7_asp::fi, osmo_ss7_asp::inst, ipa_cli_read_cb(), osmo_ss7_as::list, osmo_ss7_asp::list, LOGSS7, osmo_ss7_asp::name, osmo_ss7_asp::server, osmo_ss7_asp::siblings, ss7_initialized, xua_cli_connect_cb(), xua_cli_read_cb(), and osmo_ss7_asp::xua_server.

Referenced by DEFUN(), osmo_sccp_simple_client_on_ss7_id(), 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_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::list, osmo_ss7_asp::name, and ss7_initialized.

Referenced by DEFUN(), osmo_sccp_simple_client_on_ss7_id(), osmo_ss7_as_add_asp(), osmo_ss7_as_del_asp(), 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_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::inst, osmo_ss7_asp::list, osmo_ss7_asp::local, osmo_ss7_asp::name, osmo_sccp_instance_create(), osmo_ss7_asp_find_by_name(), OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, osmo_ss7_instance::sccp, and ss7_initialized.

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

## osmo_ss7_asp_protocol_name()

static const char* osmo_ss7_asp_protocol_name | ( | enum osmo_ss7_asp_protocol | mode | ) |

inline static

References osmo_ss7_asp_protocol_port(), and osmo_ss7_asp_protocol_vals.

Referenced by osmo_ss7_route_name(), write_one_as(), and write_one_asp().

## 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(), osmo_sccp_simple_server_on_ss7_id(), and osmo_ss7_asp_protocol_name().

## 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::inst, ipa_cli_read_cb(), osmo_ss7_asp::is_server, osmo_ss7_asp::local, LOGSS7, osmo_ss7_asp::name, OSMO_SS7_ASP_PROT_IPA, osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, osmo_ss7_asp::server, ss7_initialized, xua_asp_fsm_start(), XUA_ASPFSM_ROLE_ASP, XUA_ASPFSM_ROLE_SG, 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::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_initialized, and SUA_PPID.

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

## osmo_ss7_asp_use_default_lm()

int osmo_ss7_asp_use_default_lm | ( | struct osmo_ss7_asp * | asp,
|  | int | log_level
| ) |  |

References lm_fsm_priv::asp, osmo_ss7_asp::cfg, default_layer_manager, osmo_ss7_asp::lm, osmo_ss7_asp::lm_priv, osmo_ss7_asp::name, and xua_default_lm_fsm.

Referenced by osmo_sccp_simple_client_on_ss7_id(), and restart_asp().

## osmo_ss7_bind_all_instances()

int osmo_ss7_bind_all_instances | ( |  | ) |

bind all xUA servers on each of the stored SS7 instances

Returns
  0 on success; negative value on error

References osmo_ss7_instance::list, LOGSS7, osmo_ss7_instance_bind(), osmo_ss7_instances, and ss7_initialized.

## 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_bind()

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

bind all xUA servers belonging to an SS7 Instance

Parameters

  [in] | inst | SS7 Instance to apply the socket binding (and start listening)

Returns
  0 on success; negative value on error

References osmo_xua_server::cfg, osmo_ss7_asp_peer::host, osmo_xua_server::list, osmo_xua_server::local, LOGSS7, osmo_ss7_xua_server_bind(), osmo_ss7_asp_peer::port, and osmo_ss7_instance::xua_servers.

Referenced by osmo_ss7_bind_all_instances().

## 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_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(), 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(), 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, LOGSS7, and osmo_ss7_instance::pc_fmt.

## osmo_ss7_is_config_node()

int osmo_ss7_is_config_node | ( | struct vty * | vty,
|  | int | node
| ) |  |

## osmo_ss7_link_destroy()

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

Destryo 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_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 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_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_is_valid()

static bool osmo_ss7_pc_is_valid | ( | uint32_t | pc | ) |

inline static

Referenced by _osmo_ss7_pointcode_print(), DEFUN(), osmo_sccp_simple_client_on_ss7_id(), osmo_ss7_pc_is_local(), sccp_user_find(), show_user(), sua2sccp_tx_m3ua(), vty_show_connection(), and write_one_cs7().

## 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(), 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, get_pc_width(), osmo_ss7_pointcode_parse(), and osmo_ss7_instance::pc_fmt.

Referenced by DEFUN().

## osmo_ss7_pointcode_print()

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

References _osmo_ss7_pointcode_print(), and MAX_PC_STR_LEN.

Referenced by DEFUN(), handle_rkey_dereg(), handle_rkey_reg(), hmrt_message_for_routing(), m3ua_hmdc_rx_from_l2(), m3ua_rx_xfer(), osmo_sccp_addr_name(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_user_unbind(), osmo_ss7_route_create(), osmo_ss7_route_name(), sccp_scoc_rx_inval_opc(), sccp_user_bind_pc(), show_user(), vty_dump_rtable(), vty_show_connection(), write_one_as(), write_one_cs7(), write_one_rtable(), and write_sccp_addressbook().

## osmo_ss7_pointcode_print2()

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

References _osmo_ss7_pointcode_print(), and MAX_PC_STR_LEN.

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

## 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_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_pointcode_print(), osmo_ss7_route::pc, route_insert_sorted(), osmo_ss7_route::rtable, and ss7_initialized.

Referenced by DEFUN(), handle_rkey_reg(), ipa_asp_fsm_wait_id_ack2(), 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::list, and ss7_initialized.

Referenced by DEFUN(), handle_rkey_dereg(), handle_rkey_reg(), ipa_asp_fsm_cleanup(), 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_route::cfg, osmo_ss7_route::list, osmo_ss7_route::mask, osmo_ss7_route::pc, 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_route::cfg, osmo_ss7_route::list, osmo_ss7_route::mask, osmo_ss7_route::pc, osmo_ss7_route_table::routes, and ss7_initialized.

Referenced by DEFUN(), ipa_asp_fsm_cleanup(), and osmo_sccp_simple_client_on_ss7_id().

## 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 osmo_ss7_route_find_dpc(), osmo_ss7_instance::rtable_system, and ss7_initialized.

Referenced by gen_mtp_transfer_req_xua(), and hmrt_message_for_routing().

## osmo_ss7_route_name()

const char* osmo_ss7_route_name | ( | struct osmo_ss7_route * | rt,
|  | bool | list_asps
| ) |  |

Return human readable representation of the route, in a static buffer.

This uses both osmo_ss7_pointcode_print() and osmo_ss7_pointcode_print2(), so pairing osmo_ss7_route_name() with osmo_ss7_pointcode_print() in the same printf statement is likely to conflict.

Parameters

  [in] | rt | The route information to print, or NULL.
  [in] | list_asps | If true, append info for all ASPs for the route's AS.

Returns
  A string constant or static buffer.

References APPEND, osmo_ss7_route::as, osmo_ss7_as::asps, osmo_ss7_linkset::cfg, osmo_ss7_route::cfg, osmo_ss7_as::cfg, osmo_ss7_asp::cfg, osmo_ss7_route::dest, osmo_ss7_route_table::inst, osmo_ss7_route::linkset, osmo_ss7_route::mask, osmo_ss7_linkset::name, osmo_ss7_as::name, osmo_ss7_asp::name, osmo_ss7_asp_protocol_name(), osmo_ss7_pointcode_print(), osmo_ss7_pointcode_print2(), osmo_ss7_route::pc, osmo_ss7_as::proto, osmo_ss7_route::rtable, and osmo_ss7_asp::sock_name.

Referenced by hmrt_message_for_routing().

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

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

## osmo_ss7_user_mtp_xfer_req()

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

References m3ua_hmdc_rx_from_l2(), xua_msg::mtp, mtp_prim_to_m3ua(), MTP_SAP_USER, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_mtp_prim::transfer, osmo_mtp_prim::u, and xua_msg_free().

Referenced by sua2sccp_tx_m3ua().

## 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_vty_go_parent()

int osmo_ss7_vty_go_parent | ( | struct vty * | vty | ) |

References osmo_ss7_route_table::inst, osmo_ss7_as::inst, osmo_ss7_asp::inst, osmo_xua_server::inst, osmo_sccp_addr_entry::inst, and osmo_ss7_asp_restart().

## osmo_ss7_vty_init_asp()

void osmo_ss7_vty_init_asp | ( | void * | ctx | ) |

References cs7_role, CS7_ROLE_ASP, and vty_init_shared().

## osmo_ss7_vty_init_sg()

void osmo_ss7_vty_init_sg | ( | void * | ctx | ) |

References cs7_role, CS7_ROLE_SG, rtable_node, vty_init_shared(), and xua_node.

## 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_ss7_asp_peer::host, osmo_xua_server::local, osmo_ss7_asp_protocol_vals, osmo_ss7_asp_peer::port, osmo_xua_server::proto, and osmo_xua_server::server.

Referenced by DEFUN(), osmo_sccp_simple_server_on_ss7_id(), and osmo_ss7_instance_bind().

## 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_ss7_asp_peer::host, osmo_xua_server::inst, osmo_xua_server::list, osmo_xua_server::local, osmo_sccp_instance_create(), OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp_protocol_vals, osmo_ss7_asp_peer::port, osmo_xua_server::proto, osmo_ss7_instance::sccp, osmo_xua_server::server, ss7_initialized, xua_accept_cb(), and osmo_ss7_instance::xua_servers.

Referenced by DEFUN(), 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(), 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::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().

## 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_xua_server::cfg, osmo_ss7_asp_peer::host, osmo_xua_server::local, osmo_xua_server::server, and ss7_initialized.

Referenced by DEFUN().

## Variable Documentation

## osmo_ss7_as_traffic_mode_vals

struct value_string osmo_ss7_as_traffic_mode_vals[]

Referenced by DEFUN(), and osmo_ss7_as_traffic_mode_name().

## osmo_ss7_asp_protocol_vals

struct value_string osmo_ss7_asp_protocol_vals[]

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_instances

struct llist_head osmo_ss7_instances

Referenced by config_write_cs7(), DEFUN(), osmo_ss7_asp_find_by_socket_addr(), osmo_ss7_bind_all_instances(), osmo_ss7_instance_find(), and osmo_ss7_instance_find_or_create().