summaryrefslogtreecommitdiffstats
path: root/private/ntos/ndis/ndiswan/tcpip.h
blob: de5abe47408e10e2d8d2d89deb50482b719bd08a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// TCP control bits

#ifndef _TCPIP_
#define _TCPIP_

#define TH_SYN		0x02	// Synchronize sequence numbers
#define TH_FIN		0x01	// Sender has reached end of his stream
#define TH_RST		0x04	// Reset the connection
#define TH_PUSH		0x08	// Push data to above level
#define TH_ACK		0x10	// Acknowledgement field is valid
#define TH_URG		0x20	// Urgent pointer is valid

struct tcphdr {
	USHORT	th_sport;
	USHORT	th_dport;
	ULONG	th_seq;
	ULONG	th_ack;
	UCHAR	th_off;
	UCHAR	th_flags;
	USHORT	th_win;
	UCHAR	th_sumhi;
	UCHAR	th_sumlo;
	USHORT	th_urp;
	UCHAR	th_data[1];
};

#define IP_ALEN	4

typedef struct IPaddr {
	ULONG	s_addr;
} IPaddr;

#define IPPROTO_TCP 6

struct ip {

	UCHAR	ip_hl;
	UCHAR	ip_tos;
	USHORT	ip_len;
	USHORT	ip_id;
	USHORT	ip_off;
	UCHAR	ip_ttl;
	UCHAR	ip_p;
	USHORT	ip_sum;
	IPaddr	ip_src;
	IPaddr	ip_dst;
	UCHAR	ip_data[1];
};

typedef struct ip IPHeader, *PIPHeader;

#endif // _TCPIP_