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 // 16 17 #ifndef SHILL_EAP_PROTOCOL_H_ 18 #define SHILL_EAP_PROTOCOL_H_ 19 20 #include <base/compiler_specific.h> 21 22 namespace shill { 23 24 namespace eap_protocol { 25 26 struct ALIGNAS(1) Ieee8021xHdr { 27 uint8_t version; 28 uint8_t type; 29 uint16_t length; 30 }; 31 32 enum IeeeEapolVersion { 33 kIeee8021xEapolVersion1 = 1, 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 { 46 uint8_t code; 47 uint8_t identifier; 48 uint16_t length; // including code and identifier; network byte order 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_ 63