OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_DNS_UTIL_H_ | 5 #ifndef NET_BASE_DNS_UTIL_H_ |
6 #define NET_BASE_DNS_UTIL_H_ | 6 #define NET_BASE_DNS_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // DNSDomainToString coverts a domain in DNS format to a dotted string. | 24 // DNSDomainToString coverts a domain in DNS format to a dotted string. |
25 NET_TEST std::string DNSDomainToString(const std::string& domain); | 25 NET_TEST std::string DNSDomainToString(const std::string& domain); |
26 | 26 |
27 // Returns true iff the given character is in the set of valid DNS label | 27 // Returns true iff the given character is in the set of valid DNS label |
28 // characters as given in RFC 3490, 4.1, 3(a) | 28 // characters as given in RFC 3490, 4.1, 3(a) |
29 NET_TEST bool IsSTD3ASCIIValidCharacter(char c); | 29 NET_TEST bool IsSTD3ASCIIValidCharacter(char c); |
30 | 30 |
31 // Returns the hostname by trimming the ending dot, if one exists. | 31 // Returns the hostname by trimming the ending dot, if one exists. |
32 NET_API std::string TrimEndingDot(const std::string& host); | 32 NET_API std::string TrimEndingDot(const std::string& host); |
33 | 33 |
34 // DNS class types. | |
35 static const uint16 kClassIN = 1; | |
36 | |
37 // DNS resource record types. See | 34 // DNS resource record types. See |
38 // http://www.iana.org/assignments/dns-parameters | 35 // http://www.iana.org/assignments/dns-parameters |
39 // WARNING: if you're adding any new values here you may need to add them to | 36 // WARNING: if you're adding any new values here you may need to add them to |
40 // dnsrr_resolver.cc:DnsRRIsParsedByWindows. | 37 // dnsrr_resolver.cc:DnsRRIsParsedByWindows. |
41 static const uint16 kDNS_A = 1; | 38 |
42 static const uint16 kDNS_CNAME = 5; | 39 static const uint16 kDNS_CNAME = 5; |
43 static const uint16 kDNS_TXT = 16; | 40 static const uint16 kDNS_TXT = 16; |
44 static const uint16 kDNS_AAAA = 28; | |
45 static const uint16 kDNS_CERT = 37; | 41 static const uint16 kDNS_CERT = 37; |
46 static const uint16 kDNS_DS = 43; | 42 static const uint16 kDNS_DS = 43; |
47 static const uint16 kDNS_RRSIG = 46; | 43 static const uint16 kDNS_RRSIG = 46; |
48 static const uint16 kDNS_DNSKEY = 48; | 44 static const uint16 kDNS_DNSKEY = 48; |
49 static const uint16 kDNS_ANY = 0xff; | 45 static const uint16 kDNS_ANY = 0xff; |
50 static const uint16 kDNS_CAA = 257; | 46 static const uint16 kDNS_CAA = 257; |
51 static const uint16 kDNS_TESTING = 0xfffe; // in private use area. | 47 static const uint16 kDNS_TESTING = 0xfffe; // in private use area. |
52 | 48 |
53 // http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml | 49 // http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml |
54 static const uint8 kDNSSEC_RSA_SHA1 = 5; | 50 static const uint8 kDNSSEC_RSA_SHA1 = 5; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 unsigned len_; | 82 unsigned len_; |
87 const unsigned packet_len_; | 83 const unsigned packet_len_; |
88 | 84 |
89 DISALLOW_COPY_AND_ASSIGN(DnsResponseBuffer); | 85 DISALLOW_COPY_AND_ASSIGN(DnsResponseBuffer); |
90 }; | 86 }; |
91 | 87 |
92 | 88 |
93 } // namespace net | 89 } // namespace net |
94 | 90 |
95 #endif // NET_BASE_DNS_UTIL_H_ | 91 #endif // NET_BASE_DNS_UTIL_H_ |
OLD | NEW |