supplicant.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 SUPPLICANT_H
  10. #define 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/includes.h"
  16. #include "utils/common.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)
  33. override;
  34. android::binder::Status RemoveInterface(
  35. const std::string &ifname) override;
  36. android::binder::Status GetInterface(
  37. const std::string &ifname,
  38. android::sp<fi::w1::wpa_supplicant::IIface> *aidl_return)
  39. override;
  40. private:
  41. /* Raw pointer to the global structure maintained by the core. */
  42. struct wpa_global *wpa_global_;
  43. /* All the callback objects registered by the clients. */
  44. std::vector<android::sp<fi::w1::wpa_supplicant::ISupplicantCallbacks>>
  45. callbacks_;
  46. };
  47. } /* namespace wpa_supplicant_binder */
  48. #endif /* SUPPLICANT_H */