Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tcp_session.h « See « src - github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 33aa99e17cdd176c65b0b59f88ffd9e64f8f5608 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * Copyright (c) 2001 - 2003
 * NetGroup, Politecnico di Torino (Italy)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the Politecnico di Torino nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#ifndef __tcp_session
#define __tcp_session

#ifdef WIN32
#include "tme.h"
#endif

#ifdef __FreeBSD__

#ifdef _KERNEL
#include <net/tme/tme.h>
#else
#include <tme/tme.h>
#endif

#endif

#define UNKNOWN			0
#define SYN_RCV			1
#define SYN_ACK_RCV		2
#define ESTABLISHED		3
#define CLOSED_RST		4
#define FIN_CLN_RCV		5
#define FIN_SRV_RCV		6
#define CLOSED_FIN		7
#define ERROR_TCP		8
#define FIRST_IS_CLN	0
#define	FIRST_IS_SRV	0xffffffff
#define FIN_CLN			1
#define	FIN_SRV			2

#define MAX_WINDOW 65536

typedef struct __tcp_data
{
	struct timeval timestamp_block; /*DO NOT MOVE THIS VALUE*/
	struct timeval syn_timestamp;
	struct timeval last_timestamp;
	struct timeval syn_ack_timestamp;
	uint32 direction;
	uint32 seq_n_0_srv;
	uint32 seq_n_0_cln;
	uint32 ack_srv; /* acknowledge of (data sent by server) */
	uint32 ack_cln; /* acknowledge of (data sent by client) */
	uint32 status;
	uint32 pkts_cln_to_srv;
	uint32 pkts_srv_to_cln;
	uint32 bytes_srv_to_cln;
	uint32 bytes_cln_to_srv;
	uint32 close_state;
}
	 tcp_data;

#define FIN		1
#define	SYN		2
#define RST		4
#define PSH		8
#define ACK		16
#define URG		32

#define	TCP_SESSION						0x00000800
uint32 tcp_session(uint8 *block, uint32 pkt_size, TME_DATA *data, MEM_TYPE *mem_ex, uint8 *mem_data);

#endif