forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 9
/
ipmisc.h
executable file
·49 lines (36 loc) · 1.11 KB
/
ipmisc.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
#ifndef IPMISC_H_INCLUDED
#define IPMISC_H_INCLUDED
#include "ipchunk.h"
#include "dnsparser.h"
#include "readconfig.h"
#include "iheader.h"
typedef enum _MiscType {
IP_MISC_TYPE_UNKNOWN = 0,
IP_MISC_TYPE_BLOCK,
IP_MISC_TYPE_SUBSTITUTE,
} MiscType;
#define IP_MISC_NOTHING 0
#define IP_MISC_FILTERED_IP (-1)
#define IP_MISC_NEGATIVE_RESULT (-2)
typedef struct _IPMisc IPMisc;
struct _IPMisc{
/* private */
IpChunk c;
BOOL BlockNegative;
int (*AddBlockFromString)(IPMisc *m, const char *Ip);
int (*AddSubstituteFromString)(IPMisc *m,
const char *Ip,
const char *Substituter
);
void (*SetBlockNegative)(IPMisc *m, BOOL Value);
int (*Process)(IPMisc *m,
char *DNSPackage, /* Without TCPLength */
int PackageLength
);
};
int IPMisc_Init(IPMisc *m);
void IpMiscMapping_Update(void);
/** Mapping */
int IpMiscMapping_Init(ConfigFileInfo *ConfigInfo);
int IPMiscMapping_Process(MsgContext *MsgCtx);
#endif /* IPMISC_H_INCLUDED */