libosmo-sigtran: src/ss7_internal.h Source File

libosmo-sigtran 2.2.1.95-893c 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>
10#include <osmocom/sigtran/osmo_ss7.h>
11
12#include "ss7_instance.h"
13
14#define MAX_PC_STR_LEN 32
15
16extern bool ss7_initialized;
17
18bool ss7_ipv6_sctp_supported(const char *host, bool bind);
19
20uint32_t ss7_pc_full_mask(const struct osmo_ss7_pc_fmt *pc_fmt);
21
22struct osmo_ss7_asp *ss7_asp_find_by_socket_addr(int fd, int trans_proto);
23
24bool ss7_asp_protocol_check_trans_proto(enum osmo_ss7_asp_protocol proto, int trans_proto);
25int ss7_default_trans_proto_for_asp_proto(enum osmo_ss7_asp_protocol proto);
26int ss7_asp_ipa_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
27int ss7_asp_xua_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
28int ss7_asp_m3ua_tcp_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
29int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv);
30
31int 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.h
osmo_ss7_asp_protocol
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:157
NULL
int and can be left NULL
Definition: osmo_ss7.h:353
ss7_instance.h
ss7_asp_m3ua_tcp_srv_conn_rx_cb
int ss7_asp_m3ua_tcp_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: ss7_asp.c:1167
ss7_asp_xua_srv_conn_closed_cb
int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv)
Definition: ss7_asp.c:1357
ss7_asp_find_by_socket_addr
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:626
load_24be
static uint32_t load_24be(const void *ptr)
load a 24bit value as big-endian
Definition: ss7_internal.h:48
ss7_pc_full_mask
uint32_t ss7_pc_full_mask(const struct osmo_ss7_pc_fmt *pc_fmt)
Definition: ss7.c:94
ss7_ipv6_sctp_supported
bool ss7_ipv6_sctp_supported(const char *host, bool bind)
Definition: ss7.c:144
ss7_asp_xua_srv_conn_rx_cb
int ss7_asp_xua_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: ss7_asp.c:1102
ss7_asp_ipa_srv_conn_rx_cb
int ss7_asp_ipa_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: ss7_asp.c:1040
ss7_initialized
bool ss7_initialized
Definition: ss7.c:63
_ss7_llist_round_robin
static struct llist_head * _ss7_llist_round_robin(struct llist_head *list, void **state)
Definition: ss7_internal.h:33
xua_tcp_segmentation_cb
int xua_tcp_segmentation_cb(struct msgb *msg)
Definition: ss7_asp.c:1152
ss7_asp_protocol_check_trans_proto
bool ss7_asp_protocol_check_trans_proto(enum osmo_ss7_asp_protocol proto, int trans_proto)
Definition: ss7_asp.c:161
ss7_default_trans_proto_for_asp_proto
int ss7_default_trans_proto_for_asp_proto(enum osmo_ss7_asp_protocol proto)
Definition: ss7_asp.c:185
osmo_ss7_asp
Definition: ss7_asp.h:55
osmo_ss7_asp::proto
enum osmo_ss7_asp_protocol proto
Definition: ss7_asp.h:114
osmo_ss7_asp::trans_proto
int trans_proto
The underlaying transport protocol (one of IPPROTO_*)
Definition: ss7_asp.h:177
osmo_ss7_pc_fmt
Definition: ss7_instance.h:42
data
uint8_t data[0]
Definition: tcap_as_loadshare.c:2