Fix Coverity Errors in FIB. This is mainly consolidating the vnet_link_t and fib_link...
[vpp.git] / vnet / vnet / ip / lookup.h
index a21e181..b73191c 100644 (file)
@@ -54,7 +54,7 @@
 #include <vnet/ip/ip6_packet.h>
 #include <vnet/fib/fib_node.h>
 #include <vnet/dpo/dpo.h>
-#include <vnet/ip/ip_feature_registration.h>
+#include <vnet/ip/feature_registration.h>
 
 /** @brief Common (IP4/IP6) next index stored in adjacency. */
 typedef enum {
@@ -173,8 +173,6 @@ typedef void (*adj_midchain_fixup_t)(vlib_main_t * vm,
 */
 typedef struct ip_adjacency_t_ {
   CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
-  /* Handle for this adjacency in adjacency heap. */
-  u32 heap_handle;
 
   /** Number of adjecencies in block.  Greater than 1 means multipath;
      otherwise equal to 1. */
@@ -198,56 +196,53 @@ typedef struct ip_adjacency_t_ {
   /*
    * link/ether-type
    */
-  u8 ia_link;
+  vnet_link_t ia_link;
   u8 ia_nh_proto;
 
   union {
-    union {
-       /**
-        * IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE
-        *
-        * neighbour adjacency sub-type;
-        */
-       struct {
-           ip46_address_t next_hop;
-       } nbr;
-       /**
-        * IP_LOOKUP_NEXT_MIDCHAIN
-        *
-        * A nbr adj that is also recursive. Think tunnels.
-        * A nbr adj can transition to be of type MDICHAIN
-        * so be sure to leave the two structs with the next_hop
-        * fields aligned.
-        */
-       struct {
-           /**
-            * The recursive next-hop
-            */
-           ip46_address_t next_hop;
-            /**
-             * The node index of the tunnel's post rewrite/TX function.
-             */
-            u32 tx_function_node;
-           /**
-            * The next DPO to use
-            */
-           dpo_id_t next_dpo;
-
-           /**
-            * A function to perform the post-rewrite fixup
-            */
-           adj_midchain_fixup_t fixup_func;
-       } midchain;
-       /**
-        * IP_LOOKUP_NEXT_GLEAN
-        *
-        * Glean the address to ARP for from the packet's destination
-        */
-       struct {
-           ip46_address_t receive_addr;
-       } glean;
-    } sub_type;
-  };
+    /**
+     * IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE
+     *
+     * neighbour adjacency sub-type;
+     */
+      struct {
+         ip46_address_t next_hop;
+      } nbr;
+      /**
+       * IP_LOOKUP_NEXT_MIDCHAIN
+       *
+       * A nbr adj that is also recursive. Think tunnels.
+       * A nbr adj can transition to be of type MDICHAIN
+       * so be sure to leave the two structs with the next_hop
+       * fields aligned.
+       */
+      struct {
+         /**
+          * The recursive next-hop
+          */
+         ip46_address_t next_hop;
+         /**
+          * The node index of the tunnel's post rewrite/TX function.
+          */
+         u32 tx_function_node;
+         /**
+          * The next DPO to use
+          */
+         dpo_id_t next_dpo;
+         /**
+          * A function to perform the post-rewrite fixup
+          */
+         adj_midchain_fixup_t fixup_func;
+      } midchain;
+      /**
+       * IP_LOOKUP_NEXT_GLEAN
+       *
+       * Glean the address to ARP for from the packet's destination
+       */
+      struct {
+         ip46_address_t receive_addr;
+      } glean;
+  } sub_type;
 
   CLIB_CACHE_LINE_ALIGN_MARK(cacheline1);
 
@@ -335,11 +330,6 @@ typedef enum {
 
 struct ip_lookup_main_t;
 
-typedef void (* ip_add_del_adjacency_callback_t) (struct ip_lookup_main_t * lm,
-                                                 u32 adj_index,
-                                                 ip_adjacency_t * adj,
-                                                 u32 is_del);
-
 typedef struct ip_lookup_main_t {
   /* Adjacency heap. */
   ip_adjacency_t * adjacency_heap;
@@ -399,8 +389,6 @@ ip_get_adjacency (ip_lookup_main_t * lm,
 
   adj = vec_elt_at_index (lm->adjacency_heap, adj_index);
 
-  ASSERT (adj->heap_handle != ~0);
-
   return adj;
 }