Add advice if a kernel config file cannot be found to remind people that
[dragonfly.git] / contrib / wpa_supplicant-0.4.9 / eap_tlv.h
1 /*
2  * WPA Supplicant / EAP-TLV (draft-josefsson-pppext-eap-tls-eap-07.txt)
3  * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #ifndef EAP_TLV_H
16 #define EAP_TLV_H
17
18 /* EAP-TLV TLVs (draft-josefsson-ppext-eap-tls-eap-07.txt) */
19 #define EAP_TLV_RESULT_TLV 3 /* Acknowledged Result */
20 #define EAP_TLV_NAK_TLV 4
21 #define EAP_TLV_CRYPTO_BINDING_TLV 5
22 #define EAP_TLV_CONNECTION_BINDING_TLV 6
23 #define EAP_TLV_VENDOR_SPECIFIC_TLV 7
24 #define EAP_TLV_URI_TLV 8
25 #define EAP_TLV_EAP_PAYLOAD_TLV 9
26 #define EAP_TLV_INTERMEDIATE_RESULT_TLV 10
27 #define EAP_TLV_PAC_TLV 11 /* draft-cam-winget-eap-fast-01.txt */
28 #define EAP_TLV_CRYPTO_BINDING_TLV_ 12 /* draft-cam-winget-eap-fast-01.txt */
29
30 #define EAP_TLV_RESULT_SUCCESS 1
31 #define EAP_TLV_RESULT_FAILURE 2
32
33 #define EAP_TLV_TYPE_MANDATORY 0x8000
34
35 struct eap_tlv_hdr {
36         u16 tlv_type;
37         u16 length;
38 };
39
40 struct eap_tlv_nak_tlv {
41         u16 tlv_type;
42         u16 length;
43         u32 vendor_id;
44         u16 nak_type;
45 } __attribute__((packed));
46
47 struct eap_tlv_result_tlv {
48         u16 tlv_type;
49         u16 length;
50         u16 status;
51 } __attribute__((packed));
52
53 struct eap_tlv_intermediate_result_tlv {
54         u16 tlv_type;
55         u16 length;
56         u16 status;
57 } __attribute__((packed));
58
59 struct eap_tlv_crypto_binding__tlv {
60         u16 tlv_type;
61         u16 length;
62         u8 reserved;
63         u8 version;
64         u8 received_version;
65         u8 subtype;
66         u8 nonce[32];
67         u8 compound_mac[20];
68 } __attribute__((packed));
69
70 struct eap_tlv_pac_ack_tlv {
71         u16 tlv_type;
72         u16 length;
73         u16 pac_type;
74         u16 pac_len;
75         u16 result;
76 } __attribute__((packed));
77
78 #define EAP_TLV_CRYPTO_BINDING_SUBTYPE_REQUEST 0
79 #define EAP_TLV_CRYPTO_BINDING_SUBTYPE_RESPONSE 1
80
81
82 u8 * eap_tlv_build_nak(int id, u16 nak_type, size_t *resp_len);
83 u8 * eap_tlv_build_result(int id, u16 status, size_t *resp_len);
84 int eap_tlv_process(struct eap_sm *sm, struct eap_method_ret *ret,
85                     const struct eap_hdr *hdr, u8 **resp, size_t *resp_len);
86
87 #endif /* EAP_TLV_H */