libosmo-sigtran 2.1.0.201-feb1 Osmocom SIGTRAN library

Data Structures | Macros | Enumerations | Functions | Variables
sccp_sap.h File Reference
`#include <stdint.h>`
`#include <osmocom/core/prim.h>`
`#include <osmocom/sigtran/sigtran_sap.h>`
`#include <netinet/in.h>`

Go to the source code of this file.

## Data Structures
struct | osmo_sccp_gt
struct | osmo_sccp_addr
struct | osmo_scu_connect_param
struct | osmo_scu_data_param
struct | osmo_scu_disconn_param
struct | osmo_scu_reset_param
struct | osmo_scu_unitdata_param
struct | osmo_scu_notice_param
struct | osmo_scu_state_param
struct | osmo_scu_pcstate_param
struct | osmo_scu_prim

## Macros
#define | OSMO_SCCP_ADDR_T_GT 0x0001 /* global title */
#define | OSMO_SCCP_ADDR_T_PC 0x0002 /* signalling point code */
#define | OSMO_SCCP_ADDR_T_SSN 0x0004 /* subsystem number */
#define | OSMO_SCCP_ADDR_T_IPv4 0x0008
#define | OSMO_SCCP_ADDR_T_IPv6 0x0010
#define | OSMO_SCCP_ADDR_T_MASK 0x001f
#define | OSMO_SCCP_SSN_SMLC_BSSAP OSMO_SCCP_SSN_SMLC_BSSAP_LE
#define | OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT 0xffffffff
#define | msgb_scu_prim(msg) ((struct osmo_scu_prim *)(msg)->l1h)

## Enumerations
enum | osmo_scu_prim_type { OSMO_SCU_PRIM_N_CONNECT , OSMO_SCU_PRIM_N_DATA , OSMO_SCU_PRIM_N_EXPEDITED_DATA , OSMO_SCU_PRIM_N_DISCONNECT , OSMO_SCU_PRIM_N_RESET , OSMO_SCU_PRIM_N_INFORM , OSMO_SCU_PRIM_N_UNITDATA , OSMO_SCU_PRIM_N_NOTICE , OSMO_SCU_PRIM_N_COORD , OSMO_SCU_PRIM_N_STATE , OSMO_SCU_PRIM_N_PCSTATE }
| SCCP-User primitives as per Q.711. More...
enum | osmo_sccp_routing_ind { OSMO_SCCP_RI_NONE , OSMO_SCCP_RI_GT , OSMO_SCCP_RI_SSN_PC , OSMO_SCCP_RI_SSN_IP }
enum | osmo_sccp_gti { OSMO_SCCP_GTI_NO_GT , OSMO_SCCP_GTI_NAI_ONLY , OSMO_SCCP_GTI_TT_ONLY , OSMO_SCCP_GTI_TT_NPL_ENC , OSMO_SCCP_GTI_TT_NPL_ENC_NAI }
enum | osmo_sccp_npi { OSMO_SCCP_NPI_UNKNOWN = 0 , OSMO_SCCP_NPI_E164_ISDN = 1 , OSMO_SCCP_NPI_GEERIC = 2 , OSMO_SCCP_NPI_X121_DATA = 3 , OSMO_SCCP_NPI_F69_TELEX = 4 , OSMO_SCCP_NPI_E210_MARITIME = 5 , OSMO_SCCP_NPI_E212_LAND = 6 , OSMO_SCCP_NPI_E214_ISDN_MOBILE = 7 , OSMO_SCCP_NPI_PRIVATE = 14 }
enum | osmo_sccp_nai { OSMO_SCCP_NAI_UNKNOWN = 0 , OSMO_SCCP_NAI_SUBSCR = 1 , OSMO_SCCP_NAI_RES_NAT_USE = 2 , OSMO_SCCP_NAI_NATL = 3 , OSMO_SCCP_NAI_INTL = 4 }
enum | osmo_sccp_ssn { OSMO_SCCP_SSN_MGMT = 1 , OSMO_SCCP_SSN_ISUP = 3 , OSMO_SCCP_SSN_OMAP = 4 , OSMO_SCCP_SSN_MAP = 5 , OSMO_SCCP_SSN_HLR = 6 , OSMO_SCCP_SSN_VLR = 7 , OSMO_SCCP_SSN_MSC = 8 , OSMO_SCCP_SSN_EIR = 9 , OSMO_SCCP_SSN_AUC = 0x0a , OSMO_SCCP_SSN_ISDN_SS = 0x0b , OSMO_SCCP_SSN_RES_INTL = 0x0c , OSMO_SCCP_SSN_BISDN = 0x0d , OSMO_SCCP_SSN_TC_TEST = 0x0e , OSMO_SCCP_SSN_RANAP = 142 , OSMO_SCCP_SSN_RNSAP = 143 , OSMO_SCCP_SSN_GMLC_MAP = 145 , OSMO_SCCP_SSN_CAP = 146 , OSMO_SCCP_SSN_gsmSCF_MAP = 147 , OSMO_SCCP_SSN_SIWF_MAP = 148 , OSMO_SCCP_SSN_SGSN_MAP = 149 , OSMO_SCCP_SSN_GGSN_MAP = 150 , OSMO_SCCP_SSN_PCAP = 249 , OSMO_SCCP_SSN_BSC_BSSAP_LE = 250 , OSMO_SCCP_SSN_MSC_BSSAP_LE = 251 , OSMO_SCCP_SSN_SMLC_BSSAP_LE = 252 , OSMO_SCCP_SSN_BSS_OAM = 253 , OSMO_SCCP_SSN_BSSAP = 254 }
enum | osmo_sccp_sp_status { OSMO_SCCP_SP_S_INACCESSIBLE = 1 , OSMO_SCCP_SP_S_CONGESTED = 2 , OSMO_SCCP_SP_S_ACCESSIBLE = 3 }
enum | osmo_sccp_rem_sccp_status { OSMO_SCCP_REM_SCCP_S_AVAILABLE = 1 , OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN = 2 , OSMO_SCCP_REM_SCCP_S_UNEQUIPPED = 3 , OSMO_SCCP_REM_SCCP_S_INACCESSIBLE = 4 , OSMO_SCCP_REM_SCCP_S_CONGESTED = 5 }
enum | osmo_sccp_originator { OSMO_SCCP_ORIG_NS_PROVIDER , OSMO_SCCP_ORIG_NS_USER , OSMO_SCCP_ORIG_UNDEFINED }

