ibss_rsn.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. /* PTK derived as supplicant */
  20. #define IBSS_RSN_SET_PTK_SUPP 0x08
  21. /* PTK derived as authenticator */
  22. #define IBSS_RSN_SET_PTK_AUTH 0x10
  23. /* PTK completion reported */
  24. #define IBSS_RSN_REPORTED_PTK 0x20
  25. struct ibss_rsn_peer {
  26. struct ibss_rsn_peer *next;
  27. struct ibss_rsn *ibss_rsn;
  28. u8 addr[ETH_ALEN];
  29. struct wpa_sm *supp;
  30. enum wpa_states supp_state;
  31. u8 supp_ie[80];
  32. size_t supp_ie_len;
  33. struct wpa_state_machine *auth;
  34. int authentication_status;
  35. struct os_reltime own_auth_tx;
  36. };
  37. struct ibss_rsn {
  38. struct wpa_supplicant *wpa_s;
  39. struct wpa_authenticator *auth_group;
  40. struct ibss_rsn_peer *peers;
  41. u8 psk[PMK_LEN];
  42. };
  43. struct ibss_rsn * ibss_rsn_init(struct wpa_supplicant *wpa_s,
  44. struct wpa_ssid *ssid);
  45. void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn);
  46. int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr);
  47. void ibss_rsn_stop(struct ibss_rsn *ibss_rsn, const u8 *peermac);
  48. int ibss_rsn_rx_eapol(struct ibss_rsn *ibss_rsn, const u8 *src_addr,
  49. const u8 *buf, size_t len);
  50. void ibss_rsn_set_psk(struct ibss_rsn *ibss_rsn, const u8 *psk);
  51. void ibss_rsn_handle_auth(struct ibss_rsn *ibss_rsn, const u8 *auth_frame,
  52. size_t len);
  53. #endif /* IBSS_RSN_H */