FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
fib_entry_track.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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_TRACKER_H__
17 #define __FIB_TRACKER_H__
18 
19 #include <vnet/fib/fib_entry.h>
20 
21 /**
22  * Trackers are used on FIB entries by objects that which to track the
23  * changing state of the entry. For example a tunnel would track its
24  * destination address to be informed of reachability changes.
25  *
26  * The benefit of this aproach is that each time a new client tracks the
27  * entry it doesn't RR source it. When an entry is sourced all its children
28  * are updated. Thus, new clients tracking an entry is O(n^2). With the
29  * tracker as indirection, the entry is sourced only once.
30  */
31 
32 /**
33  * Track a FIB entry
34  * @param fib_index The FIB the entry is in
35  * @param prefix The Prefix of the entry to track
36  * @param child_type The type of object that is tracking this entry
37  * @param child_index The pool index of the object tracking
38  * @param sigbling [RETURNED] The sibling index of the child on the tracker
39  * @return The index of the FIB entry
40  */
41 extern fib_node_index_t fib_entry_track(u32 fib_index,
42  const fib_prefix_t *prefix,
43  fib_node_type_t child_type,
44  index_t child_index,
45  u32 *sibling);
46 
47 /**
48  * Stop tracking a FIB entry
49  * @param fei FIB entry index (as returned from the track API above)
50  * @param sibling Sibling index (as returned from the track API above)
51  */
52 extern void fib_entry_untrack(fib_node_index_t fei,
53  u32 sibling);
54 
55 extern void fib_entry_track_module_init(void);
56 
57 #endif
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:41
vl_api_prefix_t prefix
Definition: ip.api:144
Aggregate type for a prefix.
Definition: fib_types.h:203
unsigned int u32
Definition: types.h:88
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:30
void fib_entry_track_module_init(void)
fib_node_index_t fib_entry_track(u32 fib_index, const fib_prefix_t *prefix, fib_node_type_t child_type, index_t child_index, u32 *sibling)
Trackers are used on FIB entries by objects that which to track the changing state of the entry...
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
void fib_entry_untrack(fib_node_index_t fei, u32 sibling)
Stop tracking a FIB entry.