FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
lisp_gpe_fwd_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  * @file
17  * @brief LISP-GPE definitions.
18  */
19 
20 #ifndef __LISP_GPE_FWD_ENTRY_H__
21 #define __LISP_GPE_FWD_ENTRY_H__
22 
23 #include <lisp/lisp-gpe/lisp_gpe.h>
24 
25 /**
26  * @brief A path on which to forward lisp traffic
27  */
28 typedef struct lisp_fwd_path_t_
29 {
30  /**
31  * The adjacency constructed for the locator pair
32  */
34 
35  /**
36  * Priority. Only the paths with the best priority will be installed in FIB
37  */
39 
40  /**
41  * [UE]CMP weigt for the path
42  */
44 
46 
47 /**
48  * @brief A Forwarding entry can be 'normal' or 'negative'
49  * Negative implies we deliberately want to add a FIB entry for an EID
50  * that results in 'special' behaviour determined by an 'action'.
51  * @normal means send it down some tunnels.
52  */
54 {
58 
59 
60 /**
61  * LISP-GPE fwd entry key
62  */
64 {
69 
70 /**
71  * @brief A LISP Forwarding Entry
72  *
73  * A forwarding entry is from a locai EID to a remote EID over a set of rloc pairs
74  */
75 typedef struct lisp_gpe_fwd_entry_t_
76 {
77  /**
78  * Follows src/dst or dst only forwarding policy
79  */
81 
82  /**
83  * This object joins the FIB control plane graph to receive updates to
84  * for changes to the graph.
85  */
87 
88  /**
89  * The Entry's key: {lEID,rEID,vni}
90  */
92 
93  /**
94  * The forwarding entry type
95  */
97 
98  /**
99  * The tenant the entry belongs to
100  */
102 
103  /**
104  * The VRF (in the case of L3) or Bridge-Domain (for L2) index
105  */
106  union
107  {
108  /**
109  * Fields relevant to an L2 entry
110  */
111  struct
112  {
113  /**
114  * The VRF ID
115  */
117 
118  /**
119  * The FIB index for the overlay, i.e. the FIB in which the EIDs
120  * are present
121  */
123  /**
124  * The SRC-FIB index for created for anding source-route entries
125  */
127  };
128  /**
129  * Fields relevant to an L2 entry
130  */
131  struct
132  {
133  /**
134  * The Bridge-Domain (for L2) index
135  */
137 
138  /**
139  * The Bridge-domain index for the overlay EIDs
140  */
142 
143  /**
144  * The path-list created for the forwarding
145  */
147 
148  /**
149  * Child index of this entry on the path-list
150  */
152 
153  /**
154  * The DPO used to forward
155  */
157  } l2;
158 
159  /**
160  * Fields relevant to an NSH entry
161  */
162  struct
163  {
164  /**
165  * The path-list created for the forwarding
166  */
168 
169  /**
170  * Child index of this entry on the path-list
171  */
173 
174  /**
175  * The DPO contributed by NSH
176  */
177  dpo_id_t dpo;
178 
179  /**
180  * The DPO used for forwarding. Obtained after stacking tx node
181  * onto lb choice
182  */
184  } nsh;
185  };
186 
187  union
188  {
189  /**
190  * @brief When the type is 'normal'
191  * The RLOC pair that form the route's paths. i.e. where to send
192  * packets for this route.
193  */
195 
196  /**
197  * @brief When the type is negative. The action to take.
198  */
200  };
201 
202  /**
203  * used for getting load balance statistics
204  */
206 
208 
209 extern int
211  u32 * hw_if_indexp);
212 
213 extern void vnet_lisp_gpe_fwd_entry_flush (void);
214 
215 extern u32 lisp_l2_fib_lookup (lisp_gpe_main_t *lgm, u16 bd_index,
216  u8 src_mac[6], u8 dst_mac[6]);
217 
218 extern const dpo_id_t *lisp_nsh_fib_lookup (lisp_gpe_main_t * lgm,
219  u32 spi_si);
220 extern void
222  u32 fwd_entry_index);
223 extern void
225  u32 fwd_entry_index);
227 
228 int
230  vlib_counter_t * c);
231 
232 #endif
233 
234 /*
235  * fd.io coding-style-patch-verification: ON
236  *
237  * Local Variables:
238  * eval: (c-set-style "gnu")
239  * End:
240  */
lisp_gpe_fwd_entry_t
struct lisp_gpe_fwd_entry_t_ lisp_gpe_fwd_entry_t
A LISP Forwarding Entry.
lisp_gpe_fwd_entry_key_t
struct lisp_gpe_fwd_entry_key_t_ lisp_gpe_fwd_entry_key_t
LISP-GPE fwd entry key.
lisp_gpe_fwd_entry_t_::is_src_dst
u8 is_src_dst
Follows src/dst or dst only forwarding policy.
Definition: lisp_gpe_fwd_entry.h:80
lisp_gpe_fwd_entry_t_::node
fib_node_t node
This object joins the FIB control plane graph to receive updates to for changes to the graph.
Definition: lisp_gpe_fwd_entry.h:86
fid_address_t
Definition: lisp_types.h:69
vnet_lisp_gpe_get_fwd_entry_vnis
u32 * vnet_lisp_gpe_get_fwd_entry_vnis(void)
Definition: lisp_gpe_fwd_entry.c:1518
lisp_gpe_fwd_entry_key_t_
LISP-GPE fwd entry key.
Definition: lisp_gpe_fwd_entry.h:63
lisp_gpe_fwd_entry_t_::l2
struct lisp_gpe_fwd_entry_t_::@706::@712 l2
Fields relevant to an L2 entry.
lisp_fwd_path_t_::lisp_adj
index_t lisp_adj
The adjacency constructed for the locator pair.
Definition: lisp_gpe_fwd_entry.h:33
src_mac
vl_api_mac_address_t src_mac
Definition: acl_types.api:94
lisp_gpe_fwd_entry_type_t
enum lisp_gpe_fwd_entry_type_t_ lisp_gpe_fwd_entry_type_t
A Forwarding entry can be 'normal' or 'negative' Negative implies we deliberately want to add a FIB e...
lisp_l2_fib_lookup
u32 lisp_l2_fib_lookup(lisp_gpe_main_t *lgm, u16 bd_index, u8 src_mac[6], u8 dst_mac[6])
Lookup L2 SD FIB entry.
Definition: lisp_gpe_fwd_entry.c:644
lisp_gpe_fwd_entry_key_t_::lcl
dp_address_t lcl
Definition: lisp_gpe_fwd_entry.h:66
u16
unsigned short u16
Definition: types.h:57
lisp_fwd_path_t
struct lisp_fwd_path_t_ lisp_fwd_path_t
A path on which to forward lisp traffic.
lisp_gpe_fwd_entry_t_::dpoi_index
index_t dpoi_index
used for getting load balance statistics
Definition: lisp_gpe_fwd_entry.h:205
lisp_gpe_fwd_entry_key_t_::rmt
dp_address_t rmt
Definition: lisp_gpe_fwd_entry.h:65
lisp_gpe.h
LISP-GPE definitions.
lisp_fwd_path_t_::weight
u8 weight
[UE]CMP weigt for the path
Definition: lisp_gpe_fwd_entry.h:43
vlib_counter_t
Combined counter to hold both packets and byte differences.
Definition: counter_types.h:26
lisp_gpe_fwd_entry_t_::eid_bd_index
u32 eid_bd_index
The Bridge-domain index for the overlay EIDs.
Definition: lisp_gpe_fwd_entry.h:141
lisp_gpe_fwd_entry_key_t_::vni
u32 vni
Definition: lisp_gpe_fwd_entry.h:67
c
svmdb_client_t * c
Definition: vpp_get_metrics.c:48
index_t
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:43
lisp_gpe_fwd_entry_t_::path_list_index
fib_node_index_t path_list_index
The path-list created for the forwarding.
Definition: lisp_gpe_fwd_entry.h:146
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
vnet_lisp_gpe_add_del_fwd_entry_args_t
Definition: lisp_gpe.h:228
vnet_lisp_gpe_del_fwd_counters
void vnet_lisp_gpe_del_fwd_counters(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 fwd_entry_index)
Definition: lisp_gpe_fwd_entry.c:1327
lisp_gpe_fwd_entry_t_::key
lisp_gpe_fwd_entry_key_t * key
The Entry's key: {lEID,rEID,vni}.
Definition: lisp_gpe_fwd_entry.h:91
LISP_GPE_FWD_ENTRY_TYPE_NORMAL
@ LISP_GPE_FWD_ENTRY_TYPE_NORMAL
Definition: lisp_gpe_fwd_entry.h:55
lisp_gpe_fwd_entry_t_::paths
lisp_fwd_path_t * paths
When the type is 'normal' The RLOC pair that form the route's paths.
Definition: lisp_gpe_fwd_entry.h:194
vnet_lisp_gpe_add_del_fwd_entry
int vnet_lisp_gpe_add_del_fwd_entry(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 *hw_if_indexp)
Forwarding entry create/remove dispatcher.
Definition: lisp_gpe_fwd_entry.c:1248
lisp_fwd_path_t_::priority
u8 priority
Priority.
Definition: lisp_gpe_fwd_entry.h:38
lisp_nsh_fib_lookup
const dpo_id_t * lisp_nsh_fib_lookup(lisp_gpe_main_t *lgm, u32 spi_si)
Lookup NSH SD FIB entry.
Definition: lisp_gpe_fwd_entry.c:914
lisp_gpe_main
LISP-GPE global state.
Definition: lisp_gpe.h:119
lisp_fwd_path_t_
A path on which to forward lisp traffic.
Definition: lisp_gpe_fwd_entry.h:28
negative_fwd_actions_e
negative_fwd_actions_e
Definition: lisp_gpe.h:219
lisp_gpe_fwd_entry_t_::eid_bd_id
u32 eid_bd_id
The Bridge-Domain (for L2) index.
Definition: lisp_gpe_fwd_entry.h:136
lisp_gpe_fwd_entry_t_::tenant
u32 tenant
The tenant the entry belongs to.
Definition: lisp_gpe_fwd_entry.h:101
u32
unsigned int u32
Definition: types.h:88
lisp_gpe_fwd_entry_t_::action
negative_fwd_actions_e action
When the type is negative.
Definition: lisp_gpe_fwd_entry.h:199
lisp_gpe_fwd_entry_t_
A LISP Forwarding Entry.
Definition: lisp_gpe_fwd_entry.h:75
lisp_gpe_fwd_entry_t_::dpo
dpo_id_t dpo
The DPO used to forward.
Definition: lisp_gpe_fwd_entry.h:156
fib_node_t_
An node in the FIB graph.
Definition: fib_node.h:301
lisp_gpe_fwd_entry_t_::nsh
struct lisp_gpe_fwd_entry_t_::@706::@713 nsh
Fields relevant to an NSH entry.
lisp_gpe_fwd_entry_t_::src_fib_index
u32 src_fib_index
The SRC-FIB index for created for anding source-route entries.
Definition: lisp_gpe_fwd_entry.h:126
lisp_gpe_fwd_entry_t_::eid_table_id
u32 eid_table_id
The VRF ID.
Definition: lisp_gpe_fwd_entry.h:116
u8
unsigned char u8
Definition: types.h:56
a
a
Definition: bitmap.h:544
LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE
@ LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE
Definition: lisp_gpe_fwd_entry.h:56
vnet_lisp_gpe_add_fwd_counters
void vnet_lisp_gpe_add_fwd_counters(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 fwd_entry_index)
Definition: lisp_gpe_fwd_entry.c:468
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172
lisp_gpe_fwd_entry_t_::eid_fib_index
u32 eid_fib_index
The FIB index for the overlay, i.e.
Definition: lisp_gpe_fwd_entry.h:122
lisp_gpe_fwd_entry_t_::child_index
u32 child_index
Child index of this entry on the path-list.
Definition: lisp_gpe_fwd_entry.h:151
lisp_gpe_fwd_entry_type_t_
lisp_gpe_fwd_entry_type_t_
A Forwarding entry can be 'normal' or 'negative' Negative implies we deliberately want to add a FIB e...
Definition: lisp_gpe_fwd_entry.h:53
vnet_lisp_gpe_get_fwd_stats
int vnet_lisp_gpe_get_fwd_stats(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, vlib_counter_t *c)
Definition: lisp_gpe_fwd_entry.c:1563
vnet_lisp_gpe_fwd_entry_flush
void vnet_lisp_gpe_fwd_entry_flush(void)
Flush all the forwrding entries.
Definition: lisp_gpe_fwd_entry.c:1354
lisp_gpe_fwd_entry_t_::type
lisp_gpe_fwd_entry_type_t type
The forwarding entry type.
Definition: lisp_gpe_fwd_entry.h:96
lisp_gpe_fwd_entry_t_::choice
dpo_id_t choice
The DPO used for forwarding.
Definition: lisp_gpe_fwd_entry.h:183