OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_H_ | 5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_H_ |
6 #define NET_DNS_DNS_CONFIG_SERVICE_H_ | 6 #define NET_DNS_DNS_CONFIG_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
32 bool EqualsIgnoreHosts(const DnsConfig& d) const; | 32 bool EqualsIgnoreHosts(const DnsConfig& d) const; |
33 | 33 |
34 bool IsValid() const { | 34 bool IsValid() const { |
35 return !nameservers.empty(); | 35 return !nameservers.empty(); |
36 } | 36 } |
37 | 37 |
38 // List of name server addresses. | 38 // List of name server addresses. |
39 std::vector<IPEndPoint> nameservers; | 39 std::vector<IPEndPoint> nameservers; |
40 // Suffix search list; used on first lookup when number of dots in given name | 40 // Suffix search list; used on first lookup when number of dots in given name |
41 // is less than |ndots|. | 41 // is less than |ndots|. |
| 42 // TODO(szym): Filter out duplicate entries from this list. |
42 std::vector<std::string> search; | 43 std::vector<std::string> search; |
43 | 44 |
44 DnsHosts hosts; | 45 DnsHosts hosts; |
45 | 46 |
46 // Resolver options; see man resolv.conf. | 47 // Resolver options; see man resolv.conf. |
47 // TODO(szym): use |ndots| and |search| to determine the sequence of FQDNs | |
48 // to query given a specific name. | |
49 // TODO(szym): implement DNS Devolution for windows | 48 // TODO(szym): implement DNS Devolution for windows |
50 | 49 |
51 // Minimum number of dots before global resolution precedes |search|. | 50 // Minimum number of dots before global resolution precedes |search|. |
52 int ndots; | 51 int ndots; |
53 // Time between retransmissions, see res_state.retrans. | 52 // Time between retransmissions, see res_state.retrans. |
54 base::TimeDelta timeout; | 53 base::TimeDelta timeout; |
55 // Maximum number of retries, see res_state.retry. | 54 // Maximum number of attempts, see res_state.retry. |
56 int attempts; | 55 int attempts; |
57 // Round robin entries in |nameservers| for subsequent requests. | 56 // Round robin entries in |nameservers| for subsequent requests. |
58 bool rotate; | 57 bool rotate; |
59 // Enable EDNS0 extensions. | 58 // Enable EDNS0 extensions. |
60 bool edns0; | 59 bool edns0; |
61 }; | 60 }; |
62 | 61 |
63 | 62 |
64 // Service for watching when the system DNS settings have changed. | 63 // Service for watching when the system DNS settings have changed. |
65 // Depending on the platform, watches files in /etc/ or win registry. | 64 // Depending on the platform, watches files in /etc/ or win registry. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Written in DoRead, read in OnReadFinished, no locking necessary. | 128 // Written in DoRead, read in OnReadFinished, no locking necessary. |
130 DnsHosts dns_hosts_; | 129 DnsHosts dns_hosts_; |
131 bool success_; | 130 bool success_; |
132 | 131 |
133 DISALLOW_COPY_AND_ASSIGN(DnsHostsReader); | 132 DISALLOW_COPY_AND_ASSIGN(DnsHostsReader); |
134 }; | 133 }; |
135 | 134 |
136 } // namespace net | 135 } // namespace net |
137 | 136 |
138 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ | 137 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ |
OLD | NEW |