TRIP Routing Daemon
TRIP (RFC 3219) Location Server Implementation
Loading...
Searching...
No Matches
trib.c File Reference
#include "trib.h"
#include "db/pib.h"
#include "protocol/protocol.h"
#include <logging/logging.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for trib.c:

Go to the source code of this file.

Macros

#define _COMPONENT_   "db"
#define INIT_TABLE_CAPACITY   256
#define INIT_ADJ_TRIBS_CAPACITY   32

Functions

entry_tentry_clone (const entry_t *entry)
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 *entry)
 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 entry_size, entry_group_t **groups_out)
 Group array of entry references by attributes.

Detailed Description

Telephony Routing Information Base, singleton

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: