libosmo-sigtran 2.1.0.165-6ea6 Osmocom SIGTRAN library

Functions
sccp_scrc.c File Reference
`#include <stdbool.h>`
`#include <errno.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/sccp/sccp_types.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include <osmocom/sigtran/sccp_sap.h>`
`#include <osmocom/sigtran/sccp_helpers.h>`
`#include <osmocom/sigtran/protocol/sua.h>`
`#include <osmocom/sigtran/protocol/mtp.h>`
`#include "sccp_instance.h"`
`#include "sccp_internal.h"`
`#include "ss7_as.h"`
`#include "ss7_instance.h"`
`#include "ss7_linkset.h"`
`#include "ss7_route.h"`
`#include "ss7_route_table.h"`
`#include "xua_internal.h"`

## Functions
static bool | sua_is_connectionless (struct xua_msg *xua)
static bool | sua_is_cr (struct xua_msg *xua)
static bool | dpc_accessible (struct osmo_sccp_instance *inst, uint32_t dpc)
static bool | sccp_available (struct osmo_sccp_instance *inst, const struct osmo_sccp_addr *addr)
static int | sua2sccp_tx_m3ua (struct osmo_sccp_instance *inst, struct xua_msg *sua)
static int | gen_mtp_transfer_req_xua (struct osmo_sccp_instance *inst, struct xua_msg *xua, const struct osmo_sccp_addr *called)
static int | translate (struct osmo_sccp_instance *inst, const struct osmo_sccp_addr *called, struct osmo_sccp_addr *translated)
static int | scrc_local_out_common (struct osmo_sccp_instance *inst, struct xua_msg *xua, const struct osmo_sccp_addr *called)
static int | scrc_node_12 (struct osmo_sccp_instance *inst, struct xua_msg *xua, const struct osmo_sccp_addr *called)
static int | scrc_node_2 (struct osmo_sccp_instance *inst, struct xua_msg *xua)
static int | scrc_node_7 (struct osmo_sccp_instance *inst, struct xua_msg *xua, const struct osmo_sccp_addr *called)
static int | scrc_node_4 (struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t return_cause)
static int | scrc_translate_node_9 (struct osmo_sccp_instance *inst, struct xua_msg *xua, const struct osmo_sccp_addr *called)
static int | scrc_node_6 (struct osmo_sccp_instance *inst, struct xua_msg *xua, const struct osmo_sccp_addr *called)
int | sccp_scrc_rx_scoc_conn_msg (struct osmo_sccp_instance *inst, struct xua_msg *xua)
int | sccp_scrc_rx_sclc_msg (struct osmo_sccp_instance *inst, struct xua_msg *xua)
static int | ensure_opc_in_calling_ssn (struct osmo_sccp_instance *inst, struct xua_msg *xua)
int | scrc_rx_mtp_xfer_ind_xua (struct osmo_sccp_instance *inst, struct xua_msg *xua)

## Function Documentation

## ◆ dpc_accessible()

static bool dpc_accessible | ( | struct osmo_sccp_instance * | inst,
|  | uint32_t | dpc
| ) |  |
| static

References dpc, LOGPSCI, MAX_PC_STR_LEN, osmo_ss7_pc_is_local(), osmo_ss7_pointcode_print_buf(), osmo_ss7_instance::rtable_system, osmo_sccp_instance::ss7, and ss7_route_table_dpc_is_accessible().

Referenced by scrc_node_2().

## ◆ ensure_opc_in_calling_ssn()

static int ensure_opc_in_calling_ssn | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |
| static

References LOGPSCI, xua_msg::mtp, osmo_mtp_transfer_param::opc, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, OSMO_SCCP_RI_SSN_PC, osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ri, sua_addr_parse(), SUA_IEI_SRC_ADDR, xua_dialect_sua, xua_hdr_dump(), xua_msg_add_sccp_addr(), and xua_msg_free_tag().

Referenced by scrc_rx_mtp_xfer_ind_xua().

## ◆ gen_mtp_transfer_req_xua()

static int gen_mtp_transfer_req_xua | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | const struct osmo_sccp_addr * | called
| ) |  |
| static

