Loading...
Searching...
No Matches
osmo_ss7_asp.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/core/osmo_io.h>`
`#include <osmocom/netif/stream.h>`
`#include <osmocom/netif/ipa.h>`
`#include <osmocom/netif/sctp.h>`
`#include "sccp_internal.h"`
`#include "xua_internal.h"`
`#include "ss7_as.h"`
`#include "ss7_asp.h"`
`#include "ss7_internal.h"`
`#include "ss7_xua_srv.h"`
`#include "xua_asp_fsm.h"`
`#include "xua_as_fsm.h"`

## Functions

static int | _setsockopt_peer_primary_addr (int fd, const struct osmo_sockaddr *saddr)
static int | _setsockopt_primary_addr (int fd, const struct osmo_sockaddr *saddr)
bool | ss7_asp_protocol_check_trans_proto (enum osmo_ss7_asp_protocol proto, int trans_proto)
int | ss7_default_trans_proto_for_asp_proto (enum osmo_ss7_asp_protocol proto)
int | osmo_ss7_asp_protocol_port (enum osmo_ss7_asp_protocol prot)
int | ss7_asp_apply_new_local_address (const struct osmo_ss7_asp *asp, unsigned int loc_idx)
int | ss7_asp_apply_drop_local_address (const struct osmo_ss7_asp *asp, unsigned int loc_idx)
int | ss7_asp_apply_peer_primary_address (const struct osmo_ss7_asp *asp)
int | ss7_asp_apply_primary_address (const struct osmo_ss7_asp *asp)
static bool | sctp_peer_addr_change_ev_addr_matches_our_primary (const struct osmo_ss7_asp *asp, const union sctp_notification *notif)
static void | asp_handle_sctp_notif_monitor_primary_address (const struct osmo_ss7_asp *asp, const union sctp_notification *notif)
bool | ss7_asp_set_default_peer_hosts (struct osmo_ss7_asp *asp)
static uint16_t | get_in_port (struct sockaddr *sa)
static void | chop_v4_mapped_on_v6_prefix (char *buf)
struct osmo_ss7_asp * | ss7_asp_find_by_socket_addr (int fd, int trans_proto)
| Find an ASP definition matching the local+remote IP/PORT of given fd.
struct osmo_ss7_asp * | ss7_asp_alloc (struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, int trans_proto, 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, int res, struct msgb *msg)
static int | ipa_cli_read_cb (struct osmo_stream_cli *conn, int res, struct msgb *msg)
static int | m3ua_tcp_cli_read_cb (struct osmo_stream_cli *conn, int res, struct msgb *msg)
static int | xua_cli_connect_cb (struct osmo_stream_cli *cli)
static int | xua_cli_close_and_reconnect (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)
bool | ss7_asp_is_started (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)
int | ss7_asp_ipa_srv_conn_rx_cb (struct osmo_stream_srv *conn, int res, struct msgb *msg)
int | ss7_asp_xua_srv_conn_rx_cb (struct osmo_stream_srv *conn, int res, struct msgb *msg)
int | xua_tcp_segmentation_cb (struct msgb *msg)
int | ss7_asp_m3ua_tcp_srv_conn_rx_cb (struct osmo_stream_srv *conn, int res, struct msgb *msg)
static void | xua_cli_close (struct osmo_stream_cli *cli)
int | ss7_asp_xua_srv_conn_closed_cb (struct osmo_stream_srv *srv)
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)
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.
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.
const char * | osmo_ss7_asp_get_name (const struct osmo_ss7_asp *asp)
| Get the name of a given ASP.
enum osmo_ss7_asp_protocol | osmo_ss7_asp_get_proto (const struct osmo_ss7_asp *asp)
| Get the proto of a given ASP.
int | osmo_ss7_asp_get_trans_proto (const struct osmo_ss7_asp *asp)
| Get the transport proto of a given ASP.
int | ss7_asp_get_fd (const struct osmo_ss7_asp *asp)
| Get the fd of a given ASP.

## Variables

struct value_string | osmo_ss7_asp_protocol_vals []
const struct value_string | osmo_ss7_asp_role_names []
static const uint16_t | prot2port []
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

## Function Documentation

## _setsockopt_peer_primary_addr()

int _setsockopt_peer_primary_addr | ( | int | fd,
|  | const struct osmo_sockaddr * | saddr )

static

Referenced by ss7_asp_apply_peer_primary_address().

## _setsockopt_primary_addr()

int _setsockopt_primary_addr | ( | int | fd,
|  | const struct osmo_sockaddr * | saddr )

static

Referenced by ss7_asp_apply_primary_address().

## asp_handle_sctp_notif_monitor_primary_address()

