|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __FIB_SOURCE_H__
17 #define __FIB_SOURCE_H__
149 "FIB too many sources");
151 #define FIB_SOURCES { \
152 [FIB_SOURCE_INVALID] = "invalid", \
153 [FIB_SOURCE_SPECIAL] = "special", \
154 [FIB_SOURCE_INTERFACE] = "interface", \
155 [FIB_SOURCE_PROXY] = "proxy", \
156 [FIB_SOURCE_BIER] = "BIER", \
157 [FIB_SOURCE_6RD] = "6RD", \
158 [FIB_SOURCE_API] = "API", \
159 [FIB_SOURCE_CLI] = "CLI", \
160 [FIB_SOURCE_ADJ] = "adjacency", \
161 [FIB_SOURCE_MAP] = "MAP", \
162 [FIB_SOURCE_SR] = "SR", \
163 [FIB_SOURCE_LISP] = "LISP", \
164 [FIB_SOURCE_CLASSIFY] = "classify", \
165 [FIB_SOURCE_DHCP] = "DHCP", \
166 [FIB_SOURCE_IP6_ND_PROXY] = "IPv6-proxy-nd", \
167 [FIB_SOURCE_IP6_ND] = "IPv6-nd", \
168 [FIB_SOURCE_RR] = "recursive-resolution", \
169 [FIB_SOURCE_AE] = "attached_export", \
170 [FIB_SOURCE_MPLS] = "mpls", \
171 [FIB_SOURCE_URPF_EXEMPT] = "urpf-exempt", \
172 [FIB_SOURCE_DEFAULT_ROUTE] = "default-route", \
173 [FIB_SOURCE_INTERPOSE] = "interpose", \
236 #define FIB_SOURCE_BH_MAX (FIB_SOURCE_BH_ADJ+1)
238 #define FIB_SOURCE_BEHAVIOURS { \
239 [FIB_SOURCE_BH_DROP] = "drop", \
240 [FIB_SOURCE_BH_RR] = "rr", \
241 [FIB_SOURCE_BH_MPLS] = "mpls", \
242 [FIB_SOURCE_BH_INTERFACE] = "interface", \
243 [FIB_SOURCE_BH_INTERPOSE] = "interpose", \
244 [FIB_SOURCE_BH_LISP] = "lisp", \
245 [FIB_SOURCE_BH_ADJ] = "adjacency", \
246 [FIB_SOURCE_BH_API] = "api", \
247 [FIB_SOURCE_BH_SIMPLE] = "simple", \
255 #define foreach_fib_source \
257 _(FIB_SOURCE_SPECIAL, 0x00, FIB_SOURCE_BH_SIMPLE) \
258 _(FIB_SOURCE_CLASSIFY, 0x01, FIB_SOURCE_BH_SIMPLE) \
259 _(FIB_SOURCE_PROXY, 0x02, FIB_SOURCE_BH_SIMPLE) \
260 _(FIB_SOURCE_INTERFACE, 0x03, FIB_SOURCE_BH_INTERFACE) \
261 _(FIB_SOURCE_SR, 0x10, FIB_SOURCE_BH_API) \
262 _(FIB_SOURCE_BIER, 0x20, FIB_SOURCE_BH_SIMPLE) \
263 _(FIB_SOURCE_6RD, 0x30, FIB_SOURCE_BH_API) \
264 _(FIB_SOURCE_API, 0x80, FIB_SOURCE_BH_API) \
265 _(FIB_SOURCE_CLI, 0x81, FIB_SOURCE_BH_API) \
266 _(FIB_SOURCE_LISP, 0x90, FIB_SOURCE_BH_LISP) \
267 _(FIB_SOURCE_MAP, 0xa0, FIB_SOURCE_BH_SIMPLE) \
268 _(FIB_SOURCE_DHCP, 0xb0, FIB_SOURCE_BH_API) \
269 _(FIB_SOURCE_IP6_ND_PROXY, 0xc0, FIB_SOURCE_BH_API) \
270 _(FIB_SOURCE_IP6_ND, 0xc1, FIB_SOURCE_BH_API) \
271 _(FIB_SOURCE_ADJ, 0xd0, FIB_SOURCE_BH_ADJ) \
272 _(FIB_SOURCE_MPLS, 0xe0, FIB_SOURCE_BH_MPLS) \
273 _(FIB_SOURCE_AE, 0xf0, FIB_SOURCE_BH_SIMPLE) \
274 _(FIB_SOURCE_RR, 0xfb, FIB_SOURCE_BH_RR) \
275 _(FIB_SOURCE_URPF_EXEMPT, 0xfc, FIB_SOURCE_BH_RR) \
276 _(FIB_SOURCE_DEFAULT_ROUTE, 0xfd, FIB_SOURCE_BH_DROP) \
277 _(FIB_SOURCE_INTERPOSE, 0xfe, FIB_SOURCE_BH_INTERPOSE) \
278 _(FIB_SOURCE_INVALID, 0xff, FIB_SOURCE_BH_DROP)
284 #define FIB_SOURCE_PRIORITY_HI 0x10
285 #define FIB_SOURCE_PRIORITY_LOW 0xd0
@ FIB_SOURCE_IP6_ND
IPv6 ND (seen in the link-local tables)
u16 fib_source_get_prio(fib_source_t src)
@ FIB_SOURCE_BIER
From the BIER subsystem.
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_INTERPOSE
The interpose source.
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)
@ FIB_SOURCE_BH_MPLS
associated label stored in private data
@ FIB_SOURCE_BH_INTERFACE
cover tracking w/ glean management
@ FIB_SOURCE_URPF_EXEMPT
uRPF bypass/exemption.
fib_source_t_
The different sources that can create a route.
@ FIB_SOURCE_PROXY
A route the is being 'proxied' on behalf of another device.
@ FIB_SOURCE_BH_DROP
If you're adding a new source from a plugin pick one of these.
@ FIB_SOURCE_ADJ
Adjacency source.
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
@ FIB_SOURCE_INTERFACE
Route added as a result of interface configuration.
@ FIB_SOURCE_INVALID
An invalid source This is not a real source, so don't use it to source a prefix.
u8 * format_fib_source(u8 *s, va_list *a)
@ FIB_SOURCE_BH_ADJ
adj w/ cover tracking + refinement
@ FIB_SOURCE_CLASSIFY
Classify.
void fib_source_module_init(void)
fib_source_behaviour_t fib_source_get_behaviour(fib_source_t src)
STATIC_ASSERT(sizeof(fib_source_t)==1, "FIB too many sources")
enum fib_source_behaviour_t_ fib_source_behaviour_t
Each source has a defined behaviour that controls how entries behave that have that source.
@ FIB_SOURCE_BH_INTERPOSE
interpose
@ FIB_SOURCE_SR
SRv6 and SR-MPLS.
@ FIB_SOURCE_BH_API
add paths with [mpls] path extensions
u8 fib_source_priority_t
Each source is assigned a priority.
fib_source_priority_cmp_t fib_source_cmp(fib_source_t s1, fib_source_t s2)
@ FIB_SOURCE_DEFAULT_ROUTE
The default route source.
@ FIB_SOURCE_IP6_ND_PROXY
IPv6 Proxy ND.
@ FIB_SOURCE_CLI
From the CLI.
@ FIB_SOURCE_API
From the control plane API.
@ FIB_SOURCE_BH_LISP
simple behaviour, plus the source specific data stores the FIB index that is used for subsequent look...
void fib_source_register(fib_source_t src, fib_source_priority_t prio, fib_source_behaviour_t bh)
@ FIB_SOURCE_SPECIAL
Special sources.
@ FIB_SOURCE_FIRST
Marker.
@ FIB_SOURCE_BH_RR
If your adding a new source from a plugin these are probably not the behaviour you're lokking for.
@ FIB_SOURCE_MPLS
MPLS label.
@ FIB_SOURCE_AE
Attached Export source.
@ FIB_SOURCE_BH_SIMPLE
add paths without path extensions
void fib_source_walk(fib_source_walk_t fn, void *ctx)
@ FIB_SOURCE_RR
Recursive resolution source.
enum fib_source_t_ fib_source_t
The different sources that can create a route.
@ FIB_SOURCE_6RD
From 6RD.
enum walk_rc_t_ walk_rc_t
Walk return code.
enum fib_source_priority_cmp_t_ fib_source_priority_cmp_t
source comparison
@ FIB_SOURCE_MAP
IPv[46] Mapping.