libosmo-sigtran
0.10.0
Osmocom SIGTRAN library
|
#include <stdint.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/fsm.h>
#include <osmocom/netif/stream.h>
#include <osmocom/sigtran/xua_msg.h>
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/protocol/mtp.h>
#include <osmocom/sigtran/protocol/sua.h>
#include <osmocom/sigtran/protocol/m3ua.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include "xua_as_fsm.h"
#include "xua_asp_fsm.h"
#include "xua_internal.h"
#include "sccp_internal.h"
Macros | |
#define | CONNECTION_TIMER ( 1 * 60 * 100) |
#define | TX_INACT_TIMER ( 7 * 60 * 100) /* RFC 3868 Ch. 8. */ |
#define | RX_INACT_TIMER (15 * 60 * 100) /* RFC 3868 Ch. 8. */ |
#define | RELEASE_TIMER ( 10 * 100) |
#define | RELEASE_REP_TIMER ( 10 * 100) |
#define | INT_TIMER ( 1 * 60 * 100) |
#define | GUARD_TIMER (23 * 60 * 100) |
#define | RESET_TIMER ( 10 * 100) |
#define | SCCP_MSG_SIZE 2048 |
#define | SCCP_MSG_HEADROOM 512 |
#define | MAND_IES(msgt, ies) [msgt] = (ies) |
Functions | |
struct msgb * | sccp_msgb_alloc (const char *name) |
static struct xua_msg * | sua_gen_error (uint32_t err_code) |
static struct xua_msg * | sua_gen_error_msg (uint32_t err_code, struct msgb *msg) |
static struct msgb * | sua_to_msg (struct xua_msg *xua) |
static int | sua_tx_xua_asp (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
int | sua_tx_xua_as (struct osmo_ss7_as *as, struct xua_msg *xua) |
Send a given xUA message via a given SUA Application Server. More... | |
int | sua_parse_gt (struct osmo_sccp_gt *gt, const uint8_t *data, unsigned int datalen) |
Decode SUA Global Title according to RFC3868 Section 3.10.2.3. More... | |
int | sua_addr_parse_part (struct osmo_sccp_addr *out, const struct xua_msg_part *param) |
parse SCCP address from given xUA message part More... | |
int | sua_addr_parse (struct osmo_sccp_addr *out, struct xua_msg *xua, uint16_t iei) |
parse SCCP address from given xUA message IE More... | |
static int | sua_rx_cl (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | sua_rx_co (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | sua_rx_mgmt_err (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | sua_rx_mgmt_ntfy (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | sua_rx_mgmt (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | sua_rx_asp (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
int | sua_rx_msg (struct osmo_ss7_asp *asp, struct msgb *msg) |
process SUA message received from socket More... | |
Variables | |
static const struct value_string | sua_iei_names [] |
static const uint16_t | cldt_mand_ies [] |
static const uint16_t | cldr_mand_ies [] |
static const struct value_string | sua_cl_msgt_names [] |
static const struct xua_msg_class | msg_class_cl |
static const uint16_t | codt_mand_ies [] |
static const uint16_t | coda_mand_ies [] |
static const uint16_t | core_mand_ies [] |
static const uint16_t | coak_mand_ies [] |
static const uint16_t | coref_mand_ies [] |
static const uint16_t | relre_mand_ies [] |
static const uint16_t | relco_mand_ies [] |
static const uint16_t | resre_mand_ies [] |
static const uint16_t | resco_mand_ies [] |
static const uint16_t | coerr_mand_ies [] |
static const uint16_t | coit_mand_ies [] |
static const struct value_string | sua_co_msgt_names [] |
static const struct xua_msg_class | msg_class_co |
const struct xua_dialect | xua_dialect_sua |
static const struct xua_msg_event_map | sua_aspxm_map [] |
#define CONNECTION_TIMER ( 1 * 60 * 100) |
#define GUARD_TIMER (23 * 60 * 100) |
#define INT_TIMER ( 1 * 60 * 100) |
#define MAND_IES | ( | msgt, | |
ies | |||
) | [msgt] = (ies) |
#define RELEASE_REP_TIMER ( 10 * 100) |
#define RELEASE_TIMER ( 10 * 100) |
#define RESET_TIMER ( 10 * 100) |
#define RX_INACT_TIMER (15 * 60 * 100) /* RFC 3868 Ch. 8. */ |
#define SCCP_MSG_HEADROOM 512 |
Referenced by sccp_msgb_alloc().
#define SCCP_MSG_SIZE 2048 |
Referenced by sccp_msgb_alloc().
#define TX_INACT_TIMER ( 7 * 60 * 100) /* RFC 3868 Ch. 8. */ |
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().
int sua_addr_parse | ( | struct osmo_sccp_addr * | out, |
struct xua_msg * | xua, | ||
uint16_t | iei | ||
) |
parse SCCP address from given xUA message IE
[out] | out | caller-allocated decoded SCCP address struct |
[in] | xua | xUA message |
[in] | iei | Information Element Identifier inside xua |
References sua_addr_parse_part(), and xua_msg_find_tag().
Referenced by gen_ret_msg(), patch_sccp_with_pc(), sccp_find_user(), sccp_scrc_rx_sclc_msg(), sccp_scrc_rx_scoc_conn_msg(), sclc_rx_cldr(), sclc_rx_cldt(), scoc_fsm_idle(), scrc_rx_mtp_xfer_ind_xua(), and scu_gen_encode_and_send().
int sua_addr_parse_part | ( | struct osmo_sccp_addr * | out, |
const struct xua_msg_part * | param | ||
) |
parse SCCP address from given xUA message part
[out] | out | caller-allocated decoded SCCP address struct |
[in] | param | xUA message part containing address |
References xua_msg_part::dat, osmo_sccp_addr::gt, osmo_sccp_addr::ip, xua_msg_part::len, xua_parameter_hdr::len, OSMO_SCCP_ADDR_T_GT, OSMO_SCCP_ADDR_T_IPv4, 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::pc, osmo_sccp_addr::presence, osmo_sccp_addr::ri, osmo_sccp_addr::ssn, SUA_IEI_GT, SUA_IEI_IPv4, SUA_IEI_PC, SUA_IEI_SSN, sua_parse_gt(), SUA_RI_GT, SUA_RI_HOST, SUA_RI_SSN_IP, SUA_RI_SSN_PC, xua_msg_part::tag, xua_parameter_hdr::tag, and osmo_sccp_addr::v4.
Referenced by sua_addr_parse(), and sua_addr_to_sccp().
|
static |
References xua_msg::hdr, SUA_IEI_ERR_CODE, SUA_MGMT_ERR, SUA_MSGC_MGMT, SUA_VERSION, xua_common_hdr::version, XUA_HDR, xua_msg_add_u32(), and xua_msg_alloc().
Referenced by sua_gen_error_msg().
|
static |
References sua_gen_error(), SUA_IEI_DIAG_INFO, and xua_msg_add_data().
Referenced by sua_rx_msg().
int sua_parse_gt | ( | struct osmo_sccp_gt * | gt, |
const uint8_t * | data, | ||
unsigned int | datalen | ||
) |
Decode SUA Global Title according to RFC3868 Section 3.10.2.3.
[out] | gt | User-allocated structure for decoded output |
[in] | data | binary-encoded data |
[in] | datalen | length of data in octets |
References osmo_sccp_gt::digits, osmo_sccp_gt::gti, osmo_sccp_gt::nai, osmo_sccp_gt::npi, and osmo_sccp_gt::tt.
Referenced by sua_addr_parse_part().
|
static |
References xua_msg_event_map::event, osmo_ss7_asp::fi, SUA_ERR_UNSUPP_MSG_TYPE, and xua_msg_event_map().
Referenced by sua_rx_msg().
|
static |
References xua_msg::hdr, osmo_ss7_asp::inst, xua_common_hdr::msg_class, xua_common_hdr::msg_type, osmo_ss7_instance::sccp, scrc_rx_mtp_xfer_ind_xua(), SUA_CL_CLDR, SUA_CL_CLDT, SUA_ERR_UNSUPP_MSG_TYPE, and SUA_MSGC_CL.
Referenced by sua_rx_msg().
|
static |
References xua_msg::hdr, osmo_ss7_asp::inst, xua_common_hdr::msg_class, xua_common_hdr::msg_type, osmo_ss7_instance::sccp, scrc_rx_mtp_xfer_ind_xua(), SUA_CO_COAK, SUA_CO_CODA, SUA_CO_CODT, SUA_CO_COERR, SUA_CO_COIT, SUA_CO_CORE, SUA_CO_COREF, SUA_CO_RELCO, SUA_CO_RELRE, SUA_CO_RESCO, SUA_CO_RESRE, SUA_ERR_UNSUPP_MSG_TYPE, and SUA_MSGC_CO.
Referenced by sua_rx_msg().
|
static |
References xua_msg::hdr, xua_common_hdr::msg_type, SUA_ERR_UNSUPP_MSG_TYPE, SUA_MGMT_ERR, SUA_MGMT_NTFY, sua_rx_mgmt_err(), and sua_rx_mgmt_ntfy().
Referenced by sua_rx_msg().
|
static |
References LOGPASP, m3ua_err_names, SUA_IEI_ERR_CODE, xua_msg_dump(), and xua_msg_get_u32().
Referenced by sua_rx_mgmt().
|
static |
int sua_rx_msg | ( | struct osmo_ss7_asp * | asp, |
struct msgb * | msg | ||
) |
process SUA message received from socket
[in] | asp | Application Server Process receiving msg |
[in] | msg | received message buffer |
References osmo_ss7_asp::cfg, xua_common_hdr::data, osmo_mtp_transfer_param::dpc, xua_msg::hdr, osmo_ss7_asp::inst, LOGPASP, xua_common_hdr::msg_class, xua_msg::mtp, MTP_SI_SCCP, osmo_mtp_transfer_param::opc, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp::proto, osmo_ss7_instance::sccp, osmo_mtp_transfer_param::sio, SUA_ERR_INVAL_STREAM_ID, SUA_ERR_INVALID_VERSION, SUA_ERR_MISSING_PARAM, SUA_ERR_PARAM_FIELD_ERR, SUA_ERR_UNSUPP_MSG_CLASS, sua_gen_error_msg(), SUA_MSGC_ASPSM, SUA_MSGC_ASPTM, SUA_MSGC_CL, SUA_MSGC_CO, SUA_MSGC_MGMT, SUA_MSGC_RKM, SUA_MSGC_SNM, sua_rx_asp(), sua_rx_cl(), sua_rx_co(), sua_rx_mgmt(), sua_tx_xua_asp(), SUA_VERSION, xua_common_hdr::version, xua_dialect_check_all_mand_ies(), xua_from_msg(), xua_hdr_dump(), and xua_msg_free().
Referenced by xua_cli_read_cb(), and xua_srv_conn_cb().
|
static |
References xua_msg::hdr, xua_common_hdr::msg_class, SUA_MSGC_CL, SUA_MSGC_CO, SUA_PPID, SUA_VERSION, and xua_to_msg().
Referenced by sua_tx_xua_as(), and sua_tx_xua_asp().
int sua_tx_xua_as | ( | struct osmo_ss7_as * | as, |
struct xua_msg * | xua | ||
) |
Send a given xUA message via a given SUA Application Server.
[in] | as | Application Server through which to send xua |
[in] | xua | xUA message to be sent |
References osmo_ss7_as::cfg, osmo_ss7_routing_key::context, osmo_ss7_as::fi, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_as::proto, osmo_ss7_as::routing_key, SUA_IEI_ROUTE_CTX, sua_to_msg(), XUA_AS_E_TRANSFER_REQ, and xua_msg_add_u32().
Referenced by gen_mtp_transfer_req_xua().
|
static |
References osmo_ss7_asp::cfg, OSMO_SS7_ASP_PROT_SUA, osmo_ss7_asp_send(), osmo_ss7_asp::proto, and sua_to_msg().
Referenced by sua_rx_msg().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const struct xua_dialect xua_dialect_sua |
Referenced by osmo_sua_to_sccp(), sccp_find_user(), sccp_sclc_rx_from_scrc(), sccp_scoc_rx_from_scrc(), sccp_scoc_rx_inval_opc(), sccp_scoc_rx_inval_src_ref(), sccp_scoc_rx_unass_local_ref(), sccp_scrc_rx_sclc_msg(), sccp_scrc_rx_scoc_conn_msg(), and scrc_rx_mtp_xfer_ind_xua().