libosmo-sigtran 2.1.0.194-89e3 Osmocom SIGTRAN library

Data Structures | Macros | Functions | Variables
sccp_internal.h File Reference
`#include <inttypes.h>`
`#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>`

Go to the source code of this file.

## Data Structures
struct | osmo_sccp_addr_entry

## Macros
#define | SCCP_STR "Signalling Connection Control Part\n"

## Functions
struct osmo_sccp_addr_entry * | addr_entry_by_name_local (const char *name, const struct osmo_ss7_instance *inst)
struct osmo_sccp_addr_entry * | addr_entry_by_name_global (const char *name)
struct sccp_connection * | sccp_find_conn_by_id (const struct osmo_sccp_instance *inst, uint32_t id)
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...
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...
void | sccp_rout_fail_enqueue (struct osmo_sccp_instance *inst, const struct xua_msg *xua, uint32_t cause, bool scoc)
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 | 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, uint8_t cong_level)
int | sccp_scmg_init (struct osmo_sccp_instance *inst)

## Variables
struct llist_head | sccp_address_book_global
int | DSCCP

## Macro Definition Documentation

## ◆ SCCP_STR

#define SCCP_STR "Signalling Connection Control Part\n"

## Function Documentation

## ◆ addr_entry_by_name_global()

struct osmo_sccp_addr_entry * addr_entry_by_name_global | ( | const char * | name | ) |

References osmo_sccp_addr_entry::list_global, osmo_sccp_addr_entry::name, NULL, and sccp_address_book_global.

Referenced by osmo_sccp_addr_by_name(), and osmo_sccp_addr_create().

## ◆ addr_entry_by_name_local()

struct osmo_sccp_addr_entry * addr_entry_by_name_local | ( | const char * | name,
|  | const struct osmo_ss7_instance * | inst
| ) |  |

References osmo_ss7_instance::cfg, osmo_sccp_addr_entry::inst, osmo_sccp_addr_entry::list, osmo_sccp_addr_entry::name, NULL, and osmo_ss7_instance::sccp_address_book.

Referenced by DEFUN_ATTR(), osmo_sccp_addr_by_name_local(), and osmo_sccp_addr_update().

## ◆ osmo_sccp_vty_write_cs7_node()

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

References osmo_sccp_instance::max_optional_data, and write_sccp_timers().

Referenced by write_one_cs7().

## ◆ sccp_find_conn_by_id()

struct sccp_connection * sccp_find_conn_by_id | ( | const struct osmo_sccp_instance * | inst,
|  | uint32_t | id
| ) |  |

References sccp_connection::conn_id, osmo_sccp_instance::connections, and NULL.

Referenced by osmo_sccp_conn_id_exists(), osmo_sccp_instance_next_conn_id(), osmo_sccp_user_sap_down_nofree(), sccp_scoc_rx_from_scrc(), and sccp_scoc_rx_scrc_rout_fail().

## ◆ sccp_lbcs_local_bcast_pcstate()

void sccp_lbcs_local_bcast_pcstate | ( | struct osmo_sccp_instance * | inst,
|  | const struct osmo_scu_pcstate_param * | pcstate
| ) |  |

References osmo_sccp_user::inst, osmo_sccp_user::list, osmo_scu_prim::oph, OSMO_SCU_PRIM_N_PCSTATE, osmo_scu_prim::pcstate, sccp_msgb_alloc(), SCCP_SAP_USER, sccp_user_prim_up(), osmo_scu_prim::u, and osmo_sccp_instance::users.

Referenced by sccp_scmg_rx_mtp_pause(), sccp_scmg_rx_mtp_resume(), and sccp_scmg_rx_mtp_status().

## ◆ sccp_lbcs_local_bcast_state()

void sccp_lbcs_local_bcast_state | ( | struct osmo_sccp_instance * | inst,
|  | const struct osmo_scu_state_param * | state
| ) |  |

