Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

tcp.h File Reference

Go to the source code of this file.

Defines

#define TCP_HDR_LEN   20
#define TCP_OPT_LEN   2
#define TCP_OPT_LEN_MAX   40
#define TCP_HDR_LEN_MAX   (TCP_HDR_LEN + TCP_OPT_LEN_MAX)
#define __attribute__(x)
#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_ECE   0x40
#define TH_CWR   0x80
#define TCP_PORT_MAX   65535
#define TCP_WIN_MAX   65535
#define TCP_SEQ_LT(a, b)   ((int)((a)-(b)) < 0)
#define TCP_SEQ_LEQ(a, b)   ((int)((a)-(b)) <= 0)
#define TCP_SEQ_GT(a, b)   ((int)((a)-(b)) > 0)
#define TCP_SEQ_GEQ(a, b)   ((int)((a)-(b)) >= 0)
#define TCP_STATE_CLOSED   0
#define TCP_STATE_LISTEN   1
#define TCP_STATE_SYN_SENT   2
#define TCP_STATE_SYN_RECEIVED   3
#define TCP_STATE_ESTABLISHED   4
#define TCP_STATE_CLOSE_WAIT   5
#define TCP_STATE_FIN_WAIT_1   6
#define TCP_STATE_CLOSING   7
#define TCP_STATE_LAST_ACK   8
#define TCP_STATE_FIN_WAIT_2   9
#define TCP_STATE_TIME_WAIT   10
#define TCP_STATE_MAX   11
#define TCP_OPT_EOL   0
#define TCP_OPT_NOP   1
#define TCP_OPT_MSS   2
#define TCP_OPT_WSCALE   3
#define TCP_OPT_SACKOK   4
#define TCP_OPT_SACK   5
#define TCP_OPT_ECHO   6
#define TCP_OPT_ECHOREPLY   7
#define TCP_OPT_TIMESTAMP   8
#define TCP_OPT_POCONN   9
#define TCP_OPT_POSVC   10
#define TCP_OPT_CC   11
#define TCP_OPT_CCNEW   12
#define TCP_OPT_CCECHO   13
#define TCP_OPT_ALTSUM   14
#define TCP_OPT_ALTSUMDATA   15
#define TCP_OPT_SKEETER   16
#define TCP_OPT_BUBBA   17
#define TCP_OPT_TRAILSUM   18
#define TCP_OPT_MD5   19
#define TCP_OPT_SCPS   20
#define TCP_OPT_SNACK   21
#define TCP_OPT_REC   22
#define TCP_OPT_CORRUPT   23
#define TCP_OPT_SNAP   24
#define TCP_OPT_TCPCOMP   26
#define TCP_OPT_MAX   27
#define TCP_OPT_TYPEONLY(type)   ((type) == TCP_OPT_EOL || (type) == TCP_OPT_NOP)
#define tcp_pack_hdr(hdr, sport, dport, seq, ack, flags, win, urp)

Variables

tcp_opt __packed__


Define Documentation

#define __attribute__  ) 
 

Definition at line 20 of file tcp.h.

#define TCP_HDR_LEN   20
 

Definition at line 14 of file tcp.h.

Referenced by ip6_checksum(), ip_checksum(), and tcp_main().

#define TCP_HDR_LEN_MAX   (TCP_HDR_LEN + TCP_OPT_LEN_MAX)
 

Definition at line 17 of file tcp.h.

#define TCP_OPT_ALTSUM   14
 

Definition at line 106 of file tcp.h.

#define TCP_OPT_ALTSUMDATA   15
 

Definition at line 107 of file tcp.h.

#define TCP_OPT_BUBBA   17
 

Definition at line 109 of file tcp.h.

#define TCP_OPT_CC   11
 

Definition at line 103 of file tcp.h.

#define TCP_OPT_CCECHO   13
 

Definition at line 105 of file tcp.h.

#define TCP_OPT_CCNEW   12
 

Definition at line 104 of file tcp.h.

#define TCP_OPT_CORRUPT   23
 

Definition at line 115 of file tcp.h.

#define TCP_OPT_ECHO   6
 

Definition at line 98 of file tcp.h.

#define TCP_OPT_ECHOREPLY   7
 

Definition at line 99 of file tcp.h.

#define TCP_OPT_EOL   0
 

Definition at line 92 of file tcp.h.

#define TCP_OPT_LEN   2
 

Definition at line 15 of file tcp.h.

#define TCP_OPT_LEN_MAX   40
 

Definition at line 16 of file tcp.h.

#define TCP_OPT_MAX   27
 

Definition at line 118 of file tcp.h.

#define TCP_OPT_MD5   19
 

Definition at line 111 of file tcp.h.

#define TCP_OPT_MSS   2
 

Definition at line 94 of file tcp.h.

#define TCP_OPT_NOP   1
 

Definition at line 93 of file tcp.h.

#define TCP_OPT_POCONN   9
 

Definition at line 101 of file tcp.h.

#define TCP_OPT_POSVC   10
 

Definition at line 102 of file tcp.h.

#define TCP_OPT_REC   22
 

Definition at line 114 of file tcp.h.

#define TCP_OPT_SACK   5
 

Definition at line 97 of file tcp.h.

#define TCP_OPT_SACKOK   4
 

Definition at line 96 of file tcp.h.

#define TCP_OPT_SCPS   20
 

Definition at line 112 of file tcp.h.

#define TCP_OPT_SKEETER   16
 

Definition at line 108 of file tcp.h.

#define TCP_OPT_SNACK   21
 

Definition at line 113 of file tcp.h.

#define TCP_OPT_SNAP   24
 

Definition at line 116 of file tcp.h.

