libosmo-sigtran: src/ss7.c File Reference

libosmo-sigtran 2.2.1.95-893c Osmocom SIGTRAN library

Functions | Variables
ss7.c File Reference
`#include <string.h>`
`#include <errno.h>`
`#include <unistd.h>`
`#include <inttypes.h>`
`#include <netdb.h>`
`#include <netinet/in.h>`
`#include <netinet/sctp.h>`
`#include <osmocom/sigtran/osmo_ss7.h>`
`#include <osmocom/sigtran/mtp_sap.h>`
`#include <osmocom/sigtran/protocol/mtp.h>`
`#include <osmocom/sigtran/protocol/sua.h>`
`#include <osmocom/sigtran/protocol/m3ua.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/core/select.h>`
`#include <osmocom/core/utils.h>`
`#include <osmocom/core/talloc.h>`
`#include <osmocom/core/logging.h>`
`#include <osmocom/core/msgb.h>`
`#include <osmocom/core/socket.h>`
`#include <osmocom/core/sockaddr_str.h>`
`#include <osmocom/netif/stream.h>`
`#include <osmocom/netif/ipa.h>`
`#include <osmocom/netif/sctp.h>`
`#include "sccp_scoc_fsm.h"`
`#include "sccp_internal.h"`
`#include "xua_internal.h"`
`#include "ss7_as.h"`
`#include "ss7_asp.h"`
`#include "ss7_internal.h"`
`#include "ss7_linkset.h"`
`#include "ss7_route.h"`
`#include "ss7_route_table.h"`
`#include "xua_asp_fsm.h"`
`#include "xua_as_fsm.h"`

## Functions
| LLIST_HEAD (osmo_ss7_instances)
struct osmo_ss7_instance * | osmo_ss7_instances_llist_entry (struct llist_head *list)
uint8_t | osmo_ss7_pc_width (const struct osmo_ss7_pc_fmt *pc_fmt)
uint32_t | ss7_pc_full_mask (const struct osmo_ss7_pc_fmt *pc_fmt)
uint32_t | osmo_ss7_pc_normalize (const struct osmo_ss7_pc_fmt *pc_fmt, uint32_t pc)
struct osmo_ss7_instance * | osmo_ss7_instance_find (uint32_t id)
| Find a SS7 Instance with given ID. More...
struct osmo_ss7_instance * | osmo_ss7_instance_find_or_create (void *ctx, uint32_t id)
| Find or create a SS7 Instance. More...
bool | ss7_ipv6_sctp_supported (const char *host, bool bind)
int | osmo_ss7_init (void)
int | osmo_ss7_tmode_to_xua (enum osmo_ss7_as_traffic_mode tmod)
enum osmo_ss7_as_traffic_mode | osmo_ss7_tmode_from_xua (uint32_t in)

## Variables
bool | ss7_initialized = false
const struct value_string | mtp_unavail_cause_vals []

## Function Documentation

## ◆ LLIST_HEAD()

LLIST_HEAD | ( | osmo_ss7_instances |  | ) |

## ◆ osmo_ss7_init()

int osmo_ss7_init | ( | void |  | ) |

References ipa_asp_fsm, sccp_scoc_fsm, ss7_initialized, xua_as_fsm, xua_asp_fsm, and xua_default_lm_fsm.

## ◆ osmo_ss7_instance_find()

struct osmo_ss7_instance * osmo_ss7_instance_find | ( | uint32_t | id | ) |

Find a SS7 Instance with given ID.

Parameters

  [in] | id | ID for which to search

Returns
  osmo_ss7_instance on success; NULL on error

References osmo_ss7_instance::cfg, osmo_ss7_instance::id, osmo_ss7_instance::list, NULL, osmo_ss7_instances, and ss7_initialized.

Referenced by DEFUN(), DEFUN_ATTR(), osmo_sccp_simple_client_on_ss7_id(), osmo_ss7_instance_find_or_create(), show_as(), show_asp(), show_asp_assoc_status(), and show_asp_remaddr().

## ◆ osmo_ss7_instance_find_or_create()

struct osmo_ss7_instance * osmo_ss7_instance_find_or_create | ( | void * | ctx,
|  | uint32_t | id
| ) |  |

Find or create a SS7 Instance.

Parameters

  [in] | ctx | talloc allocation context to use for allocations
  [in] | id | ID of SS7 Instance

Returns
  osmo_ss7_instance on success; NULL on error

References osmo_ss7_instance_find(), ss7_initialized, and ss7_instance_alloc().

Referenced by DEFUN_ATTR(), osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_on_ss7_id().

## ◆ osmo_ss7_instances_llist_entry()

struct osmo_ss7_instance * osmo_ss7_instances_llist_entry | ( | struct llist_head * | list | ) |

References osmo_ss7_instance::list.

## ◆ osmo_ss7_pc_normalize()

uint32_t osmo_ss7_pc_normalize | ( | const struct osmo_ss7_pc_fmt * | pc_fmt,
|  | uint32_t | pc
| ) |  |

References pc, and ss7_pc_full_mask().

