libosmo-sigtran 2.1.0.164-775d Osmocom SIGTRAN library

sccp_sap.h
Go to the documentation of this file.
1#pragma once
2
3/* SCCP User SAP description */
4
5/* (C) 2015-2017 by Harald Welte <laforge@gnumonks.org>
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#include <stdint.h>
24#include <osmocom/core/prim.h>
25#include <osmocom/sigtran/sigtran_sap.h>
26
27#include <netinet/in.h>
28
29/* detailed coding of primitives at the SAP_SCCP_USER */
30
32 enum osmo_scu_prim_type {
33 /* connection oriented, 6.1.1 */
34 OSMO_SCU_PRIM_N_CONNECT,
35 OSMO_SCU_PRIM_N_DATA,
36 OSMO_SCU_PRIM_N_EXPEDITED_DATA,
37 OSMO_SCU_PRIM_N_DISCONNECT,
38 OSMO_SCU_PRIM_N_RESET,
39 OSMO_SCU_PRIM_N_INFORM,
40 /* connectionless, 6.2.2 */
41 OSMO_SCU_PRIM_N_UNITDATA,
42 OSMO_SCU_PRIM_N_NOTICE,
43 /* management */
44 OSMO_SCU_PRIM_N_COORD,
45 OSMO_SCU_PRIM_N_STATE,
46 OSMO_SCU_PRIM_N_PCSTATE,
47};
48
49#define OSMO_SCCP_ADDR_T_GT 0x0001 /* global title */
50#define OSMO_SCCP_ADDR_T_PC 0x0002 /* signalling point code */
51#define OSMO_SCCP_ADDR_T_SSN 0x0004 /* subsystem number */
52#define OSMO_SCCP_ADDR_T_IPv4 0x0008
53#define OSMO_SCCP_ADDR_T_IPv6 0x0010
54#define OSMO_SCCP_ADDR_T_MASK 0x001f
55
56/* Q.713 3.4.1 + RFC 3868 3.10.2.3 */
57 enum osmo_sccp_routing_ind {
58 OSMO_SCCP_RI_NONE,
59 OSMO_SCCP_RI_GT,
60 OSMO_SCCP_RI_SSN_PC,
61 OSMO_SCCP_RI_SSN_IP,
62};
63
64 extern const struct value_string osmo_sccp_routing_ind_names[];
65 static inline const char *osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val)
66{ return get_value_string(osmo_sccp_routing_ind_names, val); }
67
68
69/* Q.713 3.4.1 + RFC 3868 3.10.2.3 */
70 enum osmo_sccp_gti {
71 OSMO_SCCP_GTI_NO_GT,
72 OSMO_SCCP_GTI_NAI_ONLY,
73 OSMO_SCCP_GTI_TT_ONLY,
74 OSMO_SCCP_GTI_TT_NPL_ENC,
75 OSMO_SCCP_GTI_TT_NPL_ENC_NAI,
76};
77
78 extern const struct value_string osmo_sccp_gti_names[];
79 static inline const char *osmo_sccp_gti_name(enum osmo_sccp_gti val)
80{ return get_value_string(osmo_sccp_gti_names, val); }
81
82/* RFC 3868 3.10.2.3 */
83 enum osmo_sccp_npi {
84 OSMO_SCCP_NPI_UNKNOWN = 0,
85 OSMO_SCCP_NPI_E164_ISDN = 1,
86 OSMO_SCCP_NPI_GEERIC = 2,
87 OSMO_SCCP_NPI_X121_DATA = 3,
88 OSMO_SCCP_NPI_F69_TELEX = 4,
89 OSMO_SCCP_NPI_E210_MARITIME = 5,
90 OSMO_SCCP_NPI_E212_LAND = 6,
91 OSMO_SCCP_NPI_E214_ISDN_MOBILE = 7,
92 OSMO_SCCP_NPI_PRIVATE = 14,
93};
94
95/* Q.713 3.4.2.3.1 + RFC 3868 3.10.2.3 */
96 enum osmo_sccp_nai {
97 OSMO_SCCP_NAI_UNKNOWN = 0,
98 OSMO_SCCP_NAI_SUBSCR = 1,
99 OSMO_SCCP_NAI_RES_NAT_USE = 2,
100 OSMO_SCCP_NAI_NATL = 3,
101 OSMO_SCCP_NAI_INTL = 4,
102 /* 5.. 255: Spare */
103};
104
105/* Q.713 3.4.2.2 */
106 enum osmo_sccp_ssn {
107 /* globally standardised for GSM/UMTS: 1-31 */
108 OSMO_SCCP_SSN_MGMT = 1,
109 OSMO_SCCP_SSN_ISUP = 3,
110 OSMO_SCCP_SSN_OMAP = 4,
111 OSMO_SCCP_SSN_MAP = 5,
112 OSMO_SCCP_SSN_HLR = 6,
113 OSMO_SCCP_SSN_VLR = 7,
114 OSMO_SCCP_SSN_MSC = 8,
115 OSMO_SCCP_SSN_EIR = 9,
116 OSMO_SCCP_SSN_AUC = 0x0a,
117 /* Q.713 */
118 OSMO_SCCP_SSN_ISDN_SS = 0x0b,
119 OSMO_SCCP_SSN_RES_INTL = 0x0c,
120 OSMO_SCCP_SSN_BISDN = 0x0d,
121 OSMO_SCCP_SSN_TC_TEST = 0x0e,
122 /* national network SSN for wihin and between GSM/UMTS: 129-150 */
123 OSMO_SCCP_SSN_RANAP = 142,
124 OSMO_SCCP_SSN_RNSAP = 143,
125 OSMO_SCCP_SSN_GMLC_MAP = 145,
126 OSMO_SCCP_SSN_CAP = 146,
127 OSMO_SCCP_SSN_gsmSCF_MAP = 147,
128 OSMO_SCCP_SSN_SIWF_MAP = 148,
129 OSMO_SCCP_SSN_SGSN_MAP = 149,
130 OSMO_SCCP_SSN_GGSN_MAP = 150,
131 /* national network SSN within GSM/UMTS: 32-128 + 151-254 */
132 OSMO_SCCP_SSN_PCAP = 249,
133 OSMO_SCCP_SSN_BSC_BSSAP_LE = 250,
134 OSMO_SCCP_SSN_MSC_BSSAP_LE = 251,
135 OSMO_SCCP_SSN_SMLC_BSSAP_LE = 252,
136 OSMO_SCCP_SSN_BSS_OAM = 253,
137 OSMO_SCCP_SSN_BSSAP = 254,
138};
139
140/* Q.711 6.3.2.2.5 Signalling point status */
141 enum osmo_sccp_sp_status {
142 OSMO_SCCP_SP_S_INACCESSIBLE = 1,
143 OSMO_SCCP_SP_S_CONGESTED = 2,
144 OSMO_SCCP_SP_S_ACCESSIBLE = 3,
145};
146
147 extern const struct value_string osmo_sccp_sp_status_names[];
148 static inline const char *osmo_sccp_sp_status_name(enum osmo_sccp_sp_status val)
149{
150 return get_value_string(osmo_sccp_sp_status_names, val);
151}
152
153/* Q.711 6.3.2.2.6 Remote SCCP status */
154 enum osmo_sccp_rem_sccp_status {
155 OSMO_SCCP_REM_SCCP_S_AVAILABLE = 1,
156 OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN = 2,
157 OSMO_SCCP_REM_SCCP_S_UNEQUIPPED = 3,
158 OSMO_SCCP_REM_SCCP_S_INACCESSIBLE = 4,
159 OSMO_SCCP_REM_SCCP_S_CONGESTED = 5,
160};
161
162 extern const struct value_string osmo_sccp_rem_sccp_status_names[];
163 static inline const char *osmo_sccp_rem_sccp_status_name(enum osmo_sccp_rem_sccp_status val)
164{
165 return get_value_string(osmo_sccp_rem_sccp_status_names, val);
166}
167
168/* legacy shim for name change */
169#define OSMO_SCCP_SSN_SMLC_BSSAP OSMO_SCCP_SSN_SMLC_BSSAP_LE
170
171 extern const struct value_string osmo_sccp_ssn_names[];
172 static inline const char *osmo_sccp_ssn_name(enum osmo_sccp_ssn val)
173{ return get_value_string(osmo_sccp_ssn_names, val); }
174
175 struct osmo_sccp_gt {
176 uint8_t gti;
177 uint8_t tt;
178 uint32_t npi;
179 uint32_t nai;
180 char digits[32];
181};
182
183 struct osmo_sccp_addr {
184 uint32_t presence;
185 enum osmo_sccp_routing_ind ri;
186 struct osmo_sccp_gt gt;
187 uint32_t pc;
188 uint32_t ssn;
189 union {
190 struct in_addr v4;
191 struct in6_addr v6;
192 } ip;
193 /* we don't do hostnames */
194};
195
196/* OSMO_SCU_PRIM_N_CONNECT */
197 struct osmo_scu_connect_param {
198 struct osmo_sccp_addr called_addr;
199 struct osmo_sccp_addr calling_addr;
200 struct osmo_sccp_addr responding_addr;
201 //struct osmo_sccp_qos_pars qos_pars;
202 uint32_t sccp_class;
203 uint32_t importance;
204 uint32_t conn_id;
205 /* user data */
206};
207
208/* OSMO_SCU_PRIM_N_DATA / OSMO_SCU_PRIM_N_EXPEDITED_DATA */
209 struct osmo_scu_data_param {
210 uint32_t conn_id;
211 uint32_t importance;
212 /* user data */
213};
214
215 enum osmo_sccp_originator {
216 OSMO_SCCP_ORIG_NS_PROVIDER,
217 OSMO_SCCP_ORIG_NS_USER,
218 OSMO_SCCP_ORIG_UNDEFINED,
219};
220
221/* OSMO_SCU_PRIM_N_DISCONNECT */
222 struct osmo_scu_disconn_param {
223 enum osmo_sccp_originator originator;
224 struct osmo_sccp_addr responding_addr;
225 uint32_t cause;
226 uint32_t conn_id;
227 uint32_t importance;
228 /* user data */
229};
230
231/* OSMO_SCU_PRIM_N_RESET */
232 struct osmo_scu_reset_param {
233 enum osmo_sccp_originator originator;
234 uint32_t cause;
235 uint32_t conn_id;
236};
237
238/* OSMO_SCU_PRIM_N_UNITDATA */
239/* NOTE: Ideally there should have been a "bool in_sequence_control_present",
240 * but that was found too late, so instead set:
241 * "in_sequence_control = OSMO_SCU_UNITDATA_PARAM_SEQUENCE_CONTROL_NOT_PRESENT"
242 * to mark the field not present (aka select Protocol Class 0).
243 * See ITU-T Q.711 6.2.1 for more information.
244 */
245#define OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT 0xffffffff
246 struct osmo_scu_unitdata_param {
247 struct osmo_sccp_addr called_addr;
248 struct osmo_sccp_addr calling_addr;
249 uint32_t in_sequence_control;
250 uint32_t return_option;
251 uint32_t importance;
252 /* user data */
253};
254
255/* OSMO_SCU_PRIM_N_NOTICE */
256 struct osmo_scu_notice_param {
257 struct osmo_sccp_addr called_addr;
258 struct osmo_sccp_addr calling_addr;
259 /* ITU Q.711 6.2.2.2.4 "Reason for return":
260 * enum sccp_return_cause (ITU Q.713 3.12), as per ITU Q.713 A.5. */
261 uint32_t cause;
262 uint32_t importance; /* ITU Q.711 6.2.2.2.6, Q.713 3.19 */
263 /* user data */
264};
265
266/* OSMO_SCU_PRIM_N_STATE */
267 struct osmo_scu_state_param {
268 uint32_t affected_pc;
269 uint32_t affected_ssn;
270 bool user_in_service; /* true: UIS; false: UOS */
271 uint32_t ssn_multiplicity_ind;
272};
273
274/* OSMO_SCU_PRIM_N_PCSTATE */
275 struct osmo_scu_pcstate_param {
276 uint32_t affected_pc;
277 uint32_t restricted_importance_level;
278 enum osmo_sccp_sp_status sp_status;
279 enum osmo_sccp_rem_sccp_status remote_sccp_status;
280};
281
282 struct osmo_scu_prim {
283 struct osmo_prim_hdr oph;
284 union {
285 struct osmo_scu_connect_param connect;
286 struct osmo_scu_data_param data;
287 struct osmo_scu_disconn_param disconnect;
288 struct osmo_scu_reset_param reset;
289 struct osmo_scu_unitdata_param unitdata;
290 struct osmo_scu_notice_param notice;
291 struct osmo_scu_state_param state;
292 struct osmo_scu_pcstate_param pcstate;
293 } u;
294};
295
296#define msgb_scu_prim(msg) ((struct osmo_scu_prim *)(msg)->l1h)
297
298 extern const struct value_string osmo_scu_prim_type_names[];
299 static inline const char *osmo_scu_prim_type_name(enum osmo_scu_prim_type val)
300{
301 return get_value_string(osmo_scu_prim_type_names, val);
302}
303
304 int osmo_scu_prim_hdr_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr *oph);
305 char *osmo_scu_prim_hdr_name_c(void *ctx, const struct osmo_prim_hdr *oph);
306 char *osmo_scu_prim_name(const struct osmo_prim_hdr *oph);
307
308 struct osmo_ss7_instance;
309 struct osmo_sccp_instance;
310 struct osmo_sccp_user;
311
312 void osmo_sccp_vty_init(void);
313
314 struct osmo_sccp_instance *osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv);
315 void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst);
316 struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance *sccp);
317 struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu);
318 void osmo_sccp_set_priv(struct osmo_sccp_instance *sccp, void *priv);
319 void *osmo_sccp_get_priv(struct osmo_sccp_instance *sccp);
320
321 void osmo_sccp_user_unbind(struct osmo_sccp_user *scu);
322 void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv);
323 void *osmo_sccp_user_get_priv(struct osmo_sccp_user *scu);
324
325 struct osmo_sccp_user *osmo_sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name,
326 osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc);
327
328 struct osmo_sccp_user *osmo_sccp_user_bind(struct osmo_sccp_instance *inst, const char *name,
329 osmo_prim_cb prim_cb, uint16_t ssn);
330 struct osmo_sccp_user *osmo_sccp_user_find(struct osmo_sccp_instance *inst, uint16_t ssn, uint32_t pc);
331
332 int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph);
333 int osmo_sccp_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph);
334
335 int osmo_sccp_addr_create(struct osmo_ss7_instance *inst, const char *name, const struct osmo_sccp_addr *dest_addr);
336 int osmo_sccp_addr_update(struct osmo_ss7_instance *inst, const char *name, const struct osmo_sccp_addr *dest_addr);
337 struct osmo_ss7_instance *osmo_sccp_addr_by_name(struct osmo_sccp_addr *dest_addr, const char *name);
338 int osmo_sccp_addr_by_name_local(struct osmo_sccp_addr *dest_addr, const char *name,
339 const struct osmo_ss7_instance *inst);
340 const char *osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr);
341 void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr,
342 const struct osmo_sccp_instance *inst,
343 uint32_t ssn);
344
345 bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence);
346 int osmo_sccp_addr_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria);
347 int osmo_sccp_addr_ri_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b);
348 int osmo_sccp_gt_cmp(const struct osmo_sccp_gt *a, const struct osmo_sccp_gt *b);
349
350 const char *osmo_sccp_user_name(struct osmo_sccp_user *scu);
351
352 int osmo_sccp_instance_next_conn_id(struct osmo_sccp_instance *sccp);
osmo_scu_prim_type
osmo_scu_prim_type
SCCP-User primitives as per Q.711.
Definition: sccp_sap.h:32
OSMO_SCU_PRIM_N_CONNECT
@ OSMO_SCU_PRIM_N_CONNECT
Definition: sccp_sap.h:34
OSMO_SCU_PRIM_N_NOTICE
@ OSMO_SCU_PRIM_N_NOTICE
Definition: sccp_sap.h:42
OSMO_SCU_PRIM_N_INFORM
@ OSMO_SCU_PRIM_N_INFORM
Definition: sccp_sap.h:39
OSMO_SCU_PRIM_N_RESET
@ OSMO_SCU_PRIM_N_RESET
Definition: sccp_sap.h:38
OSMO_SCU_PRIM_N_UNITDATA
@ OSMO_SCU_PRIM_N_UNITDATA
Definition: sccp_sap.h:41
OSMO_SCU_PRIM_N_PCSTATE
@ OSMO_SCU_PRIM_N_PCSTATE
Definition: sccp_sap.h:46
OSMO_SCU_PRIM_N_EXPEDITED_DATA
@ OSMO_SCU_PRIM_N_EXPEDITED_DATA
Definition: sccp_sap.h:36
OSMO_SCU_PRIM_N_STATE
@ OSMO_SCU_PRIM_N_STATE
Definition: sccp_sap.h:45
OSMO_SCU_PRIM_N_DISCONNECT
@ OSMO_SCU_PRIM_N_DISCONNECT
Definition: sccp_sap.h:37
OSMO_SCU_PRIM_N_DATA
@ OSMO_SCU_PRIM_N_DATA
Definition: sccp_sap.h:35
OSMO_SCU_PRIM_N_COORD
@ OSMO_SCU_PRIM_N_COORD
Definition: sccp_sap.h:44
osmo_sccp_npi
osmo_sccp_npi
Definition: sccp_sap.h:83
OSMO_SCCP_NPI_F69_TELEX
@ OSMO_SCCP_NPI_F69_TELEX
Definition: sccp_sap.h:88
OSMO_SCCP_NPI_E214_ISDN_MOBILE
@ OSMO_SCCP_NPI_E214_ISDN_MOBILE
Definition: sccp_sap.h:91
OSMO_SCCP_NPI_GEERIC
@ OSMO_SCCP_NPI_GEERIC
Definition: sccp_sap.h:86
OSMO_SCCP_NPI_E210_MARITIME
@ OSMO_SCCP_NPI_E210_MARITIME
Definition: sccp_sap.h:89
OSMO_SCCP_NPI_X121_DATA
@ OSMO_SCCP_NPI_X121_DATA
Definition: sccp_sap.h:87
OSMO_SCCP_NPI_E212_LAND
@ OSMO_SCCP_NPI_E212_LAND
Definition: sccp_sap.h:90
OSMO_SCCP_NPI_E164_ISDN
@ OSMO_SCCP_NPI_E164_ISDN
Definition: sccp_sap.h:85
OSMO_SCCP_NPI_UNKNOWN
@ OSMO_SCCP_NPI_UNKNOWN
Definition: sccp_sap.h:84
OSMO_SCCP_NPI_PRIVATE
@ OSMO_SCCP_NPI_PRIVATE
Definition: sccp_sap.h:92
osmo_sccp_user_sap_down_nofree
int osmo_sccp_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph)
Main entrance function for primitives from SCCP User.
Definition: sccp_sap.c:214
osmo_sccp_ssn_name
static const char * osmo_sccp_ssn_name(enum osmo_sccp_ssn val)
Definition: sccp_sap.h:172
osmo_sccp_user_set_priv
void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv)
Definition: sccp_user.c:102
osmo_scu_prim_hdr_name_c
char * osmo_scu_prim_hdr_name_c(void *ctx, const struct osmo_prim_hdr *oph)
Definition: sccp_sap.c:74
osmo_sccp_sp_status_names
const struct value_string osmo_sccp_sp_status_names[]
Definition: sccp_sap.c:130
osmo_sccp_get_sccp
struct osmo_sccp_instance * osmo_sccp_get_sccp(const struct osmo_sccp_user *scu)
get the SCCP instance that is related to the given sccp user
Definition: sccp_user.c:150
osmo_sccp_originator
osmo_sccp_originator
Definition: sccp_sap.h:215
OSMO_SCCP_ORIG_NS_USER
@ OSMO_SCCP_ORIG_NS_USER
Definition: sccp_sap.h:217
OSMO_SCCP_ORIG_NS_PROVIDER
@ OSMO_SCCP_ORIG_NS_PROVIDER
Definition: sccp_sap.h:216
OSMO_SCCP_ORIG_UNDEFINED
@ OSMO_SCCP_ORIG_UNDEFINED
Definition: sccp_sap.h:218
osmo_sccp_instance_destroy
void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst)
Definition: sccp_instance.c:336
osmo_sccp_user_find
struct osmo_sccp_user * osmo_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_instance.c:137
osmo_sccp_rem_sccp_status_names
const struct value_string osmo_sccp_rem_sccp_status_names[]
Definition: sccp_sap.c:137
osmo_sccp_check_addr
bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence)
check whether a given SCCP-Address is consistent.
Definition: sccp_instance.c:394
osmo_sccp_sp_status_name
static const char * osmo_sccp_sp_status_name(enum osmo_sccp_sp_status val)
Definition: sccp_sap.h:148
osmo_sccp_gti
osmo_sccp_gti
Definition: sccp_sap.h:70
OSMO_SCCP_GTI_TT_NPL_ENC_NAI
@ OSMO_SCCP_GTI_TT_NPL_ENC_NAI
Definition: sccp_sap.h:75
OSMO_SCCP_GTI_NAI_ONLY
@ OSMO_SCCP_GTI_NAI_ONLY
Definition: sccp_sap.h:72
OSMO_SCCP_GTI_TT_ONLY
@ OSMO_SCCP_GTI_TT_ONLY
Definition: sccp_sap.h:73
OSMO_SCCP_GTI_TT_NPL_ENC
@ OSMO_SCCP_GTI_TT_NPL_ENC
Definition: sccp_sap.h:74
OSMO_SCCP_GTI_NO_GT
@ OSMO_SCCP_GTI_NO_GT
Definition: sccp_sap.h:71
osmo_scu_prim_hdr_name_buf
int osmo_scu_prim_hdr_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr *oph)
Definition: sccp_sap.c:59
osmo_sccp_addr_by_name
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: ss7_instance.c:729
osmo_sccp_gt_cmp
int osmo_sccp_gt_cmp(const struct osmo_sccp_gt *a, const struct osmo_sccp_gt *b)
Compare two SCCP Global Titles.
Definition: sccp_instance.c:437
osmo_sccp_routing_ind_name
static const char * osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val)
Definition: sccp_sap.h:65
osmo_sccp_routing_ind
osmo_sccp_routing_ind
Definition: sccp_sap.h:57
OSMO_SCCP_RI_GT
@ OSMO_SCCP_RI_GT
Definition: sccp_sap.h:59
OSMO_SCCP_RI_NONE
@ OSMO_SCCP_RI_NONE
Definition: sccp_sap.h:58
OSMO_SCCP_RI_SSN_PC
@ OSMO_SCCP_RI_SSN_PC
Definition: sccp_sap.h:60
OSMO_SCCP_RI_SSN_IP
@ OSMO_SCCP_RI_SSN_IP
Definition: sccp_sap.h:61
osmo_sccp_get_priv
void * osmo_sccp_get_priv(struct osmo_sccp_instance *sccp)
Definition: sccp_instance.c:365
osmo_sccp_user_bind_pc
struct osmo_sccp_user * osmo_sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc)
Bind a given SCCP User to a given SSN+PC.
Definition: sccp_instance.c:187
osmo_sccp_rem_sccp_status_name
static const char * osmo_sccp_rem_sccp_status_name(enum osmo_sccp_rem_sccp_status val)
Definition: sccp_sap.h:163
osmo_sccp_gti_name
static const char * osmo_sccp_gti_name(enum osmo_sccp_gti val)
Definition: sccp_sap.h:79
osmo_sccp_ssn_names
const struct value_string osmo_sccp_ssn_names[]
Definition: sccp_sap.c:146
osmo_sccp_addr_by_name_local
int osmo_sccp_addr_by_name_local(struct osmo_sccp_addr *dest_addr, const char *name, const struct osmo_ss7_instance *inst)
Lookup an SCCP address from the addressbook of a specific instance by its name.
Definition: ss7_instance.c:751
osmo_sccp_vty_init
void osmo_sccp_vty_init(void)
Definition: sccp_vty.c:329
osmo_sccp_get_ss7
struct osmo_ss7_instance * osmo_sccp_get_ss7(const struct osmo_sccp_instance *sccp)
get the SS7 instance that is related to the given SCCP instance
Definition: sccp_instance.c:975
osmo_sccp_user_get_priv
void * osmo_sccp_user_get_priv(struct osmo_sccp_user *scu)
Definition: sccp_user.c:107
osmo_sccp_routing_ind_names
const struct value_string osmo_sccp_routing_ind_names[]
Definition: sccp_sap.c:113
osmo_sccp_user_sap_down
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_sap.c:271
osmo_sccp_set_priv
void osmo_sccp_set_priv(struct osmo_sccp_instance *sccp, void *priv)
Definition: sccp_instance.c:360
osmo_sccp_instance_create
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_instance.c:298
osmo_scu_prim_type_name
static const char * osmo_scu_prim_type_name(enum osmo_scu_prim_type val)
Definition: sccp_sap.h:299
osmo_sccp_addr_create
int osmo_sccp_addr_create(struct osmo_ss7_instance *inst, const char *name, const struct osmo_sccp_addr *dest_addr)
Add an SCCP address entry to the addressbook.
Definition: ss7_instance.c:644
osmo_sccp_user_bind
struct osmo_sccp_user * osmo_sccp_user_bind(struct osmo_sccp_instance *inst, const char *name, osmo_prim_cb prim_cb, uint16_t ssn)
Bind a given SCCP User to a given SSN (at any PC)
Definition: sccp_instance.c:204
osmo_sccp_addr_update
int osmo_sccp_addr_update(struct osmo_ss7_instance *inst, const char *name, const struct osmo_sccp_addr *dest_addr)
Update the value of an SCCP address entry already present in the addressbook.
Definition: ss7_instance.c:674
osmo_sccp_name_by_addr
const char * osmo_sccp_name_by_addr(const struct osmo_sccp_addr *addr)
Reverse lookup the lookup-name of a specified SCCP address.
Definition: ss7_instance.c:769
osmo_sccp_ssn
osmo_sccp_ssn
Definition: sccp_sap.h:106
OSMO_SCCP_SSN_BSC_BSSAP_LE
@ OSMO_SCCP_SSN_BSC_BSSAP_LE
Definition: sccp_sap.h:133
OSMO_SCCP_SSN_ISUP
@ OSMO_SCCP_SSN_ISUP
Definition: sccp_sap.h:109
OSMO_SCCP_SSN_RES_INTL
@ OSMO_SCCP_SSN_RES_INTL
Definition: sccp_sap.h:119
OSMO_SCCP_SSN_MSC_BSSAP_LE
@ OSMO_SCCP_SSN_MSC_BSSAP_LE
Definition: sccp_sap.h:134
OSMO_SCCP_SSN_HLR
@ OSMO_SCCP_SSN_HLR
Definition: sccp_sap.h:112
OSMO_SCCP_SSN_SGSN_MAP
@ OSMO_SCCP_SSN_SGSN_MAP
Definition: sccp_sap.h:129
OSMO_SCCP_SSN_VLR
@ OSMO_SCCP_SSN_VLR
Definition: sccp_sap.h:113
OSMO_SCCP_SSN_RANAP
@ OSMO_SCCP_SSN_RANAP
Definition: sccp_sap.h:123
OSMO_SCCP_SSN_gsmSCF_MAP
@ OSMO_SCCP_SSN_gsmSCF_MAP
Definition: sccp_sap.h:127
OSMO_SCCP_SSN_MSC
@ OSMO_SCCP_SSN_MSC
Definition: sccp_sap.h:114
OSMO_SCCP_SSN_GMLC_MAP
@ OSMO_SCCP_SSN_GMLC_MAP
Definition: sccp_sap.h:125
OSMO_SCCP_SSN_BSSAP
@ OSMO_SCCP_SSN_BSSAP
Definition: sccp_sap.h:137
OSMO_SCCP_SSN_ISDN_SS
@ OSMO_SCCP_SSN_ISDN_SS
Definition: sccp_sap.h:118
OSMO_SCCP_SSN_SMLC_BSSAP_LE
@ OSMO_SCCP_SSN_SMLC_BSSAP_LE
Definition: sccp_sap.h:135
OSMO_SCCP_SSN_MAP
@ OSMO_SCCP_SSN_MAP
Definition: sccp_sap.h:111
OSMO_SCCP_SSN_GGSN_MAP
@ OSMO_SCCP_SSN_GGSN_MAP
Definition: sccp_sap.h:130
OSMO_SCCP_SSN_EIR
@ OSMO_SCCP_SSN_EIR
Definition: sccp_sap.h:115
OSMO_SCCP_SSN_CAP
@ OSMO_SCCP_SSN_CAP
Definition: sccp_sap.h:126
OSMO_SCCP_SSN_TC_TEST
@ OSMO_SCCP_SSN_TC_TEST
Definition: sccp_sap.h:121
OSMO_SCCP_SSN_RNSAP
@ OSMO_SCCP_SSN_RNSAP
Definition: sccp_sap.h:124
OSMO_SCCP_SSN_PCAP
@ OSMO_SCCP_SSN_PCAP
Definition: sccp_sap.h:132
OSMO_SCCP_SSN_AUC
@ OSMO_SCCP_SSN_AUC
Definition: sccp_sap.h:116
OSMO_SCCP_SSN_OMAP
@ OSMO_SCCP_SSN_OMAP
Definition: sccp_sap.h:110
OSMO_SCCP_SSN_BISDN
@ OSMO_SCCP_SSN_BISDN
Definition: sccp_sap.h:120
OSMO_SCCP_SSN_BSS_OAM
@ OSMO_SCCP_SSN_BSS_OAM
Definition: sccp_sap.h:136
OSMO_SCCP_SSN_SIWF_MAP
@ OSMO_SCCP_SSN_SIWF_MAP
Definition: sccp_sap.h:128
OSMO_SCCP_SSN_MGMT
@ OSMO_SCCP_SSN_MGMT
Definition: sccp_sap.h:108
osmo_sccp_nai
osmo_sccp_nai
Definition: sccp_sap.h:96
OSMO_SCCP_NAI_SUBSCR
@ OSMO_SCCP_NAI_SUBSCR
Definition: sccp_sap.h:98
OSMO_SCCP_NAI_INTL
@ OSMO_SCCP_NAI_INTL
Definition: sccp_sap.h:101
OSMO_SCCP_NAI_UNKNOWN
@ OSMO_SCCP_NAI_UNKNOWN
Definition: sccp_sap.h:97
OSMO_SCCP_NAI_RES_NAT_USE
@ OSMO_SCCP_NAI_RES_NAT_USE
Definition: sccp_sap.h:99
OSMO_SCCP_NAI_NATL
@ OSMO_SCCP_NAI_NATL
Definition: sccp_sap.h:100
osmo_sccp_rem_sccp_status
osmo_sccp_rem_sccp_status
Definition: sccp_sap.h:154
OSMO_SCCP_REM_SCCP_S_UNEQUIPPED
@ OSMO_SCCP_REM_SCCP_S_UNEQUIPPED
Definition: sccp_sap.h:157
OSMO_SCCP_REM_SCCP_S_CONGESTED
@ OSMO_SCCP_REM_SCCP_S_CONGESTED
Definition: sccp_sap.h:159
OSMO_SCCP_REM_SCCP_S_INACCESSIBLE
@ OSMO_SCCP_REM_SCCP_S_INACCESSIBLE
Definition: sccp_sap.h:158
OSMO_SCCP_REM_SCCP_S_AVAILABLE
@ OSMO_SCCP_REM_SCCP_S_AVAILABLE
Definition: sccp_sap.h:155
OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN
@ OSMO_SCCP_REM_SCCP_S_UNAVAILABLE_UNKNOWN
Definition: sccp_sap.h:156
osmo_sccp_local_addr_by_instance
void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, const struct osmo_sccp_instance *inst, uint32_t ssn)
derive a basic local SCCP-Address from a given SCCP instance.
Definition: sccp_instance.c:374
osmo_scu_prim_name
char * osmo_scu_prim_name(const struct osmo_prim_hdr *oph)
Definition: sccp_sap.c:53
osmo_sccp_user_name
const char * osmo_sccp_user_name(struct osmo_sccp_user *scu)
Compose a human readable string to describe the SCCP user's connection.
Definition: sccp_user.c:131
osmo_sccp_sp_status
osmo_sccp_sp_status
Definition: sccp_sap.h:141
OSMO_SCCP_SP_S_CONGESTED
@ OSMO_SCCP_SP_S_CONGESTED
Definition: sccp_sap.h:143
OSMO_SCCP_SP_S_INACCESSIBLE
@ OSMO_SCCP_SP_S_INACCESSIBLE
Definition: sccp_sap.h:142
OSMO_SCCP_SP_S_ACCESSIBLE
@ OSMO_SCCP_SP_S_ACCESSIBLE
Definition: sccp_sap.h:144
osmo_sccp_addr_cmp
int osmo_sccp_addr_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria)
Compare two SCCP addresses by given presence criteria.
Definition: sccp_instance.c:459
osmo_sccp_gti_names
const struct value_string osmo_sccp_gti_names[]
Definition: sccp_sap.c:121
osmo_sccp_user_unbind
void osmo_sccp_user_unbind(struct osmo_sccp_user *scu)
Unbind a given SCCP user.
Definition: sccp_user.c:96
osmo_sccp_instance_next_conn_id
int osmo_sccp_instance_next_conn_id(struct osmo_sccp_instance *sccp)
Definition: sccp_scoc.c:120
osmo_scu_prim_type_names
const struct value_string osmo_scu_prim_type_names[]
Definition: sccp_sap.c:35
osmo_sccp_addr_ri_cmp
int osmo_sccp_addr_ri_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b)
Compare the routing information of two SCCP addresses.
Definition: sccp_instance.c:519
sigtran_sap.h
osmo_sccp_addr
Definition: sccp_sap.h:183
osmo_sccp_addr::pc
uint32_t pc
Definition: sccp_sap.h:187
osmo_sccp_addr::ip
union osmo_sccp_addr::@19 ip
osmo_sccp_addr::v4
struct in_addr v4
Definition: sccp_sap.h:190
osmo_sccp_addr::ssn
uint32_t ssn
Definition: sccp_sap.h:188
osmo_sccp_addr::ri
enum osmo_sccp_routing_ind ri
Definition: sccp_sap.h:185
osmo_sccp_addr::gt
struct osmo_sccp_gt gt
Definition: sccp_sap.h:186
osmo_sccp_addr::presence
uint32_t presence
Definition: sccp_sap.h:184
osmo_sccp_addr::v6
struct in6_addr v6
Definition: sccp_sap.h:191
osmo_sccp_gt
Definition: sccp_sap.h:175
osmo_sccp_gt::gti
uint8_t gti
Definition: sccp_sap.h:176
osmo_sccp_gt::nai
uint32_t nai
Definition: sccp_sap.h:179
osmo_sccp_gt::npi
uint32_t npi
Definition: sccp_sap.h:178
osmo_sccp_gt::digits
char digits[32]
Definition: sccp_sap.h:180
osmo_sccp_gt::tt
uint8_t tt
Definition: sccp_sap.h:177
osmo_sccp_instance
Definition: sccp_instance.h:47
osmo_sccp_instance::ss7
struct osmo_ss7_instance * ss7
Definition: sccp_instance.h:58
osmo_sccp_instance::priv
void * priv
Definition: sccp_instance.h:59
osmo_sccp_user
Definition: sccp_user.h:12
osmo_sccp_user::inst
struct osmo_sccp_instance * inst
pointer back to SCCP instance
Definition: sccp_user.h:16
osmo_sccp_user::pc
uint32_t pc
Definition: sccp_user.h:22
osmo_sccp_user::ssn
uint16_t ssn
SSN and/or point code to which we are bound.
Definition: sccp_user.h:21
osmo_sccp_user::name
char * name
human-readable name of this user
Definition: sccp_user.h:18
osmo_sccp_user::prim_cb
osmo_prim_cb prim_cb
Definition: sccp_user.h:28
osmo_scu_connect_param
Definition: sccp_sap.h:197
osmo_scu_connect_param::calling_addr
struct osmo_sccp_addr calling_addr
Definition: sccp_sap.h:199
osmo_scu_connect_param::responding_addr
struct osmo_sccp_addr responding_addr
Definition: sccp_sap.h:200
osmo_scu_connect_param::sccp_class
uint32_t sccp_class
Definition: sccp_sap.h:202
osmo_scu_connect_param::importance
uint32_t importance
Definition: sccp_sap.h:203
osmo_scu_connect_param::called_addr
struct osmo_sccp_addr called_addr
Definition: sccp_sap.h:198
osmo_scu_connect_param::conn_id
uint32_t conn_id
Definition: sccp_sap.h:204
osmo_scu_data_param
Definition: sccp_sap.h:209
osmo_scu_data_param::importance
uint32_t importance
Definition: sccp_sap.h:211
osmo_scu_data_param::conn_id
uint32_t conn_id
Definition: sccp_sap.h:210
osmo_scu_disconn_param
Definition: sccp_sap.h:222
osmo_scu_disconn_param::conn_id
uint32_t conn_id
Definition: sccp_sap.h:226
osmo_scu_disconn_param::originator
enum osmo_sccp_originator originator
Definition: sccp_sap.h:223
osmo_scu_disconn_param::importance
uint32_t importance
Definition: sccp_sap.h:227
osmo_scu_disconn_param::responding_addr
struct osmo_sccp_addr responding_addr
Definition: sccp_sap.h:224
osmo_scu_disconn_param::cause
uint32_t cause
Definition: sccp_sap.h:225
osmo_scu_notice_param
Definition: sccp_sap.h:256
osmo_scu_notice_param::called_addr
struct osmo_sccp_addr called_addr
Definition: sccp_sap.h:257
osmo_scu_notice_param::cause
uint32_t cause
Definition: sccp_sap.h:261
osmo_scu_notice_param::importance
uint32_t importance
Definition: sccp_sap.h:262
osmo_scu_notice_param::calling_addr
struct osmo_sccp_addr calling_addr
Definition: sccp_sap.h:258
osmo_scu_pcstate_param
Definition: sccp_sap.h:275
osmo_scu_pcstate_param::restricted_importance_level
uint32_t restricted_importance_level
Definition: sccp_sap.h:277
osmo_scu_pcstate_param::remote_sccp_status
enum osmo_sccp_rem_sccp_status remote_sccp_status
Definition: sccp_sap.h:279
osmo_scu_pcstate_param::affected_pc
uint32_t affected_pc
Definition: sccp_sap.h:276
osmo_scu_pcstate_param::sp_status
enum osmo_sccp_sp_status sp_status
Definition: sccp_sap.h:278
osmo_scu_prim
Definition: sccp_sap.h:282
osmo_scu_prim::oph
struct osmo_prim_hdr oph
Definition: sccp_sap.h:283
osmo_scu_prim::notice
struct osmo_scu_notice_param notice
Definition: sccp_sap.h:290
osmo_scu_prim::unitdata
struct osmo_scu_unitdata_param unitdata
Definition: sccp_sap.h:289
osmo_scu_prim::disconnect
struct osmo_scu_disconn_param disconnect
Definition: sccp_sap.h:287
osmo_scu_prim::connect
struct osmo_scu_connect_param connect
Definition: sccp_sap.h:285
osmo_scu_prim::u
union osmo_scu_prim::@20 u
osmo_scu_prim::data
struct osmo_scu_data_param data
Definition: sccp_sap.h:286
osmo_scu_prim::pcstate
struct osmo_scu_pcstate_param pcstate
Definition: sccp_sap.h:292
osmo_scu_prim::reset
struct osmo_scu_reset_param reset
Definition: sccp_sap.h:288
osmo_scu_prim::state
struct osmo_scu_state_param state
Definition: sccp_sap.h:291
osmo_scu_reset_param
Definition: sccp_sap.h:232
osmo_scu_reset_param::conn_id
uint32_t conn_id
Definition: sccp_sap.h:235
osmo_scu_reset_param::cause
uint32_t cause
Definition: sccp_sap.h:234
osmo_scu_reset_param::originator
enum osmo_sccp_originator originator
Definition: sccp_sap.h:233
osmo_scu_state_param
Definition: sccp_sap.h:267
osmo_scu_state_param::ssn_multiplicity_ind
uint32_t ssn_multiplicity_ind
Definition: sccp_sap.h:271
osmo_scu_state_param::affected_ssn
uint32_t affected_ssn
Definition: sccp_sap.h:269
osmo_scu_state_param::user_in_service
bool user_in_service
Definition: sccp_sap.h:270
osmo_scu_state_param::affected_pc
uint32_t affected_pc
Definition: sccp_sap.h:268
osmo_scu_unitdata_param
Definition: sccp_sap.h:246
osmo_scu_unitdata_param::return_option
uint32_t return_option
Definition: sccp_sap.h:250
osmo_scu_unitdata_param::in_sequence_control
uint32_t in_sequence_control
Definition: sccp_sap.h:249
osmo_scu_unitdata_param::called_addr
struct osmo_sccp_addr called_addr
Definition: sccp_sap.h:247
osmo_scu_unitdata_param::calling_addr
struct osmo_sccp_addr calling_addr
Definition: sccp_sap.h:248
osmo_scu_unitdata_param::importance
uint32_t importance
Definition: sccp_sap.h:251
osmo_ss7_instance
Definition: ss7_instance.h:21
osmo_ss7_instance::sccp
struct osmo_sccp_instance * sccp
Definition: ss7_instance.h:40
osmo_ss7_instance::name
char * name
Definition: ss7_instance.h:44