sccp_internal.h File Reference
`#include <osmocom/core/fsm.h>`
`#include <osmocom/core/prim.h>`
`#include <osmocom/sigtran/sccp_sap.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`

Go to the source code of this file.

## Data Structures

struct | osmo_sccp_instance
struct | osmo_sccp_user

## Functions

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. 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...
struct msgb * | sccp_msgb_alloc (const char *name)
void | sccp_scoc_show_connections (struct vty *vty, struct osmo_sccp_instance *inst)

## Variables

int | DSCCP
struct osmo_fsm | sccp_scoc_fsm

## Function Documentation

## sccp_msgb_alloc()

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

References SCCP_MSG_HEADROOM, and SCCP_MSG_SIZE.

Referenced by osmo_sua_to_sccp(), sclc_rx_cldr(), and sclc_rx_cldt().

## 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.

Parameters

  [in] | scu | SCCP User who is sending the primitive

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

## sccp_scoc_flush_connections()

void sccp_scoc_flush_connections | ( | struct osmo_sccp_instance * | inst | ) |

References conn_destroy(), osmo_sccp_instance::connections, and sccp_connection::list.

Referenced by osmo_sccp_instance_destroy().

## 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(), conn_find_by_id(), sccp_connection::conn_id, sccp_connection::fi, xua_msg::hdr, sccp_connection::incoming, xua_common_hdr::msg_type, xua_msg::mtp, osmo_mtp_transfer_param::opc, sccp_connection::remote_pc, sccp_connection::remote_ref, 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, sccp_connection::user, 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 conn_find_by_id(), sccp_connection::conn_id, sccp_connection::fi, gen_coref_without_conn(), get_cref_cause_for_ret(), sccp_scrc_rx_scoc_conn_msg(), SCOC_E_RCOC_ROUT_FAIL_IND, SUA_IEI_DEST_REF, 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
| ) |  |

References osmo_sccp_instance::connections, sccp_connection::list, and vty_show_connection().

Referenced by DEFUN().

## sccp_scrc_rx_sclc_msg()

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

References xua_msg::hdr, 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, 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, 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, and xua_msg_dump().

Referenced by sccp_scoc_rx_scrc_rout_fail(), tx_coerr_from_xua(), tx_relco_from_xua(), tx_rlsd_from_xua_twoway(), xua_gen_encode_and_send(), and xua_gen_relre_and_send().

## 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.

Parameters

  [in] | inst | SCCP Instance in which to search
  [in] | ssn | Sub-System Number to search for
  [in] | pc | Point Code to search for

Returns
  Matching SCCP User; NULL if none found

References 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(), sccp_find_user(), sccp_user_bind_pc(), sclc_rx_cldr(), sclc_rx_cldt(), 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] | scu | SCCP User to whom to send the primitive
  [in] | prim | Primitive 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 sclc_rx_cldr(), sclc_rx_cldt(), and scu_gen_encode_and_send().

## 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, 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_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

## sccp_scoc_fsm

struct osmo_fsm sccp_scoc_fsm

Referenced by osmo_ss7_init().