libosmo-sigtran 2.0.0.50-b59d
Osmocom SIGTRAN library
sccp_internal.h File Reference
#include <osmocom/core/fsm.h>
#include <osmocom/core/prim.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/linuxrbtree.h>
#include <osmocom/core/tdef.h>
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/protocol/mtp.h>
#include "ss7_user.h"

Go to the source code of this file.

Data Structures

struct  osmo_sccp_instance
 
struct  osmo_sccp_user
 

Macros

#define SCCP_STR   "Signalling Connection Control Part\n"
 

Enumerations

enum  osmo_sccp_timer {
  OSMO_SCCP_TIMER_CONN_EST = 1 , OSMO_SCCP_TIMER_IAS , OSMO_SCCP_TIMER_IAR , OSMO_SCCP_TIMER_REL ,
  OSMO_SCCP_TIMER_REPEAT_REL , OSMO_SCCP_TIMER_INT , OSMO_SCCP_TIMER_GUARD , OSMO_SCCP_TIMER_RESET ,
  OSMO_SCCP_TIMER_REASSEMBLY , OSMO_SCCP_TIMERS_LEN
}
 

Functions

static const char * osmo_sccp_timer_name (enum osmo_sccp_timer val)
 
struct osmo_sccp_usersccp_user_find (struct osmo_sccp_instance *inst, uint16_t ssn, uint32_t pc)
 Find a SCCP User registered for given PC+SSN or SSN only First search all users with a valid PC for a full PC+SSN match. More...
 
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)
 
