-
Notifications
You must be signed in to change notification settings - Fork 2
/
tcpsplit.h
73 lines (61 loc) · 2.23 KB
/
tcpsplit.h
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
/* tcpsplit
* Mark Allman ([email protected])
*
* Copyright (c) 2004--2013 International Computer Science Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* The names and trademarks of copyright holders may not be used in
* advertising or publicity pertaining to the software without specific
* prior permission. Title to copyright in this software and any
* associated documentation will at all times remain with the copyright
* holders.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <pcap.h>
#define FALSE 0
#define TRUE 1
#define MAX_OUTPUT_FILES 1024 * 1024
#define HASH_MULTIPLIER 37
#define HASH_TBL_SIZE 48611
#define EH_SIZE 14
#define EH_TYPE_OFFSET 12
#define SLASH24 0xffffff00
struct pkt_dump_file
{
pcap_dumper_t *dp;
unsigned long pkts;
};
struct ip_pair
{
unsigned int ip1, ip2;
unsigned short port1, port2;
unsigned short file_num;
struct ip_pair *next;
};
/* balancer.c */
unsigned short file_for_new_cnn ();
/* ipa_db.c */
void init_hash_table ();
unsigned short get_file_num ();
/* tcpsplit.c */
extern unsigned short num_files;
extern struct pkt_dump_file out_file [];
extern unsigned short deterministic;