Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * WPA Supplicant / dbus-based control interface
  3. * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef CTRL_IFACE_DBUS_H
  15. #define CTRL_IFACE_DBUS_H
  16. struct wps_credential;
  17. #ifdef CONFIG_CTRL_IFACE_DBUS
  18. #define WPAS_DBUS_OBJECT_PATH_MAX 150
  19. #define WPAS_DBUS_SERVICE "fi.epitest.hostap.WPASupplicant"
  20. #define WPAS_DBUS_PATH "/fi/epitest/hostap/WPASupplicant"
  21. #define WPAS_DBUS_INTERFACE "fi.epitest.hostap.WPASupplicant"
  22. #define WPAS_DBUS_PATH_INTERFACES WPAS_DBUS_PATH "/Interfaces"
  23. #define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface"
  24. #define WPAS_DBUS_NETWORKS_PART "Networks"
  25. #define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network"
  26. #define WPAS_DBUS_BSSIDS_PART "BSSIDs"
  27. #define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID"
  28. /* Errors */
  29. #define WPAS_ERROR_INVALID_NETWORK \
  30. WPAS_DBUS_IFACE_INTERFACE ".InvalidNetwork"
  31. #define WPAS_ERROR_INVALID_BSSID \
  32. WPAS_DBUS_IFACE_INTERFACE ".InvalidBSSID"
  33. #define WPAS_ERROR_INVALID_OPTS \
  34. WPAS_DBUS_INTERFACE ".InvalidOptions"
  35. #define WPAS_ERROR_INVALID_IFACE \
  36. WPAS_DBUS_INTERFACE ".InvalidInterface"
  37. #define WPAS_ERROR_ADD_ERROR \
  38. WPAS_DBUS_INTERFACE ".AddError"
  39. #define WPAS_ERROR_EXISTS_ERROR \
  40. WPAS_DBUS_INTERFACE ".ExistsError"
  41. #define WPAS_ERROR_REMOVE_ERROR \
  42. WPAS_DBUS_INTERFACE ".RemoveError"
  43. #define WPAS_ERROR_SCAN_ERROR \
  44. WPAS_DBUS_IFACE_INTERFACE ".ScanError"
  45. #define WPAS_ERROR_ADD_NETWORK_ERROR \
  46. WPAS_DBUS_IFACE_INTERFACE ".AddNetworkError"
  47. #define WPAS_ERROR_INTERNAL_ERROR \
  48. WPAS_DBUS_IFACE_INTERFACE ".InternalError"
  49. #define WPAS_ERROR_REMOVE_NETWORK_ERROR \
  50. WPAS_DBUS_IFACE_INTERFACE ".RemoveNetworkError"
  51. #define WPAS_ERROR_WPS_PBC_ERROR \
  52. WPAS_DBUS_IFACE_INTERFACE ".WpsPbcError"
  53. #define WPAS_ERROR_WPS_PIN_ERROR \
  54. WPAS_DBUS_IFACE_INTERFACE ".WpsPinError"
  55. #define WPAS_ERROR_WPS_REG_ERROR \
  56. WPAS_DBUS_IFACE_INTERFACE ".WpsRegError"
  57. #define WPAS_DBUS_BSSID_FORMAT "%02x%02x%02x%02x%02x%02x"
  58. struct wpa_global;
  59. struct wpa_supplicant;
  60. int wpa_supplicant_dbus_ctrl_iface_init(struct wpas_dbus_priv *iface);
  61. void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s);
  62. void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s);
  63. void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
  64. enum wpa_states new_state,
  65. enum wpa_states old_state);
  66. void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
  67. const struct wps_credential *cred);
  68. char * wpas_dbus_decompose_object_path(const char *path, char **network,
  69. char **bssid);
  70. int wpas_dbus_register_iface(struct wpa_supplicant *wpa_s);
  71. int wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s);
  72. /* Methods internal to the dbus control interface */
  73. struct wpa_supplicant * wpa_supplicant_get_iface_by_dbus_path(
  74. struct wpa_global *global, const char *path);
  75. #else /* CONFIG_CTRL_IFACE_DBUS */
  76. static inline void
  77. wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
  78. {
  79. }
  80. static inline void
  81. wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
  82. {
  83. }
  84. #define wpa_supplicant_dbus_notify_state_change(w,n,o) do { } while (0)
  85. static inline void
  86. wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
  87. const struct wps_credential *cred)
  88. {
  89. }
  90. static inline int
  91. wpas_dbus_register_iface(struct wpa_supplicant *wpa_s)
  92. {
  93. return 0;
  94. }
  95. static inline int
  96. wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s)
  97. {
  98. return 0;
  99. }
  100. #endif /* CONFIG_CTRL_IFACE_DBUS */
  101. #endif /* CTRL_IFACE_DBUS_H */