Loading...
Searching...
No Matches
xua_internal.h
Go to the documentation of this file.
#pragma once
#include <osmocom/core/tdef.h>
#include <osmocom/sigtran/osmo_ss7.h>
#include "xua_msg.h"
#define M3UA_MSG_SIZE 2048
#define M3UA_MSG_HEADROOM 512
struct osmo_sccp_addr;
struct m3ua_data_hdr;
int sua_addr_parse_part(struct osmo_sccp_addr *out,
const struct xua_msg_part *param);
int sua_addr_parse(struct osmo_sccp_addr *out, struct xua_msg *xua, uint16_t iei);
int sua_parse_gt(struct osmo_sccp_gt *gt, const uint8_t *data, unsigned int datalen);
struct xua_msg *osmo_sccp_to_xua(struct msgb *msg);
struct msgb *osmo_sua_to_sccp(struct xua_msg *xua);
int sua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg);
int sua_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
void sua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *aff_ssn,
const uint32_t *smi, const char *info_string, bool available);
void sua_tx_snm_congestion(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *ssn,
const uint8_t cong_level, const char *info_string);
void sua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str);
struct osmo_mtp_prim *m3ua_to_xfer_ind(struct xua_msg *xua);
int m3ua_hmdc_rx_from_l2(struct osmo_ss7_instance *inst, struct xua_msg *xua);
int m3ua_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
void m3ua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
const uint32_t *aff_pc, unsigned int num_aff_pc,
const char *info_string, bool available);
void m3ua_tx_snm_congestion(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
const uint32_t *aff_pc, unsigned int num_aff_pc,
const uint32_t *concerned_dpc, const uint8_t *cong_level,
const char *info_string);
void m3ua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str);
void xua_snm_rx_daud(struct osmo_ss7_asp *asp, struct xua_msg *xua);
void xua_snm_rx_duna(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
void xua_snm_rx_dava(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
void xua_snm_rx_dupu(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
void xua_snm_rx_scon(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
int m3ua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg);
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);
struct m3ua_data_hdr *data_hdr_from_m3ua(struct xua_msg *xua);
void m3ua_dh_to_xfer_param(struct osmo_mtp_transfer_param *param,
const struct m3ua_data_hdr *mdh);
void mtp_xfer_param_to_m3ua_dh(struct m3ua_data_hdr *mdh,
const struct osmo_mtp_transfer_param *param);
extern const struct xua_msg_class m3ua_msg_class_mgmt;
extern const struct xua_msg_class m3ua_msg_class_snm;
extern const struct xua_msg_class m3ua_msg_class_rkm;
extern const struct xua_msg_class m3ua_msg_class_aspsm;
extern const struct xua_msg_class m3ua_msg_class_asptm;
extern const struct value_string m3ua_err_names[];
extern const struct value_string m3ua_ntfy_type_names[];
extern const struct value_string m3ua_ntfy_stchg_names[];
extern const struct value_string m3ua_ntfy_other_names[];
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);
int m3ua_rx_rkm(struct osmo_ss7_asp *asp, struct xua_msg *xua);
void xua_rkm_cleanup_dyn_as_for_asp(struct osmo_ss7_asp *asp);
struct osmo_xlm_prim *xua_xlm_prim_alloc(enum osmo_xlm_prim_type prim_type,
enum osmo_prim_operation op);
void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim *prim);
void xua_asp_send_xlm_prim_simple(struct osmo_ss7_asp *asp,
enum osmo_xlm_prim_type prim_type,
enum osmo_prim_operation op);
void xua_snm_pc_available(struct osmo_ss7_as *as, const uint32_t *aff_pc,
unsigned int num_aff_pc, const char *info_str, bool available);
enum ss7_asp_lm_timer {
/* 0 kept unused on purpose since it's handled specially by osmo_fsm */
SS7_ASP_LM_T_WAIT_ASP_UP = 1,
SS7_ASP_LM_T_WAIT_NOTIFY,
SS7_ASP_LM_T_WAIT_NOTIY_RKM,
SS7_ASP_LM_T_WAIT_RK_REG_RESP,
/* This must remain the last item: */
SS7_ASP_LM_TIMERS_LEN
};
extern const struct osmo_tdef ss7_asp_lm_timer_defaults[SS7_ASP_LM_TIMERS_LEN];
extern const struct value_string ss7_asp_lm_timer_names[];
static inline const char *ss7_asp_lm_timer_name(enum ss7_asp_lm_timer val)
{ return get_value_string(ss7_asp_lm_timer_names, val); }
extern struct osmo_fsm xua_default_lm_fsm;
extern const struct value_string m3ua_rkm_reg_status_vals[];
extern const struct value_string m3ua_rkm_dereg_status_vals[];
#define CS7_STR "ITU-T Signaling System 7\n"
#define PC_STR "Point Code\n"
#define INST_STR "An instance of the SS7 stack\n"
int xua_as_transmit_msg(struct osmo_ss7_as *as, struct msgb *msg);
int xua_find_as_for_asp(struct osmo_ss7_as **as, const struct osmo_ss7_asp *asp,
const struct xua_msg_part *rctx_ie);
int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg, uint8_t sls);
struct osmo_ss7_as *ipa_find_as_for_asp(struct osmo_ss7_asp *asp);
int osmo_isup_party_parse(char *out_digits, const uint8_t *in,
unsigned int in_num_bytes, bool odd);
int osmo_sccp_addr_parse(struct osmo_sccp_addr *out,
const uint8_t *addr, unsigned int addrlen);
int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in);
int ss7_asp_rx_unknown(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg);
sls
uint8_t sls
Definition m3ua.h:5
dpc
uint32_t dpc
Definition m3ua.h:1
osmo_ss7.h
smi
uint8_t smi
Definition sccp_scmg.h:3
osmo_xlm_prim_type
osmo_xlm_prim_type
Definition sigtran_sap.h:13
xua_msg.h
m3ua_data_hdr
Definition m3ua.h:95
osmo_mtp_prim
Definition mtp_sap.h:56
osmo_mtp_transfer_param
Definition mtp_sap.h:36
osmo_sccp_addr
Definition sccp_sap.h:183
osmo_sccp_gt
Definition sccp_sap.h:175
osmo_ss7_as
Definition ss7_as.h:31
osmo_ss7_asp
Definition ss7_asp.h:28
osmo_ss7_instance
Definition ss7_instance.h:20
osmo_xlm_prim_notify
Definition sigtran_sap.h:37
osmo_xlm_prim
Definition sigtran_sap.h:66
xua_msg_class
Definition xua_msg.h:48
xua_msg_part
Definition xua_msg.h:38
xua_msg
Definition xua_msg.h:31
m3ua_rkm_reg_status_vals
const struct value_string m3ua_rkm_reg_status_vals[]
Definition xua_rkm.c:40
m3ua_ntfy_type_names
const struct value_string m3ua_ntfy_type_names[]
Definition m3ua.c:82
xua_snm_rx_scon
void xua_snm_rx_scon(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
Definition xua_snm.c:461
m3ua_err_names
const struct value_string m3ua_err_names[]
Definition m3ua.c:58
ipa_find_as_for_asp
struct osmo_ss7_as * ipa_find_as_for_asp(struct osmo_ss7_asp *asp)
Definition ipa.c:146
xua_snm_rx_dupu
void xua_snm_rx_dupu(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
Definition xua_snm.c:427
sua_addr_parse
int sua_addr_parse(struct osmo_sccp_addr *out, struct xua_msg *xua, uint16_t iei)
parse SCCP address from given xUA message IE
Definition sua.c:511
ipa_rx_msg
int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg, uint8_t sls)
process M3UA message received from socket
Definition ipa.c:310
m3ua_tx_dupu
void m3ua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str)
Transmit SSNM DUPU message indicating user unavailability.
Definition m3ua.c:946
xua_find_as_for_asp
int xua_find_as_for_asp(struct osmo_ss7_as **as, const struct osmo_ss7_asp *asp, const struct xua_msg_part *rctx_ie)
Find the AS for given ASP + optional routing context IE.
Definition xua_shared.c:71
xua_xlm_prim_alloc
struct osmo_xlm_prim * xua_xlm_prim_alloc(enum osmo_xlm_prim_type prim_type, enum osmo_prim_operation op)
Definition xua_asp_fsm.c:97
m3ua_xfer_from_data
struct xua_msg * m3ua_xfer_from_data(const struct m3ua_data_hdr *data_hdr, const uint8_t *data, unsigned int data_len)
Definition m3ua.c:323
m3ua_tx_snm_available
void m3ua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_string, bool available)
Transmit SSNM DUNA/DAVA message indicating [un]availability of certain point code[s].
Definition m3ua.c:889
m3ua_to_xfer_ind
struct osmo_mtp_prim * m3ua_to_xfer_ind(struct xua_msg *xua)
Definition osmo_ss7_hmrt.c:47
sua_tx_snm_available
void sua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *aff_ssn, const uint32_t *smi, const char *info_string, bool available)
Transmit SSNM DUNA/DAVA message indicating [un]availability of certain point code[s].
Definition sua.c:875
m3ua_tx_xua_as
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.
Definition m3ua.c:513
m3ua_ntfy_stchg_names
const struct value_string m3ua_ntfy_stchg_names[]
Definition m3ua.c:88
m3ua_msg_class_snm
const struct xua_msg_class m3ua_msg_class_snm
Definition m3ua.c:178
m3ua_rx_msg
int m3ua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process M3UA message received from socket
Definition m3ua.c:726
osmo_isup_party_parse
int osmo_isup_party_parse(char *out_digits, const uint8_t *in, unsigned int in_num_bytes, bool odd)
Parse ISUP style address of BCD digets.
Definition sccp2sua.c:73
data_hdr_from_m3ua
struct m3ua_data_hdr * data_hdr_from_m3ua(struct xua_msg *xua)
Definition m3ua.c:543
m3ua_decode_notify
int m3ua_decode_notify(struct osmo_xlm_prim_notify *npar, void *ctx, const struct xua_msg *xua)
Definition m3ua.c:430
ipa_tx_xua_as
int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua)
Send a given xUA message via a given IPA "Application Server".
Definition ipa.c:98
xua_snm_rx_dava
void xua_snm_rx_dava(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
Definition xua_snm.c:392
xua_rkm_cleanup_dyn_as_for_asp
void xua_rkm_cleanup_dyn_as_for_asp(struct osmo_ss7_asp *asp)
Definition xua_rkm.c:596
ss7_asp_lm_timer_defaults
const struct osmo_tdef ss7_asp_lm_timer_defaults[SS7_ASP_LM_TIMERS_LEN]
Definition xua_default_lm_fsm.c:86
m3ua_rkm_dereg_status_vals
const struct value_string m3ua_rkm_dereg_status_vals[]
Definition xua_rkm.c:57
ss7_asp_rx_unknown
int ss7_asp_rx_unknown(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
Definition osmo_ss7_asp.c:1175
ss7_asp_lm_timer_name
static const char * ss7_asp_lm_timer_name(enum ss7_asp_lm_timer val)
Definition xua_internal.h:105
sua_rx_msg
int sua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process SUA message received from socket
Definition sua.c:686
mtp_xfer_param_to_m3ua_dh
void mtp_xfer_param_to_m3ua_dh(struct m3ua_data_hdr *mdh, const struct osmo_mtp_transfer_param *param)
Definition m3ua.c:291
xua_default_lm_fsm
struct osmo_fsm xua_default_lm_fsm
Definition xua_default_lm_fsm.c:380
xua_asp_send_xlm_prim
void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim *prim)
Definition xua_asp_fsm.c:112
sua_tx_xua_as
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.
Definition sua.c:308
sua_tx_snm_congestion
void sua_tx_snm_congestion(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *ssn, const uint8_t cong_level, const char *info_string)
Transmit SSNM SCON message indicating congestion.
Definition sua.c:899
m3ua_msg_class_rkm
const struct xua_msg_class m3ua_msg_class_rkm
Definition m3ua.c:262
sua_addr_parse_part
int sua_addr_parse_part(struct osmo_sccp_addr *out, const struct xua_msg_part *param)
parse SCCP address from given xUA message part
Definition sua.c:379
m3ua_hmdc_rx_from_l2
int m3ua_hmdc_rx_from_l2(struct osmo_ss7_instance *inst, struct xua_msg *xua)
Definition osmo_ss7_hmrt.c:281
m3ua_encode_notify
struct xua_msg * m3ua_encode_notify(const struct osmo_xlm_prim_notify *npar)
Definition m3ua.c:401
ss7_asp_lm_timer_names
const struct value_string ss7_asp_lm_timer_names[]
Definition xua_default_lm_fsm.c:99
m3ua_msg_class_aspsm
const struct xua_msg_class m3ua_msg_class_aspsm
Definition m3ua.c:201
m3ua_msg_class_asptm
const struct xua_msg_class m3ua_msg_class_asptm
Definition m3ua.c:214
osmo_sccp_to_xua
struct xua_msg * osmo_sccp_to_xua(struct msgb *msg)
convert SCCP message to a SUA message
Definition sccp2sua.c:1667
m3ua_ntfy_other_names
const struct value_string m3ua_ntfy_other_names[]
Definition m3ua.c:96
xua_snm_pc_available
void xua_snm_pc_available(struct osmo_ss7_as *as, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_str, bool available)
Definition xua_snm.c:172
m3ua_rx_rkm
int m3ua_rx_rkm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition xua_rkm.c:536
osmo_sua_to_sccp
struct msgb * osmo_sua_to_sccp(struct xua_msg *xua)
convert parsed SUA message to SCCP message
Definition sccp2sua.c:1781
m3ua_msgb_alloc
struct msgb * m3ua_msgb_alloc(const char *name)
Definition m3ua.c:315
m3ua_dh_to_xfer_param
void m3ua_dh_to_xfer_param(struct osmo_mtp_transfer_param *param, const struct m3ua_data_hdr *mdh)
Definition m3ua.c:303
m3ua_msg_class_mgmt
const struct xua_msg_class m3ua_msg_class_mgmt
Definition m3ua.c:232
ss7_asp_lm_timer
ss7_asp_lm_timer
Definition xua_internal.h:92
SS7_ASP_LM_T_WAIT_ASP_UP
@ SS7_ASP_LM_T_WAIT_ASP_UP
Definition xua_internal.h:94
SS7_ASP_LM_TIMERS_LEN
@ SS7_ASP_LM_TIMERS_LEN
Definition xua_internal.h:99
SS7_ASP_LM_T_WAIT_NOTIFY
@ SS7_ASP_LM_T_WAIT_NOTIFY
Definition xua_internal.h:95
SS7_ASP_LM_T_WAIT_RK_REG_RESP
@ SS7_ASP_LM_T_WAIT_RK_REG_RESP
Definition xua_internal.h:97
SS7_ASP_LM_T_WAIT_NOTIY_RKM
@ SS7_ASP_LM_T_WAIT_NOTIY_RKM
Definition xua_internal.h:96
osmo_sccp_addr_encode
int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in)
encode a SCCP address from parsed format to wire format
Definition sccp2sua.c:225
m3ua_tx_snm_congestion
void m3ua_tx_snm_congestion(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *concerned_dpc, const uint8_t *cong_level, const char *info_string)
Transmit SSNM SCON message indicating congestion.
Definition m3ua.c:913
sua_parse_gt
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.
Definition sua.c:342
osmo_sccp_addr_parse
int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, const uint8_t *addr, unsigned int addrlen)
Parse wire-encoded SCCP address into osmo_sccp_addr.
Definition sccp2sua.c:119
xua_asp_send_xlm_prim_simple
void xua_asp_send_xlm_prim_simple(struct osmo_ss7_asp *asp, enum osmo_xlm_prim_type prim_type, enum osmo_prim_operation op)
Definition xua_asp_fsm.c:127
xua_snm_rx_duna
void xua_snm_rx_duna(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua)
Definition xua_snm.c:357
sua_tx_dupu
void sua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx, uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str)
Transmit SSNM DUPU message indicating user unavailability.
Definition sua.c:926
xua_snm_rx_daud
void xua_snm_rx_daud(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition xua_snm.c:312
xua_as_transmit_msg
int xua_as_transmit_msg(struct osmo_ss7_as *as, struct msgb *msg)
Definition xua_as_fsm.c:123
data
uint8_t data[0]
Definition xua_types.h:5