TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
trib.h File Reference

Telephony Routing Information Base. More...

#include <protocol/protocol.h>
#include "pib.h"
#include <stddef.h>
#include <time.h>
Include dependency graph for trib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  entry_attrs_t
 Groupable attributes that are related to a route. More...
struct  entry_t
 Route Entry. More...
struct  table_t
 Route Table. More...
struct  entry_group_t
struct  trib_t
 Telephony Routing Information Base. More...

Macros

#define ATTR_USED_NEXTHOP   0b1
#define ATTR_USED_ADVERTPATH   0b10
#define ATTR_USED_ROUTEDPATH   0b100
#define ATTR_USED_LOCALPREF   0b1000
#define ATTR_USED_METRIC   0b10000
#define ATTR_USED_COMMUNITIES   0b100000
#define ATTR_IS_USED_NEXTHOP(x)
#define ATTR_IS_USED_ADVERTPATH(x)
#define ATTR_IS_USED_ROUTEDPATH(x)
#define ATTR_IS_USED_LOCALPREF(x)
#define ATTR_IS_USED_METRIC(x)
#define ATTR_IS_USED_COMMUNITIES(x)

Enumerations

enum  entry_type_t { ENTRY_TYPE_TRIP , ENTRY_TYPE_CONNECTED , ENTRY_TYPE_STATIC }

Functions

void entry_destroy (entry_t *entry)
 Destroy entry.
void trib_table_deinit (table_t *t)
 Deinitialize table.
trib_ttrib_new (uint32_t local_itad)
 Initialize TRIB structure.
void trib_adj_pair_add (trib_t *trib, table_t *in, table_t *out)
 Add and init pair of tables owned by caller.
void trib_adj_pair_remove (trib_t *trib, table_t *in, table_t *out)
void trib_destroy (trib_t *trib)
 Deinit TRIB structure.
void trib_table_insert (table_t *table, entry_t *route)
 Add route to table.
void trib_table_clear (table_t *table)
 Destroy all entries and clear table.
void trib_update_local (trib_t *trib)
 Update local routes when ITAD is defined.
void trib_update_adj_out (trib_t *trib, table_t *adj_trib_out)
 Update an Adj-TRIB-Out.
void trib_update_full (trib_t *trib)
 Execute route selection.
size_t get_new_entries (const table_t *table, entry_t ***new_ents_out)
 Return array of new entry references to new.
size_t group_entries_by_attrs (entry_t **entries, size_t entries_size, entry_group_t **groups_out)
 Group array of entry references by attributes.

Detailed Description

Telephony Routing Information Base.

Macro Definition Documentation

◆ ATTR_IS_USED_ADVERTPATH

#define ATTR_IS_USED_ADVERTPATH ( x)
Value:
(((x) >> 1) & 1)

◆ ATTR_IS_USED_COMMUNITIES

#define ATTR_IS_USED_COMMUNITIES ( x)
Value:
(((x) >> 5) & 1)

◆ ATTR_IS_USED_LOCALPREF

#define ATTR_IS_USED_LOCALPREF ( x)
Value:
(((x) >> 3) & 1)

◆ ATTR_IS_USED_METRIC

#define ATTR_IS_USED_METRIC ( x)
Value:
(((x) >> 4) & 1)

◆ ATTR_IS_USED_NEXTHOP

#define ATTR_IS_USED_NEXTHOP ( x)
Value:
(((x) >> 0) & 1)

◆ ATTR_IS_USED_ROUTEDPATH

#define ATTR_IS_USED_ROUTEDPATH ( x)
Value:
(((x) >> 2) & 1)

Function Documentation

◆ get_new_entries()

size_t get_new_entries ( const table_t * table,
entry_t *** new_ents_out )

Return array of new entry references to new.

Allocates array of references and assigns it to new_ents_out

Parameters
tableTable with new entries
new_ents_outWhere to put entry references
Returns
Number of new entries
Here is the caller graph for this function:

◆ group_entries_by_attrs()

size_t group_entries_by_attrs ( entry_t ** entries,
size_t entries_size,
entry_group_t ** groups_out )

Group array of entry references by attributes.

Parameters
entriesInput array
entries_sizeInput array size
groups_outOutput entry reference groups
Returns
Number of groups
Here is the caller graph for this function:

◆ trib_update_adj_out()

void trib_update_adj_out ( trib_t * trib,
table_t * adj_trib_out )

Update an Adj-TRIB-Out.

For use when a new peer connets and we have to UPDATE it without triggering a full update

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trib_update_full()

void trib_update_full ( trib_t * trib)

Execute route selection.

Takes Ext-TRIBs-in and locala routes Updates Ext-TRIB, Loc-TRIB, optimized Loc-TRIB and Ext-TRIBs-out

Here is the call graph for this function:
Here is the caller graph for this function: