FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
lisp_gpe_adjacency.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 Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
18  *
19  */
20 
21 #ifndef LISP_GPE_ADJACENCY_H__
22 #define LISP_GPE_ADJACENCY_H__
23 
24 #include <vnet/fib/fib_node.h>
25 #include <lisp/lisp-gpe/lisp_gpe.h>
26 
27 /**
28  * @brief A LISP GPE Adjacency.
29  *
30  * A adjacency represents peer on an L3 sub-interface to which to send traffic.
31  * adjacencies are thus present in the EID space.
32  * The peer is identified by the key:{remote-rloc, sub-interface}, which is
33  * equivalent to the usal adjacency key {next-hop, interface}. So curiously
34  * the rloc address from the underlay is used as a next hop address in the overlay
35  * This is OK because:
36  * 1 - the RLOC is unique in the underlay AND there is only one underlay VRF per
37  * overlay
38  * 2 - the RLOC may overlap with an address in the overlay, but we do not create
39  * an adj-fib (i.e. a route in the overlay FIB for the rloc)
40  *
41  *
42  */
43 typedef struct lisp_gpe_adjacency_t_
44 {
45  /**
46  * The LISP adj is a part of the FIB control plane graph.
47  */
49 
50  /**
51  * remote RLOC. The adjacency's next-hop
52  */
54 
55  /**
56  * The VNI. Used in combination with the local-rloc to get the sub-interface
57  */
59 
60  /**
61  * The number of locks/reference counts on the adjacency.
62  */
64 
65  /**
66  * The index of the LISP L3 subinterface
67  */
69 
70  /**
71  * The SW IF index of the sub-interface this adjacency uses.
72  * Cached for convenience from the LISP L3 sub-interface
73  */
75 
76  /**
77  * The index of the LISP GPE tunnel that provides the transport
78  * in the underlay.
79  */
81 
82  /**
83  * This adjacency is a child of the FIB entry to reach the RLOC.
84  * This is so when the reachability of that RLOC changes, we can restack
85  * the FIB adjacnecies.
86  */
88 
89  /**
90  * LISP header fields in HOST byte order
91  */
96 
98 
101  pair,
102  u32 rloc_fib_index,
103  u32 vni);
104 
105 extern void lisp_gpe_adjacency_unlock (index_t l3si);
106 
108 
109 extern void lisp_gpe_update_adjacency (vnet_main_t * vnm,
111 extern u8 *lisp_gpe_build_rewrite (vnet_main_t * vnm,
113  vnet_link_t link_type,
114  const void *dst_address);
115 
116 
117 /**
118  * @brief Flags for displaying the adjacency
119  */
121 {
125 
126 extern u8 *format_lisp_gpe_adjacency (u8 * s, va_list * args);
127 
128 #endif
129 
130 /*
131  * fd.io coding-style-patch-verification: ON
132  *
133  * Local Variables:
134  * eval: (c-set-style "gnu")
135  * End:
136  */
ip_address
Definition: ip_types.h:79
lisp_gpe_adjacency_t_::remote_rloc
ip_address_t remote_rloc
remote RLOC.
Definition: lisp_gpe_adjacency.h:53
lisp_gpe_adjacency_unlock
void lisp_gpe_adjacency_unlock(index_t l3si)
Definition: lisp_gpe_adjacency.c:450
format_lisp_gpe_adjacency
u8 * format_lisp_gpe_adjacency(u8 *s, va_list *args)
Definition: lisp_gpe_adjacency.c:508
lisp_gpe_adjacency_get
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t l3si)
Definition: lisp_gpe_adjacency.c:465
lisp_gpe_adjacency_t_::locks
u32 locks
The number of locks/reference counts on the adjacency.
Definition: lisp_gpe_adjacency.h:63
vni
u32 vni
Definition: flow_types.api:160
lisp_gpe_adjacency_t_::res
u8 res
Definition: lisp_gpe_adjacency.h:94
fib_node.h
LISP_GPE_ADJ_FORMAT_FLAG_DETAIL
@ LISP_GPE_ADJ_FORMAT_FLAG_DETAIL
Definition: lisp_gpe_adjacency.h:123
lisp_gpe.h
LISP-GPE definitions.
lisp_gpe_adjacency_format_flags_t
enum lisp_gpe_adjacency_format_flags_t_ lisp_gpe_adjacency_format_flags_t
Flags for displaying the adjacency.
lisp_gpe_adjacency_t_::fib_node
fib_node_t fib_node
The LISP adj is a part of the FIB control plane graph.
Definition: lisp_gpe_adjacency.h:48
lisp_gpe_adjacency_format_flags_t_
lisp_gpe_adjacency_format_flags_t_
Flags for displaying the adjacency.
Definition: lisp_gpe_adjacency.h:120
lisp_gpe_adjacency_find_or_create_and_lock
index_t lisp_gpe_adjacency_find_or_create_and_lock(const locator_pair_t *pair, u32 rloc_fib_index, u32 vni)
Definition: lisp_gpe_adjacency.c:342
LISP_GPE_ADJ_FORMAT_FLAG_NONE
@ LISP_GPE_ADJ_FORMAT_FLAG_NONE
Definition: lisp_gpe_adjacency.h:122
lisp_gpe_adjacency_t_::fib_entry_child_index
u32 fib_entry_child_index
This adjacency is a child of the FIB entry to reach the RLOC.
Definition: lisp_gpe_adjacency.h:87
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_update_adjacency
void lisp_gpe_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
The LISP-GPE interface registered function to update, i.e.
Definition: lisp_gpe_adjacency.c:296
lisp_gpe_adjacency_t_::sw_if_index
u32 sw_if_index
The SW IF index of the sub-interface this adjacency uses.
Definition: lisp_gpe_adjacency.h:74
lisp_gpe_adjacency_t_::next_protocol
u8 next_protocol
Definition: lisp_gpe_adjacency.h:95
locator_pair
Definition: lisp_types.h:326
vnet_main_t
Definition: vnet.h:76
u32
unsigned int u32
Definition: types.h:88
lisp_gpe_adjacency_t_
A LISP GPE Adjacency.
Definition: lisp_gpe_adjacency.h:43
fib_node_t_
An node in the FIB graph.
Definition: fib_node.h:301
lisp_gpe_adjacency_t_::flags
u8 flags
LISP header fields in HOST byte order.
Definition: lisp_gpe_adjacency.h:92
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
vnet_link_t
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
u8
unsigned char u8
Definition: types.h:56
lisp_gpe_adjacency_t_::tunnel_index
u32 tunnel_index
The index of the LISP GPE tunnel that provides the transport in the underlay.
Definition: lisp_gpe_adjacency.h:80
lisp_gpe_adjacency_t
struct lisp_gpe_adjacency_t_ lisp_gpe_adjacency_t
A LISP GPE Adjacency.
lisp_gpe_adjacency_t_::ver_res
u8 ver_res
Definition: lisp_gpe_adjacency.h:93
lisp_gpe_build_rewrite
u8 * lisp_gpe_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
Definition: lisp_gpe_adjacency.c:333
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
lisp_gpe_adjacency_t_::lisp_l3_sub_index
u32 lisp_l3_sub_index
The index of the LISP L3 subinterface.
Definition: lisp_gpe_adjacency.h:68
lisp_gpe_adjacency_t_::vni
u32 vni
The VNI.
Definition: lisp_gpe_adjacency.h:58