libosmo-sigtran 2.0.0.52-6412
Osmocom SIGTRAN library
|
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
Go to the source code of this file.
Data Structures | |
struct | osmo_ss7_route |
Macros | |
#define | OSMO_SS7_ROUTE_PRIO_DEFAULT 5 |
Functions | |
struct osmo_ss7_route * | ss7_route_alloc (struct osmo_ss7_route_table *rtbl, uint32_t pc, uint32_t mask) |
Allocate a route entry. More... | |
struct osmo_ss7_route * | ss7_route_create (struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask, const char *linkset_name) |
Create a new route in the given routing table. More... | |
void | ss7_route_destroy (struct osmo_ss7_route *rt) |
Destroy a given SS7 route. More... | |
struct osmo_ss7_route * | ss7_route_find_dpc (struct osmo_ss7_route_table *rtbl, uint32_t dpc) |
struct osmo_ss7_route * | ss7_route_find_dpc_mask (struct osmo_ss7_route_table *rtbl, uint32_t dpc, uint32_t mask) |
int | ss7_route_set_linkset (struct osmo_ss7_route *rt, const char *linkset_name) |
Set linkset on route entry. More... | |
int | ss7_route_insert (struct osmo_ss7_route *rt) |
Insert route into its routing table. More... | |
#define OSMO_SS7_ROUTE_PRIO_DEFAULT 5 |
struct osmo_ss7_route * ss7_route_alloc | ( | struct osmo_ss7_route_table * | rtbl, |
uint32_t | pc, | ||
uint32_t | mask | ||
) |
Allocate a route entry.
[in] | rtbl | Routing Table where the route belongs |
[in] | pc | Point Code of the destination of the route |
[in] | mask | Mask of the destination Point Code pc |
The returned route has no linkset associated yet, user must associate it using API ss7_route_set_linkset() before inserting the route into its routing table.
Fields priority and qos_class may be set before inserting the route into its routing table:
Use API ss7_route_insert() to insert the route into its routing table.
The route entry allocated with this API can be destroyed/freed at any point using API ss7_route_destroy(), regardless of it being already inserted or not in its routing table.
References osmo_ss7_instance::cfg, osmo_ss7_route::cfg, osmo_ss7_route_table::inst, osmo_ss7_route::list, osmo_ss7_route::mask, osmo_ss7_pc_normalize(), OSMO_SS7_ROUTE_PRIO_DEFAULT, osmo_ss7_route::pc, osmo_ss7_instance::pc_fmt, osmo_ss7_route::priority, osmo_ss7_route::rtable, and ss7_initialized.
Referenced by DEFUN_ATTR(), and ss7_route_create().
struct osmo_ss7_route * ss7_route_create | ( | struct osmo_ss7_route_table * | rtbl, |
uint32_t | pc, | ||
uint32_t | mask, | ||
const char * | linkset_name | ||
) |
Create a new route in the given routing table.
[in] | rtbl | Routing Table in which the route is to be created |
[in] | pc | Point Code of the destination of the route |
[in] | mask | Mask of the destination Point Code pc |
[in] | linkset_name | string name of the linkset to be used |
The route allocated and returned by this API is already inserted into the routing table, with priority and qos-class set to 0. If you plan to use different values for priority and qos-class, avoid using this API and use ss7_route_alloc() + ss7_route_set_linkset() + ss7_route_insert() instead.
References osmo_ss7_route::linkset_name, osmo_ss7_route::mask, osmo_ss7_route::pc, ss7_route_alloc(), ss7_route_insert(), ss7_route_set_linkset(), and ss7_route_table_find_route_by_dpc_mask().
Referenced by _rout_key(), handle_rkey_reg(), ipa_add_route(), osmo_sccp_simple_client_on_ss7_id(), and osmo_sccp_simple_server_add_clnt().
void ss7_route_destroy | ( | struct osmo_ss7_route * | rt | ) |
Destroy a given SS7 route.
References osmo_ss7_route::cfg, osmo_ss7_route_table::inst, osmo_ss7_route::linkset_name, osmo_ss7_route::list, LOGSS7, osmo_ss7_route::mask, osmo_ss7_pointcode_print(), osmo_ss7_route::pc, osmo_ss7_route::rtable, ss7_initialized, and ss7_route_inserted().
Referenced by _rout_key(), DEFUN_ATTR(), handle_rkey_dereg(), handle_rkey_reg(), ipa_del_route(), osmo_sccp_simple_client_on_ss7_id(), osmo_sccp_simple_server_add_clnt(), ss7_route_table_del_routes_by_as(), and ss7_route_table_del_routes_by_linkset().
struct osmo_ss7_route * ss7_route_find_dpc | ( | struct osmo_ss7_route_table * | rtbl, |
uint32_t | dpc | ||
) |
struct osmo_ss7_route * ss7_route_find_dpc_mask | ( | struct osmo_ss7_route_table * | rtbl, |
uint32_t | dpc, | ||
uint32_t | mask | ||
) |
int ss7_route_insert | ( | struct osmo_ss7_route * | rt | ) |
Insert route into its routing table.
[in] | rt | Route to be inserted into its routing table |
A route is only really used once it has been inserted into its routing table.
References osmo_ss7_route::cfg, osmo_ss7_route_table::inst, osmo_ss7_route::linkset_name, LOGSS7, osmo_ss7_route::mask, osmo_ss7_pointcode_print(), osmo_ss7_route::pc, route_insert_sorted(), osmo_ss7_route::rtable, ss7_route_inserted(), and ss7_route_table_find_route_by_dpc_mask().
Referenced by DEFUN_ATTR(), and ss7_route_create().
int ss7_route_set_linkset | ( | struct osmo_ss7_route * | rt, |
const char * | linkset_name | ||
) |
Set linkset on route entry.
[in] | rt | Route to be configured |
[in] | linkset_name | string name of the linkset to be used |
References osmo_ss7_route::as, osmo_ss7_as::cfg, osmo_ss7_linkset::cfg, osmo_ss7_route::cfg, osmo_ss7_route::dest, osmo_ss7_route_table::inst, osmo_ss7_route::linkset, osmo_ss7_route::linkset_name, LOGSS7, osmo_ss7_route::mask, osmo_ss7_as::name, osmo_ss7_linkset::name, osmo_ss7_as_find_by_name(), osmo_ss7_pointcode_print(), osmo_ss7_route::pc, osmo_ss7_route::rtable, ss7_linkset_find_by_name(), and ss7_route_inserted().
Referenced by DEFUN_ATTR(), and ss7_route_create().