libosmo-sigtran 2.1.0.172-a2b0 Osmocom SIGTRAN library

Loading...
Searching...
No Matches
ss7_as_loadshare_tcap.h
Go to the documentation of this file.
1#pragma once
2
3#include <complex.h>
4#include <stdint.h>
5
6#include <osmocom/core/msgb.h>
7#include <osmocom/sigtran/osmo_ss7.h>
8
9 struct xua_msg;
10
11#define TCAP_PC_WILDCARD 0xffffffff
12#define TCAP_SSN_WILDCARD 0
13
14#ifdef WITH_TCAP_LOADSHARING
15
16 struct tcap_range {
17 struct hlist_node list;
18 struct osmo_ss7_asp *asp;
19 uint32_t tid_start;
20 uint32_t tid_end;
21 uint32_t pc;
22 uint8_t ssn;
23};
24
25/* IPA entry point */
26 int ipa_rx_msg_osmo_ext_tcap_routing(struct osmo_ss7_asp *asp, struct msgb *msg);
27
28 bool tcap_range_matches(const struct tcap_range *tcrng, uint32_t tid);
29 bool tcap_range_overlaps(const struct tcap_range *a, uint32_t tid_min, uint32_t tid_max);
30
31 struct tcap_range *tcap_range_alloc(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp,
32 uint32_t tid_start, uint32_t tid_end, uint32_t pc, uint8_t ssn);
33 void tcap_range_free(struct tcap_range *tcrng);
34
35/* Traffic ASP -> AS -> STP (Rx path) From TCAP Routing AS, only used for connection tracking */
36 int ss7_asp_tcap_rx_sccp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, uint32_t opc, uint32_t dpc, struct msgb *sccp_msg);
37
38/* Traffic STP -> AS -> ASP (Tx path) Loadshare towards the TCAP routing AS */
39 int ss7_as_select_asp_loadshare_tcap(struct osmo_ss7_asp **asp, struct osmo_ss7_as *as, struct xua_msg *xua);
40
41/* When the ASP got removed */
42 void tcap_asp_down(struct osmo_ss7_asp *asp);
43
44 void tcap_enable(struct osmo_ss7_as *as);
45 void tcap_disable(struct osmo_ss7_as *as);
46
47#else
48
49 static inline int ss7_as_select_asp_loadshare_tcap(
50 struct osmo_ss7_asp **asp, struct osmo_ss7_as *as, struct xua_msg *xua) { return -EPROTONOSUPPORT; };
51 static inline int ss7_asp_tcap_rx_sccp(
52 struct osmo_ss7_as *as, struct osmo_ss7_asp *asp,
53 uint32_t opc, uint32_t dpc,
54 struct msgb *sccp_msg) { return -EINVAL; };
55 static inline void tcap_asp_down(struct osmo_ss7_asp *asp) {};
56 static inline void tcap_enable(struct osmo_ss7_as *as) {};
57 static inline void tcap_disable(struct osmo_ss7_as *as) {};
58
59#endif /* WITH_TCAP_LOADSHARING */
dpc
uint32_t dpc
Definition m3ua.h:1
opc
uint32_t opc
Definition m3ua.h:0
osmo_ss7.h
tid_start
uint32_t tid_start
Definition ss7_as_loadshare_tcap.c:0
tcap_range_overlaps
bool tcap_range_overlaps(const struct tcap_range *a, uint32_t tid_start, uint32_t tid_end)
Checks if a tid rnage overlaps with another range.
Definition ss7_as_loadshare_tcap.c:820
ssn
uint8_t ssn
Definition ss7_as_loadshare_tcap.c:3
tcap_range_matches
bool tcap_range_matches(const struct tcap_range *tcrng, uint32_t tid)
Checks if a tid matches to a specific range.
Definition ss7_as_loadshare_tcap.c:808
tcap_range_alloc
struct tcap_range * tcap_range_alloc(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, uint32_t tid_start, uint32_t tid_end, uint32_t pc, uint8_t ssn)
Create and alloc a new TCAP range entry.
Definition ss7_as_loadshare_tcap.c:841
tcap_range_free
void tcap_range_free(struct tcap_range *tcrng)
Remove and free a single TCAP range entry.
Definition ss7_as_loadshare_tcap.c:867
ipa_rx_msg_osmo_ext_tcap_routing
int ipa_rx_msg_osmo_ext_tcap_routing(struct osmo_ss7_asp *asp, struct msgb *msg)
Entrypoint for IPA TCAP Routing messages, parses and handles those.
Definition ss7_as_loadshare_tcap.c:724
tid_end
uint32_t tid_end
Definition ss7_as_loadshare_tcap.c:1
pc
uint32_t pc
Definition ss7_as_loadshare_tcap.c:2
tcap_enable
static void tcap_enable(struct osmo_ss7_as *as)
Definition ss7_as_loadshare_tcap.h:56
ss7_asp_tcap_rx_sccp
static int ss7_asp_tcap_rx_sccp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, uint32_t opc, uint32_t dpc, struct msgb *sccp_msg)
Definition ss7_as_loadshare_tcap.h:51
tcap_asp_down
static void tcap_asp_down(struct osmo_ss7_asp *asp)
Definition ss7_as_loadshare_tcap.h:55
ss7_as_select_asp_loadshare_tcap
static int ss7_as_select_asp_loadshare_tcap(struct osmo_ss7_asp **asp, struct osmo_ss7_as *as, struct xua_msg *xua)
Definition ss7_as_loadshare_tcap.h:49
tcap_disable
static void tcap_disable(struct osmo_ss7_as *as)
Definition ss7_as_loadshare_tcap.h:57
osmo_ss7_as
Definition ss7_as.h:76
osmo_ss7_asp
Definition ss7_asp.h:42
xua_msg
Definition xua_msg.h:31