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

Unified Diff: net/dns/record_rdata.h

Issue 17143006: Limited NSEC support to RecordParsed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mdns_transaction_cleanup
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: net/dns/record_rdata.h
diff --git a/net/dns/record_rdata.h b/net/dns/record_rdata.h
index 13a2b1e35ae284f5d256af895a7156a5f0fc4c68..fe065d8f4d7079f5c6497dff4b6560f793be2f1a 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 (limited) record format (http://www.ietf.org/rfc/rfc3845.txt and
+// http://www.rfc-editor.org/rfc/rfc6762.txt):
+// next-domain (ignored): A domain name.
+// one bit-map:
szym 2013/06/24 21:50:28 The formatting suggests variable names, but they a
Noam Samuel 2013/06/25 01:31:31 Done.
+// - one byte zeroed out to represent the zeroth window
+// - one byte from 0-32 representing the length of the bitmap in bytes
+// - the bitmap, each bit representing whether or not the record
+// corresponding to the bit number exists for that domain.
+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;
+
+ const std::vector<uint8>& bitmap() { return bitmap_; }
szym 2013/06/24 21:50:28 Do you need to expose both bitmap and bit?
Noam Samuel 2013/06/25 01:15:35 The main use case for exposing bitmap is to allow
+ bool bit(unsigned i);
gene 2013/06/24 19:47:16 could you please add comment describing what bit()
Noam Samuel 2013/06/24 21:31:30 Done.
+
+ private:
+ NsecRecordRdata();
+
+ std::vector<uint8> bitmap_;
+
+ DISALLOW_COPY_AND_ASSIGN(NsecRecordRdata);
+};
+
+
} // namespace net
#endif // NET_DNS_RECORD_RDATA_H_
« no previous file with comments | « net/dns/record_parsed.cc ('k') | net/dns/record_rdata.cc » ('j') | net/dns/record_rdata.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698