xref: /csrg-svn/sys/netinet/tcp.h (revision 9992)
1*9992Ssam /* tcp.h 1.23 82/12/28 */
24573Swnj 
35085Swnj typedef	u_long	tcp_seq;
44573Swnj /*
54899Swnj  * TCP header.
64924Swnj  * Per RFC 793, September, 1981.
74573Swnj  */
84899Swnj struct tcphdr {
94899Swnj 	u_short	th_sport;		/* source port */
104899Swnj 	u_short	th_dport;		/* destination port */
115085Swnj 	tcp_seq	th_seq;			/* sequence number */
125085Swnj 	tcp_seq	th_ack;			/* acknowledgement number */
13*9992Ssam #ifdef vax
14*9992Ssam 	u_char	th_x2:4,		/* (unused) */
154899Swnj 		th_off:4;		/* data offset */
16*9992Ssam #endif
17*9992Ssam #ifdef sun
18*9992Ssam 	u_char	th_off:4,		/* data offset */
19*9992Ssam 		th_x2:4;		/* (unused) */
20*9992Ssam #endif
214575Swnj 	u_char	th_flags;
225065Swnj #define	TH_FIN	0x01
235065Swnj #define	TH_SYN	0x02
245065Swnj #define	TH_RST	0x04
255065Swnj #define	TH_PUSH	0x08
265065Swnj #define	TH_ACK	0x10
275065Swnj #define	TH_URG	0x20
284899Swnj 	u_short	th_win;			/* window */
294899Swnj 	u_short	th_sum;			/* checksum */
304899Swnj 	u_short	th_urp;			/* urgent pointer */
314499Swnj };
325440Swnj 
335440Swnj #define	TCPOPT_EOL	0
345440Swnj #define	TCPOPT_NOP	1
355440Swnj #define	TCPOPT_MAXSEG	2
36