ieee802_1x.h

Go to the documentation of this file.
00001 
00016 #ifndef IEEE802_1X_H
00017 #define IEEE802_1X_H
00018 
00019 struct hostapd_data;
00020 struct sta_info;
00021 struct eapol_state_machine;
00022 struct hostapd_config;
00023 struct hostapd_bss_config;
00024 
00025 /* RFC 3580, 4. RC4 EAPOL-Key Frame */
00026 
00027 struct ieee802_1x_eapol_key {
00028         u8 type;
00029         u16 key_length;
00030         u8 replay_counter[8]; /* does not repeat within the life of the keying
00031                                * material used to encrypt the Key field;
00032                                * 64-bit NTP timestamp MAY be used here */
00033         u8 key_iv[16]; /* cryptographically random number */
00034         u8 key_index; /* key flag in the most significant bit:
00035                        * 0 = broadcast (default key),
00036                        * 1 = unicast (key mapping key); key index is in the
00037                        * 7 least significant bits */
00038         u8 key_signature[16]; /* HMAC-MD5 message integrity check computed with
00039                                * MS-MPPE-Send-Key as the key */
00040 
00041         /* followed by key: if packet body length = 44 + key length, then the
00042          * key field (of key_length bytes) contains the key in encrypted form;
00043          * if packet body length = 44, key field is absent and key_length
00044          * represents the number of least significant octets from
00045          * MS-MPPE-Send-Key attribute to be used as the keying material;
00046          * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
00047 } __attribute__ ((packed));
00048 
00049 
00050 void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
00051                         size_t len);
00052 void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta);
00053 void ieee802_1x_free_station(struct sta_info *sta);
00054 
00055 void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta);
00056 void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta);
00057 void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
00058                                    struct sta_info *sta, int authorized);
00059 void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta);
00060 int ieee802_1x_init(struct hostapd_data *hapd);
00061 void ieee802_1x_deinit(struct hostapd_data *hapd);
00062 int ieee802_1x_reconfig(struct hostapd_data *hapd,
00063                         struct hostapd_config *oldconf,
00064                         struct hostapd_bss_config *oldbss);
00065 int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
00066                          const u8 *buf, size_t len, int ack);
00067 u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len);
00068 u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len,
00069                                  int idx);
00070 const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
00071 void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
00072                                     int enabled);
00073 void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
00074                                   int valid);
00075 void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth);
00076 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
00077 int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
00078                            char *buf, size_t buflen);
00079 void hostapd_get_ntp_timestamp(u8 *buf);
00080 char *eap_type_text(u8 type);
00081 
00082 const char *radius_mode_txt(struct hostapd_data *hapd);
00083 int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
00084 
00085 #endif /* IEEE802_1X_H */
00086 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:16:48 2009 for hostapd by  doxygen 1.6.1