Check for missing deps on bootstrap target for Centos and Fedora.
[vpp.git] / src / vnet / adj / adj_midchain.c
index 8c6ab5a..55b5e44 100644 (file)
@@ -16,6 +16,7 @@
 #include <vnet/adj/adj_nbr.h>
 #include <vnet/adj/adj_internal.h>
 #include <vnet/adj/adj_l2.h>
+#include <vnet/adj/adj_nsh.h>
 #include <vnet/adj/adj_midchain.h>
 #include <vnet/ethernet/arp_packet.h>
 #include <vnet/dpo/drop_dpo.h>
@@ -308,6 +309,18 @@ VNET_FEATURE_INIT (adj_midchain_tx_no_count_ethernet, static) = {
     .runs_before = VNET_FEATURES ("error-drop"),
     .feature_index_ptr = &adj_midchain_tx_no_count_feature_node[VNET_LINK_ETHERNET],
 };
+VNET_FEATURE_INIT (adj_midchain_tx_nsh, static) = {
+    .arc_name = "nsh-output",
+    .node_name = "adj-midchain-tx",
+    .runs_before = VNET_FEATURES ("error-drop"),
+    .feature_index_ptr = &adj_midchain_tx_feature_node[VNET_LINK_NSH],
+};
+VNET_FEATURE_INIT (adj_midchain_tx_no_count_nsh, static) = {
+    .arc_name = "nsh-output",
+    .node_name = "adj-midchain-tx-no-count",
+    .runs_before = VNET_FEATURES ("error-drop"),
+    .feature_index_ptr = &adj_midchain_tx_no_count_feature_node[VNET_LINK_NSH],
+};
 
 static inline u32
 adj_get_midchain_node (vnet_link_t link)
@@ -321,6 +334,8 @@ adj_get_midchain_node (vnet_link_t link)
        return (mpls_midchain_node.index);
     case VNET_LINK_ETHERNET:
        return (adj_l2_midchain_node.index);
+    case VNET_LINK_NSH:
+        return (adj_nsh_midchain_node.index);
     case VNET_LINK_ARP:
        break;
     }
@@ -354,6 +369,11 @@ adj_midchain_get_feature_arc_index_for_link_type (const ip_adjacency_t *adj)
            arc = ethernet_main.output_feature_arc_index;
            break;
        }
+    case VNET_LINK_NSH:
+        {
+          arc = nsh_main_dummy.output_feature_arc_index;
+          break;
+        }
     case VNET_LINK_ARP:
        ASSERT(0);
        break;
@@ -481,7 +501,6 @@ format_adj_midchain (u8* s, va_list *ap)
 {
     index_t index = va_arg(*ap, index_t);
     u32 indent = va_arg(*ap, u32);
-    vnet_main_t * vnm = vnet_get_main();
     ip_adjacency_t * adj = adj_get(index);
 
     s = format (s, "%U", format_vnet_link, adj->ia_link);
@@ -489,8 +508,7 @@ format_adj_midchain (u8* s, va_list *ap)
                format_ip46_address, &adj->sub_type.nbr.next_hop);
     s = format (s, " %U",
                format_vnet_rewrite,
-               vnm->vlib_main, &adj->rewrite_header,
-               sizeof (adj->rewrite_data), indent);
+               &adj->rewrite_header, sizeof (adj->rewrite_data), indent);
     s = format (s, "\n%Ustacked-on:\n%U%U",
                format_white_space, indent,
                format_white_space, indent+2,
@@ -543,6 +561,11 @@ const static char* const midchain_ethernet_nodes[] =
     "adj-l2-midchain",
     NULL,
 };
+const static char* const midchain_nsh_nodes[] =
+{
+    "adj-nsh-midchain",
+    NULL,
+};
 
 const static char* const * const midchain_nodes[DPO_PROTO_NUM] =
 {
@@ -550,6 +573,7 @@ const static char* const * const midchain_nodes[DPO_PROTO_NUM] =
     [DPO_PROTO_IP6]  = midchain_ip6_nodes,
     [DPO_PROTO_MPLS] = midchain_mpls_nodes,
     [DPO_PROTO_ETHERNET] = midchain_ethernet_nodes,
+    [DPO_PROTO_NSH] = midchain_nsh_nodes,
 };
 
 void