| OLD | NEW |
| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool InitParseWithoutQuery(int nbytes); | 123 bool InitParseWithoutQuery(int nbytes); |
| 124 | 124 |
| 125 // Returns true if response is valid, that is, after successful InitParse. | 125 // Returns true if response is valid, that is, after successful InitParse. |
| 126 bool IsValid() const; | 126 bool IsValid() const; |
| 127 | 127 |
| 128 // All of the methods below are valid only if the response is valid. | 128 // All of the methods below are valid only if the response is valid. |
| 129 | 129 |
| 130 // Accessors for the header. | 130 // Accessors for the header. |
| 131 uint16 flags() const; // excluding rcode | 131 uint16 flags() const; // excluding rcode |
| 132 uint8 rcode() const; | 132 uint8 rcode() const; |
| 133 |
| 133 unsigned answer_count() const; | 134 unsigned answer_count() const; |
| 135 unsigned additional_answer_count() const; |
| 134 | 136 |
| 135 // Accessors to the question. The qname is unparsed. | 137 // Accessors to the question. The qname is unparsed. |
| 136 base::StringPiece qname() const; | 138 base::StringPiece qname() const; |
| 137 uint16 qtype() const; | 139 uint16 qtype() const; |
| 138 | 140 |
| 139 // Returns qname in dotted format. | 141 // Returns qname in dotted format. |
| 140 std::string GetDottedName() const; | 142 std::string GetDottedName() const; |
| 141 | 143 |
| 142 // Returns an iterator to the resource records in the answer section. | 144 // Returns an iterator to the resource records in the answer section. |
| 143 // The iterator is valid only in the scope of the DnsResponse. | 145 // The iterator is valid only in the scope of the DnsResponse. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 158 // Iterator constructed after InitParse positioned at the answer section. | 160 // Iterator constructed after InitParse positioned at the answer section. |
| 159 // It is never updated afterwards, so can be used in accessors. | 161 // It is never updated afterwards, so can be used in accessors. |
| 160 DnsRecordParser parser_; | 162 DnsRecordParser parser_; |
| 161 | 163 |
| 162 DISALLOW_COPY_AND_ASSIGN(DnsResponse); | 164 DISALLOW_COPY_AND_ASSIGN(DnsResponse); |
| 163 }; | 165 }; |
| 164 | 166 |
| 165 } // namespace net | 167 } // namespace net |
| 166 | 168 |
| 167 #endif // NET_DNS_DNS_RESPONSE_H_ | 169 #endif // NET_DNS_DNS_RESPONSE_H_ |
| OLD | NEW |