#include <vnet/vnet.h>
#include <vnet/plugin/plugin.h>
#include <nsh/nsh.h>
-#include <vnet/gre/gre.h>
-#include <vnet/vxlan/vxlan.h>
+#include <vnet/gre/packet.h>
#include <vnet/vxlan-gpe/vxlan_gpe.h>
#include <vnet/l2/l2_classify.h>
extern u8 * format_nsh_header (u8 * s, va_list * args);
extern u8 * format_nsh_node_map_trace (u8 * s, va_list * args);
-
-/* format from network order */
-u8 * format_nsh_pop_header (u8 * s, va_list * args)
-{
- return format_nsh_header(s, args);
-}
-
-
-
-u8 * format_nsh_pop_node_map_trace (u8 * s, va_list * args)
-{
- return format_nsh_node_map_trace(s, args);
-}
-
+extern u8 * format_nsh_pop_header (u8 * s, va_list * args);
+extern u8 * format_nsh_pop_node_map_trace (u8 * s, va_list * args);
static uword
nsh_pop_inline (vlib_main_t * vm,
/* Entry should point to a mapping ...*/
map0 = pool_elt_at_index(nm->nsh_mappings, entry0[0]);
- if (PREDICT_FALSE(map0 == 0))
- {
- error0 = NSH_NODE_ERROR_NO_MAPPING;
- goto trace0;
- }
/* set up things for next node to transmit ie which node to handle it and where */
next0 = map0->next_node;
if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
{
nsh_input_trace_t *tr = vlib_add_trace(vm, node, b0, sizeof(*tr));
- clib_memcpy ( &(tr->trace_data), hdr0, (hdr0->length*4) );
+ clib_memcpy_fast ( &(tr->trace_data), hdr0, (hdr0->length*4) );
}
/* Process packet 1 */
/* Entry should point to a mapping ...*/
map1 = pool_elt_at_index(nm->nsh_mappings, entry1[0]);
- if (PREDICT_FALSE(map1 == 0))
- {
- error1 = NSH_NODE_ERROR_NO_MAPPING;
- goto trace1;
- }
/* set up things for next node to transmit ie which node to handle it and where */
next1 = map1->next_node;
if (PREDICT_FALSE(b1->flags & VLIB_BUFFER_IS_TRACED))
{
nsh_input_trace_t *tr = vlib_add_trace(vm, node, b1, sizeof(*tr));
- clib_memcpy ( &(tr->trace_data), hdr1, (hdr1->length*4) );
+ clib_memcpy_fast ( &(tr->trace_data), hdr1, (hdr1->length*4) );
}
vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next,
/* Entry should point to a mapping ...*/
map0 = pool_elt_at_index(nm->nsh_mappings, entry0[0]);
- if (PREDICT_FALSE(map0 == 0))
- {
- error0 = NSH_NODE_ERROR_NO_MAPPING;
- goto trace00;
- }
/* set up things for next node to transmit ie which node to handle it and where */
next0 = map0->next_node;
if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
{
nsh_input_trace_t *tr = vlib_add_trace(vm, node, b0, sizeof(*tr));
- clib_memcpy ( &(tr->trace_data[0]), hdr0, (hdr0->length*4) );
+ clib_memcpy_fast ( &(tr->trace_data[0]), hdr0, (hdr0->length*4) );
}
vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next,
* @return from_frame->n_vectors
*
*/
-static uword
-nsh_pop (vlib_main_t * vm, vlib_node_runtime_t * node,
+VLIB_NODE_FN (nsh_pop_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
{
return nsh_pop_inline (vm, node, from_frame);
/* register nsh-input node */
VLIB_REGISTER_NODE (nsh_pop_node) = {
- .function = nsh_pop,
.name = "nsh-pop",
.vector_size = sizeof (u32),
.format_trace = format_nsh_pop_node_map_trace,
},
};
-VLIB_NODE_FUNCTION_MULTIARCH (nsh_pop_node, nsh_pop);
-
-