forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ipmisc.h
executable file
·47 lines (35 loc) · 1.09 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
#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);
/** Singleton */
int IpMiscSingleton_Init(ConfigFileInfo *ConfigInfo);
int IPMiscSingleton_Process(IHeader *h /* Entity followed */);
#endif // IPMISC_H_INCLUDED