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>
8
9struct xua_msg;
10
11#define TCAP_PC_WILDCARD 0xffffffff
12#define TCAP_SSN_WILDCARD 0
13
14#ifdef WITH_TCAP_LOADSHARING
15
16struct 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 */
26int ipa_rx_msg_osmo_ext_tcap_routing(struct osmo_ss7_asp *asp, struct msgb *msg);
27
28bool tcap_range_matches(const struct tcap_range *tcrng, uint32_t tid);
29bool tcap_range_overlaps(const struct tcap_range *a, uint32_t tid_min, uint32_t tid_max);
30
31struct 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);
33void tcap_range_free(struct tcap_range *tcrng);
34
35/* Traffic ASP -> AS -> STP (Rx path) From TCAP Routing AS, only used for connection tracking */
36int 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 */
39int 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 */
42void tcap_asp_down(struct osmo_ss7_asp *asp);
43
44void tcap_enable(struct osmo_ss7_as *as);
45void tcap_disable(struct osmo_ss7_as *as);
46
47#else
48
50 struct osmo_ss7_asp **asp, struct osmo_ss7_as *as, struct xua_msg *xua) { return -EPROTONOSUPPORT; };
51static 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; };
55static inline void tcap_asp_down(struct osmo_ss7_asp *asp) {};
56static inline void tcap_enable(struct osmo_ss7_as *as) {};
57static inline void tcap_disable(struct osmo_ss7_as *as) {};
58
59#endif /* WITH_TCAP_LOADSHARING */
uint32_t dpc
Definition m3ua.h:1
uint32_t opc
Definition m3ua.h:0
uint32_t tid_start
Definition ss7_as_loadshare_tcap.c:0
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
uint8_t ssn
Definition ss7_as_loadshare_tcap.c:3
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
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
void tcap_range_free(struct tcap_range *tcrng)
Remove and free a single TCAP range entry.
Definition ss7_as_loadshare_tcap.c:867
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
uint32_t tid_end
Definition ss7_as_loadshare_tcap.c:1
uint32_t pc
Definition ss7_as_loadshare_tcap.c:2
static void tcap_enable(struct osmo_ss7_as *as)
Definition ss7_as_loadshare_tcap.h:56
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
static void tcap_asp_down(struct osmo_ss7_asp *asp)
Definition ss7_as_loadshare_tcap.h:55
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
static void tcap_disable(struct osmo_ss7_as *as)
Definition ss7_as_loadshare_tcap.h:57
Definition ss7_as.h:76
Definition ss7_asp.h:42
Definition xua_msg.h:31