libosmo-sigtran 2.1.0.148-c8e68
Osmocom SIGTRAN library
|
#include <errno.h>
#include <string.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/linuxrbtree.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/fsm.h>
#include <osmocom/sigtran/sccp_helpers.h>
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/protocol/sua.h>
#include <osmocom/sccp/sccp_types.h>
#include "xua_internal.h"
#include "sccp_connection.h"
#include "sccp_scoc_fsm.h"
#include "sccp_instance.h"
#include "sccp_internal.h"
#include "sccp_user.h"
#include "ss7_internal.h"
#include "ss7_instance.h"
Functions | |
struct sccp_connection * | sccp_find_conn_by_id (const struct osmo_sccp_instance *inst, uint32_t id) |
bool | osmo_sccp_conn_id_exists (const struct osmo_sccp_instance *inst, uint32_t id) |
int | osmo_sccp_instance_next_conn_id (struct osmo_sccp_instance *sccp) |
static struct sccp_connection * | conn_create (struct osmo_sccp_user *user) |
static struct xua_msg * | xua_gen_relre (struct sccp_connection *conn, uint32_t cause, struct osmo_scu_prim *prim) |
int | sccp_conn_xua_gen_relre_and_send (struct sccp_connection *conn, uint32_t cause, struct osmo_scu_prim *prim) |
static bool | xua_opt_data_check_drop (const struct osmo_scu_prim *prim, unsigned lim, const char *message) |
static bool | xua_opt_data_cache_keep (struct sccp_connection *conn, const struct osmo_scu_prim *prim, int msg_type) |
static bool | xua_opt_data_length_lim (struct sccp_connection *conn, const struct osmo_scu_prim *prim, int msg_type) |
static struct xua_msg * | xua_gen_msg_co (struct sccp_connection *conn, uint32_t event, const struct osmo_scu_prim *prim, int msg_type) |
int | sccp_conn_xua_gen_encode_and_send (struct sccp_connection *conn, uint32_t event, const struct osmo_scu_prim *prim, int msg_type) |
static uint8_t | get_cref_cause_for_ret (uint8_t ret_cause) |
static struct xua_msg * | gen_coref_without_conn (struct osmo_sccp_instance *inst, struct xua_msg *xua_in, uint32_t ref_cause) |
static struct osmo_sccp_user * | sccp_find_user (struct osmo_sccp_instance *inst, struct xua_msg *xua) |
void | sccp_scoc_rx_scrc_rout_fail (struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t return_cause) |
SCOC: Receive SCRC Routing Failure. More... | |
static struct xua_msg * | gen_coerr (uint32_t route_ctx, uint32_t dest_ref, uint32_t err_cause) |
static void | tx_coerr_from_xua (struct osmo_sccp_instance *inst, struct xua_msg *in, uint32_t err_cause) |
static struct xua_msg * | gen_relco (uint32_t route_ctx, uint32_t dest_ref, uint32_t src_ref) |
static void | tx_relco_from_xua (struct osmo_sccp_instance *inst, struct xua_msg *in) |
static struct xua_msg * | gen_rlsd (uint32_t route_ctx, uint32_t dest_ref, uint32_t src_ref) |
static void | tx_rlsd_from_xua_twoway (struct sccp_connection *conn, struct xua_msg *in) |
static void | sccp_scoc_rx_unass_local_ref (struct osmo_sccp_instance *inst, struct xua_msg *xua) |
static void | sccp_scoc_rx_inval_src_ref (struct sccp_connection *conn, struct xua_msg *xua, uint32_t inval_src_ref) |
static void | sccp_scoc_rx_inval_opc (struct sccp_connection *conn, struct xua_msg *xua) |
void | sccp_scoc_rx_from_scrc (struct osmo_sccp_instance *inst, struct xua_msg *xua) |
Main entrance function for primitives from the SCRC (Routing Control) More... | |
Variables | |
static const struct xua_msg_event_map | sua_scoc_event_map [] |
static const uint8_t | cause_map_cref [] |
|
static |
References sccp_connection::conn_id, osmo_sccp_user::inst, NULL, osmo_sccp_instance_next_conn_id(), sccp_conn_alloc(), and sccp_connection::user.
Referenced by sccp_scoc_rx_from_scrc().
|
static |
References xua_msg::hdr, SUA_CAUSE_T_ERROR, SUA_CO_COERR, SUA_IEI_CAUSE, SUA_IEI_DEST_REF, SUA_IEI_ROUTE_CTX, SUA_MSGC_CO, XUA_HDR, xua_msg_add_u32(), and xua_msg_alloc().
Referenced by tx_coerr_from_xua().
|
static |
References xua_msg::hdr, osmo_sccp_instance::route_ctx, SUA_CAUSE_T_REFUSAL, SUA_CO_COREF, SUA_IEI_CAUSE, SUA_IEI_DATA, SUA_IEI_DEST_ADDR, SUA_IEI_DEST_REF, SUA_IEI_IMPORTANCE, SUA_IEI_ROUTE_CTX, SUA_IEI_SRC_ADDR, SUA_IEI_SRC_REF, SUA_MSGC_CO, XUA_HDR, xua_msg_add_u32(), xua_msg_alloc(), and xua_msg_copy_part().
Referenced by sccp_scoc_rx_scrc_rout_fail().
|
static |
References xua_msg::hdr, SUA_CO_RELCO, SUA_IEI_DEST_REF, SUA_IEI_ROUTE_CTX, SUA_IEI_SRC_REF, SUA_MSGC_CO, XUA_HDR, xua_msg_add_u32(), and xua_msg_alloc().
Referenced by tx_relco_from_xua().
|
static |
References xua_msg::hdr, SUA_CO_RELRE, SUA_IEI_DEST_REF, SUA_IEI_ROUTE_CTX, SUA_IEI_SRC_REF, SUA_MSGC_CO, XUA_HDR, xua_msg_add_u32(), and xua_msg_alloc().
Referenced by tx_rlsd_from_xua_twoway().
|
static |
References cause_map_cref.
Referenced by sccp_scoc_rx_scrc_rout_fail().
bool osmo_sccp_conn_id_exists | ( | const struct osmo_sccp_instance * | inst, |
uint32_t | id | ||
) |
References sccp_find_conn_by_id().
Referenced by osmo_sccp_tx_conn_resp_msg(), osmo_sccp_tx_data(), and osmo_sccp_tx_disconn_data().
int osmo_sccp_instance_next_conn_id | ( | struct osmo_sccp_instance * | sccp | ) |
References osmo_sccp_instance::next_id, and sccp_find_conn_by_id().
Referenced by conn_create().
int sccp_conn_xua_gen_encode_and_send | ( | struct sccp_connection * | conn, |
uint32_t | event, | ||
const struct osmo_scu_prim * | prim, | ||
int | msg_type | ||
) |
References sccp_connection::inst, msg_type, sccp_scrc_rx_scoc_conn_msg(), xua_gen_msg_co(), and xua_msg_free().
Referenced by scoc_fsm_active(), scoc_fsm_conn_pend_in(), scoc_fsm_conn_pend_out(), scoc_fsm_idle(), and scoc_fsm_wait_conn_conf().
int sccp_conn_xua_gen_relre_and_send | ( | struct sccp_connection * | conn, |
uint32_t | cause, | ||
struct osmo_scu_prim * | prim | ||
) |
struct sccp_connection * sccp_find_conn_by_id | ( | const struct osmo_sccp_instance * | inst, |
uint32_t | id | ||
) |
|
static |
References LOGPSCI, NULL, OSMO_SCCP_ADDR_T_SSN, osmo_sccp_addr::pc, osmo_sccp_addr::presence, sccp_user_find(), osmo_sccp_addr::ssn, sua_addr_parse(), SUA_IEI_DEST_ADDR, xua_dialect_sua, and xua_hdr_dump().
Referenced by sccp_scoc_rx_from_scrc().
void sccp_scoc_rx_from_scrc | ( | struct osmo_sccp_instance * | inst, |
struct xua_msg * | xua | ||
) |
Main entrance function for primitives from the SCRC (Routing Control)
[in] | inst | SCCP Instance in which we operate |
[in] | xua | SUA message in xua_msg format |
References conn_create(), sccp_connection::fi, xua_msg::hdr, sccp_connection::incoming, osmo_sccp_user::inst, LOGPSCC, LOGPSCI, xua_common_hdr::msg_type, xua_msg::mtp, osmo_mtp_transfer_param::opc, sccp_connection::remote_pc, sccp_connection::remote_ref, sccp_find_conn_by_id(), sccp_find_user(), sccp_scoc_rx_inval_opc(), sccp_scoc_rx_inval_src_ref(), sccp_scoc_rx_unass_local_ref(), SUA_CO_COAK, SUA_CO_CORE, SUA_CO_COREF, SUA_IEI_DEST_REF, SUA_IEI_SRC_REF, sua_scoc_event_map, xua_dialect_sua, xua_hdr_dump(), xua_msg_event_map(), xua_msg_find_tag(), and xua_msg_get_u32().
Referenced by scrc_node_6(), scrc_rx_mtp_xfer_ind_xua(), and scrc_translate_node_9().
|
static |
References xua_msg::hdr, sccp_connection::inst, LOGPSCC, MAX_PC_STR_LEN, xua_common_hdr::msg_type, xua_msg::mtp, osmo_mtp_transfer_param::opc, osmo_ss7_pointcode_print_buf(), osmo_sccp_instance::ss7, SUA_CO_CODA, SUA_CO_CODT, SUA_CO_COERR, SUA_CO_RELCO, SUA_CO_RELRE, SUA_CO_RESCO, SUA_CO_RESRE, tx_coerr_from_xua(), xua_dialect_sua, and xua_hdr_dump().
Referenced by sccp_scoc_rx_from_scrc().
|
static |
References xua_msg::hdr, sccp_connection::inst, LOGPSCC, xua_common_hdr::msg_type, sccp_connection::remote_ref, SUA_CO_COIT, SUA_CO_RELCO, SUA_CO_RELRE, SUA_CO_RESCO, SUA_CO_RESRE, tx_coerr_from_xua(), tx_rlsd_from_xua_twoway(), xua_dialect_sua, and xua_hdr_dump().
Referenced by sccp_scoc_rx_from_scrc().
void sccp_scoc_rx_scrc_rout_fail | ( | struct osmo_sccp_instance * | inst, |
struct xua_msg * | xua, | ||
uint32_t | return_cause | ||
) |
SCOC: Receive SCRC Routing Failure.
[in] | inst | SCCP Instance on which we operate |
[in] | xua | SUA message that was failed to route |
[in] | return_cause | Reason (cause) for routing failure |
References sccp_connection::conn_id, sccp_connection::fi, gen_coref_without_conn(), get_cref_cause_for_ret(), sccp_connection::inst, LOGPSCI, sccp_find_conn_by_id(), sccp_scrc_rx_scoc_conn_msg(), SCOC_E_RCOC_ROUT_FAIL_IND, SUA_IEI_SRC_REF, xua_dialect_sua, xua_hdr_dump(), xua_msg_free(), and xua_msg_get_u32().
Referenced by rout_fail_pending_cb().
|
static |
References xua_msg::hdr, LOGPSCI, xua_common_hdr::msg_type, SUA_CO_COAK, SUA_CO_CODA, SUA_CO_CODT, SUA_CO_COERR, SUA_CO_COIT, SUA_CO_COREF, SUA_CO_RELCO, SUA_CO_RELRE, SUA_CO_RESCO, SUA_CO_RESRE, tx_coerr_from_xua(), tx_relco_from_xua(), xua_dialect_sua, and xua_hdr_dump().
Referenced by sccp_scoc_rx_from_scrc().
|
static |
References osmo_mtp_transfer_param::dpc, gen_coerr(), xua_msg::mtp, osmo_mtp_transfer_param::opc, sccp_scrc_rx_scoc_conn_msg(), osmo_mtp_transfer_param::sio, SUA_IEI_ROUTE_CTX, SUA_IEI_SRC_REF, xua_msg_free(), and xua_msg_get_u32().
Referenced by sccp_scoc_rx_inval_opc(), sccp_scoc_rx_inval_src_ref(), and sccp_scoc_rx_unass_local_ref().
|
static |
|
static |
References sccp_connection::conn_id, osmo_mtp_transfer_param::dpc, sccp_connection::fi, gen_rlsd(), sccp_connection::inst, xua_msg::mtp, osmo_mtp_transfer_param::opc, sccp_connection::remote_pc, sccp_connection::remote_ref, osmo_sccp_instance::route_ctx, sccp_scrc_rx_scoc_conn_msg(), SCOC_E_RCOC_RLSD_IND, osmo_mtp_transfer_param::sio, SUA_IEI_DEST_REF, SUA_IEI_ROUTE_CTX, SUA_IEI_SRC_REF, xua_msg_free(), and xua_msg_get_u32().
Referenced by sccp_scoc_rx_inval_src_ref().
|
static |
References sccp_connection::called_addr, sccp_connection::calling_addr, osmo_scu_disconn_param::cause, sccp_connection::conn_id, osmo_scu_prim::disconnect, osmo_mtp_transfer_param::dpc, xua_msg::hdr, sccp_connection::inst, LOGPSCC, msg_type, xua_msg::mtp, NULL, osmo_scu_prim::oph, osmo_sccp_addr::presence, sccp_connection::remote_pc, sccp_connection::remote_ref, osmo_sccp_instance::route_ctx, sccp_connection::sccp_class, osmo_mtp_transfer_param::sls, SUA_CAUSE_T_REFUSAL, SUA_CAUSE_T_RELEASE, SUA_CO_COAK, SUA_CO_CODT, SUA_CO_COIT, SUA_CO_CORE, SUA_CO_COREF, SUA_CO_RELCO, SUA_CO_RELRE, SUA_IEI_CAUSE, SUA_IEI_DATA, SUA_IEI_DEST_ADDR, SUA_IEI_DEST_REF, SUA_IEI_PROTO_CLASS, SUA_IEI_ROUTE_CTX, SUA_IEI_SEQ_CTRL, SUA_IEI_SRC_ADDR, SUA_IEI_SRC_REF, SUA_MSGC_CO, sccp_connection::tx_co_mtp_sls, osmo_scu_prim::u, XUA_HDR, xua_msg_add_data(), xua_msg_add_sccp_addr(), xua_msg_add_u32(), xua_msg_alloc(), xua_msg_free(), and xua_opt_data_length_lim().
Referenced by sccp_conn_xua_gen_encode_and_send().
|
static |
References sccp_connection::conn_id, xua_msg::hdr, sccp_connection::inst, NULL, osmo_scu_prim::oph, sccp_connection::remote_ref, osmo_sccp_instance::route_ctx, SUA_CAUSE_T_RELEASE, SUA_CO_RELRE, SUA_IEI_CAUSE, SUA_IEI_DATA, SUA_IEI_DEST_REF, SUA_IEI_ROUTE_CTX, SUA_IEI_SRC_REF, SUA_MSGC_CO, XUA_HDR, xua_msg_add_data(), xua_msg_add_u32(), and xua_msg_alloc().
Referenced by sccp_conn_xua_gen_relre_and_send().
|
static |
|
static |
References osmo_scu_prim::oph, and osmo_scu_prim_name().
Referenced by xua_opt_data_cache_keep(), and xua_opt_data_length_lim().
|
static |
References sccp_connection::conn_id, sccp_connection::inst, osmo_sccp_instance::max_optional_data, msg_type, osmo_scu_prim::oph, osmo_sccp_tx_data(), SUA_CO_COAK, SUA_CO_CORE, SUA_CO_COREF, SUA_CO_RELRE, sccp_connection::user, xua_opt_data_cache_keep(), and xua_opt_data_check_drop().
Referenced by xua_gen_msg_co().
|
static |
Referenced by get_cref_cause_for_ret().
|
static |
Referenced by sccp_scoc_rx_from_scrc().