FD.io VPP  v17.01-9-ge7dcee4
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 that links to the adj passed
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 client/source provides the adj to link to.
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  *
148  * @param fib_index
149  * The index of the FIB
150  *
151  * @param prefix
152  * The prefix to add
153  *
154  * @param source
155  * The ID of the client/source adding the entry.
156  *
157  * @param flags
158  * Flags for the entry.
159  *
160  * @param adj_index
161  * The adjacency to link to.
162  *
163  * @return
164  * the index of the fib_entry_t that is created (or exists already).
165  */
167  const fib_prefix_t *prefix,
168  fib_source_t source,
170  adj_index_t adj_index);
171 
172 /**
173  * @brief
174  * Add a 'special' entry to the FIB that links to the DPO passed
175  * A special entry is an entry that the FIB is not expect to resolve
176  * via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
177  * Instead the client/source provides the DPO to link to.
178  * This add is reference counting per-source. So n 'removes' are required
179  * for n 'adds', if the entry is no longer required.
180  *
181  * @param fib_index
182  * The index of the FIB
183  *
184  * @param prefix
185  * The prefix to add
186  *
187  * @param source
188  * The ID of the client/source adding the entry.
189  *
190  * @param flags
191  * Flags for the entry.
192  *
193  * @param dpo
194  * The DPO to link to.
195  *
196  * @return
197  * the index of the fib_entry_t that is created (or existed already).
198  */
200  const fib_prefix_t *prefix,
201  fib_source_t source,
202  fib_entry_flag_t stype,
203  const dpo_id_t *dpo);
204 
205 /**
206  * @brief
207  * Update a 'special' entry to the FIB that links to the DPO passed
208  * A special entry is an entry that the FIB is not expect to resolve
209  * via the usual mechanisms (i.e. recurisve or neighbour adj DB lookup).
210  * Instead the client/source provides the DPO to link to.
211  * Special entries are add/remove reference counted per-source. So n
212  * 'removes' are required for n 'adds', if the entry is no longer required.
213  * An 'update' is an 'add' if no 'add' has already been called, otherwise an 'add'
214  * is therefore assumed to act on the reference instance of that add.
215  *
216  * @param fib_entry_index
217  * The index of the FIB entry to update
218  *
219  * @param source
220  * The ID of the client/source adding the entry.
221  *
222  * @param flags
223  * Flags for the entry.
224  *
225  * @param dpo
226  * The DPO to link to.
227  *
228  * @return
229  * the index of the fib_entry_t that is created (or existed already).
230  */
232  const fib_prefix_t *prefix,
233  fib_source_t source,
234  fib_entry_flag_t stype,
235  const dpo_id_t *dpo);
236 
237 /**
238  * @brief
239  * Remove a 'special' entry from the FIB.
240  * This add is reference counting per-source. So n 'removes' are required
241  * for n 'adds', if the entry is no longer required.
242  *
243  * @param fib_index
244  * The index of the FIB
245  *
246  * @param prefix
247  * The prefix to remove
248  *
249  * @param source
250  * The ID of the client/source adding the entry.
251  *
252  */
253 extern void fib_table_entry_special_remove(u32 fib_index,
254  const fib_prefix_t *prefix,
255  fib_source_t source);
256 
257 /**
258  * @brief
259  * Add one path to an entry (aka route) in the FIB. If the entry does not
260  * exist, it will be created.
261  * See the documentation for fib_route_path_t for more descirptions of
262  * the path parameters.
263  *
264  * @param fib_index
265  * The index of the FIB
266  *
267  * @param prefix
268  * The prefix for the entry to add
269  *
270  * @param source
271  * The ID of the client/source adding the entry.
272  *
273  * @param flags
274  * Flags for the entry.
275  *
276  * @paran next_hop_proto
277  * The protocol of the next hop. This cannot be derived in the event that
278  * the next hop is all zeros.
279  *
280  * @param next_hop
281  * The address of the next-hop.
282  *
283  * @param sw_if_index
284  * The index of the interface.
285  *
286  * @param next_hop_fib_index,
287  * The fib index of the next-hop for recursive resolution
288  *
289  * @param next_hop_weight
290  * [un]equal cost path weight
291  *
292  * @param next_hop_label_stack
293  * The path's out-going label stack. NULL is there is none.
294  *
295  * @param pf
296  * Flags for the path
297  *
298  * @return
299  * the index of the fib_entry_t that is created (or existed already).
300  */
302  const fib_prefix_t *prefix,
303  fib_source_t source,
305  fib_protocol_t next_hop_proto,
306  const ip46_address_t *next_hop,
307  u32 next_hop_sw_if_index,
308  u32 next_hop_fib_index,
309  u32 next_hop_weight,
310  mpls_label_t *next_hop_label_stack,
312 /**
313  * @brief
314  * Add n paths to an entry (aka route) in the FIB. If the entry does not
315  * exist, it will be created.
316  * See the documentation for fib_route_path_t for more descirptions of
317  * the path parameters.
318  *
319  * @param fib_index
320  * The index of the FIB
321  *
322  * @param prefix
323  * The prefix for the entry to add
324  *
325  * @param source
326  * The ID of the client/source adding the entry.
327  *
328  * @param flags
329  * Flags for the entry.
330  *
331  * @param rpaths
332  * A vector of paths. Not const since they may be modified.
333  *
334  * @return
335  * the index of the fib_entry_t that is created (or existed already).
336  */
338  const fib_prefix_t *prefix,
339  fib_source_t source,
341  fib_route_path_t *rpath);
342 
343 /**
344  * @brief
345  * remove one path to an entry (aka route) in the FIB. If this is the entry's
346  * last path, then the entry will be removed, unless it has other sources.
347  * See the documentation for fib_route_path_t for more descirptions of
348  * the path parameters.
349  *
350  * @param fib_index
351  * The index of the FIB
352  *
353  * @param prefix
354  * The prefix for the entry to add
355  *
356  * @param source
357  * The ID of the client/source adding the entry.
358  *
359  * @paran next_hop_proto
360  * The protocol of the next hop. This cannot be derived in the event that
361  * the next hop is all zeros.
362  *
363  * @param next_hop
364  * The address of the next-hop.
365  *
366  * @param sw_if_index
367  * The index of the interface.
368  *
369  * @param next_hop_fib_index,
370  * The fib index of the next-hop for recursive resolution
371  *
372  * @param next_hop_weight
373  * [un]equal cost path weight
374  *
375  * @param pf
376  * Flags for the path
377  */
378 extern void fib_table_entry_path_remove(u32 fib_index,
379  const fib_prefix_t *prefix,
380  fib_source_t source,
381  fib_protocol_t next_hop_proto,
382  const ip46_address_t *next_hop,
383  u32 next_hop_sw_if_index,
384  u32 next_hop_fib_index,
385  u32 next_hop_weight,
387 
388 /**
389  * @brief
390  * Remove n paths to an entry (aka route) in the FIB. If this is the entry's
391  * last path, then the entry will be removed, unless it has other sources.
392  * See the documentation for fib_route_path_t for more descirptions of
393  * the path parameters.
394  *
395  * @param fib_index
396  * The index of the FIB
397  *
398  * @param prefix
399  * The prefix for the entry to add
400  *
401  * @param source
402  * The ID of the client/source adding the entry.
403  *
404  * @param rpaths
405  * A vector of paths.
406  */
407 extern void fib_table_entry_path_remove2(u32 fib_index,
408  const fib_prefix_t *prefix,
409  fib_source_t source,
410  fib_route_path_t *paths);
411 
412 /**
413  * @brief
414  * Update an entry to have a new set of paths. If the entry does not
415  * exist, it will be created.
416  * The difference between an 'path-add' and an update, is that path-add is
417  * an incremental addition of paths, whereas an update is a wholesale swap.
418  *
419  * @param fib_index
420  * The index of the FIB
421  *
422  * @param prefix
423  * The prefix for the entry to add
424  *
425  * @param source
426  * The ID of the client/source adding the entry.
427  *
428  * @param rpaths
429  * A vector of paths. Not const since they may be modified.
430  *
431  * @return
432  * the index of the fib_entry_t that is created (or existed already).
433  */
435  const fib_prefix_t *prefix,
436  fib_source_t source,
438  fib_route_path_t *paths);
439 
440 /**
441  * @brief
442  * Update the entry to have just one path. If the entry does not
443  * exist, it will be created.
444  * See the documentation for fib_route_path_t for more descirptions of
445  * the path parameters.
446  *
447  * @param fib_index
448  * The index of the FIB
449  *
450  * @param prefix
451  * The prefix for the entry to add
452  *
453  * @param source
454  * The ID of the client/source adding the entry.
455  *
456  * @param flags
457  * Flags for the entry.
458  *
459  * @paran next_hop_proto
460  * The protocol of the next hop. This cannot be derived in the event that
461  * the next hop is all zeros.
462  *
463  * @param next_hop
464  * The address of the next-hop.
465  *
466  * @param sw_if_index
467  * The index of the interface.
468  *
469  * @param next_hop_fib_index,
470  * The fib index of the next-hop for recursive resolution
471  *
472  * @param next_hop_weight
473  * [un]equal cost path weight
474  *
475  * @param next_hop_label_stack
476  * The path's out-going label stack. NULL is there is none.
477  *
478  * @param pf
479  * Flags for the path
480  *
481  * @return
482  * the index of the fib_entry_t that is created (or existed already).
483  */
485  const fib_prefix_t *prefix,
486  fib_source_t source,
488  fib_protocol_t next_hop_proto,
489  const ip46_address_t *next_hop,
490  u32 next_hop_sw_if_index,
491  u32 next_hop_fib_index,
492  u32 next_hop_weight,
493  mpls_label_t *next_hop_label_stack,
495 
496 /**
497  * @brief
498  * Add a MPLS local label for the prefix/route. If the entry does not
499  * exist, it will be created. In theory more than one local label can be
500  * added, but this is not yet supported.
501  *
502  * @param fib_index
503  * The index of the FIB
504  *
505  * @param prefix
506  * The prefix for the entry to which to add the label
507  *
508  * @param label
509  * The MPLS label to add
510  *
511  * @return
512  * the index of the fib_entry_t that is created (or existed already).
513  */
515  const fib_prefix_t *prefix,
516  mpls_label_t label);
517 /**
518  * @brief
519  * remove a MPLS local label for the prefix/route.
520  *
521  * @param fib_index
522  * The index of the FIB
523  *
524  * @param prefix
525  * The prefix for the entry to which to add the label
526  *
527  * @param label
528  * The MPLS label to add
529  */
530 extern void fib_table_entry_local_label_remove(u32 fib_index,
531  const fib_prefix_t *prefix,
532  mpls_label_t label);
533 
534 /**
535  * @brief
536  * Delete a FIB entry. If the entry has no more sources, then it is
537  * removed from the table.
538  *
539  * @param fib_index
540  * The index of the FIB
541  *
542  * @param prefix
543  * The prefix for the entry to remove
544  *
545  * @param source
546  * The ID of the client/source adding the entry.
547  */
548 extern void fib_table_entry_delete(u32 fib_index,
549  const fib_prefix_t *prefix,
550  fib_source_t source);
551 
552 /**
553  * @brief
554  * Delete a FIB entry. If the entry has no more sources, then it is
555  * removed from the table.
556  *
557  * @param entry_index
558  * The index of the FIB entry
559  *
560  * @param source
561  * The ID of the client/source adding the entry.
562  */
563 extern void fib_table_entry_delete_index(fib_node_index_t entry_index,
564  fib_source_t source);
565 
566 /**
567  * @brief
568  * Flush all entries from a table for the source
569  *
570  * @param fib_index
571  * The index of the FIB
572  *
573  * @paran proto
574  * The protocol of the entries in the table
575  *
576  * @param source
577  * the source to flush
578  */
579 extern void fib_table_flush(u32 fib_index,
580  fib_protocol_t proto,
581  fib_source_t source);
582 
583 /**
584  * @brief
585  * Get the index of the FIB bound to the interface
586  *
587  * @paran proto
588  * The protocol of the FIB (and thus the entries therein)
589  *
590  * @param sw_if_index
591  * The interface index
592  *
593  * @return fib_index
594  * The index of the FIB
595  */
597  u32 sw_if_index);
598 
599 /**
600  * @brief
601  * Get the Table-ID of the FIB bound to the interface
602  *
603  * @paran proto
604  * The protocol of the FIB (and thus the entries therein)
605  *
606  * @param sw_if_index
607  * The interface index
608  *
609  * @return fib_index
610  * The tableID of the FIB
611  */
613  u32 sw_if_index);
614 
615 /**
616  * @brief
617  * Get the index of the FIB for a Table-ID. This DOES NOT create the
618  * FIB if it does not exist.
619  *
620  * @paran proto
621  * The protocol of the FIB (and thus the entries therein)
622  *
623  * @param table-id
624  * The Table-ID
625  *
626  * @return fib_index
627  * The index of the FIB, which may be INVALID.
628  */
629 extern u32 fib_table_find(fib_protocol_t proto, u32 table_id);
630 
631 
632 /**
633  * @brief
634  * Get the index of the FIB for a Table-ID. This DOES create the
635  * FIB if it does not exist.
636  *
637  * @paran proto
638  * The protocol of the FIB (and thus the entries therein)
639  *
640  * @param table-id
641  * The Table-ID
642  *
643  * @return fib_index
644  * The index of the FIB
645  */
647  u32 table_id);
648 
649 /**
650  * @brief
651  * Create a new table with no table ID. This means it does not get
652  * added to the hash-table and so can only be found by using the index returned.
653  *
654  * @paran proto
655  * The protocol of the FIB (and thus the entries therein)
656  *
657  * @param fmt
658  * A string to describe the table
659  *
660  * @return fib_index
661  * The index of the FIB
662  */
664  const char *const fmt,
665  ...);
666 
667 /**
668  * @brief
669  * Get the flow hash configured used by the table
670  *
671  * @param fib_index
672  * The index of the FIB
673  *
674  * @paran proto
675  * The protocol of the FIB (and thus the entries therein)
676  *
677  * @return The flow hash config
678  */
680  fib_protocol_t proto);
681 
682 /**
683  * @brief
684  * Take a reference counting lock on the table
685  *
686  * @param fib_index
687  * The index of the FIB
688  *
689  * @paran proto
690  * The protocol of the FIB (and thus the entries therein)
691  */
692 extern void fib_table_unlock(u32 fib_index,
693  fib_protocol_t proto);
694 
695 /**
696  * @brief
697  * Release a reference counting lock on the table. When the last lock
698  * has gone. the FIB is deleted.
699  *
700  * @param fib_index
701  * The index of the FIB
702  *
703  * @paran proto
704  * The protocol of the FIB (and thus the entries therein)
705  */
706 extern void fib_table_lock(u32 fib_index,
707  fib_protocol_t proto);
708 
709 /**
710  * @brief
711  * Return the number of entries in the FIB added by a given source.
712  *
713  * @param fib_index
714  * The index of the FIB
715  *
716  * @paran proto
717  * The protocol of the FIB (and thus the entries therein)
718  *
719  * @return number of sourced entries.
720  */
721 extern u32 fib_table_get_num_entries(u32 fib_index,
722  fib_protocol_t proto,
723  fib_source_t source);
724 
725 /**
726  * @brief
727  * Get a pointer to a FIB table
728  */
730  fib_protocol_t proto);
731 
732 #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:285
mpls_fib_t mpls
Definition: fib_table.h:40
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:808
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:565
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
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:145
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:677
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:487
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:138
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:935
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:918
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:130
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:399
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:1098
u8 * format_fib_table_name(u8 *s, va_list ap)
Format the description/name of the table.
Definition: fib_table.c:1084
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:66
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:948
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:995
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
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
void fib_table_unlock(u32 fib_index, fib_protocol_t proto)
Take a reference counting lock on the table.
Definition: fib_table.c:1048
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:1062
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:521
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:902
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:831
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
Definition: lookup.h:160
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:726
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:870
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, adj_index_t adj_index)
Add a &#39;special&#39; entry to the FIB that links to the adj passed A special entry is an entry that the FI...
Definition: fib_table.c:369
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:1072
u32 flags
Definition: vhost-user.h:75
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:635
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:964
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:843
A protocol Independent FIB table.
Definition: fib_table.h:29