libosmo-sigtran 2.1.0.187-fd10 Osmocom SIGTRAN library

osmo_ss7.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5
6#include <osmocom/core/linuxlist.h>
7#include <osmocom/core/utils.h>
8#include <osmocom/core/fsm.h>
9#include <osmocom/core/msgb.h>
10#include <osmocom/core/prim.h>
11#include <osmocom/core/socket.h>
12#include <osmocom/core/rate_ctr.h>
13
14/* Maximum number of supported RCTXs present in RFC4666 Routing Context IE. */
15#define OSMO_SS7_MAX_RCTX_COUNT 128
16
17 struct osmo_ss7_instance;
18
19 extern struct llist_head osmo_ss7_instances;
20/* Get an entry pointer from a list item in osmo_ss7_instances: */
21 struct osmo_ss7_instance *osmo_ss7_instances_llist_entry(struct llist_head *list);
22
23 int osmo_ss7_init(void);
24
25/* All known point-code formats have a length of or below 24 bit.
26 * A point-code value exceeding that is used to indicate an unset PC. */
27#define OSMO_SS7_PC_INVALID 0xffffffff
28 static inline bool osmo_ss7_pc_is_valid(uint32_t pc)
29{
30 return pc <= 0x00ffffff;
31}
32
33/***********************************************************************
34 * xUA Servers
35 ***********************************************************************/
36
37 struct osmo_xua_layer_manager;
38
39 struct osmo_xua_server;
40
41/***********************************************************************
42 * SS7 Instances
43 ***********************************************************************/
44
45 struct osmo_ss7_pc_fmt;
46 struct osmo_ss7_instance;
47
48 struct osmo_ss7_instance *osmo_ss7_instance_find(uint32_t id);
49 struct osmo_ss7_instance *
50 osmo_ss7_instance_find_or_create(void *ctx, uint32_t id);
51 void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst);
52
53uint32_t osmo_ss7_instance_get_id(const struct osmo_ss7_instance *inst);
54 const char *osmo_ss7_instance_get_name(const struct osmo_ss7_instance *inst);
55
56 int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst,
57 uint8_t c0, uint8_t c1, uint8_t c2);
58 const struct osmo_ss7_pc_fmt *
59 osmo_ss7_instance_get_pc_fmt(const struct osmo_ss7_instance *inst);
60
61uint32_t osmo_ss7_instance_get_primary_pc(const struct osmo_ss7_instance *inst);
62uint8_t osmo_ss7_instance_get_network_indicator(const struct osmo_ss7_instance *inst);
63
64 struct osmo_sccp_instance *osmo_ss7_ensure_sccp(struct osmo_ss7_instance *inst);
65 struct osmo_sccp_instance *osmo_ss7_get_sccp(const struct osmo_ss7_instance *inst);
66
67 int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst);
68
69 bool osmo_ss7_pc_is_local(const struct osmo_ss7_instance *inst, uint32_t pc);
70 int osmo_ss7_pointcode_parse(const struct osmo_ss7_instance *inst, const char *str);
71 int osmo_ss7_pointcode_parse_mask_or_len(const struct osmo_ss7_instance *inst, const char *in);
72 const char *osmo_ss7_pointcode_print_buf(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, uint32_t pc);
73 const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc);
74 const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc);
75
76uint8_t osmo_ss7_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt);
77uint32_t osmo_ss7_pc_normalize(const struct osmo_ss7_pc_fmt *pc_fmt, uint32_t pc);
78
79/***********************************************************************
80 * MTP Users (Users of MTP, such as SCCP or ISUP)
81 ***********************************************************************/
82
83 struct osmo_ss7_user;
84 struct osmo_mtp_prim;
85
86
87 struct osmo_ss7_user *osmo_ss7_user_create(struct osmo_ss7_instance *inst, const char *name);
88 void osmo_ss7_user_destroy(struct osmo_ss7_user *user);
89
90 struct osmo_ss7_instance *osmo_ss7_user_get_instance(const struct osmo_ss7_user *user);
91 void osmo_ss7_user_set_prim_cb(struct osmo_ss7_user *user, osmo_prim_cb prim_cb);
92 void osmo_ss7_user_set_priv(struct osmo_ss7_user *user, void *priv);
93 void *osmo_ss7_user_get_priv(const struct osmo_ss7_user *user);
94
95 int osmo_ss7_user_register(struct osmo_ss7_user *user, uint8_t service_ind);
96 int osmo_ss7_user_unregister(struct osmo_ss7_user *user, uint8_t service_ind);
97
98
99/* MTP User wants to submit a primitive down to MTP SAP */
100 int osmo_ss7_user_mtp_sap_prim_down(struct osmo_ss7_user *user,
101 struct osmo_mtp_prim *omp);
102
103/***********************************************************************
104 * SCCP Instance
105 ***********************************************************************/
106
107 struct osmo_sccp_instance;
108
109 void osmo_sccp_set_max_optional_data(struct osmo_sccp_instance *inst, int val);
110
111/***********************************************************************
112 * SS7 Links
113 ***********************************************************************/
114
115 struct osmo_ss7_link;
116
117/***********************************************************************
118 * SS7 Linksets
119 ***********************************************************************/
120
121 struct osmo_ss7_linkset;
122
123/***********************************************************************
124 * SS7 Routes
125 ***********************************************************************/
126
127 struct osmo_ss7_route;
128
129 struct osmo_ss7_route *
130 osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc)
131 OSMO_DEPRECATED("Use internal ss7_instance_lookup_route() instead");
132 const char *osmo_ss7_route_print(const struct osmo_ss7_route *rt);
133 const char *osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps);
134 struct osmo_ss7_as *
135 osmo_ss7_route_get_dest_as(struct osmo_ss7_route *rt);
136
137/***********************************************************************
138 * SS7 Routing key
139 ***********************************************************************/
140
141 struct osmo_ss7_routing_key {
142 uint32_t context;
143 uint32_t l_rk_id;
144
145 uint32_t pc;
146 uint8_t si;
147 uint32_t ssn;
148 /* FIXME: more complex routing keys */
149};
150
151
152/***********************************************************************
153 * SS7 ASP Protocols
154 ***********************************************************************/
155
156 enum osmo_ss7_asp_protocol {
157 OSMO_SS7_ASP_PROT_NONE,
158 OSMO_SS7_ASP_PROT_SUA,
159 OSMO_SS7_ASP_PROT_M3UA,
160 OSMO_SS7_ASP_PROT_IPA,
161 _NUM_OSMO_SS7_ASP_PROT
162};
163
164 extern struct value_string osmo_ss7_asp_protocol_vals[];
165 static inline const char *
166 osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
167{
168 return get_value_string(osmo_ss7_asp_protocol_vals, mode);
169}
170
171 int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot);
172
173
174/***********************************************************************
175 * SS7 AS Traffic Mode
176 ***********************************************************************/
177
178 /* Traffic mode implementations which can be configured on an AS, either by
179 * peer (eg. RFC4666 M3UA "Traffic Mode Type") or locally through VTY.
180 * Note: This is related but not exactly RFC4666 M3UA "Traffic Mode Type" (enum
181 * m3ua_traffic_mode). */
182 enum osmo_ss7_as_traffic_mode {
183 /* RFC4666 M3UA "Traffic Mode Type" "Override". Default traffic mode: */
184 OSMO_SS7_AS_TMOD_OVERRIDE = 0,
185 /* RFC4666 M3UA "Traffic Mode Type" "Broadcast": */
186 OSMO_SS7_AS_TMOD_BCAST,
187 /* RFC4666 M3UA "Traffic Mode Type" "Loadshare",
188 * traffic distribution based on OPC+SLS: */
189 OSMO_SS7_AS_TMOD_LOADSHARE,
190 /* RFC4666 M3UA "Traffic Mode Type" "Loadshare",
191 * traffic distribution implemented as round-robin: */
192 OSMO_SS7_AS_TMOD_ROUNDROBIN,
193 _NUM_OSMO_SS7_ASP_TMOD
194};
195
196 extern struct value_string osmo_ss7_as_traffic_mode_vals[];
197
198 static inline const char *
199 osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
200{
201 return get_value_string(osmo_ss7_as_traffic_mode_vals, mode);
202}
203
204 enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in);
205 int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod);
206
207
208/***********************************************************************
209 * SS7 Application Servers
210 ***********************************************************************/
211
212 struct osmo_ss7_as;
213 struct osmo_ss7_asp;
214
215 struct osmo_ss7_as *
216 osmo_ss7_as_find_by_name(struct osmo_ss7_instance *inst, const char *name);
217 struct osmo_ss7_as *
218 osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx);
219 struct osmo_ss7_as *
220 osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id);
221 struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst,
222 enum osmo_ss7_asp_protocol proto);
223 struct osmo_ss7_as *
224 osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name,
225 enum osmo_ss7_asp_protocol proto);
226 enum osmo_ss7_asp_protocol osmo_ss7_as_get_asp_protocol(const struct osmo_ss7_as *as);
227 int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name);
228 int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name);
229 void osmo_ss7_as_destroy(struct osmo_ss7_as *as);
230 bool osmo_ss7_as_has_asp(const struct osmo_ss7_as *as,
231 const struct osmo_ss7_asp *asp);
232 struct osmo_ss7_asp *osmo_ss7_as_select_asp(struct osmo_ss7_as *as);
233 bool osmo_ss7_as_down(const struct osmo_ss7_as *as);
234 bool osmo_ss7_as_active(const struct osmo_ss7_as *as);
235 bool osmo_ss7_as_tmode_compatible_xua(struct osmo_ss7_as *as, uint32_t m3ua_tmt);
236
237
238/***********************************************************************
239 * SS7 Application Server Processes
240 ***********************************************************************/
241
242 enum osmo_ss7_asp_admin_state {
244 OSMO_SS7_ASP_ADM_S_SHUTDOWN,
246 OSMO_SS7_ASP_ADM_S_BLOCKED,
248 OSMO_SS7_ASP_ADM_S_ENABLED,
249};
250 extern const struct value_string osmo_ss7_asp_admin_state_names[];
251
252 enum osmo_ss7_asp_role {
253 OSMO_SS7_ASP_ROLE_ASP,
254 OSMO_SS7_ASP_ROLE_SG,
255 OSMO_SS7_ASP_ROLE_IPSP,
256};
257
258 extern const struct value_string osmo_ss7_asp_role_names[];
259
260 struct osmo_ss7_asp;
261
263#define OSMO_SS7_ASP_QUIRK_NO_NOTIFY 0x00000001
265#define OSMO_SS7_ASP_QUIRK_DAUD_IN_ASP 0x00000002
267#define OSMO_SS7_ASP_QUIRK_SNM_INACTIVE 0x00000004
268
269
270 struct osmo_ss7_asp *
271 osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name);
272 struct osmo_ss7_asp *
273 osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as,
274 enum osmo_ss7_asp_protocol proto);
275 struct osmo_ss7_asp *
276 osmo_ss7_asp_find(struct osmo_ss7_instance *inst, const char *name,
277 uint16_t remote_port, uint16_t local_port,
278 enum osmo_ss7_asp_protocol proto)
279 OSMO_DEPRECATED("Use osmo_ss7_asp_find2() instead");
280 struct osmo_ss7_asp *
281 osmo_ss7_asp_find2(struct osmo_ss7_instance *inst, const char *name,
282 uint16_t remote_port, uint16_t local_port,
283 int trans_proto, enum osmo_ss7_asp_protocol proto);
284 struct osmo_ss7_asp *
285 osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
286 uint16_t remote_port, uint16_t local_port,
287 enum osmo_ss7_asp_protocol proto)
288 OSMO_DEPRECATED("Use osmo_ss7_asp_find_or_create2() instead");
289 struct osmo_ss7_asp *
290 osmo_ss7_asp_find_or_create2(struct osmo_ss7_instance *inst, const char *name,
291 uint16_t remote_port, uint16_t local_port,
292 int trans_proto, enum osmo_ss7_asp_protocol proto);
293 void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp);
294 void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp);
295 int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg);
296 int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);
297 int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);
298 bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp);
299 int osmo_ss7_asp_get_log_subsys(const struct osmo_ss7_asp *asp);
300 const char *osmo_ss7_asp_get_name(const struct osmo_ss7_asp *asp);
301 enum osmo_ss7_asp_protocol osmo_ss7_asp_get_proto(const struct osmo_ss7_asp *asp);
302 int osmo_ss7_asp_get_trans_proto(const struct osmo_ss7_asp *asp);
303
311 typedef int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg);
312
313 void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb);
314
315
316/***********************************************************************
317 * Simple Client
318 ***********************************************************************/
319
320 struct osmo_sccp_instance *
321 osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
322 enum osmo_ss7_asp_protocol prot, int default_local_port,
323 const char *default_local_ip, int default_remote_port,
324 const char *default_remote_ip);
325
326 struct osmo_sccp_instance *
327 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
328 uint32_t default_pc,
329 enum osmo_ss7_asp_protocol prot,
330 int default_local_port,
331 const char *default_local_ip,
332 int default_remote_port,
333 const char *default_remote_ip);
334
335/***********************************************************************
336 * Simple Server
337 ***********************************************************************/
338
339 struct osmo_sccp_instance *
340 osmo_sccp_simple_server(void *ctx, uint32_t pc,
341 enum osmo_ss7_asp_protocol prot, int local_port,
342 const char *local_ip);
343
344 struct osmo_sccp_instance *
345 osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc,
346 enum osmo_ss7_asp_protocol prot,
347 int local_port, const char *local_ip);
348
349 struct osmo_sccp_instance *
350 osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst,
351 enum osmo_ss7_asp_protocol prot,
352 const char *name, uint32_t pc,
353 int local_port, int remote_port,
354 const char *remote_ip);
355
356/* VTY related */
357 struct vty;
358 void osmo_ss7_vty_init_asp(void *ctx);
359 void osmo_ss7_vty_init_sg(void *ctx);
360 int osmo_ss7_vty_go_parent(struct vty *vty);
361 int osmo_ss7_is_config_node(struct vty *vty, int node)
362 OSMO_DEPRECATED("Implicit parent node tracking has replaced the use of this callback. "
363 "This callback is no longer called, ever, and can be left NULL.");
dpc
uint32_t dpc
Definition: m3ua.h:1
osmo_ss7_route_get_dest_as
struct osmo_ss7_as * osmo_ss7_route_get_dest_as(struct osmo_ss7_route *rt)
Get destination AS of route.
Definition: ss7_route.c:377
osmo_ss7_as_add_asp
int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name)
Add given ASP to given AS.
Definition: ss7_as.c:181
osmo_ss7_as_find_by_name
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: ss7_instance.c:250
osmo_ss7_pointcode_parse_mask_or_len
int osmo_ss7_pointcode_parse_mask_or_len(const struct osmo_ss7_instance *inst, const char *in)
Definition: ss7_instance.c:623
osmo_sccp_set_max_optional_data
void osmo_sccp_set_max_optional_data(struct osmo_sccp_instance *inst, int val)
Adjust the upper bound for the optional data length (the payload) for CR, CC, CREF and RLSD messages.
Definition: sccp_instance.c:974
osmo_ss7_pc_is_local
bool osmo_ss7_pc_is_local(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: ss7_instance.c:199
osmo_ss7_asp_get_trans_proto
int osmo_ss7_asp_get_trans_proto(const struct osmo_ss7_asp *asp)
Get the transport proto of a given ASP.
Definition: ss7_asp.c:1503
osmo_ss7_user_get_priv
void * osmo_ss7_user_get_priv(const struct osmo_ss7_user *user)
Definition: ss7_user.c:79
osmo_ss7_vty_init_sg
void osmo_ss7_vty_init_sg(void *ctx)
Definition: ss7_vty.c:1480
osmo_ss7_instance_get_primary_pc
uint32_t osmo_ss7_instance_get_primary_pc(const struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:143
osmo_ss7_pc_is_valid
static bool osmo_ss7_pc_is_valid(uint32_t pc)
Definition: osmo_ss7.h:28
osmo_ss7_route_name
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: ss7_route.c:297
osmo_ss7_user_create
struct osmo_ss7_user * osmo_ss7_user_create(struct osmo_ss7_instance *inst, const char *name)
Definition: ss7_user.c:39
osmo_ss7_pointcode_parse
int osmo_ss7_pointcode_parse(const struct osmo_ss7_instance *inst, const char *str)
Definition: ss7_instance.c:551
osmo_sccp_simple_client_on_ss7_id
struct osmo_sccp_instance * osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip)
request an sccp client instance
Definition: sccp_instance.c:590
osmo_ss7_instance_get_id
uint32_t osmo_ss7_instance_get_id(const struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:133
osmo_ss7_as_find_by_proto
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: ss7_instance.c:302
osmo_ss7_asp_find_by_name
struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Definition: ss7_instance.c:362
osmo_ss7_user_register
int osmo_ss7_user_register(struct osmo_ss7_user *user, uint8_t service_ind)
Register a MTP user for a given service indicator.
Definition: ss7_user.c:88
osmo_ss7_asp_protocol
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:156
OSMO_SS7_ASP_PROT_SUA
@ OSMO_SS7_ASP_PROT_SUA
Definition: osmo_ss7.h:158
OSMO_SS7_ASP_PROT_NONE
@ OSMO_SS7_ASP_PROT_NONE
Definition: osmo_ss7.h:157
OSMO_SS7_ASP_PROT_IPA
@ OSMO_SS7_ASP_PROT_IPA
Definition: osmo_ss7.h:160
OSMO_SS7_ASP_PROT_M3UA
@ OSMO_SS7_ASP_PROT_M3UA
Definition: osmo_ss7.h:159
_NUM_OSMO_SS7_ASP_PROT
@ _NUM_OSMO_SS7_ASP_PROT
Definition: osmo_ss7.h:161
osmo_ss7_asp_protocol_vals
struct value_string osmo_ss7_asp_protocol_vals[]
Definition: ss7_asp.c:142
osmo_ss7_as_traffic_mode_vals
struct value_string osmo_ss7_as_traffic_mode_vals[]
Definition: ss7_as.c:51
osmo_ss7_tmode_to_xua
int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod)
Definition: ss7.c:196
osmo_ss7_as_find_by_l_rk_id
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: ss7_instance.c:284
osmo_ss7_asp_get_proto
enum osmo_ss7_asp_protocol osmo_ss7_asp_get_proto(const struct osmo_ss7_asp *asp)
Get the proto of a given ASP.
Definition: ss7_asp.c:1494
osmo_ss7_as_select_asp
struct osmo_ss7_asp * osmo_ss7_as_select_asp(struct osmo_ss7_as *as)
Select an AS to transmit a message, according to AS configuration and ASP availability.
Definition: ss7_as.c:555
osmo_ss7_asp_role
osmo_ss7_asp_role
Definition: osmo_ss7.h:252
OSMO_SS7_ASP_ROLE_SG
@ OSMO_SS7_ASP_ROLE_SG
Definition: osmo_ss7.h:254
OSMO_SS7_ASP_ROLE_ASP
@ OSMO_SS7_ASP_ROLE_ASP
Definition: osmo_ss7.h:253
OSMO_SS7_ASP_ROLE_IPSP
@ OSMO_SS7_ASP_ROLE_IPSP
Definition: osmo_ss7.h:255
osmo_ss7_asp_send
int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
send a fully encoded msgb via a given ASP
Definition: ss7_asp.c:1383
osmo_ss7_user_get_instance
struct osmo_ss7_instance * osmo_ss7_user_get_instance(const struct osmo_ss7_user *user)
Definition: ss7_user.c:64
osmo_ss7_instance_destroy
void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst)
Destroy a SS7 Instance.
Definition: ss7_instance.c:109
osmo_ss7_route_print
const char * osmo_ss7_route_print(const struct osmo_ss7_route *rt)
Definition: ss7_route.c:272
osmo_ss7_user_set_priv
void osmo_ss7_user_set_priv(struct osmo_ss7_user *user, void *priv)
Definition: ss7_user.c:74
osmo_ss7_get_sccp
struct osmo_sccp_instance * osmo_ss7_get_sccp(const struct osmo_ss7_instance *inst)
Get the SCCP instance, if present.
Definition: ss7_instance.c:194
osmo_sccp_simple_server_on_ss7_id
struct osmo_sccp_instance * osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip)
Definition: sccp_instance.c:841
osmo_ss7_asp_rx_unknown_cb
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:311
osmo_ss7_asp_role_names
const struct value_string osmo_ss7_asp_role_names[]
Definition: ss7_asp.c:157
osmo_ss7_as_find_by_rctx
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: ss7_instance.c:267
osmo_ss7_asp_admin_state
osmo_ss7_asp_admin_state
Definition: osmo_ss7.h:242
OSMO_SS7_ASP_ADM_S_SHUTDOWN
@ OSMO_SS7_ASP_ADM_S_SHUTDOWN
no SCTP association with peer
Definition: osmo_ss7.h:244
OSMO_SS7_ASP_ADM_S_BLOCKED
@ OSMO_SS7_ASP_ADM_S_BLOCKED
SCP association, but reject ASP-ACTIVE.
Definition: osmo_ss7.h:246
OSMO_SS7_ASP_ADM_S_ENABLED
@ OSMO_SS7_ASP_ADM_S_ENABLED
in normal operation
Definition: osmo_ss7.h:248
osmo_ss7_pc_normalize
uint32_t osmo_ss7_pc_normalize(const struct osmo_ss7_pc_fmt *pc_fmt, uint32_t pc)
Definition: ss7.c:102
osmo_ss7_asp_protocol_port
int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot)
Definition: ss7_asp.c:208
osmo_ss7_asp_find2
struct osmo_ss7_asp * osmo_ss7_asp_find2(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, int trans_proto, enum osmo_ss7_asp_protocol proto)
Definition: ss7_instance.c:393
osmo_ss7_as_active
bool osmo_ss7_as_active(const struct osmo_ss7_as *as)
Determine if given AS is in the active state.
Definition: ss7_as.c:302
osmo_ss7_asp_destroy
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp)
Definition: ss7_asp.c:746
osmo_ss7_ensure_sccp
struct osmo_sccp_instance * osmo_ss7_ensure_sccp(struct osmo_ss7_instance *inst)
Allocate an SCCP instance, if not present yet.
Definition: ss7_instance.c:180
osmo_ss7_as_down
bool osmo_ss7_as_down(const struct osmo_ss7_as *as)
Determine if given AS is in the down state.
Definition: ss7_as.c:312
osmo_ss7_as_traffic_mode
osmo_ss7_as_traffic_mode
Definition: osmo_ss7.h:182
OSMO_SS7_AS_TMOD_OVERRIDE
@ OSMO_SS7_AS_TMOD_OVERRIDE
Definition: osmo_ss7.h:184
_NUM_OSMO_SS7_ASP_TMOD
@ _NUM_OSMO_SS7_ASP_TMOD
Definition: osmo_ss7.h:193
OSMO_SS7_AS_TMOD_ROUNDROBIN
@ OSMO_SS7_AS_TMOD_ROUNDROBIN
Definition: osmo_ss7.h:192
OSMO_SS7_AS_TMOD_BCAST
@ OSMO_SS7_AS_TMOD_BCAST
Definition: osmo_ss7.h:186
OSMO_SS7_AS_TMOD_LOADSHARE
@ OSMO_SS7_AS_TMOD_LOADSHARE
Definition: osmo_ss7.h:189
osmo_ss7_asp_find_or_create
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) OSMO_DEPRECATED("Use osmo_ss7_asp_find_or_create2() instead")
Definition: ss7_instance.c:449
osmo_sccp_simple_server_add_clnt
struct osmo_sccp_instance * osmo_sccp_simple_server_add_clnt(struct osmo_sccp_instance *inst, enum osmo_ss7_asp_protocol prot, const char *name, uint32_t pc, int local_port, int remote_port, const char *remote_ip)
Definition: sccp_instance.c:894
osmo_ss7_asp_active
bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp)
Definition: ss7_asp.c:952
osmo_ss7_user_unregister
int osmo_ss7_user_unregister(struct osmo_ss7_user *user, uint8_t service_ind)
Unregister a MTP user for a given service indicator.
Definition: ss7_user.c:110
osmo_ss7_instances
struct llist_head osmo_ss7_instances
osmo_ss7_asp_restart
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp)
Definition: ss7_asp.c:886
osmo_ss7_instance_find_or_create
struct osmo_ss7_instance * osmo_ss7_instance_find_or_create(void *ctx, uint32_t id)
Find or create a SS7 Instance.
Definition: ss7.c:132
osmo_ss7_pointcode_print2
const char * osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: ss7_instance.c:617
osmo_ss7_pc_width
uint8_t osmo_ss7_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt)
Definition: ss7.c:88
osmo_ss7_pointcode_print_buf
const char * osmo_ss7_pointcode_print_buf(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: ss7_instance.c:585
osmo_ss7_init
int osmo_ss7_init(void)
Definition: ss7.c:170
osmo_ss7_register_rx_unknown_cb
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: ss7_asp.c:1442
osmo_ss7_is_config_node
int osmo_ss7_is_config_node(struct vty *vty, int node) OSMO_DEPRECATED("Implicit parent node tracking has replaced the use of this callback. " "This callback is no longer called
osmo_ss7_user_set_prim_cb
void osmo_ss7_user_set_prim_cb(struct osmo_ss7_user *user, osmo_prim_cb prim_cb)
Definition: ss7_user.c:69
osmo_ss7_user_destroy
void osmo_ss7_user_destroy(struct osmo_ss7_user *user)
Definition: ss7_user.c:51
osmo_ss7_instance_get_network_indicator
uint8_t osmo_ss7_instance_get_network_indicator(const struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:149
osmo_ss7_as_get_asp_protocol
enum osmo_ss7_asp_protocol osmo_ss7_as_get_asp_protocol(const struct osmo_ss7_as *as)
Get asp_protocol configuration of a given AS.
Definition: ss7_as.c:145
osmo_ss7_route_lookup
struct osmo_ss7_route * osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc) OSMO_DEPRECATED("Use internal ss7_instance_lookup_route() instead")
Find a SS7 route for given destination point code in given SS7.
Definition: ss7_route.c:360
osmo_ss7_instance_get_pc_fmt
const struct osmo_ss7_pc_fmt * osmo_ss7_instance_get_pc_fmt(const struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:173
osmo_ss7_asp_find_or_create2
struct osmo_ss7_asp * osmo_ss7_asp_find_or_create2(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, int trans_proto, enum osmo_ss7_asp_protocol proto)
Definition: ss7_instance.c:427
osmo_sccp_simple_server
struct osmo_sccp_instance * osmo_sccp_simple_server(void *ctx, uint32_t pc, enum osmo_ss7_asp_protocol prot, int local_port, const char *local_ip)
Definition: sccp_instance.c:885
osmo_sccp_simple_client
struct osmo_sccp_instance * osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc, enum osmo_ss7_asp_protocol prot, int default_local_port, const char *default_local_ip, int default_remote_port, const char *default_remote_ip)
request an sccp client instance
Definition: sccp_instance.c:820
osmo_ss7_vty_go_parent
int osmo_ss7_vty_go_parent(struct vty *vty)
Definition: ss7_vty.c:1354
osmo_ss7_as_has_asp
bool osmo_ss7_as_has_asp(const struct osmo_ss7_as *as, const struct osmo_ss7_asp *asp)
Determine if given AS contains ASP.
Definition: ss7_as.c:250
osmo_ss7_asp_protocol_name
static const char * osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
Definition: osmo_ss7.h:166
osmo_ss7_instance_find
struct osmo_ss7_instance * osmo_ss7_instance_find(uint32_t id)
Find a SS7 Instance with given ID.
Definition: ss7.c:115
osmo_ss7_as_del_asp
int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name)
Delete given ASP from given AS.
Definition: ss7_as.c:197
osmo_ss7_asp_admin_state_names
const struct value_string osmo_ss7_asp_admin_state_names[]
Definition: ss7_asp.c:150
osmo_ss7_pointcode_print
const char * osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: ss7_instance.c:609
osmo_ss7_asp_find_by_proto
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 ASP protocol (xUA variant).
Definition: ss7_instance.c:379
osmo_ss7_user_mtp_sap_prim_down
int osmo_ss7_user_mtp_sap_prim_down(struct osmo_ss7_user *user, struct osmo_mtp_prim *omp)
Definition: mtp_sap.c:214
osmo_ss7_find_free_rctx
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:210
osmo_ss7_as_traffic_mode_name
static const char * osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
Definition: osmo_ss7.h:199
osmo_ss7_asp_get_name
const char * osmo_ss7_asp_get_name(const struct osmo_ss7_asp *asp)
Get the name of a given ASP.
Definition: ss7_asp.c:1485
osmo_ss7_instance_set_pc_fmt
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: ss7_instance.c:155
osmo_ss7_as_find_or_create
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: ss7_instance.c:336
osmo_ss7_as_tmode_compatible_xua
bool osmo_ss7_as_tmode_compatible_xua(struct osmo_ss7_as *as, uint32_t m3ua_tmt)
Definition: ss7_as.c:587
osmo_ss7_asp_find
struct osmo_ss7_asp * osmo_ss7_asp_find(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto) OSMO_DEPRECATED("Use osmo_ss7_asp_find2() instead")
Definition: ss7_instance.c:415
osmo_ss7_asp_get_log_subsys
int osmo_ss7_asp_get_log_subsys(const struct osmo_ss7_asp *asp)
Get the logging subsystem for a given ASP.
Definition: ss7_asp.c:1469
osmo_ss7_asp_disconnect
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp)
Definition: ss7_asp.c:1430
osmo_ss7_tmode_from_xua
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in)
Definition: ss7.c:213
osmo_ss7_asp_use_default_lm
int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level)
Definition: xua_default_lm_fsm.c:427
osmo_ss7_vty_init_asp
void osmo_ss7_vty_init_asp(void *ctx)
Definition: ss7_vty.c:1474
osmo_ss7_instance_get_name
const char * osmo_ss7_instance_get_name(const struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:138
osmo_ss7_instances_llist_entry
struct osmo_ss7_instance * osmo_ss7_instances_llist_entry(struct llist_head *list)
Definition: ss7.c:69
osmo_ss7_as_destroy
void osmo_ss7_as_destroy(struct osmo_ss7_as *as)
Destroy given Application Server.
Definition: ss7_as.c:229
osmo_mtp_prim
Definition: mtp_sap.h:64
osmo_sccp_instance
Definition: sccp_instance.h:47
osmo_ss7_as
Definition: ss7_as.h:75
osmo_ss7_as::name
char * name
Definition: ss7_as.h:96
osmo_ss7_as::proto
enum osmo_ss7_asp_protocol proto
Definition: ss7_as.h:98
osmo_ss7_as::inst
struct osmo_ss7_instance * inst
Definition: ss7_as.h:78
osmo_ss7_asp
Definition: ss7_asp.h:43
osmo_ss7_asp::proto
enum osmo_ss7_asp_protocol proto
Definition: ss7_asp.h:99
osmo_ss7_asp::inst
struct osmo_ss7_instance * inst
Definition: ss7_asp.h:46
osmo_ss7_asp::name
char * name
Definition: ss7_asp.h:97
osmo_ss7_asp::trans_proto
int trans_proto
The underlaying transport protocol (one of IPPROTO_*)
Definition: ss7_asp.h:150
osmo_ss7_instance
Definition: ss7_instance.h:31
osmo_ss7_instance::user
struct osmo_ss7_user * user[16]
Definition: ss7_instance.h:46
osmo_ss7_instance::list
struct llist_head list
member of global list of instances
Definition: ss7_instance.h:33
osmo_ss7_link
Definition: ss7_link.h:19
osmo_ss7_linkset
Definition: ss7_linkset.h:13
osmo_ss7_pc_fmt
Definition: ss7_instance.h:26
osmo_ss7_route
Definition: ss7_route.h:28
osmo_ss7_routing_key
Definition: osmo_ss7.h:141
osmo_ss7_routing_key::si
uint8_t si
Definition: osmo_ss7.h:146
osmo_ss7_routing_key::context
uint32_t context
Definition: osmo_ss7.h:142
osmo_ss7_routing_key::l_rk_id
uint32_t l_rk_id
Definition: osmo_ss7.h:143
osmo_ss7_routing_key::ssn
uint32_t ssn
Definition: osmo_ss7.h:147
osmo_ss7_routing_key::pc
uint32_t pc
Definition: osmo_ss7.h:145
osmo_ss7_user
Definition: ss7_user.h:15
osmo_ss7_user::name
const char * name
Definition: ss7_user.h:19
osmo_ss7_user::inst
struct osmo_ss7_instance * inst
Definition: ss7_user.h:17
osmo_xua_layer_manager
Definition: ss7_xua_srv.h:18
osmo_xua_server
Definition: ss7_xua_srv.h:22