-
Notifications
You must be signed in to change notification settings - Fork 3
/
traffana.h
68 lines (56 loc) · 1.7 KB
/
traffana.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
/*
* traffana.h
* Traffic Analyzer header file
*
* @author : Himanshu Mehra
* @email : [email protected]
* @project: ISI Project
*/
#ifndef __TRAFFANA_H__
#define __TRAFFANA_H__
#include <stdint.h>
#include <assert.h>
#include "common.h"
/* Constants */
#define TRAFFANA_DEFAULT_EPOCH 1 /* second */
#define TRAFFANA_MAX_FLOWS 2048
#define TRAFFANA_MAX_ATTACKERS 65535
#define TRAFFANA_FLOW_MON_2TUPLE 2
#define TRAFFANA_FLOW_MON_5TUPLE 5
typedef struct {
char pcap_file[MAX_NAME_LEN];
char output_file[MAX_NAME_LEN];
char interface[MAX_NAME_LEN];
double epoch;
uint8_t verbose;
uint8_t tuple_mode;
double global_time;
uint32_t pkt_threshold;
uint32_t byte_threshold;
uint32_t flow_threshold;
uint32_t src_threshold;
FILE *loghdl;
FILE *attack_loghdl;
} traffana_input_t;
typedef struct {
uint32_t src_addr; /* network order */
uint32_t dst_addr; /* network order */
uint16_t src_port; /* network order */
uint16_t dst_port; /* network order */
uint8_t proto;
} traffana_flow_t;
typedef struct {
uint32_t num_pkts;
uint32_t num_bytes;
uint32_t num_icmp_pkts;
uint32_t num_udp_pkts;
uint32_t num_tcp_pkts;
uint32_t num_other_pkts;
uint32_t num_flows;
uint32_t num_tcp_flows;
uint32_t num_udp_flows;
uint32_t num_icmp_flows;
uint32_t num_src_addrs;
uint32_t attack_detected;
} traffana_epoch_t;
#endif /* #ifndef __TRAFFANA_H__ */