16 #ifndef __FIB_SOURCE_H__ 17 #define __FIB_SOURCE_H__ 146 "FIB too many sources");
148 #define FIB_SOURCES { \ 149 [FIB_SOURCE_INVALID] = "invalid", \ 150 [FIB_SOURCE_SPECIAL] = "special", \ 151 [FIB_SOURCE_INTERFACE] = "interface", \ 152 [FIB_SOURCE_PROXY] = "proxy", \ 153 [FIB_SOURCE_BIER] = "BIER", \ 154 [FIB_SOURCE_6RD] = "6RD", \ 155 [FIB_SOURCE_API] = "API", \ 156 [FIB_SOURCE_CLI] = "CLI", \ 157 [FIB_SOURCE_ADJ] = "adjacency", \ 158 [FIB_SOURCE_MAP] = "MAP", \ 159 [FIB_SOURCE_SR] = "SR", \ 160 [FIB_SOURCE_LISP] = "LISP", \ 161 [FIB_SOURCE_CLASSIFY] = "classify", \ 162 [FIB_SOURCE_DHCP] = "DHCP", \ 163 [FIB_SOURCE_IP6_ND_PROXY] = "IPv6-proxy-nd", \ 164 [FIB_SOURCE_IP6_ND] = "IPv6-nd", \ 165 [FIB_SOURCE_RR] = "recursive-resolution", \ 166 [FIB_SOURCE_AE] = "attached_export", \ 167 [FIB_SOURCE_MPLS] = "mpls", \ 168 [FIB_SOURCE_URPF_EXEMPT] = "urpf-exempt", \ 169 [FIB_SOURCE_DEFAULT_ROUTE] = "default-route", \ 170 [FIB_SOURCE_INTERPOSE] = "interpose", \ 225 #define FIB_SOURCE_BH_MAX (FIB_SOURCE_BH_ADJ+1) 227 #define FIB_SOURCE_BEHAVIOURS { \ 228 [FIB_SOURCE_BH_DROP] = "drop", \ 229 [FIB_SOURCE_BH_RR] = "rr", \ 230 [FIB_SOURCE_BH_MPLS] = "mpls", \ 231 [FIB_SOURCE_BH_INTERFACE] = "interface", \ 232 [FIB_SOURCE_BH_INTERPOSE] = "interpose", \ 233 [FIB_SOURCE_BH_LISP] = "lisp", \ 234 [FIB_SOURCE_BH_ADJ] = "adjacency", \ 235 [FIB_SOURCE_BH_API] = "api", \ 236 [FIB_SOURCE_BH_SIMPLE] = "simple", \ 244 #define foreach_fib_source \ 246 _(FIB_SOURCE_SPECIAL, 0x00, FIB_SOURCE_BH_SIMPLE) \ 247 _(FIB_SOURCE_CLASSIFY, 0x01, FIB_SOURCE_BH_SIMPLE) \ 248 _(FIB_SOURCE_PROXY, 0x02, FIB_SOURCE_BH_SIMPLE) \ 249 _(FIB_SOURCE_INTERFACE, 0x03, FIB_SOURCE_BH_INTERFACE) \ 250 _(FIB_SOURCE_SR, 0x10, FIB_SOURCE_BH_API) \ 251 _(FIB_SOURCE_BIER, 0x20, FIB_SOURCE_BH_SIMPLE) \ 252 _(FIB_SOURCE_6RD, 0x30, FIB_SOURCE_BH_API) \ 253 _(FIB_SOURCE_API, 0x80, FIB_SOURCE_BH_API) \ 254 _(FIB_SOURCE_CLI, 0x81, FIB_SOURCE_BH_API) \ 255 _(FIB_SOURCE_LISP, 0x90, FIB_SOURCE_BH_LISP) \ 256 _(FIB_SOURCE_MAP, 0xa0, FIB_SOURCE_BH_SIMPLE) \ 257 _(FIB_SOURCE_DHCP, 0xb0, FIB_SOURCE_BH_API) \ 258 _(FIB_SOURCE_IP6_ND_PROXY, 0xc0, FIB_SOURCE_BH_API) \ 259 _(FIB_SOURCE_IP6_ND, 0xc1, FIB_SOURCE_BH_API) \ 260 _(FIB_SOURCE_ADJ, 0xd0, FIB_SOURCE_BH_ADJ) \ 261 _(FIB_SOURCE_MPLS, 0xe0, FIB_SOURCE_BH_MPLS) \ 262 _(FIB_SOURCE_AE, 0xf0, FIB_SOURCE_BH_SIMPLE) \ 263 _(FIB_SOURCE_RR, 0xfb, FIB_SOURCE_BH_RR) \ 264 _(FIB_SOURCE_URPF_EXEMPT, 0xfc, FIB_SOURCE_BH_RR) \ 265 _(FIB_SOURCE_DEFAULT_ROUTE, 0xfd, FIB_SOURCE_BH_DROP) \ 266 _(FIB_SOURCE_INTERPOSE, 0xfe, FIB_SOURCE_BH_INTERPOSE) \ 267 _(FIB_SOURCE_INVALID, 0xff, FIB_SOURCE_BH_DROP) 273 #define FIB_SOURCE_PRIORITY_HI 0x10 274 #define FIB_SOURCE_PRIORITY_LOW 0xd0 285 fib_source_priority_t prio,
286 fib_source_behaviour_t bh);
289 fib_source_priority_t prio,
290 fib_source_behaviour_t bh);
294 fib_source_priority_t prio,
295 fib_source_behaviour_t bh,
associated label stored in private data
enum fib_source_t_ fib_source_t
The different sources that can create a route.
If your adding a new source from a plugin pick one of these.
fib_source_behaviour_t fib_source_get_behaviour(fib_source_t src)
Route added as a result of interface configuration.
A route the is being 'proxied' on behalf of another device.
add paths without path extensions
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
void fib_source_module_init(void)
enum fib_source_behaviour_t_ fib_source_behaviour_t
Each source has a defined behaviour that controls how entries behave that have that source...
adj w/ cover tracking + refinement
u8 fib_source_priority_t
Each source is assigned a priority.
enum walk_rc_t_ walk_rc_t
Walk return code.
u8 * format_fib_source(u8 *s, va_list *a)
Recursive resolution source.
void fib_source_walk(fib_source_walk_t fn, void *ctx)
add paths with [mpls] path extensions
fib_source_t_
The different sources that can create a route.
simple + source fib tracking
u16 fib_source_get_prio(fib_source_t src)
fib_source_priority_cmp_t fib_source_cmp(fib_source_t s1, fib_source_t s2)
From the control plane API.
IPv6 ND (seen in the link-local tables)
An invalid source This is not a real source, so don't use it to source a prefix.
The default route source.
STATIC_ASSERT(sizeof(fib_source_t)==1, "FIB too many sources")
void fib_source_register(fib_source_t src, fib_source_priority_t prio, fib_source_behaviour_t bh)
fib_source_behaviour_t_
Each source has a defined behaviour that controls how entries behave that have that 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_priority_cmp_t_
source comparison
If your adding a new source from a plugin these are probably not the behaviour you're lokking for...
enum fib_source_priority_cmp_t_ fib_source_priority_cmp_t
source comparison
cover tracking w/ glean management