Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 (limited) record format (http://www.ietf.org/rfc/rfc3845.txt and | |
| 186 // http://www.rfc-editor.org/rfc/rfc6762.txt): | |
| 187 // next-domain (ignored): A domain name. | |
| 188 // 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.
| |
| 189 // - one byte zeroed out to represent the zeroth window | |
| 190 // - one byte from 0-32 representing the length of the bitmap in bytes | |
| 191 // - the bitmap, each bit representing whether or not the record | |
| 192 // corresponding to the bit number exists for that domain. | |
| 193 class NET_EXPORT_PRIVATE NsecRecordRdata : public RecordRdata { | |
| 194 public: | |
| 195 static const uint16 kType = dns_protocol::kTypeNSEC; | |
| 196 | |
| 197 virtual ~NsecRecordRdata(); | |
| 198 static scoped_ptr<NsecRecordRdata> Create(const base::StringPiece& data, | |
| 199 const DnsRecordParser& parser); | |
| 200 virtual bool IsEqual(const RecordRdata* other) const OVERRIDE; | |
| 201 virtual uint16 Type() const OVERRIDE; | |
| 202 | |
| 203 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
| |
| 204 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.
| |
| 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_ |
| OLD | NEW |