Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SHILL_EAP_PROTOCOL_H_ |
| 6 | #define SHILL_EAP_PROTOCOL_H_ |
| 7 | |
| 8 | #include <base/basictypes.h> |
| 9 | #include <base/compiler_specific.h> |
| 10 | |
| 11 | namespace shill { |
| 12 | |
| 13 | namespace eap_protocol { |
| 14 | |
| 15 | struct ALIGNAS(1) Ieee8021xHdr { |
| 16 | uint8 version; |
| 17 | uint8 type; |
| 18 | uint16 length; |
| 19 | }; |
| 20 | |
| 21 | enum IeeeEapolVersion { |
| 22 | kIeee8021xEapolVersion2 = 2 |
| 23 | }; |
| 24 | |
| 25 | enum IeeeEapolType { |
| 26 | kIIeee8021xTypeEapPacket = 0, |
| 27 | kIIeee8021xTypeEapolStart = 1, |
| 28 | kIIeee8021xTypeEapolLogoff = 2, |
| 29 | kIIeee8021xTypeEapolKey = 3, |
| 30 | kIIeee8021xTypeEapolEncapsulatedAsfAlert = 4 |
| 31 | }; |
| 32 | |
| 33 | struct ALIGNAS(1) EapHeader { |
| 34 | uint8 code; |
| 35 | uint8 identifier; |
| 36 | uint16 length; // including code and identifier; network byte order |
| 37 | }; |
| 38 | |
| 39 | enum EapCode { |
| 40 | kEapCodeRequest = 1, |
| 41 | kEapCodeRespnose = 2, |
| 42 | kEapCodeSuccess = 3, |
| 43 | kEapCodeFailure = 4 |
| 44 | }; |
| 45 | |
| 46 | } // namespace eap_protocol |
| 47 | |
| 48 | } // namespace shill |
| 49 | |
| 50 | #endif // SHILL_EAP_PROTOCOL_H_ |