Referenced by ss7_combined_linkset_alloc(), ss7_route_alloc(), ss7_route_table_find_combined_linkset_by_dpc(), ss7_route_table_find_combined_linkset_by_dpc_mask(), ss7_route_table_find_route_by_dpc_mask(), ss7_route_table_find_route_by_dpc_mask_as(), and ss7_route_table_lookup_route().

## ◆ osmo_ss7_pc_width()

uint8_t osmo_ss7_pc_width | ( | const struct osmo_ss7_pc_fmt * | pc_fmt | ) |

References osmo_ss7_pc_fmt::component_len.

Referenced by get_pc_comp_shift(), osmo_ss7_pointcode_parse_mask_or_len(), osmo_ss7_route_print(), and ss7_pc_full_mask().

## ◆ osmo_ss7_tmode_from_xua()

enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua | ( | uint32_t | in | ) |

References M3UA_TMOD_BCAST, M3UA_TMOD_LOADSHARE, M3UA_TMOD_OVERRIDE, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, and OSMO_SS7_AS_TMOD_OVERRIDE.

Referenced by handle_rkey_reg(), and xua_asp_fsm_inactive().

## ◆ osmo_ss7_tmode_to_xua()

int osmo_ss7_tmode_to_xua | ( | enum osmo_ss7_as_traffic_mode | tmod | ) |

References M3UA_TMOD_BCAST, M3UA_TMOD_LOADSHARE, M3UA_TMOD_OVERRIDE, OSMO_SS7_AS_TMOD_BCAST, OSMO_SS7_AS_TMOD_LOADSHARE, OSMO_SS7_AS_TMOD_OVERRIDE, and OSMO_SS7_AS_TMOD_ROUNDROBIN.

Referenced by peer_send(), and xua_rkm_send_reg_req().

## ◆ ss7_ipv6_sctp_supported()

bool ss7_ipv6_sctp_supported | ( | const char * | host,
|  | bool | bind
| ) |  |

References NULL.

Referenced by ss7_asp_set_default_peer_hosts(), and ss7_xua_server_set_default_local_hosts().

## ◆ ss7_pc_full_mask()

uint32_t ss7_pc_full_mask | ( | const struct osmo_ss7_pc_fmt * | pc_fmt | ) |

References osmo_ss7_pc_width().

Referenced by osmo_ss7_pc_normalize(), and ss7_route_is_fully_qualified().

## Variable Documentation

## ◆ mtp_unavail_cause_vals

const struct value_string mtp_unavail_cause_vals[]

Initial value:
= {
{ MTP_UNAVAIL_C_UNKNOWN, "unknown" },
{ MTP_UNAVAIL_C_UNEQUIP_REM_USER, "unequipped-remote-user" },
{ MTP_UNAVAIL_C_INACC_REM_USER, "inaccessible-remote-user" },
{ 0, NULL }
}
MTP_UNAVAIL_C_UNEQUIP_REM_USER
@ MTP_UNAVAIL_C_UNEQUIP_REM_USER
Definition: mtp.h:51
MTP_UNAVAIL_C_UNKNOWN
@ MTP_UNAVAIL_C_UNKNOWN
Definition: mtp.h:50
MTP_UNAVAIL_C_INACC_REM_USER
@ MTP_UNAVAIL_C_INACC_REM_USER
Definition: mtp.h:52
NULL
int and can be left NULL
Definition: osmo_ss7.h:353

Referenced by mtp_unavail_cause_str().

## ◆ ss7_initialized

bool ss7_initialized = false

Referenced by osmo_ss7_as_add_asp(), osmo_ss7_as_del_asp(), osmo_ss7_as_destroy(), osmo_ss7_as_find_by_l_rk_id(), osmo_ss7_as_find_by_name(), osmo_ss7_as_find_by_proto(), osmo_ss7_as_find_by_rctx(), osmo_ss7_as_find_or_create(), osmo_ss7_as_has_asp(), osmo_ss7_asp_destroy(), osmo_ss7_asp_find2(), osmo_ss7_asp_find_by_name(), osmo_ss7_asp_find_or_create2(), osmo_ss7_asp_restart(), osmo_ss7_asp_send(), osmo_ss7_init(), osmo_ss7_instance_destroy(), osmo_ss7_instance_find(), osmo_ss7_instance_find_or_create(), osmo_ss7_pc_is_local(), osmo_ss7_route_lookup(), ss7_asp_find_by_socket_addr(), ss7_instance_lookup_route(), ss7_link_destroy(), ss7_link_find_or_create(), ss7_linkset_destroy(), ss7_linkset_find_by_name(), ss7_linkset_find_or_create(), ss7_route_alloc(), ss7_route_destroy(), ss7_route_table_find(), ss7_route_table_find_combined_linkset_by_dpc(), ss7_route_table_find_combined_linkset_by_dpc_mask(), ss7_route_table_find_or_create(), ss7_route_table_find_route_by_dpc_mask(), ss7_route_table_find_route_by_dpc_mask_as(), ss7_xua_server_create2(), ss7_xua_server_find2(), and ss7_xua_server_set_local_hosts().