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
12 * See README and COPYING for more details.
20 struct eapol_state_machine
;
21 struct hostapd_config
;
22 struct hostapd_bss_config
;
28 /* RFC 3580, 4. RC4 EAPOL-Key Frame */
30 struct ieee802_1x_eapol_key
{
33 u8 replay_counter
[8]; /* does not repeat within the life of the keying
34 * material used to encrypt the Key field;
35 * 64-bit NTP timestamp MAY be used here */
36 u8 key_iv
[16]; /* cryptographically random number */
37 u8 key_index
; /* key flag in the most significant bit:
38 * 0 = broadcast (default key),
39 * 1 = unicast (key mapping key); key index is in the
40 * 7 least significant bits */
41 u8 key_signature
[16]; /* HMAC-MD5 message integrity check computed with
42 * MS-MPPE-Send-Key as the key */
44 /* followed by key: if packet body length = 44 + key length, then the
45 * key field (of key_length bytes) contains the key in encrypted form;
46 * if packet body length = 44, key field is absent and key_length
47 * represents the number of least significant octets from
48 * MS-MPPE-Send-Key attribute to be used as the keying material;
49 * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
57 void ieee802_1x_receive(struct hostapd_data
*hapd
, const u8
*sa
, const u8
*buf
,
59 void ieee802_1x_new_station(struct hostapd_data
*hapd
, struct sta_info
*sta
);
60 void ieee802_1x_free_station(struct sta_info
*sta
);
62 void ieee802_1x_tx_key(struct hostapd_data
*hapd
, struct sta_info
*sta
);
63 void ieee802_1x_abort_auth(struct hostapd_data
*hapd
, struct sta_info
*sta
);
64 void ieee802_1x_set_sta_authorized(struct hostapd_data
*hapd
,
65 struct sta_info
*sta
, int authorized
);
66 void ieee802_1x_dump_state(FILE *f
, const char *prefix
, struct sta_info
*sta
);
67 int ieee802_1x_init(struct hostapd_data
*hapd
);
68 void ieee802_1x_deinit(struct hostapd_data
*hapd
);
69 int ieee802_1x_tx_status(struct hostapd_data
*hapd
, struct sta_info
*sta
,
70 const u8
*buf
, size_t len
, int ack
);
71 u8
* ieee802_1x_get_identity(struct eapol_state_machine
*sm
, size_t *len
);
72 u8
* ieee802_1x_get_radius_class(struct eapol_state_machine
*sm
, size_t *len
,
74 const u8
* ieee802_1x_get_key(struct eapol_state_machine
*sm
, size_t *len
);
75 void ieee802_1x_notify_port_enabled(struct eapol_state_machine
*sm
,
77 void ieee802_1x_notify_port_valid(struct eapol_state_machine
*sm
,
79 void ieee802_1x_notify_pre_auth(struct eapol_state_machine
*sm
, int pre_auth
);
80 int ieee802_1x_get_mib(struct hostapd_data
*hapd
, char *buf
, size_t buflen
);
81 int ieee802_1x_get_mib_sta(struct hostapd_data
*hapd
, struct sta_info
*sta
,
82 char *buf
, size_t buflen
);
83 void hostapd_get_ntp_timestamp(u8
*buf
);
84 char *eap_type_text(u8 type
);
86 const char *radius_mode_txt(struct hostapd_data
*hapd
);
87 int radius_sta_rate(struct hostapd_data
*hapd
, struct sta_info
*sta
);
89 #endif /* IEEE802_1X_H */