xref: /dpdk/lib/net/rte_tcp.h (revision fba9875559906e04eaeb74532f4cfd51194259a2)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 1982, 1986, 1990, 1993
3  *      The Regents of the University of California.
4  * Copyright(c) 2010-2014 Intel Corporation.
5  * All rights reserved.
6  */
7 
8 #ifndef _RTE_TCP_H_
9 #define _RTE_TCP_H_
10 
11 /**
12  * @file
13  *
14  * TCP-related defines
15  */
16 
17 #include <stdint.h>
18 
19 #include <rte_byteorder.h>
20 
21 /**
22  * TCP Header
23  */
24 struct __rte_packed_begin rte_tcp_hdr {
25 	rte_be16_t src_port; /**< TCP source port. */
26 	rte_be16_t dst_port; /**< TCP destination port. */
27 	rte_be32_t sent_seq; /**< TX data sequence number. */
28 	rte_be32_t recv_ack; /**< RX data acknowledgment sequence number. */
29 	uint8_t  data_off;   /**< Data offset. */
30 	uint8_t  tcp_flags;  /**< TCP flags */
31 	rte_be16_t rx_win;   /**< RX flow control window. */
32 	rte_be16_t cksum;    /**< TCP checksum. */
33 	rte_be16_t tcp_urp;  /**< TCP urgent pointer, if any. */
34 } __rte_packed_end;
35 
36 /**
37  * TCP Flags
38  */
39 #define RTE_TCP_CWR_FLAG 0x80 /**< Congestion Window Reduced */
40 #define RTE_TCP_ECE_FLAG 0x40 /**< ECN-Echo */
41 #define RTE_TCP_URG_FLAG 0x20 /**< Urgent Pointer field significant */
42 #define RTE_TCP_ACK_FLAG 0x10 /**< Acknowledgment field significant */
43 #define RTE_TCP_PSH_FLAG 0x08 /**< Push Function */
44 #define RTE_TCP_RST_FLAG 0x04 /**< Reset the connection */
45 #define RTE_TCP_SYN_FLAG 0x02 /**< Synchronize sequence numbers */
46 #define RTE_TCP_FIN_FLAG 0x01 /**< No more data from sender */
47 
48 #endif /* RTE_TCP_H_ */
49