libosmo-sigtran  1.0.0.8-99be
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 
12 extern struct llist_head osmo_ss7_instances;
13 
14 struct osmo_ss7_instance;
15 struct osmo_ss7_user;
16 struct osmo_sccp_instance;
17 struct osmo_mtp_prim;
19 
20 int osmo_ss7_init(void);
22 
23 bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc);
24 int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str);
25 int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in);
26 const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc);
27 const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc);
28 
29 /* All known point-code formats have a length of or below 24 bit.
30  * A point-code value exceeding that is used to indicate an unset PC. */
31 #define OSMO_SS7_PC_INVALID 0xffffffff
32 static inline bool osmo_ss7_pc_is_valid(uint32_t pc)
33 {
34  return pc <= 0x00ffffff;
35 }
36 
37 /***********************************************************************
38  * SS7 Routing Tables
39  ***********************************************************************/
40 
43  struct llist_head list;
47  struct llist_head routes;
48 
49  struct {
50  char *name;
51  char *description;
52  } cfg;
53 };
54 
55 struct osmo_ss7_route_table *
57 struct osmo_ss7_route_table *
60 
61 /***********************************************************************
62  * SS7 Instances
63  ***********************************************************************/
64 
66  char delimiter;
67  uint8_t component_len[3];
68 };
69 
72  struct llist_head list;
74  struct llist_head linksets;
76  struct llist_head as_list;
78  struct llist_head asp_list;
80  struct llist_head rtable_list;
82  struct llist_head xua_servers;
83  /* array for faster lookup of user (indexed by service
84  * indicator) */
85  const struct osmo_ss7_user *user[16];
86 
88 
90 
91  struct {
92  uint32_t id;
93  char *name;
94  char *description;
95  uint32_t primary_pc;
96  /* secondary PCs */
97  /* capability PCs */
99  struct osmo_ss7_pc_fmt pc_fmt;
101  struct llist_head sccp_address_book;
102  } cfg;
103 };
104 
105 struct osmo_ss7_instance *osmo_ss7_instance_find(uint32_t id);
106 struct osmo_ss7_instance *
107 osmo_ss7_instance_find_or_create(void *ctx, uint32_t id);
110  uint8_t c0, uint8_t c1, uint8_t c2);
113 
115 
116 uint8_t osmo_ss7_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt);
117 
118 /***********************************************************************
119  * MTP Users (Users of MTP, such as SCCP or ISUP)
120  ***********************************************************************/
121 
123  /* pointer back to SS7 instance */
125  /* name of the user */
126  const char *name;
127  /* primitive call-back for incoming MTP primitives */
128  osmo_prim_cb prim_cb;
129  /* private data */
130  void *priv;
131 };
132 
133 int osmo_ss7_user_register(struct osmo_ss7_instance *inst, uint8_t service_ind,
134  struct osmo_ss7_user *user);
135 
136 int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind,
137  struct osmo_ss7_user *user);
138 
139 int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp);
140 
141 /* SS7 User wants to issue MTP-TRANSFER.req */
143  struct osmo_mtp_prim *omp);
144 
145 /***********************************************************************
146  * SS7 Links
147  ***********************************************************************/
148 
154 };
155 
156 struct osmo_ss7_linkset;
157 struct osmo_ss7_link;
158 
162  struct {
163  char *name;
164  char *description;
165  uint32_t id;
166 
167  enum osmo_ss7_link_adm_state adm_state;
168  } cfg;
169 };
170 
171 void osmo_ss7_link_destroy(struct osmo_ss7_link *link);
172 struct osmo_ss7_link *
173 osmo_ss7_link_find_or_create(struct osmo_ss7_linkset *lset, uint32_t id);
174 
175 /***********************************************************************
176  * SS7 Linksets
177  ***********************************************************************/
178 
180  struct llist_head list;
184  struct osmo_ss7_link *links[16];
185 
186  struct {
187  char *name;
188  char *description;
189  uint32_t adjacent_pc;
190  uint32_t local_pc;
191  } cfg;
192 };
193 
194 void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset);
195 struct osmo_ss7_linkset *
197 struct osmo_ss7_linkset *
198 osmo_ss7_linkset_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint32_t pc);
199 
200 
201 /***********************************************************************
202  * SS7 Routes
203  ***********************************************************************/
204 
207  struct llist_head list;
210 
211  struct {
215  struct osmo_ss7_as *as;
216  } dest;
217 
218  struct {
219  /* FIXME: presence? */
220  uint32_t pc;
221  uint32_t mask;
225  uint32_t priority;
226  uint8_t qos_class;
227  } cfg;
228 };
229 
230 struct osmo_ss7_route *
231 osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc);
232 struct osmo_ss7_route *
234  uint32_t mask);
235 struct osmo_ss7_route *
237 struct osmo_ss7_route *
238 osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
239  uint32_t mask, const char *linkset_name);
240 void osmo_ss7_route_destroy(struct osmo_ss7_route *rt);
241 const char *osmo_ss7_route_print(const struct osmo_ss7_route *rt);
242 const char *osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps);
243 
244 
245 /***********************************************************************
246  * SS7 Application Servers
247  ***********************************************************************/
248 
250  uint32_t context;
251  uint32_t l_rk_id;
252 
253  uint32_t pc;
254  uint8_t si;
255  uint32_t ssn;
256  /* FIXME: more complex routing keys */
257 };
258 
260  OSMO_SS7_AS_TMOD_OVERRIDE = 0, /* default */
265 };
266 
267 extern struct value_string osmo_ss7_as_traffic_mode_vals[];
268 
269 static inline const char *
271 {
272  return get_value_string(osmo_ss7_as_traffic_mode_vals, mode);
273 }
274 
281 };
282 
283 extern struct value_string osmo_ss7_asp_protocol_vals[];
284 
285 static inline const char *
287 {
288  return get_value_string(osmo_ss7_asp_protocol_vals, mode);
289 }
290 
292 
293 struct osmo_ss7_as {
295  struct llist_head list;
297 
299  struct osmo_fsm_inst *fi;
300 
303 
306 
307  struct {
308  char *name;
309  char *description;
311  struct osmo_ss7_routing_key routing_key;
314  uint8_t qos_class;
315  struct {
316  uint32_t dpc;
317  } pc_override;
318 
319  struct osmo_ss7_asp *asps[16];
320  } cfg;
321 };
322 
323 struct osmo_ss7_as *
325 struct osmo_ss7_as *
326 osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx);
327 struct osmo_ss7_as *
328 osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id);
331 struct osmo_ss7_as *
334 int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name);
335 int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name);
336 void osmo_ss7_as_destroy(struct osmo_ss7_as *as);
337 bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as,
338  struct osmo_ss7_asp *asp);
339 void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp);
340 
341 
342 /***********************************************************************
343  * SS7 Application Server Processes
344  ***********************************************************************/
345 
347  char *host;
348  uint16_t port;
349 };
350 
358 };
359 
360 struct osmo_ss7_asp {
362  struct llist_head list;
364 
366  struct osmo_fsm_inst *fi;
367 
370  struct llist_head siblings;
371 
373  struct osmo_stream_cli *client;
374  struct osmo_stream_srv *server;
376  char *sock_name;
377 
378  /* ASP Identifier for ASP-UP + NTFY */
379  uint32_t asp_id;
381 
382  /* Layer Manager to which we talk */
383  const struct osmo_xua_layer_manager *lm;
384  void *lm_priv;
385 
388 
391 
393  struct msgb *pending_msg;
394 
395  struct {
396  char *name;
397  char *description;
399  enum osmo_ss7_asp_admin_state adm_state;
400  bool is_server;
401 
402  struct osmo_ss7_asp_peer local;
403  struct osmo_ss7_asp_peer remote;
404  uint8_t qos_class;
405  } cfg;
406 };
407 
408 struct osmo_ss7_asp *
410 struct osmo_ss7_asp
413 struct osmo_ss7_asp *
415  uint16_t remote_port, uint16_t local_port,
417 void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp);
418 int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg);
419 int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);
420 int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);
421 
429 typedef int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg);
430 
432 
433 #define LOGPASP(asp, subsys, level, fmt, args ...) \
434  LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
435 
436 /***********************************************************************
437  * xUA Servers
438  ***********************************************************************/
439 
441  osmo_prim_cb prim_cb;
442 };
443 
445  struct llist_head list;
447 
448  /* list of ASPs established via this server */
449  struct llist_head asp_list;
450 
451  struct osmo_stream_srv_link *server;
452 
453  struct {
455  struct osmo_ss7_asp_peer local;
457  } cfg;
458 };
459 
460 struct osmo_xua_server *
462  uint16_t local_port);
463 
464 struct osmo_xua_server *
466  uint16_t local_port, const char *local_host);
467 
468 int
470 
471 int
472 osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host);
473 
475 
476 struct osmo_sccp_instance *
477 osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
478  enum osmo_ss7_asp_protocol prot, int default_local_port,
479  const char *default_local_ip, int default_remote_port,
480  const char *default_remote_ip);
481 
482 struct osmo_sccp_instance *
483 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
484  uint32_t default_pc,
485  enum osmo_ss7_asp_protocol prot,
486  int default_local_port,
487  const char *default_local_ip,
488  int default_remote_port,
489  const char *default_remote_ip);
490 
491 struct osmo_sccp_instance *
492 osmo_sccp_simple_server(void *ctx, uint32_t pc,
493  enum osmo_ss7_asp_protocol prot, int local_port,
494  const char *local_ip);
495 
496 struct osmo_sccp_instance *
497 osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc,
498  enum osmo_ss7_asp_protocol prot,
499  int local_port, const char *local_ip);
500 
501 struct osmo_sccp_instance *
503  enum osmo_ss7_asp_protocol prot,
504  const char *name, uint32_t pc,
505  int local_port, int remote_port,
506  const char *remote_ip);
507 
510 
511 /* VTY related */
512 struct vty;
513 void osmo_ss7_vty_init_asp(void *ctx);
514 void osmo_ss7_vty_init_sg(void *ctx);
515 int osmo_ss7_vty_go_parent(struct vty *vty);
516 int osmo_ss7_is_config_node(struct vty *vty, int node);
uint32_t dpc
Definition: m3ua.h:456
int osmo_ss7_init(void)
Definition: osmo_ss7.c:1945
struct osmo_stream_cli * client
osmo_stream / libosmo-netif handles
Definition: osmo_ss7.h:373
void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset)
Destroy a SS7 Linkset.
Definition: osmo_ss7.c:560
uint32_t id
Definition: osmo_ss7.h:92
struct osmo_stream_srv_link * server
Definition: osmo_ss7.h:451
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:1833
uint32_t primary_pc
Definition: osmo_ss7.h:95
uint8_t si
Definition: osmo_ss7.h:254
uint8_t network_indicator
Definition: osmo_ss7.h:98
char * linkset_name
human-specified linkset name
Definition: osmo_ss7.h:223
bool simple_client_allocated
Were we allocated by "simple client" support?
Definition: osmo_ss7.h:305
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:411
void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
Definition: osmo_ss7.c:710
Definition: osmo_ss7.h:150
int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7.c:529
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:724
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:590
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
struct osmo_sccp_instance * osmo_ss7_ensure_sccp(struct osmo_ss7_instance *inst)
Allocate an SCCP instance, if not present yet.
Definition: osmo_ss7.c:466
uint32_t local_pc
Definition: osmo_ss7.h:190
char * description
Definition: osmo_ss7.h:309
uint8_t osmo_ss7_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt)
Definition: osmo_ss7.c:182
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_user.c:573
struct osmo_stream_srv * server
Definition: osmo_ss7.h:374
uint32_t context
Definition: osmo_ss7.h:250
Definition: sccp_internal.h:41
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:347
const char * osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:283
bool rkm_dyn_allocated
Were we dynamically allocated by RKM?
Definition: osmo_ss7.h:302
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:509
Definition: osmo_ss7.h:205
bool permit_dyn_rkm_alloc
Definition: osmo_ss7.h:100
void * priv
Definition: osmo_ss7.h:130
Definition: osmo_ss7.h:444
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:45
int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level)
Definition: xua_default_lm_fsm.c:366
uint32_t l_rk_id
Definition: osmo_ss7.h:251
struct osmo_fsm_inst * fi
ASP FSM.
Definition: osmo_ss7.h:366
bool accept_dyn_reg
Definition: osmo_ss7.h:454
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:1188
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1234
struct value_string osmo_ss7_as_traffic_mode_vals[]
Definition: osmo_ss7.c:61
Definition: osmo_ss7.h:279
uint8_t qos_class
Definition: osmo_ss7.h:404
Definition: osmo_ss7.h:346
const struct osmo_xua_layer_manager * lm
Definition: osmo_ss7.h:383
uint32_t asp_id
Definition: osmo_ss7.h:379
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:182
uint32_t priority
lower priority is higher
Definition: osmo_ss7.h:225
Definition: osmo_ss7.h:122
Definition: osmo_ss7.h:41
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_user.c:582
Definition: osmo_ss7.h:249
const char * osmo_ss7_route_print(const struct osmo_ss7_route *rt)
Definition: osmo_ss7.c:867
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:651
uint32_t pc
Definition: osmo_ss7.h:253
int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot)
Definition: osmo_ss7.c:314
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in)
Definition: osmo_ss7.c:1972
static const char * osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
Definition: osmo_ss7.h:286
Definition: osmo_ss7.h:278
const struct osmo_ss7_user * user[16]
Definition: osmo_ss7.h:85
int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1270
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:1042
struct osmo_ss7_route_table * rtable_system
Definition: osmo_ss7.h:87
int osmo_ss7_is_config_node(struct vty *vty, int node)
Definition: osmo_ss7_vty.c:1716
osmo_ss7_link_adm_state
Definition: osmo_ss7.h:149
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:456
int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod)
Definition: osmo_ss7.c:1958
void osmo_ss7_link_destroy(struct osmo_ss7_link *link)
Destryo SS7 Link.
Definition: osmo_ss7.c:634
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:124
bool dyn_allocated
Were we dynamically allocated.
Definition: osmo_ss7.h:387
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:979
struct osmo_ss7_instance * osmo_ss7_instance_find(uint32_t id)
Find a SS7 Instance with given ID.
Definition: osmo_ss7.c:330
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:446
struct llist_head osmo_ss7_instances
Definition: osmo_ss7.h:280
uint32_t dpc
Definition: osmo_ss7.h:316
bool simple_client_allocated
Were we allocated by "simple client" support?
Definition: osmo_ss7.h:390
uint32_t mask
Definition: osmo_ss7.h:221
struct osmo_ss7_route_table * osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:693
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:926
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:892
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:1900
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:310
struct value_string osmo_ss7_asp_protocol_vals[]
Definition: osmo_ss7.c:69
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:2006
Definition: osmo_ss7.h:277
bool asp_id_present
Definition: osmo_ss7.h:380
static bool osmo_ss7_pc_is_valid(uint32_t pc)
Definition: osmo_ss7.h:32
Definition: osmo_ss7.h:440
int osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: osmo_ss7.c:1909
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1819
Definition: osmo_ss7.h:261
struct llist_head list
member in list of routing tables
Definition: osmo_ss7.h:43
no SCTP association with peer
Definition: osmo_ss7.h:353
void osmo_ss7_vty_init_asp(void *ctx)
Definition: osmo_ss7_vty.c:1814
osmo_ss7_asp_admin_state
Definition: osmo_ss7.h:351
Definition: osmo_ss7.h:264
char * name
Definition: osmo_ss7.h:187
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:429
void osmo_ss7_route_destroy(struct osmo_ss7_route *rt)
Destroy a given SS7 route.
Definition: osmo_ss7.c:834
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:441
void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst)
Destroy a SS7 Instance.
Definition: osmo_ss7.c:388
const char * osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:275
char * description
Definition: osmo_ss7.h:94
void osmo_ss7_vty_init_sg(void *ctx)
Definition: osmo_ss7_vty.c:1820
Definition: osmo_ss7.h:65
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_user.c:532
int osmo_ss7_vty_go_parent(struct vty *vty)
Definition: osmo_ss7_vty.c:1668
osmo_ss7_as_traffic_mode
Definition: osmo_ss7.h:259
char * name
Definition: osmo_ss7.h:93
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:759
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst)
Definition: osmo_ss7.c:92
char * description
Definition: osmo_ss7.h:188
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:363
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:275
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:1781
const char * name
Definition: osmo_ss7.h:126
int osmo_ss7_user_mtp_xfer_req(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7_hmrt.c:284
Definition: osmo_ss7.h:260
Definition: osmo_ss7.h:360
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:1202
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:296
struct osmo_fsm_inst * fi
AS FSM.
Definition: osmo_ss7.h:299
Definition: osmo_ss7.h:153
uint32_t ssn
Definition: osmo_ss7.h:255
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:1855
struct llist_head routes
list of osmo_ss7_route
Definition: osmo_ss7.h:47
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:1012
uint32_t adjacent_pc
Definition: osmo_ss7.h:189
SCP association, but reject ASP-ACTIVE.
Definition: osmo_ss7.h:355
struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:1110
static const char * osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
Definition: osmo_ss7.h:270
struct osmo_sccp_instance * sccp
Definition: osmo_ss7.h:89
char * sock_name
pre-formatted human readable local/remote socket name
Definition: osmo_ss7.h:376
in normal operation
Definition: osmo_ss7.h:357
Definition: osmo_ss7.h:262
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:909
Definition: osmo_ss7.h:263
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_user.c:334
void osmo_ss7_as_destroy(struct osmo_ss7_as *as)
Destroy given Application Server.
Definition: osmo_ss7.c:1067
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:741
uint8_t qos_class
Definition: osmo_ss7.h:226
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:607
struct msgb * pending_msg
Pending message for non-blocking IPA read.
Definition: osmo_ss7.h:393
char * description
Definition: osmo_ss7.h:397
struct osmo_xua_server * xua_server
osmo_xua_server over which we were established
Definition: osmo_ss7.h:369
Definition: osmo_ss7.h:152
Definition: osmo_ss7.h:70
Definition: osmo_ss7.h:276
bool is_server
Definition: osmo_ss7.h:400
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:944
Definition: osmo_ss7.h:179
Definition: osmo_ss7.h:151
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:1936
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:398
int osmo_ss7_instance_bind(struct osmo_ss7_instance *inst)
bind all xUA servers belonging to an SS7 Instance
Definition: osmo_ss7.c:431
char * name
Definition: osmo_ss7.h:308
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:128
struct osmo_ss7_linkset * linkset
pointer to linkset (destination) of route
Definition: osmo_ss7.h:213
void * lm_priv
Definition: osmo_ss7.h:384
char * host
Definition: osmo_ss7.h:347
int osmo_ss7_bind_all_instances()
bind all xUA servers on each of the stored SS7 instances
Definition: osmo_ss7.c:448
struct osmo_ss7_route_table * rtable
osmo_ss7_route_table to which we belong
Definition: osmo_ss7.h:209
char delimiter
Definition: osmo_ss7.h:66
struct osmo_ss7_route_table::@19 cfg
struct osmo_ss7_as * as
pointer to Application Server
Definition: osmo_ss7.h:215
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str)
Definition: osmo_ss7.c:217
Definition: osmo_ss7.h:293
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in)
Definition: osmo_ss7.c:289
uint32_t pc
Definition: osmo_ss7.h:220
uint16_t port
Definition: osmo_ss7.h:348
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:485
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:1092
char * name
Definition: osmo_ss7.h:396
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:795
Definition: mtp_sap.h:56
char * description
Definition: osmo_ss7.h:51
void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs)
Definition: osmo_ss7.c:1919
uint32_t recovery_timeout_msec
Definition: osmo_ss7.h:313
uint8_t qos_class
Definition: osmo_ss7.h:314
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_user.c:511
char * name
Definition: osmo_ss7.h:50
struct osmo_ss7_route_table * osmo_ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:681