Peter Qiu | c0beca5 | 2015-09-03 11:25:46 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2013 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 16 | |
| 17 | #ifndef SHILL_EAP_PROTOCOL_H_ |
| 18 | #define SHILL_EAP_PROTOCOL_H_ |
| 19 | |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 20 | #include <base/compiler_specific.h> |
| 21 | |
| 22 | namespace shill { |
| 23 | |
| 24 | namespace eap_protocol { |
| 25 | |
| 26 | struct ALIGNAS(1) Ieee8021xHdr { |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 27 | uint8_t version; |
| 28 | uint8_t type; |
| 29 | uint16_t length; |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | enum IeeeEapolVersion { |
Paul Stewart | 475ce5a | 2014-05-08 10:06:41 -0700 | [diff] [blame] | 33 | kIeee8021xEapolVersion1 = 1, |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 34 | kIeee8021xEapolVersion2 = 2 |
| 35 | }; |
| 36 | |
| 37 | enum IeeeEapolType { |
| 38 | kIIeee8021xTypeEapPacket = 0, |
| 39 | kIIeee8021xTypeEapolStart = 1, |
| 40 | kIIeee8021xTypeEapolLogoff = 2, |
| 41 | kIIeee8021xTypeEapolKey = 3, |
| 42 | kIIeee8021xTypeEapolEncapsulatedAsfAlert = 4 |
| 43 | }; |
| 44 | |
| 45 | struct ALIGNAS(1) EapHeader { |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 46 | uint8_t code; |
| 47 | uint8_t identifier; |
| 48 | uint16_t length; // including code and identifier; network byte order |
Paul Stewart | ac802ac | 2013-04-02 15:45:24 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | enum EapCode { |
| 52 | kEapCodeRequest = 1, |
| 53 | kEapCodeRespnose = 2, |
| 54 | kEapCodeSuccess = 3, |
| 55 | kEapCodeFailure = 4 |
| 56 | }; |
| 57 | |
| 58 | } // namespace eap_protocol |
| 59 | |
| 60 | } // namespace shill |
| 61 | |
| 62 | #endif // SHILL_EAP_PROTOCOL_H_ |