libosmo-sigtran
0.10.0
Osmocom SIGTRAN library
|
Go to the documentation of this file.
3 #include <osmocom/core/fsm.h>
4 #include <osmocom/core/prim.h>
11 struct llist_head
list;
15 struct llist_head
users;
28 struct llist_head
list;
39 struct llist_head
links;
71 struct xua_msg *xua, uint32_t cause);
79 struct xua_msg *xua, uint32_t cause);
struct osmo_scu_data_param data
Definition: sccp_sap.h:229
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:126
#define M3UA_MSGC_SNM
Definition: m3ua.h:31
static void write_one_cs7(struct vty *vty, struct osmo_ss7_instance *inst)
Definition: osmo_ss7_vty.c:1599
struct osmo_ss7_instance * ss7
Definition: sccp_internal.h:20
struct osmo_ss7_instance * osmo_ss7_instance_find(uint32_t id)
Find a SS7 Instance with given ID.
Definition: osmo_ss7.c:329
#define APPEND(fmt, args ...)
Definition: sccp_internal.h:9
struct osmo_ss7_instance * osmo_ss7_instance_find_or_create(void *ctx, uint32_t id)
Find or create a SS7 Instance.
Definition: osmo_ss7.c:346
uint32_t dpc
Definition: mtp_sap.h:38
uint32_t id
Definition: osmo_ss7.h:161
int _sccp_parse_connection_release_complete(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:349
uint8_t network_indicator
Definition: osmo_ss7.h:98
@ XUA_ASPFSM_ROLE_ASP
Definition: xua_asp_fsm.h:40
struct osmo_fsm sccp_scoc_fsm
Definition: sccp_scoc.c:1177
static int xua_cli_connect_cb(struct osmo_stream_cli *cli)
Definition: osmo_ss7.c:1462
const struct value_string mtp_si_vals[]
Definition: osmo_ss7_vty.c:822
static int sua_to_sccp_udt(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1180
struct llist_head osmo_ss7_instances
#define MAND_IES(msgt, ies)
Definition: m3ua.c:129
static void vty_init_addr(void)
Definition: osmo_ss7_vty.c:1727
struct llist_head list
member of global list of instances
Definition: osmo_ss7.h:72
int osmo_sccp_tx_conn_req_msg(struct osmo_sccp_user *scu, uint32_t conn_id, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, struct msgb *msg)
Definition: sccp_helpers.c:138
struct osmo_ss7_link * links[16]
array of osmo_ss7_link
Definition: osmo_ss7.h:182
struct msgb * sccp_create_cr(const struct sccp_source_reference *src_ref, const struct sockaddr_sccp *called, const uint8_t *l3_data, size_t l3_length)
Definition: sccp.c:757
int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name)
Delete given ASP from given AS.
Definition: osmo_ss7.c:987
@ XUA_ASPFSM_ROLE_SG
Definition: xua_asp_fsm.h:41
union osmo_xlm_prim::@31 u
int osmo_ss7_instance_bind(struct osmo_ss7_instance *inst)
bind all xUA servers belonging to an SS7 Instance
Definition: osmo_ss7.c:430
#define SUA_CO_COAK
Definition: sua.h:71
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:387
#define CS7_STR
Definition: xua_internal.h:66
int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
send a fully encoded msgb via a given ASP
Definition: osmo_ss7.c:1715
static void write_one_as(struct vty *vty, struct osmo_ss7_as *as)
Definition: osmo_ss7_vty.c:933
struct llist_head entry
Definition: xua_msg.h:39
uint32_t xua_msg_get_u32(struct xua_msg *xua, uint16_t iei)
Definition: xua_msg.c:292
uint8_t data[0]
Definition: xua_types.h:37
uint16_t status_info
Definition: sigtran_sap.h:40
static const struct value_string sctp_assoc_chg_vals[]
Definition: osmo_ss7.c:1287
struct osmo_ss7_as * as
pointer to Application Server
Definition: osmo_ss7.h:213
void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb)
Register a call-back function for unknown SCTP PPID / IPA Stream ID.
Definition: osmo_ss7.c:1937
@ OSMO_SCU_PRIM_N_DISCONNECT
Definition: sccp_sap.h:37
char * osmo_sccp_gt_dump(const struct osmo_sccp_gt *gt)
Definition: sccp_helpers.c:256
static const struct value_string m3ua_snm_msgt_names[]
Definition: m3ua.c:166
@ OSMO_XLM_PRIM_M_SCTP_RELEASE
Definition: sigtran_sap.h:15
#define M3UA_IEI_DEREG_STATUS
Definition: m3ua.h:92
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:47
static int _sccp_parse_err(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:470
static const struct value_string sctp_sn_type_vals[]
Definition: osmo_ss7.c:1296
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
Definition: sccp_user.c:194
Definition: osmo_ss7.h:288
char * info_string
Definition: sigtran_sap.h:43
#define M3UA_IEI_SVC_IND
Definition: m3ua.h:88
void * priv
Definition: sccp_internal.h:43
struct osmo_ss7_instance::@20 cfg
static const struct osmo_ss7_pc_fmt default_pc_fmt
Definition: osmo_ss7.c:119
static struct xua_msg * sccp_to_xua_rlc(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1109
static unsigned int num_pc_comp_exp(const struct osmo_ss7_pc_fmt *pc_fmt)
Definition: osmo_ss7.c:169
osmo_ss7_as_traffic_mode
Definition: osmo_ss7.h:254
#define SCCP_MSG_SIZE
Definition: sccp.c:42
@ M3UA_ERR_INVAL_ROUT_CTX
Definition: m3ua.h:171
@ OSMO_SCU_PRIM_N_UNITDATA
Definition: sccp_sap.h:41
#define M3UA_NOTIFY_T_STATCHG
Definition: m3ua.h:107
static const uint16_t dava_mand_ies[]
Definition: m3ua.c:151
@ OSMO_SS7_ASP_PROT_IPA
Definition: osmo_ss7.h:274
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:1867
uint16_t port
Definition: osmo_ss7.h:342
@ XUA_AS_E_TRANSFER_REQ
Definition: xua_as_fsm.h:10
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in)
Definition: osmo_ss7.c:288
int osmo_sccp_tx_unitdata_ranap(struct osmo_sccp_user *scu, uint32_t src_point_code, uint32_t dst_point_code, const uint8_t *data, unsigned int len)
Definition: sccp_helpers.c:81
@ M3UA_ERR_UNSUPP_TRAF_MOD_TYP
Definition: m3ua.h:151
#define MAX_PC_STR_LEN
Definition: osmo_ss7.c:53
struct osmo_ss7_link * osmo_ss7_link_find_or_create(struct osmo_ss7_linkset *lset, uint32_t id)
Find or create SS7 Link with given ID in given Linkset.
Definition: osmo_ss7.c:638
struct osmo_fsm_inst * fi
AS FSM.
Definition: osmo_ss7.h:294
char * name
human-readable name of this user
Definition: sccp_internal.h:32
#define SUA_CO_RELCO
Definition: sua.h:74
#define SUA_CL_CLDR
Definition: sua.h:68
static int _sccp_send_data(int class, const struct sockaddr_sccp *in, const struct sockaddr_sccp *out, struct msgb *payload, void *ctx)
Definition: sccp.c:568
int osmo_ss7_xua_server_bind(struct osmo_xua_server *xs)
Set the xUA server to bind/listen to the currently configured ip/port.
Definition: osmo_ss7.c:1831
static const uint16_t dupu_mand_ies[]
Definition: m3ua.c:160
struct llist_head list
member in osmo_ss7_route_table::routes
Definition: osmo_ss7.h:205
#define M3UA_MSG_SIZE
Definition: m3ua.c:312
static bool ss7_initialized
Definition: osmo_ss7.c:55
#define M3UA_NOTIFY_I_RESERVED
Definition: m3ua.h:110
#define SUA_CO_COREF
Definition: sua.h:72
#define M3UA_RKM_DEREG_REQ
Definition: m3ua.h:63
Definition: sccp_internal.h:26
static void vty_dump_rtable(struct vty *vty, struct osmo_ss7_route_table *rtbl)
Definition: osmo_ss7_vty.c:372
static struct cmd_node sccpaddr_gt_node
Definition: osmo_ss7_vty.c:1032
static int xua_srv_conn_closed_cb(struct osmo_stream_srv *srv)
Definition: osmo_ss7.c:1599
uint32_t priority
lower priority is higher
Definition: osmo_ss7.h:223
int ss7_asp_rx_unknown(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
Definition: osmo_ss7.c:1918
const struct xua_msg_class m3ua_msg_class_snm
Definition: m3ua.c:175
Definition: sccp_sap.h:151
struct osmo_ss7_instance * inst
Definition: osmo_ss7_vty.c:1023
uint32_t l_rk_id
Definition: osmo_ss7.h:248
#define M3UA_IEI_ERR_CODE
Definition: m3ua.h:71
@ XUA_ASP_E_ASPSM_BEAT
Definition: xua_asp_fsm.h:28
void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
Definition: osmo_ss7.c:697
struct osmo_ss7_route * osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, const char *linkset_name)
Create a new route in the given routing table.
Definition: osmo_ss7.c:782
@ OSMO_SCCP_GTI_TT_NPL_ENC_NAI
Definition: sccp_sap.h:74
#define M3UA_MSGC_ASPTM
Definition: m3ua.h:33
#define M3UA_ASPSM_BEAT_ACK
Definition: m3ua.h:54
static int sua_to_sccp_it(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1246
#define M3UA_NOTIFY_I_AS_INACT
Definition: m3ua.h:111
uint8_t ssn
Definition: sccp.c:72
uint16_t ssn
SSN and/or point code to which we are bound.
Definition: sccp_internal.h:35
#define SUA_CO_CODT
Definition: sua.h:77
struct llist_head linksets
list of osmo_ss7_linkset
Definition: osmo_ss7.h:74
uint8_t ni
Definition: m3ua.h:3
Definition: sccp_scoc.c:86
static const struct value_string m3ua_aspsm_msgt_names[]
Definition: m3ua.c:189
struct osmo_ss7_as * osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx)
Find Application Server by given routing context.
Definition: osmo_ss7.c:854
struct value_string osmo_ss7_asp_protocol_vals[]
Definition: osmo_ss7.c:69
@ XUA_ASP_E_SCTP_COMM_DOWN_IND
Definition: xua_asp_fsm.h:15
static int _sccp_send_connection_released(struct sccp_connection *conn, int cause)
Definition: sccp.c:932
int m3ua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process M3UA message received from socket
Definition: m3ua.c:696
const char * osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:274
static void write_one_asp(struct vty *vty, struct osmo_ss7_asp *asp)
Definition: osmo_ss7_vty.c:677
uint32_t pc
Definition: sccp_sap.h:155
bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Determine if given AS contains ASP.
Definition: osmo_ss7.c:1037
uint32_t conn_id
Definition: sccp_sap.h:178
int osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: osmo_ss7.c:1840
#define OSMO_SCCP_ADDR_T_PC
Definition: sccp_sap.h:50
#define M3UA_ASPSM_BEAT
Definition: m3ua.h:51
static int _sccp_send_connection_data(struct sccp_connection *conn, struct msgb *_data)
Definition: sccp.c:861
uint32_t npi
Definition: sccp_sap.h:146
#define M3UA_ASPSM_DOWN
Definition: m3ua.h:50
#define SUA_IEI_ROUTE_CTX
Definition: sua.h:83
int sccp_scrc_rx_sclc_msg(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Definition: sccp_scrc.c:415
int osmo_sccp_tx_conn_req(struct osmo_sccp_user *scu, uint32_t conn_id, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, const uint8_t *data, unsigned int len)
Definition: sccp_helpers.c:110
const struct value_string m3ua_asptm_msgt_names[]
Definition: m3ua.c:204
int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot)
Definition: osmo_ss7.c:313
static int _sccp_handle_read(struct msgb *msgb)
Definition: sccp.c:582
#define M3UA_SNM_DUPU
Definition: m3ua.h:46
struct osmo_xlm_prim_error error
Definition: sigtran_sap.h:70
Definition: osmo_ss7.h:244
Definition: osmo_ss7.h:175
Definition: sccp_sap.h:165
static void write_one_rtable(struct vty *vty, struct osmo_ss7_route_table *rtable)
Definition: osmo_ss7_vty.c:352
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:132
#define M3UA_SNM_DUNA
Definition: m3ua.h:42
Definition: sccp_sap.h:207
@ M3UA_ERR_DEST_STATUS_UNKN
Definition: m3ua.h:166
#define M3UA_MSG_HEADROOM
Definition: m3ua.c:313
uint32_t incl_len
Definition: mtp_pcap.c:50
@ M3UA_ERR_INVAL_NET_APPEAR
Definition: m3ua.h:167
static const struct value_string m3ua_iei_names[]
Definition: m3ua.c:100
static struct xua_msg * sccp_to_xua_rlsd(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1082
uint32_t primary_pc
Definition: osmo_ss7.h:95
uint32_t dpc
Definition: m3ua.h:1
static const uint16_t data_mand_ies[]
Definition: m3ua.c:132
uint32_t presence
Definition: sccp_sap.h:152
void sccp_scoc_flush_connections(struct osmo_sccp_instance *inst)
Definition: sccp_scoc.c:1665
struct in_addr v4
Definition: sccp_sap.h:158
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1753
Definition: sccp_sap.h:190
@ OSMO_SS7_ASP_PROT_M3UA
Definition: osmo_ss7.h:273
@ IPA_ASP_E_ID_RESP
Definition: xua_asp_fsm.h:32
union osmo_mtp_prim::@18 u
void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset)
Destroy a SS7 Linkset.
Definition: osmo_ss7.c:547
#define SUA_IEI_DATA
Definition: sua.h:107
osmo_prim_cb prim_cb
Definition: sccp_internal.h:42
static struct cmd_node xua_node
Definition: osmo_ss7_vty.c:415
@ OSMO_SCCP_RI_NONE
Definition: sccp_sap.h:57
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1179
#define M3UA_PORT
Definition: m3ua.h:26
@ XUA_ASP_E_ASPTM_ASPIA
Definition: xua_asp_fsm.h:25
const char * osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:282
Definition: osmo_ss7_vty.c:1018
uint32_t cause
Definition: sccp_sap.h:193
static LLIST_HEAD(sccp_connections)
static void store_local_ref(struct sccp_source_reference *local_ref, struct xua_msg *xua, uint16_t iei)
Definition: sccp2sua.c:993
#define M3UA_MSGC_RKM
Definition: m3ua.h:34
struct osmo_ss7_route * osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc)
Find a SS7 route for given destination point code in given SS7.
Definition: osmo_ss7.c:746
const struct xua_msg_class m3ua_msg_class_rkm
Definition: m3ua.c:259
int _sccp_parse_connection_confirm(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:312
struct osmo_ss7_linkset * osmo_ss7_linkset_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint32_t pc)
Find or allocate SS7 Linkset.
Definition: osmo_ss7.c:594
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:445
static int m3ua_rx_asp(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: m3ua.c:674
int osmo_ss7_init(void)
Definition: osmo_ss7.c:1876
void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst)
Destroy a SS7 Instance.
Definition: osmo_ss7.c:387
#define NUM_SCCP_MSGT
Definition: sccp2sua.c:747
bool rkm_dyn_allocated
Were we dynamically allocated by RKM?
Definition: osmo_ss7.h:297
static int sccp_addr_to_sua(struct xua_msg *xua, uint16_t iei, const uint8_t *addr, unsigned int addrlen)
convert SCCP address to SUA address
Definition: sccp2sua.c:321
const char * osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps)
Return human readable representation of the route, in a static buffer.
Definition: osmo_ss7_hmrt.c:149
@ M3UA_ERR_INVALID_VERSION
Definition: m3ua.h:147
struct osmo_stream_srv_link * server
Definition: osmo_ss7.h:440
uint32_t sccp_class
Definition: sccp_sap.h:170
static struct osmo_sccp_addr_entry * addr_entry_by_name_global(const char *name)
Definition: osmo_ss7_vty.c:1062
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1215
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:435
void * priv
Definition: osmo_ss7.h:128
#define SUA_IEI_SRC_ADDR
Definition: sua.h:98
#define M3UA_NOTIFY_I_OT_ALT_ASP_ACT
Definition: m3ua.h:116
static int32_t next_l_rk_id
Definition: osmo_ss7.c:59
Definition: sigtran_sap.h:37
int osmo_sccp_tx_data(struct osmo_sccp_user *scu, uint32_t conn_id, const uint8_t *data, unsigned int len)
Definition: sccp_helpers.c:152
#define SUA_CAUSE_T_RELEASE
Definition: sua.h:136
static enum osmo_ss7_asp_protocol parse_asp_proto(const char *protocol)
Definition: osmo_ss7_vty.c:410
struct osmo_ss7_instance * osmo_ss7_instance_find(uint32_t id)
Find a SS7 Instance with given ID.
Definition: osmo_ss7.c:329
struct llist_head list
Definition: osmo_ss7.h:178
static bool sccp_is_mandatory(enum sccp_message_types type, const struct xua_msg_part *part)
Definition: sccp2sua.c:928
#define SCCP_MSG_HEADROOM
Definition: sccp.c:43
uint32_t orig_len
Definition: mtp_pcap.c:51
int _sccp_parse_connection_refused(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:275
@ OSMO_SCCP_SSN_RANAP
Definition: sccp_sap.h:122
static void append_to_buf(char *buf, size_t size, bool *comma, const char *fmt,...)
Definition: sccp_helpers.c:240
uint32_t pc
Definition: osmo_ss7.h:250
enum osmo_ss7_as_traffic_mode mode
Definition: osmo_ss7.h:304
Definition: osmo_ss7.h:433
@ MTP_SI_GCP
Definition: mtp.h:21
#define M3UA_MGMT_ERR
Definition: m3ua.h:37
@ MTP_SAP_USER
Definition: sigtran_sap.h:10
int _sccp_parse_connection_dt1(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:369
static struct xua_msg * mtp_prim_to_m3ua(struct osmo_mtp_prim *prim)
Definition: osmo_ss7_hmrt.c:71
#define XUA_VAR_HELP_STR
Definition: osmo_ss7_vty.c:45
struct osmo_ss7_asp_peer local
Definition: osmo_ss7.h:391
struct osmo_prim_hdr oph
Definition: mtp_sap.h:57
char * linkset_name
human-specified linkset name
Definition: osmo_ss7.h:221
struct value_string osmo_ss7_as_traffic_mode_vals[]
Definition: osmo_ss7.c:61
int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
send a fully encoded msgb via a given ASP
Definition: osmo_ss7.c:1715
static void _send_msg(struct sccp_connection *conn, struct msgb *msg, void *ctx)
Definition: sccp.c:100
struct osmo_scu_connect_param connect
Definition: sccp_sap.h:228
uint16_t version_major
Definition: mtp_pcap.c:39
int osmo_ss7_bind_all_instances()
bind all xUA servers on each of the stored SS7 instances
Definition: osmo_ss7.c:447
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str)
Definition: osmo_ss7.c:216
uint8_t * dat
Definition: xua_msg.h:43
struct osmo_sccp_addr calling_addr
Definition: sccp_sap.h:167
int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name)
Add given ASP to given AS.
Definition: osmo_ss7.c:957
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:355
@ XUA_ASP_E_ASPSM_ASPDN_ACK
Definition: xua_asp_fsm.h:24
bool permit_dyn_rkm_alloc
Definition: osmo_ss7.h:100
@ M3UA_ERR_INVAL_PARAM_VAL
Definition: m3ua.h:163
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:270
struct osmo_ss7_as::@25 cfg
#define SUA_CL_CLDT
Definition: sua.h:67
struct xua_msg * xua_from_msg(const int version, uint16_t len, uint8_t *data)
Definition: xua_msg.c:151
static int ipa_rx_msg_ccm(struct osmo_ss7_asp *asp, struct msgb *msg)
Definition: ipa.c:91
static int _sccp_parse_optional_data(const int offset, struct msgb *msgb, struct sccp_optional_data *data)
Definition: sccp.c:160
uint8_t version
Definition: xua_types.h:32
static int sua_to_sccp_cref(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1069
@ OSMO_XLM_PRIM_M_NOTIFY
Definition: sigtran_sap.h:20
#define SUA_IEI_IMPORTANCE
Definition: sua.h:114
struct osmo_ss7_route::@23 dest
uint32_t route_ctx
Definition: sigtran_sap.h:42
int m3ua_rx_rkm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: xua_rkm.c:493
#define OSMO_SCCP_ADDR_T_IPv4
Definition: sccp_sap.h:52
static int sua_to_sccp_cr(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1016
void * write_context
Definition: sccp.c:55
#define SUA_IEI_SEQ_CTRL
Definition: sua.h:117
#define SUA_IEI_DEST_REF
Definition: sua.h:101
static int sccp_msg_add_sua_opt(enum sccp_message_types type, struct msgb *msg, struct xua_msg_part *opt)
Convert a given SUA option/IE to SCCP and add it to given * msgb.
Definition: sccp2sua.c:589
#define SUA_IEI_PROTO_CLASS
Definition: sua.h:116
struct osmo_xua_server * osmo_ss7_xua_server_find(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port)
Definition: osmo_ss7.c:1767
#define M3UA_NOTIFY_I_OT_ASP_FAILURE
Definition: m3ua.h:117
static struct xua_msg * sccp_to_xua_cc(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1032
struct in6_addr v6
Definition: sccp_sap.h:159
static int sccp_data_to_sua_ptr(struct xua_msg *xua, uint16_t iei, struct msgb *msg, uint8_t *ptr_addr)
convenience wrapper around xua_msg_add_data() for variable mandatory data
Definition: sccp2sua.c:458
#define M3UA_IEI_NET_APPEAR
Definition: m3ua.h:79
#define M3UA_XFER_DATA
Definition: m3ua.h:40
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:57
#define M3UA_NOTIFY(type, info)
Definition: m3ua.h:106
struct osmo_ss7_route * osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask)
Find a SS7 route for given destination point code + mask in given table.
Definition: osmo_ss7.c:728
uint8_t data[0]
Definition: xua_types.h:5
static struct msgb * patch_sccp_with_pc(struct osmo_ss7_asp *asp, struct msgb *sccp_msg_in, uint32_t opc, uint32_t dpc)
Definition: ipa.c:142
struct osmo_fsm_inst * xua_asp_fsm_start(struct osmo_ss7_asp *asp, enum xua_asp_role role, int log_level)
Start a new ASP finite stae machine for given ASP.
Definition: xua_asp_fsm.c:689
char * description
Definition: osmo_ss7.h:53
uint16_t version_minor
Definition: mtp_pcap.c:40
@ M3UA_ERR_REFUSED_MGMT_BLOCKING
Definition: m3ua.h:159
int osmo_ss7_user_register(struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
Register a MTP user for a given service indicator.
Definition: osmo_ss7.c:472
@ OSMO_SCU_PRIM_N_CONNECT
Definition: sccp_sap.h:34
#define OSMO_SCCP_ADDR_T_SSN
Definition: sccp_sap.h:51
static uint16_t get_in_port(struct sockaddr *sa)
Definition: osmo_ss7.c:1067
@ XUA_ASP_E_ASPTM_ASPAC_ACK
Definition: xua_asp_fsm.h:22
#define M3UA_VERSION
Definition: m3ua.h:24
struct osmo_scu_unitdata_param unitdata
Definition: sccp_sap.h:232
#define M3UA_IEI_LOC_RKEY_ID
Definition: m3ua.h:86
int sccp_connection_free(struct sccp_connection *connection)
Definition: sccp.c:1319
int m3ua_decode_notify(struct osmo_xlm_prim_notify *npar, void *ctx, const struct xua_msg *xua)
Definition: m3ua.c:409
const struct xua_msg_class m3ua_msg_class_aspsm
Definition: m3ua.c:198
void sccp_set_log_area(int log_area)
Definition: sccp.c:1482
struct osmo_ss7_route * osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc)
Find a SS7 route for given destination point code in given table.
Definition: osmo_ss7.c:711
struct osmo_ss7_linkset * osmo_ss7_linkset_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find SS7 Linkset by given name.
Definition: osmo_ss7.c:577
static int m3ua_rx_mgmt_ntfy(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: m3ua.c:609
struct osmo_prim_hdr oph
Definition: sccp_sap.h:226
static int sua_to_sccp_err(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1274
#define ROUTING_KEY_SI_ARG
Definition: osmo_ss7_vty.c:841
uint32_t opc
Definition: mtp_sap.h:37
const char * _osmo_ss7_pointcode_print(char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:250
#define M3UA_NOTIFY_I_AS_PEND
Definition: m3ua.h:113
#define OSMO_SCCP_ADDR_T_GT
Definition: sccp_sap.h:49
Definition: osmo_ss7.h:70
char * host
Definition: osmo_ss7.h:341
#define SUA_IEI_SEGMENTATION
Definition: sua.h:118
@ IPA_ASP_E_ID_GET
Definition: xua_asp_fsm.h:34
#define M3UA_RKM_DEREG_RSP
Definition: m3ua.h:64
struct llist_head siblings
Definition: osmo_ss7.h:362
@ M3UA_ERR_PARAM_FIELD_ERR
Definition: m3ua.h:164
struct osmo_ss7_asp * asps[16]
Definition: osmo_ss7.h:311
const struct value_string m3ua_ntfy_stchg_names[]
Definition: m3ua.c:85
struct msgb * pending_msg
Pending message for non-blocking IPA read.
Definition: osmo_ss7.h:382
char * name
Definition: osmo_ss7.h:185
#define SUA_MSGC_CL
Definition: sua.h:35
uint32_t sccp_src_ref_to_int(struct sccp_source_reference *ref)
Definition: sccp.c:1396
static struct xua_msg * sccp_to_xua_it(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1231
struct osmo_fsm xua_as_fsm
Definition: xua_as_fsm.c:372
static struct xua_msg * sccp_to_xua_err(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1264
@ MTP_SI_ISUP
Definition: mtp.h:12
#define ROUTING_KEY_SI_ARG_STRS
Definition: osmo_ss7_vty.c:842
char * osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr)
Definition: sccp_helpers.c:288
int _sccp_parse_connection_released(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:241
const char * osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:274
static struct cmd_node rtable_node
Definition: osmo_ss7_vty.c:244
static enum cs7_role_t cs7_role
Definition: osmo_ss7_vty.c:56
int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2)
Set the point code format used in given SS7 instance.
Definition: osmo_ss7.c:410
int sccp_write(struct msgb *data, const struct sockaddr_sccp *in, const struct sockaddr_sccp *out, int class, void *ctx)
Definition: sccp.c:1371
@ M3UA_ERR_INVAL_ASP_ID
Definition: m3ua.h:161
static int DSCCP
Definition: sccp.c:37
struct pcap_hdr __attribute__((packed))
int _sccp_parse_udt(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:409
@ MTP_SI_BICC
Definition: mtp.h:20
#define M3UA_IEI_HEARDBT_DATA
Definition: m3ua.h:69
int32_t thiszone
Definition: mtp_pcap.c:41
struct osmo_stream_cli * client
osmo_stream / libosmo-netif handles
Definition: osmo_ss7.h:365
@ XUA_ASP_E_ASPTM_ASPIA_ACK
Definition: xua_asp_fsm.h:26
struct llist_head links
Definition: sccp_internal.h:39
char delimiter
Definition: osmo_ss7.h:68
@ OSMO_SCCP_RI_SSN_PC
Definition: sccp_sap.h:59
struct msgb * osmo_sua_to_sccp(struct xua_msg *xua)
convert parsed SUA message to SCCP message
Definition: sccp2sua.c:1357
static int source_local_reference_is_free(struct sccp_source_reference *reference)
Definition: sccp.c:603
@ CS7_ROLE_ASP
Definition: osmo_ss7_vty.c:57
static const char * osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
Definition: osmo_ss7.h:281
int sccp_connection_force_free(struct sccp_connection *con)
Definition: sccp.c:1331
const struct value_string m3ua_ntfy_type_names[]
Definition: m3ua.c:79
union osmo_scu_prim::@30 u
struct xua_msg_part * xua_msg_find_tag(const struct xua_msg *msg, uint16_t tag)
Definition: xua_msg.c:86
void osmo_ss7_vty_init_sg(void *ctx)
Definition: osmo_ss7_vty.c:1814
int(* read_cb)(struct msgb *, unsigned int, void *)
Definition: sccp.c:69
uint32_t mask
Definition: osmo_ss7.h:219
int sccp_set_read(const struct sockaddr_sccp *sock, int(*read_cb)(struct msgb *, unsigned int, void *), void *context)
Definition: sccp.c:1377
uint8_t component_len[3]
Definition: osmo_ss7.h:69
struct msgb * sccp_create_rlsd(struct sccp_source_reference *src_ref, struct sccp_source_reference *dst_ref, int cause)
Definition: sccp.c:902
int sccp_create_sccp_addr(struct msgb *msg, const struct sockaddr_sccp *sock)
Definition: sccp.c:488
#define M3UA_IEI_PROT_DATA
Definition: m3ua.h:90
struct osmo_xua_server::@28 cfg
#define M3UA_ASPSM_UP_ACK
Definition: m3ua.h:52
const struct osmo_xua_layer_manager * lm
Definition: osmo_ss7.h:375
int osmo_sccp_tx_conn_resp_msg(struct osmo_sccp_user *scu, uint32_t conn_id, const struct osmo_sccp_addr *resp_addr, struct msgb *msg)
Definition: sccp_helpers.c:206
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst)
Definition: osmo_ss7.c:92
struct osmo_mtp_prim * m3ua_to_xfer_ind(struct xua_msg *xua)
Definition: osmo_ss7_hmrt.c:40
struct osmo_sccp_instance * inst
pointer back to SCCP instance
Definition: sccp_internal.h:30
#define M3UA_IEI_TRAF_MODE_TYP
Definition: m3ua.h:70
void * priv
Definition: sccp_internal.h:21
static uint32_t pc_comp_shift_and_mask(const struct osmo_ss7_pc_fmt *pc_fmt, unsigned int comp_num, uint32_t pc)
Definition: osmo_ss7.c:205
uint8_t tt
Definition: sccp_sap.h:145
int osmo_sccp_tx_data_msg(struct osmo_sccp_user *scu, uint32_t conn_id, struct msgb *msg)
Definition: sccp_helpers.c:170
@ M3UA_TMOD_OVERRIDE
Definition: m3ua.h:176
@ XUA_ASP_E_ASPSM_ASPDN
Definition: xua_asp_fsm.h:23
static int hmrt_message_for_routing(struct osmo_ss7_instance *inst, struct xua_msg *xua)
Definition: osmo_ss7_hmrt.c:204
void osmo_ss7_link_destroy(struct osmo_ss7_link *link)
Destryo SS7 Link.
Definition: osmo_ss7.c:621
int sccp_scrc_rx_scoc_conn_msg(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Definition: sccp_scrc.c:393
const char * name
Definition: xua_msg.h:56
struct osmo_sccp_instance * sccp
Definition: osmo_ss7.h:89
#define M3UA_IEI_STATUS
Definition: m3ua.h:72
static int xua_ies_to_sccp_opts(struct msgb *msg, uint8_t *ptr_opt, enum sccp_message_types type, struct xua_msg *xua)
Definition: sccp2sua.c:972
int sccp_parse_header(struct msgb *msg, struct sccp_parse_result *result)
Definition: sccp.c:1430
static const uint16_t sccp_optional[NUM_SCCP_MSGT][MAX_IES]
Definition: sccp2sua.c:842
int event
Definition: xua_msg.h:66
struct llist_head list_global
Definition: osmo_ss7_vty.c:1022
int osmo_sccp_tx_disconn(struct osmo_sccp_user *scu, uint32_t conn_id, const struct osmo_sccp_addr *resp_addr, uint32_t cause)
Definition: sccp_helpers.c:182
#define M3UA_IEI_ORIG_PC
Definition: m3ua.h:89
static int xua_msg_add_sccp_opt(struct xua_msg *xua, uint8_t sccp_opt_type, uint16_t opt_len, uint8_t *opt)
Convert a given SCCP option to SUA and add it to given xua_msg.
Definition: sccp2sua.c:472
struct osmo_ss7_as * osmo_ss7_as_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find Application Server by given name.
Definition: osmo_ss7.c:837
static int ipa_cli_read_cb(struct osmo_stream_cli *conn)
Definition: osmo_ss7.c:1503
const struct xua_msg_class m3ua_msg_class_mgmt
Definition: m3ua.c:229
Definition: xua_types.h:31
uint32_t network
Definition: mtp_pcap.c:44
struct msgb * sccp_msgb_alloc(const char *name)
Definition: sua.c:63
@ M3UA_ERR_ASP_ID_REQD
Definition: m3ua.h:160
static int m3ua_rx_mgmt_err(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: m3ua.c:590
@ MTP_SI_DUP
Definition: mtp.h:13
static int ipa_srv_conn_cb(struct osmo_stream_srv *conn)
Definition: osmo_ss7.c:1364
@ OSMO_XLM_PRIM_M_SCTP_RESTART
Definition: sigtran_sap.h:16
struct osmo_ss7_pc_fmt pc_fmt
Definition: osmo_ss7.h:99
int xua_msg_add_data(struct xua_msg *msg, uint16_t tag, uint16_t len, uint8_t *dat)
Definition: xua_msg.c:61
static int32_t next_rctx
Definition: osmo_ss7.c:58
@ MTP_SI_TUP
Definition: mtp.h:11
@ OSMO_XLM_PRIM_M_SCTP_ESTABLISH
Definition: sigtran_sap.h:14
#define ROUTING_KEY_CMD_STRS
Definition: osmo_ss7_vty.c:837
struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
Find or Create Application Server.
Definition: osmo_ss7.c:924
static struct osmo_ss7_asp * osmo_ss7_asp_find_by_socket_addr(int fd)
Find an ASP definition matching the local+remote IP/PORT of given fd.
Definition: osmo_ss7.c:1083
#define SUA_CO_RELRE
Definition: sua.h:73
@ XUA_ASP_E_ASPTM_ASPAC
Definition: xua_asp_fsm.h:21
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:122
#define NOTIFY_PAR_P_ASP_ID
Definition: sigtran_sap.h:34
void sccp_scoc_rx_scrc_rout_fail(struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t cause)
SCOC: Receive SCRC Routing Failure.
Definition: sccp_scoc.c:1239
char * name
Definition: osmo_ss7.h:93
uint8_t sio
Definition: mtp_sap.h:40
#define SCU_MSG_SIZE
Definition: sccp_helpers.c:36
void osmo_ss7_vty_init_asp(void *ctx)
Definition: osmo_ss7_vty.c:1808
int sccp_connection_set_incoming(const struct sockaddr_sccp *sock, int(*accept_cb)(struct sccp_connection *, void *), void *context)
Definition: sccp.c:1354
char * name
Definition: osmo_ss7.h:385
static void msgb_put_u24be(struct msgb *msg, uint32_t val)
Definition: sccp2sua.c:43
int sua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process SUA message received from socket
Definition: sua.c:647
static const struct xua_msg_class msg_class_xfer
Definition: m3ua.c:139
int osmo_sccp_tx_conn_resp(struct osmo_sccp_user *scu, uint32_t conn_id, const struct osmo_sccp_addr *resp_addr, const uint8_t *data, unsigned int len)
Definition: sccp_helpers.c:227
#define SUA_IEI_CREDIT
Definition: sua.h:106
@ CS7_ROLE_SG
Definition: osmo_ss7_vty.c:57
struct llist_head callback
Definition: sccp.c:73
@ OSMO_SCCP_GTI_NAI_ONLY
Definition: sccp_sap.h:71
#define M3UA_IEI_CORR_ID
Definition: m3ua.h:75
@ MTP_SI_SCCP
Definition: mtp.h:10
#define M3UA_IEI_REG_STATUS
Definition: m3ua.h:91
struct osmo_ss7_as::@25::@26 pc_override
int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
Main entrance function for primitives from SCCP User.
Definition: sccp_scoc.c:1605
char * name
Definition: osmo_ss7.h:300
static struct msgb * scu_msgb_alloc(const char *name)
Definition: sccp_helpers.c:39
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in)
Definition: osmo_ss7.c:288
static int _sccp_send_connection_request(struct sccp_connection *connection, const struct sockaddr_sccp *called, struct msgb *msg)
Definition: sccp.c:804
struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7.c:1147
char * name
Definition: osmo_ss7.h:52
struct osmo_sccp_addr called_addr
Definition: sccp_sap.h:208
static int sua_to_sccp_udts(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1216
#define SUA_IEI_RX_SEQ_NR
Definition: sua.h:104
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str)
Definition: osmo_ss7.c:216
uint32_t ts_usec
Definition: mtp_pcap.c:49
#define M3UA_MSGC_XFER
Definition: m3ua.h:30
static int sua_to_sccp_rlc(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1120
static const struct value_string ss7_network_indicator_vals[]
Definition: osmo_ss7_vty.c:86
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:180
int sccp_system_incoming(struct msgb *msgb)
Definition: sccp.c:1233
char * description
Definition: osmo_ss7.h:301
void osmo_ss7_as_destroy(struct osmo_ss7_as *as)
Destroy given Application Server.
Definition: osmo_ss7.c:1012
int _sccp_parse_connection_request(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:197
int osmo_ss7_user_mtp_xfer_req(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7_hmrt.c:284
static int sccp_addr_to_sua_ptr(struct xua_msg *xua, uint16_t iei, struct msgb *msg, uint8_t *ptr_addr)
convenience wrapper around sccp_addr_to_sua() for variable mandatory addresses
Definition: sccp2sua.c:340
uint8_t msg_class
Definition: xua_types.h:34
static void xua_cli_close_and_reconnect(struct osmo_stream_cli *cli)
Definition: osmo_ss7.c:1496
static const uint16_t reg_rsp_ies[]
Definition: m3ua.c:243
struct xua_common_hdr hdr
Definition: xua_msg.h:32
struct osmo_sccp_addr responding_addr
Definition: sccp_sap.h:192
struct msgb * sccp_create_refuse(struct sccp_source_reference *src_ref, int cause, uint8_t *inp, int length)
Definition: sccp.c:665
char * description
Definition: osmo_ss7.h:94
uint8_t sls
Definition: mtp_sap.h:39
uint32_t opc
Definition: m3ua.h:96
int osmo_ss7_vty_go_parent(struct vty *vty)
Definition: osmo_ss7_vty.c:1662
@ XUA_ASP_E_ASPSM_BEAT_ACK
Definition: xua_asp_fsm.h:29
void osmo_ss7_route_destroy(struct osmo_ss7_route *rt)
Destroy a given SS7 route.
Definition: osmo_ss7.c:821
@ OSMO_SCCP_ORIG_NS_USER
Definition: sccp_sap.h:185
uint32_t sigfigs
Definition: mtp_pcap.c:42
@ OSMO_MTP_PRIM_TRANSFER
Definition: mtp_sap.h:28
#define M3UA_SNM_DAVA
Definition: m3ua.h:43
static int xua_srv_conn_cb(struct osmo_stream_srv *conn)
Definition: osmo_ss7.c:1395
int xua_msg_add_sccp_addr(struct xua_msg *xua, uint16_t iei, const struct osmo_sccp_addr *addr)
Definition: xua_msg.c:338
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:432
static int sccp_add_var_addr(struct msgb *msg, uint8_t *var_ptr, struct xua_msg *xua, uint16_t iei)
Add a "SCCP Variable Mandatory Part" (Address format) to the given msgb.
Definition: sccp2sua.c:372
static void log_sctp_notification(struct osmo_ss7_asp *asp, const char *pfx, union sctp_notification *notif)
Definition: osmo_ss7.c:1338
static int sccp_add_variable_part(struct msgb *msg, uint8_t *var_ptr, struct xua_msg *xua, uint16_t iei)
Add a "SCCP Variable Mandatory Part" to the given msgb.
Definition: sccp2sua.c:403
int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.
Definition: osmo_ss7.h:418
static int sua_to_sccp_rlsd(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1094
static int _sccp_send_connection_release_complete(struct sccp_connection *connection)
Definition: sccp.c:1087
static const char * osmo_sccp_ssn_name(enum osmo_sccp_ssn val)
Definition: sccp_sap.h:140
bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Determine if given AS contains ASP.
Definition: osmo_ss7.c:1037
Definition: osmo_ss7.h:118
int osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: osmo_ss7.c:1840
struct llist_head routes
list of osmo_ss7_route
Definition: osmo_ss7.h:49
static int sua_addr_to_sccp(struct msgb *msg, struct xua_msg_part *part)
convert SUA address to SCCP address
Definition: sccp2sua.c:352
int xua_msg_event_map(const struct xua_msg *xua, const struct xua_msg_event_map *maps, unsigned int num_maps)
Map from a xua_msg (class+type) to an event.
Definition: xua_msg.c:394
@ OSMO_SCCP_GTI_TT_NPL_ENC
Definition: sccp_sap.h:73
static bool osmo_ss7_pc_is_valid(uint32_t pc)
Definition: osmo_ss7.h:32
#define M3UA_ASPTM_ACTIVE_ACK
Definition: m3ua.h:58
struct osmo_fsm_inst * fi
ASP FSM.
Definition: osmo_ss7.h:358
#define M3UA_NOTIFY_T_OTHER
Definition: m3ua.h:108
#define M3UA_IEI_DEST_PC
Definition: m3ua.h:87
struct m3ua_data_hdr * data_hdr_from_m3ua(struct xua_msg *xua)
Definition: m3ua.c:518
#define M3UA_ASPTM_INACTIVE
Definition: m3ua.h:57
static struct cmd_node as_node
Definition: osmo_ss7_vty.c:702
static void vty_dump_xua_server(struct vty *vty, struct osmo_xua_server *xs)
Definition: osmo_ss7_vty.c:504
uint8_t si
Definition: osmo_ss7.h:251
#define M3UA_NOTIFY_I_AS_ACT
Definition: m3ua.h:112
struct llist_head asp_list
list of osmo_ss7_asp
Definition: osmo_ss7.h:78
static const uint16_t prot2port[]
Definition: osmo_ss7.c:306
#define M3UA_IEI_ASP_ID
Definition: m3ua.h:73
uint32_t asp_id
Definition: sigtran_sap.h:41
struct osmo_ss7_route_table * rtable_system
Definition: osmo_ss7.h:87
char * description
Definition: osmo_ss7.h:386
char * osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct osmo_sccp_addr *addr)
Definition: sccp_helpers.c:312
#define OSMO_SS7_PC_INVALID
Definition: osmo_ss7.h:31
void mtp_xfer_param_to_m3ua_dh(struct m3ua_data_hdr *mdh, const struct osmo_mtp_transfer_param *param)
Definition: m3ua.c:288
#define INST_STR
Definition: xua_internal.h:68
#define SUA_IEI_DEST_ADDR
Definition: sua.h:99
void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs)
Definition: osmo_ss7.c:1850
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:371
#define M3UA_IEI_USER_CAUSE
Definition: m3ua.h:80
static struct osmo_ss7_as * find_as_for_asp(struct osmo_ss7_asp *asp)
Definition: ipa.c:125
struct osmo_ss7_asp * osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, enum osmo_ss7_asp_protocol proto)
Find an ASP that matches the given protocol.
Definition: osmo_ss7.c:1133
#define ROUTING_KEY_SSN_ARG
Definition: osmo_ss7_vty.c:852
struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:1055
@ XUA_ASP_E_SCTP_EST_IND
Definition: xua_asp_fsm.h:17
static void msgb_put_sccp_opt(struct msgb *msg, uint8_t pnc, uint8_t len, const uint8_t *data)
append a SCCP option to the given message
Definition: sccp2sua.c:576
int xua_msg_add_u32(struct xua_msg *xua, uint16_t iei, uint32_t val)
Definition: xua_msg.c:280
#define M3UA_SNM_DAUD
Definition: m3ua.h:44
static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd)
Definition: osmo_ss7.c:1633
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
static struct msgb * m3ua_to_msg(struct xua_msg *xua)
Definition: m3ua.c:455
uint32_t recovery_timeout_msec
Definition: osmo_ss7.h:305
@ MTP_SI_B_ISUP
Definition: mtp.h:16
static void * tall_sccp_ctx
Definition: sccp.c:39
uint32_t xua_msg_part_get_u32(struct xua_msg_part *part)
Definition: xua_msg.c:286
int sccp_connection_close(struct sccp_connection *connection, int cause)
Definition: sccp.c:1307
static const struct value_string m3ua_xfer_msgt_names[]
Definition: m3ua.c:135
const struct osmo_ss7_user * user[16]
Definition: osmo_ss7.h:85
#define M3UA_IEI_ROUT_KEY
Definition: m3ua.h:83
#define M3UA_IEI_INFO_STRING
Definition: m3ua.h:66
struct osmo_fsm ipa_asp_fsm
Definition: xua_asp_fsm.c:1059
struct msgb * sccp_create_udt(int class, const struct sockaddr_sccp *in, const struct sockaddr_sccp *out, uint8_t *in_data, int len)
Definition: sccp.c:528
char digits[32]
Definition: sccp_sap.h:148
static void write_one_xua(struct vty *vty, struct osmo_xua_server *xs)
Definition: osmo_ss7_vty.c:493
int(* accept_cb)(struct sccp_connection *, void *)
Definition: sccp.c:65
static int config_write_cs7(struct vty *vty)
Definition: osmo_ss7_vty.c:204
struct xua_msg * xua_msg_alloc(void)
Definition: xua_msg.c:44
struct llist_head as_list
list of osmo_ss7_as
Definition: osmo_ss7.h:76
static struct cmd_node asp_node
Definition: osmo_ss7_vty.c:545
@ XUA_ASP_E_ASPSM_ASPUP_ACK
Definition: xua_asp_fsm.h:20
#define M3UA_MGMT_NTFY
Definition: m3ua.h:38
uint8_t sls
Definition: m3ua.h:101
void xua_rkm_cleanup_dyn_as_for_asp(struct osmo_ss7_asp *asp)
Definition: xua_rkm.c:553
struct osmo_ss7_instance * osmo_ss7_instance_find_or_create(void *ctx, uint32_t id)
Find or create a SS7 Instance.
Definition: osmo_ss7.c:346
static int get_logevel_by_sn_type(int sn_type)
Definition: osmo_ss7.c:1313
struct llist_head headers
Definition: xua_msg.h:35
static struct xua_msg * sccp_to_xua_cref(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1058
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1179
void osmo_sccp_addr_set_ssn(struct osmo_sccp_addr *addr, uint32_t ssn)
Definition: sccp_helpers.c:54
int scrc_rx_mtp_xfer_ind_xua(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Definition: sccp_scrc.c:442
static const uint16_t dereg_req_ies[]
Definition: m3ua.c:246
struct osmo_ss7_as * osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto)
Find Application Server (AS) by given protocol.
Definition: osmo_ss7.c:889
struct osmo_ss7_route * osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc)
Find a SS7 route for given destination point code in given SS7.
Definition: osmo_ss7.c:746
static int _sccp_send_connection_it(struct sccp_connection *conn)
Definition: sccp.c:879
struct osmo_xua_server * xua_server
osmo_xua_server over which we were established
Definition: osmo_ss7.h:361
struct osmo_ss7_linkset::@22 cfg
static int m3ua_rx_xfer(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: m3ua.c:535
int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name)
Delete given ASP from given AS.
Definition: osmo_ss7.c:987
#define MAX_IES
Definition: sccp2sua.c:746
#define SUA_PPID
Definition: sua.h:27
#define SUA_IEI_CAUSE
Definition: sua.h:102
static bool sccp_option_permitted(enum sccp_message_types type, const struct xua_msg_part *part)
Definition: sccp2sua.c:950
bool is_server
Definition: osmo_ss7.h:389
int osmo_ss7_is_config_node(struct vty *vty, int node)
Definition: osmo_ss7_vty.c:1710
#define M3UA_SNM_SCON
Definition: m3ua.h:45
Definition: sccp_sap.h:143
uint8_t qos_class
Definition: osmo_ss7.h:393
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:72
@ M3UA_ERR_UNEXPECTED_MSG
Definition: m3ua.h:152
static const char * osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val)
Definition: sccp_sap.h:64
void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim *prim)
Definition: xua_asp_fsm.c:117
struct osmo_sccp_addr calling_addr
Definition: sccp_sap.h:209
struct osmo_mtp_transfer_param transfer
Definition: mtp_sap.h:59
static int assign_source_local_reference(struct sccp_connection *connection)
Definition: sccp.c:627
static const uint16_t scon_mand_ies[]
Definition: m3ua.c:157
static void msgb_put_sccp_opt_hdr(struct msgb *msg, uint8_t pnc, uint8_t len)
append a SCCP option header to the given message
Definition: sccp2sua.c:565
static int _sccp_handle_connection_confirm(struct msgb *msgb)
Definition: sccp.c:1189
uint32_t route_ctx
Definition: sccp_internal.h:17
bool dyn_allocated
Were we dynamically allocated.
Definition: osmo_ss7.h:379
static const uint16_t reg_req_ies[]
Definition: m3ua.c:240
static struct xua_msg * m3ua_gen_error_msg(uint32_t err_code, struct msgb *msg)
Definition: m3ua.c:362
struct osmo_ss7_asp_peer local
Definition: osmo_ss7.h:444
@ M3UA_ERR_PROTOCOL_ERR
Definition: m3ua.h:153
static unsigned int get_pc_comp_shift(const struct osmo_ss7_pc_fmt *pc_fmt, unsigned int comp_num)
Definition: osmo_ss7.c:189
uint16_t tag
Definition: xua_msg.h:41
@ SCCP_SAP_USER
Definition: sigtran_sap.h:7
Definition: mtp_pcap.c:47
static struct xua_msg * sccp_to_xua_udt(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1160
const char * name
Definition: osmo_ss7.h:124
#define M3UA_MSGC_MGMT
Definition: m3ua.h:29
static const struct value_string m3ua_mgmt_msgt_names[]
Definition: m3ua.c:224
struct llist_head list
entry in list of sccp users of osmo_sccp_instance
Definition: sccp_internal.h:28
@ M3UA_ERR_INVAL_STREAM_ID
Definition: m3ua.h:155
int osmo_sccp_tx_unitdata(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, const uint8_t *data, unsigned int len)
Definition: sccp_helpers.c:60
struct osmo_xua_server * osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port, const char *local_host)
create a new xUA server configured with given ip/port
Definition: osmo_ss7.c:1789
@ OSMO_XLM_PRIM_M_ERROR
Definition: sigtran_sap.h:21
static struct xua_msg * sccp_to_xua_opt(struct msgb *msg, uint8_t *ptr_opt, struct xua_msg *xua)
convert SCCP optional part to list of SUA options
Definition: sccp2sua.c:701
static void * g_ctx
Definition: osmo_ss7_vty.c:57
struct osmo_ss7_as * osmo_ss7_as_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find Application Server by given name.
Definition: osmo_ss7.c:837
@ M3UA_TMOD_BCAST
Definition: m3ua.h:178
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:1867
@ OSMO_SS7_ASP_PROT_SUA
Definition: osmo_ss7.h:272
struct value_string osmo_ss7_as_traffic_mode_vals[]
Definition: osmo_ss7.c:61
#define SUA_CO_CORE
Definition: sua.h:70
uint32_t ts_sec
Definition: mtp_pcap.c:48
#define SUA_ERR_INVAL_LOADSH_LEVEL
Definition: sua.h:160
struct llist_head list
entry in 'ref osmo_ss7_instance.as_list
Definition: osmo_ss7.h:290
@ MTP_SI_AAL2_SIG
Definition: mtp.h:19
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:302
struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
Find or Create Application Server.
Definition: osmo_ss7.c:924
static __attribute__((constructor))
Definition: sccp.c:1472
@ OSMO_SS7_AS_TMOD_LOADSHARE
Definition: osmo_ss7.h:257
int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7.c:516
struct osmo_xlm_prim_notify notify
Definition: sigtran_sap.h:69
struct msgb * m3ua_msgb_alloc(const char *name)
Definition: m3ua.c:315
#define M3UA_IEI_AFFECTED_PC
Definition: m3ua.h:74
int osmo_ss7_xua_server_bind(struct osmo_xua_server *xs)
Set the xUA server to bind/listen to the currently configured ip/port.
Definition: osmo_ss7.c:1831
const struct sockaddr_sccp sccp_ssn_bssap
Definition: sccp.c:46
void sccp_scoc_rx_from_scrc(struct osmo_sccp_instance *inst, struct xua_msg *xua)
Main entrance function for primitives from the SCRC (Routing Control)
Definition: sccp_scoc.c:1505
static const uint16_t ntfy_req_ies[]
Definition: m3ua.c:221
uint8_t ni
Definition: m3ua.h:99
@ XUA_ASP_E_ASPSM_ASPUP
Definition: xua_asp_fsm.h:19
#define M3UA_NOTIFY_I_OT_INS_RES
Definition: m3ua.h:115
uint32_t nai
Definition: sccp_sap.h:147
const struct value_string m3ua_ntfy_other_names[]
Definition: m3ua.c:93
@ OSMO_SS7_AS_TMOD_BCAST
Definition: osmo_ss7.h:256
static const char * osmo_sccp_gti_name(enum osmo_sccp_gti val)
Definition: sccp_sap.h:78
struct llist_head asp_list
Definition: osmo_ss7.h:438
struct msgb * xua_to_msg(const int version, struct xua_msg *msg)
Definition: xua_msg.c:203
static int _sccp_send_connection_confirm(struct sccp_connection *connection)
Definition: sccp.c:740
void m3ua_dh_to_xfer_param(struct osmo_mtp_transfer_param *param, const struct m3ua_data_hdr *mdh)
Definition: m3ua.c:300
#define LOGSS7(inst, level, fmt, args ...)
Definition: osmo_ss7.c:77
struct llist_head list
Definition: osmo_ss7.h:434
Definition: mtp_pcap.c:37
struct osmo_ss7_asp::@27 cfg
static const struct xua_msg_event_map m3ua_aspxm_map[]
Definition: m3ua.c:660
static void vty_init_shared(void *ctx)
Definition: osmo_ss7_vty.c:1759
struct osmo_ss7_routing_key routing_key
Definition: osmo_ss7.h:303
#define M3UA_RKM_REG_RSP
Definition: m3ua.h:62
int sccp_connection_send_it(struct sccp_connection *connection)
Definition: sccp.c:1294
struct msgb * sccp_create_cc(struct sccp_source_reference *src_ref, struct sccp_source_reference *dst_ref)
Definition: sccp.c:709
static void xua_cli_close(struct osmo_stream_cli *cli)
Definition: osmo_ss7.c:1486
static const char * osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
Definition: osmo_ss7.h:265
static int deliver_to_mtp_user(const struct osmo_ss7_user *osu, struct xua_msg *xua)
Definition: osmo_ss7_hmrt.c:83
uint16_t len
Definition: xua_types.h:1
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:224
const char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr)
Reverse lookup the lookup-name of a specified SCCP address.
Definition: osmo_ss7_vty.c:1099
int osmo_isup_party_encode(struct msgb *msg, const char *in_digits)
Encode an ISUP style address of BCD digits.
Definition: sccp2sua.c:92
int osmo_sccp_tx_unitdata_msg(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, struct msgb *msg)
Definition: sccp_helpers.c:96
int sccp_sclc_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
Main entrance function for primitives from SCCP User.
Definition: sccp_sclc.c:122
static struct xua_msg * m3ua_gen_error(uint32_t err_code)
Definition: m3ua.c:351
struct osmo_ss7_as * osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx)
Find Application Server by given routing context.
Definition: osmo_ss7.c:854
struct osmo_ss7_route * osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask)
Find a SS7 route for given destination point code + mask in given table.
Definition: osmo_ss7.c:728
#define XUA_VAR_STR
Definition: osmo_ss7_vty.c:43
osmo_static_assert(sizeof(struct sccp_source_reference)<=sizeof(uint32_t), enough_space)
int sccp_determine_msg_type(struct msgb *msg)
Definition: sccp.c:1422
uint8_t si
Definition: m3ua.h:2
struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id)
Find Application Server by given local routing key ID.
Definition: osmo_ss7.c:871
struct osmo_sccp_addr called_addr
Definition: sccp_sap.h:166
struct osmo_fsm xua_asp_fsm
Definition: xua_asp_fsm.c:666
static struct xua_msg * sccp_to_xua_udts(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1195
#define SUA_CO_COIT
Definition: sua.h:80
int mtp_pcap_write_header(int fd)
Definition: mtp_pcap.c:54
static unsigned int get_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt)
Definition: osmo_ss7.c:182
static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg)
Definition: ipa.c:203
#define M3UA_RKM_REG_REQ
Definition: m3ua.h:61
union osmo_sccp_addr::@29 ip
static uint32_t load_24be(const void *ptr)
load a 24bit value as big-endian
Definition: sccp2sua.c:57
@ MTP_SI_TESTING
Definition: mtp.h:15
int m3ua_hmdc_rx_from_l2(struct osmo_ss7_instance *inst, struct xua_msg *xua)
Definition: osmo_ss7_hmrt.c:269
#define PC_STR
Definition: xua_internal.h:67
int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
Unregister a MTP user for a given service indicator.
Definition: osmo_ss7.c:496
struct osmo_scu_disconn_param disconnect
Definition: sccp_sap.h:230
static const uint16_t err_req_ies[]
Definition: m3ua.c:218
struct xua_msg * osmo_sccp_to_xua(struct msgb *msg)
convert SCCP message to a SUA message
Definition: sccp2sua.c:1289
struct osmo_ss7_route_table * rtable
osmo_ss7_route_table to which we belong
Definition: osmo_ss7.h:207
uint32_t pc
Definition: osmo_ss7.h:218
bool accept_dyn_reg
Definition: osmo_ss7.h:443
static int _sccp_handle_connection_release_complete(struct msgb *msgb)
Definition: sccp.c:1028
void osmo_ss7_route_destroy(struct osmo_ss7_route *rt)
Destroy a given SS7 route.
Definition: osmo_ss7.c:821
const struct xua_msg_class m3ua_msg_class_asptm
Definition: m3ua.c:211
static int hmdt_message_for_distribution(struct osmo_ss7_instance *inst, struct xua_msg *xua)
Definition: osmo_ss7_hmrt.c:100
uint32_t opc
Definition: m3ua.h:0
struct llist_head list
Definition: osmo_ss7_vty.c:1021
#define M3UA_SNM_DRST
Definition: m3ua.h:47
uint32_t dpc
Definition: m3ua.h:97
static int _rout_key(struct vty *vty, const char *rcontext, const char *dpc, const char *si, const char *ssn)
Definition: osmo_ss7_vty.c:857
@ OSMO_SCCP_GTI_NO_GT
Definition: sccp_sap.h:70
int sccp_connection_write(struct sccp_connection *connection, struct msgb *data)
Definition: sccp.c:1277
void(* write_data)(struct sccp_connection *conn, struct msgb *data, void *gctx, void *ctx)
Definition: sccp.c:53
struct osmo_sccp_addr addr
Definition: osmo_ss7_vty.c:1025
@ MTP_SI_SAT_ISUP
Definition: mtp.h:17
static uint32_t find_free_l_rk_id(struct osmo_ss7_instance *inst)
Definition: osmo_ss7.c:103
Definition: osmo_ss7.h:201
#define M3UA_IEI_DEREG_RESULT
Definition: m3ua.h:85
void sccp_sclc_rx_scrc_rout_fail(struct osmo_sccp_instance *inst, struct xua_msg *xua, uint32_t cause)
SCRC -> SCLC (Routing Failure.
Definition: sccp_sclc.c:327
struct sccp_connection * sccp_connection_socket(void)
Definition: sccp.c:1342
xua_asp_role
Definition: xua_asp_fsm.h:39
static int _sccp_send_refuse(struct sccp_source_reference *src_ref, int cause, void *ctx)
Definition: sccp.c:699
uint32_t snaplen
Definition: mtp_pcap.c:43
static struct cmd_node sccpaddr_node
Definition: osmo_ss7_vty.c:1026
#define SCU_MSG_HEADROOM
Definition: sccp_helpers.c:37
@ IPA_ASP_E_ID_ACK
Definition: xua_asp_fsm.h:33
uint32_t conn_id
Definition: sccp_sap.h:194
const char * osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:282
static const uint16_t dereg_rsp_ies[]
Definition: m3ua.c:249
static int xua_cli_read_cb(struct osmo_stream_cli *conn)
Definition: osmo_ss7.c:1532
struct osmo_ss7_route_table::@19 cfg
void xua_msg_free(struct xua_msg *msg)
Definition: xua_msg.c:56
uint8_t mp
Definition: m3ua.h:100
Definition: sccp_sap.h:225
static const char * gen_pc_fmtstr(const struct osmo_ss7_pc_fmt *pc_fmt, unsigned int *num_comp_exp)
Definition: osmo_ss7.c:140
static int _sccp_handle_connection_released(struct msgb *msgb)
Definition: sccp.c:1115
uint32_t ssn
Definition: osmo_ss7.h:252
DEFUN(cs7_instance, cs7_instance_cmd, "cs7 instance <0-15>", CS7_STR "Configure a SS7 Instance\n" INST_STR "Number of the instance\n")
Definition: osmo_ss7_vty.c:65
void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs)
Definition: osmo_ss7.c:1850
struct osmo_fsm_inst * xua_as_fsm_start(struct osmo_ss7_as *as, int log_level)
Start an AS FSM for a given Application Server.
Definition: xua_as_fsm.c:385
int sccp_system_incoming_ctx(struct msgb *msgb, void *ctx)
Definition: sccp.c:1238
#define SUA_ERR_SUBSYS_STATUS_UNKN
Definition: sua.h:159
static int destination_local_reference_is_free(struct sccp_source_reference *reference)
Definition: sccp.c:615
struct osmo_ss7_route * osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask, const char *linkset_name)
Create a new route in the given routing table.
Definition: osmo_ss7.c:782
static const uint16_t daud_mand_ies[]
Definition: m3ua.c:154
static osmo_ss7_asp_rx_unknown_cb * g_osmo_ss7_asp_rx_unknown_cb
Definition: osmo_ss7.c:1916
void sccp_scoc_show_connections(struct vty *vty, struct osmo_sccp_instance *inst)
Definition: sccp_scoc.c:1700
void * accept_context
Definition: sccp.c:66
char name[512]
Definition: osmo_ss7_vty.c:1024
const char * name
Definition: xua_msg.h:49
bool incoming
Definition: sccp_scoc.c:110
#define OSMO_SCCP_ADDR_T_IPv6
Definition: sccp_sap.h:53
struct osmo_stream_srv * server
Definition: osmo_ss7.h:366
struct osmo_ss7_linkset * linkset
pointer to linkset (destination) of route
Definition: osmo_ss7.h:211
@ M3UA_TMOD_LOADSHARE
Definition: m3ua.h:177
struct xua_msg * m3ua_encode_notify(const struct osmo_xlm_prim_notify *npar)
Definition: m3ua.c:380
int sccp_sclc_rx_from_scrc(struct osmo_sccp_instance *inst, struct xua_msg *xua)
SCRC -> SCLC (connectionless message)
Definition: sccp_sclc.c:251
static void write_sccp_addressbook(struct vty *vty, const struct osmo_ss7_instance *inst)
Definition: osmo_ss7_vty.c:1112
char * sock_name
pre-formatted human readable local/remote socket name
Definition: osmo_ss7.h:368
static int _sccp_handle_connection_request(struct msgb *msgb, void *ctx)
Definition: sccp.c:956
uint32_t conn_id
Definition: sccp_sap.h:172
struct llist_head xua_servers
list of osmo_xua_servers
Definition: osmo_ss7.h:82
#define LOGPASP(asp, subsys, level, fmt, args ...)
Definition: osmo_ss7.h:422
void * read_context
Definition: sccp.c:70
#define NOTIFY_PAR_P_ROUTE_CTX
Definition: sigtran_sap.h:35
int xua_dialect_check_all_mand_ies(const struct xua_dialect *dialect, struct xua_msg *xua)
Definition: xua_msg.c:449
struct osmo_ss7_route_table * osmo_ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:668
static int asp_proto_to_ip_proto(enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7.c:80
uint16_t status_type
Definition: sigtran_sap.h:39
#define ROUTING_KEY_SSN_ARG_STRS
Definition: osmo_ss7_vty.c:853
const struct value_string m3ua_err_names[]
Definition: m3ua.c:55
static void msgb_put_u16le(struct msgb *msg, uint16_t val)
Definition: sccp2sua.c:50
@ OSMO_SCCP_GTI_TT_ONLY
Definition: sccp_sap.h:72
#define M3UA_MSGC_ASPSM
Definition: m3ua.h:32
static struct cmd_node cs7_node
Definition: osmo_ss7_vty.c:59
#define ROUTING_KEY_CMD
Definition: osmo_ss7_vty.c:836
uint32_t code
Definition: sigtran_sap.h:47
static int m3ua_rx_mgmt(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: m3ua.c:647
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:102
static struct sccp_data_callback * _find_ssn(uint8_t ssn)
Definition: sccp.c:78
@ OSMO_SS7_AS_TMOD_OVERRIDE
Definition: osmo_ss7.h:255
struct llist_head list
Definition: sccp_internal.h:11
Definition: osmo_ss7.h:352
struct llist_head connections
Definition: sccp_internal.h:13
#define SUA_IEI_S7_HOP_CTR
Definition: sua.h:97
struct llist_head sccp_address_book
Definition: osmo_ss7.h:101
Definition: osmo_ss7.h:155
@ OSMO_SS7_ASP_PROT_NONE
Definition: osmo_ss7.h:271
struct osmo_ss7_route_table * osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:680
#define M3UA_IEI_REG_RESULT
Definition: m3ua.h:84
@ OSMO_SCCP_RI_GT
Definition: sccp_sap.h:58
void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn)
Definition: sccp_helpers.c:44
#define M3UA_ASPTM_INACTIVE_ACK
Definition: m3ua.h:59
static int sua_to_sccp_cc(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1044
char * xua_msg_dump(struct xua_msg *xua, const struct xua_dialect *dialect)
Definition: xua_msg.c:494
Definition: osmo_ss7.h:65
struct msgb * sccp_create_dt1(struct sccp_source_reference *dst_ref, uint8_t *inp_data, uint8_t len)
Definition: sccp.c:831
int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod)
Definition: osmo_ss7.c:1889
struct osmo_ss7_user ss7_user
Definition: sccp_internal.h:23
int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name)
Add given ASP to given AS.
Definition: osmo_ss7.c:957
#define M3UA_IEI_CONG_IND
Definition: m3ua.h:81
int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process M3UA message received from socket
Definition: ipa.c:276
@ M3UA_ERR_MISSING_PARAM
Definition: m3ua.h:168
uint8_t qos_class
Definition: osmo_ss7.h:306
static void route_insert_sorted(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_route *cmp)
Definition: osmo_ss7.c:757
uint8_t msg_type
Definition: xua_types.h:35
LLIST_HEAD(osmo_ss7_instances)
struct llist_head list
Definition: sccp_scoc.c:90
struct osmo_fsm_inst * as_fi
Definition: sccp_internal.h:46
char * osmo_sccp_inst_addr_name(const struct osmo_sccp_instance *sccp, const struct osmo_sccp_addr *addr)
Definition: sccp_helpers.c:337
#define SUA_CAUSE_T_REFUSAL
Definition: sua.h:135
int osmo_sccp_addr_parse(struct osmo_sccp_addr *out, const uint8_t *addr, unsigned int addrlen)
Parse wire-encoded SCCP address into omso_sccp_addr.
Definition: sccp2sua.c:118
struct osmo_xua_server * osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port, const char *local_host)
create a new xUA server configured with given ip/port
Definition: osmo_ss7.c:1789
static int _sccp_handle_connection_refused(struct msgb *msgb)
Definition: sccp.c:1156
#define M3UA_ASPTM_ACTIVE
Definition: m3ua.h:56
static const uint16_t drst_mand_ies[]
Definition: m3ua.c:163
struct osmo_xua_server * osmo_ss7_xua_server_find(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port)
Definition: osmo_ss7.c:1767
@ M3UA_ERR_UNSUPP_MSG_CLASS
Definition: m3ua.h:149
@ M3UA_ERR_NO_CONFGD_AS_FOR_ASP
Definition: m3ua.h:172
Definition: sigtran_sap.h:66
struct osmo_ss7_linkset * linkset
osmo_ss7_linkset to which we belong
Definition: osmo_ss7.h:157
struct osmo_fsm xua_default_lm_fsm
Definition: xua_default_lm_fsm.c:330
@ OSMO_SS7_AS_TMOD_ROUNDROBIN
Definition: osmo_ss7.h:258
static struct xua_msg * sccp_to_xua_dt1(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1132
uint8_t si
Definition: m3ua.h:98
struct value_string osmo_ss7_asp_protocol_vals[]
Definition: osmo_ss7.c:69
struct sccp_source_reference sccp_src_ref_from_int(uint32_t int_ref)
Definition: sccp.c:1409
struct osmo_ss7_route::@24 cfg
struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7.c:1147
static bool sccp_ptr_part_consistent(struct msgb *msg, uint8_t *ptr_addr)
validate that SCCP part with pointer + length doesn't exceed msg tail
Definition: sccp2sua.c:433
uint32_t context
Definition: osmo_ss7.h:247
#define SUA_CAUSE_T_MASK
Definition: sua.h:133
uint8_t msg_type
Definition: xua_types.h:3
Definition: osmo_ss7.h:41
uint32_t pc
Definition: sccp_internal.h:36
uint8_t qos_class
Definition: osmo_ss7.h:224
uint16_t len
Definition: xua_msg.h:42
static int _sccp_handle_connection_dt1(struct msgb *msgb)
Definition: sccp.c:1060
@ M3UA_ERR_UNEXP_PARAM
Definition: m3ua.h:165
void osmo_ss7_as_destroy(struct osmo_ss7_as *as)
Destroy given Application Server.
Definition: osmo_ss7.c:1012
struct osmo_sccp_gt gt
Definition: sccp_sap.h:154
static struct osmo_sccp_addr_entry * addr_entry_by_name_local(const char *name, const struct osmo_ss7_instance *inst)
Definition: osmo_ss7_vty.c:1044
int sccp_user_prim_up(struct osmo_sccp_user *scut, struct osmo_scu_prim *prim)
Send a SCCP User SAP Primitive up to the User.
Definition: sccp_user.c:153
static void _sccp_set_connection_state(struct sccp_connection *connection, int new_state)
Definition: sccp.c:656
struct osmo_ss7_asp_peer remote
Definition: osmo_ss7.h:392
static const struct value_string m3ua_rkm_msgt_names[]
Definition: m3ua.c:252
int xua_as_transmit_msg(struct osmo_ss7_as *as, struct msgb *msg)
Definition: xua_as_fsm.c:75
uint8_t gti
Definition: sccp_sap.h:144
#define SUA_CO_COERR
Definition: sua.h:79
#define M3UA_IEI_CONC_DEST
Definition: m3ua.h:82
static int m3ua_tx_xua_asp(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: m3ua.c:474
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:492
uint32_t next_id
Definition: sccp_internal.h:19
struct llist_head list
entry in osmo_ss7_instance::asp_list
Definition: osmo_ss7.h:354
@ OSMO_SCU_PRIM_N_DATA
Definition: sccp_sap.h:35
enum osmo_sccp_routing_ind ri
Definition: sccp_sap.h:153
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:490
@ M3UA_ERR_UNSUPP_MSG_TYPE
Definition: m3ua.h:150
const struct xua_dialect xua_dialect_sua
Definition: sua.c:215
static struct xua_msg * sccp_to_xua_cr(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1001
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:291
@ OSMO_SCCP_RI_SSN_IP
Definition: sccp_sap.h:60
uint32_t presence
Definition: sigtran_sap.h:38
static const uint16_t sccp_mandatory[NUM_SCCP_MSGT][MAX_IES]
Definition: sccp2sua.c:751
static int _sccp_parse_it(struct msgb *msgb, struct sccp_parse_result *result)
Definition: sccp.c:451
static int strnappendchar(char *str, char c, size_t n)
Definition: osmo_ss7.c:125
@ XUA_ASP_E_M_ASP_UP_REQ
Definition: xua_asp_fsm.h:10
int sccp_connection_connect(struct sccp_connection *conn, const struct sockaddr_sccp *local, struct msgb *data)
Definition: sccp.c:1347
char * osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr)
Definition: sccp_helpers.c:288
struct llist_head list
member in list of routing tables
Definition: osmo_ss7.h:45
struct osmo_sccp_user * 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.
Definition: sccp_user.c:47
#define M3UA_PPID
Definition: m3ua.h:25
uint32_t adjacent_pc
Definition: osmo_ss7.h:187
enum osmo_sccp_originator originator
Definition: sccp_sap.h:191
int xua_msg_free_tag(struct xua_msg *xua, uint16_t tag)
Definition: xua_msg.c:97
uint32_t id
Definition: osmo_ss7.h:92
LLIST_HEAD(sccp_address_book_global)
struct osmo_ss7_link::@21 cfg
static const uint16_t duna_mand_ies[]
Definition: m3ua.c:148
struct osmo_mtp_transfer_param mtp
Definition: xua_msg.h:33
struct llist_head rtable_list
list of osmo_ss7_route_table
Definition: osmo_ss7.h:80
int sccp_system_init(void(*outgoing)(struct sccp_connection *conn, struct msgb *data, void *, void *), void *ctx)
Definition: sccp.c:1224
const struct xua_dialect xua_dialect_m3ua
Definition: m3ua.c:272
int mtp_pcap_write_msu(int fd, const uint8_t *data, int length)
Definition: mtp_pcap.c:69
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in)
Definition: osmo_ss7.c:1903
#define SUA_IEI_SRC_REF
Definition: sua.h:100
uint32_t magic_number
Definition: mtp_pcap.c:38
#define M3UA_ASPSM_DOWN_ACK
Definition: m3ua.h:53
static int copy_address(struct sccp_address *addr, uint8_t offset, struct msgb *msgb)
Definition: sccp.c:108
struct llist_head users
Definition: sccp_internal.h:15
#define SUA_CAUSE_T_ERROR
Definition: sua.h:138
#define SUA_CAUSE_T_RETURN
Definition: sua.h:134
char * xua_hdr_dump(struct xua_msg *xua, const struct xua_dialect *dialect)
Definition: xua_msg.c:434
#define SUA_CAUSE_T_RESET
Definition: sua.h:137
struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:1055
static int sua_to_sccp_dt1(struct msgb *msg, struct xua_msg *xua)
Definition: sccp2sua.c:1146
cs7_role_t
Definition: osmo_ss7_vty.c:55
struct osmo_sccp_addr responding_addr
Definition: sccp_sap.h:168
#define M3UA_IEI_ROUTE_CTX
Definition: m3ua.h:67
#define SUA_PORT
Definition: sua.h:28
#define M3UA_IEI_DIAG_INFO
Definition: m3ua.h:68
#define M3UA_ASPSM_UP
Definition: m3ua.h:49
#define SUA_MSGC_CO
Definition: sua.h:36
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.
Definition: osmo_ss7_vty.c:1081
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1215
#define XUA_HDR(class, type)
Definition: xua_msg.h:25
uint32_t ssn
Definition: sccp_sap.h:156