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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @brief LISP-GPE definitions.
20 #ifndef __LISP_GPE_FWD_ENTRY_H__
21 #define __LISP_GPE_FWD_ENTRY_H__
23 #include <vnet/lisp-gpe/lisp_gpe.h>
26 * @brief A path on which to forward lisp traffic
28 typedef struct lisp_fwd_path_t_
31 * The adjacency constructed for the locator pair
36 * Priority. Only the paths with the best priority will be installed in FIB
41 * [UE]CMP weigt for the path
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.
53 typedef enum lisp_gpe_fwd_entry_type_t_
55 LISP_GPE_FWD_ENTRY_TYPE_NORMAL,
56 LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE,
57 } lisp_gpe_fwd_entry_type_t;
61 * LISP-GPE fwd entry key
63 typedef struct lisp_gpe_fwd_entry_key_t_
68 } lisp_gpe_fwd_entry_key_t;
71 * @brief A LISP Forwarding Entry
73 * A forwarding entry is from a locai EID to a remote EID over a set of rloc pairs
75 typedef struct lisp_gpe_fwd_entry_t_
78 * Follows src/dst or dst only forwarding policy
83 * This object joins the FIB control plane graph to receive updates to
84 * for changes to the graph.
89 * The Entry's key: {lEID,rEID,vni}
91 lisp_gpe_fwd_entry_key_t *key;
94 * The forwarding entry type
96 lisp_gpe_fwd_entry_type_t type;
99 * The tenant the entry belongs to
104 * The VRF (in the case of L3) or Bridge-Domain (for L2) index
109 * Fields relevant to an L2 entry
119 * The FIB index for the overlay, i.e. the FIB in which the EIDs
124 * The SRC-FIB index for created for anding source-route entries
129 * Fields relevant to an L2 entry
134 * The Bridge-Domain (for L2) index
139 * The Bridge-domain index for the overlay EIDs
144 * The path-list created for the forwarding
146 fib_node_index_t path_list_index;
149 * Child index of this entry on the path-list
154 * The DPO used to forward
160 * Fields relevant to an NSH entry
165 * The path-list created for the forwarding
167 fib_node_index_t path_list_index;
170 * Child index of this entry on the path-list
175 * The DPO contributed by NSH
180 * The DPO used for forwarding. Obtained after stacking tx node
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.
194 lisp_fwd_path_t *paths;
197 * @brief When the type is negative. The action to take.
199 negative_fwd_actions_e action;
203 * used for getting load balance statistics
207 } lisp_gpe_fwd_entry_t;
210 vnet_lisp_gpe_add_del_fwd_entry (vnet_lisp_gpe_add_del_fwd_entry_args_t * a,
213 extern void vnet_lisp_gpe_fwd_entry_flush (void);
215 extern u32 lisp_l2_fib_lookup (lisp_gpe_main_t * lgm,
216 u16 bd_index, u8 src_mac[8], u8 dst_mac[8]);
218 extern const dpo_id_t *lisp_nsh_fib_lookup (lisp_gpe_main_t * lgm,
221 vnet_lisp_gpe_del_fwd_counters (vnet_lisp_gpe_add_del_fwd_entry_args_t * a,
222 u32 fwd_entry_index);
224 vnet_lisp_gpe_add_fwd_counters (vnet_lisp_gpe_add_del_fwd_entry_args_t * a,
225 u32 fwd_entry_index);
226 extern u32 *vnet_lisp_gpe_get_fwd_entry_vnis (void);
229 vnet_lisp_gpe_get_fwd_stats (vnet_lisp_gpe_add_del_fwd_entry_args_t * a,
235 * fd.io coding-style-patch-verification: ON
238 * eval: (c-set-style "gnu")