libosmo-sigtran  0.10.0
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 
114 /***********************************************************************
115  * MTP Users (Users of MTP, such as SCCP or ISUP)
116  ***********************************************************************/
117 
119  /* pointer back to SS7 instance */
121  /* name of the user */
122  const char *name;
123  /* primitive call-back for incoming MTP primitives */
124  osmo_prim_cb prim_cb;
125  /* private data */
126  void *priv;
127 };
128 
129 int osmo_ss7_user_register(struct osmo_ss7_instance *inst, uint8_t service_ind,
130  struct osmo_ss7_user *user);
131 
132 int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind,
133  struct osmo_ss7_user *user);
134 
135 int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp);
136 
137 /* SS7 User wants to issue MTP-TRANSFER.req */
139  struct osmo_mtp_prim *omp);
140 
141 /***********************************************************************
142  * SS7 Links
143  ***********************************************************************/
144 
150 };
151 
152 struct osmo_ss7_linkset;
153 struct osmo_ss7_link;
154 
158  struct {
159  char *name;
160  char *description;
161  uint32_t id;
162 
163  enum osmo_ss7_link_adm_state adm_state;
164  } cfg;
165 };
166 
167 void osmo_ss7_link_destroy(struct osmo_ss7_link *link);
168 struct osmo_ss7_link *
169 osmo_ss7_link_find_or_create(struct osmo_ss7_linkset *lset, uint32_t id);
170 
171 /***********************************************************************
172  * SS7 Linksets
173  ***********************************************************************/
174 
176  struct llist_head list;
180  struct osmo_ss7_link *links[16];
181 
182  struct {
183  char *name;
184  char *description;
185  uint32_t adjacent_pc;
186  uint32_t local_pc;
187  } cfg;
188 };
189 
190 void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset);
191 struct osmo_ss7_linkset *
193 struct osmo_ss7_linkset *
194 osmo_ss7_linkset_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint32_t pc);
195 
196 
197 /***********************************************************************
198  * SS7 Routes
199  ***********************************************************************/
200 
203  struct llist_head list;
206 
207  struct {
211  struct osmo_ss7_as *as;
212  } dest;
213 
214  struct {
215  /* FIXME: presence? */
216  uint32_t pc;
217  uint32_t mask;
221  uint32_t priority;
222  uint8_t qos_class;
223  } cfg;
224 };
225 
226 struct osmo_ss7_route *
227 osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc);
228 struct osmo_ss7_route *
230  uint32_t mask);
231 struct osmo_ss7_route *
233 struct osmo_ss7_route *
234 osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
235  uint32_t mask, const char *linkset_name);
236 void osmo_ss7_route_destroy(struct osmo_ss7_route *rt);
237 const char *osmo_ss7_route_name(struct osmo_ss7_route *rt, bool list_asps);
238 
239 
240 /***********************************************************************
241  * SS7 Application Servers
242  ***********************************************************************/
243 
245  uint32_t context;
246  uint32_t l_rk_id;
247 
248  uint32_t pc;
249  uint8_t si;
250  uint32_t ssn;
251  /* FIXME: more complex routing keys */
252 };
253 
255  OSMO_SS7_AS_TMOD_OVERRIDE = 0, /* default */
260 };
261 
262 extern struct value_string osmo_ss7_as_traffic_mode_vals[];
263 
264 static inline const char *
266 {
267  return get_value_string(osmo_ss7_as_traffic_mode_vals, mode);
268 }
269 
276 };
277 
278 extern struct value_string osmo_ss7_asp_protocol_vals[];
279 
280 static inline const char *
282 {
283  return get_value_string(osmo_ss7_asp_protocol_vals, mode);
284 }
285 
287 
288 struct osmo_ss7_as {
290  struct llist_head list;
292 
294  struct osmo_fsm_inst *fi;
295 
298 
299  struct {
300  char *name;
301  char *description;
303  struct osmo_ss7_routing_key routing_key;
306  uint8_t qos_class;
307  struct {
308  uint32_t dpc;
309  } pc_override;
310 
311  struct osmo_ss7_asp *asps[16];
312  } cfg;
313 };
314 
315 struct osmo_ss7_as *
317 struct osmo_ss7_as *
318 osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx);
319 struct osmo_ss7_as *
320 osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id);
323 struct osmo_ss7_as *
326 int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name);
327 int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name);
328 void osmo_ss7_as_destroy(struct osmo_ss7_as *as);
329 bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as,
330  struct osmo_ss7_asp *asp);
331 void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp);
332 
333 
334 /***********************************************************************
335  * SS7 Application Server Processes
336  ***********************************************************************/
337 
339  char *host;
340  uint16_t port;
341 };
342 
350 };
351 
352 struct osmo_ss7_asp {
354  struct llist_head list;
356 
358  struct osmo_fsm_inst *fi;
359 
362  struct llist_head siblings;
363 
365  struct osmo_stream_cli *client;
366  struct osmo_stream_srv *server;
368  char *sock_name;
369 
370  /* ASP Identifier for ASP-UP + NTFY */
371  uint32_t asp_id;
373 
374  /* Layer Manager to which we talk */
375  const struct osmo_xua_layer_manager *lm;
376  void *lm_priv;
377 
380 
382  struct msgb *pending_msg;
383 
384  struct {
385  char *name;
386  char *description;
388  enum osmo_ss7_asp_admin_state adm_state;
389  bool is_server;
390 
391  struct osmo_ss7_asp_peer local;
392  struct osmo_ss7_asp_peer remote;
393  uint8_t qos_class;
394  } cfg;
395 };
396 
397 struct osmo_ss7_asp *
399 struct osmo_ss7_asp
402 struct osmo_ss7_asp *
404  uint16_t remote_port, uint16_t local_port,
406 void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp);
407 int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg);
408 int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);
409 int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);
410 
418 typedef int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg);
419 
421 
422 #define LOGPASP(asp, subsys, level, fmt, args ...) \
423  LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
424 
425 /***********************************************************************
426  * xUA Servers
427  ***********************************************************************/
428 
430  osmo_prim_cb prim_cb;
431 };
432 
434  struct llist_head list;
436 
437  /* list of ASPs established via this server */
438  struct llist_head asp_list;
439 
440  struct osmo_stream_srv_link *server;
441 
442  struct {
444  struct osmo_ss7_asp_peer local;
446  } cfg;
447 };
448 
449 struct osmo_xua_server *
451  uint16_t local_port);
452 
453 struct osmo_xua_server *
455  uint16_t local_port, const char *local_host);
456 
457 int
459 
460 int
461 osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host);
462 
464 
465 struct osmo_sccp_instance *
466 osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
467  enum osmo_ss7_asp_protocol prot, int default_local_port,
468  const char *default_local_ip, int default_remote_port,
469  const char *default_remote_ip);
470 
471 struct osmo_sccp_instance *
472 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
473  uint32_t default_pc,
474  enum osmo_ss7_asp_protocol prot,
475  int default_local_port,
476  const char *default_local_ip,
477  int default_remote_port,
478  const char *default_remote_ip);
479 
480 struct osmo_sccp_instance *
481 osmo_sccp_simple_server(void *ctx, uint32_t pc,
482  enum osmo_ss7_asp_protocol prot, int local_port,
483  const char *local_ip);
484 
485 struct osmo_sccp_instance *
486 osmo_sccp_simple_server_on_ss7_id(void *ctx, uint32_t ss7_id, uint32_t pc,
487  enum osmo_ss7_asp_protocol prot,
488  int local_port, const char *local_ip);
489 
490 struct osmo_sccp_instance *
492  enum osmo_ss7_asp_protocol prot,
493  const char *name, uint32_t pc,
494  int local_port, int remote_port,
495  const char *remote_ip);
496 
499 
500 /* VTY related */
501 struct vty;
502 void osmo_ss7_vty_init_asp(void *ctx);
503 void osmo_ss7_vty_init_sg(void *ctx);
504 int osmo_ss7_vty_go_parent(struct vty *vty);
505 int osmo_ss7_is_config_node(struct vty *vty, int node);
uint32_t dpc
Definition: m3ua.h:445
int osmo_ss7_init(void)
Definition: osmo_ss7.c:1876
struct osmo_stream_cli * client
osmo_stream / libosmo-netif handles
Definition: osmo_ss7.h:365
void osmo_ss7_linkset_destroy(struct osmo_ss7_linkset *lset)
Destroy a SS7 Linkset.
Definition: osmo_ss7.c:547
uint32_t id
Definition: osmo_ss7.h:92
struct osmo_stream_srv_link * server
Definition: osmo_ss7.h:440
struct osmo_xua_server * osmo_ss7_xua_server_find(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port)
Definition: osmo_ss7.c:1767
uint32_t primary_pc
Definition: osmo_ss7.h:95
uint8_t si
Definition: osmo_ss7.h:249
uint8_t network_indicator
Definition: osmo_ss7.h:98
char * linkset_name
human-specified linkset name
Definition: osmo_ss7.h:219
int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2)
Set the point code format used in given SS7 instance.
Definition: osmo_ss7.c:410
void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
Definition: osmo_ss7.c:697
Definition: osmo_ss7.h:146
int osmo_ss7_mtp_to_user(struct osmo_ss7_instance *inst, struct osmo_mtp_prim *omp)
Definition: osmo_ss7.c:516
struct osmo_ss7_route * osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc)
Find a SS7 route for given destination point code in given table.
Definition: osmo_ss7.c:711
struct osmo_ss7_linkset * osmo_ss7_linkset_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find SS7 Linkset by given name.
Definition: osmo_ss7.c:577
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
uint32_t local_pc
Definition: osmo_ss7.h:186
char * description
Definition: osmo_ss7.h:301
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:580
struct osmo_stream_srv * server
Definition: osmo_ss7.h:366
uint32_t context
Definition: osmo_ss7.h:245
Definition: sccp_internal.h:9
struct osmo_ss7_instance * osmo_ss7_instance_find_or_create(void *ctx, uint32_t id)
Find or create a SS7 Instance.
Definition: osmo_ss7.c:346
const char * osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:282
bool rkm_dyn_allocated
Were we dynamically allocated by RKM?
Definition: osmo_ss7.h:297
int osmo_ss7_user_unregister(struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
Unregister a MTP user for a given service indicator.
Definition: osmo_ss7.c:496
Definition: osmo_ss7.h:201
bool permit_dyn_rkm_alloc
Definition: osmo_ss7.h:100
void * priv
Definition: osmo_ss7.h:126
Definition: osmo_ss7.h:433
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:246
struct osmo_fsm_inst * fi
ASP FSM.
Definition: osmo_ss7.h:358
bool accept_dyn_reg
Definition: osmo_ss7.h:443
struct osmo_ss7_asp * osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as, enum osmo_ss7_asp_protocol proto)
Find an ASP that matches the given protocol.
Definition: osmo_ss7.c:1133
void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1179
struct value_string osmo_ss7_as_traffic_mode_vals[]
Definition: osmo_ss7.c:61
Definition: osmo_ss7.h:274
uint8_t qos_class
Definition: osmo_ss7.h:393
Definition: osmo_ss7.h:338
const struct osmo_xua_layer_manager * lm
Definition: osmo_ss7.h:375
uint32_t asp_id
Definition: osmo_ss7.h:371
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: osmo_ss7.h:178
uint32_t priority
lower priority is higher
Definition: osmo_ss7.h:221
Definition: osmo_ss7.h:118
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:589
Definition: osmo_ss7.h:244
struct osmo_ss7_link * osmo_ss7_link_find_or_create(struct osmo_ss7_linkset *lset, uint32_t id)
Find or create SS7 Link with given ID in given Linkset.
Definition: osmo_ss7.c:638
uint32_t pc
Definition: osmo_ss7.h:248
int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot)
Definition: osmo_ss7.c:313
enum osmo_ss7_as_traffic_mode osmo_ss7_tmode_from_xua(uint32_t in)
Definition: osmo_ss7.c:1903
static const char * osmo_ss7_asp_protocol_name(enum osmo_ss7_asp_protocol mode)
Definition: osmo_ss7.h:281
Definition: osmo_ss7.h:273
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:1215
int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name)
Delete given ASP from given AS.
Definition: osmo_ss7.c:987
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:1710
osmo_ss7_link_adm_state
Definition: osmo_ss7.h:145
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:445
int osmo_ss7_tmode_to_xua(enum osmo_ss7_as_traffic_mode tmod)
Definition: osmo_ss7.c:1889
void osmo_ss7_link_destroy(struct osmo_ss7_link *link)
Destryo SS7 Link.
Definition: osmo_ss7.c:621
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:120
bool dyn_allocated
Were we dynamically allocated.
Definition: osmo_ss7.h:379
struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
Find or Create Application Server.
Definition: osmo_ss7.c:924
struct osmo_ss7_instance * osmo_ss7_instance_find(uint32_t id)
Find a SS7 Instance with given ID.
Definition: osmo_ss7.c:329
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:435
struct llist_head osmo_ss7_instances
Definition: osmo_ss7.h:275
uint32_t dpc
Definition: osmo_ss7.h:308
uint32_t mask
Definition: osmo_ss7.h:217
struct osmo_ss7_route_table * osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:680
struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id)
Find Application Server by given local routing key ID.
Definition: osmo_ss7.c:871
struct osmo_ss7_as * osmo_ss7_as_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Find Application Server by given name.
Definition: osmo_ss7.c:837
int osmo_ss7_xua_server_bind(struct osmo_xua_server *xs)
Set the xUA server to bind/listen to the currently configured ip/port.
Definition: osmo_ss7.c:1831
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:302
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:1937
Definition: osmo_ss7.h:272
bool asp_id_present
Definition: osmo_ss7.h:372
static bool osmo_ss7_pc_is_valid(uint32_t pc)
Definition: osmo_ss7.h:32
Definition: osmo_ss7.h:429
int osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: osmo_ss7.c:1840
void osmo_ss7_asp_disconnect(struct osmo_ss7_asp *asp)
Definition: osmo_ss7.c:1753
Definition: osmo_ss7.h:256
struct llist_head list
member in list of routing tables
Definition: osmo_ss7.h:43
no SCTP association with peer
Definition: osmo_ss7.h:345
void osmo_ss7_vty_init_asp(void *ctx)
Definition: osmo_ss7_vty.c:1808
osmo_ss7_asp_admin_state
Definition: osmo_ss7.h:343
Definition: osmo_ss7.h:259
char * name
Definition: osmo_ss7.h:183
int osmo_ss7_asp_rx_unknown_cb(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb *msg)
Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.
Definition: osmo_ss7.h:418
void osmo_ss7_route_destroy(struct osmo_ss7_route *rt)
Destroy a given SS7 route.
Definition: osmo_ss7.c:821
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:430
void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst)
Destroy a SS7 Instance.
Definition: osmo_ss7.c:387
const char * osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:274
char * description
Definition: osmo_ss7.h:94
void osmo_ss7_vty_init_sg(void *ctx)
Definition: osmo_ss7_vty.c:1814
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:539
int osmo_ss7_vty_go_parent(struct vty *vty)
Definition: osmo_ss7_vty.c:1662
osmo_ss7_as_traffic_mode
Definition: osmo_ss7.h:254
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:746
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst)
Definition: osmo_ss7.c:92
char * description
Definition: osmo_ss7.h:184
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:355
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:270
int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg)
send a fully encoded msgb via a given ASP
Definition: osmo_ss7.c:1715
const char * name
Definition: osmo_ss7.h:122
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:255
Definition: osmo_ss7.h:352
struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7.c:1147
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:291
struct osmo_fsm_inst * fi
AS FSM.
Definition: osmo_ss7.h:294
Definition: osmo_ss7.h:149
uint32_t ssn
Definition: osmo_ss7.h:250
struct osmo_xua_server * osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port, const char *local_host)
create a new xUA server configured with given ip/port
Definition: osmo_ss7.c:1789
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:957
uint32_t adjacent_pc
Definition: osmo_ss7.h:185
SCP association, but reject ASP-ACTIVE.
Definition: osmo_ss7.h:347
struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name)
Definition: osmo_ss7.c:1055
static const char * osmo_ss7_as_traffic_mode_name(enum osmo_ss7_as_traffic_mode mode)
Definition: osmo_ss7.h:265
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:368
in normal operation
Definition: osmo_ss7.h:349
Definition: osmo_ss7.h:257
struct osmo_ss7_as * osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx)
Find Application Server by given routing context.
Definition: osmo_ss7.c:854
Definition: osmo_ss7.h:258
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:1012
struct osmo_ss7_route * osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask)
Find a SS7 route for given destination point code + mask in given table.
Definition: osmo_ss7.c:728
uint8_t qos_class
Definition: osmo_ss7.h:222
struct osmo_ss7_linkset * osmo_ss7_linkset_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint32_t pc)
Find or allocate SS7 Linkset.
Definition: osmo_ss7.c:594
struct msgb * pending_msg
Pending message for non-blocking IPA read.
Definition: osmo_ss7.h:382
char * description
Definition: osmo_ss7.h:386
struct osmo_xua_server * xua_server
osmo_xua_server over which we were established
Definition: osmo_ss7.h:361
Definition: osmo_ss7.h:148
Definition: osmo_ss7.h:70
Definition: osmo_ss7.h:271
bool is_server
Definition: osmo_ss7.h:389
struct osmo_ss7_as * osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto)
Find Application Server (AS) by given protocol.
Definition: osmo_ss7.c:889
Definition: osmo_ss7.h:175
Definition: osmo_ss7.h:147
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc)
Definition: osmo_ss7.c:1867
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:387
int osmo_ss7_instance_bind(struct osmo_ss7_instance *inst)
bind all xUA servers belonging to an SS7 Instance
Definition: osmo_ss7.c:430
char * name
Definition: osmo_ss7.h:300
osmo_prim_cb prim_cb
Definition: osmo_ss7.h:124
struct osmo_ss7_linkset * linkset
pointer to linkset (destination) of route
Definition: osmo_ss7.h:209
void * lm_priv
Definition: osmo_ss7.h:376
char * host
Definition: osmo_ss7.h:339
int osmo_ss7_bind_all_instances()
bind all xUA servers on each of the stored SS7 instances
Definition: osmo_ss7.c:447
struct osmo_ss7_route_table * rtable
osmo_ss7_route_table to which we belong
Definition: osmo_ss7.h:205
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:211
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str)
Definition: osmo_ss7.c:216
Definition: osmo_ss7.h:288
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in)
Definition: osmo_ss7.c:288
uint32_t pc
Definition: osmo_ss7.h:216
uint16_t port
Definition: osmo_ss7.h:340
int osmo_ss7_user_register(struct osmo_ss7_instance *inst, uint8_t service_ind, struct osmo_ss7_user *user)
Register a MTP user for a given service indicator.
Definition: osmo_ss7.c:472
bool osmo_ss7_as_has_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Determine if given AS contains ASP.
Definition: osmo_ss7.c:1037
char * name
Definition: osmo_ss7.h:385
struct osmo_ss7_route * osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, const char *linkset_name)
Create a new route in the given routing table.
Definition: osmo_ss7.c:782
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:1850
uint32_t recovery_timeout_msec
Definition: osmo_ss7.h:305
uint8_t qos_class
Definition: osmo_ss7.h:306
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:518
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:668