* - <code>vnet_buffer(b)->sw_if_index[VLIB_TX]</code>
* - Reset output sw_if_index.
*
- * <em>Nexd Index:</em>
+ * <em>Next Index:</em>
* - Dispatches the packet to the esp-encrypt node.
*/
static uword
vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
ipsec_gre_tunnel_t *t = pool_elt_at_index (igm->tunnels, rd->dev_instance);
+ /* use an ethertype of 0x01 for l2-gre */
+ u16 l2_gre_protocol_ethertype = clib_net_to_host_u16 (0x01);
+
/* Vector of buffer / pkt indices we're supposed to process */
from = vlib_frame_vector_args (frame);
ip4_and_gre_union_t *h0, *h1;
u32 bi0, next0, bi1, next1;
__attribute__ ((unused)) u8 error0, error1;
- u16 gre_protocol0, gre_protocol1;
/* Prefetch the next iteration */
{
b0 = vlib_get_buffer (vm, bi0);
b1 = vlib_get_buffer (vm, bi1);
- ip0 = vlib_buffer_get_current (b0);
- gre_protocol0 = clib_net_to_host_u16 (0x01);
-
- ip1 = vlib_buffer_get_current (b1);
- gre_protocol1 = clib_net_to_host_u16 (0x01);
-
vlib_buffer_advance (b0, -sizeof (*h0));
vlib_buffer_advance (b1, -sizeof (*h1));
h1->as_u64[2] = 0;
ip0 = &h0->ip4_and_gre.ip4;
- h0->ip4_and_gre.gre.protocol = gre_protocol0;
+ h0->ip4_and_gre.gre.protocol = l2_gre_protocol_ethertype;
ip0->ip_version_and_header_length = 0x45;
ip0->ttl = 254;
ip0->protocol = IP_PROTOCOL_GRE;
ip1 = &h1->ip4_and_gre.ip4;
- h1->ip4_and_gre.gre.protocol = gre_protocol1;
+ h1->ip4_and_gre.gre.protocol = l2_gre_protocol_ethertype;
ip1->ip_version_and_header_length = 0x45;
ip1->ttl = 254;
ip1->protocol = IP_PROTOCOL_GRE;
ip4_and_gre_union_t *h0;
u32 bi0, next0;
__attribute__ ((unused)) u8 error0;
- u16 gre_protocol0;
bi0 = to_next[0] = from[0];
from += 1;
b0 = vlib_get_buffer (vm, bi0);
- gre_protocol0 = clib_net_to_host_u16 (0x01);
-
vlib_buffer_advance (b0, -sizeof (*h0));
h0 = vlib_buffer_get_current (b0);
h0->as_u64[2] = 0;
ip0 = &h0->ip4_and_gre.ip4;
- h0->ip4_and_gre.gre.protocol = gre_protocol0;
+ h0->ip4_and_gre.gre.protocol = l2_gre_protocol_ethertype;
ip0->ip_version_and_header_length = 0x45;
ip0->ttl = 254;
ip0->protocol = IP_PROTOCOL_GRE;
ipsec_gre_main_t *igm = &ipsec_gre_main;
clib_error_t *error;
- memset (igm, 0, sizeof (igm[0]));
+ clib_memset (igm, 0, sizeof (igm[0]));
igm->vlib_main = vm;
igm->vnet_main = vnet_get_main ();
VLIB_INIT_FUNCTION (ipsec_gre_init);
-ipsec_gre_main_t *
-ipsec_gre_get_main (vlib_main_t * vm)
-{
- vlib_call_init_function (vm, ipsec_gre_init);
- return &ipsec_gre_main;
-}
-
/*
* fd.io coding-style-patch-verification: ON
*