| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DNS_PROTOCOL_H_ | 5 #ifndef NET_DNS_DNS_PROTOCOL_H_ |
| 6 #define NET_DNS_DNS_PROTOCOL_H_ | 6 #define NET_DNS_DNS_PROTOCOL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| 11 | 11 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // / / | 68 // / / |
| 69 // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 69 // +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
| 70 | 70 |
| 71 #pragma pack(push) | 71 #pragma pack(push) |
| 72 #pragma pack(1) | 72 #pragma pack(1) |
| 73 | 73 |
| 74 // On-the-wire header. All uint16 are in network order. | 74 // On-the-wire header. All uint16 are in network order. |
| 75 // Used internally in DnsQuery and DnsResponseParser. | 75 // Used internally in DnsQuery and DnsResponseParser. |
| 76 struct NET_EXPORT_PRIVATE Header { | 76 struct NET_EXPORT_PRIVATE Header { |
| 77 uint16 id; | 77 uint16 id; |
| 78 uint8 flags[2]; | 78 uint16 flags; |
| 79 uint16 qdcount; | 79 uint16 qdcount; |
| 80 uint16 ancount; | 80 uint16 ancount; |
| 81 uint16 nscount; | 81 uint16 nscount; |
| 82 uint16 arcount; | 82 uint16 arcount; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 #pragma pack(pop) | 85 #pragma pack(pop) |
| 86 | 86 |
| 87 static const uint8 kLabelMask = 0xc0; | 87 static const uint8 kLabelMask = 0xc0; |
| 88 static const uint8 kLabelPointer = 0xc0; | 88 static const uint8 kLabelPointer = 0xc0; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 107 | 107 |
| 108 // DNS rcode values. | 108 // DNS rcode values. |
| 109 static const uint8 kRcodeMask = 0xf; | 109 static const uint8 kRcodeMask = 0xf; |
| 110 static const uint8 kRcodeNOERROR = 0; | 110 static const uint8 kRcodeNOERROR = 0; |
| 111 static const uint8 kRcodeFORMERR = 1; | 111 static const uint8 kRcodeFORMERR = 1; |
| 112 static const uint8 kRcodeSERVFAIL = 2; | 112 static const uint8 kRcodeSERVFAIL = 2; |
| 113 static const uint8 kRcodeNXDOMAIN = 3; | 113 static const uint8 kRcodeNXDOMAIN = 3; |
| 114 static const uint8 kRcodeNOTIMP = 4; | 114 static const uint8 kRcodeNOTIMP = 4; |
| 115 static const uint8 kRcodeREFUSED = 5; | 115 static const uint8 kRcodeREFUSED = 5; |
| 116 | 116 |
| 117 // DNS flags. |
| 118 static const uint16 kFlagResponse = 0x8000; |
| 119 static const uint16 kFlagRA = 0x80; |
| 120 static const uint16 kFlagRD = 0x100; |
| 121 static const uint16 kFlagTC = 0x200; |
| 122 static const uint16 kFlagAA = 0x400; |
| 123 |
| 117 } // namespace dns_protocol | 124 } // namespace dns_protocol |
| 118 | 125 |
| 119 } // namespace net | 126 } // namespace net |
| 120 | 127 |
| 121 #endif // NET_DNS_DNS_PROTOCOL_H_ | 128 #endif // NET_DNS_DNS_PROTOCOL_H_ |
| 122 | 129 |
| OLD | NEW |