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 #include "net/dns/record_rdata.h" | 5 #include "net/dns/record_rdata.h" |
6 | 6 |
7 #include "base/big_endian.h" | 7 #include "base/big_endian.h" |
8 #include "net/base/dns_util.h" | 8 #include "net/base/dns_util.h" |
| 9 #include "net/base/ip_address_number.h" |
9 #include "net/dns/dns_protocol.h" | 10 #include "net/dns/dns_protocol.h" |
10 #include "net/dns/dns_response.h" | 11 #include "net/dns/dns_response.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 | 14 |
14 static const size_t kSrvRecordMinimumSize = 6; | 15 static const size_t kSrvRecordMinimumSize = 6; |
15 | 16 |
16 RecordRdata::RecordRdata() { | 17 RecordRdata::RecordRdata() { |
17 } | 18 } |
18 | 19 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 bool NsecRecordRdata::GetBit(unsigned i) const { | 279 bool NsecRecordRdata::GetBit(unsigned i) const { |
279 unsigned byte_num = i/8; | 280 unsigned byte_num = i/8; |
280 if (bitmap_.size() < byte_num + 1) | 281 if (bitmap_.size() < byte_num + 1) |
281 return false; | 282 return false; |
282 | 283 |
283 unsigned bit_num = 7 - i % 8; | 284 unsigned bit_num = 7 - i % 8; |
284 return (bitmap_[byte_num] & (1 << bit_num)) != 0; | 285 return (bitmap_[byte_num] & (1 << bit_num)) != 0; |
285 } | 286 } |
286 | 287 |
287 } // namespace net | 288 } // namespace net |
OLD | NEW |