Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: net/base/dns_util.h

Issue 7008021: Added DnsQuery class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed issues cbentzel mentioned' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
34 // DNS resource record types. See 37 // DNS resource record types. See
35 // http://www.iana.org/assignments/dns-parameters 38 // http://www.iana.org/assignments/dns-parameters
36 // WARNING: if you're adding any new values here you may need to add them to 39 // WARNING: if you're adding any new values here you may need to add them to
37 // dnsrr_resolver.cc:DnsRRIsParsedByWindows. 40 // dnsrr_resolver.cc:DnsRRIsParsedByWindows.
38 41 static const uint16 kDNS_A = 1;
39 static const uint16 kDNS_CNAME = 5; 42 static const uint16 kDNS_CNAME = 5;
40 static const uint16 kDNS_TXT = 16; 43 static const uint16 kDNS_TXT = 16;
44 static const uint16 kDNS_AAAA = 28;
41 static const uint16 kDNS_CERT = 37; 45 static const uint16 kDNS_CERT = 37;
42 static const uint16 kDNS_DS = 43; 46 static const uint16 kDNS_DS = 43;
43 static const uint16 kDNS_RRSIG = 46; 47 static const uint16 kDNS_RRSIG = 46;
44 static const uint16 kDNS_DNSKEY = 48; 48 static const uint16 kDNS_DNSKEY = 48;
45 static const uint16 kDNS_ANY = 0xff; 49 static const uint16 kDNS_ANY = 0xff;
46 static const uint16 kDNS_CAA = 13172; // temporary, not IANA 50 static const uint16 kDNS_CAA = 13172; // temporary, not IANA
47 static const uint16 kDNS_TESTING = 0xfffe; // in private use area. 51 static const uint16 kDNS_TESTING = 0xfffe; // in private use area.
48 52
49 // http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml 53 // http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
50 static const uint8 kDNSSEC_RSA_SHA1 = 5; 54 static const uint8 kDNSSEC_RSA_SHA1 = 5;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 unsigned len_; 86 unsigned len_;
83 const unsigned packet_len_; 87 const unsigned packet_len_;
84 88
85 DISALLOW_COPY_AND_ASSIGN(DnsResponseBuffer); 89 DISALLOW_COPY_AND_ASSIGN(DnsResponseBuffer);
86 }; 90 };
87 91
88 92
89 } // namespace net 93 } // namespace net
90 94
91 #endif // NET_BASE_DNS_UTIL_H_ 95 #endif // NET_BASE_DNS_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698