void asp_handle_sctp_notif_monitor_primary_address | ( | const struct osmo_ss7_asp * | asp,
|  | const union sctp_notification * | notif )

static

References osmo_ss7_asp::cfg, osmo_ss7_asp_peer::idx_primary, osmo_ss7_asp::remote, sctp_peer_addr_change_ev_addr_matches_our_primary(), and ss7_asp_apply_primary_address().

Referenced by ss7_asp_xua_srv_conn_rx_cb(), and xua_cli_read_cb().

## chop_v4_mapped_on_v6_prefix()

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

static

References len.

Referenced by ss7_asp_find_by_socket_addr().

## get_in_port()

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

static

Referenced by ss7_asp_find_by_socket_addr().

## get_logevel_by_sn_type()

int get_logevel_by_sn_type | ( | int | sn_type | ) |

static

Referenced by log_sctp_notification().

## ipa_cli_read_cb()

int ipa_cli_read_cb | ( | struct osmo_stream_cli * | conn,
|  | int | res,
|  | struct msgb * | msg )

static

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

Referenced by osmo_ss7_asp_restart().

## log_sctp_notification()

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 ss7_asp_xua_srv_conn_rx_cb(), and xua_cli_read_cb().

## m3ua_tcp_cli_read_cb()

int m3ua_tcp_cli_read_cb | ( | struct osmo_stream_cli * | conn,
|  | int | res,
|  | struct msgb * | msg )

static

References xua_common_hdr::data, M3UA_MSGC_XFER, M3UA_PPID, xua_common_hdr::msg_class, and xua_cli_read_cb().

Referenced by osmo_ss7_asp_restart().

## 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(), ss7_as_select_asp_broadcast(), ss7_as_select_asp_override(), ss7_as_select_asp_roundrobin(), sua_snm_ssn_available(), 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(), ss7_asp_xua_srv_conn_closed_cb(), and ss7_xua_server_destroy().

## 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 DEFUN(), ipa_asp_fsm_timer_cb(), ipa_asp_fsm_wait_id_resp(), and ipa_pong_timer_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_get_name()

const char * osmo_ss7_asp_get_name | ( | const struct osmo_ss7_asp * | asp | ) |

Get the name of a given ASP.

Parameters

  [in] | asp | The ASP for which the name is requested

Returns
  The name of the ASP, or NULL if not set

References osmo_ss7_asp::cfg, and osmo_ss7_asp::name.

## osmo_ss7_asp_get_proto()

enum osmo_ss7_asp_protocol osmo_ss7_asp_get_proto | ( | const struct osmo_ss7_asp * | asp | ) |

Get the proto of a given ASP.

Parameters

  [in] | asp | The ASP for which the proto is requested

Returns
  The proto of the ASP

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

## osmo_ss7_asp_get_trans_proto()

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

Get the transport proto of a given ASP.

Parameters

  [in] | asp | The ASP for which the transport proto is requested

Returns
  The transport proto of the ASP (one of IPPROTO_*)

References osmo_ss7_asp::cfg, and osmo_ss7_asp::trans_proto.

## 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 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, m3ua_tcp_cli_read_cb(), osmo_ss7_asp::max_attempts_present, osmo_ss7_asp::max_attempts_value, osmo_ss7_asp::max_init_timeo_present, osmo_ss7_asp::max_init_timeo_value, osmo_ss7_asp::max_instreams_present, osmo_ss7_asp::max_instreams_value, osmo_ss7_asp::name, osmo_ss7_asp::num_ostreams_present, osmo_ss7_asp::num_ostreams_value, OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, osmo_ss7_asp::role, osmo_ss7_asp::sctp_init, osmo_ss7_asp::server, ss7_asp_peer_snprintf(), ss7_initialized, osmo_ss7_asp::trans_proto, xua_asp_fsm_start(), xua_cli_close_and_reconnect(), xua_cli_connect_cb(), xua_cli_read_cb(), and xua_tcp_segmentation_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_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.

## sctp_peer_addr_change_ev_addr_matches_our_primary()

bool sctp_peer_addr_change_ev_addr_matches_our_primary | ( | const struct osmo_ss7_asp * | asp,
|  | const union sctp_notification * | notif )

static

References osmo_ss7_asp::cfg, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::idx_primary, and osmo_ss7_asp::remote.

Referenced by asp_handle_sctp_notif_monitor_primary_address().

## ss7_asp_alloc()

struct osmo_ss7_asp * ss7_asp_alloc | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | uint16_t | remote_port,
|  | uint16_t | local_port,
|  | int | trans_proto,
|  | 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_PROT_SUA, osmo_ss7_asp_protocol_name(), osmo_ss7_ensure_sccp(), osmo_ss7_asp_peer::port, osmo_ss7_asp::proto, osmo_ss7_asp::remote, ss7_asp_lm_timer_defaults, ss7_asp_peer_init(), ss7_asp_protocol_check_trans_proto(), ss7_asp_rcgd, osmo_ss7_asp::T_defs_lm, and osmo_ss7_asp::trans_proto.