References osmo_ss7_route::as, osmo_ss7_as::cfg, osmo_ss7_linkset::cfg, osmo_ss7_route::dest, osmo_mtp_transfer_param::dpc, xua_msg::hdr, osmo_ss7_as::inst, osmo_ss7_route::linkset, LOGPSCI, xua_common_hdr::msg_class, xua_msg::mtp, osmo_ss7_linkset::name, osmo_mtp_transfer_param::opc, osmo_ss7_route_label::opc, OSMO_SCCP_ADDR_T_PC, OSMO_SS7_ASP_PROT_IPA, OSMO_SS7_ASP_PROT_M3UA, OSMO_SS7_ASP_PROT_SUA, osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_ss7_as::proto, sccp_rout_fail_enqueue(), osmo_mtp_transfer_param::sls, osmo_sccp_instance::ss7, ss7_instance_lookup_route(), ss7_route_label_to_str(), sua2sccp_tx_m3ua(), sua_addr_parse(), SUA_IEI_SRC_ADDR, SUA_MSGC_CO, and sua_tx_xua_as().

Referenced by scrc_node_12().

## ◆ sccp_available()

static bool sccp_available | ( | struct osmo_sccp_instance * | inst,
|  | const struct osmo_sccp_addr * | addr
| ) |  |
| static

Referenced by scrc_node_2().

## ◆ sccp_scrc_rx_sclc_msg()

int sccp_scrc_rx_sclc_msg | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |

References xua_msg::hdr, LOGPSCI, xua_common_hdr::msg_type, OSMO_SCCP_RI_GT, osmo_sccp_addr::ri, scrc_local_out_common(), scrc_node_12(), scrc_node_7(), sua_addr_parse(), SUA_CL_CLDR, SUA_IEI_DEST_ADDR, xua_dialect_sua, xua_hdr_dump(), and xua_msg_dump().

Referenced by sccp_sclc_rx_scrc_rout_fail(), and xua_gen_encode_and_send().

## ◆ sccp_scrc_rx_scoc_conn_msg()

int sccp_scrc_rx_scoc_conn_msg | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |

References xua_msg::hdr, LOGPSCI, xua_common_hdr::msg_type, scrc_local_out_common(), scrc_node_2(), sua_addr_parse(), SUA_CO_CORE, SUA_IEI_DEST_ADDR, xua_dialect_sua, xua_hdr_dump(), and xua_msg_dump().

Referenced by sccp_conn_xua_gen_encode_and_send(), sccp_conn_xua_gen_relre_and_send(), sccp_scoc_rx_scrc_rout_fail(), tx_coerr_from_xua(), tx_relco_from_xua(), and tx_rlsd_from_xua_twoway().

## ◆ scrc_local_out_common()

static int scrc_local_out_common | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | const struct osmo_sccp_addr * | called
| ) |  |
| static

References OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, osmo_ss7_pc_is_local(), osmo_sccp_addr::pc, osmo_sccp_addr::presence, scrc_node_12(), scrc_node_4(), scrc_node_6(), scrc_translate_node_9(), and osmo_sccp_instance::ss7.

Referenced by sccp_scrc_rx_sclc_msg(), and sccp_scrc_rx_scoc_conn_msg().

## ◆ scrc_node_12()

static int scrc_node_12 | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | const struct osmo_sccp_addr * | called
| ) |  |
| static

References gen_mtp_transfer_req_xua(), and osmo_ss7_as::inst.

Referenced by sccp_scrc_rx_sclc_msg(), scrc_local_out_common(), scrc_node_2(), and scrc_node_7().

## ◆ scrc_node_2()

static int scrc_node_2 | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |
| static

References osmo_mtp_transfer_param::dpc, dpc_accessible(), LOGPSCI, xua_msg::mtp, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_RI_SSN_PC, osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ri, sccp_available(), sccp_rout_fail_enqueue(), scrc_node_12(), sua_addr_parse(), SUA_IEI_DEST_ADDR, xua_dialect_sua, and xua_hdr_dump().

Referenced by sccp_scrc_rx_scoc_conn_msg().

## ◆ scrc_node_4()

static int scrc_node_4 | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | uint32_t | return_cause
| ) |  |
| static

References sccp_rout_fail_enqueue(), and sua_is_connectionless().

Referenced by scrc_local_out_common(), scrc_node_6(), scrc_rx_mtp_xfer_ind_xua(), and scrc_translate_node_9().

## ◆ scrc_node_6()

static int scrc_node_6 | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | const struct osmo_sccp_addr * | called
| ) |  |
| static