## Functions
static const char * | osmo_sccp_routing_ind_name (enum osmo_sccp_routing_ind val)
static const char * | osmo_sccp_gti_name (enum osmo_sccp_gti val)
static const char * | osmo_sccp_sp_status_name (enum osmo_sccp_sp_status val)
static const char * | osmo_sccp_rem_sccp_status_name (enum osmo_sccp_rem_sccp_status val)
static const char * | osmo_sccp_ssn_name (enum osmo_sccp_ssn val)
static const char * | osmo_scu_prim_type_name (enum osmo_scu_prim_type val)
int | osmo_scu_prim_hdr_name_buf (char *buf, size_t buflen, const struct osmo_prim_hdr *oph)
char * | osmo_scu_prim_hdr_name_c (void *ctx, const struct osmo_prim_hdr *oph)
char * | osmo_scu_prim_name (const struct osmo_prim_hdr *oph)
void | osmo_sccp_vty_init (void)
struct osmo_sccp_instance * | osmo_sccp_instance_create (struct osmo_ss7_instance *ss7, void *priv)
| create a SCCP Instance and register it as user with SS7 inst More...
void | osmo_sccp_instance_destroy (struct osmo_sccp_instance *inst)
struct osmo_ss7_instance * | osmo_sccp_get_ss7 (const struct osmo_sccp_instance *sccp)
| get the SS7 instance that is related to the given SCCP instance More...
struct osmo_sccp_instance * | osmo_sccp_get_sccp (const struct osmo_sccp_user *scu)
| get the SCCP instance that is related to the given sccp user More...
void | osmo_sccp_set_priv (struct osmo_sccp_instance *sccp, void *priv)
void * | osmo_sccp_get_priv (struct osmo_sccp_instance *sccp)
void | osmo_sccp_user_unbind (struct osmo_sccp_user *scu)
| Unbind a given SCCP user. More...
void | osmo_sccp_user_set_priv (struct osmo_sccp_user *scu, void *priv)
void * | osmo_sccp_user_get_priv (struct osmo_sccp_user *scu)
struct osmo_sccp_user * | osmo_sccp_user_bind_pc (struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc)
| Bind a given SCCP User to a given SSN+PC. More...
struct osmo_sccp_user * | osmo_sccp_user_bind (struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn)
| Bind a given SCCP User to a given SSN (at any PC) More...
struct osmo_sccp_user * | osmo_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 | osmo_sccp_user_sap_down (struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
| Main entrance function for primitives from SCCP User. More...
int | osmo_sccp_user_sap_down_nofree (struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
| Main entrance function for primitives from SCCP User. More...
int | osmo_sccp_addr_create (struct osmo_ss7_instance *inst, const char *name, const struct osmo_sccp_addr *dest_addr)
| Add an SCCP address entry to the addressbook. More...
int | osmo_sccp_addr_update (struct osmo_ss7_instance *inst, const char *name, const struct osmo_sccp_addr *dest_addr)
| Update the value of an SCCP address entry already present in the addressbook. More...
struct osmo_ss7_instance * | osmo_sccp_addr_by_name (struct osmo_sccp_addr *dest_addr, const char *name)
| Lookup an SCCP address from the addressbook by its name. More...
int | osmo_sccp_addr_by_name_local (struct osmo_sccp_addr *dest_addr, const char *name, const struct osmo_ss7_instance *inst)
| Lookup an SCCP address from the addressbook of a specific instance by its name. More...
const char * | osmo_sccp_name_by_addr (const struct osmo_sccp_addr *addr)
| Reverse lookup the lookup-name of a specified SCCP address. More...
void | osmo_sccp_local_addr_by_instance (struct osmo_sccp_addr *dest_addr, const struct osmo_sccp_instance *inst, uint32_t ssn)
| derive a basic local SCCP-Address from a given SCCP instance. More...
bool | osmo_sccp_check_addr (struct osmo_sccp_addr *addr, uint32_t presence)
| check whether a given SCCP-Address is consistent. More...
int | osmo_sccp_addr_cmp (const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria)
| Compare two SCCP addresses by given presence criteria. More...
int | osmo_sccp_addr_ri_cmp (const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b)
| Compare the routing information of two SCCP addresses. More...
int | osmo_sccp_gt_cmp (const struct osmo_sccp_gt *a, const struct osmo_sccp_gt *b)
| Compare two SCCP Global Titles. More...
const char * | osmo_sccp_user_name (struct osmo_sccp_user *scu)
| Compose a human readable string to describe the SCCP user's connection. More...
int | osmo_sccp_instance_next_conn_id (struct osmo_sccp_instance *sccp)

## Variables
const struct value_string | osmo_sccp_routing_ind_names []
const struct value_string | osmo_sccp_gti_names []
const struct value_string | osmo_sccp_sp_status_names []
const struct value_string | osmo_sccp_rem_sccp_status_names []
const struct value_string | osmo_sccp_ssn_names []
const struct value_string | osmo_scu_prim_type_names []

## Macro Definition Documentation

## ◆ msgb_scu_prim

#define msgb_scu_prim | ( |  | msg | ) | ((struct osmo_scu_prim *)(msg)->l1h)

## ◆ OSMO_SCCP_ADDR_T_GT

#define OSMO_SCCP_ADDR_T_GT 0x0001 /* global title */

## ◆ OSMO_SCCP_ADDR_T_IPv4

#define OSMO_SCCP_ADDR_T_IPv4 0x0008

## ◆ OSMO_SCCP_ADDR_T_IPv6

#define OSMO_SCCP_ADDR_T_IPv6 0x0010

## ◆ OSMO_SCCP_ADDR_T_MASK

#define OSMO_SCCP_ADDR_T_MASK 0x001f

## ◆ OSMO_SCCP_ADDR_T_PC

#define OSMO_SCCP_ADDR_T_PC 0x0002 /* signalling point code */

## ◆ OSMO_SCCP_ADDR_T_SSN

#define OSMO_SCCP_ADDR_T_SSN 0x0004 /* subsystem number */

## ◆ OSMO_SCCP_SSN_SMLC_BSSAP

#define OSMO_SCCP_SSN_SMLC_BSSAP OSMO_SCCP_SSN_SMLC_BSSAP_LE

## ◆ OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT

#define OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT 0xffffffff

## Enumeration Type Documentation

## ◆ osmo_sccp_gti

enum osmo_sccp_gti

Enumerator
OSMO_SCCP_GTI_NO_GT |
OSMO_SCCP_GTI_NAI_ONLY |
OSMO_SCCP_GTI_TT_ONLY |
OSMO_SCCP_GTI_TT_NPL_ENC |
OSMO_SCCP_GTI_TT_NPL_ENC_NAI |

## ◆ osmo_sccp_nai

enum osmo_sccp_nai

Enumerator
OSMO_SCCP_NAI_UNKNOWN |
OSMO_SCCP_NAI_SUBSCR |
OSMO_SCCP_NAI_RES_NAT_USE |
OSMO_SCCP_NAI_NATL |
OSMO_SCCP_NAI_INTL |

## ◆ osmo_sccp_npi

enum osmo_sccp_npi

Enumerator
OSMO_SCCP_NPI_UNKNOWN |
OSMO_SCCP_NPI_E164_ISDN |
OSMO_SCCP_NPI_GEERIC |
OSMO_SCCP_NPI_X121_DATA |
OSMO_SCCP_NPI_F69_TELEX |
OSMO_SCCP_NPI_E210_MARITIME |
OSMO_SCCP_NPI_E212_LAND |
OSMO_SCCP_NPI_E214_ISDN_MOBILE |
OSMO_SCCP_NPI_PRIVATE |

## ◆ osmo_sccp_originator

enum osmo_sccp_originator

Enumerator
OSMO_SCCP_ORIG_NS_PROVIDER |
OSMO_SCCP_ORIG_NS_USER |
OSMO_SCCP_ORIG_UNDEFINED |

## ◆ osmo_sccp_rem_sccp_status

enum osmo_sccp_rem_sccp_status

Enumerator
OSMO_SCCP_REM_SCCP_S_AVAILABLE |
OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN |
OSMO_SCCP_REM_SCCP_S_UNEQUIPPED |
OSMO_SCCP_REM_SCCP_S_INACCESSIBLE |
OSMO_SCCP_REM_SCCP_S_CONGESTED |

## ◆ osmo_sccp_routing_ind

enum osmo_sccp_routing_ind

Enumerator
OSMO_SCCP_RI_NONE |
OSMO_SCCP_RI_GT |
OSMO_SCCP_RI_SSN_PC |
OSMO_SCCP_RI_SSN_IP |

## ◆ osmo_sccp_sp_status

enum osmo_sccp_sp_status

Enumerator
OSMO_SCCP_SP_S_INACCESSIBLE |
OSMO_SCCP_SP_S_CONGESTED |
OSMO_SCCP_SP_S_ACCESSIBLE |

## ◆ osmo_sccp_ssn

enum osmo_sccp_ssn

Enumerator
OSMO_SCCP_SSN_MGMT |
OSMO_SCCP_SSN_ISUP |
OSMO_SCCP_SSN_OMAP |
OSMO_SCCP_SSN_MAP |
OSMO_SCCP_SSN_HLR |
OSMO_SCCP_SSN_VLR |
OSMO_SCCP_SSN_MSC |
OSMO_SCCP_SSN_EIR |
OSMO_SCCP_SSN_AUC |
OSMO_SCCP_SSN_ISDN_SS |
OSMO_SCCP_SSN_RES_INTL |
OSMO_SCCP_SSN_BISDN |
OSMO_SCCP_SSN_TC_TEST |
OSMO_SCCP_SSN_RANAP |
OSMO_SCCP_SSN_RNSAP |
OSMO_SCCP_SSN_GMLC_MAP |
OSMO_SCCP_SSN_CAP |
OSMO_SCCP_SSN_gsmSCF_MAP |
OSMO_SCCP_SSN_SIWF_MAP |
OSMO_SCCP_SSN_SGSN_MAP |
OSMO_SCCP_SSN_GGSN_MAP |
OSMO_SCCP_SSN_PCAP |
OSMO_SCCP_SSN_BSC_BSSAP_LE |
OSMO_SCCP_SSN_MSC_BSSAP_LE |
OSMO_SCCP_SSN_SMLC_BSSAP_LE |
OSMO_SCCP_SSN_BSS_OAM |
OSMO_SCCP_SSN_BSSAP |

## ◆ osmo_scu_prim_type

enum osmo_scu_prim_type

SCCP-User primitives as per Q.711.

Enumerator
OSMO_SCU_PRIM_N_CONNECT |
OSMO_SCU_PRIM_N_DATA |
OSMO_SCU_PRIM_N_EXPEDITED_DATA |
OSMO_SCU_PRIM_N_DISCONNECT |
OSMO_SCU_PRIM_N_RESET |
OSMO_SCU_PRIM_N_INFORM |
OSMO_SCU_PRIM_N_UNITDATA |
OSMO_SCU_PRIM_N_NOTICE |
OSMO_SCU_PRIM_N_COORD |
OSMO_SCU_PRIM_N_STATE |
OSMO_SCU_PRIM_N_PCSTATE |

## Function Documentation

## ◆ osmo_sccp_addr_by_name()

struct osmo_ss7_instance * osmo_sccp_addr_by_name | ( | struct osmo_sccp_addr * | dest_addr,
|  | const char * | name
| ) |  |

Lookup an SCCP address from the addressbook by its name.

Parameters

  [out] | dest_addr | pointer to output the resulting sccp-address; (set to NULL if not interested)
  [in] | name | of the address to lookup

Returns
  SS7 instance; NULL on error

References osmo_sccp_addr_entry::addr, addr_entry_by_name_global(), osmo_sccp_addr_entry::inst, osmo_sccp_addr_entry::name, and NULL.

## ◆ osmo_sccp_addr_by_name_local()

int osmo_sccp_addr_by_name_local | ( | struct osmo_sccp_addr * | dest_addr,
|  | const char * | name,
|  | const struct osmo_ss7_instance * | inst
| ) |  |

Lookup an SCCP address from the addressbook of a specific instance by its name.

Parameters

  [out] | dest_addr | pointer to output the resulting sccp-address; (set to NULL if not interested)
  [in] | name | of the address to lookup
  [in] | inst | ss7 instance of which the address book will be searched

Returns
  0 on success; <0 on error

References osmo_sccp_addr_entry::addr, addr_entry_by_name_local(), osmo_sccp_addr_entry::inst, and osmo_sccp_addr_entry::name.

## ◆ osmo_sccp_addr_cmp()

int osmo_sccp_addr_cmp | ( | const struct osmo_sccp_addr * | a,
|  | const struct osmo_sccp_addr * | b,
|  | uint32_t | presence_criteria
| ) |  |

Compare two SCCP addresses by given presence criteria.

Any OSMO_SCCP_ADDR_T_* type not set in presence_criteria is ignored. In case all bits are set in presence_criteria, the comparison is in the order of: OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_IPv4, OSMO_SCCP_ADDR_T_IPv6, OSMO_SCCP_ADDR_T_SSN. The SCCP addresses' Routing Indicator is not compared, see osmo_sccp_addr_ri_cmp().

Parameters

  [in] | a | left side.
  [in] | b | right side.
  [in] | presence_criteria | A bitmask of OSMO_SCCP_ADDR_T_* values, or OSMO_SCCP_ADDR_T_MASK to compare all parts, except the routing indicator.

Returns
  -1 if a < b, 1 if a > b, and 0 if all checked values match.

References osmo_sccp_addr::gt, osmo_sccp_addr::ip, OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_IPv4, OSMO_SCCP_ADDR_T_IPv6, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, osmo_sccp_gt_cmp(), osmo_sccp_addr::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ssn, osmo_sccp_addr::v4, and osmo_sccp_addr::v6.

Referenced by osmo_sccp_addr_ri_cmp().

## ◆ osmo_sccp_addr_create()

int osmo_sccp_addr_create | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | const struct osmo_sccp_addr * | dest_addr
| ) |  |

Add an SCCP address entry to the addressbook.

Parameters

  | [int] | inst cs7 instance where this address belongs
  [in] | name | of the address to create
  [in] | dest_addr | address value to add to the addressbook.

Returns
  0 on success, negative error code on error.

Validates that the name is unique among all cs7 instances of the process, and that no such entry already exists.

References addr_entry_alloc(), addr_entry_by_name_global(), osmo_ss7_instance::cfg, osmo_ss7_instance::id, osmo_sccp_addr_entry::inst, LOGSS7, and osmo_sccp_addr_entry::name.

Referenced by DEFUN_ATTR().

## ◆ osmo_sccp_addr_ri_cmp()

int osmo_sccp_addr_ri_cmp | ( | const struct osmo_sccp_addr * | a,
|  | const struct osmo_sccp_addr * | b
| ) |  |

Compare the routing information of two SCCP addresses.

Compare the ri of a and b, and, if equal, return osmo_sccp_addr_cmp() with presence criteria selected according to ri.

Parameters

  [in] | a | left side.
  [in] | b | right side.

Returns
  -1 if a < b, 1 if a > b, and 0 if a == b.

References osmo_sccp_addr_cmp(), OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_IPv4, OSMO_SCCP_ADDR_T_IPv6, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_NONE, OSMO_SCCP_RI_SSN_IP, OSMO_SCCP_RI_SSN_PC, osmo_sccp_addr::presence, and osmo_sccp_addr::ri.

## ◆ osmo_sccp_addr_update()

int osmo_sccp_addr_update | ( | struct osmo_ss7_instance * | inst,
|  | const char * | name,
|  | const struct osmo_sccp_addr * | dest_addr
| ) |  |

Update the value of an SCCP address entry already present in the addressbook.

Parameters

  | [int] | inst cs7 instance where this address belongs
  [in] | name | of the address to update
  [in] | dest_addr | address value to store in the addressbook.

Returns
  0 on success, negative error code on error.

References osmo_sccp_addr_entry::addr, addr_entry_by_name_local(), osmo_ss7_instance::cfg, osmo_ss7_instance::id, osmo_sccp_addr_entry::inst, LOGSS7, and osmo_sccp_addr_entry::name.

## ◆ osmo_sccp_check_addr()

bool osmo_sccp_check_addr | ( | struct osmo_sccp_addr * | addr,
|  | uint32_t | presence
| ) |  |

check whether a given SCCP-Address is consistent.

Parameters

  [in] | addr | SCCP address to check
  [in] | presence | mask with minimum required address components

Returns
  true when address data seems plausible

References osmo_sccp_addr::gt, osmo_sccp_gt::gti, osmo_sccp_gt::nai, osmo_sccp_gt::npi, OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_IPv4, OSMO_SCCP_ADDR_T_IPv6, OSMO_SCCP_ADDR_T_PC, OSMO_SCCP_ADDR_T_SSN, OSMO_SCCP_RI_GT, OSMO_SCCP_RI_SSN_IP, OSMO_SCCP_RI_SSN_PC, osmo_sccp_addr::presence, and osmo_sccp_addr::ri.

## ◆ osmo_sccp_get_priv()

void * osmo_sccp_get_priv | ( | struct osmo_sccp_instance * | sccp | ) |

References osmo_sccp_instance::priv.

## ◆ osmo_sccp_get_sccp()

struct osmo_sccp_instance * osmo_sccp_get_sccp | ( | const struct osmo_sccp_user * | scu | ) |

get the SCCP instance that is related to the given sccp user

Parameters

  [in] | scu | SCCP user

Returns
  SCCP instance; NULL if scu was NULL

References osmo_sccp_user::inst, and NULL.

## ◆ osmo_sccp_get_ss7()

struct osmo_ss7_instance * osmo_sccp_get_ss7 | ( | const struct osmo_sccp_instance * | sccp | ) |

get the SS7 instance that is related to the given SCCP instance

Parameters

  [in] | sccp | SCCP instance

Returns
  SS7 instance; NULL if sccp was NULL

References NULL, osmo_ss7_instance::sccp, and osmo_sccp_instance::ss7.

## ◆ osmo_sccp_gt_cmp()

int osmo_sccp_gt_cmp | ( | const struct osmo_sccp_gt * | a,
|  | const struct osmo_sccp_gt * | b
| ) |  |

Compare two SCCP Global Titles.

Parameters

  [in] | a | left side.
  [in] | b | right side.

Returns
  -1 if a < b, 1 if a > b, and 0 if a == b.

Referenced by osmo_sccp_addr_cmp().

## ◆ osmo_sccp_gti_name()

static const char * osmo_sccp_gti_name | ( | enum osmo_sccp_gti | val | ) |
| inline static

References osmo_sccp_gti_names.

Referenced by sccp_addr_to_str_buf().

## ◆ osmo_sccp_instance_create()

struct osmo_sccp_instance * osmo_sccp_instance_create | ( | struct osmo_ss7_instance * | ss7,
|  | void * | priv
| ) |  |

create a SCCP Instance and register it as user with SS7 inst

Parameters

  [in] | ss7 | SS7 instance to which this SCCP instance belongs
  [in] | priv | private data to be stored within SCCP instance

Returns
  callee-allocated SCCP instance on success; NULL on error

References osmo_sccp_instance::list, osmo_sccp_instance::max_optional_data, MTP_SI_SCCP, mtp_user_prim_cb(), NULL, osmo_sccp_timer_defaults, osmo_ss7_user_create(), osmo_ss7_user_register(), osmo_ss7_user_set_prim_cb(), osmo_ss7_user_set_priv(), osmo_sccp_instance::priv, osmo_sccp_instance::queue, osmo_sccp_instance::rout_fail_pending, rout_fail_pending_cb(), sccp_scmg_init(), osmo_sccp_instance::ss7, osmo_sccp_instance::ss7_user, osmo_sccp_instance::tdefs, osmo_sccp_instance::timer, and osmo_sccp_instance::users.

Referenced by osmo_ss7_ensure_sccp().

## ◆ osmo_sccp_instance_destroy()

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

References osmo_sccp_instance::connections, osmo_sccp_user::inst, osmo_sccp_instance::list, osmo_sccp_user::list, MTP_SI_SCCP, NULL, osmo_sccp_user_unbind(), osmo_ss7_user_destroy(), osmo_ss7_user_unregister(), osmo_sccp_instance::rout_fail_pending, osmo_ss7_instance::sccp, osmo_sccp_instance::ss7, osmo_sccp_instance::ss7_user, osmo_sccp_instance::timer, and osmo_sccp_instance::users.

## ◆ osmo_sccp_instance_next_conn_id()

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

## ◆ osmo_sccp_local_addr_by_instance()

void osmo_sccp_local_addr_by_instance | ( | struct osmo_sccp_addr * | dest_addr,
|  | const struct osmo_sccp_instance * | inst,
|  | uint32_t | ssn
| ) |  |

derive a basic local SCCP-Address from a given SCCP instance.

Parameters

  [out] | dest_addr | pointer to output address memory
  [in] | inst | SCCP instance
  [in] | ssn | Subsystem Number

References osmo_ss7_instance::cfg, osmo_sccp_make_addr_pc_ssn(), osmo_ss7_instance::primary_pc, and osmo_sccp_instance::ss7.

## ◆ osmo_sccp_name_by_addr()

const char * osmo_sccp_name_by_addr | ( | const struct osmo_sccp_addr * | addr | ) |

Reverse lookup the lookup-name of a specified SCCP address.

Parameters

  [in] | name | of the address to lookup

Returns
  char pointer to the lookup-name; NULL on error

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

## ◆ osmo_sccp_rem_sccp_status_name()

static const char * osmo_sccp_rem_sccp_status_name | ( | enum osmo_sccp_rem_sccp_status | val | ) |
| inline static

References osmo_sccp_rem_sccp_status_names.

## ◆ osmo_sccp_routing_ind_name()

static const char * osmo_sccp_routing_ind_name | ( | enum osmo_sccp_routing_ind | val | ) |
| inline static

References osmo_sccp_routing_ind_names.

Referenced by sccp_addr_to_str_buf().

## ◆ osmo_sccp_set_priv()

void osmo_sccp_set_priv | ( | struct osmo_sccp_instance * | sccp,
|  | void * | priv
| ) |  |

References osmo_sccp_instance::priv, and osmo_sccp_user::priv.

## ◆ osmo_sccp_sp_status_name()

static const char * osmo_sccp_sp_status_name | ( | enum osmo_sccp_sp_status | val | ) |
| inline static

References osmo_sccp_sp_status_names.

## ◆ osmo_sccp_ssn_name()

static const char * osmo_sccp_ssn_name | ( | enum osmo_sccp_ssn | val | ) |
| inline static

References osmo_sccp_ssn_names.

Referenced by sccp_addr_to_str_buf().

## ◆ osmo_sccp_user_bind()

struct osmo_sccp_user * osmo_sccp_user_bind | ( | struct osmo_sccp_instance * | inst,
|  | const char * | name,
|  | osmo_prim_cb | prim_cb,
|  | uint16_t | ssn
| ) |  |

Bind a given SCCP User to a given SSN (at any PC)

Parameters

  [in] | inst | SCCP Instance
  [in] | name | human-readable name
  [in] | prim_cb | User provided callback to pass a primitive/msg up the stack
  [in] | ssn | Sub-System Number to bind to

Returns
  Callee-allocated SCCP User on success; negative otherwise

Ownership of oph->msg in prim_cb is transferred to the user of the registered callback when called.

References osmo_sccp_user::inst, osmo_sccp_user::name, OSMO_SS7_PC_INVALID, osmo_sccp_user::prim_cb, sccp_user_bind_pc(), and osmo_sccp_user::ssn.

Referenced by sccp_scmg_init().

## ◆ osmo_sccp_user_bind_pc()

struct osmo_sccp_user * osmo_sccp_user_bind_pc | ( | struct osmo_sccp_instance * | inst,
|  | const char * | name,
|  | osmo_prim_cb | prim_cb,
|  | uint16_t | ssn,
|  | uint32_t | pc
| ) |  |

Bind a given SCCP User to a given SSN+PC.

Parameters

  [in] | inst | SCCP Instance
  [in] | name | human-readable name
  [in] | prim_cb | User provided callback to pass a primitive/msg up the stack
  [in] | ssn | Sub-System Number to bind to
  [in] | pc | Point Code to bind to

Returns
  Callee-allocated SCCP User on success; negative otherwise

Ownership of oph->msg in prim_cb is transferred to the user of the registered callback when called.

References osmo_sccp_user::inst, osmo_sccp_user::name, osmo_sccp_user::pc, osmo_sccp_user::prim_cb, sccp_user_bind_pc(), and osmo_sccp_user::ssn.

## ◆ osmo_sccp_user_find()

struct osmo_sccp_user * osmo_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 match was found, search all users with an invalid PC for an SSN-only match.

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::inst, osmo_sccp_user::pc, sccp_user_find(), and osmo_sccp_user::ssn.

## ◆ osmo_sccp_user_get_priv()

void * osmo_sccp_user_get_priv | ( | struct osmo_sccp_user * | scu | ) |

References osmo_sccp_user::priv.

## ◆ osmo_sccp_user_name()

const char * osmo_sccp_user_name | ( | struct osmo_sccp_user * | scu | ) |

Compose a human readable string to describe the SCCP user's connection.

The output follows ['<scu.name>':]<local-sccp-addr>, e.g. "'OsmoHNBW':RI=SSN_PC,PC=0.23.5,SSN=RANAP", or just "RI=SSN_PC,PC=0.23.5,SSN=RANAP" if no scu->name is set. This calls osmo_sccp_addr_name(), which returns a static buffer; hence calling this function and osmo_sccp_addr_name() in the same printf statement is likely to conflict.

References osmo_sccp_user::inst, osmo_sccp_user::name, osmo_sccp_addr_name(), osmo_sccp_make_addr_pc_ssn(), osmo_sccp_user::pc, osmo_sccp_instance::ss7, and osmo_sccp_user::ssn.

## ◆ osmo_sccp_user_sap_down()

int osmo_sccp_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 osmo_sccp_user_sap().

Parameters

  [in] | scu | SCCP User sending us the primitive
  [in] | oph | Osmocom primitive sent by the user

Returns
  0 on success; negative on error

References osmo_scu_prim::oph, and osmo_sccp_user_sap_down_nofree().

Referenced by osmo_sccp_tx_conn_req(), osmo_sccp_tx_conn_resp_msg(), osmo_sccp_tx_data(), osmo_sccp_tx_disconn_data(), osmo_sccp_tx_unitdata(), and sccp_scmg_tx().

## ◆ osmo_sccp_user_sap_down_nofree()

int osmo_sccp_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 osmo_sccp_user_sap_down().

Parameters

  [in] | scu | SCCP User sending us the primitive
  [in] | oph | Osmocom primitive sent by the user

Returns
  0 on success; negative on error

References osmo_scu_connect_param::conn_id, osmo_scu_prim::connect, sccp_connection::fi, sccp_connection::inst, osmo_sccp_user::inst, LOGPSCU, osmo_scu_prim::oph, OSMO_SCU_PRIM_N_CONNECT, OSMO_SCU_PRIM_N_DATA, OSMO_SCU_PRIM_N_DISCONNECT, OSMO_SCU_PRIM_N_RESET, OSMO_SCU_PRIM_N_UNITDATA, osmo_scu_prim_name(), sccp_conn_alloc(), sccp_find_conn_by_id(), sccp_sclc_user_sap_down_nofree(), scu_prim_conn_id(), scu_scoc_event_map, and osmo_scu_prim::u.

Referenced by osmo_sccp_user_sap_down().

## ◆ osmo_sccp_user_set_priv()

void osmo_sccp_user_set_priv | ( | struct osmo_sccp_user * | scu,
|  | void * | priv
| ) |  |

References osmo_sccp_user::priv.

## ◆ osmo_sccp_user_unbind()

void osmo_sccp_user_unbind | ( | struct osmo_sccp_user * | scu | ) |

Unbind a given SCCP user.

Parameters

  [in] | scu | SCCP User which is to be un-bound. Will be destroyed at the time this function returns.

References LOGPSCU, and sccp_user_free().

Referenced by osmo_sccp_instance_destroy().

## ◆ osmo_sccp_vty_init()

void osmo_sccp_vty_init | ( | void |  | ) |

References gen_sccp_timer_cmd_strs().

## ◆ osmo_scu_prim_hdr_name_buf()

int osmo_scu_prim_hdr_name_buf | ( | char * | buf,
|  | size_t | buflen,
|  | const struct osmo_prim_hdr * | oph
| ) |  |

References osmo_scu_prim_type_name().

Referenced by osmo_scu_prim_hdr_name_c(), and osmo_scu_prim_name().

## ◆ osmo_scu_prim_hdr_name_c()

char * osmo_scu_prim_hdr_name_c | ( | void * | ctx,
|  | const struct osmo_prim_hdr * | oph
| ) |  |

References osmo_scu_prim_hdr_name_buf().

## ◆ osmo_scu_prim_name()

char * osmo_scu_prim_name | ( | const struct osmo_prim_hdr * | oph | ) |

References osmo_scu_prim_hdr_name_buf(), and prim_name_buf.

Referenced by osmo_sccp_user_sap_down_nofree(), sccp_sclc_user_sap_down_nofree(), sccp_user_prim_up(), scmg_prim_cb(), xua_opt_data_cache_keep(), and xua_opt_data_check_drop().

## ◆ osmo_scu_prim_type_name()

static const char * osmo_scu_prim_type_name | ( | enum osmo_scu_prim_type | val | ) |
| inline static

References osmo_scu_prim_type_names.

Referenced by osmo_scu_prim_hdr_name_buf().

## Variable Documentation

## ◆ osmo_sccp_gti_names

const struct value_string osmo_sccp_gti_names[]
| extern

Referenced by osmo_sccp_gti_name().

## ◆ osmo_sccp_rem_sccp_status_names

const struct value_string osmo_sccp_rem_sccp_status_names[]
| extern

Referenced by osmo_sccp_rem_sccp_status_name().

## ◆ osmo_sccp_routing_ind_names

const struct value_string osmo_sccp_routing_ind_names[]
| extern

Referenced by osmo_sccp_routing_ind_name().

## ◆ osmo_sccp_sp_status_names

const struct value_string osmo_sccp_sp_status_names[]
| extern

Referenced by osmo_sccp_sp_status_name().

## ◆ osmo_sccp_ssn_names

const struct value_string osmo_sccp_ssn_names[]
| extern

Referenced by osmo_sccp_ssn_name().

## ◆ osmo_scu_prim_type_names

const struct value_string osmo_scu_prim_type_names[]
| extern

Referenced by osmo_scu_prim_type_name().