Referenced by osmo_ss7_asp_find_or_create2().

## ss7_asp_apply_drop_local_address()

int ss7_asp_apply_drop_local_address | ( | const struct osmo_ss7_asp * | asp,
|  | unsigned int | loc_idx )

References osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp_peer::host, osmo_ss7_asp::is_server, osmo_ss7_asp::local, LOGPASP, and osmo_ss7_asp::server.

Referenced by DEFUN_ATTR().

## ss7_asp_apply_new_local_address()

int ss7_asp_apply_new_local_address | ( | const struct osmo_ss7_asp * | asp,
|  | unsigned int | loc_idx )

References osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp_peer::host, osmo_ss7_asp::is_server, osmo_ss7_asp::local, LOGPASP, and osmo_ss7_asp::server.

Referenced by DEFUN_ATTR().

## ss7_asp_apply_peer_primary_address()

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

References _setsockopt_peer_primary_addr(), osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, osmo_ss7_asp_peer::idx_primary, osmo_ss7_asp::is_server, osmo_ss7_asp::local, LOGPASP, osmo_ss7_asp_peer::port, and osmo_ss7_asp::server.

Referenced by DEFUN_ATTR(), xua_accept_cb(), and xua_cli_connect_cb().

## ss7_asp_apply_primary_address()

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

References _setsockopt_primary_addr(), osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp_peer::host, osmo_ss7_asp_peer::host_cnt, osmo_ss7_asp_peer::idx_primary, osmo_ss7_asp::is_server, LOGPASP, osmo_ss7_asp_peer::port, osmo_ss7_asp::remote, and osmo_ss7_asp::server.

Referenced by asp_handle_sctp_notif_monitor_primary_address(), DEFUN_ATTR(), xua_accept_cb(), and xua_cli_connect_cb().

## ss7_asp_find_by_socket_addr()

struct osmo_ss7_asp * ss7_asp_find_by_socket_addr | ( | int | fd,
|  | int | trans_proto )

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_cnt, osmo_ss7_asp::inst, osmo_ss7_asp::list, osmo_ss7_asp::local, osmo_ss7_instances, osmo_ss7_asp_peer::port, osmo_ss7_asp::remote, ss7_asp_peer_match_host(), ss7_initialized, and osmo_ss7_asp::trans_proto.

Referenced by xua_accept_cb().

## ss7_asp_get_fd()

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

Get the fd of a given ASP.

Parameters

  [in] | asp | The ASP for which the fd is requested

Returns
  The fd of the ASP if acailable, negative otherwise

References osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp::is_server, and osmo_ss7_asp::server.

Referenced by show_one_asp(), show_one_asp_assoc_status_tcp(), and show_one_asp_remaddr_tcp().

## ss7_asp_ipa_srv_conn_rx_cb()

int ss7_asp_ipa_srv_conn_rx_cb | ( | struct osmo_stream_srv * | conn,
|  | int | res,
|  | struct msgb * | msg )

References osmo_ss7_asp::asp_id, osmo_ss7_asp::ctrg, ipa_rx_msg(), and SS7_ASP_CTR_PKT_RX_TOTAL.

Referenced by xua_accept_cb().

## ss7_asp_is_started()

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

References osmo_ss7_asp::cfg, osmo_ss7_asp::client, osmo_ss7_asp::is_server, and osmo_ss7_asp::server.

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

## ss7_asp_m3ua_tcp_srv_conn_rx_cb()

int ss7_asp_m3ua_tcp_srv_conn_rx_cb | ( | struct osmo_stream_srv * | conn,
|  | int | res,
|  | struct msgb * | msg )

References osmo_ss7_asp::ctrg, xua_common_hdr::data, M3UA_MSGC_XFER, m3ua_rx_msg(), xua_common_hdr::msg_class, and SS7_ASP_CTR_PKT_RX_TOTAL.

Referenced by xua_accept_cb().

## ss7_asp_protocol_check_trans_proto()

bool ss7_asp_protocol_check_trans_proto | ( | enum osmo_ss7_asp_protocol | proto,
|  | int | trans_proto )

References OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_NONE, and OSMO_SS7_ASP_PROT_SUA.

Referenced by ss7_asp_alloc(), and ss7_xua_server_create2().

## 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(), ss7_asp_xua_srv_conn_rx_cb(), and xua_cli_read_cb().

## ss7_asp_set_default_peer_hosts()

