libosmo-sigtran 2.2.1.4-74d0 Osmocom SIGTRAN library

xua_internal.h
Go to the documentation of this file.
1#pragma once
2
3#include <unistd.h>
4#include <stdint.h>
5
6#include <osmocom/core/tdef.h>
7#include <osmocom/sigtran/osmo_ss7.h>
8#include "xua_msg.h"
9
10#define M3UA_MSG_SIZE 2048
11#define M3UA_MSG_HEADROOM 512
12
13struct osmo_sccp_addr;
14struct m3ua_data_hdr;
15
16int sua_addr_parse_part(struct osmo_sccp_addr *out,
17 const struct xua_msg_part *param);
18int sua_addr_parse(struct osmo_sccp_addr *out, struct xua_msg *xua, uint16_t iei);
19
20int sua_parse_gt(struct osmo_sccp_gt *gt, const uint8_t *data, unsigned int datalen);
21
22struct xua_msg *osmo_sccp_to_xua(const struct msgb *msg);
23struct msgb *osmo_sua_to_sccp(const struct xua_msg *xua);
24
25int sua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg);
26
27int sua_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
28void sua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
29 const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *aff_ssn,
30 const uint32_t *smi, const char *info_string, bool available);
31void sua_tx_snm_congestion(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
32 const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *ssn,
33 const uint8_t cong_level, const char *info_string);
34void sua_tx_snm_daud(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
35 const uint32_t *aff_pc, unsigned int num_aff_pc, const uint32_t *aff_ssn,
36 const uint32_t *smi, const char *info_string);
37void sua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
38 uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str);
39
40struct xua_msg *sua_gen_cldr(const struct xua_msg *xua_in, uint32_t route_ctx, uint32_t ret_cause);
41
42struct msgb *m3ua_to_msg(struct xua_msg *xua);
43int m3ua_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
44void m3ua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
45 const uint32_t *aff_pc, unsigned int num_aff_pc,
46 const char *info_string, bool available);
47void m3ua_tx_snm_congestion(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
48 const uint32_t *aff_pc, unsigned int num_aff_pc,
49 const uint32_t *concerned_dpc, const uint8_t *cong_level,
50 const char *info_string);
51void m3ua_tx_snm_daud(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
52 const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_string);
53void m3ua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
54 uint32_t dpc, uint16_t user, uint16_t cause, const char *info_str);
55
56struct xua_msg *m3ua_encode_duna(const uint32_t *rctx, unsigned int num_rctx,
57 const uint32_t *aff_pc, unsigned int num_aff_pc,
58 const char *info_string);
59
60void xua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
61 const uint32_t *aff_pc, unsigned int num_aff_pc,
62 const char *info_str, bool available);
63
64void xua_snm_rx_daud(struct osmo_ss7_asp *asp, struct xua_msg *xua);
65void xua_snm_rx_duna(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
66void xua_snm_rx_dava(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
67void xua_snm_rx_dupu(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
68void xua_snm_rx_scon(struct osmo_ss7_asp *asp, struct osmo_ss7_as *as, struct xua_msg *xua);
69int m3ua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg);
70
71struct msgb *m3ua_msgb_alloc(const char *name);
72struct xua_msg *m3ua_xfer_from_data(const struct m3ua_data_hdr *data_hdr,
73 const uint8_t *data, unsigned int data_len);
74struct m3ua_data_hdr *data_hdr_from_m3ua(const struct xua_msg *xua);
75void m3ua_dh_to_xfer_param(struct osmo_mtp_transfer_param *param,
76 const struct m3ua_data_hdr *mdh);
77void mtp_xfer_param_to_m3ua_dh(struct m3ua_data_hdr *mdh,
78 const struct osmo_mtp_transfer_param *param);
79
80
81extern const struct xua_msg_class m3ua_msg_class_mgmt;
82extern const struct xua_msg_class m3ua_msg_class_snm;
83extern const struct xua_msg_class m3ua_msg_class_rkm;
84extern const struct xua_msg_class m3ua_msg_class_aspsm;
85extern const struct xua_msg_class m3ua_msg_class_asptm;
86
87extern const struct value_string m3ua_err_names[];
88extern const struct value_string m3ua_ntfy_type_names[];
89extern const struct value_string m3ua_ntfy_stchg_names[];
90extern const struct value_string m3ua_ntfy_other_names[];
91const char *m3ua_ntfy_info_name(uint16_t ntfy_status_type, uint16_t ntfy_status_info);
92
93struct xua_msg *m3ua_encode_notify(const struct osmo_xlm_prim_notify *npar);
94int m3ua_decode_notify(struct osmo_xlm_prim_notify *npar, void *ctx,
95 const struct xua_msg *xua);
96int m3ua_rx_rkm(struct osmo_ss7_asp *asp, struct xua_msg *xua);
97
98struct osmo_xlm_prim *xua_xlm_prim_alloc(enum osmo_xlm_prim_type prim_type,
99 enum osmo_prim_operation op);
100
101void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim *prim);
102void xua_asp_send_xlm_prim_simple(struct osmo_ss7_asp *asp,
103 enum osmo_xlm_prim_type prim_type,
104 enum osmo_prim_operation op);
105
106void xua_snm_pc_available(struct osmo_ss7_as *as, const uint32_t *aff_pc,
107 unsigned int num_aff_pc, const char *info_str, bool available);
108
109void xua_tx_snm_daud(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int num_rctx,
110 const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_str);
111
112 enum ss7_asp_lm_timer {
113 /* 0 kept unused on purpose since it's handled specially by osmo_fsm */
114 SS7_ASP_LM_T_WAIT_ASP_UP = 1,
115 SS7_ASP_LM_T_WAIT_NOTIFY,
116 SS7_ASP_LM_T_WAIT_NOTIY_RKM,
117 SS7_ASP_LM_T_WAIT_RK_REG_RESP,
118 /* This must remain the last item: */
119 SS7_ASP_LM_TIMERS_LEN
120};
121
122extern const struct osmo_tdef ss7_asp_lm_timer_defaults[SS7_ASP_LM_TIMERS_LEN];
123
124extern const struct value_string ss7_asp_lm_timer_names[];
125 static inline const char *ss7_asp_lm_timer_name(enum ss7_asp_lm_timer val)
126{ return get_value_string(ss7_asp_lm_timer_names, val); }
127
128extern struct osmo_fsm xua_default_lm_fsm;
129extern const struct value_string m3ua_rkm_reg_status_vals[];
130extern const struct value_string m3ua_rkm_dereg_status_vals[];
131
132int xua_as_transmit_msg(struct osmo_ss7_as *as, struct xua_msg *xua);
133
134int xua_find_as_for_asp(struct osmo_ss7_as **as, const struct osmo_ss7_asp *asp,
135 const struct xua_msg_part *rctx_ie);
136
137struct msgb *ipa_gen_ping(void);
138struct msgb *ipa_to_msg(struct xua_msg *xua);
139int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua);
140int ipa_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg, uint8_t sls);
141struct osmo_ss7_as *ipa_find_as_for_asp(struct osmo_ss7_asp *asp);
142
143int osmo_isup_party_parse(char *out_digits, const uint8_t *in,
144 unsigned int in_num_bytes, bool odd);
145int osmo_sccp_addr_parse(struct osmo_sccp_addr *out,
146 const uint8_t *addr, unsigned int addrlen);
147int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in);
148
149int 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_transfer_param
Definition: mtp_sap.h:42
osmo_sccp_addr
Definition: sccp_sap.h:183
osmo_sccp_gt
Definition: sccp_sap.h:175
osmo_ss7_as
Definition: ss7_as.h:86
osmo_ss7_asp
Definition: ss7_asp.h:45
osmo_xlm_prim_notify
Definition: sigtran_sap.h:37
osmo_xlm_prim
Definition: sigtran_sap.h:67
xua_msg_class
Definition: xua_msg.h:49
xua_msg_part
Definition: xua_msg.h:39
xua_msg
Definition: xua_msg.h:31
ssn
uint8_t ssn
Definition: tcap_as_loadshare.c:3
data
uint8_t data[0]
Definition: tcap_as_loadshare.c:2
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:83
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:591
sua_tx_snm_daud
void sua_tx_snm_daud(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)
Transmit SSNM DAUD message requesting [un]availability status of certain point code[s].
Definition: sua.c:973
m3ua_err_names
const struct value_string m3ua_err_names[]
Definition: m3ua.c:59
ipa_find_as_for_asp
struct osmo_ss7_as * ipa_find_as_for_asp(struct osmo_ss7_asp *asp)
Definition: ipa.c:172
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:557
xua_as_transmit_msg
int xua_as_transmit_msg(struct osmo_ss7_as *as, struct xua_msg *xua)
Definition: xua_as_fsm.c:191
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:555
m3ua_to_msg
struct msgb * m3ua_to_msg(struct xua_msg *xua)
Definition: m3ua.c:506
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:366
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:1014
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:107
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:337
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:944
sua_gen_cldr
struct xua_msg * sua_gen_cldr(const struct xua_msg *xua_in, uint32_t route_ctx, uint32_t ret_cause)
Definition: sua.c:268
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:921
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:551
m3ua_ntfy_stchg_names
const struct value_string m3ua_ntfy_stchg_names[]
Definition: m3ua.c:89
m3ua_msg_class_snm
const struct xua_msg_class m3ua_msg_class_snm
Definition: m3ua.c:192
ipa_to_msg
struct msgb * ipa_to_msg(struct xua_msg *xua)
Definition: ipa.c:75
m3ua_rx_msg
int m3ua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process M3UA message received from socket
Definition: m3ua.c:786
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
m3ua_decode_notify
int m3ua_decode_notify(struct osmo_xlm_prim_notify *npar, void *ctx, const struct xua_msg *xua)
Definition: m3ua.c:447
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:132
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:522
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: ss7_asp.c:1445
ss7_asp_lm_timer_name
static const char * ss7_asp_lm_timer_name(enum ss7_asp_lm_timer val)
Definition: xua_internal.h:125
sua_rx_msg
int sua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg)
process SUA message received from socket
Definition: sua.c:734
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:305
xua_default_lm_fsm
struct osmo_fsm xua_default_lm_fsm
Definition: xua_default_lm_fsm.c:383
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:122
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:359
m3ua_ntfy_info_name
const char * m3ua_ntfy_info_name(uint16_t ntfy_status_type, uint16_t ntfy_status_info)
Definition: m3ua.c:104
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:945
m3ua_msg_class_rkm
const struct xua_msg_class m3ua_msg_class_rkm
Definition: m3ua.c:276
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:423
m3ua_encode_notify
struct xua_msg * m3ua_encode_notify(const struct osmo_xlm_prim_notify *npar)
Definition: m3ua.c:415
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:215
m3ua_msg_class_asptm
const struct xua_msg_class m3ua_msg_class_asptm
Definition: m3ua.c:228
m3ua_ntfy_other_names
const struct value_string m3ua_ntfy_other_names[]
Definition: m3ua.c:97
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:223
m3ua_rx_rkm
int m3ua_rx_rkm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: xua_rkm.c:566
m3ua_tx_snm_daud
void m3ua_tx_snm_daud(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)
Transmit SSNM DAUD message requesting [un]availability status of certain point code[s].
Definition: m3ua.c:999
osmo_sccp_to_xua
struct xua_msg * osmo_sccp_to_xua(const struct msgb *msg)
convert SCCP message to a SUA message
Definition: sccp2sua.c:1667
m3ua_msgb_alloc
struct msgb * m3ua_msgb_alloc(const char *name)
Definition: m3ua.c:329
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:317
xua_tx_snm_available
void xua_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_str, bool available)
Definition: xua_snm.c:71
m3ua_msg_class_mgmt
const struct xua_msg_class m3ua_msg_class_mgmt
Definition: m3ua.c:246
m3ua_encode_duna
struct xua_msg * m3ua_encode_duna(const uint32_t *rctx, unsigned int num_rctx, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_string)
Definition: m3ua.c:867
ss7_asp_lm_timer
ss7_asp_lm_timer
Definition: xua_internal.h:112
SS7_ASP_LM_T_WAIT_ASP_UP
@ SS7_ASP_LM_T_WAIT_ASP_UP
Definition: xua_internal.h:114
SS7_ASP_LM_TIMERS_LEN
@ SS7_ASP_LM_TIMERS_LEN
Definition: xua_internal.h:119
SS7_ASP_LM_T_WAIT_NOTIFY
@ SS7_ASP_LM_T_WAIT_NOTIFY
Definition: xua_internal.h:115
SS7_ASP_LM_T_WAIT_RK_REG_RESP
@ SS7_ASP_LM_T_WAIT_RK_REG_RESP
Definition: xua_internal.h:117
SS7_ASP_LM_T_WAIT_NOTIY_RKM
@ SS7_ASP_LM_T_WAIT_NOTIY_RKM
Definition: xua_internal.h:116
osmo_sua_to_sccp
struct msgb * osmo_sua_to_sccp(const struct xua_msg *xua)
convert parsed SUA message to SCCP message
Definition: sccp2sua.c:1781
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:967
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:386
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
data_hdr_from_m3ua
struct m3ua_data_hdr * data_hdr_from_m3ua(const struct xua_msg *xua)
Definition: m3ua.c:574
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:137
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:487
ipa_gen_ping
struct msgb * ipa_gen_ping(void)
Definition: ipa.c:62
xua_tx_snm_daud
void xua_tx_snm_daud(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_str)
Definition: xua_snm.c:87
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:989
xua_snm_rx_daud
void xua_snm_rx_daud(struct osmo_ss7_asp *asp, struct xua_msg *xua)
Definition: xua_snm.c:408