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 296 fib_source_priority_t prio,
297 fib_source_behaviour_t bh);
300 fib_source_priority_t prio,
301 fib_source_behaviour_t bh);
305 fib_source_priority_t prio,
306 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 you're 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 behaviour, plus the source specific data stores the FIB index that is used for subsequent look...
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