supplicant.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * binder interface for wpa_supplicant daemon
  3. * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
  4. * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
  5. *
  6. * This software may be distributed under the terms of the BSD license.
  7. * See README for more details.
  8. */
  9. #ifndef WPA_SUPPLICANT_BINDER_SUPPLICANT_H
  10. #define WPA_SUPPLICANT_BINDER_SUPPLICANT_H
  11. #include "fi/w1/wpa_supplicant/BnSupplicant.h"
  12. #include "fi/w1/wpa_supplicant/IIface.h"
  13. #include "fi/w1/wpa_supplicant/ISupplicantCallbacks.h"
  14. extern "C" {
  15. #include "utils/common.h"
  16. #include "utils/includes.h"
  17. #include "../wpa_supplicant_i.h"
  18. }
  19. namespace wpa_supplicant_binder {
  20. /**
  21. * Implementation of the supplicant binder object. This binder
  22. * object is used core for global control operations on
  23. * wpa_supplicant.
  24. */
  25. class Supplicant : public fi::w1::wpa_supplicant::BnSupplicant
  26. {
  27. public:
  28. Supplicant(struct wpa_global *global);
  29. virtual ~Supplicant() = default;
  30. android::binder::Status CreateInterface(
  31. const android::os::PersistableBundle &params,
  32. android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
  33. android::binder::Status
  34. RemoveInterface(const std::string &ifname) override;
  35. android::binder::Status GetInterface(
  36. const std::string &ifname,
  37. android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return) override;
  38. private:
  39. /* Raw pointer to the global structure maintained by the core. */
  40. struct wpa_global *wpa_global_;
  41. /* All the callback objects registered by the clients. */
  42. std::vector<android::sp<fi::w1::wpa_supplicant::ISupplicantCallbacks>>
  43. callbacks_;
  44. };
  45. } /* namespace wpa_supplicant_binder */
  46. #endif /* WPA_SUPPLICANT_BINDER_SUPPLICANT_H */