FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
fib_source.h File Reference
+ Include dependency graph for fib_source.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FIB_SOURCES
 
#define FIB_SOURCE_BH_MAX   (FIB_SOURCE_BH_ADJ+1)
 
#define FIB_SOURCE_BEHAVIOURS
 
#define foreach_fib_source
 The fixed source to priority mappings. More...
 
#define FIB_SOURCE_PRIORITY_HI   0x10
 Some priority values that plugins might use when they are not to concerned where in the list they'll go. More...
 
#define FIB_SOURCE_PRIORITY_LOW   0xd0
 

Typedefs

typedef enum fib_source_t_ fib_source_t
 The different sources that can create a route. More...
 
typedef u8 fib_source_priority_t
 Each source is assigned a priority. More...
 
typedef enum fib_source_priority_cmp_t_ fib_source_priority_cmp_t
 source comparison More...
 
typedef enum fib_source_behaviour_t_ fib_source_behaviour_t
 Each source has a defined behaviour that controls how entries behave that have that source. More...
 
typedef walk_rc_t(* fib_source_walk_t) (fib_source_t id, const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh, void *ctx)
 

Enumerations

enum  fib_source_t_ {
  FIB_SOURCE_INVALID = 0, FIB_SOURCE_FIRST, FIB_SOURCE_SPECIAL = FIB_SOURCE_FIRST, FIB_SOURCE_CLASSIFY,
  FIB_SOURCE_PROXY, FIB_SOURCE_INTERFACE, FIB_SOURCE_SR, FIB_SOURCE_BIER,
  FIB_SOURCE_6RD, FIB_SOURCE_API, FIB_SOURCE_CLI, FIB_SOURCE_LISP,
  FIB_SOURCE_MAP, FIB_SOURCE_DHCP, FIB_SOURCE_IP6_ND_PROXY, FIB_SOURCE_IP6_ND,
  FIB_SOURCE_ADJ, FIB_SOURCE_MPLS, FIB_SOURCE_AE, FIB_SOURCE_RR,
  FIB_SOURCE_URPF_EXEMPT, FIB_SOURCE_DEFAULT_ROUTE, FIB_SOURCE_INTERPOSE, FIB_SOURCE_LAST = FIB_SOURCE_INTERPOSE
}
 The different sources that can create a route. More...
 
enum  fib_source_priority_cmp_t_ { FIB_SOURCE_CMP_BETTER, FIB_SOURCE_CMP_WORSE, FIB_SOURCE_CMP_EQUAL }
 source comparison More...
 
enum  fib_source_behaviour_t_ {
  FIB_SOURCE_BH_DROP, FIB_SOURCE_BH_API, FIB_SOURCE_BH_SIMPLE, FIB_SOURCE_BH_RR,
  FIB_SOURCE_BH_MPLS, FIB_SOURCE_BH_INTERFACE, FIB_SOURCE_BH_INTERPOSE, FIB_SOURCE_BH_LISP,
  FIB_SOURCE_BH_ADJ
}
 Each source has a defined behaviour that controls how entries behave that have that source. More...
 

Functions

 STATIC_ASSERT (sizeof(fib_source_t)==1, "FIB too many sources")
 
u16 fib_source_get_prio (fib_source_t src)
 
fib_source_behaviour_t fib_source_get_behaviour (fib_source_t src)
 
fib_source_priority_cmp_t fib_source_cmp (fib_source_t s1, fib_source_t s2)
 
u8format_fib_source (u8 *s, va_list *a)
 
