1 | #ifndef _TCP_H
|
---|
2 | #define _TCP_H
|
---|
3 |
|
---|
4 | #define TCP_INITIAL_TIMEOUT (3*TICKS_PER_SEC)
|
---|
5 | #define TCP_MAX_TIMEOUT (60*TICKS_PER_SEC)
|
---|
6 | #define TCP_MIN_TIMEOUT (TICKS_PER_SEC)
|
---|
7 | #define TCP_MAX_RETRY 10
|
---|
8 | #define TCP_MAX_HEADER ((int)sizeof(struct iphdr)+64)
|
---|
9 | #define TCP_MIN_WINDOW (1500-TCP_MAX_HEADER)
|
---|
10 | #define TCP_MAX_WINDOW (65535-TCP_MAX_HEADER)
|
---|
11 |
|
---|
12 |
|
---|
13 | #define MAX_URL 80
|
---|
14 |
|
---|
15 |
|
---|
16 | #define FIN 1
|
---|
17 | #define SYN 2
|
---|
18 | #define RST 4
|
---|
19 | #define PSH 8
|
---|
20 | #define ACK 16
|
---|
21 | #define URG 32
|
---|
22 |
|
---|
23 |
|
---|
24 | struct tcphdr {
|
---|
25 | uint16_t src;
|
---|
26 | uint16_t dst;
|
---|
27 | int32_t seq;
|
---|
28 | int32_t ack;
|
---|
29 | uint16_t ctrl;
|
---|
30 | uint16_t window;
|
---|
31 | uint16_t chksum;
|
---|
32 | uint16_t urgent;
|
---|
33 | };
|
---|
34 |
|
---|
35 | #endif /* _TCP_H */
|
---|