notify.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * wpa_supplicant - Event notifications
  3. * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
  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. #include "includes.h"
  15. #include "common.h"
  16. #include "config.h"
  17. #include "wpa_supplicant_i.h"
  18. #include "wps_supplicant.h"
  19. #include "ctrl_iface_dbus.h"
  20. #include "notify.h"
  21. int wpas_notify_supplicant_initialized(struct wpa_global *global)
  22. {
  23. if (global->params.dbus_ctrl_interface) {
  24. global->dbus_ctrl_iface =
  25. wpa_supplicant_dbus_ctrl_iface_init(global);
  26. if (global->dbus_ctrl_iface == NULL)
  27. return -1;
  28. }
  29. return 0;
  30. }
  31. void wpas_notify_supplicant_deinitialized(struct wpa_global *global)
  32. {
  33. if (global->dbus_ctrl_iface)
  34. wpa_supplicant_dbus_ctrl_iface_deinit(global->dbus_ctrl_iface);
  35. }
  36. int wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
  37. {
  38. if (wpas_dbus_register_iface(wpa_s))
  39. return -1;
  40. return 0;
  41. }
  42. void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
  43. {
  44. /* unregister interface in old DBus ctrl iface */
  45. wpas_dbus_unregister_iface(wpa_s);
  46. }
  47. void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
  48. wpa_states new_state, wpa_states old_state)
  49. {
  50. /* notify the old DBus API */
  51. wpa_supplicant_dbus_notify_state_change(wpa_s, new_state,
  52. old_state);
  53. }
  54. void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
  55. {
  56. }
  57. void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s)
  58. {
  59. }
  60. void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s)
  61. {
  62. }
  63. void wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
  64. struct wpa_ssid *ssid)
  65. {
  66. }
  67. void wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
  68. struct wpa_ssid *ssid)
  69. {
  70. }
  71. void wpas_notify_scanning(struct wpa_supplicant *wpa_s)
  72. {
  73. /* notify the old DBus API */
  74. wpa_supplicant_dbus_notify_scanning(wpa_s);
  75. }
  76. void wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success)
  77. {
  78. }
  79. void wpas_notify_scan_results(struct wpa_supplicant *wpa_s)
  80. {
  81. /* notify the old DBus API */
  82. wpa_supplicant_dbus_notify_scan_results(wpa_s);
  83. wpas_wps_notify_scan_results(wpa_s);
  84. }
  85. void wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
  86. const struct wps_credential *cred)
  87. {
  88. /* notify the old DBus API */
  89. wpa_supplicant_dbus_notify_wps_cred(wpa_s, cred);
  90. }
  91. void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
  92. struct wps_event_m2d *m2d)
  93. {
  94. }
  95. void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
  96. struct wps_event_fail *fail)
  97. {
  98. }
  99. void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
  100. {
  101. }
  102. void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
  103. struct wpa_ssid *ssid)
  104. {
  105. }
  106. void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
  107. struct wpa_ssid *ssid)
  108. {
  109. }
  110. void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name)
  111. {
  112. }
  113. void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name)
  114. {
  115. }
  116. void wpas_notify_debug_params_changed(struct wpa_global *global)
  117. {
  118. }