api: missing support for dumping of neighbours (VPP-333)
[vpp.git] / vnet / vnet / ethernet / init.c
index 7590abd..2d20adc 100644 (file)
@@ -61,34 +61,23 @@ add_type (ethernet_main_t * em, ethernet_type_t type, char *type_name)
   hash_set_mem (em->type_info_by_name, ti->name, i);
 }
 
-static char *feature_start_nodes[] = {
-  "adj-midchain-tx-no-count",
-};
-
 /* Built-in ip4 tx feature path definition */
 /* *INDENT-OFF* */
-VNET_ETHERNET_TX_FEATURE_INIT (ethernet_tx_drop, static) =
+VNET_FEATURE_ARC_INIT (ethernet_output, static) =
+{
+  .arc_name  = "ethernet-output",
+  .start_nodes = VNET_FEATURES ("adj-l2-midchain"),
+  .arc_index_ptr = &ethernet_main.output_feature_arc_index,
+};
+
+VNET_FEATURE_INIT (ethernet_tx_drop, static) =
 {
+  .arc_name = "ethernet-output",
   .node_name = "error-drop",
   .runs_before = 0,    /* not before any other features */
-  .feature_index = &ethernet_main.ethernet_tx_feature_drop,
 };
 /* *INDENT-ON* */
 
-static clib_error_t *
-ethernet_feature_init (vlib_main_t * vm)
-{
-  ip_config_main_t *cm = &ethernet_main.feature_config_mains[VNET_IP_TX_FEAT];
-  vnet_config_main_t *vcm = &cm->config_main;
-
-  return (vnet_feature_arc_init (vm, vcm,
-                                feature_start_nodes,
-                                ARRAY_LEN (feature_start_nodes),
-                                ethernet_main.next_feature[VNET_IP_TX_FEAT],
-                                &ethernet_main.feature_nodes
-                                [VNET_IP_TX_FEAT]));
-}
-
 static clib_error_t *
 ethernet_init (vlib_main_t * vm)
 {
@@ -115,8 +104,10 @@ ethernet_init (vlib_main_t * vm)
     return error;
   if ((error = vlib_call_init_function (vm, ethernet_input_init)))
     return error;
+  if ((error = vlib_call_init_function (vm, vnet_feature_init)))
+    return error;
 
-  return (ethernet_feature_init (vm));
+  return 0;
 }
 
 VLIB_INIT_FUNCTION (ethernet_init);