tcp: custom checksum calculations for Ipv4/Ipv6
[vpp.git] / src / vnet / tcp / tcp.h
index a1b7d4c..1bf3281 100644 (file)
@@ -120,6 +120,7 @@ extern timer_expiration_handler tcp_timer_retransmit_syn_handler;
   _(RATE_SAMPLE, "Conn does rate sampling")    \
   _(TRACK_BURST, "Track burst")                        \
   _(ZERO_RWND_SENT, "Zero RWND sent")          \
+  _(NO_CSUM_OFFLOAD, "No Checksum Offload")     \
 
 typedef enum _tcp_connection_flag_bits
 {
@@ -1233,6 +1234,8 @@ vlib_buffer_push_tcp_net_order (vlib_buffer_t * b, u16 sp, u16 dp, u32 seq,
   th->window = wnd;
   th->checksum = 0;
   th->urgent_pointer = 0;
+  vnet_buffer (b)->l4_hdr_offset = (u8 *) th - b->data;
+  b->flags |= VNET_BUFFER_F_L4_HDR_OFFSET_VALID;
   return th;
 }