libosmo-sigtran: src/ss7_route_table.h Source File

libosmo-sigtran 2.2.1.95-893c 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_instance;
12enum osmo_ss7_route_status;
13
14 struct osmo_ss7_route_label {
15 uint32_t opc;
16 uint32_t dpc;
17 uint8_t sls;
18};
19char *ss7_route_label_to_str(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, const struct osmo_ss7_route_label *rtlb);
20
21 struct osmo_ss7_route_table {
23 struct llist_head list;
25 struct osmo_ss7_instance *inst;
27 struct llist_head combined_linksets;
28
29 struct {
30 char *name;
31 char *description;
32 } cfg;
33};
34
35struct osmo_ss7_route_table *
36 ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name);
37struct osmo_ss7_route_table *
38 ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name);
39void ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl);
40
41struct osmo_ss7_route *
42 ss7_route_table_find_route_by_dpc_mask(const struct osmo_ss7_route_table *rtbl, uint32_t dpc,
43 uint32_t mask, bool dynamic);
44struct osmo_ss7_route *
45 ss7_route_table_find_route_by_dpc_mask_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc,
46 uint32_t mask, const struct osmo_ss7_as *as, bool dynamic);
47struct osmo_ss7_route *
48 ss7_route_table_lookup_route(const struct osmo_ss7_route_table *rtbl, const struct osmo_ss7_route_label *rtlabel);
49bool ss7_route_table_dpc_is_accessible(const struct osmo_ss7_route_table *rtbl, uint32_t dpc);
50bool ss7_route_table_dpc_is_accessible_via_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, const struct osmo_ss7_as *as);
51bool ss7_route_table_dpc_is_accessible_skip_as(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, const struct osmo_ss7_as *as);
52
53struct osmo_ss7_combined_linkset *
54 ss7_route_table_find_combined_linkset(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, uint32_t prio);
55struct osmo_ss7_combined_linkset *
56 ss7_route_table_find_or_create_combined_linkset(struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask, uint32_t prio);
57struct osmo_ss7_combined_linkset *
58 ss7_route_table_find_combined_linkset_by_dpc(const struct osmo_ss7_route_table *rtbl, uint32_t dpc);
59struct osmo_ss7_combined_linkset *
60 ss7_route_table_find_combined_linkset_by_dpc_mask(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask);
61struct osmo_ss7_combined_linkset *
62 ss7_route_table_find_combined_linkset(const struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, uint32_t prio);
63
64void ss7_route_table_update_route_status_by_as(const struct osmo_ss7_route_table *rtbl, enum osmo_ss7_route_status status,
65 const struct osmo_ss7_as *as, uint32_t dpc);
66void ss7_route_table_del_routes_by_as(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_as *as);
67void ss7_route_table_del_routes_by_linkset(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_linkset *lset);
dpc
uint32_t dpc
Definition: m3ua.h:1
osmo_ss7_route_status
osmo_ss7_route_status
Definition: ss7_route.h:19
ss7_route_table_find_combined_linkset
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:216
ss7_route_table_find_combined_linkset_by_dpc_mask
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:195
ss7_route_table_del_routes_by_as
void ss7_route_table_del_routes_by_as(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_as *as)
Definition: ss7_route_table.c:267
ss7_route_label_to_str
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
ss7_route_table_update_route_status_by_as
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:247
ss7_route_table_find_or_create_combined_linkset
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:238
ss7_route_table_dpc_is_accessible
bool ss7_route_table_dpc_is_accessible(const struct osmo_ss7_route_table *rtbl, uint32_t dpc)
Definition: ss7_route_table.c:330
ss7_route_table_dpc_is_accessible_skip_as
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:370
ss7_route_table_find_route_by_dpc_mask_as
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:145
ss7_route_table_del_routes_by_linkset
void ss7_route_table_del_routes_by_linkset(struct osmo_ss7_route_table *rtbl, struct osmo_ss7_linkset *lset)
Definition: ss7_route_table.c:285
ss7_route_table_find_combined_linkset_by_dpc
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:176
ss7_route_table_destroy
void ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
Definition: ss7_route_table.c:99
ss7_route_table_lookup_route
struct osmo_ss7_route * ss7_route_table_lookup_route(const struct osmo_ss7_route_table *rtbl, const struct osmo_ss7_route_label *rtlabel)
Definition: ss7_route_table.c:305
ss7_route_table_find_route_by_dpc_mask
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:112
ss7_route_table_dpc_is_accessible_via_as
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:347
ss7_route_table_find_or_create
struct osmo_ss7_route_table * ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
Definition: ss7_route_table.c:87
ss7_route_table_find
struct osmo_ss7_route_table * ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
Definition: ss7_route_table.c:75
osmo_ss7_as
Definition: ss7_as.h:95
osmo_ss7_combined_linkset
Definition: ss7_combined_linkset.h:25
osmo_ss7_combined_linkset::mask
uint32_t mask
Definition: ss7_combined_linkset.h:41
osmo_ss7_instance
Definition: ss7_instance.h:47
osmo_ss7_linkset
Definition: ss7_linkset.h:13
osmo_ss7_route_label
Definition: ss7_route_table.h:14
osmo_ss7_route_label::dpc
uint32_t dpc
Definition: ss7_route_table.h:16
osmo_ss7_route_label::opc
uint32_t opc
Definition: ss7_route_table.h:15
osmo_ss7_route_label::sls
uint8_t sls
Definition: ss7_route_table.h:17
osmo_ss7_route_table
Definition: ss7_route_table.h:21
osmo_ss7_route_table::list
struct llist_head list
member in list of routing tables
Definition: ss7_route_table.h:23
osmo_ss7_route_table::inst
struct osmo_ss7_instance * inst
osmo_ss7_instance to which we belong
Definition: ss7_route_table.h:25
osmo_ss7_route_table::combined_linksets
struct llist_head combined_linksets
list of osmo_ss7_combined_linksets
Definition: ss7_route_table.h:27
osmo_ss7_route_table::cfg
struct osmo_ss7_route_table::@38 cfg
osmo_ss7_route_table::description
char * description
Definition: ss7_route_table.h:31
osmo_ss7_route_table::name
char * name
Definition: ss7_route_table.h:30
osmo_ss7_route
Definition: ss7_route.h:28
osmo_ss7_route::as
struct osmo_ss7_as * as
pointer to Application Server
Definition: ss7_route.h:44
osmo_ss7_route::mask
uint32_t mask
Definition: ss7_route.h:50
pc
uint32_t pc
Definition: tcap_as_loadshare.c:2