4faf7b71f12144a0a4813121769ea10d043721ae
[reactos.git] / reactos / drivers / net / npf / tcp_session.h
1 /*
2 * Copyright (c) 2001
3 * Politecnico di Torino. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the Politecnico
13 * di Torino, and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 */
21
22 #ifndef __tcp_session
23 #define __tcp_session
24
25 #ifdef WIN32
26 #include "tme.h"
27 #endif
28
29 #ifdef __FreeBSD__
30
31 #ifdef _KERNEL
32 #include <net/tme/tme.h>
33 #else
34 #include <tme/tme.h>
35 #endif
36
37 #endif
38
39 #define UNKNOWN 0
40 #define SYN_RCV 1
41 #define SYN_ACK_RCV 2
42 #define ESTABLISHED 3
43 #define CLOSED_RST 4
44 #define FIN_CLN_RCV 5
45 #define FIN_SRV_RCV 6
46 #define CLOSED_FIN 7
47 #define ERROR_TCP 8
48 #define FIRST_IS_CLN 0
49 #define FIRST_IS_SRV 0xffffffff
50 #define FIN_CLN 1
51 #define FIN_SRV 2
52
53 #define MAX_WINDOW 65536
54
55 typedef struct __tcp_data
56 {
57 struct timeval timestamp_block; /*DO NOT MOVE THIS VALUE*/
58 struct timeval syn_timestamp;
59 struct timeval last_timestamp;
60 struct timeval syn_ack_timestamp;
61 uint32 direction;
62 uint32 seq_n_0_srv;
63 uint32 seq_n_0_cln;
64 uint32 ack_srv; /* acknowledge of (data sent by server) */
65 uint32 ack_cln; /* acknowledge of (data sent by client) */
66 uint32 status;
67 uint32 pkts_cln_to_srv;
68 uint32 pkts_srv_to_cln;
69 uint32 bytes_srv_to_cln;
70 uint32 bytes_cln_to_srv;
71 uint32 close_state;
72 }
73 tcp_data;
74
75 #define FIN 1
76 #define SYN 2
77 #define RST 4
78 #define PSH 8
79 #define ACK 16
80 #define URG 32
81
82 #define TCP_SESSION 0x00000800
83 uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data);
84
85 #endif
86