blob: 5a47a591361fd6e44e1b8dd294fdcb1d85c2331a [file] [log] [blame]
Peter Qiuc0beca52015-09-03 11:25:46 -07001//
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 Stewartac802ac2013-04-02 15:45:24 -070016
17#ifndef SHILL_EAP_PROTOCOL_H_
18#define SHILL_EAP_PROTOCOL_H_
19
Paul Stewartac802ac2013-04-02 15:45:24 -070020#include <base/compiler_specific.h>
21
22namespace shill {
23
24namespace eap_protocol {
25
26struct ALIGNAS(1) Ieee8021xHdr {
Ben Chan7fab8972014-08-10 17:14:46 -070027 uint8_t version;
28 uint8_t type;
29 uint16_t length;
Paul Stewartac802ac2013-04-02 15:45:24 -070030};
31
32enum IeeeEapolVersion {
Paul Stewart475ce5a2014-05-08 10:06:41 -070033 kIeee8021xEapolVersion1 = 1,
Paul Stewartac802ac2013-04-02 15:45:24 -070034 kIeee8021xEapolVersion2 = 2
35};
36
37enum IeeeEapolType {
38 kIIeee8021xTypeEapPacket = 0,
39 kIIeee8021xTypeEapolStart = 1,
40 kIIeee8021xTypeEapolLogoff = 2,
41 kIIeee8021xTypeEapolKey = 3,
42 kIIeee8021xTypeEapolEncapsulatedAsfAlert = 4
43};
44
45struct ALIGNAS(1) EapHeader {
Ben Chan7fab8972014-08-10 17:14:46 -070046 uint8_t code;
47 uint8_t identifier;
48 uint16_t length; // including code and identifier; network byte order
Paul Stewartac802ac2013-04-02 15:45:24 -070049};
50
51enum 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_