libosmo-sigtran  2.2.1
Osmocom SIGTRAN library
tcap_as_loadshare.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdint.h>
4 
5 #include <osmocom/core/msgb.h>
7 
8 struct xua_msg;
9 
10 #define TCAP_PC_WILDCARD 0xffffffff
11 #define TCAP_SSN_WILDCARD 0
12 
13 struct tcap_range {
14  struct hlist_node list;
15  struct osmo_ss7_asp *asp;
16  uint32_t tid_start;
17  uint32_t tid_end;
18  uint32_t pc;
19  uint8_t ssn;
20 };
21 
22 /* IPA entry point */
23 int ipa_rx_msg_osmo_ext_tcap_routing(struct osmo_ss7_asp *asp, struct msgb *msg);
24 
25 struct tcap_range *tcap_range_alloc(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp,
26  uint32_t tid_start, uint32_t tid_end, uint32_t pc, uint8_t ssn);
27 void tcap_range_free(struct tcap_range *tcrng);
28 
29 bool tcap_range_matches(const struct tcap_range *tcrng, uint32_t tid);
30 bool tcap_range_overlaps(const struct tcap_range *a, uint32_t tid_min, uint32_t tid_max);
31 
32 /* Traffic ASP -> AS -> STP (Rx path) From TCAP Routing AS, only used for connection tracking */
33 int tcap_as_rx_sccp_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, uint32_t opc, uint32_t dpc, struct msgb *sccp_msg);
34 
35 /* Traffic STP -> AS -> ASP (Tx path) Loadshare towards the TCAP routing AS */
36 int tcap_as_select_asp_loadshare(struct osmo_ss7_asp **asp, struct osmo_ss7_as *as, const struct xua_msg *xua);
37 
38 /* When the ASP got removed */
39 void tcap_as_del_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp);
40 
41 void tcap_enable(struct osmo_ss7_as *as);
42 void tcap_disable(struct osmo_ss7_as *as);
uint32_t dpc
Definition: m3ua.h:1
uint32_t opc
Definition: m3ua.h:0
Definition: ss7_as.h:86
Definition: ss7_asp.h:45
Definition: tcap_as_loadshare.h:13
uint8_t ssn
Definition: tcap_as_loadshare.h:19
uint32_t tid_start
Definition: tcap_as_loadshare.h:16
uint32_t tid_end
Definition: tcap_as_loadshare.h:17
struct osmo_ss7_asp * asp
Definition: tcap_as_loadshare.h:15
struct hlist_node list
Definition: tcap_as_loadshare.h:14
uint32_t pc
Definition: tcap_as_loadshare.h:18
Definition: xua_msg.h:31
uint32_t tid_start
Definition: tcap_as_loadshare.c:0
uint8_t ssn
Definition: tcap_as_loadshare.c:3
uint32_t tid_end
Definition: tcap_as_loadshare.c:1
uint32_t pc
Definition: tcap_as_loadshare.c:2
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: tcap_as_loadshare.c:832
void tcap_disable(struct osmo_ss7_as *as)
Definition: tcap_as_loadshare.c:926
void tcap_enable(struct osmo_ss7_as *as)
Definition: tcap_as_loadshare.c:917
int tcap_as_rx_sccp_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp, uint32_t opc, uint32_t dpc, struct msgb *sccp_msg)
Traffic from the TCAP ASP -> AS -> osmo-stp, only used to update transaction tracking.
Definition: tcap_as_loadshare.c:277
int tcap_as_select_asp_loadshare(struct osmo_ss7_asp **asp, struct osmo_ss7_as *as, const struct xua_msg *xua)
Entrypoint for M3UA messages towards the TCAP nodes.
Definition: tcap_as_loadshare.c:597
bool tcap_range_overlaps(const struct tcap_range *a, uint32_t tid_min, uint32_t tid_max)
Checks if a tid rnage overlaps with another range.
Definition: tcap_as_loadshare.c:882
bool tcap_range_matches(const struct tcap_range *tcrng, uint32_t tid)
Checks if a tid matches to a specific range.
Definition: tcap_as_loadshare.c:870
void tcap_range_free(struct tcap_range *tcrng)
Remove and free a single TCAP range entry.
Definition: tcap_as_loadshare.c:858
void tcap_as_del_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
Definition: tcap_as_loadshare.c:907
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: tcap_as_loadshare.c:707