return s;
}
-vlib_node_registration_t ip4_classify_node;
-vlib_node_registration_t ip6_classify_node;
-
#define foreach_ip_classify_error \
_(MISS, "Classify misses") \
_(HIT, "Classify hits") \
bi0 = from[0];
b0 = vlib_get_buffer (vm, bi0);
- h0 = (void *) vlib_buffer_get_current (b0) -
- ethernet_buffer_header_size (b0);
+ h0 = vlib_buffer_get_current (b0) - ethernet_buffer_header_size (b0);
bi1 = from[1];
b1 = vlib_get_buffer (vm, bi1);
- h1 = (void *) vlib_buffer_get_current (b1) -
- ethernet_buffer_header_size (b1);
+ h1 = vlib_buffer_get_current (b1) - ethernet_buffer_header_size (b1);
cd_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
cd0 = classify_dpo_get (cd_index0);
t1 = pool_elt_at_index (vcm->tables, table_index1);
- vnet_buffer (b0)->l2_classify.hash =
- vnet_classify_hash_packet (t0, (u8 *) h0);
+ vnet_buffer (b0)->l2_classify.hash = vnet_classify_hash_packet (t0, h0);
vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
- vnet_buffer (b1)->l2_classify.hash =
- vnet_classify_hash_packet (t1, (u8 *) h1);
+ vnet_buffer (b1)->l2_classify.hash = vnet_classify_hash_packet (t1, h1);
vnet_classify_prefetch_bucket (t1, vnet_buffer (b1)->l2_classify.hash);
bi0 = from[0];
b0 = vlib_get_buffer (vm, bi0);
- h0 = (void *) vlib_buffer_get_current (b0) -
- ethernet_buffer_header_size (b0);
+ h0 = vlib_buffer_get_current (b0) - ethernet_buffer_header_size (b0);
cd_index0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
cd0 = classify_dpo_get (cd_index0);
table_index0 = cd0->cd_table_index;
t0 = pool_elt_at_index (vcm->tables, table_index0);
- vnet_buffer (b0)->l2_classify.hash =
- vnet_classify_hash_packet (t0, (u8 *) h0);
+ vnet_buffer (b0)->l2_classify.hash = vnet_classify_hash_packet (t0, h0);
vnet_buffer (b0)->l2_classify.table_index = table_index0;
vnet_classify_prefetch_bucket (t0, vnet_buffer (b0)->l2_classify.hash);
hash0 = vnet_buffer (b0)->l2_classify.hash;
t0 = pool_elt_at_index (vcm->tables, table_index0);
- e0 = vnet_classify_find_entry (t0, (u8 *) h0, hash0, now);
+ e0 = vnet_classify_find_entry (t0, h0, hash0, now);
if (e0)
{
vnet_buffer (b0)->l2_classify.opaque_index
break;
}
- hash0 = vnet_classify_hash_packet (t0, (u8 *) h0);
- e0 = vnet_classify_find_entry
- (t0, (u8 *) h0, hash0, now);
+ hash0 = vnet_classify_hash_packet (t0, h0);
+ e0 = vnet_classify_find_entry (t0, h0, hash0, now);
if (e0)
{
vnet_buffer (b0)->l2_classify.opaque_index
return frame->n_vectors;
}
-static uword
-ip4_classify (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip4_classify_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return ip_classify_inline (vm, node, frame, 1 /* is_ip4 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ip4_classify_node) = {
- .function = ip4_classify,
.name = "ip4-classify",
.vector_size = sizeof (u32),
.sibling_of = "ip4-lookup",
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ip4_classify_node, ip4_classify)
- static uword
- ip6_classify (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_classify_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return ip_classify_inline (vm, node, frame, 0 /* is_ip4 */ );
}
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ip6_classify_node) = {
- .function = ip6_classify,
.name = "ip6-classify",
.vector_size = sizeof (u32),
.sibling_of = "ip6-lookup",
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_classify_node, ip6_classify)
- static clib_error_t *ip_classify_init (vlib_main_t * vm)
+#ifndef CLIB_MARCH_VARIANT
+static clib_error_t *
+ip_classify_init (vlib_main_t * vm)
{
return 0;
}
VLIB_INIT_FUNCTION (ip_classify_init);
+#endif /* CLIB_MARCH_VARIANT */
/*
* fd.io coding-style-patch-verification: ON