libosmo-sigtran: src/ss7_asp.h File Reference

libosmo-sigtran 2.2.1.95-893c Osmocom SIGTRAN library

Data Structures | Macros | Enumerations | Functions | Variables
ss7_asp.h File Reference
`#include "config.h"`
`#include <stdint.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/fsm.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/core/tdef.h>`
`#include <osmocom/netif/stream.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include "ss7_asp_peer.h"`
`#include "ss7_internal.h"`

Go to the source code of this file.

## Data Structures
struct | osmo_xua_layer_manager
struct | osmo_ss7_asp

## Macros
#define | SS7_ASP_XUA_DEFAULT_T_ACK_SEC 2
#define | SS7_ASP_XUA_DEFAULT_T_BEAT_SEC 30
#define | LOGPASP(asp, subsys, level, fmt, args ...) _LOGSS7((asp)->inst, subsys, level, "ASP(%s) " fmt, (asp)->cfg.name, ## args)

## Enumerations
enum | ss7_asp_xua_timer { SS7_ASP_XUA_T_ACK = 1 , SS7_ASP_XUA_T_BEAT , SS7_ASP_XUA_TIMERS_LEN }
enum | ss7_asp_ctr { SS7_ASP_CTR_PKT_RX_TOTAL , SS7_ASP_CTR_PKT_RX_UNKNOWN , SS7_ASP_CTR_PKT_RX_NI_MISMATCH , SS7_ASP_CTR_PKT_TX_TOTAL }

## Functions
struct osmo_xua_layer_manager * | xua_layer_manager_default_alloc (struct osmo_ss7_asp *asp)
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)
bool | ss7_asp_set_default_peer_hosts (struct osmo_ss7_asp *asp)
bool | ss7_asp_is_started (const struct osmo_ss7_asp *asp)
int | ss7_asp_get_fd (const struct osmo_ss7_asp *asp)
| Get the fd of a given ASP. More...
int | ss7_asp_disconnect_stream (struct osmo_ss7_asp *asp)
int | ss7_asp_apply_tcp_pars (const struct osmo_ss7_asp *asp)
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)
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)
void | ss7_asp_set_blocked (struct osmo_ss7_asp *asp, bool blocked)
void | ss7_asp_restart_after_reconfigure (struct osmo_ss7_asp *asp)
void | ss7_asp_xua_layer_manager_start (struct osmo_ss7_asp *asp)
unsigned int | ss7_asp_get_all_rctx (const struct osmo_ss7_asp *asp, uint32_t *rctx, unsigned int rctx_size, const struct osmo_ss7_as *excl_as)
unsigned int | ss7_asp_get_all_rctx_be (const struct osmo_ss7_asp *asp, uint32_t *rctx, unsigned int rctx_size, const struct osmo_ss7_as *excl_as)
struct osmo_ss7_as * | ss7_asp_find_as_by_rctx (const struct osmo_ss7_asp *asp, uint32_t rctx)
| Find Application Server associated to ASP by given routing context. More...
struct osmo_ss7_as * | ss7_asp_get_first_as (const struct osmo_ss7_asp *asp)
int | ss7_asp_determine_traf_mode (const struct osmo_ss7_asp *asp)
bool | ss7_asp_check_remote_asp_id_unique (const struct osmo_ss7_asp *asp, uint32_t remote_asp_id)

## Variables
const struct value_string | ss7_asp_xua_timer_names []
const struct osmo_tdef | ss7_asp_xua_timer_defaults [SS7_ASP_XUA_TIMERS_LEN]

## Macro Definition Documentation

## ◆ LOGPASP

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

## ◆ SS7_ASP_XUA_DEFAULT_T_ACK_SEC

#define SS7_ASP_XUA_DEFAULT_T_ACK_SEC 2

## ◆ SS7_ASP_XUA_DEFAULT_T_BEAT_SEC

#define SS7_ASP_XUA_DEFAULT_T_BEAT_SEC 30

## 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_RX_NI_MISMATCH |
SS7_ASP_CTR_PKT_TX_TOTAL |

## ◆ ss7_asp_xua_timer

enum ss7_asp_xua_timer

Enumerator
SS7_ASP_XUA_T_ACK |
SS7_ASP_XUA_T_BEAT |
SS7_ASP_XUA_TIMERS_LEN |

## Function Documentation

## ◆ 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_asp::adm_state, osmo_ss7_instance::asp_list, osmo_ss7_asp::assoc_as_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, NULL, 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, osmo_ss7_asp::shutdown, ss7_asp_lm_timer_defaults, ss7_asp_peer_init(), ss7_asp_protocol_check_trans_proto(), ss7_asp_rcgd, ss7_asp_xua_timer_defaults, osmo_ss7_asp::T_defs_lm, osmo_ss7_asp::T_defs_xua, 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_apply_tcp_pars()

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

References ss7_asp_apply_tcp_keepalive(), and ss7_asp_apply_tcp_user_timeout().

Referenced by ss7_asp_start_client(), and xua_accept_cb().

## ◆ ss7_asp_check_remote_asp_id_unique()

