libosmo-sigtran 2.0.0.17-24bf
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>
8
9extern bool ss7_initialized;
10uint32_t ss7_find_free_l_rk_id(struct osmo_ss7_instance *inst);
11
12bool ss7_ipv6_sctp_supported(const char *host, bool bind);
13
14struct osmo_ss7_as *ss7_as_alloc(struct osmo_ss7_instance *inst, const char *name,
16
17struct osmo_ss7_asp *ss7_asp_alloc(struct osmo_ss7_instance *inst, const char *name,
18 uint16_t remote_port, uint16_t local_port,
21bool ss7_asp_is_started(const struct osmo_ss7_asp *asp);
22int ss7_asp_get_fd(const struct osmo_ss7_asp *asp);
24
27int ss7_asp_ipa_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
28int ss7_asp_xua_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
29int ss7_asp_m3ua_tcp_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg);
30int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv);
32int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp);
33int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx);
34int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx);
35
36bool ss7_asp_peer_match_host(const struct osmo_ss7_asp_peer *peer, const char *host, bool host_is_v6);
37int ss7_asp_peer_find_host(const struct osmo_ss7_asp_peer *peer, const char *host);
38
40
41int xua_tcp_segmentation_cb(struct msgb *msg);
42
46};
47
52};
53
54/***********************************************************************
55 * SS7 Routes
56 ***********************************************************************/
57#define OSMO_SS7_ROUTE_PRIO_DEFAULT 5
58
59struct osmo_ss7_route *
60ss7_route_alloc(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask);
61int ss7_route_set_linkset(struct osmo_ss7_route *rt, const char *linkset_name);
62int ss7_route_insert(struct osmo_ss7_route *rt);
osmo_ss7_asp_protocol
Definition: osmo_ss7.h:277
bool ss7_asp_is_started(const struct osmo_ss7_asp *asp)
Definition: osmo_ss7_asp.c:727
int ss7_asp_m3ua_tcp_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: osmo_ss7_asp.c:886
int ss7_asp_peer_find_host(const struct osmo_ss7_asp_peer *peer, const char *host)
Find the exact IP address match and return its index in the array.
Definition: osmo_ss7_asp_peer.c:285
int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv)
Definition: osmo_ss7_asp.c:1075
int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp)
Definition: osmo_ss7_asp.c:283
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: osmo_ss7_asp.c:462
ss7_asp_ctr
Definition: ss7_internal.h:48
@ SS7_ASP_CTR_PKT_TX_TOTAL
Definition: ss7_internal.h:51
@ SS7_ASP_CTR_PKT_RX_UNKNOWN
Definition: ss7_internal.h:50
@ SS7_ASP_CTR_PKT_RX_TOTAL
Definition: ss7_internal.h:49
int ss7_route_set_linkset(struct osmo_ss7_route *rt, const char *linkset_name)
Set linkset on route entry.
Definition: osmo_ss7.c:717
bool ss7_ipv6_sctp_supported(const char *host, bool bind)
Definition: osmo_ss7.c:1085
int ss7_asp_xua_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: osmo_ss7_asp.c:821
int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp)
Definition: osmo_ss7_asp.c:241
int ss7_asp_get_fd(const struct osmo_ss7_asp *asp)
Get the fd of a given ASP.
Definition: osmo_ss7_asp.c:1236
int ss7_asp_ipa_srv_conn_rx_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg)
Definition: osmo_ss7_asp.c:799
uint32_t ss7_find_free_l_rk_id(struct osmo_ss7_instance *inst)
Definition: osmo_ss7.c:83
bool ss7_initialized
Definition: osmo_ss7.c:59
int xua_tcp_segmentation_cb(struct msgb *msg)
Definition: osmo_ss7_asp.c:871
int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx)
Definition: osmo_ss7_asp.c:197
bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs)
Definition: osmo_ss7_xua_srv.c:345
int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx)
Definition: osmo_ss7_asp.c:219
struct osmo_ss7_as * ss7_as_alloc(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto)
Allocate an Application Server.
Definition: osmo_ss7_as.c:70
bool ss7_asp_protocol_check_trans_proto(enum osmo_ss7_asp_protocol proto, int trans_proto)
Definition: osmo_ss7_asp.c:132
int ss7_default_trans_proto_for_asp_proto(enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7_asp.c:156
struct osmo_ss7_asp * ss7_asp_alloc(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, int trans_proto, enum osmo_ss7_asp_protocol proto)
Definition: osmo_ss7_asp.c:532
ss7_as_ctr
Definition: ss7_internal.h:43
@ SS7_AS_CTR_RX_MSU_TOTAL
Definition: ss7_internal.h:44
@ SS7_AS_CTR_TX_MSU_TOTAL
Definition: ss7_internal.h:45
bool ss7_asp_peer_match_host(const struct osmo_ss7_asp_peer *peer, const char *host, bool host_is_v6)
Definition: osmo_ss7_asp_peer.c:266
int ss7_route_insert(struct osmo_ss7_route *rt)
Insert route into its routing table.
Definition: osmo_ss7.c:840
struct osmo_ss7_route * ss7_route_alloc(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask)
Allocate a route entry.
Definition: osmo_ss7.c:682
bool ss7_asp_set_default_peer_hosts(struct osmo_ss7_asp *asp)
Definition: osmo_ss7_asp.c:394
Definition: osmo_ss7.h:300
char * name
Definition: osmo_ss7.h:318
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:320
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:303
Definition: osmo_ss7.h:365
Definition: osmo_ss7.h:390
enum osmo_ss7_asp_protocol proto
Definition: osmo_ss7.h:431
struct osmo_ss7_instance * inst
Definition: osmo_ss7.h:393
char * name
Definition: osmo_ss7.h:429
int trans_proto
The underlaying transport protocol (one of IPPROTO_*)
Definition: osmo_ss7.h:458
Definition: osmo_ss7.h:73
Definition: osmo_ss7.h:44
Definition: osmo_ss7.h:207
uint32_t pc
Definition: osmo_ss7.h:222
uint32_t mask
Definition: osmo_ss7.h:223
char * linkset_name
human-specified linkset name
Definition: osmo_ss7.h:225
Definition: osmo_ss7.h:541