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 | |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 8 | #include <base/compiler_specific.h> |
| 9 | |
| 10 | namespace shill { |
| 11 | |
| 12 | namespace eap_protocol { |
| 13 | |
| 14 | struct ALIGNAS(1) Ieee8021xHdr { |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 15 | uint8_t version; |
| 16 | uint8_t type; |
| 17 | uint16_t length; |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 18 | }; |
| 19 | |
| 20 | enum IeeeEapolVersion { |
Paul Stewart | 475ce5a | 2014-05-08 10:06:41 -0700 | [diff] [blame] | 21 | kIeee8021xEapolVersion1 = 1, |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 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 { |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 34 | uint8_t code; |
| 35 | uint8_t identifier; |
| 36 | uint16_t length; // including code and identifier; network byte order |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 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_ |