libosmo-sigtran 2.1.0.194-89e3 Osmocom SIGTRAN library

ss7_xua_srv.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <unistd.h>
5#include <osmocom/core/defs.h>
6#include <osmocom/core/linuxlist.h>
7#include <osmocom/core/prim.h>
8#include <osmocom/netif/stream.h>
9
10#include <osmocom/sigtran/osmo_ss7.h>
11
12/***********************************************************************
13 * xUA Servers
14 ***********************************************************************/
15
16struct osmo_ss7_instance;
17
18 struct osmo_xua_layer_manager {
19 osmo_prim_cb prim_cb;
20};
21
22 struct osmo_xua_server {
23 struct llist_head list;
24 struct osmo_ss7_instance *inst;
25
26 /* list of ASPs established via this server */
27 struct llist_head asp_list;
28
29 struct osmo_stream_srv_link *server;
30
31 struct {
32 bool accept_dyn_reg;
33 struct osmo_ss7_asp_peer local;
34 enum osmo_ss7_asp_protocol proto;
35 struct {
36 bool num_ostreams_present;
37 bool max_instreams_present;
38 uint16_t num_ostreams_value;
39 uint16_t max_instreams_value;
40 } sctp_init;
41
43 int trans_proto;
44 } cfg;
45};
46
47struct osmo_xua_server *
48 ss7_xua_server_find(struct osmo_ss7_instance *inst,
49 enum osmo_ss7_asp_protocol proto,
50 uint16_t local_port)
51 OSMO_DEPRECATED("Use ss7_xua_server_find2() instead");
52struct osmo_xua_server *
53 ss7_xua_server_find2(struct osmo_ss7_instance *inst,
54 int trans_proto,
55 enum osmo_ss7_asp_protocol proto,
56 uint16_t local_port);
57
58struct osmo_xua_server *
59 ss7_xua_server_create(struct osmo_ss7_instance *inst,
60 enum osmo_ss7_asp_protocol proto,
61 uint16_t local_port, const char *local_host)
62 OSMO_DEPRECATED("Use ss7_xua_server_create2() instead");
63struct osmo_xua_server *
64 ss7_xua_server_create2(struct osmo_ss7_instance *inst,
65 int trans_proto, enum osmo_ss7_asp_protocol proto,
66 uint16_t local_port, const char *local_host);
67
68int
69 ss7_xua_server_bind(struct osmo_xua_server *xs);
70
71int
72 ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host);
73int
74 ss7_xua_server_set_local_hosts(struct osmo_xua_server *xs, const char **local_hosts, size_t local_host_cnt);
75int ss7_xua_server_add_local_host(struct osmo_xua_server *xs, const char *local_host);
76int ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char *local_host);
77void ss7_xua_server_destroy(struct osmo_xua_server *xs);
78
79bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs);
osmo_ss7.h
osmo_ss7_asp_protocol
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:157
ss7_xua_server_add_local_host
int ss7_xua_server_add_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: ss7_xua_srv.c:368
ss7_xua_server_set_local_hosts
int ss7_xua_server_set_local_hosts(struct osmo_xua_server *xs, const char **local_hosts, size_t local_host_cnt)
Definition: ss7_xua_srv.c:356
ss7_xua_server_create2
struct osmo_xua_server * ss7_xua_server_create2(struct osmo_ss7_instance *inst, int trans_proto, 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: ss7_xua_srv.c:230
ss7_xua_server_bind
int ss7_xua_server_bind(struct osmo_xua_server *xs)
Set the xUA server to bind/listen to the currently configured ip/port.
Definition: ss7_xua_srv.c:326
ss7_xua_server_del_local_host
int ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: ss7_xua_srv.c:379
ss7_xua_server_set_default_local_hosts
bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs)
Definition: ss7_xua_srv.c:389
ss7_xua_server_find
struct osmo_xua_server * ss7_xua_server_find(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port) OSMO_DEPRECATED("Use ss7_xua_server_find2() instead")
find an xUA server with the given parameters
Definition: ss7_xua_srv.c:458
ss7_xua_server_create
struct osmo_xua_server * ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_protocol proto, uint16_t local_port, const char *local_host) OSMO_DEPRECATED("Use ss7_xua_server_create2() instead")
create a new xUA server configured with given ip/port
Definition: ss7_xua_srv.c:289
ss7_xua_server_destroy
void ss7_xua_server_destroy(struct osmo_xua_server *xs)
Definition: ss7_xua_srv.c:403
ss7_xua_server_set_local_host
int ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host)
Definition: ss7_xua_srv.c:350
ss7_xua_server_find2
struct osmo_xua_server * ss7_xua_server_find2(struct osmo_ss7_instance *inst, int trans_proto, enum osmo_ss7_asp_protocol proto, uint16_t local_port)
find an xUA server with the given parameters
Definition: ss7_xua_srv.c:430
osmo_ss7_asp_peer
Definition: ss7_asp_peer.h:11
osmo_ss7_instance
Definition: ss7_instance.h:31
osmo_xua_layer_manager
Definition: ss7_xua_srv.h:18
osmo_xua_layer_manager::prim_cb
osmo_prim_cb prim_cb
Definition: ss7_xua_srv.h:19
osmo_xua_server
Definition: ss7_xua_srv.h:22
osmo_xua_server::server
struct osmo_stream_srv_link * server
Definition: ss7_xua_srv.h:29
osmo_xua_server::max_instreams_value
uint16_t max_instreams_value
Definition: ss7_xua_srv.h:39
osmo_xua_server::proto
enum osmo_ss7_asp_protocol proto
Definition: ss7_xua_srv.h:34
osmo_xua_server::num_ostreams_present
bool num_ostreams_present
Definition: ss7_xua_srv.h:36
osmo_xua_server::inst
struct osmo_ss7_instance * inst
Definition: ss7_xua_srv.h:24
osmo_xua_server::asp_list
struct llist_head asp_list
Definition: ss7_xua_srv.h:27
osmo_xua_server::accept_dyn_reg
bool accept_dyn_reg
Definition: ss7_xua_srv.h:32
osmo_xua_server::sctp_init
struct osmo_xua_server::@37::@38 sctp_init
osmo_xua_server::num_ostreams_value
uint16_t num_ostreams_value
Definition: ss7_xua_srv.h:38
osmo_xua_server::cfg
struct osmo_xua_server::@37 cfg
osmo_xua_server::list
struct llist_head list
Definition: ss7_xua_srv.h:23
osmo_xua_server::local
struct osmo_ss7_asp_peer local
Definition: ss7_xua_srv.h:33
osmo_xua_server::max_instreams_present
bool max_instreams_present
Definition: ss7_xua_srv.h:37
osmo_xua_server::trans_proto
int trans_proto
The underlaying transport protocol (one of IPPROTO_*)
Definition: ss7_xua_srv.h:43