X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fbuffer.h;h=8647db005f458e997954d5fb07a734187e4ca58c;hb=072401e8096c648b91f958bd911f64ce24fecff9;hp=f1cc637179a713bedfc2055339a86e4e67430cb6;hpb=ff542707733102b2573dca2496ea427b3dba3b10;p=vpp.git diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h index f1cc637179a..8647db005f4 100644 --- a/src/vnet/buffer.h +++ b/src/vnet/buffer.h @@ -71,9 +71,7 @@ #define VNET_BUFFER_SPAN_CLONE (1 << LOG2_VNET_BUFFER_SPAN_CLONE) #define foreach_buffer_opaque_union_subtype \ -_(ethernet) \ _(ip) \ -_(mcast) \ _(swt) \ _(l2) \ _(l2t) \ @@ -84,7 +82,8 @@ _(policer) \ _(ipsec) \ _(map) \ _(map_t) \ -_(ip_frag) +_(ip_frag) \ +_(tcp) /* * vnet stack buffer opaque array overlay structure. @@ -100,16 +99,12 @@ _(ip_frag) typedef struct { u32 sw_if_index[VLIB_N_RX_TX]; + i16 l2_hdr_offset; + i16 l3_hdr_offset; + i16 l4_hdr_offset; union { - /* Ethernet. */ - struct - { - /* Saved value of current header by ethernet-input. */ - i32 start_of_ethernet_header; - } ethernet; - /* IP4/6 buffer opaque. */ struct { @@ -131,6 +126,9 @@ typedef struct /* Rewrite length */ u32 save_rewrite_length; + + /* MFIB RPF ID */ + u32 rpf_id; }; /* ICMP */ @@ -140,9 +138,6 @@ typedef struct u8 code; u32 data; } icmp; - - /* IP header offset from vlib_buffer.data - saved by ip*_local nodes */ - i32 start_of_ip_header; }; } ip; @@ -159,15 +154,6 @@ typedef struct u8 first; } mpls; - /* Multicast replication */ - struct - { - u32 pad[3]; - u32 mcast_group_index; - u32 mcast_current_index; - u32 original_free_list_index; - } mcast; - /* ip4-in-ip6 softwire termination, only valid there */ struct { @@ -176,12 +162,13 @@ typedef struct } swt; /* l2 bridging path, only valid there */ - struct + struct opaque_l2 { u32 feature_bitmap; - u16 bd_index; // bridge-domain index - u8 l2_len; // ethernet header length - u8 shg; // split-horizon group + u16 bd_index; /* bridge-domain index */ + u8 l2_len; /* ethernet header length */ + u8 shg; /* split-horizon group */ + u16 l2fib_sn; /* l2fib bd/int seq_num */ } l2; /* l2tpv3 softwire encap, only valid there */ @@ -200,9 +187,12 @@ typedef struct /* L2 classify */ struct { - u64 pad; - u32 table_index; - u32 opaque_index; + struct opaque_l2 pad; + union + { + u32 table_index; + u32 opaque_index; + }; u64 hash; } l2_classify; @@ -277,6 +267,19 @@ typedef struct u16 buffer_advance; } device_input_feat; + /* TCP */ + struct + { + u32 connection_index; + u32 seq_number; + u32 seq_end; + u32 ack_number; + u16 hdr_offset; /**< offset relative to ip hdr */ + u16 data_offset; /**< offset relative to ip hdr */ + u16 data_len; /**< data len */ + u8 flags; + } tcp; + u32 unused[6]; }; } vnet_buffer_opaque_t; @@ -285,8 +288,8 @@ typedef struct * The opaque field of the vlib_buffer_t is intepreted as a * vnet_buffer_opaque_t. Hence it should be big enough to accommodate one. */ -STATIC_ASSERT (sizeof (vnet_buffer_opaque_t) <= STRUCT_SIZE_OF (vlib_buffer_t, - opaque), +STATIC_ASSERT (sizeof (vnet_buffer_opaque_t) <= + STRUCT_SIZE_OF (vlib_buffer_t, opaque), "VNET buffer meta-data too large for vlib_buffer"); #define vnet_buffer(b) ((vnet_buffer_opaque_t *) (b)->opaque)