Loading...
Searching...
No Matches
sccp_sclc.c File Reference
`#include <string.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/core/timer.h>`
`#include <osmocom/core/fsm.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_internal.h"`

## Functions

static struct xua_msg * | xua_gen_msg_cl (uint32_t event, struct osmo_scu_prim *prim, int msg_type)
static int | xua_gen_encode_and_send (struct osmo_sccp_user *scu, uint32_t event, struct osmo_scu_prim *prim, int msg_type)
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.
int | sccp_sclc_user_sap_down (struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
| Main entrance function for primitives from SCCP User.
static int | sclc_rx_cldt (struct osmo_sccp_instance *inst, struct xua_msg *xua)
static int | sclc_rx_cldr (struct osmo_sccp_instance *inst, struct xua_msg *xua)
int | sccp_sclc_rx_from_scrc (struct osmo_sccp_instance *inst, struct xua_msg *xua)
| SCRC -> SCLC (connectionless message)
static struct xua_msg * | gen_ret_msg (struct osmo_sccp_instance *inst, const struct xua_msg *xua_in, uint32_t ret_cause)
void | sccp_sclc_rx_scrc_rout_fail (struct osmo_sccp_instance *inst, struct xua_msg *xua_in, uint32_t cause)
| SCRC -> SCLC (Routing Failure.

## Function Documentation

## gen_ret_msg()

static struct xua_msg * gen_ret_msg | ( | struct osmo_sccp_instance * | inst,
|  | const struct xua_msg * | xua_in,
|  | uint32_t | ret_cause
| ) |  |

static

References xua_msg::hdr, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_RI_SSN_PC, osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ri, osmo_sccp_instance::route_ctx, sua_addr_parse(), SUA_CAUSE_T_RETURN, SUA_CL_CLDR, SUA_IEI_CAUSE, SUA_IEI_CORR_ID, SUA_IEI_DATA, SUA_IEI_DEST_ADDR, SUA_IEI_IMPORTANCE, SUA_IEI_MSG_PRIO, SUA_IEI_ROUTE_CTX, SUA_IEI_SEGMENTATION, SUA_IEI_SRC_ADDR, SUA_MSGC_CL, XUA_HDR, xua_msg_add_sccp_addr(), xua_msg_add_u32(), xua_msg_alloc(), xua_msg_copy_part(), and xua_msg_free_tag().

Referenced by sccp_sclc_rx_scrc_rout_fail().

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

## sclc_rx_cldr()

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

static

References osmo_scu_notice_param::called_addr, osmo_scu_notice_param::calling_addr, osmo_scu_notice_param::cause, xua_msg_part::dat, osmo_scu_notice_param::importance, xua_msg_part::len, osmo_scu_prim::notice, osmo_scu_prim::oph, OSMO_SCU_PRIM_N_NOTICE, osmo_sccp_addr::pc, sccp_msgb_alloc(), SCCP_SAP_USER, sccp_user_find(), sccp_user_prim_up(), osmo_sccp_addr::ssn, sua_addr_parse(), SUA_IEI_CAUSE, SUA_IEI_DATA, SUA_IEI_DEST_ADDR, SUA_IEI_IMPORTANCE, SUA_IEI_SRC_ADDR, osmo_scu_prim::u, xua_msg_find_tag(), and xua_msg_get_u32().

Referenced by sccp_sclc_rx_from_scrc(), and sccp_sclc_rx_scrc_rout_fail().

## sclc_rx_cldt()

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

static

References osmo_scu_unitdata_param::called_addr, osmo_scu_unitdata_param::calling_addr, xua_msg_part::dat, osmo_scu_unitdata_param::importance, osmo_scu_unitdata_param::in_sequence_control, xua_msg_part::len, osmo_scu_prim::oph, OSMO_SCU_PRIM_N_UNITDATA, osmo_sccp_addr::pc, osmo_scu_unitdata_param::return_option, sccp_msgb_alloc(), SCCP_SAP_USER, sccp_user_find(), sccp_user_prim_up(), osmo_sccp_addr::ssn, sua_addr_parse(), SUA_IEI_DATA, SUA_IEI_DEST_ADDR, SUA_IEI_IMPORTANCE, SUA_IEI_PROTO_CLASS, SUA_IEI_SEQ_CTRL, SUA_IEI_SRC_ADDR, osmo_scu_prim::u, osmo_scu_prim::unitdata, xua_msg_find_tag(), and xua_msg_get_u32().

Referenced by sccp_sclc_rx_from_scrc().

## xua_gen_encode_and_send()

static int xua_gen_encode_and_send | ( | struct osmo_sccp_user * | scu,
|  | uint32_t | event,
|  | struct osmo_scu_prim * | prim,
|  | int | msg_type
| ) |  |

static

References osmo_sccp_user::inst, msg_type, sccp_scrc_rx_sclc_msg(), xua_gen_msg_cl(), and xua_msg_free().

Referenced by sccp_sclc_user_sap_down_nofree().

## xua_gen_msg_cl()

static struct xua_msg * xua_gen_msg_cl | ( | uint32_t | event,
|  | struct osmo_scu_prim * | prim,
|  | int | msg_type
| ) |  |

static

References osmo_scu_unitdata_param::called_addr, osmo_scu_unitdata_param::calling_addr, xua_msg::hdr, osmo_scu_unitdata_param::in_sequence_control, msg_type, osmo_scu_prim::oph, SUA_CL_CLDT, SUA_IEI_DATA, SUA_IEI_DEST_ADDR, SUA_IEI_PROTO_CLASS, SUA_IEI_ROUTE_CTX, SUA_IEI_SEQ_CTRL, SUA_IEI_SRC_ADDR, SUA_MSGC_CL, osmo_scu_prim::u, osmo_scu_prim::unitdata, XUA_HDR, xua_msg_add_data(), xua_msg_add_sccp_addr(), xua_msg_add_u32(), xua_msg_alloc(), and xua_msg_free().

Referenced by xua_gen_encode_and_send().