Chromium Code Reviews| Index: net/dns/record_rdata.h |
| diff --git a/net/dns/record_rdata.h b/net/dns/record_rdata.h |
| index 13a2b1e35ae284f5d256af895a7156a5f0fc4c68..8ff5c2eea10ed9b98244f6c5f95a9ea4fe9a0158 100644 |
| --- a/net/dns/record_rdata.h |
| +++ b/net/dns/record_rdata.h |
| @@ -181,6 +181,37 @@ class NET_EXPORT_PRIVATE TxtRecordRdata : public RecordRdata { |
| DISALLOW_COPY_AND_ASSIGN(TxtRecordRdata); |
| }; |
| +// Only the subset of the NSEC record format required by mDNS is supported. |
| +// Nsec record format is described in http://www.ietf.org/rfc/rfc3845.txt and |
| +// the limited version required for mDNS described in |
| +// http://www.rfc-editor.org/rfc/rfc6762.txt Section 6.1. |
| +class NET_EXPORT_PRIVATE NsecRecordRdata : public RecordRdata { |
| + public: |
| + static const uint16 kType = dns_protocol::kTypeNSEC; |
| + |
| + virtual ~NsecRecordRdata(); |
| + static scoped_ptr<NsecRecordRdata> Create(const base::StringPiece& data, |
| + const DnsRecordParser& parser); |
| + virtual bool IsEqual(const RecordRdata* other) const OVERRIDE; |
| + virtual uint16 Type() const OVERRIDE; |
| + |
| + // Length of the bitmap in bits. |
| + const unsigned bitmap_length() { return bitmap_.size() * 8; } |
|
szym
2013/06/25 01:40:57
I think you meant to put the const after ()
Noam Samuel
2013/06/25 01:58:41
Done.
|
| + |
| + // Returns bit i-th bit in the bitmap, where bits withing a byte are organized |
| + // most to least significant. If it is set, a record with rrtype i exists for |
| + // the domain name of this nsec record. |
| + bool GetBit(unsigned i); |
| + |
| + private: |
| + NsecRecordRdata(); |
| + |
| + std::vector<uint8> bitmap_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NsecRecordRdata); |
| +}; |
| + |
| + |
| } // namespace net |
| #endif // NET_DNS_RECORD_RDATA_H_ |