forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 9
/
hostsutils.h
executable file
·47 lines (39 loc) · 1.8 KB
/
hostsutils.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 HOSTSUTILS_H_INCLUDED
#define HOSTSUTILS_H_INCLUDED
#include "iheader.h"
#include "hostscontainer.h"
typedef enum _HostsUtilsTryResult{
HOSTSUTILS_TRY_BLOCKED = -2,
HOSTSUTILS_TRY_NONE = -1,
HOSTSUTILS_TRY_OK = 0,
HOSTSUTILS_TRY_RECURSED = 1
} HostsUtilsTryResult;
int HostsUtils_GetCName(const char *Domain,
char *Buffer,
HostsContainer *Container
);
BOOL HostsUtils_TypeExisting(HostsContainer *Container,
const char *Domain,
HostsRecordType Type
);
HostsUtilsTryResult HostsUtils_Try(MsgContext *MsgCtx,
int BufferLength,
HostsContainer *Container
);
int HostsUtils_GenerateQuery(char *RequestBuffer,
int BufferLength,
SOCKET Socket, /* Both for sending and receiving */
Address_Type *BackAddress,
BOOL RequestTcp,
uint16_t Identifier,
const char *Name,
DNSRecordType Type
);
/* Error code returned */
int HostsUtils_CombineRecursedResponse(MsgContext *Buffer,
int Bufferlength,
char *RecursedEntity,
int EntityLength,
const char *RecursedDomain
);
#endif /* HOSTSUTILS_H_INCLUDED */