bool 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, osmo_ss7_asp::local, osmo_ss7_asp::remote, ss7_asp_peer_add_host(), and ss7_ipv6_sctp_supported().

Referenced by osmo_sccp_simple_client_on_ss7_id(), and osmo_ss7_vty_go_parent().

## ss7_asp_xua_srv_conn_closed_cb()

int ss7_asp_xua_srv_conn_closed_cb | ( | struct osmo_stream_srv * | srv | ) |

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

## ss7_asp_xua_srv_conn_rx_cb()

int ss7_asp_xua_srv_conn_rx_cb | ( | struct osmo_stream_srv * | conn,
|  | int | res,
|  | struct msgb * | msg )

References asp_handle_sctp_notif_monitor_primary_address(), osmo_ss7_asp::cfg, osmo_ss7_asp::ctrg, log_sctp_notification(), LOGPASP, 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().

## ss7_default_trans_proto_for_asp_proto()

int ss7_default_trans_proto_for_asp_proto | ( | enum osmo_ss7_asp_protocol | proto | ) |

References OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, and OSMO_SS7_ASP_PROT_SUA.

Referenced by DEFUN_ATTR(), DEFUN_ATTR(), DEFUN_ATTR(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), osmo_sccp_simple_server_on_ss7_id(), osmo_ss7_asp_find(), osmo_ss7_asp_find_or_create(), ss7_xua_server_create(), ss7_xua_server_find(), write_one_asp(), and write_one_xua().

## xua_cli_close()

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

int 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(), osmo_ss7_asp_restart(), and xua_cli_read_cb().

## xua_cli_connect_cb()

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

static

References osmo_ss7_asp::asp_id, osmo_ss7_asp::cfg, osmo_ss7_asp::fi, osmo_ss7_asp::lm, LOGPASP, M3UA_MSG_HEADROOM, M3UA_MSG_SIZE, OSMO_SS7_ASP_PROT_IPA, OSMO_XLM_PRIM_M_SCTP_ESTABLISH, osmo_xua_layer_manager::prim_cb, osmo_ss7_asp::proto, osmo_ss7_asp::sock_name, ss7_asp_apply_peer_primary_address(), ss7_asp_apply_primary_address(), osmo_ss7_asp::trans_proto, XUA_ASP_E_M_ASP_UP_REQ, and xua_asp_send_xlm_prim_simple().

Referenced by osmo_ss7_asp_restart().

## xua_cli_read_cb()

int xua_cli_read_cb | ( | struct osmo_stream_cli * | conn,
|  | int | res,
|  | struct msgb * | msg )

static

References asp_handle_sctp_notif_monitor_primary_address(), osmo_ss7_asp::cfg, osmo_ss7_asp::ctrg, log_sctp_notification(), LOGPASP, 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 m3ua_tcp_cli_read_cb(), and osmo_ss7_asp_restart().

## xua_tcp_segmentation_cb()

int xua_tcp_segmentation_cb | ( | struct msgb * | msg | ) |

References xua_common_hdr::data, msg_length, and xua_common_hdr::msg_length.

Referenced by osmo_ss7_asp_restart(), and xua_accept_cb().

## Variable Documentation

## 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_asp_rcg_idx

unsigned int g_ss7_asp_rcg_idx

static

Referenced by ss7_asp_alloc().

## 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:155
OSMO_SS7_ASP_PROT_NONE
@ OSMO_SS7_ASP_PROT_NONE
Definition osmo_ss7.h:154
OSMO_SS7_ASP_PROT_IPA
@ OSMO_SS7_ASP_PROT_IPA
Definition osmo_ss7.h:157
OSMO_SS7_ASP_PROT_M3UA
@ OSMO_SS7_ASP_PROT_M3UA
Definition osmo_ss7.h:156

Referenced by osmo_ss7_asp_protocol_name(), parse_asp_proto(), show_one_asp(), ss7_xua_server_bind(), ss7_xua_server_create2(), 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:240
OSMO_SS7_ASP_ROLE_ASP
@ OSMO_SS7_ASP_ROLE_ASP
Definition osmo_ss7.h:239
OSMO_SS7_ASP_ROLE_IPSP
@ OSMO_SS7_ASP_ROLE_IPSP
Definition osmo_ss7.h:241

Referenced by show_one_asp(), and 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:29

Referenced by osmo_ss7_asp_protocol_port().

## 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 ss7_asp.h:25
SS7_ASP_CTR_PKT_RX_UNKNOWN
@ SS7_ASP_CTR_PKT_RX_UNKNOWN
Definition ss7_asp.h:24
SS7_ASP_CTR_PKT_RX_TOTAL
@ SS7_ASP_CTR_PKT_RX_TOTAL
Definition ss7_asp.h:23

## 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_asp.c:186

Referenced by ss7_asp_alloc().