References osmo_sccp_user::inst, osmo_sccp_user::list, osmo_scu_prim::oph, OSMO_SCU_PRIM_N_STATE, sccp_msgb_alloc(), SCCP_SAP_USER, sccp_user_prim_up(), osmo_scu_prim::state, osmo_scu_prim::u, and osmo_sccp_instance::users.

Referenced by sccp_scmg_rx_ssn_allowed(), and sccp_scmg_rx_ssn_prohibited().

## ◆ sccp_msgb_alloc()

struct msgb * sccp_msgb_alloc | ( | const char * | name | ) |

References NULL, SCCP_MSG_HEADROOM, and SCCP_MSG_SIZE.

Referenced by osmo_sua_to_sccp(), sccp_lbcs_local_bcast_pcstate(), sccp_lbcs_local_bcast_state(), sccp_scmg_tx(), sclc_rx_cldr(), and sclc_rx_cldt().

## ◆ sccp_rout_fail_enqueue()

void sccp_rout_fail_enqueue | ( | struct osmo_sccp_instance * | inst,
|  | const struct xua_msg * | xua,
|  | uint32_t | cause,
|  | bool | scoc
| ) |  |

References sccp_pending_rout_fail::cause, sccp_pending_rout_fail::list, LOGPSCI, osmo_sccp_instance::queue, osmo_sccp_instance::rout_fail_pending, sccp_pending_rout_fail::scoc, osmo_sccp_instance::timer, sccp_pending_rout_fail::xua, xua_dialect_sua, xua_hdr_dump(), and xua_msg_copy().

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

## ◆ 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] | inst | SCCP Instance in which we operate
  [in] | xua | SUA connectionless message

Returns
  0 on success; negative on error

References _LOGPSCI, 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] | inst | SCCP Instance in which we operate
  [in] | xua_in | Message that failed to be routed
  [in] | cause | SCCP Return Cause

References gen_ret_msg(), xua_msg::hdr, LOGPSCI, 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, xua_dialect_sua, xua_hdr_dump(), and xua_msg_free().

Referenced by rout_fail_pending_cb().

## ◆ 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] | scu | SCCP 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] | scu | SCCP User who is sending the primitive
  | [on] | oph Osmocom primitive header of the primitive

Returns
  0 on success; negative in case of error

References LOGPSCU, 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 | ) |

References osmo_sccp_user::inst, osmo_sccp_user_bind(), and scmg_prim_cb().

Referenced by osmo_sccp_instance_create().

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

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

## ◆ sccp_scmg_rx_mtp_status()

void sccp_scmg_rx_mtp_status | ( | struct osmo_sccp_instance * | inst,
|  | uint32_t | dpc,
|  | enum mtp_unavail_cause | cause,
|  | uint8_t | cong_level
| ) |  |

References osmo_scu_pcstate_param::affected_pc, dpc, MTP_UNAVAIL_C_CONGESTED, MTP_UNAVAIL_C_INACC_REM_USER, MTP_UNAVAIL_C_UNEQUIP_REM_USER, MTP_UNAVAIL_C_UNKNOWN, OSMO_SCCP_REM_SCCP_S_AVAILABLE, OSMO_SCCP_REM_SCCP_S_CONGESTED, OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN, OSMO_SCCP_SP_S_ACCESSIBLE, OSMO_SCCP_SP_S_CONGESTED, and sccp_lbcs_local_bcast_pcstate().

Referenced by mtp_user_prim_cb().

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

References osmo_scu_state_param::affected_pc, dpc, sccp_lbcs_local_bcast_state(), and smi.

Referenced by scmg_rx_ssa(), and sua_snm_ssn_available_to_sccp().

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

References osmo_scu_state_param::affected_pc, dpc, sccp_lbcs_local_bcast_state(), and smi.

Referenced by scmg_rx_ssp(), and sua_snm_ssn_available_to_sccp().

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

Parameters

  [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().

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

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

## Variable Documentation

## ◆ DSCCP

int DSCCP
| extern

## ◆ sccp_address_book_global

struct llist_head sccp_address_book_global
| extern

Referenced by addr_entry_alloc(), addr_entry_by_name_global(), and osmo_sccp_name_by_addr().