libosmo-sigtran 2.3.0.61-fb14d
Osmocom SIGTRAN library
ss7_route_table.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <unistd.h>
5#include <osmocom/core/linuxlist.h>
6
7/***********************************************************************
8 * SS7 Routing Tables
9 ***********************************************************************/
10
11struct osmo_ss7_as;
12struct osmo_ss7_linkset;
16
17/* Q.703 3.1.4 Message labelling
18 * Q.704 2.2 Routing label
19 * Q.704 15.2 Label */
20#define OSMO_SS7_RTLABEL_SLS_UNSET 0
22 uint32_t opc; /* Q.704 2.2.3 */
23 uint32_t dpc; /* Q.704 2.2.3 */
24 uint8_t sls; /* Q.704 2.2.4 */
25};
26char *ss7_route_label_to_str(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, const struct osmo_ss7_route_label *rtlb);
27
28/* MTP3 Label: SI + Routing Label + User Part specific label
29 * Q.703 3.1.4 Message labelling
30 * Q.704 2.1.5, 2.1.6, 2.3.1
31 * Q.704 14.1 (Common characteristics of message signal unit formats) */
34 uint8_t sio; /* Q.704 14.2 Service information octet */
35#if 0
36 union { /* Q.704 14.3 Label (User Part labels) */
37 struct { /* si = MTP_SI_SCCP */
38 uint32_t ssn;
39 } sccp;
40 } u;
41#endif
42};
43char *ss7_mtp3_rtlabel_to_str(char *buf, size_t buf_len,
44 const struct osmo_ss7_instance *inst,
45 const struct ss7_mtp3_rtlabel *rtlb);
47 const struct osmo_mtp_transfer_param *param);
49 const struct ss7_mtp3_rtlabel *rtlb);
50
53 struct llist_head list;
57 struct llist_head combined_linksets;
58
59 struct {
60 char *name;
62 } cfg;
63};
64
70
71struct osmo_ss7_route *
73 uint32_t mask, bool dynamic);
74struct osmo_ss7_route *
76 uint32_t mask, const struct osmo_ss7_as *as, bool dynamic);
77struct osmo_ss7_route *
79 const struct ss7_mtp3_rtlabel *rtlabel);
80bool ss7_route_table_dpc_is_accessible(const struct osmo_ss7_route_table *rtbl, uint32_t dpc);
81bool ss7_route_table_dpc_is_accessible_via_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, const struct osmo_ss7_as *as);
82bool ss7_route_table_dpc_is_accessible_skip_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, const struct osmo_ss7_as *as);
83
85ss7_route_table_find_combined_linkset(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, uint32_t prio);
87ss7_route_table_find_or_create_combined_linkset(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask, uint32_t prio);
93ss7_route_table_find_combined_linkset(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, uint32_t prio);
94
96 const struct osmo_ss7_as *as, uint32_t dpc);
uint32_t dpc
Definition: m3ua.h:1
osmo_ss7_route_status
Definition: ss7_route.h:20
struct osmo_ss7_combined_linkset * ss7_route_table_find_combined_linkset(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, uint32_t prio)
Definition: ss7_route_table.c:256
void mtp3_rtlabel_to_mtp_xfer_param(struct osmo_mtp_transfer_param *param, const struct ss7_mtp3_rtlabel *rtlb)
Definition: ss7_route_table.c:82
struct osmo_ss7_route * ss7_route_table_lookup_route(const struct osmo_ss7_route_table *rtbl, const struct ss7_mtp3_rtlabel *rtlabel)
Definition: ss7_route_table.c:345
char * ss7_mtp3_rtlabel_to_str(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, const struct ss7_mtp3_rtlabel *rtlb)
Definition: ss7_route_table.c:53
struct osmo_ss7_combined_linkset * ss7_route_table_find_combined_linkset_by_dpc_mask(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask)
Definition: ss7_route_table.c:235
void ss7_route_table_del_routes_by_as(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_as *as)
Definition: ss7_route_table.c:307
char * ss7_route_label_to_str(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, const struct osmo_ss7_route_label *rtlb)
Definition: ss7_route_table.c:39
void ss7_route_table_update_route_status_by_as(const struct osmo_ss7_route_table *rtbl, enum osmo_ss7_route_status status, const struct osmo_ss7_as *as, uint32_t dpc)
Definition: ss7_route_table.c:287
void mtp_xfer_param_to_mtp3_rtlabel(struct ss7_mtp3_rtlabel *rtlb, const struct osmo_mtp_transfer_param *param)
Definition: ss7_route_table.c:69
struct osmo_ss7_combined_linkset * ss7_route_table_find_or_create_combined_linkset(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask, uint32_t prio)
Definition: ss7_route_table.c:278
bool ss7_route_table_dpc_is_accessible(const struct osmo_ss7_route_table *rtbl, uint32_t dpc)
Definition: ss7_route_table.c:374
bool ss7_route_table_dpc_is_accessible_skip_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, const struct osmo_ss7_as *as)
Definition: ss7_route_table.c:414
struct osmo_ss7_route * ss7_route_table_find_route_by_dpc_mask_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, const struct osmo_ss7_as *as, bool dynamic)
Find a SS7 route for given destination point code + mask in given table via given AS.
Definition: ss7_route_table.c:185
void ss7_route_table_del_routes_by_linkset(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_linkset *lset)
Definition: ss7_route_table.c:325
struct osmo_ss7_combined_linkset * ss7_route_table_find_combined_linkset_by_dpc(const struct osmo_ss7_route_table *rtbl, uint32_t dpc)
Definition: ss7_route_table.c:216
void ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
Definition: ss7_route_table.c:139
struct osmo_ss7_route * ss7_route_table_find_route_by_dpc_mask(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, bool dynamic)
Find a SS7 route for given destination point code + mask in given table.
Definition: ss7_route_table.c:152
bool ss7_route_table_dpc_is_accessible_via_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, const struct osmo_ss7_as *as)
Definition: ss7_route_table.c:391
struct osmo_ss7_route_table * ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
Definition: ss7_route_table.c:127
struct osmo_ss7_route_table * ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
Definition: ss7_route_table.c:115
Definition: mtp_sap.h:49
Definition: ss7_as.h:105
Definition: ss7_combined_linkset.h:25
uint32_t mask
Definition: ss7_combined_linkset.h:41
Definition: ss7_instance.h:47
Definition: ss7_linkset.h:13
Definition: ss7_route_table.h:21
uint32_t dpc
Definition: ss7_route_table.h:23
uint32_t opc
Definition: ss7_route_table.h:22
uint8_t sls
Definition: ss7_route_table.h:24
Definition: ss7_route_table.h:51
struct llist_head list
member in list of routing tables
Definition: ss7_route_table.h:53
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: ss7_route_table.h:55
struct llist_head combined_linksets
list of osmo_ss7_combined_linksets
Definition: ss7_route_table.h:57
struct osmo_ss7_route_table::@38 cfg
char * description
Definition: ss7_route_table.h:61
char * name
Definition: ss7_route_table.h:60
Definition: ss7_route.h:29
struct osmo_ss7_as * as
pointer to Application Server
Definition: ss7_route.h:45
uint32_t mask
Definition: ss7_route.h:51
Definition: ss7_route_table.h:32
uint8_t sio
Definition: ss7_route_table.h:34
struct osmo_ss7_route_label rtlabel
Definition: ss7_route_table.h:33
uint8_t ssn
Definition: tcap_as_loadshare.c:3
uint32_t pc
Definition: tcap_as_loadshare.c:2