forked from DNS-OARC/dnscap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnscap_common.h
48 lines (43 loc) · 1.03 KB
/
dnscap_common.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
/*
* setup MY_BPFTIMEVAL as the timeval structure that bpf packets
* will be assoicated with packets from libpcap
*/
#ifdef __OpenBSD__
# define MY_BPFTIMEVAL bpf_timeval
#endif
#ifndef MY_BPFTIMEVAL
# define MY_BPFTIMEVAL timeval
#endif
typedef struct MY_BPFTIMEVAL my_bpftimeval;
/*
* Structure to contain IP addresses
*/
typedef struct {
int af;
union {
struct in_addr a4;
struct in6_addr a6;
} u;
} iaddr;
/*
* plugins can call the logerr() function in the main dnscap
* process.
*/
typedef int logerr_t(const char *fmt, ...);
/*
* Prototype for the plugin "output" function
*/
typedef void output_t(const char *descr,
iaddr from,
iaddr to,
uint8_t proto,
int isfrag,
unsigned sport,
unsigned dport,
my_bpftimeval ts,
const u_char *pkt_copy,
unsigned olen,
const u_char *dnspkt,
unsigned dnslen);
#define DIR_INITIATE 0x0001
#define DIR_RESPONSE 0x0002