FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
gre.h
Go to the documentation of this file.
1 /*
2  * gre.h: types/functions for gre.
3  *
4  * Copyright (c) 2012 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef included_gre_h
19 #define included_gre_h
20 
21 #include <vnet/vnet.h>
22 #include <vnet/gre/packet.h>
23 #include <vnet/ip/ip.h>
24 #include <vnet/ip/format.h>
25 #include <vnet/adj/adj_types.h>
26 #include <vnet/tunnel/tunnel.h>
27 #include <vnet/teib/teib.h>
28 
31 
32 typedef enum
33 {
34 #define gre_error(n,s) GRE_ERROR_##n,
35 #include <vnet/gre/error.def>
36 #undef gre_error
38 } gre_error_t;
39 
40 /**
41  * L3: GRE (i.e. this tunnel is in L3 mode)
42  * TEB: Transparent Ethernet Bridging - the tunnel is in L2 mode
43  * ERSPAN: type 2 - the tunnel is for port mirror SPAN output. Each tunnel is
44  * associated with a session ID and expected to be used for encap
45  * and output of mirrored packet from a L2 network only. There is
46  * no support for receiving ERSPAN packets from a GRE ERSPAN tunnel
47  */
48 #define foreach_gre_tunnel_type \
49  _(L3, "L3") \
50  _(TEB, "TEB") \
51  _(ERSPAN, "ERSPAN") \
52 
53 /**
54  * @brief The GRE tunnel type
55  */
56 typedef enum gre_tunnel_type_t_
57 {
58 #define _(n, s) GRE_TUNNEL_TYPE_##n,
60 #undef _
61 } __clib_packed gre_tunnel_type_t;
62 
63 extern u8 *format_gre_tunnel_type (u8 * s, va_list * args);
64 
65 
66 /**
67  * A GRE payload protocol registration
68  */
69 typedef struct
70 {
71  /** Name (a c string). */
72  char *name;
73 
74  /** GRE protocol type in host byte order. */
76 
77  /** GRE tunnel type */
79 
80  /** Node which handles this type. */
82 
83  /** Next index for this type. */
86 
87 /**
88  * Elements of the GRE key that are common for v6 and v6 addresses
89  */
91 {
92  union
93  {
94  struct
95  {
100  };
102  };
104 
106 
107 /**
108  * @brief Key for a IPv4 GRE Tunnel
109  */
110 typedef struct gre_tunnel_key4_t_
111 {
112  /**
113  * Source and destination IP addresses
114  */
115  union
116  {
117  struct
118  {
121  };
123  };
124 
125  /** address independent attributes */
127 } __attribute__ ((packed)) gre_tunnel_key4_t;
128 
130 
131 /**
132  * @brief Key for a IPv6 GRE Tunnel
133  * We use a different type so that the V4 key hash is as small as possible
134  */
135 typedef struct gre_tunnel_key6_t_
136 {
137  /**
138  * Source and destination IP addresses
139  */
140  ip6_address_t gtk_src;
141  ip6_address_t gtk_dst;
142 
143  /** address independent attributes */
145 } __attribute__ ((packed)) gre_tunnel_key6_t;
146 
148 
149 /**
150  * Union of the two possible key types
151  */
152 typedef union gre_tunnel_key_t_
153 {
157 
158 /**
159  * The session ID is only a 10 bit value
160  */
161 #define GTK_SESSION_ID_MAX (0x3ff)
162 
163 /**
164  * Used for GRE header seq number generation for ERSPAN encap
165  */
166 typedef struct
167 {
170 } gre_sn_t;
171 
172 /**
173  * Hash key for GRE header seq number generation for ERSPAN encap
174  */
175 typedef struct
176 {
177  ip46_address_t src;
178  ip46_address_t dst;
180 } gre_sn_key_t;
181 
182 /**
183  * @brief A representation of a GRE tunnel
184  */
185 typedef struct
186 {
187  /**
188  * Required for pool_get_aligned
189  */
190  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
191 
192  /**
193  * The tunnel's source/local address
194  */
195  ip46_address_t tunnel_src;
196  /**
197  * The tunnel's destination/remote address
198  */
200  /**
201  * The FIB in which the src.dst address are present
202  */
209 
210  /**
211  * an L2 tunnel always rquires an L2 midchain. cache here for DP.
212  */
214 
215  /**
216  * ERSPAN type 2 session ID, least significant 10 bits of u16
217  */
219 
220  /**
221  * GRE header sequence number (SN) used for ERSPAN type 2 header, must be
222  * bumped automically to be thread safe. As multiple GRE tunnels are created
223  * for the same fib-idx/DIP/SIP with different ERSPAN session number, they all
224  * share the same SN which is kept per FIB/DIP/SIP, as specified by RFC2890.
225  */
227 
228 
229  u32 dev_instance; /* Real device instance in tunnel vector */
230  u32 user_instance; /* Instance name being shown to user */
231 } gre_tunnel_t;
232 
233 typedef struct
234 {
237 } next_info_t;
238 
239 /**
240  * @brief GRE related global data
241  */
242 typedef struct
243 {
244  /**
245  * pool of tunnel instances
246  */
248 
249  /**
250  * GRE payload protocol registrations
251  */
253 
254  /**
255  * Hash tables mapping name/protocol to protocol info index.
256  */
257  uword *protocol_info_by_name, *protocol_info_by_protocol;
258 
259  /**
260  * Hash mapping to tunnels with ipv4 src/dst addr
261  */
263 
264  /**
265  * Hash mapping to tunnels with ipv6 src/dst addr
266  */
268 
269  /**
270  * Hash mapping tunnel src/dst addr and fib-idx to sequence number
271  */
273 
274  /**
275  * Mapping from sw_if_index to tunnel index
276  */
278 
279  /* Sparse vector mapping gre protocol in network byte order
280  to next index. */
282 
283  /* convenience */
286 
287  /* Record used instances */
289 
291 } gre_main_t;
292 
293 /**
294  * @brief IPv4 and GRE header.
295  */
296 /* *INDENT-OFF* */
297 typedef CLIB_PACKED (struct {
299  gre_header_t gre;
300 }) ip4_and_gre_header_t;
301 /* *INDENT-ON* */
302 
303 /**
304  * @brief IPv6 and GRE header.
305  */
306 /* *INDENT-OFF* */
307 typedef CLIB_PACKED (struct {
309  gre_header_t gre;
310 }) ip6_and_gre_header_t;
311 /* *INDENT-ON* */
312 
315 {
317  return p ? vec_elt_at_index (em->protocol_infos, p[0]) : 0;
318 }
319 
320 extern gre_main_t gre_main;
321 
323  u32 hw_if_index, u32 flags);
324 
325 extern void gre_tunnel_stack (adj_index_t ai);
326 extern void gre_update_adj (vnet_main_t * vnm,
328 
329 typedef struct mgre_walk_ctx_t_
330 {
331  const gre_tunnel_t *t;
332  const teib_entry_t *ne;
334 
337 
341 
347 
348 /* Parse gre protocol as 0xXXXX or protocol name.
349  In either host or network byte order. */
352 
353 /* Parse gre header. */
356 
357 void
359  u32 node_index, gre_tunnel_type_t tunnel_type);
360 
361 /* manually added to the interface output node in gre.c */
362 #define GRE_OUTPUT_NEXT_LOOKUP 1
363 
364 typedef struct
365 {
371  ip46_address_t src, dst;
376 
378  u32 * sw_if_indexp);
379 
380 static inline void
383  u32 fib_index,
384  gre_tunnel_type_t ttype,
386 {
387  key->gtk_src = src;
388  key->gtk_dst = dst;
389  key->gtk_common.type = ttype;
390  key->gtk_common.mode = tmode;
391  key->gtk_common.fib_index = fib_index;
392  key->gtk_common.session_id = session_id;
393 }
394 
395 static inline int
397  const gre_tunnel_key4_t * key2)
398 {
399  return ((key1->gtk_as_u64 == key2->gtk_as_u64) &&
400  (key1->gtk_common.as_u64 == key2->gtk_common.as_u64));
401 }
402 
403 static inline void
404 gre_mk_key6 (const ip6_address_t * src,
405  const ip6_address_t * dst,
406  u32 fib_index,
407  gre_tunnel_type_t ttype,
409 {
410  key->gtk_src = *src;
411  key->gtk_dst = *dst;
412  key->gtk_common.type = ttype;
413  key->gtk_common.mode = tmode;
414  key->gtk_common.fib_index = fib_index;
415  key->gtk_common.session_id = session_id;
416 }
417 
418 static inline int
420  const gre_tunnel_key6_t * key2)
421 {
422  return (ip6_address_is_equal (&key1->gtk_src, &key2->gtk_src) &&
423  ip6_address_is_equal (&key1->gtk_dst, &key2->gtk_dst) &&
424  (key1->gtk_common.as_u64 == key2->gtk_common.as_u64));
425 }
426 
427 static inline void
429 {
430  key->src = gt->tunnel_src;
431  key->dst = gt->tunnel_dst.fp_addr;
432  key->fib_index = gt->outer_fib_index;
433 }
434 
435 #endif /* included_gre_h */
436 
437 /*
438  * fd.io coding-style-patch-verification: ON
439  *
440  * Local Variables:
441  * eval: (c-set-style "gnu")
442  * End:
443  */
gre_tunnel_t::type
gre_tunnel_type_t type
Definition: gre.h:206
ip6_address_is_equal
static uword ip6_address_is_equal(const ip6_address_t *a, const ip6_address_t *b)
Definition: ip6_packet.h:167
adj_types.h
gre_tunnel_t::sw_if_index
u32 sw_if_index
Definition: gre.h:205
gre_tunnel_key_common_t
struct gre_tunnel_key_common_t_ gre_tunnel_key_common_t
Elements of the GRE key that are common for v6 and v6 addresses.
gre_sn_t
Used for GRE header seq number generation for ERSPAN encap.
Definition: gre.h:166
gre_tunnel_key6_t_
Key for a IPv6 GRE Tunnel We use a different type so that the V4 key hash is as small as possible.
Definition: gre.h:135
gre_protocol_info_t::name
char * name
Name (a c string).
Definition: gre.h:72
gre_sn_key_t::dst
ip46_address_t dst
Definition: gre.h:178
tunnel_encap_decap_flags_t
enum tunnel_encap_decap_flags_t_ tunnel_encap_decap_flags_t
CLIB_PACKED
typedef CLIB_PACKED(struct { ip4_header_t ip4;gre_header_t gre;}) ip4_and_gre_header_t
IPv4 and GRE header.
vnet_device_class_t
struct _vnet_device_class vnet_device_class_t
gre_tunnel_key4_t_::gtk_dst
ip4_address_t gtk_dst
Definition: gre.h:120
gre_mk_sn_key
static void gre_mk_sn_key(const gre_tunnel_t *gt, gre_sn_key_t *key)
Definition: gre.h:428
ip4
vl_api_ip4_address_t ip4
Definition: one.api:376
gre_main_t
GRE related global data.
Definition: gre.h:242
next_info_t::tunnel_type
u8 tunnel_type
Definition: gre.h:236
gre_sn_t::seq_num
u32 seq_num
Definition: gre.h:168
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
gre_register_input_protocol
void gre_register_input_protocol(vlib_main_t *vm, gre_protocol_t protocol, u32 node_index, gre_tunnel_type_t tunnel_type)
Definition: node.c:499
gre_main_t::tunnel_by_key6
uword * tunnel_by_key6
Hash mapping to tunnels with ipv6 src/dst addr.
Definition: gre.h:267
vnet_gre_tunnel_add_del_args_t::outer_table_id
u32 outer_table_id
Definition: gre.h:372
tunnel.h
vnet_gre_tunnel_add_del_args_t::instance
u32 instance
Definition: gre.h:370
adj_walk_rc_t
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
gre_tunnel_key_common_t_::type
gre_tunnel_type_t type
Definition: gre.h:98
next_info_t::next_index
u8 next_index
Definition: gre.h:235
gre_mk_key6
static void gre_mk_key6(const ip6_address_t *src, const ip6_address_t *dst, u32 fib_index, gre_tunnel_type_t ttype, tunnel_mode_t tmode, u16 session_id, gre_tunnel_key6_t *key)
Definition: gre.h:404
gre_main_t::protocol_info_by_protocol
uword * protocol_info_by_protocol
Definition: gre.h:257
gre_tunnel_key_common_t_::session_id
u16 session_id
Definition: gre.h:97
gre_protocol_info_t
A GRE payload protocol registration.
Definition: gre.h:69
u16
unsigned short u16
Definition: types.h:57
gre_protocol_info_t::protocol
gre_protocol_t protocol
GRE protocol type in host byte order.
Definition: gre.h:75
gre_tunnel_t::flags
tunnel_encap_decap_flags_t flags
Definition: gre.h:208
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
gre_tunnel_t::hw_if_index
u32 hw_if_index
Definition: gre.h:204
node_index
node node_index
Definition: interface_output.c:420
gre_match_key6
static int gre_match_key6(const gre_tunnel_key6_t *key1, const gre_tunnel_key6_t *key2)
Definition: gre.h:419
gre_tunnel_type_t_
gre_tunnel_type_t_
The GRE tunnel type.
Definition: gre.h:56
gre_tunnel_key_common_t_::mode
tunnel_mode_t mode
Definition: gre.h:99
unformat_pg_gre_header
unformat_function_t unformat_pg_gre_header
Definition: gre.h:355
error.def
GRE_N_ERROR
@ GRE_N_ERROR
Definition: gre.h:37
ip4_header_t
Definition: ip4_packet.h:87
unformat_gre_header
unformat_function_t unformat_gre_header
Definition: gre.h:354
vnet_gre_tunnel_add_del_args_t::src
ip46_address_t src
Definition: gre.h:371
key
typedef key
Definition: ipsec_types.api:88
foreach_gre_tunnel_type
#define foreach_gre_tunnel_type
L3: GRE (i.e.
Definition: gre.h:48
gre_interface_admin_up_down
clib_error_t * gre_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Definition: interface.c:605
gre_match_key4
static int gre_match_key4(const gre_tunnel_key4_t *key1, const gre_tunnel_key4_t *key2)
Definition: gre.h:396
gre_tunnel_t::tunnel_dst
fib_prefix_t tunnel_dst
The tunnel's destination/remote address.
Definition: gre.h:199
teib.h
mgre_walk_ctx_t
struct mgre_walk_ctx_t_ mgre_walk_ctx_t
gre_main_t::tunnel_index_by_sw_if_index
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
Definition: gre.h:277
gre_tunnel_key_common_t_::as_u64
u64 as_u64
Definition: gre.h:101
gre_sn_key_t::fib_index
u32 fib_index
Definition: gre.h:179
teib_entry_t_
Definition: teib.c:33
vnet_gre_tunnel_add_del_args_t
Definition: gre.h:364
gre_tunnel_t::l2_adj_index
adj_index_t l2_adj_index
an L2 tunnel always rquires an L2 midchain.
Definition: gre.h:213
unformat_gre_protocol_host_byte_order
unformat_function_t unformat_gre_protocol_host_byte_order
Definition: gre.h:350
gre_tunnel_key4_t_::gtk_as_u64
u64 gtk_as_u64
Definition: gre.h:122
gre_main_t::vlib_main
vlib_main_t * vlib_main
Definition: gre.h:284
gre_tunnel_type_t
enum gre_tunnel_type_t_ gre_tunnel_type_t
The GRE tunnel type.
gre_tunnel_key6_t_::gtk_src
ip6_address_t gtk_src
Source and destination IP addresses.
Definition: gre.h:140
unformat_gre_protocol_net_byte_order
unformat_function_t unformat_gre_protocol_net_byte_order
Definition: gre.h:351
gre_protocol_info_t::tunnel_type
gre_tunnel_type_t tunnel_type
GRE tunnel type.
Definition: gre.h:78
vec_elt_at_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Definition: vec_bootstrap.h:203
format.h
mgre_walk_ctx_t_
Definition: gre.h:329
vnet_gre_tunnel_add_del_args_t::session_id
u16 session_id
Definition: gre.h:373
next_info_t
Definition: gre.h:233
gre_error_t
gre_error_t
Definition: gre.h:32
packet.h
gre_protocol_t
gre_protocol_t
Definition: packet.h:30
uword
u64 uword
Definition: types.h:112
hash_get
#define hash_get(h, key)
Definition: hash.h:249
gre_tunnel_t
A representation of a GRE tunnel.
Definition: gre.h:185
gre_tunnel_t::session_id
u16 session_id
ERSPAN type 2 session ID, least significant 10 bits of u16.
Definition: gre.h:218
gre_protocol_info_t::node_index
u32 node_index
Node which handles this type.
Definition: gre.h:81
gre_teb_encap_node
vlib_node_registration_t gre_teb_encap_node
(constructor) VLIB_REGISTER_NODE (gre_teb_encap_node)
Definition: gre.c:695
session_id
u32 session_id
Definition: flow_types.api:131
STATIC_ASSERT_SIZEOF
STATIC_ASSERT_SIZEOF(gre_tunnel_key_common_t, sizeof(u64))
gre_erspan_encap_node
vlib_node_registration_t gre_erspan_encap_node
(constructor) VLIB_REGISTER_NODE (gre_erspan_encap_node)
Definition: gre.c:708
gre_tunnel_key_common_t_::fib_index
u32 fib_index
Definition: gre.h:96
vnet_gre_tunnel_add_del_args_t::type
gre_tunnel_type_t type
Definition: gre.h:367
src
vl_api_address_t src
Definition: gre.api:54
gre_tunnel_key_t_::gtk_v6
gre_tunnel_key6_t gtk_v6
Definition: gre.h:155
gre_tunnel_t::mode
tunnel_mode_t mode
Definition: gre.h:207
ip4_address_t
Definition: ip4_packet.h:50
gre_tunnel_t::tunnel_src
ip46_address_t tunnel_src
The tunnel's source/local address.
Definition: gre.h:195
gre_tunnel_stack
void gre_tunnel_stack(adj_index_t ai)
gre_tunnel_stack
Definition: interface.c:130
vnet_gre_tunnel_add_del_args_t::mode
tunnel_mode_t mode
Definition: gre.h:368
gre_tunnel_t::dev_instance
u32 dev_instance
Definition: gre.h:229
gre_tunnel_key4_t_
Key for a IPv4 GRE Tunnel.
Definition: gre.h:110
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
fib_prefix_t_::fp_addr
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:225
gre_tunnel_key6_t_::gtk_dst
ip6_address_t gtk_dst
Definition: gre.h:141
gre_tunnel_key4_t_::gtk_common
gre_tunnel_key_common_t gtk_common
address independent attributes
Definition: gre.h:126
gre_main
gre_main_t gre_main
Definition: gre.c:26
data
u8 data[128]
Definition: ipsec_types.api:92
gre_main_t::protocol_infos
gre_protocol_info_t * protocol_infos
GRE payload protocol registrations.
Definition: gre.h:252
gre_protocol_info_t::next_index
u32 next_index
Next index for this type.
Definition: gre.h:84
format_function_t
u8 *() format_function_t(u8 *s, va_list *args)
Definition: format.h:48
vnet_gre_tunnel_add_del_args_t::is_add
u8 is_add
Definition: gre.h:366
vnet_main_t
Definition: vnet.h:76
vnet_gre_tunnel_add_del_args_t::flags
tunnel_encap_decap_flags_t flags
Definition: gre.h:374
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
gre_main_t::next_by_protocol
next_info_t * next_by_protocol
Definition: gre.h:281
gre_hw_interface_class
vnet_hw_interface_class_t gre_hw_interface_class
gre_tunnel_key_t_::gtk_v4
gre_tunnel_key4_t gtk_v4
Definition: gre.h:154
vnet_gre_tunnel_add_del
int vnet_gre_tunnel_add_del(vnet_gre_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
Definition: interface.c:580
u64
unsigned long u64
Definition: types.h:89
gre_main_t::seq_num_by_key
uword * seq_num_by_key
Hash mapping tunnel src/dst addr and fib-idx to sequence number.
Definition: gre.h:272
ip.h
u32
unsigned int u32
Definition: types.h:88
ip6
vl_api_ip6_address_t ip6
Definition: one.api:424
protocol
vl_api_ip_proto_t protocol
Definition: lb_types.api:72
dst
vl_api_ip4_address_t dst
Definition: pnat.api:41
gre_main_t::instance_used
uword * instance_used
Definition: gre.h:288
mgre_walk_ctx_t_::t
const gre_tunnel_t * t
Definition: gre.h:331
gre_main_t::vnet_main
vnet_main_t * vnet_main
Definition: gre.h:285
format_gre_protocol
format_function_t format_gre_protocol
Definition: gre.h:338
unformat_function_t
uword() unformat_function_t(unformat_input_t *input, va_list *args)
Definition: format.h:225
vnet_gre_tunnel_add_del_args_t::is_ipv6
u8 is_ipv6
Definition: gre.h:369
gre6_input_node
vlib_node_registration_t gre6_input_node
(constructor) VLIB_REGISTER_NODE (gre6_input_node)
Definition: node.c:474
ip6_header_t
Definition: ip6_packet.h:294
gre_mk_key4
static void gre_mk_key4(ip4_address_t src, ip4_address_t dst, u32 fib_index, gre_tunnel_type_t ttype, tunnel_mode_t tmode, u16 session_id, gre_tunnel_key4_t *key)
Definition: gre.h:381
gre_tunnel_key6_t
struct gre_tunnel_key6_t_ gre_tunnel_key6_t
Key for a IPv6 GRE Tunnel We use a different type so that the V4 key hash is as small as possible.
mgre_mk_incomplete_walk
adj_walk_rc_t mgre_mk_incomplete_walk(adj_index_t ai, void *data)
Definition: gre.c:468
gre_tunnel_key_t_
Union of the two possible key types.
Definition: gre.h:152
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
gre_get_protocol_info
static gre_protocol_info_t * gre_get_protocol_info(gre_main_t *em, gre_protocol_t protocol)
Definition: gre.h:314
gre_main_t::tunnels
gre_tunnel_t * tunnels
pool of tunnel instances
Definition: gre.h:247
tunnel_mode_t
enum tunnel_mode_t_ tunnel_mode_t
gre_sn_t::ref_count
u32 ref_count
Definition: gre.h:169
format_gre_header
format_function_t format_gre_header
Definition: gre.h:339
vlib_main_t
Definition: main.h:102
gre_header_t
Definition: packet.h:37
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
a
a
Definition: bitmap.h:544
gre_tunnel_t::gre_sn
gre_sn_t * gre_sn
GRE header sequence number (SN) used for ERSPAN type 2 header, must be bumped automically to be threa...
Definition: gre.h:226
format_gre_tunnel_type
u8 * format_gre_tunnel_type(u8 *s, va_list *args)
Definition: interface.c:29
mgre_mk_complete_walk
adj_walk_rc_t mgre_mk_complete_walk(adj_index_t ai, void *data)
Definition: gre.c:437
gre_tunnel_key_common_t_
Elements of the GRE key that are common for v6 and v6 addresses.
Definition: gre.h:90
gre4_input_node
vlib_node_registration_t gre4_input_node
(constructor) VLIB_REGISTER_NODE (gre4_input_node)
Definition: node.c:454
vnet.h
gre_sn_key_t
Hash key for GRE header seq number generation for ERSPAN encap.
Definition: gre.h:175
gre_tunnel_t::outer_fib_index
u32 outer_fib_index
The FIB in which the src.dst address are present.
Definition: gre.h:203
gre_main_t::tunnel_by_key4
uword * tunnel_by_key4
Hash mapping to tunnels with ipv4 src/dst addr.
Definition: gre.h:262
gre_tunnel_key4_t_::gtk_src
ip4_address_t gtk_src
Definition: gre.h:119
gre_tunnel_key_t
union gre_tunnel_key_t_ gre_tunnel_key_t
Union of the two possible key types.
gre_main_t::msg_id_base
u16 msg_id_base
Definition: gre.h:290
gre_update_adj
void gre_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
Definition: gre.c:404
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
gre_tunnel_t::user_instance
u32 user_instance
Definition: gre.h:230
gre_tunnel_key6_t_::gtk_common
gre_tunnel_key_common_t gtk_common
address independent attributes
Definition: gre.h:144
mgre_hw_interface_class
vnet_hw_interface_class_t mgre_hw_interface_class
vnet_hw_interface_class_t
struct _vnet_hw_interface_class vnet_hw_interface_class_t
fib_prefix_t_
Aggregate type for a prefix.
Definition: fib_types.h:202
gre_sn_key_t::src
ip46_address_t src
Definition: gre.h:177
mgre_walk_ctx_t_::ne
const teib_entry_t * ne
Definition: gre.h:332
gre_tunnel_key4_t
struct gre_tunnel_key4_t_ gre_tunnel_key4_t
Key for a IPv4 GRE Tunnel.
gre_device_class
vnet_device_class_t gre_device_class
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105
format_gre_header_with_length
format_function_t format_gre_header_with_length
Definition: gre.h:340