ibss_rsn.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * wpa_supplicant - IBSS RSN
  3. * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef IBSS_RSN_H
  9. #define IBSS_RSN_H
  10. struct ibss_rsn;
  11. /* not authenticated */
  12. #define IBSS_RSN_AUTH_NOT_AUTHENTICATED 0x00
  13. /* remote peer sent an EAPOL message */
  14. #define IBSS_RSN_AUTH_EAPOL_BY_PEER 0x01
  15. /* we sent an AUTH message with seq 1 */
  16. #define IBSS_RSN_AUTH_BY_US 0x02
  17. /* we sent an EAPOL message */
  18. #define IBSS_RSN_AUTH_EAPOL_BY_US 0x04
  19. struct ibss_rsn_peer {
  20. struct ibss_rsn_peer *next;
  21. struct ibss_rsn *ibss_rsn;
  22. u8 addr[ETH_ALEN];
  23. struct wpa_sm *supp;
  24. enum wpa_states supp_state;
  25. u8 supp_ie[80];
  26. size_t supp_ie_len;
  27. struct wpa_state_machine *auth;
  28. int authentication_status;
  29. };
  30. struct ibss_rsn {
  31. struct wpa_supplicant *wpa_s;
  32. struct wpa_authenticator *auth_group;
  33. struct ibss_rsn_peer *peers;
  34. u8 psk[PMK_LEN];
  35. };
  36. struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s);
  37. void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn);
  38. int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr);
  39. void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac);
  40. int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
  41. const u8 *buf, size_t len);
  42. void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
  43. void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame,
  44. size_t len);
  45. #endif /* IBSS_RSN_H */