Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 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 | */ |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 15 | /** |
| 16 | * @file |
| 17 | * @brief VXLAN GPE definitions |
| 18 | * |
| 19 | */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 20 | #ifndef included_vnet_vxlan_gpe_h |
| 21 | #define included_vnet_vxlan_gpe_h |
| 22 | |
| 23 | #include <vppinfra/error.h> |
| 24 | #include <vppinfra/hash.h> |
| 25 | #include <vnet/vnet.h> |
| 26 | #include <vnet/ip/ip.h> |
| 27 | #include <vnet/l2/l2_input.h> |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 28 | #include <vnet/l2/l2_output.h> |
| 29 | #include <vnet/l2/l2_bd.h> |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 30 | #include <vnet/ethernet/ethernet.h> |
| 31 | #include <vnet/vxlan-gpe/vxlan_gpe_packet.h> |
| 32 | #include <vnet/ip/ip4_packet.h> |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 33 | #include <vnet/ip/ip6_packet.h> |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 34 | #include <vnet/udp/udp.h> |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 35 | #include <vnet/dpo/dpo.h> |
| 36 | #include <vnet/adj/adj_types.h> |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 37 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 38 | /** |
| 39 | * @brief VXLAN GPE header struct |
| 40 | * |
| 41 | */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 42 | /* *INDENT-OFF* */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 43 | typedef CLIB_PACKED (struct { |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 44 | /** 20 bytes */ |
| 45 | ip4_header_t ip4; |
| 46 | /** 8 bytes */ |
| 47 | udp_header_t udp; |
| 48 | /** 8 bytes */ |
| 49 | vxlan_gpe_header_t vxlan; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 50 | }) ip4_vxlan_gpe_header_t; |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 51 | /* *INDENT-ON* */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 52 | |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 53 | /* *INDENT-OFF* */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 54 | typedef CLIB_PACKED (struct { |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 55 | /** 40 bytes */ |
| 56 | ip6_header_t ip6; |
| 57 | /** 8 bytes */ |
| 58 | udp_header_t udp; |
| 59 | /** 8 bytes */ |
| 60 | vxlan_gpe_header_t vxlan; |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 61 | }) ip6_vxlan_gpe_header_t; |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 62 | /* *INDENT-ON* */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 63 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 64 | /** |
| 65 | * @brief Key struct for IPv4 VXLAN GPE tunnel. |
| 66 | * Key fields: local remote, vni |
| 67 | * all fields in NET byte order |
| 68 | * VNI shifted 8 bits |
| 69 | */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 70 | /* *INDENT-OFF* */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 71 | typedef CLIB_PACKED(struct { |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 72 | union { |
| 73 | struct { |
| 74 | u32 local; |
| 75 | u32 remote; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 76 | |
| 77 | u32 vni; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 78 | u32 pad; |
| 79 | }; |
| 80 | u64 as_u64[2]; |
| 81 | }; |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 82 | }) vxlan4_gpe_tunnel_key_t; |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 83 | /* *INDENT-ON* */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 84 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 85 | /** |
| 86 | * @brief Key struct for IPv6 VXLAN GPE tunnel. |
| 87 | * Key fields: local remote, vni |
| 88 | * all fields in NET byte order |
| 89 | * VNI shifted 8 bits |
| 90 | */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 91 | /* *INDENT-OFF* */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 92 | typedef CLIB_PACKED(struct { |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 93 | ip6_address_t local; |
| 94 | ip6_address_t remote; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 95 | u32 vni; |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 96 | }) vxlan6_gpe_tunnel_key_t; |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 97 | /* *INDENT-ON* */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 98 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 99 | /** |
| 100 | * @brief Struct for VXLAN GPE tunnel |
| 101 | */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 102 | typedef struct |
| 103 | { |
Dave Barach | eb987d3 | 2018-05-03 08:26:39 -0400 | [diff] [blame] | 104 | /* Required for pool_get_aligned */ |
| 105 | CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); |
| 106 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 107 | /** Rewrite string. $$$$ embed vnet_rewrite header */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 108 | u8 *rewrite; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 109 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 110 | /** encapsulated protocol */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 111 | u8 protocol; |
| 112 | |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 113 | /* FIB DPO for IP forwarding of VXLAN-GPE encap packet */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 114 | dpo_id_t next_dpo; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 115 | /** tunnel local address */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 116 | ip46_address_t local; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 117 | /** tunnel remote address */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 118 | ip46_address_t remote; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 119 | |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 120 | /* mcast packet output intfc index (used only if dst is mcast) */ |
| 121 | u32 mcast_sw_if_index; |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 122 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 123 | /** FIB indices - tunnel partner lookup here */ |
| 124 | u32 encap_fib_index; |
| 125 | /** FIB indices - inner IP packet lookup here */ |
| 126 | u32 decap_fib_index; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 127 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 128 | /** VXLAN GPE VNI in HOST byte order, shifted left 8 bits */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 129 | u32 vni; |
| 130 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 131 | /** vnet intfc hw_if_index */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 132 | u32 hw_if_index; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 133 | /** vnet intfc sw_if_index */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 134 | u32 sw_if_index; |
| 135 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 136 | /** flags */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 137 | u32 flags; |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 138 | |
| 139 | /** rewrite size for dynamic plugins like iOAM */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 140 | u8 rewrite_size; |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 141 | |
| 142 | /** Next node after VxLAN-GPE encap */ |
| 143 | uword encap_next_node; |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 144 | |
| 145 | /** |
| 146 | * Linkage into the FIB object graph |
| 147 | */ |
| 148 | fib_node_t node; |
| 149 | |
| 150 | /* |
| 151 | * The FIB entry for (depending on VXLAN-GPE tunnel is unicast or mcast) |
| 152 | * sending unicast VXLAN-GPE encap packets or receiving mcast VXLAN-GPE packets |
| 153 | */ |
| 154 | fib_node_index_t fib_entry_index; |
| 155 | adj_index_t mcast_adj_index; |
| 156 | |
| 157 | /** |
| 158 | * The tunnel is a child of the FIB entry for its desintion. This is |
| 159 | * so it receives updates when the forwarding information for that entry |
| 160 | * changes. |
| 161 | * The tunnels sibling index on the FIB entry's dependency list. |
| 162 | */ |
| 163 | u32 sibling_index; |
| 164 | |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 165 | } vxlan_gpe_tunnel_t; |
| 166 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 167 | /** Flags for vxlan_gpe_tunnel_t */ |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 168 | #define VXLAN_GPE_TUNNEL_IS_IPV4 1 |
| 169 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 170 | /** next nodes for VXLAN GPE input */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 171 | #define foreach_vxlan_gpe_input_next \ |
| 172 | _(DROP, "error-drop") \ |
| 173 | _(IP4_INPUT, "ip4-input") \ |
| 174 | _(IP6_INPUT, "ip6-input") \ |
Gabriel Ganne | 7e665d6 | 2017-11-17 09:18:53 +0100 | [diff] [blame] | 175 | _(L2_INPUT, "l2-input") |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 176 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 177 | /** struct for next nodes for VXLAN GPE input */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 178 | typedef enum |
| 179 | { |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 180 | #define _(s,n) VXLAN_GPE_INPUT_NEXT_##s, |
| 181 | foreach_vxlan_gpe_input_next |
| 182 | #undef _ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 183 | VXLAN_GPE_INPUT_N_NEXT, |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 184 | } vxlan_gpe_input_next_t; |
| 185 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 186 | /** struct for VXLAN GPE errors */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 187 | typedef enum |
| 188 | { |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 189 | #define vxlan_gpe_error(n,s) VXLAN_GPE_ERROR_##n, |
| 190 | #include <vnet/vxlan-gpe/vxlan_gpe_error.def> |
| 191 | #undef vxlan_gpe_error |
| 192 | VXLAN_GPE_N_ERROR, |
| 193 | } vxlan_gpe_input_error_t; |
| 194 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 195 | /** Struct for VXLAN GPE node state */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 196 | typedef struct |
| 197 | { |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 198 | /** vector of encap tunnel instances */ |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 199 | vxlan_gpe_tunnel_t *tunnels; |
| 200 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 201 | /** lookup IPv4 VXLAN GPE tunnel by key */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 202 | uword *vxlan4_gpe_tunnel_by_key; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 203 | /** lookup IPv6 VXLAN GPE tunnel by key */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 204 | uword *vxlan6_gpe_tunnel_by_key; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 205 | |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 206 | /* local VTEP IPs ref count used by vxlan-bypass node to check if |
| 207 | received VXLAN packet DIP matches any local VTEP address */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 208 | uword *vtep4; /* local ip4 VTEPs keyed on their ip4 addr */ |
| 209 | uword *vtep6; /* local ip6 VTEPs keyed on their ip6 addr */ |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 210 | /* mcast shared info */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 211 | uword *mcast_shared; /* keyed on mcast ip46 addr */ |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 212 | /** Free vlib hw_if_indices */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 213 | u32 *free_vxlan_gpe_tunnel_hw_if_indices; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 214 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 215 | /** Mapping from sw_if_index to tunnel index */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 216 | u32 *tunnel_index_by_sw_if_index; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 217 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 218 | /** State convenience vlib_main_t */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 219 | vlib_main_t *vlib_main; |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 220 | /** State convenience vnet_main_t */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 221 | vnet_main_t *vnet_main; |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 222 | |
| 223 | /** List of next nodes for the decap indexed on protocol */ |
| 224 | uword decap_next_node_list[VXLAN_GPE_PROTOCOL_MAX]; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 225 | } vxlan_gpe_main_t; |
| 226 | |
Dave Wallace | 71612d6 | 2017-10-24 01:32:41 -0400 | [diff] [blame] | 227 | extern vxlan_gpe_main_t vxlan_gpe_main; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 228 | |
| 229 | extern vlib_node_registration_t vxlan_gpe_encap_node; |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 230 | extern vlib_node_registration_t vxlan4_gpe_input_node; |
| 231 | extern vlib_node_registration_t vxlan6_gpe_input_node; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 232 | |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 233 | u8 *format_vxlan_gpe_encap_trace (u8 * s, va_list * args); |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 234 | |
Keith Burns (alagalah) | d46cca1 | 2016-08-25 11:21:39 -0700 | [diff] [blame] | 235 | /** Struct for VXLAN GPE add/del args */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 236 | typedef struct |
| 237 | { |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 238 | u8 is_add; |
Hongjun Ni | df921cc | 2016-05-25 01:16:19 +0800 | [diff] [blame] | 239 | u8 is_ip6; |
| 240 | ip46_address_t local, remote; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 241 | u8 protocol; |
Hongjun Ni | 8a0a0ae | 2017-05-27 20:23:09 +0800 | [diff] [blame] | 242 | u32 mcast_sw_if_index; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 243 | u32 encap_fib_index; |
| 244 | u32 decap_fib_index; |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 245 | u32 vni; |
| 246 | } vnet_vxlan_gpe_add_del_tunnel_args_t; |
| 247 | |
| 248 | |
Hongjun Ni | 7deb139 | 2016-06-15 22:49:23 +0800 | [diff] [blame] | 249 | int vnet_vxlan_gpe_add_del_tunnel |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 250 | (vnet_vxlan_gpe_add_del_tunnel_args_t * a, u32 * sw_if_indexp); |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 251 | |
| 252 | |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 253 | int vxlan4_gpe_rewrite (vxlan_gpe_tunnel_t * t, u32 extension_size, |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 254 | u8 protocol_override, uword encap_next_node); |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 255 | int vxlan6_gpe_rewrite (vxlan_gpe_tunnel_t * t, u32 extension_size, |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 256 | u8 protocol_override, uword encap_next_node); |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 257 | |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 258 | /** |
| 259 | * @brief Struct for defining VXLAN GPE next nodes |
| 260 | */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 261 | typedef enum |
| 262 | { |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 263 | VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP, |
| 264 | VXLAN_GPE_ENCAP_NEXT_IP6_LOOKUP, |
| 265 | VXLAN_GPE_ENCAP_NEXT_DROP, |
| 266 | VXLAN_GPE_ENCAP_N_NEXT |
| 267 | } vxlan_gpe_encap_next_t; |
| 268 | |
| 269 | |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 270 | void vxlan_gpe_unregister_decap_protocol (u8 protocol_id, |
| 271 | uword next_node_index); |
Vengada Govindan | 6d403a0 | 2016-10-12 05:54:09 -0700 | [diff] [blame] | 272 | |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 273 | void vxlan_gpe_register_decap_protocol (u8 protocol_id, |
| 274 | uword next_node_index); |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 275 | |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 276 | void vnet_int_vxlan_gpe_bypass_mode (u32 sw_if_index, u8 is_ip6, |
| 277 | u8 is_enable); |
Keith Burns (alagalah) | 94b1442 | 2016-05-05 18:16:50 -0700 | [diff] [blame] | 278 | |
| 279 | #endif /* included_vnet_vxlan_gpe_h */ |
sharath reddy | 6f8273a | 2017-12-11 11:31:31 +0530 | [diff] [blame] | 280 | |
| 281 | /* |
| 282 | * fd.io coding-style-patch-verification: ON |
| 283 | * |
| 284 | * Local Variables: |
| 285 | * eval: (c-set-style "gnu") |
| 286 | * End: |
| 287 | */ |