Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016 Cisco and/or its affiliates. |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 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 | */ |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 15 | /** |
| 16 | * @file |
| 17 | * @brief LISP-GPE definitions. |
| 18 | */ |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 19 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 20 | #ifndef included_vnet_lisp_gpe_h |
| 21 | #define included_vnet_lisp_gpe_h |
| 22 | |
| 23 | #include <vppinfra/error.h> |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 24 | #include <vppinfra/mhash.h> |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 25 | #include <vnet/vnet.h> |
| 26 | #include <vnet/ip/ip.h> |
| 27 | #include <vnet/l2/l2_input.h> |
| 28 | #include <vnet/ethernet/ethernet.h> |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 29 | #include <vnet/ip/ip4_packet.h> |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 30 | #include <vnet/udp/udp.h> |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 31 | #include <vnet/lisp-cp/lisp_types.h> |
| 32 | #include <vnet/lisp-gpe/lisp_gpe_packet.h> |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 33 | #include <vnet/adj/adj_types.h> |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 34 | #include <vppinfra/bihash_24_8.h> |
| 35 | #include <vppinfra/bihash_template.h> |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 36 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 37 | /** IP4-UDP-LISP encap header */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 38 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 39 | typedef CLIB_PACKED (struct { |
| 40 | ip4_header_t ip4; /* 20 bytes */ |
| 41 | udp_header_t udp; /* 8 bytes */ |
| 42 | lisp_gpe_header_t lisp; /* 8 bytes */ |
| 43 | }) ip4_udp_lisp_gpe_header_t; |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 44 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 45 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 46 | /** IP6-UDP-LISP encap header */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 47 | /* *INDENT-OFF* */ |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 48 | typedef CLIB_PACKED (struct { |
| 49 | ip6_header_t ip6; /* 40 bytes */ |
| 50 | udp_header_t udp; /* 8 bytes */ |
| 51 | lisp_gpe_header_t lisp; /* 8 bytes */ |
| 52 | }) ip6_udp_lisp_gpe_header_t; |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 53 | /* *INDENT-ON* */ |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 54 | |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 55 | #define foreach_lisp_gpe_ip_input_next \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 56 | _(DROP, "error-drop") \ |
| 57 | _(IP4_INPUT, "ip4-input") \ |
| 58 | _(IP6_INPUT, "ip6-input") \ |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 59 | _(L2_INPUT, "l2-input") |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 60 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 61 | /** Enum of possible next nodes post LISP-GPE decap */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 62 | typedef enum |
| 63 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 64 | #define _(s,n) LISP_GPE_INPUT_NEXT_##s, |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 65 | foreach_lisp_gpe_ip_input_next |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 66 | #undef _ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 67 | LISP_GPE_INPUT_N_NEXT, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 68 | } lisp_gpe_input_next_t; |
| 69 | |
Florin Coras | 263440e | 2017-02-22 23:38:08 -0800 | [diff] [blame] | 70 | /* Arc to nsh-input added only if nsh-input exists */ |
| 71 | #define LISP_GPE_INPUT_NEXT_NSH_INPUT 4 |
| 72 | |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 73 | typedef enum |
| 74 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 75 | #define lisp_gpe_error(n,s) LISP_GPE_ERROR_##n, |
| 76 | #include <vnet/lisp-gpe/lisp_gpe_error.def> |
| 77 | #undef lisp_gpe_error |
| 78 | LISP_GPE_N_ERROR, |
Florin Coras | 577c355 | 2016-04-21 00:45:40 +0200 | [diff] [blame] | 79 | } lisp_gpe_error_t; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 80 | |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 81 | typedef struct tunnel_lookup |
| 82 | { |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 83 | /** Lookup lisp-gpe interfaces by dp table (eg. vrf/bridge index) */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 84 | uword *hw_if_index_by_dp_table; |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 85 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 86 | /** lookup decap tunnel termination sw_if_index by vni and vice versa */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 87 | uword *sw_if_index_by_vni; |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 88 | |
| 89 | // FIXME - Need this? |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 90 | uword *vni_by_sw_if_index; |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 91 | } tunnel_lookup_t; |
| 92 | |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 93 | typedef struct |
| 94 | { |
| 95 | u32 fwd_entry_index; |
| 96 | u32 tunnel_index; |
| 97 | } lisp_stats_key_t; |
| 98 | |
| 99 | typedef struct |
| 100 | { |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 101 | u32 vni; |
| 102 | dp_address_t deid; |
| 103 | dp_address_t seid; |
| 104 | ip_address_t loc_rloc; |
| 105 | ip_address_t rmt_rloc; |
| 106 | |
Filip Tehlar | 2151191 | 2017-04-07 10:41:42 +0200 | [diff] [blame] | 107 | vlib_counter_t counters; |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 108 | } lisp_api_stats_t; |
Filip Tehlar | 3e7b5693 | 2017-02-21 18:28:34 +0100 | [diff] [blame] | 109 | |
| 110 | typedef enum gpe_encap_mode_e |
| 111 | { |
| 112 | GPE_ENCAP_LISP, |
| 113 | GPE_ENCAP_VXLAN, |
| 114 | GPE_ENCAP_COUNT |
| 115 | } gpe_encap_mode_t; |
| 116 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 117 | /** LISP-GPE global state*/ |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 118 | typedef struct lisp_gpe_main |
| 119 | { |
Neale Ranns | 5e575b1 | 2016-10-03 09:40:25 +0100 | [diff] [blame] | 120 | /** |
| 121 | * @brief DB of all forwarding entries. The Key is:{l-EID,r-EID,vni} |
| 122 | * where the EID encodes L2 or L3 |
| 123 | */ |
| 124 | uword *lisp_gpe_fwd_entries; |
| 125 | |
| 126 | /** |
| 127 | * @brief A Pool of all LISP forwarding entries |
| 128 | */ |
| 129 | struct lisp_gpe_fwd_entry_t_ *lisp_fwd_entry_pool; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 130 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 131 | /** Free vlib hw_if_indices */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 132 | u32 *free_tunnel_hw_if_indices; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 133 | |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 134 | u8 is_en; |
| 135 | |
| 136 | /* L3 data structures |
| 137 | * ================== */ |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 138 | tunnel_lookup_t l3_ifaces; |
Florin Coras | 577c355 | 2016-04-21 00:45:40 +0200 | [diff] [blame] | 139 | |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 140 | /* L2 data structures |
| 141 | * ================== */ |
| 142 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 143 | /** L2 LISP FIB */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 144 | BVT (clib_bihash) l2_fib; |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 145 | |
| 146 | tunnel_lookup_t l2_ifaces; |
| 147 | |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 148 | /** Load-balance for a miss in the table */ |
Neale Ranns | 5e575b1 | 2016-10-03 09:40:25 +0100 | [diff] [blame] | 149 | dpo_id_t l2_lb_cp_lkup; |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 150 | |
Florin Coras | ce1b4c7 | 2017-01-26 14:25:34 -0800 | [diff] [blame] | 151 | /* NSH data structures |
| 152 | * ================== */ |
| 153 | |
| 154 | BVT (clib_bihash) nsh_fib; |
| 155 | |
| 156 | tunnel_lookup_t nsh_ifaces; |
| 157 | |
| 158 | const dpo_id_t *nsh_cp_lkup; |
| 159 | |
Filip Tehlar | 3e7b5693 | 2017-02-21 18:28:34 +0100 | [diff] [blame] | 160 | gpe_encap_mode_t encap_mode; |
| 161 | |
Filip Tehlar | 2151191 | 2017-04-07 10:41:42 +0200 | [diff] [blame] | 162 | u8 *dummy_stats_pool; |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 163 | uword *lisp_stats_index_by_key; |
Filip Tehlar | 2151191 | 2017-04-07 10:41:42 +0200 | [diff] [blame] | 164 | vlib_combined_counter_main_t counters; |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 165 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 166 | /** convenience */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 167 | vlib_main_t *vlib_main; |
| 168 | vnet_main_t *vnet_main; |
| 169 | ip4_main_t *im4; |
| 170 | ip6_main_t *im6; |
| 171 | ip_lookup_main_t *lm4; |
| 172 | ip_lookup_main_t *lm6; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 173 | } lisp_gpe_main_t; |
| 174 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 175 | /** LISP-GPE global state*/ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 176 | lisp_gpe_main_t lisp_gpe_main; |
| 177 | |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 178 | always_inline lisp_gpe_main_t * |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 179 | vnet_lisp_gpe_get_main () |
| 180 | { |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 181 | return &lisp_gpe_main; |
| 182 | } |
| 183 | |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 184 | |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 185 | extern vlib_node_registration_t lisp_gpe_ip4_input_node; |
| 186 | extern vlib_node_registration_t lisp_gpe_ip6_input_node; |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 187 | extern vnet_hw_interface_class_t lisp_gpe_hw_class; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 188 | |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 189 | u8 *format_lisp_gpe_header_with_length (u8 * s, va_list * args); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 190 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 191 | /** Read LISP-GPE status */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 192 | u8 vnet_lisp_gpe_enable_disable_status (void); |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 193 | |
Neale Ranns | 5e575b1 | 2016-10-03 09:40:25 +0100 | [diff] [blame] | 194 | u32 |
| 195 | lisp_gpe_l3_iface_find_or_create (lisp_gpe_main_t * lgm, |
| 196 | u32 overlay_table_id, u32 vni); |
| 197 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 198 | /** Add/del LISP-GPE interface. */ |
Neale Ranns | 5e575b1 | 2016-10-03 09:40:25 +0100 | [diff] [blame] | 199 | extern void lisp_gpe_del_l2_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id); |
| 200 | extern u32 lisp_gpe_add_l2_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id); |
| 201 | extern void lisp_gpe_del_l3_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id); |
| 202 | extern u32 lisp_gpe_add_l3_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id); |
| 203 | |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 204 | |
Florin Coras | 577c355 | 2016-04-21 00:45:40 +0200 | [diff] [blame] | 205 | typedef struct |
| 206 | { |
| 207 | u8 is_en; |
| 208 | } vnet_lisp_gpe_enable_disable_args_t; |
| 209 | |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 210 | clib_error_t |
| 211 | * vnet_lisp_gpe_enable_disable (vnet_lisp_gpe_enable_disable_args_t * a); |
Florin Coras | 577c355 | 2016-04-21 00:45:40 +0200 | [diff] [blame] | 212 | |
Neale Ranns | 5e575b1 | 2016-10-03 09:40:25 +0100 | [diff] [blame] | 213 | typedef enum |
| 214 | { |
| 215 | NO_ACTION, |
| 216 | FORWARD_NATIVE, |
| 217 | SEND_MAP_REQUEST, |
| 218 | DROP |
| 219 | } negative_fwd_actions_e; |
| 220 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 221 | /** */ |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 222 | typedef struct |
| 223 | { |
Filip Tehlar | ed6b52b | 2017-03-22 09:02:33 +0100 | [diff] [blame] | 224 | u8 is_src_dst; |
| 225 | |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 226 | u8 is_add; |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 227 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 228 | /** type of mapping */ |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 229 | u8 is_negative; |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 230 | |
| 231 | /** action for negative mappings */ |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 232 | negative_fwd_actions_e action; |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 233 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 234 | /** local eid */ |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 235 | gid_address_t lcl_eid; |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 236 | |
| 237 | /** remote eid */ |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 238 | gid_address_t rmt_eid; |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 239 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 240 | /** vector of locator pairs */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 241 | locator_pair_t *locator_pairs; |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 242 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 243 | /** FIB index to lookup remote locator at encap */ |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 244 | u32 encap_fib_index; |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 245 | |
| 246 | /** FIB index to lookup inner IP at decap */ |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 247 | u32 decap_fib_index; |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 248 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 249 | /* TODO remove */ |
| 250 | u32 decap_next_index; |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 251 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 252 | /** VNI/tenant id in HOST byte order */ |
Florin Coras | ed09a05 | 2016-05-06 14:22:40 +0200 | [diff] [blame] | 253 | u32 vni; |
| 254 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 255 | /** vrf or bd where fwd entry should be inserted */ |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 256 | union |
| 257 | { |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 258 | /** table (vrf) id */ |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 259 | u32 table_id; |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 260 | |
| 261 | /** bridge domain id */ |
Florin Coras | c14f31c | 2017-04-06 15:27:35 -0700 | [diff] [blame] | 262 | u32 bd_id; |
Florin Coras | 429e795 | 2016-08-02 02:31:03 +0200 | [diff] [blame] | 263 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 264 | /** generic access */ |
Florin Coras | 429e795 | 2016-08-02 02:31:03 +0200 | [diff] [blame] | 265 | u32 dp_table; |
Florin Coras | 1a1adc7 | 2016-07-22 01:45:30 +0200 | [diff] [blame] | 266 | }; |
Florin Coras | e127a7e | 2016-02-18 22:20:01 +0100 | [diff] [blame] | 267 | } vnet_lisp_gpe_add_del_fwd_entry_args_t; |
| 268 | |
Filip Tehlar | 5fae99c | 2017-01-18 12:57:37 +0100 | [diff] [blame] | 269 | typedef struct |
| 270 | { |
| 271 | u32 fwd_entry_index; |
| 272 | u32 dp_table; |
| 273 | u32 vni; |
Filip Tehlar | 0eb874e | 2017-05-18 14:23:32 +0200 | [diff] [blame^] | 274 | u8 action; |
Filip Tehlar | 5fae99c | 2017-01-18 12:57:37 +0100 | [diff] [blame] | 275 | dp_address_t leid; |
| 276 | dp_address_t reid; |
| 277 | } lisp_api_gpe_fwd_entry_t; |
| 278 | |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 279 | #define foreach_lgpe_ip4_lookup_next \ |
| 280 | _(DROP, "error-drop") \ |
| 281 | _(LISP_CP_LOOKUP, "lisp-cp-lookup") |
| 282 | |
| 283 | typedef enum lgpe_ip4_lookup_next |
| 284 | { |
| 285 | #define _(sym,str) LGPE_IP4_LOOKUP_NEXT_##sym, |
| 286 | foreach_lgpe_ip4_lookup_next |
| 287 | #undef _ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 288 | LGPE_IP4_LOOKUP_N_NEXT, |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 289 | } lgpe_ip4_lookup_next_t; |
| 290 | |
Florin Coras | ff0bf13 | 2016-09-05 19:30:35 +0200 | [diff] [blame] | 291 | #define foreach_lgpe_ip6_lookup_next \ |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 292 | _(DROP, "error-drop") \ |
| 293 | _(LISP_CP_LOOKUP, "lisp-cp-lookup") |
| 294 | |
| 295 | typedef enum lgpe_ip6_lookup_next |
| 296 | { |
| 297 | #define _(sym,str) LGPE_IP6_LOOKUP_NEXT_##sym, |
| 298 | foreach_lgpe_ip6_lookup_next |
| 299 | #undef _ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 300 | LGPE_IP6_LOOKUP_N_NEXT, |
Florin Coras | 02655bd | 2016-04-26 00:17:24 +0200 | [diff] [blame] | 301 | } lgpe_ip6_lookup_next_t; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 302 | |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 303 | u8 *format_vnet_lisp_gpe_status (u8 * s, va_list * args); |
Filip Tehlar | 46d4e36 | 2016-05-09 09:39:26 +0200 | [diff] [blame] | 304 | |
Filip Tehlar | 5fae99c | 2017-01-18 12:57:37 +0100 | [diff] [blame] | 305 | lisp_api_gpe_fwd_entry_t *vnet_lisp_gpe_fwd_entries_get_by_vni (u32 vni); |
Filip Tehlar | 3e7b5693 | 2017-02-21 18:28:34 +0100 | [diff] [blame] | 306 | gpe_encap_mode_t vnet_gpe_get_encap_mode (void); |
| 307 | int vnet_gpe_set_encap_mode (gpe_encap_mode_t mode); |
Filip Tehlar | 5fae99c | 2017-01-18 12:57:37 +0100 | [diff] [blame] | 308 | |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 309 | u8 vnet_lisp_stats_enable_disable_state (void); |
| 310 | vnet_api_error_t vnet_lisp_stats_enable_disable (u8 enable); |
| 311 | lisp_api_stats_t *vnet_lisp_get_stats (void); |
Filip Tehlar | 2151191 | 2017-04-07 10:41:42 +0200 | [diff] [blame] | 312 | int vnet_lisp_flush_stats (void); |
Filip Tehlar | 4868ff6 | 2017-03-09 16:48:39 +0100 | [diff] [blame] | 313 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 314 | #endif /* included_vnet_lisp_gpe_h */ |
Florin Coras | 220beac | 2016-08-16 23:04:00 +0200 | [diff] [blame] | 315 | |
| 316 | /* |
| 317 | * fd.io coding-style-patch-verification: ON |
| 318 | * |
| 319 | * Local Variables: |
| 320 | * eval: (c-set-style "gnu") |
| 321 | * End: |
| 322 | */ |