~jff-de/bindguard/trunk

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
#ifdef GEOIP
#define HAVE_GEOIP_H
#endif

#ifdef HAVE_GEOIP_H
#define GEOIP_DB		"/usr/share/GeoIP/GeoIP.dat"
#endif

#ifdef HAVE_GEOIP_H
#include "/usr/include/GeoIP.h"
#endif 

extern int errno;

#define DEFAULT_BOGON	"/etc/bind/bogon.conf"
#define PIDFILE			"/var/run/bindguard.pid"

#define HASHSIZE		32768L
#define EXPIRED			600
#define CHECK_AFTER		60


typedef struct _host {
	unsigned long		hash;
	unsigned long		entryno;
	char				*hostname;
	char				*querydomain;
	char				*querytype;
	unsigned long		count;
	int					blocked;
	time_t				created;
	time_t				updated;
	struct _host		*next;
	struct _host		*prev;
} host;

typedef struct _cmd {
	int					opcode;
	int					datalen;
	char				*data;
} shmcmd;

typedef struct _ignore {
	char				*host;
	struct _ignore		*next;
} ignoreList;