Index: net/dns/dns_response.h |
diff --git a/net/dns/dns_response.h b/net/dns/dns_response.h |
index ddd2c2089439ad47997ec4435982e9c4f0e9c207..7984a58f7450aba4ebeea59a4a0942812157c2f6 100644 |
--- a/net/dns/dns_response.h |
+++ b/net/dns/dns_response.h |
@@ -51,6 +51,9 @@ class NET_EXPORT_PRIVATE DnsRecordParser { |
// Returns |true| if no more bytes remain in the packet. |
bool AtEnd() const { return cur_ == packet_ + length_; } |
+ // Returns current offset into the packet. |
+ size_t offset() const { return cur_ - packet_; } |
+ |
// Parses a (possibly compressed) DNS name from the packet starting at |
// |pos|. Stores output (even partial) in |out| unless |out| is NULL. |out| |
// is stored in the dotted form, e.g., "example.com". Returns number of bytes |
@@ -92,11 +95,17 @@ class NET_EXPORT_PRIVATE DnsResponse { |
bool InitParse(int nbytes, const DnsQuery& query); |
// Accessors for the header. |
- uint8 flags0() const; // first byte of flags |
- uint8 flags1() const; // second byte of flags excluding rcode |
+ uint16 flags() const; // excluding rcode |
uint8 rcode() const; |
int answer_count() const; |
+ // Accessors to the question. The qname is unparsed. |
+ base::StringPiece qname() const; |
+ uint16 qtype() const; |
+ |
+ // Returns qname in dotted format. |
+ std::string GetDottedName() const; |
+ |
// Returns an iterator to the resource records in the answer section. Must be |
// called after InitParse. The iterator is valid only in the scope of the |
// DnsResponse. |