References osmo_sccp_user::inst, LOGPSCI, osmo_ss7_pointcode_print(), osmo_sccp_addr::pc, sccp_rout_fail_enqueue(), sccp_sclc_rx_from_scrc(), sccp_scoc_rx_from_scrc(), sccp_user_find(), scrc_node_4(), osmo_sccp_instance::ss7, osmo_sccp_addr::ssn, and sua_is_connectionless().

Referenced by scrc_local_out_common(), and scrc_rx_mtp_xfer_ind_xua().

## ◆ scrc_node_7()

static int scrc_node_7 | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | const struct osmo_sccp_addr * | called
| ) |  |
| static

References scrc_node_12(), and sua_is_connectionless().

Referenced by sccp_scrc_rx_sclc_msg(), and scrc_translate_node_9().

## ◆ scrc_rx_mtp_xfer_ind_xua()

int scrc_rx_mtp_xfer_ind_xua | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua
| ) |  |

References xua_msg_part::dat, ensure_opc_in_calling_ssn(), LOGPSCI, OSMO_SCCP_RI_GT, osmo_sccp_addr::ri, sccp_scoc_rx_from_scrc(), scrc_node_4(), scrc_node_6(), scrc_translate_node_9(), sua_addr_parse(), SUA_IEI_DEST_ADDR, SUA_IEI_PROTO_CLASS, SUA_IEI_S7_HOP_CTR, sua_is_connectionless(), sua_is_cr(), xua_dialect_sua, xua_hdr_dump(), xua_msg_dump(), xua_msg_find_tag(), xua_msg_get_u32(), and xua_msg_part_get_u32().

Referenced by mtp_user_prim_cb(), sua_rx_cl(), and sua_rx_co().

## ◆ scrc_translate_node_9()

static int scrc_translate_node_9 | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | xua,
|  | const struct osmo_sccp_addr * | called
| ) |  |
| static

References LOGPSCI, OSMO_SCCP_RI_SSN_IP, OSMO_SCCP_RI_SSN_PC, osmo_ss7_pc_is_local(), osmo_sccp_addr::pc, osmo_sccp_addr::ri, sccp_rout_fail_enqueue(), sccp_sclc_rx_from_scrc(), sccp_scoc_rx_from_scrc(), scrc_node_4(), scrc_node_7(), osmo_sccp_instance::ss7, sua_is_connectionless(), and translate().

Referenced by scrc_local_out_common(), and scrc_rx_mtp_xfer_ind_xua().

## ◆ sua2sccp_tx_m3ua()

static int sua2sccp_tx_m3ua | ( | struct osmo_sccp_instance * | inst,
|  | struct xua_msg * | sua
| ) |  |
| static

References osmo_ss7_instance::cfg, osmo_mtp_transfer_param::dpc, osmo_ss7_instance::id, LOGPSCI, xua_msg::mtp, MTP_SAP_USER, MTP_SI_SCCP, MTP_SIO, osmo_ss7_instance::network_indicator, osmo_mtp_transfer_param::opc, osmo_mtp_prim::oph, OSMO_MTP_PRIM_TRANSFER, osmo_ss7_pc_is_valid(), osmo_ss7_user_mtp_xfer_req(), osmo_sua_to_sccp(), osmo_ss7_instance::primary_pc, osmo_mtp_transfer_param::sio, osmo_mtp_transfer_param::sls, osmo_sccp_instance::ss7, osmo_mtp_prim::transfer, and osmo_mtp_prim::u.

Referenced by gen_mtp_transfer_req_xua().

## ◆ sua_is_connectionless()

static bool sua_is_connectionless | ( | struct xua_msg * | xua | ) |
| static

References xua_msg::hdr, xua_common_hdr::msg_class, and SUA_MSGC_CL.

Referenced by scrc_node_4(), scrc_node_6(), scrc_node_7(), scrc_rx_mtp_xfer_ind_xua(), and scrc_translate_node_9().

## ◆ sua_is_cr()

static bool sua_is_cr | ( | struct xua_msg * | xua | ) |
| static

References xua_msg::hdr, xua_common_hdr::msg_class, xua_common_hdr::msg_type, SUA_CO_CORE, and SUA_MSGC_CO.

Referenced by scrc_rx_mtp_xfer_ind_xua().

## ◆ translate()

static int translate | ( | struct osmo_sccp_instance * | inst,
|  | const struct osmo_sccp_addr * | called,
|  | struct osmo_sccp_addr * | translated
| ) |  |
| static

Referenced by scrc_translate_node_9().