int scrc_rx_mtp_xfer_ind_xua (struct osmo_sccp_instance *inst, 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...
 
void sccp_scoc_rx_scrc_rout_fail (struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t cause)
 SCOC: Receive SCRC Routing Failure. More...
 
void sccp_scoc_flush_connections (struct osmo_sccp_instance *inst)
 
int sccp_sclc_rx_from_scrc (struct osmo_sccp_instance *inst, struct xua_msg *xua)
 SCRC -> SCLC (connectionless message) More...
 
void sccp_sclc_rx_scrc_rout_fail (struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t cause)
 SCRC -> SCLC (Routing Failure. More...
 
int sccp_user_prim_up (struct osmo_sccp_user *scut, struct osmo_scu_prim *prim)
 Send a SCCP User SAP Primitive up to the User. More...
 
int sccp_sclc_user_sap_down (struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
 Main entrance function for primitives from SCCP User. More...
 
int sccp_sclc_user_sap_down_nofree (struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
 Main entrance function for primitives from SCCP User. More...
 
struct msgb * sccp_msgb_alloc (const char *name)
 
void sccp_scoc_show_connections (struct vty *vty, struct osmo_sccp_instance *inst)
 
void osmo_sccp_vty_write_cs7_node (struct vty *vty, const char *indent, struct osmo_sccp_instance *inst)
 
void sccp_lbcs_local_bcast_pcstate (struct osmo_sccp_instance *inst, const struct osmo_scu_pcstate_param *pcstate)
 
void sccp_lbcs_local_bcast_state (struct osmo_sccp_instance *inst, const struct osmo_scu_state_param *state)
 
void sccp_scmg_rx_ssn_allowed (struct osmo_sccp_instance *inst, uint32_t dpc, uint32_t ssn, uint32_t smi)
 
void sccp_scmg_rx_ssn_prohibited (struct osmo_sccp_instance *inst, uint32_t dpc, uint32_t ssn, uint32_t smi)
 
void sccp_scmg_rx_mtp_pause (struct osmo_sccp_instance *inst, uint32_t dpc)
 brief MTP -> SNM (MTP-PAUSE.ind) - inability to providing MTP service Q.714 5.2.2 More...
 
void sccp_scmg_rx_mtp_resume (struct osmo_sccp_instance *inst, uint32_t dpc)
 brief MTP -> SNM (MTP-RESUME.ind) - ability of providing the MTP service Q.714 5.2.3 More...
 
void sccp_scmg_rx_mtp_status (struct osmo_sccp_instance *inst, uint32_t dpc, enum mtp_unavail_cause cause)
 
int sccp_scmg_init (struct osmo_sccp_instance *inst)
 

Variables

const struct osmo_tdef osmo_sccp_timer_defaults [OSMO_SCCP_TIMERS_LEN]
 
const struct value_string osmo_sccp_timer_names []
 
int DSCCP
 
struct osmo_fsm sccp_scoc_fsm
 

Macro Definition Documentation

◆ SCCP_STR

#define SCCP_STR   "Signalling Connection Control Part\n"

Enumeration Type Documentation

◆ osmo_sccp_timer

Enumerator
OSMO_SCCP_TIMER_CONN_EST 
OSMO_SCCP_TIMER_IAS 
OSMO_SCCP_TIMER_IAR 
OSMO_SCCP_TIMER_REL 
OSMO_SCCP_TIMER_REPEAT_REL 
OSMO_SCCP_TIMER_INT 
OSMO_SCCP_TIMER_GUARD 
OSMO_SCCP_TIMER_RESET 
OSMO_SCCP_TIMER_REASSEMBLY 
OSMO_SCCP_TIMERS_LEN 

Function Documentation

◆ osmo_sccp_timer_name()

static const char * osmo_sccp_timer_name ( enum osmo_sccp_timer  val)
inlinestatic

References osmo_sccp_timer_names.

◆ osmo_sccp_vty_write_cs7_node()

void osmo_sccp_vty_write_cs7_node ( struct vty *  vty,
const char *  indent,
struct osmo_sccp_instance inst 
)

◆ sccp_lbcs_local_bcast_pcstate()

◆ sccp_lbcs_local_bcast_state()

◆ sccp_msgb_alloc()

struct msgb * sccp_msgb_alloc ( const char *  name)

◆ sccp_sclc_rx_from_scrc()

int sccp_sclc_rx_from_scrc ( struct osmo_sccp_instance inst,
struct xua_msg xua 
)

SCRC -> SCLC (connectionless message)

Parameters
[in]instSCCP Instance in which we operate
[in]xuaSUA connectionless message
Returns
0 on success; negative on error

References xua_msg::hdr, xua_common_hdr::msg_class, xua_common_hdr::msg_type, sclc_rx_cldr(), sclc_rx_cldt(), SUA_CL_CLDR, SUA_CL_CLDT, SUA_MSGC_CL, xua_dialect_sua, and xua_hdr_dump().

Referenced by scrc_node_6(), and scrc_translate_node_9().

◆ sccp_sclc_rx_scrc_rout_fail()

void sccp_sclc_rx_scrc_rout_fail ( struct osmo_sccp_instance inst,
struct xua_msg xua_in,
uint32_t  cause 
)

SCRC -> SCLC (Routing Failure.

Parameters
[in]instSCCP Instance in which we operate
[in]xua_inMessage that failed to be routed
[in]causeSCCP Return Cause

References gen_ret_msg(), xua_msg::hdr, xua_common_hdr::msg_type, xua_msg::mtp, osmo_mtp_transfer_param::opc, osmo_ss7_pc_is_local(), sccp_scrc_rx_sclc_msg(), sclc_rx_cldr(), osmo_sccp_instance::ss7, SUA_CL_CLDR, SUA_CL_CLDT, and xua_msg_free().

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

◆ sccp_sclc_user_sap_down()

int sccp_sclc_user_sap_down ( struct osmo_sccp_user scu,
struct osmo_prim_hdr *  oph 
)

Main entrance function for primitives from SCCP User.

Implies a msgb_free(oph->msg), otherwise the same as sccp_sclc_user_sap_down_nofree().

Parameters
[in]scuSCCP User who is sending the primitive
[on]oph Osmocom primitive header of the primitive
Returns
0 on success; negative in case of error

References osmo_scu_prim::oph, and sccp_sclc_user_sap_down_nofree().

◆ sccp_sclc_user_sap_down_nofree()

int sccp_sclc_user_sap_down_nofree ( struct osmo_sccp_user scu,
struct osmo_prim_hdr *  oph 
)

Main entrance function for primitives from SCCP User.

The caller is required to free oph->msg, otherwise the same as sccp_sclc_user_sap_down().

Parameters
[in]scuSCCP User who is sending the primitive
[on]oph Osmocom primitive header of the primitive
Returns
0 on success; negative in case of error

References osmo_scu_prim::oph, OSMO_SCU_PRIM_N_UNITDATA, osmo_scu_prim_name(), SUA_CL_CLDT, and xua_gen_encode_and_send().

Referenced by osmo_sccp_user_sap_down_nofree(), and sccp_sclc_user_sap_down().

◆ sccp_scmg_init()

int sccp_scmg_init ( struct osmo_sccp_instance inst)

◆ sccp_scmg_rx_mtp_pause()

void sccp_scmg_rx_mtp_pause ( struct osmo_sccp_instance inst,
uint32_t  dpc 
)

brief MTP -> SNM (MTP-PAUSE.ind) - inability to providing MTP service Q.714 5.2.2

References osmo_scu_pcstate_param::affected_pc, dpc, OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN, OSMO_SCCP_SP_S_INACCESSIBLE, and sccp_lbcs_local_bcast_pcstate().

Referenced by xua_snm_pc_available_to_sccp().

◆ sccp_scmg_rx_mtp_resume()

void sccp_scmg_rx_mtp_resume ( struct osmo_sccp_instance inst,
uint32_t  dpc 
)

brief MTP -> SNM (MTP-RESUME.ind) - ability of providing the MTP service Q.714 5.2.3

References osmo_scu_pcstate_param::affected_pc, dpc, OSMO_SCCP_REM_SCCP_S_AVAILABLE, OSMO_SCCP_SP_S_ACCESSIBLE, and sccp_lbcs_local_bcast_pcstate().

Referenced by xua_snm_pc_available_to_sccp().

◆ sccp_scmg_rx_mtp_status()

◆ sccp_scmg_rx_ssn_allowed()

void sccp_scmg_rx_ssn_allowed ( struct osmo_sccp_instance inst,
uint32_t  dpc,
uint32_t  ssn,
uint32_t  smi 
)

◆ sccp_scmg_rx_ssn_prohibited()

void sccp_scmg_rx_ssn_prohibited ( struct osmo_sccp_instance inst,
uint32_t  dpc,
uint32_t  ssn,
uint32_t  smi 
)

◆ sccp_scoc_flush_connections()

void sccp_scoc_flush_connections ( struct osmo_sccp_instance inst)

◆ sccp_scoc_rx_from_scrc()

◆ sccp_scoc_rx_scrc_rout_fail()

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.

Parameters
[in]instSCCP Instance on which we operate
[in]xuaSUA message that was failed to route
[in]return_causeReason (cause) for routing failure

References conn_find_by_id(), sccp_connection::conn_id, sccp_connection::fi, gen_coref_without_conn(), get_cref_cause_for_ret(), sccp_connection::inst, sccp_scrc_rx_scoc_conn_msg(), SCOC_E_RCOC_ROUT_FAIL_IND, SUA_IEI_DEST_REF, xua_dialect_sua, xua_hdr_dump(), xua_msg_free(), and xua_msg_get_u32().

Referenced by scrc_node_2(), scrc_node_4(), and scrc_node_6().

◆ sccp_scoc_show_connections()

void sccp_scoc_show_connections ( struct vty *  vty,
struct osmo_sccp_instance inst 
)

◆ sccp_scrc_rx_sclc_msg()

◆ sccp_scrc_rx_scoc_conn_msg()

◆ sccp_user_find()

struct osmo_sccp_user * sccp_user_find ( struct osmo_sccp_instance inst,
uint16_t  ssn,
uint32_t  pc 
)

Find a SCCP User registered for given PC+SSN or SSN only First search all users with a valid PC for a full PC+SSN match.

If no such match was found, search all users with an invalid PC for an SSN-only match.

Parameters
[in]instSCCP Instance in which to search
[in]ssnSub-System Number to search for
[in]pcPoint Code to search for
Returns
Matching SCCP User; NULL if none found

References osmo_sccp_user::inst, osmo_sccp_user::list, osmo_ss7_pc_is_valid(), osmo_sccp_user::pc, osmo_sccp_user::ssn, and osmo_sccp_instance::users.

Referenced by DEFUN(), osmo_sccp_user_find(), sccp_find_user(), sccp_user_bind_pc(), sclc_rx_cldr(), sclc_rx_cldt(), scmg_rx_sst(), and scrc_node_6().

◆ sccp_user_prim_up()

int sccp_user_prim_up ( struct osmo_sccp_user scu,
struct osmo_scu_prim prim 
)

Send a SCCP User SAP Primitive up to the User.

Parameters
[in]scuSCCP User to whom to send the primitive
[in]primPrimitive to send to the user
Returns
return value of the SCCP User's prim_cb() function

References osmo_sccp_user::name, osmo_scu_prim::oph, osmo_scu_prim_name(), and osmo_sccp_user::prim_cb.

Referenced by sccp_lbcs_local_bcast_pcstate(), sccp_lbcs_local_bcast_state(), sclc_rx_cldr(), sclc_rx_cldt(), and scu_gen_encode_and_send().

◆ scrc_rx_mtp_xfer_ind_xua()

Variable Documentation

◆ DSCCP

int DSCCP
extern

◆ osmo_sccp_timer_defaults

const struct osmo_tdef osmo_sccp_timer_defaults[OSMO_SCCP_TIMERS_LEN]
extern

◆ osmo_sccp_timer_names

const struct value_string osmo_sccp_timer_names[]
extern

◆ sccp_scoc_fsm

struct osmo_fsm sccp_scoc_fsm
extern

Referenced by conn_create_id(), and osmo_ss7_init().