fib_source_t fib_source_allocate (const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
 
void fib_source_register (fib_source_t src, fib_source_priority_t prio, fib_source_behaviour_t bh)
 
void fib_source_walk (fib_source_walk_t fn, void *ctx)
 
void fib_source_module_init (void)
 

Macro Definition Documentation

◆ FIB_SOURCE_BEHAVIOURS

#define FIB_SOURCE_BEHAVIOURS
Value:
{ \
[FIB_SOURCE_BH_DROP] = "drop", \
[FIB_SOURCE_BH_RR] = "rr", \
[FIB_SOURCE_BH_MPLS] = "mpls", \
[FIB_SOURCE_BH_INTERFACE] = "interface", \
[FIB_SOURCE_BH_INTERPOSE] = "interpose", \
[FIB_SOURCE_BH_LISP] = "lisp", \
[FIB_SOURCE_BH_ADJ] = "adjacency", \
[FIB_SOURCE_BH_API] = "api", \
[FIB_SOURCE_BH_SIMPLE] = "simple", \
}
associated label stored in private data
Definition: fib_source.h:214
If your adding a new source from a plugin pick one of these.
Definition: fib_source.h:201
add paths without path extensions
Definition: fib_source.h:205
adj w/ cover tracking + refinement
Definition: fib_source.h:222
add paths with [mpls] path extensions
Definition: fib_source.h:203
simple + source fib tracking
Definition: fib_source.h:220
If your adding a new source from a plugin these are probably not the behaviour you're lokking for...
Definition: fib_source.h:212
cover tracking w/ glean management
Definition: fib_source.h:216

Definition at line 227 of file fib_source.h.

◆ FIB_SOURCE_BH_MAX

#define FIB_SOURCE_BH_MAX   (FIB_SOURCE_BH_ADJ+1)

Definition at line 225 of file fib_source.h.

◆ FIB_SOURCE_PRIORITY_HI

#define FIB_SOURCE_PRIORITY_HI   0x10

Some priority values that plugins might use when they are not to concerned where in the list they'll go.

Definition at line 273 of file fib_source.h.

◆ FIB_SOURCE_PRIORITY_LOW

#define FIB_SOURCE_PRIORITY_LOW   0xd0

Definition at line 274 of file fib_source.h.

◆ FIB_SOURCES

#define FIB_SOURCES
Value:
{ \
[FIB_SOURCE_INVALID] = "invalid", \
[FIB_SOURCE_SPECIAL] = "special", \
[FIB_SOURCE_INTERFACE] = "interface", \
[FIB_SOURCE_PROXY] = "proxy", \
[FIB_SOURCE_BIER] = "BIER", \
[FIB_SOURCE_6RD] = "6RD", \
[FIB_SOURCE_API] = "API", \
[FIB_SOURCE_CLI] = "CLI", \
[FIB_SOURCE_ADJ] = "adjacency", \
[FIB_SOURCE_MAP] = "MAP", \
[FIB_SOURCE_SR] = "SR", \
[FIB_SOURCE_LISP] = "LISP", \
[FIB_SOURCE_CLASSIFY] = "classify", \
[FIB_SOURCE_DHCP] = "DHCP", \
[FIB_SOURCE_IP6_ND_PROXY] = "IPv6-proxy-nd", \
[FIB_SOURCE_IP6_ND] = "IPv6-nd", \
[FIB_SOURCE_RR] = "recursive-resolution", \
[FIB_SOURCE_AE] = "attached_export", \
[FIB_SOURCE_MPLS] = "mpls", \
[FIB_SOURCE_URPF_EXEMPT] = "urpf-exempt", \
[FIB_SOURCE_DEFAULT_ROUTE] = "default-route", \
[FIB_SOURCE_INTERPOSE] = "interpose", \
}
uRPF bypass/exemption.
Definition: fib_source.h:124
Route added as a result of interface configuration.
Definition: fib_source.h:56
Attached Export source.
Definition: fib_source.h:114
A route the is being 'proxied' on behalf of another device.
Definition: fib_source.h:50
From the BIER subsystem.
Definition: fib_source.h:64
IPv[46] Mapping.
Definition: fib_source.h:84
Recursive resolution source.
Definition: fib_source.h:119
From 6RD.
Definition: fib_source.h:68
Adjacency source.
Definition: fib_source.h:102
SRv6 and SR-MPLS.
Definition: fib_source.h:60
From the CLI.
Definition: fib_source.h:76
From the control plane API.
Definition: fib_source.h:72
IPv6 ND (seen in the link-local tables)
Definition: fib_source.h:96
The interpose source.
Definition: fib_source.h:138
IPv6 Proxy ND.
Definition: fib_source.h:92
An invalid source This is not a real source, so don't use it to source a prefix.
Definition: fib_source.h:32
The default route source.
Definition: fib_source.h:131
Special sources.
Definition: fib_source.h:42
MPLS label.
Definition: fib_source.h:108

Definition at line 148 of file fib_source.h.

◆ foreach_fib_source

#define foreach_fib_source
Value:
/** you can't do better then the special source */ \
associated label stored in private data
Definition: fib_source.h:214
uRPF bypass/exemption.
Definition: fib_source.h:124
If your adding a new source from a plugin pick one of these.
Definition: fib_source.h:201
Route added as a result of interface configuration.
Definition: fib_source.h:56
Attached Export source.
Definition: fib_source.h:114
A route the is being 'proxied' on behalf of another device.
Definition: fib_source.h:50
From the BIER subsystem.
Definition: fib_source.h:64
add paths without path extensions
Definition: fib_source.h:205
adj w/ cover tracking + refinement
Definition: fib_source.h:222
IPv[46] Mapping.
Definition: fib_source.h:84
Recursive resolution source.
Definition: fib_source.h:119
add paths with [mpls] path extensions
Definition: fib_source.h:203
From 6RD.
Definition: fib_source.h:68
Adjacency source.
Definition: fib_source.h:102
SRv6 and SR-MPLS.
Definition: fib_source.h:60
From the CLI.
Definition: fib_source.h:76
simple + source fib tracking
Definition: fib_source.h:220
From the control plane API.
Definition: fib_source.h:72
IPv6 ND (seen in the link-local tables)
Definition: fib_source.h:96
The interpose source.
Definition: fib_source.h:138
IPv6 Proxy ND.
Definition: fib_source.h:92
An invalid source This is not a real source, so don't use it to source a prefix.
Definition: fib_source.h:32
The default route source.
Definition: fib_source.h:131
Special sources.
Definition: fib_source.h:42
MPLS label.
Definition: fib_source.h:108
If your adding a new source from a plugin these are probably not the behaviour you're lokking for...
Definition: fib_source.h:212
cover tracking w/ glean management
Definition: fib_source.h:216

The fixed source to priority mappings.

Declared here so those adding new sources can better determine their respective priority values.

Definition at line 244 of file fib_source.h.

Typedef Documentation

◆ fib_source_behaviour_t

Each source has a defined behaviour that controls how entries behave that have that source.

◆ fib_source_priority_cmp_t

source comparison

◆ fib_source_priority_t

Each source is assigned a priority.

lower priority is beeter. the source with the best source with have its contribution added to forwarding. the lesser sources will be 'remembered' by FIB and added to forwarding should the best source be removed.

Definition at line 179 of file fib_source.h.

◆ fib_source_t

The different sources that can create a route.

The sources are defined here with their relative priority order. The lower the value the higher the priority

◆ fib_source_walk_t

typedef walk_rc_t(* fib_source_walk_t) (fib_source_t id, const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh, void *ctx)

Definition at line 292 of file fib_source.h.

Enumeration Type Documentation

◆ fib_source_behaviour_t_

Each source has a defined behaviour that controls how entries behave that have that source.

Enumerator
FIB_SOURCE_BH_DROP 

If your adding a new source from a plugin pick one of these.

Default behaviour - always install a drop

FIB_SOURCE_BH_API 

add paths with [mpls] path extensions

FIB_SOURCE_BH_SIMPLE 

add paths without path extensions

FIB_SOURCE_BH_RR 

If your adding a new source from a plugin these are probably not the behaviour you're lokking for.

recursive resolution w/ cover tracking

FIB_SOURCE_BH_MPLS 

associated label stored in private data

FIB_SOURCE_BH_INTERFACE 

cover tracking w/ glean management

FIB_SOURCE_BH_INTERPOSE 

interpose

FIB_SOURCE_BH_LISP 

simple + source fib tracking

FIB_SOURCE_BH_ADJ 

adj w/ cover tracking + refinement

Definition at line 195 of file fib_source.h.

◆ fib_source_priority_cmp_t_

source comparison

Enumerator
FIB_SOURCE_CMP_BETTER 
FIB_SOURCE_CMP_WORSE 
FIB_SOURCE_CMP_EQUAL 

Definition at line 184 of file fib_source.h.

◆ fib_source_t_

The different sources that can create a route.

The sources are defined here with their relative priority order. The lower the value the higher the priority

Enumerator
FIB_SOURCE_INVALID 

An invalid source This is not a real source, so don't use it to source a prefix.

It exists here to provide a value for inexistant/uninitialized source

FIB_SOURCE_FIRST 

Marker.

Add new values after this one.

FIB_SOURCE_SPECIAL 

Special sources.

These are for entries that are added to all FIBs by default, and should never be over-ridden (hence they are the highest priority)

FIB_SOURCE_CLASSIFY 

Classify.

A route that links directly to a classify adj

FIB_SOURCE_PROXY 

A route the is being 'proxied' on behalf of another device.

FIB_SOURCE_INTERFACE 

Route added as a result of interface configuration.

this will also come from the API/CLI, but the distinction is that is from confiiguration on an interface, not a 'ip route' command

FIB_SOURCE_SR 

SRv6 and SR-MPLS.

FIB_SOURCE_BIER 

From the BIER subsystem.

FIB_SOURCE_6RD 

From 6RD.

FIB_SOURCE_API 

From the control plane API.

FIB_SOURCE_CLI 

From the CLI.

FIB_SOURCE_LISP 

LISP.

FIB_SOURCE_MAP 

IPv[46] Mapping.

FIB_SOURCE_DHCP 

DHCP.

FIB_SOURCE_IP6_ND_PROXY 

IPv6 Proxy ND.

FIB_SOURCE_IP6_ND 

IPv6 ND (seen in the link-local tables)

FIB_SOURCE_ADJ 

Adjacency source.

routes created as a result of ARP/ND entries. This is lower priority then the API/CLI. This is on purpose. trust me.

FIB_SOURCE_MPLS 

MPLS label.

The prefix has been assigned a local label. This source never provides forwarding information, instead it acts as a place-holder so the association of label to prefix can be maintained

FIB_SOURCE_AE 

Attached Export source.

routes created as a result of attahced export. routes thus sourced will be present in the export tables

FIB_SOURCE_RR 

Recursive resolution source.

Used to install an entry that is the resolution traget of another.

FIB_SOURCE_URPF_EXEMPT 

uRPF bypass/exemption.

Used to install an entry that is exempt from the loose uRPF check

FIB_SOURCE_DEFAULT_ROUTE 

The default route source.

The default route is always added to the FIB table (like the special sources) but we need to be able to over-ride it with 'ip route' sources when provided

FIB_SOURCE_INTERPOSE 

The interpose source.

This is not a real source, so don't use it to source a prefix. It exists here to provide a value against which to register to the VFT for providing the interpose actions to a real source.

FIB_SOURCE_LAST 

Marker.

add new entries before this one.

Definition at line 26 of file fib_source.h.

Function Documentation

◆ fib_source_allocate()

fib_source_t fib_source_allocate ( const char *  name,
fib_source_priority_t  prio,
fib_source_behaviour_t  bh 
)

Definition at line 118 of file fib_source.c.

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

◆ fib_source_cmp()

fib_source_priority_cmp_t fib_source_cmp ( fib_source_t  s1,
fib_source_t  s2 
)

Definition at line 76 of file fib_source.c.

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

◆ fib_source_get_behaviour()

fib_source_behaviour_t fib_source_get_behaviour ( fib_source_t  src)

Definition at line 58 of file fib_source.c.

+ Here is the caller graph for this function:

◆ fib_source_get_prio()

u16 fib_source_get_prio ( fib_source_t  src)

Definition at line 49 of file fib_source.c.

+ Here is the caller graph for this function:

◆ fib_source_module_init()

void fib_source_module_init ( void  )

Definition at line 217 of file fib_source.c.

+ Here is the caller graph for this function:

◆ fib_source_register()

void fib_source_register ( fib_source_t  src,
fib_source_priority_t  prio,
fib_source_behaviour_t  bh 
)

Definition at line 137 of file fib_source.c.

+ Here is the call graph for this function:

◆ fib_source_walk()

void fib_source_walk ( fib_source_walk_t  fn,
void *  ctx 
)

Definition at line 169 of file fib_source.c.

◆ format_fib_source()

u8* format_fib_source ( u8 s,
va_list *  a 
)

Definition at line 66 of file fib_source.c.

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

◆ STATIC_ASSERT()

STATIC_ASSERT ( sizeof(fib_source_t = =1,
"FIB too many sources"   
)