]>
Commit | Line | Data |
---|---|---|
ede152ec RG |
1 | #pragma once |
2 | #include "iputils.hh" | |
3 | ||
4 | struct DOHServerConfig; | |
5 | ||
6 | struct DOHFrontend | |
7 | { | |
8 | std::shared_ptr<DOHServerConfig> d_dsc{nullptr}; | |
bf8cd40d | 9 | std::vector<std::pair<std::string, std::string>> d_certKeyPairs; |
ede152ec RG |
10 | std::string d_ciphers; |
11 | std::string d_ciphers13; | |
12 | ComboAddress d_local; | |
13 | ||
14 | uint32_t d_idleTimeout{30}; // HTTP idle timeout in seconds | |
15 | std::vector<std::string> d_urls; | |
16 | ||
17 | std::atomic<uint64_t> d_httpconnects; // number of TCP/IP connections established | |
18 | std::atomic<uint64_t> d_http1queries; // valid DNS queries received via HTTP1 | |
19 | std::atomic<uint64_t> d_http2queries; // valid DNS queries received via HTTP2 | |
20 | std::atomic<uint64_t> d_tls10queries; // valid DNS queries received via TLSv1.0 | |
21 | std::atomic<uint64_t> d_tls11queries; // valid DNS queries received via TLSv1.1 | |
22 | std::atomic<uint64_t> d_tls12queries; // valid DNS queries received via TLSv1.2 | |
23 | std::atomic<uint64_t> d_tls13queries; // valid DNS queries received via TLSv1.3 | |
24 | std::atomic<uint64_t> d_tlsUnknownqueries; // valid DNS queries received via unknown TLS version | |
25 | ||
26 | std::atomic<uint64_t> d_getqueries; // valid DNS queries received via GET | |
27 | std::atomic<uint64_t> d_postqueries; // valid DNS queries received via POST | |
28 | std::atomic<uint64_t> d_badrequests; // request could not be converted to dns query | |
29 | std::atomic<uint64_t> d_errorresponses; // dnsdist set 'error' on response | |
30 | std::atomic<uint64_t> d_validresponses; // valid responses sent out | |
31 | ||
32 | #ifndef HAVE_DNS_OVER_HTTPS | |
33 | void setup() | |
34 | { | |
35 | } | |
36 | ||
6c7cec08 | 37 | void reloadCertificates() |
ede152ec RG |
38 | { |
39 | } | |
40 | #else | |
41 | void setup(); | |
6c7cec08 | 42 | void reloadCertificates(); |
ede152ec RG |
43 | #endif /* HAVE_DNS_OVER_HTTPS */ |
44 | }; | |
45 | ||
46 | #ifndef HAVE_DNS_OVER_HTTPS | |
47 | struct DOHUnit | |
48 | { | |
49 | }; | |
50 | ||
51 | #else /* HAVE_DNS_OVER_HTTPS */ | |
52 | struct st_h2o_req_t; | |
53 | ||
54 | struct DOHUnit | |
55 | { | |
56 | std::string query; | |
57 | ComboAddress remote; | |
58 | ComboAddress dest; | |
59 | st_h2o_req_t* req{nullptr}; | |
60 | DOHUnit** self{nullptr}; | |
61 | int rsock; | |
62 | uint16_t qtype; | |
63 | bool error{false}; | |
64 | bool ednsAdded{false}; | |
65 | }; | |
66 | ||
67 | #endif /* HAVE_DNS_OVER_HTTPS */ |