066f5a9001e72169cb7d48084941667a93e27615
[mech_eap.git] / wpa_supplicant / notify.c
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
15 #include "includes.h"
16
17 #include "common.h"
18 #include "config.h"
19 #include "wpa_supplicant_i.h"
20 #include "wps_supplicant.h"
21 #include "ctrl_iface_dbus.h"
22 #include "notify.h"
23
24 int wpas_notify_supplicant_initialized(struct wpa_global *global)
25 {
26         if (global->params.dbus_ctrl_interface) {
27                 global->dbus_ctrl_iface =
28                         wpa_supplicant_dbus_ctrl_iface_init(global);
29                 if (global->dbus_ctrl_iface == NULL)
30                         return -1;
31         }
32
33         return 0;
34 }
35
36
37 void wpas_notify_supplicant_deinitialized(struct wpa_global *global)
38 {
39         if (global->dbus_ctrl_iface)
40                 wpa_supplicant_dbus_ctrl_iface_deinit(global->dbus_ctrl_iface);
41 }
42
43
44 int wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
45 {
46         if (wpas_dbus_register_iface(wpa_s))
47                 return -1;
48
49         return 0;
50 }
51
52
53
54 void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
55 {
56         /* unregister interface in old DBus ctrl iface */
57         wpas_dbus_unregister_iface(wpa_s);
58 }
59
60
61 void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
62                                wpa_states new_state, wpa_states old_state)
63 {
64         /* notify the old DBus API */
65         wpa_supplicant_dbus_notify_state_change(wpa_s, new_state,
66                                                 old_state);
67 }
68
69
70 void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
71 {
72 }
73
74
75 void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s)
76 {
77 }
78
79
80 void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s)
81 {
82 }
83
84
85 void wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
86                                          struct wpa_ssid *ssid)
87 {
88 }
89
90
91 void wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
92                                   struct wpa_ssid *ssid)
93 {
94 }
95
96
97 void wpas_notify_scanning(struct wpa_supplicant *wpa_s)
98 {
99         /* notify the old DBus API */
100         wpa_supplicant_dbus_notify_scanning(wpa_s);
101 }
102
103
104 void wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success)
105 {
106 }
107
108
109 void wpas_notify_scan_results(struct wpa_supplicant *wpa_s)
110 {
111         /* notify the old DBus API */
112         wpa_supplicant_dbus_notify_scan_results(wpa_s);
113
114         wpas_wps_notify_scan_results(wpa_s);
115 }
116
117
118 void wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
119                                 const struct wps_credential *cred)
120 {
121         /* notify the old DBus API */
122         wpa_supplicant_dbus_notify_wps_cred(wpa_s, cred);
123 }
124
125
126 void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
127                                struct wps_event_m2d *m2d)
128 {
129 }
130
131
132 void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
133                                 struct wps_event_fail *fail)
134 {
135 }
136
137
138 void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
139 {
140 }
141
142
143 void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
144                                struct wpa_ssid *ssid)
145 {
146 }
147
148
149 void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
150                                  struct wpa_ssid *ssid)
151 {
152 }
153
154
155 void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name)
156 {
157 }
158
159
160 void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name)
161 {
162 }
163
164
165 void wpas_notify_debug_params_changed(struct wpa_global *global)
166 {
167 }