FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
bier_entry.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  * bier_entry : The BIER entry
17  *
18  * The interface to the BIER entry is through a bier_entry_t* rather
19  * than an index. This is because the BIER table allocates the entries
20  * in a contiguous array once and only once when the table is created.
21  * this is done for forwarding performance. The entry is thus not subject
22  * to realloc, and does not need to be malloc'd when a route to that
23  * bit-position is first learned.
24  *
25  */
26 
27 #ifndef __BIER_ENTRY_H__
28 #define __BIER_ENTRY_H__
29 
30 #include <vlib/vlib.h>
31 #include <vnet/fib/fib_node.h>
32 #include <vnet/bier/bier_types.h>
33 
34 /**
35  * Forward declarations
36  */
37 struct bier_route_update_t_;
38 struct bier_fmask_db_t_;
39 
40 /**
41  * The BIER entry
42  *
43  * the BIER entry is the representation of a BIER forwarding egress router (BFER)
44  * (or the egress PE) that is assigned a bit position.
45  */
46 typedef struct bier_entry_t_ {
47  /**
48  * linkage into the FIB graph
49  */
51 
52  /**
53  * The index of the BIER table in which this entry resides
54  */
56 
57  /**
58  * the bit position this entry represents.
59  * this is the key table insertion
60  */
62 
63  /**
64  * the FIB path-list this entry resolves through.
65  * the path-list is itself resoved on the entry's fmasks
66  */
68  /**
69  * sibling index on the path list
70  */
72 } bier_entry_t;
73 
75  bier_bp_t bp);
76 extern void bier_entry_delete(index_t bei);
77 
78 extern void bier_entry_path_update (index_t bei,
79  const fib_route_path_t *rpaths);
80 
81 extern void bier_entry_path_add(index_t bei,
82  const fib_route_path_t *brp);
83 
84 extern int bier_entry_path_remove(index_t bei,
85  const fib_route_path_t *brp);
86 
87 extern u8* format_bier_entry(u8* s, va_list *ap);
88 
90  dpo_id_t *dpo);
91 
94 {
95  return (&bier_entry_pool[bei]);
96 }
97 #endif
Global Table of fmask objects The key into this table includes the table&#39;s key and the fmask&#39;s key...
Definition: bier_fmask_db.c:30
A representation of a path as described by a route producer.
Definition: fib_types.h:485
struct bier_entry_t_ bier_entry_t
The BIER entry.
index_t bier_entry_create(index_t bti, bier_bp_t bp)
Definition: bier_entry.c:62
void bier_entry_contribute_forwarding(index_t bei, dpo_id_t *dpo)
Definition: bier_entry.c:355
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
index_t be_bti
The index of the BIER table in which this entry resides.
Definition: bier_entry.h:55
fib_node_index_t be_path_list
the FIB path-list this entry resolves through.
Definition: bier_entry.h:67
static bier_entry_t * bier_entry_get(index_t bei)
Definition: bier_entry.h:93
bier_bp_t be_bp
the bit position this entry represents.
Definition: bier_entry.h:61
unsigned char u8
Definition: types.h:56
void bier_entry_path_add(index_t bei, const fib_route_path_t *brp)
Definition: bier_entry.c:170
#define always_inline
Definition: clib.h:99
fib_node_index_t be_sibling_index
sibling index on the path list
Definition: bier_entry.h:71
u32 bier_bp_t
A bit positon as assigned to egress PEs.
Definition: bier_types.h:294
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:170
void bier_entry_path_update(index_t bei, const fib_route_path_t *rpaths)
Definition: bier_entry.c:240
An node in the FIB graph.
Definition: fib_node.h:295
fib_node_t be_node
linkage into the FIB graph
Definition: bier_entry.h:50
bier_entry_t * bier_entry_pool
Definition: bier_entry.c:25
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:30
The BIER entry.
Definition: bier_entry.h:46
u8 * format_bier_entry(u8 *s, va_list *ap)
Definition: bier_entry.c:367
int bier_entry_path_remove(index_t bei, const fib_route_path_t *brp)
Definition: bier_entry.c:296
void bier_entry_delete(index_t bei)
Definition: bier_entry.c:143