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