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

Side by Side Diff: net/dns/dns_response.h

Issue 10442098: [net/dns] Resolve AF_UNSPEC on dual-stacked systems. Sort addresses according to RFC3484. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle ifa_netmnask == NULL and other errors after getifaddrs. Created 8 years, 4 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) 2012 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_RESPONSE_H_ 5 #ifndef NET_DNS_DNS_RESPONSE_H_
6 #define NET_DNS_DNS_RESPONSE_H_ 6 #define NET_DNS_DNS_RESPONSE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const char* cur_; 74 const char* cur_;
75 }; 75 };
76 76
77 // Buffer-holder for the DNS response allowing easy access to the header fields 77 // Buffer-holder for the DNS response allowing easy access to the header fields
78 // and resource records. After reading into |io_buffer| must call InitParse to 78 // and resource records. After reading into |io_buffer| must call InitParse to
79 // position the RR parser. 79 // position the RR parser.
80 class NET_EXPORT_PRIVATE DnsResponse { 80 class NET_EXPORT_PRIVATE DnsResponse {
81 public: 81 public:
82 // Possible results from ParseToAddressList. 82 // Possible results from ParseToAddressList.
83 enum Result { 83 enum Result {
84 DNS_SUCCESS = 0, 84 DNS_PARSE_OK = 0,
85 DNS_MALFORMED_RESPONSE, // DnsRecordParser failed before the end of 85 DNS_MALFORMED_RESPONSE, // DnsRecordParser failed before the end of
86 // packet. 86 // packet.
87 DNS_MALFORMED_CNAME, // Could not parse CNAME out of RRDATA. 87 DNS_MALFORMED_CNAME, // Could not parse CNAME out of RRDATA.
88 DNS_NAME_MISMATCH, // Got an address but no ordered chain of CNAMEs 88 DNS_NAME_MISMATCH, // Got an address but no ordered chain of CNAMEs
89 // leads there. 89 // leads there.
90 DNS_SIZE_MISMATCH, // Got an address but size does not match. 90 DNS_SIZE_MISMATCH, // Got an address but size does not match.
91 DNS_CNAME_AFTER_ADDRESS, // Found CNAME after an address record. 91 DNS_CNAME_AFTER_ADDRESS, // Found CNAME after an address record.
92 DNS_ADDRESS_TTL_MISMATCH, // TTL of all address records are not identical. 92 DNS_ADDRESS_TTL_MISMATCH, // TTL of all address records are not identical.
93 DNS_NO_ADDRESSES, // No address records found. 93 DNS_NO_ADDRESSES, // No address records found.
94 // Only add new values here. 94 // Only add new values here.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // Iterator constructed after InitParse positioned at the answer section. 147 // Iterator constructed after InitParse positioned at the answer section.
148 // It is never updated afterwards, so can be used in accessors. 148 // It is never updated afterwards, so can be used in accessors.
149 DnsRecordParser parser_; 149 DnsRecordParser parser_;
150 150
151 DISALLOW_COPY_AND_ASSIGN(DnsResponse); 151 DISALLOW_COPY_AND_ASSIGN(DnsResponse);
152 }; 152 };
153 153
154 } // namespace net 154 } // namespace net
155 155
156 #endif // NET_DNS_DNS_RESPONSE_H_ 156 #endif // NET_DNS_DNS_RESPONSE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698