libosmo-sigtran 2.1.0.165-6ea6 Osmocom SIGTRAN library

ss7_instance.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5#include <osmocom/core/linuxlist.h>
6
7/***********************************************************************
8 * SS7 Instances
9 ***********************************************************************/
10
11struct osmo_ss7_user;
12struct osmo_ss7_route_table;
13struct osmo_ss7_route_label;
14struct osmo_sccp_instance;
15
16 struct osmo_ss7_pc_fmt {
17 char delimiter;
18 uint8_t component_len[3];
19};
20
21 struct osmo_ss7_instance {
23 struct llist_head list;
25 struct llist_head linksets;
27 struct llist_head as_list;
29 struct llist_head asp_list;
31 struct llist_head rtable_list;
33 struct llist_head xua_servers;
34 /* array for faster lookup of user (indexed by service
35 * indicator) */
36 const struct osmo_ss7_user *user[16];
37
38 struct osmo_ss7_route_table *rtable_system;
39
40 struct osmo_sccp_instance *sccp;
41
42 struct {
43 uint32_t id;
44 char *name;
45 char *description;
46 uint32_t primary_pc;
47 /* capability PCs */
48 uint8_t network_indicator;
49 struct osmo_ss7_pc_fmt pc_fmt;
50 bool permit_dyn_rkm_alloc;
51 struct llist_head sccp_address_book;
52 uint32_t secondary_pc;
53 /* How many bits from ITU OPC/DPC field (starting from least-significant-bit)
54 * to skip for routing decisions (always takes 6 bits).
55 * range 0-8, defaults to 0, which means take least significant 6 bits. */
56 uint8_t opc_shift;
57 uint8_t dpc_shift;
58 /* How many bits from ITU SLS field (starting from least-significant-bit)
59 * to skip for routing decisions.
60 * range 0-3, defaults to 0, which means take all 4 bits. */
61 uint8_t sls_shift;
62 } cfg;
63};
64
65struct osmo_ss7_instance *
66 ss7_instance_alloc(void *ctx, uint32_t id);
67
68uint32_t ss7_find_free_l_rk_id(struct osmo_ss7_instance *inst);
69struct osmo_ss7_route *
70 ss7_instance_lookup_route(struct osmo_ss7_instance *inst, const struct osmo_ss7_route_label *rtlabel);
71
72#define _LOGSS7(inst, subsys, level, fmt, args ...) \
73 LOGP(subsys, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
74#define LOGSS7(inst, level, fmt, args ...) \
75 _LOGSS7(inst, DLSS7, level, fmt, ## args)
ss7_instance_lookup_route
struct osmo_ss7_route * ss7_instance_lookup_route(struct osmo_ss7_instance *inst, const struct osmo_ss7_route_label *rtlabel)
Find a SS7 route for given destination point code in given SS7.
Definition: ss7_instance.c:208
ss7_find_free_l_rk_id
uint32_t ss7_find_free_l_rk_id(struct osmo_ss7_instance *inst)
Definition: ss7_instance.c:195
ss7_instance_alloc
struct osmo_ss7_instance * ss7_instance_alloc(void *ctx, uint32_t id)
Definition: ss7_instance.c:53
osmo_sccp_instance
Definition: sccp_instance.h:47
osmo_ss7_instance
Definition: ss7_instance.h:21
osmo_ss7_instance::sccp
struct osmo_sccp_instance * sccp
Definition: ss7_instance.h:40
osmo_ss7_instance::secondary_pc
uint32_t secondary_pc
Definition: ss7_instance.h:52
osmo_ss7_instance::rtable_system
struct osmo_ss7_route_table * rtable_system
Definition: ss7_instance.h:38
osmo_ss7_instance::dpc_shift
uint8_t dpc_shift
Definition: ss7_instance.h:57
osmo_ss7_instance::linksets
struct llist_head linksets
list of osmo_ss7_linkset
Definition: ss7_instance.h:25
osmo_ss7_instance::cfg
struct osmo_ss7_instance::@31 cfg
osmo_ss7_instance::name
char * name
Definition: ss7_instance.h:44
osmo_ss7_instance::primary_pc
uint32_t primary_pc
Definition: ss7_instance.h:46
osmo_ss7_instance::pc_fmt
struct osmo_ss7_pc_fmt pc_fmt
Definition: ss7_instance.h:49
osmo_ss7_instance::as_list
struct llist_head as_list
list of osmo_ss7_as
Definition: ss7_instance.h:27
osmo_ss7_instance::rtable_list
struct llist_head rtable_list
list of osmo_ss7_route_table
Definition: ss7_instance.h:31
osmo_ss7_instance::network_indicator
uint8_t network_indicator
Definition: ss7_instance.h:48
osmo_ss7_instance::description
char * description
Definition: ss7_instance.h:45
osmo_ss7_instance::id
uint32_t id
Definition: ss7_instance.h:43
osmo_ss7_instance::sls_shift
uint8_t sls_shift
Definition: ss7_instance.h:61
osmo_ss7_instance::asp_list
struct llist_head asp_list
list of osmo_ss7_asp
Definition: ss7_instance.h:29
osmo_ss7_instance::user
const struct osmo_ss7_user * user[16]
Definition: ss7_instance.h:36
osmo_ss7_instance::permit_dyn_rkm_alloc
bool permit_dyn_rkm_alloc
Definition: ss7_instance.h:50
osmo_ss7_instance::sccp_address_book
struct llist_head sccp_address_book
Definition: ss7_instance.h:51
osmo_ss7_instance::opc_shift
uint8_t opc_shift
Definition: ss7_instance.h:56
osmo_ss7_instance::list
struct llist_head list
member of global list of instances
Definition: ss7_instance.h:23
osmo_ss7_instance::xua_servers
struct llist_head xua_servers
list of osmo_xua_servers
Definition: ss7_instance.h:33
osmo_ss7_pc_fmt
Definition: ss7_instance.h:16
osmo_ss7_pc_fmt::delimiter
char delimiter
Definition: ss7_instance.h:17
osmo_ss7_pc_fmt::component_len
uint8_t component_len[3]
Definition: ss7_instance.h:18
osmo_ss7_route_label
Definition: ss7_route_table.h:14
osmo_ss7_route_table
Definition: ss7_route_table.h:21
osmo_ss7_route
Definition: ss7_route.h:28
osmo_ss7_user
Definition: ss7_user.h:13