forked from aolarchive/mod_webfw2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thrasher.h
71 lines (62 loc) · 1.42 KB
/
thrasher.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
typedef enum {
TYPE_THRESHOLD_v1 = 0,
TYPE_REMOVE,
TYPE_INJECT,
TYPE_THRESHOLD_v2,
TYPE_THRESHOLD_v3,
TYPE_THRESHOLD_v4,
TYPE_THRESHOLD_v6,
} thrasher_pkt_type;
typedef struct thrasher_v1_data {
char *host;
char *uri;
uint32_t addr;
uint16_t hlen;
uint16_t urilen;
} thrasher_v1_data_t;
typedef struct thrasher_v2_data {
uint16_t addr;
} thrasher_v2_data_t;
typedef struct thrasher_v3_data {
char *host;
char *uri;
uint32_t addr;
uint16_t hlen;
uint16_t urilen;
uint32_t ident;
} thrasher_v3_data_t;
typedef struct thrasher_v4_data {
char *host;
char *uri;
uint32_t addr;
uint16_t hlen;
uint16_t urilen;
uint32_t ident;
char *reason;
} thrasher_v4_data_t;
typedef struct thrasher_v6_data {
char *host;
char *uri;
unsigned char addr[16];
uint16_t hlen;
uint16_t urilen;
uint32_t ident;
char *reason;
} thrasher_v6_data_t;
typedef struct thrasher_pkt {
unsigned char *packet;
apr_size_t len;
uint32_t ident;
int (*thrasher_recv_cb)(struct thrasher_pkt *pkt, apr_socket_t *sock);
} thrasher_pkt_t;
int thrasher_query(request_rec *,
webfw2_config_t *,
webfw2_filter_t *,
thrasher_pkt_type,
const char *,
uint32_t,
char*,
int);
apr_socket_t *thrasher_connect(apr_pool_t *pool, webfw2_config_t *config);
int thrasher_is_connected(apr_socket_t *sock);
int thrasher_should_retry(webfw2_config_t *, webfw2_filter_t *);