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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_RECORD_RDATA_H_ 5 #ifndef NET_DNS_RECORD_RDATA_H_
6 #define NET_DNS_RECORD_RDATA_H_ 6 #define NET_DNS_RECORD_RDATA_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 const std::vector<std::string>& texts() const { return texts_; } 174 const std::vector<std::string>& texts() const { return texts_; }
175 175
176 private: 176 private:
177 TxtRecordRdata(); 177 TxtRecordRdata();
178 178
179 std::vector<std::string> texts_; 179 std::vector<std::string> texts_;
180 180
181 DISALLOW_COPY_AND_ASSIGN(TxtRecordRdata); 181 DISALLOW_COPY_AND_ASSIGN(TxtRecordRdata);
182 }; 182 };
183 183
184 // Only the subset of the NSEC record format required by mDNS is supported.
185 // Nsec record format is described in http://www.ietf.org/rfc/rfc3845.txt and
186 // the limited version required for mDNS described in
187 // http://www.rfc-editor.org/rfc/rfc6762.txt Section 6.1.
188 class NET_EXPORT_PRIVATE NsecRecordRdata : public RecordRdata {
189 public:
190 static const uint16 kType = dns_protocol::kTypeNSEC;
191
192 virtual ~NsecRecordRdata();
193 static scoped_ptr<NsecRecordRdata> Create(const base::StringPiece& data,
194 const DnsRecordParser& parser);
195 virtual bool IsEqual(const RecordRdata* other) const OVERRIDE;
196 virtual uint16 Type() const OVERRIDE;
197
198 // Length of the bitmap in bits.
199 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.
200
201 // Returns bit i-th bit in the bitmap, where bits withing a byte are organized
202 // most to least significant. If it is set, a record with rrtype i exists for
203 // the domain name of this nsec record.
204 bool GetBit(unsigned i);
205
206 private:
207 NsecRecordRdata();
208
209 std::vector<uint8> bitmap_;
210
211 DISALLOW_COPY_AND_ASSIGN(NsecRecordRdata);
212 };
213
214
184 } // namespace net 215 } // namespace net
185 216
186 #endif // NET_DNS_RECORD_RDATA_H_ 217 #endif // NET_DNS_RECORD_RDATA_H_
OLDNEW
« 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