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/netif/stream.h>
#include <osmocom/sigtran/xua_msg.h>
#include <osmocom/sigtran/mtp_sap.h>
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/protocol/m3ua.h>
#include <osmocom/sigtran/protocol/sua.h>
#include "xua_as_fsm.h"
#include "xua_asp_fsm.h"
#include "xua_internal.h"
Macros | |
#define | M3UA_MSGB_SIZE 1500 |
#define | MAND_IES(msgt, ies) [msgt] = (ies) |
#define | M3UA_MSG_SIZE 2048 |
#define | M3UA_MSG_HEADROOM 512 |
Functions | |
void | mtp_xfer_param_to_m3ua_dh (struct m3ua_data_hdr *mdh, const struct osmo_mtp_transfer_param *param) |
void | m3ua_dh_to_xfer_param (struct osmo_mtp_transfer_param *param, const struct m3ua_data_hdr *mdh) |
struct msgb * | m3ua_msgb_alloc (const char *name) |
struct xua_msg * | m3ua_xfer_from_data (const struct m3ua_data_hdr *data_hdr, const uint8_t *data, unsigned int data_len) |
static struct xua_msg * | m3ua_gen_error (uint32_t err_code) |
static struct xua_msg * | m3ua_gen_error_msg (uint32_t err_code, struct msgb *msg) |
struct xua_msg * | m3ua_encode_notify (const struct osmo_xlm_prim_notify *npar) |
int | m3ua_decode_notify (struct osmo_xlm_prim_notify *npar, void *ctx, const struct xua_msg *xua) |
static struct msgb * | m3ua_to_msg (struct xua_msg *xua) |
static int | m3ua_tx_xua_asp (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
int | m3ua_tx_xua_as (struct osmo_ss7_as *as, struct xua_msg *xua) |
Send a given xUA message via a given M3UA Application Server. More... | |
struct m3ua_data_hdr * | data_hdr_from_m3ua (struct xua_msg *xua) |
static int | m3ua_rx_xfer (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | m3ua_rx_mgmt_err (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | m3ua_rx_mgmt_ntfy (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | m3ua_rx_mgmt (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
static int | m3ua_rx_asp (struct osmo_ss7_asp *asp, struct xua_msg *xua) |
int | m3ua_rx_msg (struct osmo_ss7_asp *asp, struct msgb *msg) |
process M3UA message received from socket More... | |
Variables | |
const struct value_string | m3ua_err_names [] |
const struct value_string | m3ua_ntfy_type_names [] |
const struct value_string | m3ua_ntfy_stchg_names [] |
const struct value_string | m3ua_ntfy_other_names [] |
static const struct value_string | m3ua_iei_names [] |
static const uint16_t | data_mand_ies [] |
static const struct value_string | m3ua_xfer_msgt_names [] |
static const struct xua_msg_class | msg_class_xfer |
static const uint16_t | duna_mand_ies [] |
static const uint16_t | dava_mand_ies [] |
static const uint16_t | daud_mand_ies [] |
static const uint16_t | scon_mand_ies [] |
static const uint16_t | dupu_mand_ies [] |
static const uint16_t | drst_mand_ies [] |
static const struct value_string | m3ua_snm_msgt_names [] |
const struct xua_msg_class | m3ua_msg_class_snm |
static const struct value_string | m3ua_aspsm_msgt_names [] |
const struct xua_msg_class | m3ua_msg_class_aspsm |
const struct value_string | m3ua_asptm_msgt_names [] |
const struct xua_msg_class | m3ua_msg_class_asptm |
static const uint16_t | err_req_ies [] |
static const uint16_t | ntfy_req_ies [] |
static const struct value_string | m3ua_mgmt_msgt_names [] |
const struct xua_msg_class | m3ua_msg_class_mgmt |
static const uint16_t | reg_req_ies [] |
static const uint16_t | reg_rsp_ies [] |
static const uint16_t | dereg_req_ies [] |
static const uint16_t | dereg_rsp_ies [] |
static const struct value_string | m3ua_rkm_msgt_names [] |
const struct xua_msg_class | m3ua_msg_class_rkm |
const struct xua_dialect | xua_dialect_m3ua |
static const struct xua_msg_event_map | m3ua_aspxm_map [] |
#define M3UA_MSG_HEADROOM 512 |
Referenced by m3ua_msgb_alloc().
#define M3UA_MSG_SIZE 2048 |
Referenced by m3ua_msgb_alloc().
#define M3UA_MSGB_SIZE 1500 |
#define MAND_IES | ( | msgt, | |
ies | |||
) | [msgt] = (ies) |
struct m3ua_data_hdr* data_hdr_from_m3ua | ( | struct xua_msg * | xua | ) |
References xua_msg_part::dat, xua_msg::hdr, M3UA_IEI_PROT_DATA, M3UA_MSGC_XFER, M3UA_XFER_DATA, xua_common_hdr::msg_class, xua_common_hdr::msg_type, and xua_msg_find_tag().
Referenced by hmdt_message_for_distribution(), and m3ua_rx_xfer().
int m3ua_decode_notify | ( | struct osmo_xlm_prim_notify * | npar, |
void * | ctx, | ||
const struct xua_msg * | xua | ||
) |
References osmo_xlm_prim_notify::asp_id, xua_msg_part::dat, osmo_xlm_prim_notify::info_string, xua_msg_part::len, M3UA_IEI_ASP_ID, M3UA_IEI_INFO_STRING, M3UA_IEI_ROUTE_CTX, M3UA_IEI_STATUS, NOTIFY_PAR_P_ASP_ID, NOTIFY_PAR_P_ROUTE_CTX, osmo_xlm_prim_notify::presence, osmo_xlm_prim_notify::route_ctx, osmo_xlm_prim_notify::status_info, osmo_xlm_prim_notify::status_type, xua_msg_find_tag(), and xua_msg_part_get_u32().
Referenced by m3ua_rx_mgmt_ntfy(), and sua_rx_mgmt_ntfy().
void m3ua_dh_to_xfer_param | ( | struct osmo_mtp_transfer_param * | param, |
const struct m3ua_data_hdr * | mdh | ||
) |
References osmo_mtp_transfer_param::dpc, m3ua_data_hdr::dpc, m3ua_data_hdr::mp, m3ua_data_hdr::ni, osmo_mtp_transfer_param::opc, m3ua_data_hdr::opc, m3ua_data_hdr::si, osmo_mtp_transfer_param::sio, osmo_mtp_transfer_param::sls, and m3ua_data_hdr::sls.
Referenced by ipa_rx_msg_sccp(), m3ua_rx_xfer(), and m3ua_to_xfer_ind().
struct xua_msg* m3ua_encode_notify | ( | const struct osmo_xlm_prim_notify * | npar | ) |
References osmo_xlm_prim_notify::asp_id, xua_msg::hdr, osmo_xlm_prim_notify::info_string, M3UA_IEI_ASP_ID, M3UA_IEI_INFO_STRING, M3UA_IEI_ROUTE_CTX, M3UA_IEI_STATUS, M3UA_MGMT_NTFY, M3UA_MSGC_MGMT, M3UA_NOTIFY, NOTIFY_PAR_P_ASP_ID, NOTIFY_PAR_P_ROUTE_CTX, osmo_xlm_prim_notify::presence, osmo_xlm_prim_notify::route_ctx, osmo_xlm_prim_notify::status_info, osmo_xlm_prim_notify::status_type, XUA_HDR, xua_msg_add_data(), xua_msg_add_u32(), and xua_msg_alloc().
Referenced by encode_notify().
|
static |
References xua_msg::hdr, M3UA_IEI_ERR_CODE, M3UA_MGMT_ERR, M3UA_MSGC_MGMT, M3UA_VERSION, xua_common_hdr::version, XUA_HDR, xua_msg_add_u32(), and xua_msg_alloc().
Referenced by m3ua_gen_error_msg().
|
static |
References m3ua_gen_error(), M3UA_IEI_DIAG_INFO, and xua_msg_add_data().
Referenced by m3ua_rx_msg().
struct msgb* m3ua_msgb_alloc | ( | const char * | name | ) |
References M3UA_MSG_HEADROOM, and M3UA_MSG_SIZE.
Referenced by m3ua_rx_rkm_dereg_req(), m3ua_rx_rkm_reg_req(), m3ua_to_xfer_ind(), xua_cli_read_cb(), xua_rkm_send_dereg_req(), xua_rkm_send_reg_req(), and xua_srv_conn_cb().
|
static |
References xua_msg_event_map::event, osmo_ss7_asp::fi, M3UA_ERR_UNEXPECTED_MSG, M3UA_ERR_UNSUPP_MSG_TYPE, and xua_msg_event_map().
Referenced by m3ua_rx_msg().
|
static |
References xua_msg::hdr, M3UA_ERR_UNSUPP_MSG_TYPE, M3UA_MGMT_ERR, M3UA_MGMT_NTFY, m3ua_rx_mgmt_err(), m3ua_rx_mgmt_ntfy(), and xua_common_hdr::msg_type.
Referenced by m3ua_rx_msg().
|
static |
References osmo_xlm_prim_error::code, osmo_xlm_prim::error, LOGPASP, m3ua_err_names, M3UA_IEI_ERR_CODE, OSMO_XLM_PRIM_M_ERROR, osmo_xlm_prim::u, xua_asp_send_xlm_prim(), xua_msg_dump(), xua_msg_get_u32(), and xua_xlm_prim_alloc().
Referenced by m3ua_rx_mgmt().
|
static |
References osmo_xlm_prim_notify::info_string, LOGPASP, m3ua_decode_notify(), M3UA_NOTIFY_T_OTHER, M3UA_NOTIFY_T_STATCHG, m3ua_ntfy_other_names, m3ua_ntfy_stchg_names, m3ua_ntfy_type_names, osmo_xlm_prim::notify, OSMO_XLM_PRIM_M_NOTIFY, osmo_xlm_prim_notify::status_info, osmo_xlm_prim_notify::status_type, osmo_xlm_prim::u, xua_asp_send_xlm_prim(), and xua_xlm_prim_alloc().
Referenced by m3ua_rx_mgmt().
int m3ua_rx_msg | ( | struct osmo_ss7_asp * | asp, |
struct msgb * | msg | ||
) |
process M3UA 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, xua_msg::hdr, LOGPASP, M3UA_ERR_INVAL_STREAM_ID, M3UA_ERR_INVALID_VERSION, M3UA_ERR_MISSING_PARAM, M3UA_ERR_PARAM_FIELD_ERR, M3UA_ERR_UNSUPP_MSG_CLASS, m3ua_gen_error_msg(), M3UA_MSGC_ASPSM, M3UA_MSGC_ASPTM, M3UA_MSGC_MGMT, M3UA_MSGC_RKM, M3UA_MSGC_SNM, M3UA_MSGC_XFER, m3ua_rx_asp(), m3ua_rx_mgmt(), m3ua_rx_rkm(), m3ua_rx_xfer(), m3ua_tx_xua_asp(), M3UA_VERSION, xua_common_hdr::msg_class, OSMO_SS7_ASP_PROT_M3UA, osmo_ss7_asp::proto, 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 data_hdr_from_m3ua(), osmo_mtp_transfer_param::dpc, xua_msg::hdr, osmo_ss7_asp::inst, LOGPASP, m3ua_dh_to_xfer_param(), M3UA_ERR_INVAL_ROUT_CTX, M3UA_ERR_NO_CONFGD_AS_FOR_ASP, M3UA_ERR_UNSUPP_MSG_TYPE, m3ua_hmdc_rx_from_l2(), M3UA_IEI_ROUTE_CTX, M3UA_XFER_DATA, m3ua_xfer_msgt_names, xua_common_hdr::msg_type, xua_msg::mtp, osmo_mtp_transfer_param::opc, osmo_ss7_as_find_by_rctx(), osmo_ss7_as_has_asp(), osmo_ss7_pointcode_print(), osmo_ss7_pointcode_print2(), xua_msg_free_tag(), and xua_msg_get_u32().
Referenced by m3ua_rx_msg().
|
static |
References xua_msg::hdr, M3UA_MSGC_XFER, M3UA_PPID, M3UA_VERSION, xua_common_hdr::msg_class, and xua_to_msg().
Referenced by m3ua_tx_xua_as(), and m3ua_tx_xua_asp().
int m3ua_tx_xua_as | ( | struct osmo_ss7_as * | as, |
struct xua_msg * | xua | ||
) |
Send a given xUA message via a given M3UA 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, M3UA_IEI_ROUTE_CTX, m3ua_to_msg(), OSMO_SS7_ASP_PROT_M3UA, osmo_ss7_as::proto, osmo_ss7_as::routing_key, XUA_AS_E_TRANSFER_REQ, and xua_msg_add_u32().
Referenced by hmrt_message_for_routing().
|
static |
References osmo_ss7_asp::cfg, m3ua_to_msg(), OSMO_SS7_ASP_PROT_M3UA, osmo_ss7_asp_send(), and osmo_ss7_asp::proto.
Referenced by m3ua_rx_msg().
struct xua_msg* m3ua_xfer_from_data | ( | const struct m3ua_data_hdr * | data_hdr, |
const uint8_t * | data, | ||
unsigned int | data_len | ||
) |
References xua_msg_part::dat, xua_msg_part::entry, xua_msg::hdr, xua_msg::headers, xua_msg_part::len, M3UA_IEI_PROT_DATA, M3UA_MSGC_XFER, M3UA_XFER_DATA, xua_msg_part::tag, XUA_HDR, and xua_msg_alloc().
Referenced by ipa_rx_msg_sccp(), and mtp_prim_to_m3ua().
void mtp_xfer_param_to_m3ua_dh | ( | struct m3ua_data_hdr * | mdh, |
const struct osmo_mtp_transfer_param * | param | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
const struct value_string m3ua_asptm_msgt_names[] |
|
static |
const struct value_string m3ua_err_names[] |
Referenced by m3ua_rx_mgmt_err(), and sua_rx_mgmt_err().
|
static |
|
static |
const struct xua_msg_class m3ua_msg_class_aspsm |
const struct xua_msg_class m3ua_msg_class_asptm |
const struct xua_msg_class m3ua_msg_class_mgmt |
const struct xua_msg_class m3ua_msg_class_rkm |
const struct xua_msg_class m3ua_msg_class_snm |
const struct value_string m3ua_ntfy_other_names[] |
Referenced by m3ua_rx_mgmt_ntfy(), and sua_rx_mgmt_ntfy().
const struct value_string m3ua_ntfy_stchg_names[] |
Referenced by m3ua_rx_mgmt_ntfy(), and sua_rx_mgmt_ntfy().
const struct value_string m3ua_ntfy_type_names[] |
Referenced by m3ua_rx_mgmt_ntfy(), and sua_rx_mgmt_ntfy().
|
static |
|
static |
|
static |
Referenced by m3ua_rx_xfer().
|
static |
|
static |
|
static |
|
static |
|
static |
const struct xua_dialect xua_dialect_m3ua |