libosmo-sigtran  2.3.0
Osmocom SIGTRAN library
ss7_internal.h
Go to the documentation of this file.
1 #pragma once
2 
3 /* Internal header used by libosmo-sccp, not available publicly for lib users */
4 
5 #include <stdbool.h>
6 #include <stdint.h>
7 
8 #include <osmocom/core/linuxlist.h>
9 #include <osmocom/netif/stream.h>
11 
12 #include "ss7_instance.h"
13 
14 #define MAX_PC_STR_LEN 32
15 
16 extern bool ss7_initialized;
17 
18 bool ss7_ipv6_sctp_supported(const char *host, bool bind);
19 
20 uint32_t ss7_pc_full_mask(const struct osmo_ss7_pc_fmt *pc_fmt);
21 
23 
26 int ss7_asp_ipa_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
27 int ss7_asp_xua_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
28 int ss7_asp_m3ua_tcp_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
29 int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv);
30 
31 int xua_tcp_segmentation_cb(struct msgb *msg);
32 
33 static inline struct llist_head *_ss7_llist_round_robin(struct llist_head *list, void **state)
34 {
35  struct llist_head *e = *state;
36  if (!e || e->next == list)
37  e = list;
38  e = e->next;
39  if (e == list)
40  e = NULL;
41  *state = e;
42  return e;
43 }
44 #define ss7_llist_round_robin(list, state, struct_type, entry_name) \
45  llist_entry(_ss7_llist_round_robin(list, state), struct_type, entry_name)
46 
48 static inline uint32_t load_24be(const void *ptr)
49 {
50  const uint8_t *data = ptr;
51  return (data[0] << 16) | (data[1] << 8) | data[2];
52 }
53 
54 /* VTY */
55 #define XUA_VAR_STR "(sua|m3ua|ipa)"
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:157
int and can be left NULL
Definition: osmo_ss7.h:353
int ss7_asp_m3ua_tcp_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: ss7_asp.c:1187
int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv)
Definition: ss7_asp.c:1377
static uint32_t load_24be(const void *ptr)
load a 24bit value as big-endian
Definition: ss7_internal.h:48
uint32_t ss7_pc_full_mask(const struct osmo_ss7_pc_fmt *pc_fmt)
Definition: ss7.c:94
struct osmo_ss7_asp * ss7_asp_find_by_socket_addr(int fd, int trans_proto)
Find an ASP definition matching the local+remote IP/PORT of given fd.
Definition: ss7_asp.c:644
bool ss7_ipv6_sctp_supported(const char *host, bool bind)
Definition: ss7.c:144
int ss7_asp_xua_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: ss7_asp.c:1122
int ss7_asp_ipa_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: ss7_asp.c:1060
bool ss7_initialized
Definition: ss7.c:63
int xua_tcp_segmentation_cb(struct msgb *msg)
Definition: ss7_asp.c:1172
bool ss7_asp_protocol_check_trans_proto(enum osmo_ss7_asp_protocol proto, int trans_proto)
Definition: ss7_asp.c:162
int ss7_default_trans_proto_for_asp_proto(enum osmo_ss7_asp_protocol proto)
Definition: ss7_asp.c:186
static struct llist_head * _ss7_llist_round_robin(struct llist_head *list, void **state)
Definition: ss7_internal.h:33
Definition: ss7_asp.h:55
enum osmo_ss7_asp_protocol proto
Definition: ss7_asp.h:114
int trans_proto
The underlaying transport protocol (one of IPPROTO_*)
Definition: ss7_asp.h:178
Definition: ss7_instance.h:42
uint8_t data[0]
Definition: tcap_as_loadshare.c:2