forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
request_response.h
executable file
·59 lines (38 loc) · 1.26 KB
/
request_response.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
50
51
52
53
54
55
56
57
58
59
#ifndef REQUEST_RESPONSE_H_INCLUDED
#define REQUEST_RESPONSE_H_INCLUDED
#include "querydnsbase.h"
#include "readconfig.h"
#include "dnscache.h"
#include "common.h"
int InitAddress(ConfigFileInfo *ConfigInfo);
BOOL SocketIsStillReadable(SOCKET Sock, int timeout);
void ClearSocketBuffer(SOCKET Sock);
int SendAndReveiveRawMessageViaTCP(SOCKET Sock,
const void *Content,
int ContentLength,
ExtendableBuffer *ResultBuffer,
uint16_t *TCPLength /* Big-endian */
);
int QueryDNSViaTCP(void);
void SetUDPAntiPollution(BOOL State);
void SetUDPAppendEDNSOpt(BOOL State);
int InitBlockedIP(StringList *l);
int InitIPSubstituting(StringList *l);
int QueryDNSViaUDP(void);
int ProbeFakeAddresses(const char *ServerAddress,
const char *RequestingDomain,
StringList *out
);
struct TestServerArguments
{
const char *ServerAddress;
uint32_t *Counter;
};
int TestServer(struct TestServerArguments *Args);
int SetSocketWait(SOCKET sock, BOOL Wait);
int SetSocketSendTimeLimit(SOCKET sock, int time);
int SetSocketRecvTimeLimit(SOCKET sock, int time);
BOOL TCPSocketIsHealthy(SOCKET sock);
void CloseTCPConnection(SOCKET sock);
void TransferStart(BOOL StartTCP);
#endif // REQUEST_RESPONSE_H_INCLUDED