bool ss7_asp_check_remote_asp_id_unique | ( | const struct osmo_ss7_asp * | asp,
|  | uint32_t | remote_asp_id
| ) |  |

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, ss7_as_asp_assoc::asp_entry, osmo_ss7_asp::assoc_as_list, and ss7_as_find_asp_by_remote_asp_id().

Referenced by xua_asp_fsm_down(), and xua_asp_fsm_inactive().

## ◆ ss7_asp_determine_traf_mode()

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

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, ss7_as_asp_assoc::asp_entry, osmo_ss7_asp::assoc_as_list, osmo_ss7_as::cfg, osmo_ss7_as::mode, and osmo_ss7_as::mode_set_by_vty.

Referenced by asp_act_needed(), and peer_send().

## ◆ ss7_asp_disconnect_stream()

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

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

Referenced by ipa_t_beat_cb(), osmo_ss7_asp_restart(), osmo_xlm_sap_down(), ss7_xua_server_destroy(), xua_accept_cb(), and xua_t_beat_cb().

## ◆ ss7_asp_find_as_by_rctx()

struct osmo_ss7_as * ss7_asp_find_as_by_rctx | ( | const struct osmo_ss7_asp * | asp,
|  | uint32_t | rctx
| ) |  |

Find Application Server associated to ASP by given routing context.

Parameters

  [in] | asp | Application Server Process through which to send
  [in] | rctx | Routing Context

Returns
  pointer to Application Server on success; NULL otherwise

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, ss7_as_asp_assoc::asp_entry, osmo_ss7_asp::assoc_as_list, osmo_ss7_as::cfg, osmo_ss7_routing_key::context, NULL, and osmo_ss7_as::routing_key.

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

## ◆ ss7_asp_get_all_rctx()

unsigned int ss7_asp_get_all_rctx | ( | const struct osmo_ss7_asp * | asp,
|  | uint32_t * | rctx,
|  | unsigned int | rctx_size,
|  | const struct osmo_ss7_as * | excl_as
| ) |  |

References _ss7_asp_get_all_rctx().

Referenced by fill_notify_route_ctx().

## ◆ ss7_asp_get_all_rctx_be()

unsigned int ss7_asp_get_all_rctx_be | ( | const struct osmo_ss7_asp * | asp,
|  | uint32_t * | rctx,
|  | unsigned int | rctx_size,
|  | const struct osmo_ss7_as * | excl_as
| ) |  |

References _ss7_asp_get_all_rctx().

Referenced by sua_snm_ssn_available(), tx_daud_pc(), xua_asp_tx_snm_daud_address_book(), xua_msg_add_asp_rctx(), xua_snm_pc_available(), xua_snm_rx_daud(), xua_snm_scon(), and xua_snm_upu().

## ◆ 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_get_first_as()

struct osmo_ss7_as * ss7_asp_get_first_as | ( | const struct osmo_ss7_asp * | asp | ) |

References ss7_as_asp_assoc::as, ss7_as_asp_assoc::asp, ss7_as_asp_assoc::asp_entry, osmo_ss7_asp::assoc_as_list, and NULL.

Referenced by ipa_asp_fsm_start(), ipa_rx_msg_osmo_ext_tcap_routing(), ipa_rx_msg_up(), and xua_find_as_for_asp().

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

## ◆ ss7_asp_restart_after_reconfigure()

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

References osmo_ss7_asp_restart(), and ss7_asp_set_default_peer_hosts().

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

## ◆ ss7_asp_set_blocked()

void ss7_asp_set_blocked | ( | struct osmo_ss7_asp * | asp,
|  | bool | blocked
| ) |  |

References osmo_ss7_asp::adm_state, osmo_ss7_asp::blocked, osmo_ss7_asp::cfg, osmo_ss7_asp::fi, LOGPASP, NULL, XUA_ASP_E_ADM_BLOCKED, and XUA_ASP_E_ADM_UNBLOCKED.

Referenced by DEFUN_ATTR().

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

## ◆ ss7_asp_xua_layer_manager_start()

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

References osmo_ss7_asp::cfg, osmo_ss7_asp::lm, OSMO_SS7_ASP_PROT_IPA, osmo_ss7_asp::proto, and xua_layer_manager_default_alloc().

Referenced by osmo_ss7_asp_restart(), and xua_accept_cb().

## ◆ xua_layer_manager_default_alloc()

struct osmo_xua_layer_manager * xua_layer_manager_default_alloc | ( | struct osmo_ss7_asp * | asp | ) |

References xua_layer_manager_default_priv::asp, osmo_ss7_asp::cfg, default_lm_prim_cb(), xua_layer_manager_default_priv::fi, osmo_xua_layer_manager::free_func, osmo_ss7_asp::name, NULL, osmo_xua_layer_manager::prim_cb, osmo_xua_layer_manager::priv, xua_default_lm_fsm, and xua_layer_manager_default_free().

Referenced by ss7_asp_xua_layer_manager_start().

## Variable Documentation

## ◆ ss7_asp_xua_timer_defaults

const struct osmo_tdef ss7_asp_xua_timer_defaults[SS7_ASP_XUA_TIMERS_LEN]
| extern

Referenced by gen_asp_timer_xua_cmd_strs(), and ss7_asp_alloc().

## ◆ ss7_asp_xua_timer_names

const struct value_string ss7_asp_xua_timer_names[]
| extern

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