Break up vpe.api
[vpp.git] / src / vnet / buffer.h
index e774a08..6518fb6 100644 (file)
@@ -88,6 +88,8 @@ _(ipsec)                                      \
 _(map)                                         \
 _(map_t)                                       \
 _(ip_frag)                                     \
+_(mpls)                                                \
+_(bier)                                        \
 _(tcp)
 
 /*
@@ -126,8 +128,14 @@ typedef struct
             protocol and ports. */
          u32 flow_hash;
 
-         /* next protocol */
-         u32 save_protocol;
+         union
+         {
+           /* next protocol */
+           u32 save_protocol;
+
+           /* Hint for transport protocols */
+           u32 fib_index;
+         };
 
          /* Rewrite length */
          u32 save_rewrite_length;
@@ -159,6 +167,16 @@ typedef struct
       u8 first;
     } mpls;
 
+    /*
+     * BIER - the nubmer of bytes in the header.
+     *  the len field inthe header is not authoritative. It's the
+     * value in the table that counts.
+     */
+    struct
+    {
+      u8 n_bytes;
+    } bier;
+
     /* ip4-in-ip6 softwire termination, only valid there */
     struct
     {
@@ -311,9 +329,26 @@ typedef struct
 {
   union
   {
+#if VLIB_BUFFER_TRACE_TRAJECTORY > 0
+    /* buffer trajectory tracing */
+    struct
+    {
+      u16 *trajectory_trace;
+    };
+#endif
+    u32 unused[12];
   };
 } vnet_buffer_opaque2_t;
 
+#define vnet_buffer2(b) ((vnet_buffer_opaque2_t *) (b)->opaque2)
+
+/*
+ * The opaque2 field of the vlib_buffer_t is intepreted as a
+ * vnet_buffer_opaque2_t. Hence it should be big enough to accommodate one.
+ */
+STATIC_ASSERT (sizeof (vnet_buffer_opaque2_t) <=
+              STRUCT_SIZE_OF (vlib_buffer_t, opaque2),
+              "VNET buffer opaque2 meta-data too large for vlib_buffer");
 
 
 #endif /* included_vnet_buffer_h */