FD.io VPP  v17.04-9-g99c0734
Vector Packet Processing
fib_table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __FIB_TABLE_H__
17 #define __FIB_TABLE_H__
18 
19 #include <vnet/ip/ip.h>
20 #include <vnet/adj/adj.h>
21 #include <vnet/fib/fib_entry.h>
22 #include <vnet/mpls/mpls.h>
23 #include <vnet/mpls/packet.h>
24 
25 /**
26  * @brief
27  * A protocol Independent FIB table
28  */
29 typedef struct fib_table_t_
30 {
31  /**
32  * A union of the protocol specific FIBs that provide the
33  * underlying LPM mechanism.
34  * This element is first in the struct so that it is in the
35  * first cache line.
36  */
37  union {
41  };
42 
43  /**
44  * Which protocol this table serves. Used to switch on the union above.
45  */
47 
48  /**
49  * number of locks on the table
50  */
52 
53  /**
54  * Table ID (hash key) for this FIB.
55  */
57 
58  /**
59  * Index into FIB vector.
60  */
62 
63  /**
64  * flow hash configuration
65  */
67 
68  /**
69  * Per-source route counters
70  */
72 
73  /**
74  * Total route counters
75  */
77 
78  /**
79  * Table description
80  */
82 } fib_table_t;
83 
84 /**
85  * @brief
86  * Format the description/name of the table
87  */
88 extern u8* format_fib_table_name(u8* s, va_list ap);
89 
90 /**
91  * @brief
92  * Perfom a longest prefix match in the non-forwarding table
93  *
94  * @param fib_index
95  * The index of the FIB
96  *
97  * @param prefix
98  * The prefix to lookup
99  *
100  * @return
101  * The index of the fib_entry_t for the best match, which may be the default route
102  */
103 extern fib_node_index_t fib_table_lookup(u32 fib_index,
104  const fib_prefix_t *prefix);
105 
106 /**
107  * @brief
108  * Perfom an exact match in the non-forwarding table
109  *
110  * @param fib_index
111  * The index of the FIB
112  *
113  * @param prefix
114  * The prefix to lookup
115  *
116  * @return
117  * The index of the fib_entry_t for the exact match, or INVALID
118  * is there is no match.
119  */
121  const fib_prefix_t *prefix);
122 
123 /**
124  * @brief
125  * Get the less specific (covering) prefix
126  *
127  * @param fib_index
128  * The index of the FIB
129  *
130  * @param prefix
131  * The prefix to lookup
132  *
133  * @return
134  * The index of the less specific fib_entry_t.
135  */
137  const fib_prefix_t *prefix);
138 
139 /**
140  * @brief
141  * Add a 'special' entry to the FIB.
142  * A special entry is an entry that the FIB is not expect to resolve
143  * via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
144  * Instead the will link to a DPO valid for the source and/or the flags.
145  * This add is reference counting per-source. So n 'removes' are required
146  * for n 'adds', if the entry is no longer required.
147  * If the source needs to provide non-default forwarding use:
148  * fib_table_entry_special_dpo_add()
149  *
150  * @param fib_index
151  * The index of the FIB
152  *
153  * @param prefix
154  * The prefix to add
155  *
156  * @param source
157  * The ID of the client/source adding the entry.
158  *
159  * @param flags
160  * Flags for the entry.
161  *
162  * @return
163  * the index of the fib_entry_t that is created (or exists already).
164  */
166  const fib_prefix_t *prefix,
167  fib_source_t source,
169 
170 /**
171  * @brief
172  * Add a 'special' entry to the FIB that links to the DPO passed
173  * A special entry is an entry that the FIB is not expect to resolve
174  * via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
175  * Instead the client/source provides the DPO to link to.
176  * This add is reference counting per-source. So n 'removes' are required
177  * for n 'adds', if the entry is no longer required.
178  *
179  * @param fib_index
180  * The index of the FIB
181  *
182  * @param prefix
183  * The prefix to add
184  *
185  * @param source
186  * The ID of the client/source adding the entry.
187  *
188  * @param flags
189  * Flags for the entry.
190  *
191  * @param dpo
192  * The DPO to link to.
193  *
194  * @return
195  * the index of the fib_entry_t that is created (or existed already).
196  */
198  const fib_prefix_t *prefix,
199  fib_source_t source,
200  fib_entry_flag_t stype,
201  const dpo_id_t *dpo);
202 
203 /**
204  * @brief
205  * Update a 'special' entry to the FIB that links to the DPO passed
206  * A special entry is an entry that the FIB is not expect to resolve
207  * via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
208  * Instead the client/source provides the DPO to link to.
209  * Special entries are add/remove reference counted per-source. So n
210  * 'removes' are required for n 'adds', if the entry is no longer required.
211  * An 'update' is an 'add' if no 'add' has already been called, otherwise an 'add'
212  * is therefore assumed to act on the reference instance of that add.
213  *
214  * @param fib_entry_index
215  * The index of the FIB entry to update
216  *
217  * @param source
218  * The ID of the client/source adding the entry.
219  *
220  * @param flags
221  * Flags for the entry.
222  *
223  * @param dpo
224  * The DPO to link to.
225  *
226  * @return
227  * the index of the fib_entry_t that is created (or existed already).
228  */
230  const fib_prefix_t *prefix,
231  fib_source_t source,
232  fib_entry_flag_t stype,
233  const dpo_id_t *dpo);
234 
235 /**
236  * @brief
237  * Remove a 'special' entry from the FIB.
238  * This add is reference counting per-source. So n 'removes' are required
239  * for n 'adds', if the entry is no longer required.
240  *
241  * @param fib_index
242  * The index of the FIB
243  *
244  * @param prefix
245  * The prefix to remove
246  *
247  * @param source
248  * The ID of the client/source adding the entry.
249  *
250  */
251 extern void fib_table_entry_special_remove(u32 fib_index,
252  const fib_prefix_t *prefix,
253  fib_source_t source);
254 
255 /**
256  * @brief
257  * Add one path to an entry (aka route) in the FIB. If the entry does not
258  * exist, it will be created.
259  * See the documentation for fib_route_path_t for more descirptions of
260  * the path parameters.
261  *
262  * @param fib_index
263  * The index of the FIB
264  *
265  * @param prefix
266  * The prefix for the entry to add
267  *
268  * @param source
269  * The ID of the client/source adding the entry.
270  *
271  * @param flags
272  * Flags for the entry.
273  *
274  * @paran next_hop_proto
275  * The protocol of the next hop. This cannot be derived in the event that
276  * the next hop is all zeros.
277  *
278  * @param next_hop
279  * The address of the next-hop.
280  *
281  * @param sw_if_index
282  * The index of the interface.
283  *
284  * @param next_hop_fib_index,
285  * The fib index of the next-hop for recursive resolution
286  *
287  * @param next_hop_weight
288  * [un]equal cost path weight
289  *
290  * @param next_hop_label_stack
291  * The path's out-going label stack. NULL is there is none.
292  *
293  * @param pf
294  * Flags for the path
295  *
296  * @return
297  * the index of the fib_entry_t that is created (or existed already).
298  */
300  const fib_prefix_t *prefix,
301  fib_source_t source,
303  fib_protocol_t next_hop_proto,
304  const ip46_address_t *next_hop,
305  u32 next_hop_sw_if_index,
306  u32 next_hop_fib_index,
307  u32 next_hop_weight,
308  mpls_label_t *next_hop_label_stack,
310 /**
311  * @brief
312  * Add n paths to an entry (aka route) in the FIB. If the entry does not
313  * exist, it will be created.
314  * See the documentation for fib_route_path_t for more descirptions of
315  * the path parameters.
316  *
317  * @param fib_index
318  * The index of the FIB
319  *
320  * @param prefix
321  * The prefix for the entry to add
322  *
323  * @param source
324  * The ID of the client/source adding the entry.
325  *
326  * @param flags
327  * Flags for the entry.
328  *
329  * @param rpaths
330  * A vector of paths. Not const since they may be modified.
331  *
332  * @return
333  * the index of the fib_entry_t that is created (or existed already).
334  */
336  const fib_prefix_t *prefix,
337  fib_source_t source,
339  fib_route_path_t *rpath);
340 
341 /**
342  * @brief
343  * remove one path to an entry (aka route) in the FIB. If this is the entry's
344  * last path, then the entry will be removed, unless it has other sources.
345  * See the documentation for fib_route_path_t for more descirptions of
346  * the path parameters.
347  *
348  * @param fib_index
349  * The index of the FIB
350  *
351  * @param prefix
352  * The prefix for the entry to add
353  *
354  * @param source
355  * The ID of the client/source adding the entry.
356  *
357  * @paran next_hop_proto
358  * The protocol of the next hop. This cannot be derived in the event that
359  * the next hop is all zeros.
360  *
361  * @param next_hop
362  * The address of the next-hop.
363  *
364  * @param sw_if_index
365  * The index of the interface.
366  *
367  * @param next_hop_fib_index,
368  * The fib index of the next-hop for recursive resolution
369  *
370  * @param next_hop_weight
371  * [un]equal cost path weight
372  *
373  * @param pf
374  * Flags for the path
375  */
376 extern void fib_table_entry_path_remove(u32 fib_index,
377  const fib_prefix_t *prefix,
378  fib_source_t source,
379  fib_protocol_t next_hop_proto,
380  const ip46_address_t *next_hop,
381  u32 next_hop_sw_if_index,
382  u32 next_hop_fib_index,
383  u32 next_hop_weight,
385 
386 /**
387  * @brief
388  * Remove n paths to an entry (aka route) in the FIB. If this is the entry's
389  * last path, then the entry will be removed, unless it has other sources.
390  * See the documentation for fib_route_path_t for more descirptions of
391  * the path parameters.
392  *
393  * @param fib_index
394  * The index of the FIB
395  *
396  * @param prefix
397  * The prefix for the entry to add
398  *
399  * @param source
400  * The ID of the client/source adding the entry.
401  *
402  * @param rpaths
403  * A vector of paths.
404  */
405 extern void fib_table_entry_path_remove2(u32 fib_index,
406  const fib_prefix_t *prefix,
407  fib_source_t source,
408  fib_route_path_t *paths);
409 
410 /**
411  * @brief
412  * Update an entry to have a new set of paths. If the entry does not
413  * exist, it will be created.
414  * The difference between an 'path-add' and an update, is that path-add is
415  * an incremental addition of paths, whereas an update is a wholesale swap.
416  *
417  * @param fib_index
418  * The index of the FIB
419  *
420  * @param prefix
421  * The prefix for the entry to add
422  *
423  * @param source
424  * The ID of the client/source adding the entry.
425  *
426  * @param rpaths
427  * A vector of paths. Not const since they may be modified.
428  *
429  * @return
430  * the index of the fib_entry_t that is created (or existed already).
431  */
433  const fib_prefix_t *prefix,
434  fib_source_t source,
436  fib_route_path_t *paths);
437 
438 /**
439  * @brief
440  * Update the entry to have just one path. If the entry does not
441  * exist, it will be created.
442  * See the documentation for fib_route_path_t for more descirptions of
443  * the path parameters.
444  *
445  * @param fib_index
446  * The index of the FIB
447  *
448  * @param prefix
449  * The prefix for the entry to add
450  *
451  * @param source
452  * The ID of the client/source adding the entry.
453  *
454  * @param flags
455  * Flags for the entry.
456  *
457  * @paran next_hop_proto
458  * The protocol of the next hop. This cannot be derived in the event that
459  * the next hop is all zeros.
460  *
461  * @param next_hop
462  * The address of the next-hop.
463  *
464  * @param sw_if_index
465  * The index of the interface.
466  *
467  * @param next_hop_fib_index,
468  * The fib index of the next-hop for recursive resolution
469  *
470  * @param next_hop_weight
471  * [un]equal cost path weight
472  *
473  * @param next_hop_label_stack
474  * The path's out-going label stack. NULL is there is none.
475  *
476  * @param pf
477  * Flags for the path
478  *
479  * @return
480  * the index of the fib_entry_t that is created (or existed already).
481  */
483  const fib_prefix_t *prefix,
484  fib_source_t source,
486  fib_protocol_t next_hop_proto,
487  const ip46_address_t *next_hop,
488  u32 next_hop_sw_if_index,
489  u32 next_hop_fib_index,
490  u32 next_hop_weight,
491  mpls_label_t *next_hop_label_stack,
493 
494 /**
495  * @brief
496  * Add a MPLS local label for the prefix/route. If the entry does not
497  * exist, it will be created. In theory more than one local label can be
498  * added, but this is not yet supported.
499  *
500  * @param fib_index
501  * The index of the FIB
502  *
503  * @param prefix
504  * The prefix for the entry to which to add the label
505  *
506  * @param label
507  * The MPLS label to add
508  *
509  * @return
510  * the index of the fib_entry_t that is created (or existed already).
511  */
513  const fib_prefix_t *prefix,
514  mpls_label_t label);
515 /**
516  * @brief
517  * remove a MPLS local label for the prefix/route.
518  *
519  * @param fib_index
520  * The index of the FIB
521  *
522  * @param prefix
523  * The prefix for the entry to which to add the label
524  *
525  * @param label
526  * The MPLS label to add
527  */
528 extern void fib_table_entry_local_label_remove(u32 fib_index,
529  const fib_prefix_t *prefix,
530  mpls_label_t label);
531 
532 /**
533  * @brief
534  * Delete a FIB entry. If the entry has no more sources, then it is
535  * removed from the table.
536  *
537  * @param fib_index
538  * The index of the FIB
539  *
540  * @param prefix
541  * The prefix for the entry to remove
542  *
543  * @param source
544  * The ID of the client/source adding the entry.
545  */
546 extern void fib_table_entry_delete(u32 fib_index,
547  const fib_prefix_t *prefix,
548  fib_source_t source);
549 
550 /**
551  * @brief
552  * Delete a FIB entry. If the entry has no more sources, then it is
553  * removed from the table.
554  *
555  * @param entry_index
556  * The index of the FIB entry
557  *
558  * @param source
559  * The ID of the client/source adding the entry.
560  */
561 extern void fib_table_entry_delete_index(fib_node_index_t entry_index,
562  fib_source_t source);
563 
564 /**
565  * @brief
566  * Flush all entries from a table for the source
567  *
568  * @param fib_index
569  * The index of the FIB
570  *
571  * @paran proto
572  * The protocol of the entries in the table
573  *
574  * @param source
575  * the source to flush
576  */
577 extern void fib_table_flush(u32 fib_index,
578  fib_protocol_t proto,
579  fib_source_t source);
580 
581 /**
582  * @brief
583  * Get the index of the FIB bound to the interface
584  *
585  * @paran proto
586  * The protocol of the FIB (and thus the entries therein)
587  *
588  * @param sw_if_index
589  * The interface index
590  *
591  * @return fib_index
592  * The index of the FIB
593  */
595  u32 sw_if_index);
596 
597 /**
598  * @brief
599  * Get the Table-ID of the FIB bound to the interface
600  *
601  * @paran proto
602  * The protocol of the FIB (and thus the entries therein)
603  *
604  * @param sw_if_index
605  * The interface index
606  *
607  * @return fib_index
608  * The tableID of the FIB
609  */
611  u32 sw_if_index);
612 
613 /**
614  * @brief
615  * Get the index of the FIB for a Table-ID. This DOES NOT create the
616  * FIB if it does not exist.
617  *
618  * @paran proto
619  * The protocol of the FIB (and thus the entries therein)
620  *
621  * @param table-id
622  * The Table-ID
623  *
624  * @return fib_index
625  * The index of the FIB, which may be INVALID.
626  */
627 extern u32 fib_table_find(fib_protocol_t proto, u32 table_id);
628 
629 
630 /**
631  * @brief
632  * Get the index of the FIB for a Table-ID. This DOES create the
633  * FIB if it does not exist.
634  *
635  * @paran proto
636  * The protocol of the FIB (and thus the entries therein)
637  *
638  * @param table-id
639  * The Table-ID
640  *
641  * @return fib_index
642  * The index of the FIB
643  */
645  u32 table_id);
646 
647 /**
648  * @brief
649  * Create a new table with no table ID. This means it does not get
650  * added to the hash-table and so can only be found by using the index returned.
651  *
652  * @paran proto
653  * The protocol of the FIB (and thus the entries therein)
654  *
655  * @param fmt
656  * A string to describe the table
657  *
658  * @return fib_index
659  * The index of the FIB
660  */
662  const char *const fmt,
663  ...);
664 
665 /**
666  * @brief
667  * Get the flow hash configured used by the table
668  *
669  * @param fib_index
670  * The index of the FIB
671  *
672  * @paran proto
673  * The protocol of the FIB (and thus the entries therein)
674  *
675  * @return The flow hash config
676  */
678  fib_protocol_t proto);
679 
680 /**
681  * @brief
682  * Take a reference counting lock on the table
683  *
684  * @param fib_index
685  * The index of the FIB
686  *
687  * @paran proto
688  * The protocol of the FIB (and thus the entries therein)
689  */
690 extern void fib_table_unlock(u32 fib_index,
691  fib_protocol_t proto);
692 
693 /**
694  * @brief
695  * Release a reference counting lock on the table. When the last lock
696  * has gone. the FIB is deleted.
697  *
698  * @param fib_index
699  * The index of the FIB
700  *
701  * @paran proto
702  * The protocol of the FIB (and thus the entries therein)
703  */
704 extern void fib_table_lock(u32 fib_index,
705  fib_protocol_t proto);
706 
707 /**
708  * @brief
709  * Return the number of entries in the FIB added by a given source.
710  *
711  * @param fib_index
712  * The index of the FIB
713  *
714  * @paran proto
715  * The protocol of the FIB (and thus the entries therein)
716  *
717  * @return number of sourced entries.
718  */
719 extern u32 fib_table_get_num_entries(u32 fib_index,
720  fib_protocol_t proto,
721  fib_source_t source);
722 
723 /**
724  * @brief
725  * Get a pointer to a FIB table
726  */
728  fib_protocol_t proto);
729 
730 /**
731  * @brief Call back function when walking entries in a FIB table
732  */
734  void *ctx);
735 
736 /**
737  * @brief Walk all entries in a FIB table
738  * N.B: This is NOT safe to deletes. If you need to delete walk the whole
739  * table and store elements in a vector, then delete the elements
740  */
741 extern void fib_table_walk(u32 fib_index,
742  fib_protocol_t proto,
744  void *ctx);
745 
746 #endif
fib_protocol_t ft_proto
Which protocol this table serves.
Definition: fib_table.h:46
A representation of a path as described by a route producer.
Definition: fib_types.h:308
mpls_fib_t mpls
Definition: fib_table.h:40
int(* fib_table_walk_fn_t)(fib_node_index_t fei, void *ctx)
Call back function when walking entries in a FIB table.
Definition: fib_table.h:733
struct fib_table_t_ fib_table_t
A protocol Independent FIB table.
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
Definition: fib_table.c:66
u32 mpls_label_t
A label value only, i.e.
Definition: packet.h:24
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
Definition: fib_table.c:798
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t stype, const dpo_id_t *dpo)
Update a &#39;special&#39; entry to the FIB that links to the DPO passed A special entry is an entry that the...
Definition: fib_table.c:327
void fib_table_entry_path_remove2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_route_path_t *paths)
Remove n paths to an entry (aka route) in the FIB.
Definition: fib_table.c:555
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void fib_table_walk(u32 fib_index, fib_protocol_t proto, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
Definition: fib_table.c:1038
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
Definition: fib_table.c:95
Aggregrate type for a prefix.
Definition: fib_types.h:160
fib_node_index_t fib_table_entry_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *paths)
Update an entry to have a new set of paths.
Definition: fib_table.c:667
fib_node_index_t fib_table_entry_path_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_protocol_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, mpls_label_t *next_hop_label_stack, fib_route_path_flags_t pf)
Add one path to an entry (aka route) in the FIB.
Definition: fib_table.c:477
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
fib_node_index_t fib_table_get_less_specific(u32 fib_index, const fib_prefix_t *prefix)
Get the less specific (covering) prefix.
Definition: fib_table.c:131
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:146
enum fib_source_t_ fib_source_t
The different sources that can create a route.
u32 fib_table_get_table_id_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the Table-ID of the FIB bound to the interface.
Definition: fib_table.c:925
u32 ft_total_route_counts
Total route counters.
Definition: fib_table.h:76
flow_hash_config_t fib_table_get_flow_hash_config(u32 fib_index, fib_protocol_t proto)
Get the flow hash configured used by the table.
Definition: fib_table.c:908
u16 ft_locks
number of locks on the table
Definition: fib_table.h:51
#define FIB_SOURCE_MAX
The maximum number of sources.
Definition: fib_entry.h:134
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a &#39;special&#39; entry from the FIB.
Definition: fib_table.c:388
fib_node_index_t ft_index
Index into FIB vector.
Definition: fib_table.h:61
void fib_table_flush(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Flush all entries from a table for the source.
Definition: fib_table.c:1139
u8 * format_fib_table_name(u8 *s, va_list ap)
Format the description/name of the table.
Definition: fib_table.c:1094
u32 ft_table_id
Table ID (hash key) for this FIB.
Definition: fib_table.h:56
u32 ft_flow_hash_config
flow hash configuration
Definition: fib_table.h:66
Definition: ip6.h:67
Definition: ip4.h:48
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
Definition: fib_table.c:938
u8 * ft_desc
Table description.
Definition: fib_table.h:81
u32 fib_table_create_and_lock(fib_protocol_t proto, const char *const fmt,...)
Create a new table with no table ID.
Definition: fib_table.c:985
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
Definition: fib_table.c:27
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:28
void fib_table_unlock(u32 fib_index, fib_protocol_t proto)
Take a reference counting lock on the table.
Definition: fib_table.c:1058
enum fib_entry_flag_t_ fib_entry_flag_t
unsigned int u32
Definition: types.h:88
void fib_table_lock(u32 fib_index, fib_protocol_t proto)
Release a reference counting lock on the table.
Definition: fib_table.c:1072
fib_node_index_t fib_table_entry_path_add2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *rpath)
Add n paths to an entry (aka route) in the FIB.
Definition: fib_table.c:511
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
Definition: fib_table.c:892
u32 ft_src_route_counts[FIB_SOURCE_MAX]
Per-source route counters.
Definition: fib_table.h:71
void fib_table_entry_delete_index(fib_node_index_t entry_index, fib_source_t source)
Delete a FIB entry.
Definition: fib_table.c:821
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
Definition: lookup.h:165
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_protocol_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, mpls_label_t *next_hop_label_stack, fib_route_path_flags_t pf)
Update the entry to have just one path.
Definition: fib_table.c:716
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a &#39;special&#39; entry to the FIB.
Definition: fib_table.c:369
unsigned short u16
Definition: types.h:57
ip6_fib_t v6
Definition: fib_table.h:39
unsigned char u8
Definition: types.h:56
void fib_table_entry_local_label_remove(u32 fib_index, const fib_prefix_t *prefix, mpls_label_t label)
remove a MPLS local label for the prefix/route.
Definition: fib_table.c:860
ip4_fib_t v4
Definition: fib_table.h:38
u32 fib_table_get_num_entries(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Return the number of entries in the FIB added by a given source.
Definition: fib_table.c:1082
u32 flags
Definition: vhost-user.h:78
void fib_table_entry_path_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_protocol_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_route_path_flags_t pf)
remove one path to an entry (aka route) in the FIB.
Definition: fib_table.c:625
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
Definition: fib_table.c:954
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t stype, const dpo_id_t *dpo)
Add a &#39;special&#39; entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
Definition: fib_table.c:288
fib_node_index_t fib_table_entry_local_label_add(u32 fib_index, const fib_prefix_t *prefix, mpls_label_t label)
Add a MPLS local label for the prefix/route.
Definition: fib_table.c:833
A protocol Independent FIB table.
Definition: fib_table.h:29