#define TCP_OPT_TCPCOMP   26
 

Definition at line 117 of file tcp.h.

#define TCP_OPT_TIMESTAMP   8
 

Definition at line 100 of file tcp.h.

#define TCP_OPT_TRAILSUM   18
 

Definition at line 110 of file tcp.h.

#define TCP_OPT_TYPEONLY type   )     ((type) == TCP_OPT_EOL || (type) == TCP_OPT_NOP)
 

Definition at line 120 of file tcp.h.

#define TCP_OPT_WSCALE   3
 

Definition at line 95 of file tcp.h.

#define tcp_pack_hdr hdr,
sport,
dport,
seq,
ack,
flags,
win,
urp   ) 
 

Value:

do {    \
        struct tcp_hdr *tcp_pack_p = (struct tcp_hdr *)(hdr);           \
        tcp_pack_p->th_sport = htons(sport);                            \
        tcp_pack_p->th_dport = htons(dport);                            \
        tcp_pack_p->th_seq = htonl(seq);                                \
        tcp_pack_p->th_ack = htonl(ack);                                \
        tcp_pack_p->th_x2 = 0; tcp_pack_p->th_off = 5;                  \
        tcp_pack_p->th_flags = flags;                                   \
        tcp_pack_p->th_win = htons(win);                                \
        tcp_pack_p->th_urp = htons(urp);                                \
} while (0)

Definition at line 146 of file tcp.h.

Referenced by __pyx_f_4dnet_tcp_pack_hdr().

#define TCP_PORT_MAX   65535
 

Definition at line 59 of file tcp.h.

Referenced by arg_to_fr(), ipf_ports_to_rule(), ipfw_to_fr(), and parse_portspec().

#define TCP_SEQ_GEQ a,
 )     ((int)((a)-(b)) >= 0)
 

Definition at line 68 of file tcp.h.

#define TCP_SEQ_GT a,
 )     ((int)((a)-(b)) > 0)
 

Definition at line 67 of file tcp.h.

#define TCP_SEQ_LEQ a,
 )     ((int)((a)-(b)) <= 0)
 

Definition at line 66 of file tcp.h.

#define TCP_SEQ_LT a,
 )     ((int)((a)-(b)) < 0)
 

Definition at line 65 of file tcp.h.

#define TCP_STATE_CLOSE_WAIT   5
 

Definition at line 79 of file tcp.h.

#define TCP_STATE_CLOSED   0
 

Definition at line 73 of file tcp.h.

#define TCP_STATE_CLOSING   7
 

Definition at line 82 of file tcp.h.

#define TCP_STATE_ESTABLISHED   4
 

Definition at line 78 of file tcp.h.

#define TCP_STATE_FIN_WAIT_1   6
 

Definition at line 81 of file tcp.h.

#define TCP_STATE_FIN_WAIT_2   9
 

Definition at line 85 of file tcp.h.

#define TCP_STATE_LAST_ACK   8
 

Definition at line 83 of file tcp.h.

#define TCP_STATE_LISTEN   1
 

Definition at line 74 of file tcp.h.

#define TCP_STATE_MAX   11
 

Definition at line 87 of file tcp.h.

#define TCP_STATE_SYN_RECEIVED   3
 

Definition at line 76 of file tcp.h.

#define TCP_STATE_SYN_SENT   2
 

Definition at line 75 of file tcp.h.

#define TCP_STATE_TIME_WAIT   10
 

Definition at line 86 of file tcp.h.

#define TCP_WIN_MAX   65535
 

Definition at line 60 of file tcp.h.

Referenced by tcp_main().

#define TH_ACK   0x10
 

Definition at line 54 of file tcp.h.

Referenced by CreateNewSession(), CreateTCPFlagString(), flags_aton(), flowps_tcp_penalty(), InitFakePkt(), InitStream4Pkt(), ProcessPerfMonitor(), ReassembleStream4(), StoreStreamPkt(), UpdateState2(), and UpdateStateAsync().

#define TH_CWR   0x80
 

Definition at line 57 of file tcp.h.

#define TH_ECE   0x40
 

Definition at line 56 of file tcp.h.

#define TH_FIN   0x01
 

Definition at line 50 of file tcp.h.

Referenced by CreateNewSession(), CreateTCPFlagString(), flags_aton(), flowps_tcp_penalty(), ReassembleStream4(), UpdateState2(), and UpdateStateAsync().

#define TH_PUSH   0x08
 

Definition at line 53 of file tcp.h.

Referenced by CreateNewSession(), CreateTCPFlagString(), flags_aton(), InitFakePkt(), InitStream4Pkt(), and ReassembleStream4().

#define TH_RST   0x04
 

Definition at line 52 of file tcp.h.

Referenced by CreateNewSession(), CreateTCPFlagString(), flags_aton(), ps_filter_ignore(), ps_tracker_update_tcp(), ReassembleStream4(), TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync().

#define TH_SYN   0x02
 

Definition at line 51 of file tcp.h.

Referenced by CreateNewSession(), CreateTCPFlagString(), flags_aton(), flowps_tcp_penalty(), GetDirection(), ProcessPerfMonitor(), ReassembleStream4(), StoreStreamPkt(), tcp_main(), TcpAction(), TcpActionAsync(), UpdateState2(), and UpdateStateAsync().

#define TH_URG   0x20
 

Definition at line 55 of file tcp.h.

Referenced by CreateNewSession(), CreateTCPFlagString(), flags_aton(), and PrintTCPHeader().


Variable Documentation

struct tcp_opt __packed__
 


Generated on Sun May 14 14:51:21 2006 by  doxygen 1.4.2