123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef _NETINET_IP_TCP_H
- #define _NETINET_IP_TCP_H
- #include <endian.h>
- #include <linux/socket.h>
- #include <sys/types.h>
- typedef u_long tcp_seq;
- struct tcphdr {
- u_short th_sport;
- u_short th_dport;
- tcp_seq th_seq;
- tcp_seq th_ack;
- #if __BYTE_ORDER == __LITTLE_ENDIAN
- u_char th_x2:4,
- th_off:4;
- #endif
- #if __BYTE_ORDER == __BIG_ENDIAN
- u_char th_off:4,
- th_x2:4;
- #endif
- u_char th_flags;
- #define TH_FIN 0x01
- #define TH_SYN 0x02
- #define TH_RST 0x04
- #define TH_PUSH 0x08
- #define TH_ACK 0x10
- #define TH_URG 0x20
- u_short th_win;
- u_short th_sum;
- u_short th_urp;
- };
- #define TCPOPT_EOL 0
- #define TCPOPT_NOP 1
- #define TCPOPT_MAXSEG 2
- #ifdef lint
- #define TCP_MSS 536
- #else
- #define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
- #endif
- #endif
|