00001 /* 00002 * EAP-TLV definitions (draft-josefsson-pppext-eap-tls-eap-10.txt) 00003 * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation. 00008 * 00009 * Alternatively, this software may be distributed under the terms of BSD 00010 * license. 00011 * 00012 * See README and COPYING for more details. 00013 */ 00014 00015 #ifndef EAP_TLV_COMMON_H 00016 #define EAP_TLV_COMMON_H 00017 00018 /* EAP-TLV TLVs (draft-josefsson-ppext-eap-tls-eap-10.txt) */ 00019 #define EAP_TLV_RESULT_TLV 3 /* Acknowledged Result */ 00020 #define EAP_TLV_NAK_TLV 4 00021 #define EAP_TLV_ERROR_CODE_TLV 5 00022 #define EAP_TLV_CONNECTION_BINDING_TLV 6 00023 #define EAP_TLV_VENDOR_SPECIFIC_TLV 7 00024 #define EAP_TLV_URI_TLV 8 00025 #define EAP_TLV_EAP_PAYLOAD_TLV 9 00026 #define EAP_TLV_INTERMEDIATE_RESULT_TLV 10 00027 #define EAP_TLV_PAC_TLV 11 /* RFC 5422, Section 4.2 */ 00028 #define EAP_TLV_CRYPTO_BINDING_TLV 12 00029 #define EAP_TLV_CALLING_STATION_ID_TLV 13 00030 #define EAP_TLV_CALLED_STATION_ID_TLV 14 00031 #define EAP_TLV_NAS_PORT_TYPE_TLV 15 00032 #define EAP_TLV_SERVER_IDENTIFIER_TLV 16 00033 #define EAP_TLV_IDENTITY_TYPE_TLV 17 00034 #define EAP_TLV_SERVER_TRUSTED_ROOT_TLV 18 00035 #define EAP_TLV_REQUEST_ACTION_TLV 19 00036 #define EAP_TLV_PKCS7_TLV 20 00037 00038 #define EAP_TLV_RESULT_SUCCESS 1 00039 #define EAP_TLV_RESULT_FAILURE 2 00040 00041 #define EAP_TLV_TYPE_MANDATORY 0x8000 00042 #define EAP_TLV_TYPE_MASK 0x3fff 00043 00044 #ifdef _MSC_VER 00045 #pragma pack(push, 1) 00046 #endif /* _MSC_VER */ 00047 00048 struct eap_tlv_hdr { 00049 be16 tlv_type; 00050 be16 length; 00051 } STRUCT_PACKED; 00052 00053 struct eap_tlv_nak_tlv { 00054 be16 tlv_type; 00055 be16 length; 00056 be32 vendor_id; 00057 be16 nak_type; 00058 } STRUCT_PACKED; 00059 00060 struct eap_tlv_result_tlv { 00061 be16 tlv_type; 00062 be16 length; 00063 be16 status; 00064 } STRUCT_PACKED; 00065 00066 /* RFC 4851, Section 4.2.7 - Intermediate-Result TLV */ 00067 struct eap_tlv_intermediate_result_tlv { 00068 be16 tlv_type; 00069 be16 length; 00070 be16 status; 00071 /* Followed by optional TLVs */ 00072 } STRUCT_PACKED; 00073 00074 /* RFC 4851, Section 4.2.8 - Crypto-Binding TLV */ 00075 struct eap_tlv_crypto_binding_tlv { 00076 be16 tlv_type; 00077 be16 length; 00078 u8 reserved; 00079 u8 version; 00080 u8 received_version; 00081 u8 subtype; 00082 u8 nonce[32]; 00083 u8 compound_mac[20]; 00084 } STRUCT_PACKED; 00085 00086 struct eap_tlv_pac_ack_tlv { 00087 be16 tlv_type; 00088 be16 length; 00089 be16 pac_type; 00090 be16 pac_len; 00091 be16 result; 00092 } STRUCT_PACKED; 00093 00094 /* RFC 4851, Section 4.2.9 - Request-Action TLV */ 00095 struct eap_tlv_request_action_tlv { 00096 be16 tlv_type; 00097 be16 length; 00098 be16 action; 00099 } STRUCT_PACKED; 00100 00101 /* RFC 5422, Section 4.2.6 - PAC-Type TLV */ 00102 struct eap_tlv_pac_type_tlv { 00103 be16 tlv_type; /* PAC_TYPE_PAC_TYPE */ 00104 be16 length; 00105 be16 pac_type; 00106 } STRUCT_PACKED; 00107 00108 #ifdef _MSC_VER 00109 #pragma pack(pop) 00110 #endif /* _MSC_VER */ 00111 00112 #define EAP_TLV_CRYPTO_BINDING_SUBTYPE_REQUEST 0 00113 #define EAP_TLV_CRYPTO_BINDING_SUBTYPE_RESPONSE 1 00114 00115 #define EAP_TLV_ACTION_PROCESS_TLV 1 00116 #define EAP_TLV_ACTION_NEGOTIATE_EAP 2 00117 00118 #endif /* EAP_TLV_COMMON_H */