blob: 42b5499866b5b807ea88b1ccea0c248c77547e95 [file] [log] [blame]
Paul Stewartac802ac2013-04-02 15:45:24 -07001// 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 Stewartac802ac2013-04-02 15:45:24 -07008#include <base/compiler_specific.h>
9
10namespace shill {
11
12namespace eap_protocol {
13
14struct ALIGNAS(1) Ieee8021xHdr {
Ben Chan7fab8972014-08-10 17:14:46 -070015 uint8_t version;
16 uint8_t type;
17 uint16_t length;
Paul Stewartac802ac2013-04-02 15:45:24 -070018};
19
20enum IeeeEapolVersion {
Paul Stewart475ce5a2014-05-08 10:06:41 -070021 kIeee8021xEapolVersion1 = 1,
Paul Stewartac802ac2013-04-02 15:45:24 -070022 kIeee8021xEapolVersion2 = 2
23};
24
25enum IeeeEapolType {
26 kIIeee8021xTypeEapPacket = 0,
27 kIIeee8021xTypeEapolStart = 1,
28 kIIeee8021xTypeEapolLogoff = 2,
29 kIIeee8021xTypeEapolKey = 3,
30 kIIeee8021xTypeEapolEncapsulatedAsfAlert = 4
31};
32
33struct ALIGNAS(1) EapHeader {
Ben Chan7fab8972014-08-10 17:14:46 -070034 uint8_t code;
35 uint8_t identifier;
36 uint16_t length; // including code and identifier; network byte order
Paul Stewartac802ac2013-04-02 15:45:24 -070037};
38
39enum 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_