dnscrypto-proxy: Update to release 1.3.0
[tomato.git] / release / src / router / dnscrypt / src / proxy / tcp_request_p.h
blob4496299f4eb501e1aa7839ba3177c97b22f6634f
2 #ifndef __TCP_REQUEST_H_P__
3 #define __TCP_REQUEST_H_P__ 1
5 #include <sys/types.h>
7 #include <stdint.h>
9 #include <event2/event.h>
11 #include "dnscrypt.h"
12 #include "queue.h"
14 typedef struct TCPRequestStatus_ {
15 _Bool has_dns_query_len : 1;
16 _Bool has_dns_reply_len : 1;
17 _Bool is_in_queue : 1;
18 _Bool is_dying : 1;
19 } TCPRequestStatus;
21 typedef struct TCPRequest_ {
22 uint8_t client_nonce[crypto_box_HALF_NONCEBYTES];
23 TAILQ_ENTRY(TCPRequest_) queue;
24 #ifdef PLUGINS
25 struct sockaddr_storage client_sockaddr;
26 #endif
27 struct bufferevent *client_proxy_bev;
28 struct bufferevent *proxy_resolver_bev;
29 struct evbuffer *proxy_resolver_query_evbuf;
30 ProxyContext *proxy_context;
31 struct event *timeout_timer;
32 #ifdef PLUGINS
33 ev_socklen_t client_sockaddr_len;
34 #endif
35 TCPRequestStatus status;
36 size_t dns_query_len;
37 size_t dns_reply_len;
38 } TCPRequest;
40 #endif