libosmo-sigtran 2.2.1.64-e866 Osmocom SIGTRAN library

Functions
xua_snm.c File Reference
`#include <stdint.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/core/talloc.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include <osmocom/sigtran/protocol/m3ua.h>`
`#include <osmocom/sigtran/protocol/sua.h>`
`#include <osmocom/sigtran/protocol/mtp.h>`
`#include "ss7_as.h"`
`#include "ss7_asp.h"`
`#include "ss7_route.h"`
`#include "ss7_internal.h"`
`#include "ss7_route_table.h"`
`#include "ss7_user.h"`
`#include "xua_internal.h"`
`#include "sccp_internal.h"`

## Functions
| osmo_static_assert (M3UA_SNM_DUNA==SUA_SNM_DUNA, _sa_duna)
| osmo_static_assert (M3UA_SNM_DAVA==SUA_SNM_DAVA, _sa_dava)
| osmo_static_assert (M3UA_SNM_DAUD==SUA_SNM_DAUD, _sa_dava)
| osmo_static_assert (M3UA_IEI_AFFECTED_PC==SUA_IEI_AFFECTED_PC, _sa_aff_pc)
| osmo_static_assert (M3UA_IEI_ROUTE_CTX==SUA_IEI_ROUTE_CTX, _sa_rctx)
| osmo_static_assert (M3UA_IEI_INFO_STRING==SUA_IEI_INFO_STRING, _sa_inf_str)
static const char * | format_affected_pcs_c (void *ctx, const struct osmo_ss7_instance *s7i, const struct xua_msg_part *ie_aff_pc)
void | xua_tx_snm_available (struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_str, bool available)
void | xua_tx_snm_daud (struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_str)
static void | xua_tx_upu (struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str)
static void | xua_tx_scon (struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *concerned_dpc, const uint8_t *cong_level, const char *info_string)
static void | xua_snm_pc_available_to_mtp_users (struct osmo_ss7_instance *s7i, const uint32_t *aff_pc, unsigned int num_aff_pc, bool available)
static void | xua_snm_srm_pc_available_single (struct osmo_ss7_as *as, uint32_t pc, bool available)
static void | xua_snm_srm_pc_available (struct osmo_ss7_as *as, const uint32_t *aff_pc, unsigned int num_aff_pc, bool available)
void | xua_snm_pc_available (struct osmo_ss7_as *as, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_str, bool available)
static void | sua_snm_ssn_available_to_sccp (struct osmo_sccp_instance *sccp, uint32_t aff_pc, uint32_t aff_ssn, uint32_t smi, bool available)
static void | sua_snm_ssn_available (struct osmo_ss7_as *as, uint32_t aff_pc, uint32_t aff_ssn, const uint32_t *smi, const char *info_str, bool available)
static void | xua_snm_upu (struct osmo_ss7_as *as, uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str)
static void | xua_snm_scon_to_mtp_users (struct osmo_ss7_instance *s7i, const uint32_t *aff_pc, unsigned int num_aff_pc, bool cong_level_present, uint8_t cong_level)
static void | xua_snm_scon (struct osmo_ss7_as *as, const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *concerned_dpc, const uint8_t *cong_level, const char *info_string)
void | xua_snm_rx_daud (struct osmo_ss7_asp *asp, struct xua_msg *xua)
void | xua_snm_rx_duna (struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
void | xua_snm_rx_dava (struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
void | xua_snm_rx_dupu (struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
void | xua_snm_rx_scon (struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)

## Function Documentation

## ◆ format_affected_pcs_c()

static const char * format_affected_pcs_c | ( | void * | ctx,
|  | const struct osmo_ss7_instance * | s7i,
|  | const struct xua_msg_part * | ie_aff_pc
| ) |  |
| static

References xua_msg_part::dat, xua_msg_part::len, osmo_ss7_pointcode_print(), and pc.

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

## ◆ osmo_static_assert() [1/6]

osmo_static_assert | ( | M3UA_IEI_AFFECTED_PC | = `=SUA_IEI_AFFECTED_PC`,
|  | _sa_aff_pc |
| ) |  |

## ◆ osmo_static_assert() [2/6]

osmo_static_assert | ( | M3UA_IEI_INFO_STRING | = `=SUA_IEI_INFO_STRING`,
|  | _sa_inf_str |
| ) |  |

## ◆ osmo_static_assert() [3/6]

osmo_static_assert | ( | M3UA_IEI_ROUTE_CTX | = `=SUA_IEI_ROUTE_CTX`,
|  | _sa_rctx |
| ) |  |

## ◆ osmo_static_assert() [4/6]

osmo_static_assert | ( | M3UA_SNM_DAUD | = `=SUA_SNM_DAUD`,
|  | _sa_dava |
| ) |  |

## ◆ osmo_static_assert() [5/6]

osmo_static_assert | ( | M3UA_SNM_DAVA | = `=SUA_SNM_DAVA`,
|  | _sa_dava |
| ) |  |

## ◆ osmo_static_assert() [6/6]

osmo_static_assert | ( | M3UA_SNM_DUNA | = `=SUA_SNM_DUNA`,
|  | _sa_duna |
| ) |  |

## ◆ sua_snm_ssn_available()

static void sua_snm_ssn_available | ( | struct osmo_ss7_as * | as,
|  | uint32_t | aff_pc,
|  | uint32_t | aff_ssn,
|  | const uint32_t * | smi,
|  | const char * | info_str,
|  | bool | available
| ) |  |
| static

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, osmo_ss7_as::inst, osmo_ss7_asp::list, osmo_ss7_asp_active(), OSMO_SS7_ASP_PROT_SUA, OSMO_SS7_ASP_ROLE_SG, OSMO_SS7_MAX_RCTX_COUNT, osmo_ss7_asp::proto, osmo_ss7_asp::role, osmo_ss7_instance::sccp, smi, ss7_asp_get_all_rctx_be(), sua_snm_ssn_available_to_sccp(), and sua_tx_snm_available().

Referenced by xua_snm_rx_dava(), and xua_snm_rx_duna().

## ◆ sua_snm_ssn_available_to_sccp()

static void sua_snm_ssn_available_to_sccp | ( | struct osmo_sccp_instance * | sccp,
|  | uint32_t | aff_pc,
|  | uint32_t | aff_ssn,
|  | uint32_t | smi,
|  | bool | available
| ) |  |
| static

References sccp_scmg_rx_ssn_allowed(), sccp_scmg_rx_ssn_prohibited(), and smi.

Referenced by sua_snm_ssn_available().

## ◆ xua_snm_pc_available()

void xua_snm_pc_available | ( | struct osmo_ss7_as * | as,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | const char * | info_str,
|  | bool | available
| ) |  |

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, osmo_ss7_as::inst, osmo_ss7_asp::list, osmo_ss7_as_has_asp(), osmo_ss7_asp_active(), OSMO_SS7_ASP_ROLE_SG, OSMO_SS7_MAX_RCTX_COUNT, osmo_ss7_asp::role, ss7_asp_get_all_rctx_be(), xua_snm_pc_available_to_mtp_users(), xua_snm_srm_pc_available(), and xua_tx_snm_available().

Referenced by as_snm_pc_available(), as_snm_pc_unavailable(), xua_as_fsm_onenter(), xua_snm_rx_dava(), and xua_snm_rx_duna().

## ◆ xua_snm_pc_available_to_mtp_users()

static void xua_snm_pc_available_to_mtp_users | ( | struct osmo_ss7_instance * | s7i,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | bool | available
| ) |  |
| static

References mtp_pause_ind_up_to_all_users(), mtp_resume_ind_up_to_all_users(), and pc.

Referenced by xua_snm_pc_available().

## ◆ xua_snm_rx_daud()

void xua_snm_rx_daud | ( | struct osmo_ss7_asp * | asp,
|  | struct xua_msg * | xua
| ) |  |

References xua_msg_part::dat, format_affected_pcs_c(), osmo_ss7_asp::inst, xua_msg_part::len, LOGPASP, M3UA_IEI_AFFECTED_PC, M3UA_IEI_INFO_STRING, NULL, osmo_ss7_asp_get_log_subsys(), OSMO_SS7_MAX_RCTX_COUNT, pc, osmo_ss7_instance::rtable_system, ss7_asp_get_all_rctx_be(), ss7_route_table_dpc_is_accessible(), xua_msg_find_tag(), xua_msg_get_str(), and xua_tx_snm_available().

Referenced by m3ua_rx_snm_asp(), m3ua_rx_snm_ipsp(), m3ua_rx_snm_sg(), sua_rx_snm_asp(), sua_rx_snm_ipsp(), and sua_rx_snm_sg().

## ◆ xua_snm_rx_dava()

void xua_snm_rx_dava | ( | struct osmo_ss7_asp * | asp,
|  | struct osmo_ss7_as * | as,
|  | struct xua_msg * | xua
| ) |  |

References osmo_ss7_asp::cfg, xua_msg_part::dat, format_affected_pcs_c(), osmo_ss7_asp::inst, xua_msg_part::len, LOGPASP, M3UA_IEI_AFFECTED_PC, M3UA_IEI_INFO_STRING, osmo_ss7_asp_get_log_subsys(), OSMO_SS7_ASP_PROT_SUA, OSMO_SS7_ASP_ROLE_ASP, pc, osmo_ss7_asp::proto, osmo_ss7_asp::role, smi, ssn, SUA_IEI_SMI, SUA_IEI_SSN, sua_snm_ssn_available(), xua_msg_find_tag(), xua_msg_get_str(), xua_msg_get_u32p(), xua_msg_part_get_u32(), and xua_snm_pc_available().

Referenced by m3ua_rx_snm_asp(), and sua_rx_snm_asp().

## ◆ xua_snm_rx_duna()

void xua_snm_rx_duna | ( | struct osmo_ss7_asp * | asp,
|  | struct osmo_ss7_as * | as,
|  | struct xua_msg * | xua
| ) |  |

References osmo_ss7_asp::cfg, xua_msg_part::dat, format_affected_pcs_c(), osmo_ss7_asp::inst, xua_msg_part::len, LOGPASP, M3UA_IEI_AFFECTED_PC, M3UA_IEI_INFO_STRING, osmo_ss7_asp_get_log_subsys(), OSMO_SS7_ASP_PROT_SUA, OSMO_SS7_ASP_ROLE_ASP, pc, osmo_ss7_asp::proto, osmo_ss7_asp::role, smi, ssn, SUA_IEI_SMI, SUA_IEI_SSN, sua_snm_ssn_available(), xua_msg_find_tag(), xua_msg_get_str(), xua_msg_get_u32p(), xua_msg_part_get_u32(), and xua_snm_pc_available().

Referenced by m3ua_rx_snm_asp(), and sua_rx_snm_asp().

## ◆ xua_snm_rx_dupu()

void xua_snm_rx_dupu | ( | struct osmo_ss7_asp * | asp,
|  | struct osmo_ss7_as * | as,
|  | struct xua_msg * | xua
| ) |  |

References osmo_ss7_asp::cfg, osmo_ss7_asp::inst, LOGPASP, M3UA_IEI_USER_CAUSE, mtp_si_vals, osmo_ss7_asp_get_log_subsys(), OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, OSMO_SS7_ASP_ROLE_ASP, osmo_ss7_pointcode_print(), osmo_ss7_asp::proto, osmo_ss7_asp::role, SUA_IEI_AFFECTED_PC, SUA_IEI_INFO_STRING, SUA_IEI_USER_CAUSE, xua_msg_get_str(), xua_msg_get_u32(), and xua_snm_upu().

Referenced by m3ua_rx_snm_asp(), and sua_rx_snm_asp().

## ◆ xua_snm_rx_scon()

void xua_snm_rx_scon | ( | struct osmo_ss7_asp * | asp,
|  | struct osmo_ss7_as * | as,
|  | struct xua_msg * | xua
| ) |  |

References xua_msg_part::dat, format_affected_pcs_c(), osmo_ss7_asp::inst, xua_msg_part::len, LOGPASP, M3UA_IEI_AFFECTED_PC, M3UA_IEI_CONC_DEST, M3UA_IEI_CONG_IND, M3UA_IEI_INFO_STRING, osmo_ss7_asp_get_log_subsys(), xua_msg_find_tag(), xua_msg_get_str(), xua_msg_get_u32p(), and xua_snm_scon().

Referenced by m3ua_rx_snm_asp(), m3ua_rx_snm_ipsp(), m3ua_rx_snm_sg(), sua_rx_snm_asp(), sua_rx_snm_ipsp(), and sua_rx_snm_sg().

## ◆ xua_snm_scon()

static void xua_snm_scon | ( | struct osmo_ss7_as * | as,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | const uint32_t * | concerned_dpc,
|  | const uint8_t * | cong_level,
|  | const char * | info_string
| ) |  |
| static

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, osmo_ss7_as::inst, osmo_ss7_asp::list, osmo_ss7_asp_active(), OSMO_SS7_ASP_ROLE_SG, OSMO_SS7_MAX_RCTX_COUNT, osmo_ss7_asp::role, ss7_asp_get_all_rctx_be(), xua_snm_scon_to_mtp_users(), and xua_tx_scon().

Referenced by xua_snm_rx_scon().

## ◆ xua_snm_scon_to_mtp_users()

static void xua_snm_scon_to_mtp_users | ( | struct osmo_ss7_instance * | s7i,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | bool | cong_level_present,
|  | uint8_t | cong_level
| ) |  |
| static

References mtp_status_ind_up_to_all_users(), MTP_UNAVAIL_C_CONGESTED, and pc.

Referenced by xua_snm_scon().

## ◆ xua_snm_srm_pc_available()

static void xua_snm_srm_pc_available | ( | struct osmo_ss7_as * | as,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | bool | available
| ) |  |
| static

References osmo_ss7_route::as, osmo_ss7_route::mask, pc, and xua_snm_srm_pc_available_single().

Referenced by xua_snm_pc_available().

## ◆ xua_snm_srm_pc_available_single()

static void xua_snm_srm_pc_available_single | ( | struct osmo_ss7_as * | as,
|  | uint32_t | pc,
|  | bool | available
| ) |  |
| static

References osmo_ss7_route::as, osmo_ss7_as::cfg, osmo_ss7_as::inst, LOGPAS, osmo_ss7_as::name, osmo_ss7_pointcode_print(), OSMO_SS7_ROUTE_STATUS_AVAILABLE, OSMO_SS7_ROUTE_STATUS_UNAVAILABLE, pc, osmo_ss7_instance::rtable_system, ss7_route_create(), ss7_route_status_name(), ss7_route_table_find_route_by_dpc_mask_as(), ss7_route_table_update_route_status_by_as(), and ss7_route_update_route_status().

Referenced by xua_snm_srm_pc_available().

## ◆ xua_snm_upu()

static void xua_snm_upu | ( | struct osmo_ss7_as * | as,
|  | uint32_t | dpc,
|  | uint16_t | user,
|  | uint16_t | cause,
|  | const char * | info_str
| ) |  |
| static

References osmo_ss7_instance::asp_list, osmo_ss7_asp::cfg, dpc, osmo_ss7_as::inst, mtp_prim_status_ind_alloc(), osmo_ss7_asp_active(), OSMO_SS7_ASP_ROLE_SG, OSMO_SS7_MAX_RCTX_COUNT, osmo_ss7_user_find_by_si(), osmo_ss7_asp::role, ss7_asp_get_all_rctx_be(), ss7_user_mtp_sap_prim_up(), and xua_tx_upu().

Referenced by xua_snm_rx_dupu().

## ◆ xua_tx_scon()

static void xua_tx_scon | ( | struct osmo_ss7_asp * | asp,
|  | const uint32_t * | rctx,
|  | unsigned int | num_rctx,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | const uint32_t * | concerned_dpc,
|  | const uint8_t * | cong_level,
|  | const char * | info_string
| ) |  |
| static

References osmo_ss7_asp::cfg, m3ua_tx_snm_congestion(), NULL, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp::proto, and sua_tx_snm_congestion().

Referenced by xua_snm_scon().

## ◆ xua_tx_snm_available()

void xua_tx_snm_available | ( | struct osmo_ss7_asp * | asp,
|  | const uint32_t * | rctx,
|  | unsigned int | num_rctx,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | const char * | info_str,
|  | bool | available
| ) |  |

References osmo_ss7_asp::cfg, m3ua_tx_snm_available(), NULL, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp::proto, and sua_tx_snm_available().

Referenced by as_tx_duna_during_asp_act(), xua_snm_pc_available(), and xua_snm_rx_daud().

## ◆ xua_tx_snm_daud()

void xua_tx_snm_daud | ( | struct osmo_ss7_asp * | asp,
|  | const uint32_t * | rctx,
|  | unsigned int | num_rctx,
|  | const uint32_t * | aff_pc,
|  | unsigned int | num_aff_pc,
|  | const char * | info_str
| ) |  |

References osmo_ss7_asp::cfg, m3ua_tx_snm_daud(), NULL, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp::proto, and sua_tx_snm_daud().

Referenced by tx_daud_pc(), and xua_asp_tx_snm_daud_address_book().

## ◆ xua_tx_upu()

static void xua_tx_upu | ( | struct osmo_ss7_asp * | asp,
|  | const uint32_t * | rctx,
|  | unsigned int | num_rctx,
|  | uint32_t | dpc,
|  | uint16_t | user,
|  | uint16_t | cause,
|  | const char * | info_str
| ) |  |
| static

References osmo_ss7_asp::cfg, dpc, m3ua_tx_dupu(), OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp::proto, and sua_tx_dupu().

Referenced by xua_snm_upu().