123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- typedef uint32_t tcp_seq;
- struct tcphdr {
- uint16_t th_sport;
- uint16_t th_dport;
- tcp_seq th_seq;
- tcp_seq th_ack;
- uint8_t th_offx2;
- uint8_t th_flags;
- uint16_t th_win;
- uint16_t th_sum;
- uint16_t th_urp;
- } UNALIGNED;
- #define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4)
- #define TH_FIN 0x01
- #define TH_SYN 0x02
- #define TH_RST 0x04
- #define TH_PUSH 0x08
- #define TH_ACK 0x10
- #define TH_URG 0x20
- #define TH_ECNECHO 0x40
- #define TH_CWR 0x80
- #define TCPOPT_EOL 0
- #define TCPOPT_NOP 1
- #define TCPOPT_MAXSEG 2
- #define TCPOLEN_MAXSEG 4
- #define TCPOPT_WSCALE 3
- #define TCPOPT_SACKOK 4
- #define TCPOPT_SACK 5
- #define TCPOPT_ECHO 6
- #define TCPOPT_ECHOREPLY 7
- #define TCPOPT_TIMESTAMP 8
- #define TCPOLEN_TIMESTAMP 10
- #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2)
- #define TCPOPT_CC 11
- #define TCPOPT_CCNEW 12
- #define TCPOPT_CCECHO 13
- #define TCPOPT_SIGNATURE 19
- #define TCPOLEN_SIGNATURE 18
- #define TCP_SIGLEN 16
- #define TCPOPT_SCPS 20
- #define TCPOPT_UTO 28
- #define TCPOLEN_UTO 4
- #define TCPOPT_TCPAO 29
- #define TCPOPT_MPTCP 30
- #define TCPOPT_FASTOPEN 34
- #define TCPOPT_EXPERIMENT2 254
- #define TCPOPT_TSTAMP_HDR \
- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
- #ifndef FTP_PORT
- #define FTP_PORT 21
- #endif
- #ifndef SSH_PORT
- #define SSH_PORT 22
- #endif
- #ifndef TELNET_PORT
- #define TELNET_PORT 23
- #endif
- #ifndef SMTP_PORT
- #define SMTP_PORT 25
- #endif
- #ifndef NAMESERVER_PORT
- #define NAMESERVER_PORT 53
- #endif
- #ifndef HTTP_PORT
- #define HTTP_PORT 80
- #endif
- #ifndef NETBIOS_NS_PORT
- #define NETBIOS_NS_PORT 137
- #endif
- #ifndef NETBIOS_SSN_PORT
- #define NETBIOS_SSN_PORT 139
- #endif
- #ifndef BGP_PORT
- #define BGP_PORT 179
- #endif
- #ifndef RPKI_RTR_PORT
- #define RPKI_RTR_PORT 323
- #endif
- #ifndef SMB_PORT
- #define SMB_PORT 445
- #endif
- #ifndef RTSP_PORT
- #define RTSP_PORT 554
- #endif
- #ifndef MSDP_PORT
- #define MSDP_PORT 639
- #endif
- #ifndef LDP_PORT
- #define LDP_PORT 646
- #endif
- #ifndef PPTP_PORT
- #define PPTP_PORT 1723
- #endif
- #ifndef NFS_PORT
- #define NFS_PORT 2049
- #endif
- #ifndef OPENFLOW_PORT_OLD
- #define OPENFLOW_PORT_OLD 6633
- #endif
- #ifndef OPENFLOW_PORT_IANA
- #define OPENFLOW_PORT_IANA 6653
- #endif
- #ifndef HTTP_PORT_ALT
- #define HTTP_PORT_ALT 8080
- #endif
- #ifndef RTSP_PORT_ALT
- #define RTSP_PORT_ALT 8554
- #endif
- #ifndef BEEP_PORT
- #define BEEP_PORT 10288
- #endif
- #ifndef REDIS_PORT
- #define REDIS_PORT 6379
- #endif
|