Skip to Content
[CAIDA - Center for Applied Internet Data Analysis logo]
The Center for Applied Internet Data Analysis
corsaro_dos.h
1 /*
2  * corsaro
3  *
4  * Alistair King, CAIDA, UC San Diego
5  * corsaro-info@caida.org
6  *
7  * Copyright (C) 2012 The Regents of the University of California.
8  *
9  * This file is part of corsaro.
10  *
11  * corsaro is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * corsaro is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with corsaro. If not, see <http://www.gnu.org/licenses/>.
23  *
24  */
25 
26 #ifndef __CORSARO_DOS_H
27 #define __CORSARO_DOS_H
28 
29 #include "corsaro_plugin.h"
30 
32 
33 
44 {
51 
54 
60 
65 typedef struct corsaro_dos_header
66 {
69 } PACKED corsaro_dos_header_t;
70 
80 {
82  uint32_t target_ip;
83 
85  uint32_t attacker_ip_cnt;
86 
90 
92  uint32_t attack_port_cnt;
93 
95  uint32_t target_port_cnt;
96 
98  uint64_t packet_cnt;
99 
102 
104  uint64_t byte_cnt;
105 
108 
110  uint64_t max_ppm;
111 
113  uint32_t start_time_sec;
114 
116  uint32_t start_time_usec;
117 
119  uint32_t latest_time_sec;
120 
123 
126 
135  uint8_t *initial_packet;
137 
151  corsaro_dos_attack_vector_in_t *attack_vector,
152  libtrace_packet_t *packet);
153 
162  corsaro_file_t *file,
164 
170 
179  corsaro_file_t *file,
181 
187 
196  corsaro_file_t *file,
197  corsaro_dos_header_t *header);
198 
204 
215  corsaro_file_t *file,
216  corsaro_in_record_type_t record_type,
218 
227 
230 #endif /* __CORSARO_DOS_H */
uint32_t start_time_usec
The time of the initial packet (usec)
Definition: corsaro_dos.h:116
Header file dealing with the corsaro plugin manager.
uint32_t mismatched_pkt_cnt
The number of packets which had mismatched IP addresses in the header.
Definition: corsaro_dos.h:50
off_t corsaro_dos_header_fprint(corsaro_t *corsaro, corsaro_file_t *file, corsaro_dos_header_t *header)
Print a header record to stdout in ASCII format.
Definition: corsaro_dos.c:1554
An opaque structure defining an corsaro output file.
Definition: corsaro_file.h:60
uint64_t packet_cnt
The number of packets that comprise this vector.
Definition: corsaro_dos.h:98
A reusable opaque structure for corsaro to read an input record into.
Definition: corsaro_int.h:350
void corsaro_dos_attack_vector_get_packet(corsaro_dos_attack_vector_in_t *attack_vector, libtrace_packet_t *packet)
Extract the initial packet from an attack vector record.
Definition: corsaro_dos.c:1402
uint32_t attack_vector_cnt
The number of attack vectors in this interval.
Definition: corsaro_dos.h:53
int corsaro_dos_record_print(corsaro_in_record_type_t record_type, corsaro_in_record_t *record)
Print any DoS record to a file in ASCII format.
Definition: corsaro_dos.c:1611
static libtrace_packet_t * packet
A pointer to a libtrace packet.
Definition: corsaro_main.c:67
uint32_t initial_packet_len
The length of the initial packet (bytes)
Definition: corsaro_dos.h:125
static corsaro_in_record_t * record
A pointer to a corsaro record.
Definition: corsaro_main.c:76
off_t corsaro_dos_attack_vector_fprint(corsaro_t *corsaro, corsaro_file_t *file, corsaro_dos_attack_vector_in_t *av)
Print an attack vector record to stdout in ASCII format.
Definition: corsaro_dos.c:1449
uint32_t latest_time_sec
The time of the last packet (seconds)
Definition: corsaro_dos.h:119
uint32_t interval_attacker_ip_cnt
Number of IP addresses the alleged attack has originated from in the current interval.
Definition: corsaro_dos.h:89
off_t corsaro_dos_record_fprint(corsaro_t *corsaro, corsaro_file_t *file, corsaro_in_record_type_t record_type, corsaro_in_record_t *record)
Print any DoS record to stdout in ASCII format.
Definition: corsaro_dos.c:1578
Structure to hold a dos attack vector.
Definition: corsaro_dos.h:79
off_t corsaro_dos_global_header_fprint(corsaro_t *corsaro, corsaro_file_t *file, corsaro_dos_global_header_t *header)
Print a global header record to stdout in ASCII format.
Definition: corsaro_dos.c:1414
void corsaro_dos_global_header_print(corsaro_dos_global_header_t *header)
Print a global header record to a file in ASCII format.
Definition: corsaro_dos.c:1433
uint32_t non_attack_vector_cnt
The number of potential attack vectors which were not classified as being part of an attack...
Definition: corsaro_dos.h:58
uint32_t interval_packet_cnt
The number of packets added to this vector in the current interval.
Definition: corsaro_dos.h:101
uint8_t * initial_packet
A copy of the packet that caused the vector to be created.
Definition: corsaro_dos.h:135
void corsaro_dos_header_print(corsaro_dos_header_t *header)
Print a header record to a file in ASCII format.
Definition: corsaro_dos.c:1569
uint32_t latest_time_usec
The time of the last packet (usec)
Definition: corsaro_dos.h:122
uint32_t attack_vector_cnt
The number of attack vectors in this interval.
Definition: corsaro_dos.h:68
uint64_t byte_cnt
The number of bytes that comprise this vector.
Definition: corsaro_dos.h:104
Structure to hold the dos header details for an interval.
Definition: corsaro_dos.h:65
uint32_t attacker_ip_cnt
Number of IP addresses the alleged attack has originated from.
Definition: corsaro_dos.h:85
uint32_t attack_port_cnt
Number of ports that alleged attack packets have originated from.
Definition: corsaro_dos.h:92
uint32_t target_port_cnt
Number of ports that alleged attack packets were directed to.
Definition: corsaro_dos.h:95
Corsaro output state.
Definition: corsaro_int.h:230
void corsaro_dos_attack_vector_print(corsaro_dos_attack_vector_in_t *av)
Print an attack vector record to a file in ASCII format.
Definition: corsaro_dos.c:1495
uint32_t start_time_sec
The time of the initial packet (seconds)
Definition: corsaro_dos.h:113
uint32_t target_ip
The IP address of the alleged target of the attack.
Definition: corsaro_dos.h:82
uint64_t max_ppm
The maximum packet rate observed thus far.
Definition: corsaro_dos.h:110
enum corsaro_in_record_type corsaro_in_record_type_t
Corsaro input record types.
uint32_t interval_byte_cnt
The number of bytes added to this vector in the current interval.
Definition: corsaro_dos.h:107
#define CORSARO_PLUGIN_GENERATE_PROTOS(plugin)
Convenience macro that defines all the function prototypes for the corsaro plugin API...
Structure to hold the dos record in the global output file.
Definition: corsaro_dos.h:43