forked from DataSoft/Honeyd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze.h
80 lines (69 loc) · 2.71 KB
/
analyze.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
74
75
76
77
78
79
80
/*
* Copyright (c) 2002, 2003, 2004 Niels Provos <[email protected]>
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _ANALYZE_H_
#define _ANALYZE_H_
#define ANALYZE_REPORT_INTERVAL 60
struct auxkey {
SPLAY_ENTRY(auxkey) node;
TAILQ_ENTRY(auxkey) next;
uint32_t value;
};
struct report {
SPLAY_ENTRY(report) node;
void *key;
size_t keylen;
uint32_t minute;
uint32_t hour;
uint32_t day;
};
struct record;
void analyze_init(void);
void analyze_set_checkpoint_doreplay(int);
void analyze_record(const struct record *record);
void analyze_report_cb(int, short, void *);
void analyze_spammer_enter(const struct addr *src, uint32_t bytes);
void analyze_os_enter(const struct addr *addr, const char *osfp);
void analyze_port_enter(uint16_t, const struct addr *, const struct addr *);
void analyze_country_enter(const struct addr *, const struct addr *);
struct kctree;
struct keycount;
struct reporttree *report_create(struct kctree *kctree,
void (*extract)(struct keycount *, void **, size_t *));
void make_report(struct kctree *, char *,
void (*)(struct keycount *, void **, size_t *),
char *(*)(void *, size_t));
struct reporttree;
void report_free(struct reporttree *tree);
void report_print(struct reporttree *, FILE *, char *(*)(void *, size_t));
void analyze_print_report();
void analyze_test(void);
#endif /* _ANALYZE_H_ */