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

Go to the source code of this file.

Macros

#define _COMPONENT_   "db"
#define INIT_VEC_CAPACITY   16
#define VEC_ENSURE_CAPACITY(vec, size, capacity, type)
 Ensure vector has at least 1 free slot for new element.

Functions

pib_tpib_new ()
 Initialize PIB.
void pib_destroy (pib_t *pib)
 Deinitialize PIB.
acl_tpib_acl_new (pib_t *pib, const char *name)
 Create and insert ACL into PIB.
routemap_tpib_routemap_new (pib_t *pib, const char *name, int deny)
 Create and insert route map into PIB.
acl_tpib_acl_find (const pib_t *pib, const char *name)
 Find an ACL by name.
routemap_tpib_routemap_find (const pib_t *pib, const char *name)
 Find a route map by name.
void acl_insert (acl_t *acl, int deny, const char *expression)
 Create and insert entry into ACL.
acl_entry_tacl_find (const acl_t *acl, const char *expression)
 Find entry in ACL.
int acl_entry_match (const char *expr, const char *target)
 Match target against ACL expression.
int acl_check (const acl_t *acl, const char *target)
 Check target against ACL.
routemap_matcher_troutemap_statement_matcher_new (routemap_statement_t *statement, int af)
 Allocate a matcher in a route map statement.
void routemap_statement_insert_action (routemap_statement_t *statement, const routemap_action_t *action)
 Insert action (copy) into route map.
void routemap_statement_action_deinit (routemap_action_t *action)
 Deinit route map action.
void routemap_matcher_insert (routemap_matcher_t *matcher, const acl_t *acl)
 Insert ACL into route map matcher.
void routemap_matcher_deinit (routemap_matcher_t *matcher)
 Deinitialize a route map matcher.
routemap_action_troutemap_statement_action_find (const routemap_statement_t *statement, routemap_set_attr_t attribute)
 Find action by attribute.
routemap_statement_troutemap_statement_new (routemap_t *routemap, uint32_t seq, int deny)
 Allocate statement in route map.
routemap_statement_troutemap_statement_find (routemap_t *routemap, uint32_t seq)
 Find statement in route map by sequence number.
const routemap_statement_troutemap_match (const routemap_t *routemap, const char *route)
 Match route against route map matchers.

Detailed Description

Policy Information Base, singleton

Macro Definition Documentation

◆ VEC_ENSURE_CAPACITY

#define VEC_ENSURE_CAPACITY ( vec,
size,
capacity,
type )
Value:
if ((capacity) < (size) + 1) { \
(capacity) *= 2; \
(vec) = realloc((vec), (capacity) * sizeof(type)); \
}

Ensure vector has at least 1 free slot for new element.

Function Documentation

◆ acl_check()

int acl_check ( const acl_t * acl,
const char * target )

Check target against ACL.

Returns
1 on permit, 0 on deny
Here is the call graph for this function:
Here is the caller graph for this function:

◆ acl_entry_match()

int acl_entry_match ( const char * expr,
const char * target )

Match target against ACL expression.

Does not check correctness of ACL expression

Returns
1 on matched, 0 otherwise
Here is the caller graph for this function:

◆ routemap_match()

const routemap_statement_t * routemap_match ( const routemap_t * routemap,
const char * route )

Match route against route map matchers.

Matchers are OR'd together, ACL's inside a matcher are AND'd together

Here is the call graph for this function: