1*76404edcSAsim Jamshed #ifndef __TCP_UTIL_H_ 2*76404edcSAsim Jamshed #define __TCP_UTIL_H_ 3*76404edcSAsim Jamshed 4*76404edcSAsim Jamshed #include "mtcp.h" 5*76404edcSAsim Jamshed #include "tcp_stream.h" 6*76404edcSAsim Jamshed 7*76404edcSAsim Jamshed struct tcp_timestamp 8*76404edcSAsim Jamshed { 9*76404edcSAsim Jamshed uint32_t ts_val; 10*76404edcSAsim Jamshed uint32_t ts_ref; 11*76404edcSAsim Jamshed }; 12*76404edcSAsim Jamshed 13*76404edcSAsim Jamshed void ParseTCPOptions(tcp_stream *cur_stream, 14*76404edcSAsim Jamshed uint32_t cur_ts, uint8_t *tcpopt, int len); 15*76404edcSAsim Jamshed 16*76404edcSAsim Jamshed extern inline int 17*76404edcSAsim Jamshed ParseTCPTimestamp(tcp_stream *cur_stream, 18*76404edcSAsim Jamshed struct tcp_timestamp *ts, uint8_t *tcpopt, int len); 19*76404edcSAsim Jamshed 20*76404edcSAsim Jamshed #if TCP_OPT_SACK_ENABLED 21*76404edcSAsim Jamshed void 22*76404edcSAsim Jamshed ParseSACKOption(tcp_stream *cur_stream, 23*76404edcSAsim Jamshed uint32_t ack_seq, uint8_t *tcpopt, int len); 24*76404edcSAsim Jamshed #endif 25*76404edcSAsim Jamshed 26*76404edcSAsim Jamshed uint16_t 27*76404edcSAsim Jamshed TCPCalcChecksum(uint16_t *buf, uint16_t len, uint32_t saddr, uint32_t daddr); 28*76404edcSAsim Jamshed 29*76404edcSAsim Jamshed void 30*76404edcSAsim Jamshed PrintTCPOptions(uint8_t *tcpopt, int len); 31*76404edcSAsim Jamshed 32*76404edcSAsim Jamshed #endif /* __TCP_UTIL_H_ */ 33