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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 public: | 191 public: |
192 static const uint16_t kType = dns_protocol::kTypeNSEC; | 192 static const uint16_t kType = dns_protocol::kTypeNSEC; |
193 | 193 |
194 ~NsecRecordRdata() override; | 194 ~NsecRecordRdata() override; |
195 static std::unique_ptr<NsecRecordRdata> Create(const base::StringPiece& data, | 195 static std::unique_ptr<NsecRecordRdata> Create(const base::StringPiece& data, |
196 const DnsRecordParser& parser); | 196 const DnsRecordParser& parser); |
197 bool IsEqual(const RecordRdata* other) const override; | 197 bool IsEqual(const RecordRdata* other) const override; |
198 uint16_t Type() const override; | 198 uint16_t Type() const override; |
199 | 199 |
200 // Length of the bitmap in bits. | 200 // Length of the bitmap in bits. |
201 unsigned bitmap_length() const { return bitmap_.size() * 8; } | 201 uint16_t bitmap_length() const; |
202 | 202 |
203 // Returns bit i-th bit in the bitmap, where bits withing a byte are organized | 203 // Returns bit i-th bit in the bitmap, where bits withing a byte are organized |
204 // most to least significant. If it is set, a record with rrtype i exists for | 204 // most to least significant. If it is set, a record with rrtype i exists for |
205 // the domain name of this nsec record. | 205 // the domain name of this nsec record. |
206 bool GetBit(unsigned i) const; | 206 bool GetBit(unsigned i) const; |
207 | 207 |
208 private: | 208 private: |
209 NsecRecordRdata(); | 209 NsecRecordRdata(); |
210 | 210 |
211 std::vector<uint8_t> bitmap_; | 211 std::vector<uint8_t> bitmap_; |
212 | 212 |
213 DISALLOW_COPY_AND_ASSIGN(NsecRecordRdata); | 213 DISALLOW_COPY_AND_ASSIGN(NsecRecordRdata); |
214 }; | 214 }; |
215 | 215 |
216 | 216 |
217 } // namespace net | 217 } // namespace net |
218 | 218 |
219 #endif // NET_DNS_RECORD_RDATA_H_ | 219 #endif // NET_DNS_RECORD_RDATA_H_ |
OLD | NEW |