forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
statichosts.h
executable file
·49 lines (31 loc) · 955 Bytes
/
statichosts.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 STATICHOSTS_H_INCLUDED
#define STATICHOSTS_H_INCLUDED
#include "stringchunk.h"
#include "dnsrelated.h"
#include "querydnsbase.h"
#define DOMAIN_NAME_LENGTH_MAX 128
typedef struct _OffsetOfHosts{
int32_t Offset;
} OffsetOfHosts;
typedef struct _HostsContainer{
StringList Domains;
StringChunk Ipv4Hosts;
StringChunk Ipv6Hosts;
StringChunk CNameHosts;
StringChunk ExcludedDomains;
/* StringChunk ExcludedIPs;*/
ExtendableBuffer IPs;
} HostsContainer;
extern HostsContainer MainStaticContainer;
typedef enum _HostsRecordType{
HOSTS_TYPE_TOO_LONG = -1,
HOSTS_TYPE_UNKNOWN = 0,
HOSTS_TYPE_A = 1 << 1,
HOSTS_TYPE_AAAA = 1 << 2,
HOSTS_TYPE_CNAME = 1 << 3,
HOSTS_TYPE_EXCLUEDE = 1 << 4,
} HostsRecordType;
int Hosts_InitContainer(HostsContainer *Container);
HostsRecordType Hosts_LoadFromMetaLine(HostsContainer *Container, char *MetaLine);
int StaticHosts_Init(ConfigFileInfo *ConfigInfo);
#endif // STATICHOSTS_H_INCLUDED