nl80211: Fix a typo
[hostap-gosc2009.git] / src / ap / ieee802_1x.h
blobe7be41bb543b8bbb3297fd1bda0ce7e0e6ed48af
1 /*
2 * hostapd / IEEE 802.1X-2004 Authenticator
3 * Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef IEEE802_1X_H
16 #define IEEE802_1X_H
18 struct hostapd_data;
19 struct sta_info;
20 struct eapol_state_machine;
21 struct hostapd_config;
22 struct hostapd_bss_config;
24 /* RFC 3580, 4. RC4 EAPOL-Key Frame */
26 struct ieee802_1x_eapol_key {
27 u8 type;
28 u16 key_length;
29 u8 replay_counter[8]; /* does not repeat within the life of the keying
30 * material used to encrypt the Key field;
31 * 64-bit NTP timestamp MAY be used here */
32 u8 key_iv[16]; /* cryptographically random number */
33 u8 key_index; /* key flag in the most significant bit:
34 * 0 = broadcast (default key),
35 * 1 = unicast (key mapping key); key index is in the
36 * 7 least significant bits */
37 u8 key_signature[16]; /* HMAC-MD5 message integrity check computed with
38 * MS-MPPE-Send-Key as the key */
40 /* followed by key: if packet body length = 44 + key length, then the
41 * key field (of key_length bytes) contains the key in encrypted form;
42 * if packet body length = 44, key field is absent and key_length
43 * represents the number of least significant octets from
44 * MS-MPPE-Send-Key attribute to be used as the keying material;
45 * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
46 } __attribute__ ((packed));
49 void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
50 size_t len);
51 void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta);
52 void ieee802_1x_free_station(struct sta_info *sta);
54 void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta);
55 void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta);
56 void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
57 struct sta_info *sta, int authorized);
58 void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta);
59 int ieee802_1x_init(struct hostapd_data *hapd);
60 void ieee802_1x_deinit(struct hostapd_data *hapd);
61 int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
62 const u8 *buf, size_t len, int ack);
63 u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len);
64 u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len,
65 int idx);
66 const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
67 void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
68 int enabled);
69 void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
70 int valid);
71 void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth);
72 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
73 int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
74 char *buf, size_t buflen);
75 void hostapd_get_ntp_timestamp(u8 *buf);
76 char *eap_type_text(u8 type);
78 const char *radius_mode_txt(struct hostapd_data *hapd);
79 int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
81 #endif /* IEEE802_1X_H */