Deleted Added
sdiff udiff text old ( 214501 ) new ( 252190 )
full compact
1/*
2 * WPA Supplicant / dbus-based control interface
3 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
4 * Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
5 * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Alternatively, this software may be distributed under the terms of BSD
12 * license.
13 *
14 * See README and COPYING for more details.
15 */
16
17#include "includes.h"
18
19#include "common.h"
20#include "wps/wps.h"
21#include "../config.h"
22#include "../wpa_supplicant_i.h"
23#include "../bss.h"
24#include "dbus_new_helpers.h"
25#include "dbus_dict_helpers.h"
26#include "dbus_new.h"
27#include "dbus_new_handlers.h"
28#include "dbus_common.h"
29#include "dbus_common_i.h"
30
31
32/**
33 * wpas_dbus_signal_interface - Send a interface related event signal
34 * @wpa_s: %wpa_supplicant network interface data
35 * @sig_name: signal name - InterfaceAdded or InterfaceRemoved
36 * @properties: Whether to add second argument with object properties
37 *
38 * Notify listeners about event related with interface
39 */
40static void wpas_dbus_signal_interface(struct wpa_supplicant *wpa_s,
41 const char *sig_name, int properties)
42{
43 struct wpas_dbus_priv *iface;
44 DBusMessage *msg;
45 DBusMessageIter iter, iter_dict;
46
47 iface = wpa_s->global->dbus;
48
49 /* Do nothing if the control interface is not turned on */
50 if (iface == NULL)
51 return;
52
53 msg = dbus_message_new_signal(WPAS_DBUS_NEW_PATH,
54 WPAS_DBUS_NEW_INTERFACE, sig_name);
55 if (msg == NULL)
56 return;
57
58 dbus_message_iter_init_append(msg, &iter);
59 if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
60 &wpa_s->dbus_new_path))
61 goto err;
62
63 if (properties) {
64 if (!wpa_dbus_dict_open_write(&iter, &iter_dict))
65 goto err;
66
67 wpa_dbus_get_object_properties(iface, wpa_s->dbus_new_path,
68 WPAS_DBUS_NEW_IFACE_INTERFACE,
69 &iter_dict);
70
71 if (!wpa_dbus_dict_close_write(&iter, &iter_dict))
72 goto err;
73 }
74
75 dbus_connection_send(iface->con, msg, NULL);
76 dbus_message_unref(msg);
77 return;
78
79err:
80 wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");

--- 71 unchanged lines hidden (view full) ---

152 * Notify listeners about event related with BSS
153 */
154static void wpas_dbus_signal_bss(struct wpa_supplicant *wpa_s,
155 const char *bss_obj_path,
156 const char *sig_name, int properties)
157{
158 struct wpas_dbus_priv *iface;
159 DBusMessage *msg;
160 DBusMessageIter iter, iter_dict;
161
162 iface = wpa_s->global->dbus;
163
164 /* Do nothing if the control interface is not turned on */
165 if (iface == NULL)
166 return;
167
168 msg = dbus_message_new_signal(wpa_s->dbus_new_path,
169 WPAS_DBUS_NEW_IFACE_INTERFACE,
170 sig_name);
171 if (msg == NULL)
172 return;
173
174 dbus_message_iter_init_append(msg, &iter);
175 if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
176 &bss_obj_path))
177 goto err;
178
179 if (properties) {
180 if (!wpa_dbus_dict_open_write(&iter, &iter_dict))
181 goto err;
182
183 wpa_dbus_get_object_properties(iface, bss_obj_path,
184 WPAS_DBUS_NEW_IFACE_BSS,
185 &iter_dict);
186
187 if (!wpa_dbus_dict_close_write(&iter, &iter_dict))
188 goto err;
189 }
190
191 dbus_connection_send(iface->con, msg, NULL);
192 dbus_message_unref(msg);
193 return;
194
195err:
196 wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");

--- 102 unchanged lines hidden (view full) ---

299 * Notify listeners about event related with configured network
300 */
301static void wpas_dbus_signal_network(struct wpa_supplicant *wpa_s,
302 int id, const char *sig_name,
303 int properties)
304{
305 struct wpas_dbus_priv *iface;
306 DBusMessage *msg;
307 DBusMessageIter iter, iter_dict;
308 char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
309
310 iface = wpa_s->global->dbus;
311
312 /* Do nothing if the control interface is not turned on */
313 if (iface == NULL)
314 return;
315

--- 9 unchanged lines hidden (view full) ---

325
326 dbus_message_iter_init_append(msg, &iter);
327 path = net_obj_path;
328 if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
329 &path))
330 goto err;
331
332 if (properties) {
333 if (!wpa_dbus_dict_open_write(&iter, &iter_dict))
334 goto err;
335
336 wpa_dbus_get_object_properties(iface, net_obj_path,
337 WPAS_DBUS_NEW_IFACE_NETWORK,
338 &iter_dict);
339
340 if (!wpa_dbus_dict_close_write(&iter, &iter_dict))
341 goto err;
342 }
343
344 dbus_connection_send(iface->con, msg, NULL);
345
346 dbus_message_unref(msg);
347 return;
348
349err:

--- 39 unchanged lines hidden (view full) ---

389 */
390void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id)
391{
392 wpas_dbus_signal_network(wpa_s, id, "NetworkSelected", FALSE);
393}
394
395
396/**
397 * wpas_dbus_signal_network_enabled_changed - Signals Enabled property changes
398 * @wpa_s: %wpa_supplicant network interface data
399 * @ssid: configured network which Enabled property has changed
400 *
401 * Sends PropertyChanged signals containing new value of Enabled property
402 * for specified network
403 */
404void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,

--- 240 unchanged lines hidden (view full) ---

645 dbus_connection_send(iface->con, msg, NULL);
646
647nomem:
648 dbus_message_unref(msg);
649}
650
651#endif /* CONFIG_WPS */
652
653
654/**
655 * wpas_dbus_signal_prop_changed - Signals change of property
656 * @wpa_s: %wpa_supplicant network interface data
657 * @property: indicates which property has changed
658 *
659 * Sends ProertyChanged signals with path, interface and arguments
660 * depending on which property has changed.
661 */
662void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
663 enum wpas_dbus_prop property)
664{
665 WPADBusPropertyAccessor getter;
666 char *prop;
667
668 if (wpa_s->dbus_new_path == NULL)
669 return; /* Skip signal since D-Bus setup is not yet ready */
670
671 switch (property) {
672 case WPAS_DBUS_PROP_AP_SCAN:
673 getter = (WPADBusPropertyAccessor) wpas_dbus_getter_ap_scan;
674 prop = "ApScan";
675 break;
676 case WPAS_DBUS_PROP_SCANNING:
677 getter = (WPADBusPropertyAccessor) wpas_dbus_getter_scanning;
678 prop = "Scanning";
679 break;
680 case WPAS_DBUS_PROP_STATE:
681 getter = (WPADBusPropertyAccessor) wpas_dbus_getter_state;
682 prop = "State";
683 break;
684 case WPAS_DBUS_PROP_CURRENT_BSS:
685 getter = (WPADBusPropertyAccessor)
686 wpas_dbus_getter_current_bss;
687 prop = "CurrentBSS";
688 break;
689 case WPAS_DBUS_PROP_CURRENT_NETWORK:
690 getter = (WPADBusPropertyAccessor)
691 wpas_dbus_getter_current_network;
692 prop = "CurrentNetwork";
693 break;
694 default:
695 wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
696 __func__, property);
697 return;
698 }
699
700 wpa_dbus_mark_property_changed(wpa_s->global->dbus,
701 wpa_s->dbus_new_path,
702 WPAS_DBUS_NEW_IFACE_INTERFACE, prop);
703}
704
705
706/**
707 * wpas_dbus_bss_signal_prop_changed - Signals change of BSS property
708 * @wpa_s: %wpa_supplicant network interface data
709 * @property: indicates which property has changed
710 * @id: unique BSS identifier

--- 47 unchanged lines hidden (view full) ---

758 WPAS_DBUS_NEW_IFACE_BSS, prop);
759}
760
761
762/**
763 * wpas_dbus_signal_debug_level_changed - Signals change of debug param
764 * @global: wpa_global structure
765 *
766 * Sends ProertyChanged signals informing that debug level has changed.
767 */
768void wpas_dbus_signal_debug_level_changed(struct wpa_global *global)
769{
770 wpa_dbus_mark_property_changed(global->dbus, WPAS_DBUS_NEW_PATH,
771 WPAS_DBUS_NEW_INTERFACE,
772 "DebugLevel");
773}
774
775
776/**
777 * wpas_dbus_signal_debug_timestamp_changed - Signals change of debug param
778 * @global: wpa_global structure
779 *
780 * Sends ProertyChanged signals informing that debug timestamp has changed.
781 */
782void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global)
783{
784 wpa_dbus_mark_property_changed(global->dbus, WPAS_DBUS_NEW_PATH,
785 WPAS_DBUS_NEW_INTERFACE,
786 "DebugTimestamp");
787}
788
789
790/**
791 * wpas_dbus_signal_debug_show_keys_changed - Signals change of debug param
792 * @global: wpa_global structure
793 *
794 * Sends ProertyChanged signals informing that debug show_keys has changed.
795 */
796void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global)
797{
798 wpa_dbus_mark_property_changed(global->dbus, WPAS_DBUS_NEW_PATH,
799 WPAS_DBUS_NEW_INTERFACE,
800 "DebugShowKeys");
801}
802

--- 42 unchanged lines hidden (view full) ---

845 { "GetInterface", WPAS_DBUS_NEW_INTERFACE,
846 (WPADBusMethodHandler) &wpas_dbus_handler_get_interface,
847 {
848 { "ifname", "s", ARG_IN },
849 { "path", "o", ARG_OUT },
850 END_ARGS
851 }
852 },
853 { NULL, NULL, NULL, { END_ARGS } }
854};
855
856static const struct wpa_dbus_property_desc wpas_dbus_global_properties[] = {
857 { "DebugLevel", WPAS_DBUS_NEW_INTERFACE, "s",
858 (WPADBusPropertyAccessor) wpas_dbus_getter_debug_level,
859 (WPADBusPropertyAccessor) wpas_dbus_setter_debug_level,
860 RW
861 },
862 { "DebugTimestamp", WPAS_DBUS_NEW_INTERFACE, "b",
863 (WPADBusPropertyAccessor) wpas_dbus_getter_debug_timestamp,
864 (WPADBusPropertyAccessor) wpas_dbus_setter_debug_timestamp,
865 RW
866 },
867 { "DebugShowKeys", WPAS_DBUS_NEW_INTERFACE, "b",
868 (WPADBusPropertyAccessor) wpas_dbus_getter_debug_show_keys,
869 (WPADBusPropertyAccessor) wpas_dbus_setter_debug_show_keys,
870 RW
871 },
872 { "Interfaces", WPAS_DBUS_NEW_INTERFACE, "ao",
873 (WPADBusPropertyAccessor) &wpas_dbus_getter_interfaces,
874 NULL,
875 R
876 },
877 { "EapMethods", WPAS_DBUS_NEW_INTERFACE, "as",
878 (WPADBusPropertyAccessor) wpas_dbus_getter_eap_methods,
879 NULL,
880 R
881 },
882 { NULL, NULL, NULL, NULL, NULL, 0 }
883};
884
885static const struct wpa_dbus_signal_desc wpas_dbus_global_signals[] = {
886 { "InterfaceAdded", WPAS_DBUS_NEW_INTERFACE,
887 {
888 { "path", "o", ARG_OUT },
889 { "properties", "a{sv}", ARG_OUT },
890 END_ARGS
891 }
892 },
893 { "InterfaceRemoved", WPAS_DBUS_NEW_INTERFACE,
894 {
895 { "path", "o", ARG_OUT },
896 END_ARGS
897 }
898 },
899 { "PropertiesChanged", WPAS_DBUS_NEW_INTERFACE,
900 {
901 { "properties", "a{sv}", ARG_OUT },
902 END_ARGS
903 }
904 },
905 { NULL, NULL, { END_ARGS } }
906};

--- 60 unchanged lines hidden (view full) ---

967static void wpa_dbus_free(void *ptr)
968{
969 os_free(ptr);
970}
971
972
973static const struct wpa_dbus_property_desc wpas_dbus_network_properties[] = {
974 { "Properties", WPAS_DBUS_NEW_IFACE_NETWORK, "a{sv}",
975 (WPADBusPropertyAccessor) wpas_dbus_getter_network_properties,
976 (WPADBusPropertyAccessor) wpas_dbus_setter_network_properties,
977 RW
978 },
979 { "Enabled", WPAS_DBUS_NEW_IFACE_NETWORK, "b",
980 (WPADBusPropertyAccessor) wpas_dbus_getter_enabled,
981 (WPADBusPropertyAccessor) wpas_dbus_setter_enabled,
982 RW
983 },
984 { NULL, NULL, NULL, NULL, NULL, 0 }
985};
986
987
988static const struct wpa_dbus_signal_desc wpas_dbus_network_signals[] = {
989 { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_NETWORK,
990 {
991 { "properties", "a{sv}", ARG_OUT },
992 END_ARGS
993 }
994 },
995 { NULL, NULL, { END_ARGS } }
996};

--- 10 unchanged lines hidden (view full) ---

1007int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
1008 struct wpa_ssid *ssid)
1009{
1010 struct wpas_dbus_priv *ctrl_iface;
1011 struct wpa_dbus_object_desc *obj_desc;
1012 struct network_handler_args *arg;
1013 char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
1014
1015 /* Do nothing if the control interface is not turned on */
1016 if (wpa_s == NULL || wpa_s->global == NULL)
1017 return 0;
1018 ctrl_iface = wpa_s->global->dbus;
1019 if (ctrl_iface == NULL)
1020 return 0;
1021
1022 os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,

--- 46 unchanged lines hidden (view full) ---

1069 *
1070 * Unregisters network representing object from dbus
1071 */
1072int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
1073{
1074 struct wpas_dbus_priv *ctrl_iface;
1075 char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
1076 int ret;
1077
1078 /* Do nothing if the control interface is not turned on */
1079 if (wpa_s == NULL || wpa_s->global == NULL ||
1080 wpa_s->dbus_new_path == NULL)
1081 return 0;
1082 ctrl_iface = wpa_s->global->dbus;
1083 if (ctrl_iface == NULL)
1084 return 0;
1085
1086 os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
1087 "%s/" WPAS_DBUS_NEW_NETWORKS_PART "/%u",
1088 wpa_s->dbus_new_path, nid);

--- 6 unchanged lines hidden (view full) ---

1095 wpas_dbus_signal_network_removed(wpa_s, nid);
1096
1097 return ret;
1098}
1099
1100
1101static const struct wpa_dbus_property_desc wpas_dbus_bss_properties[] = {
1102 { "SSID", WPAS_DBUS_NEW_IFACE_BSS, "ay",
1103 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_ssid,
1104 NULL,
1105 R
1106 },
1107 { "BSSID", WPAS_DBUS_NEW_IFACE_BSS, "ay",
1108 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_bssid,
1109 NULL,
1110 R
1111 },
1112 { "Privacy", WPAS_DBUS_NEW_IFACE_BSS, "b",
1113 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_privacy,
1114 NULL,
1115 R
1116 },
1117 { "Mode", WPAS_DBUS_NEW_IFACE_BSS, "s",
1118 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_mode,
1119 NULL,
1120 R
1121 },
1122 { "Signal", WPAS_DBUS_NEW_IFACE_BSS, "n",
1123 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_signal,
1124 NULL,
1125 R
1126 },
1127 { "Frequency", WPAS_DBUS_NEW_IFACE_BSS, "q",
1128 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_frequency,
1129 NULL,
1130 R
1131 },
1132 { "Rates", WPAS_DBUS_NEW_IFACE_BSS, "au",
1133 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_rates,
1134 NULL,
1135 R
1136 },
1137 { "WPA", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
1138 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_wpa,
1139 NULL,
1140 R
1141 },
1142 { "RSN", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
1143 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_rsn,
1144 NULL,
1145 R
1146 },
1147 { "IEs", WPAS_DBUS_NEW_IFACE_BSS, "ay",
1148 (WPADBusPropertyAccessor) wpas_dbus_getter_bss_ies,
1149 NULL,
1150 R
1151 },
1152 { NULL, NULL, NULL, NULL, NULL, 0 }
1153};
1154
1155
1156static const struct wpa_dbus_signal_desc wpas_dbus_bss_signals[] = {
1157 { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_BSS,
1158 {
1159 { "properties", "a{sv}", ARG_OUT },
1160 END_ARGS
1161 }
1162 },
1163 { NULL, NULL, { END_ARGS } }
1164};

--- 29 unchanged lines hidden (view full) ---

1194 bss_obj_path);
1195 if (wpa_dbus_unregister_object_per_iface(ctrl_iface, bss_obj_path)) {
1196 wpa_printf(MSG_ERROR, "dbus: Cannot unregister BSS object %s",
1197 bss_obj_path);
1198 return -1;
1199 }
1200
1201 wpas_dbus_signal_bss_removed(wpa_s, bss_obj_path);
1202
1203 return 0;
1204}
1205
1206
1207/**
1208 * wpas_dbus_register_bss - Register a scanned BSS with dbus
1209 * @wpa_s: wpa_supplicant interface structure

--- 48 unchanged lines hidden (view full) ---

1258 wpa_s->ifname, obj_desc)) {
1259 wpa_printf(MSG_ERROR,
1260 "Cannot register BSSID dbus object %s.",
1261 bss_obj_path);
1262 goto err;
1263 }
1264
1265 wpas_dbus_signal_bss_added(wpa_s, bss_obj_path);
1266
1267 return 0;
1268
1269err:
1270 free_dbus_object_desc(obj_desc);
1271 return -1;
1272}
1273

--- 15 unchanged lines hidden (view full) ---

1289 { "AddNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
1290 (WPADBusMethodHandler) &wpas_dbus_handler_add_network,
1291 {
1292 { "args", "a{sv}", ARG_IN },
1293 { "path", "o", ARG_OUT },
1294 END_ARGS
1295 }
1296 },
1297 { "RemoveNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
1298 (WPADBusMethodHandler) &wpas_dbus_handler_remove_network,
1299 {
1300 { "path", "o", ARG_IN },
1301 END_ARGS
1302 }
1303 },
1304 { "SelectNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
1305 (WPADBusMethodHandler) &wpas_dbus_handler_select_network,
1306 {
1307 { "path", "o", ARG_IN },
1308 END_ARGS
1309 }
1310 },
1311 { "AddBlob", WPAS_DBUS_NEW_IFACE_INTERFACE,
1312 (WPADBusMethodHandler) &wpas_dbus_handler_add_blob,
1313 {
1314 { "name", "s", ARG_IN },
1315 { "data", "ay", ARG_IN },
1316 END_ARGS
1317 }
1318 },

--- 17 unchanged lines hidden (view full) ---

1336 (WPADBusMethodHandler) &wpas_dbus_handler_wps_start,
1337 {
1338 { "args", "a{sv}", ARG_IN },
1339 { "output", "a{sv}", ARG_OUT },
1340 END_ARGS
1341 }
1342 },
1343#endif /* CONFIG_WPS */
1344 { NULL, NULL, NULL, { END_ARGS } }
1345};
1346
1347static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
1348 { "Capabilities", WPAS_DBUS_NEW_IFACE_INTERFACE, "a{sv}",
1349 (WPADBusPropertyAccessor) wpas_dbus_getter_capabilities,
1350 NULL, R
1351 },
1352 { "State", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
1353 (WPADBusPropertyAccessor) wpas_dbus_getter_state,
1354 NULL, R
1355 },
1356 { "Scanning", WPAS_DBUS_NEW_IFACE_INTERFACE, "b",
1357 (WPADBusPropertyAccessor) wpas_dbus_getter_scanning,
1358 NULL, R
1359 },
1360 { "ApScan", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
1361 (WPADBusPropertyAccessor) wpas_dbus_getter_ap_scan,
1362 (WPADBusPropertyAccessor) wpas_dbus_setter_ap_scan,
1363 RW
1364 },
1365 { "Ifname", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
1366 (WPADBusPropertyAccessor) wpas_dbus_getter_ifname,
1367 NULL, R
1368 },
1369 { "Driver", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
1370 (WPADBusPropertyAccessor) wpas_dbus_getter_driver,
1371 NULL, R
1372 },
1373 { "BridgeIfname", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
1374 (WPADBusPropertyAccessor) wpas_dbus_getter_bridge_ifname,
1375 NULL, R
1376 },
1377 { "CurrentBSS", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
1378 (WPADBusPropertyAccessor) wpas_dbus_getter_current_bss,
1379 NULL, R
1380 },
1381 { "CurrentNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
1382 (WPADBusPropertyAccessor) wpas_dbus_getter_current_network,
1383 NULL, R
1384 },
1385 { "Blobs", WPAS_DBUS_NEW_IFACE_INTERFACE, "a{say}",
1386 (WPADBusPropertyAccessor) wpas_dbus_getter_blobs,
1387 NULL, R
1388 },
1389 { "BSSs", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
1390 (WPADBusPropertyAccessor) wpas_dbus_getter_bsss,
1391 NULL, R
1392 },
1393 { "Networks", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
1394 (WPADBusPropertyAccessor) wpas_dbus_getter_networks,
1395 NULL, R
1396 },
1397#ifdef CONFIG_WPS
1398 { "ProcessCredentials", WPAS_DBUS_NEW_IFACE_WPS, "b",
1399 (WPADBusPropertyAccessor) wpas_dbus_getter_process_credentials,
1400 (WPADBusPropertyAccessor) wpas_dbus_setter_process_credentials,
1401 RW
1402 },
1403#endif /* CONFIG_WPS */
1404 { NULL, NULL, NULL, NULL, NULL, 0 }
1405};
1406
1407static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
1408 { "ScanDone", WPAS_DBUS_NEW_IFACE_INTERFACE,
1409 {
1410 { "success", "b", ARG_OUT },
1411 END_ARGS
1412 }

--- 37 unchanged lines hidden (view full) ---

1450 }
1451 },
1452 { "NetworkSelected", WPAS_DBUS_NEW_IFACE_INTERFACE,
1453 {
1454 { "path", "o", ARG_OUT },
1455 END_ARGS
1456 }
1457 },
1458 { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_INTERFACE,
1459 {
1460 { "properties", "a{sv}", ARG_OUT },
1461 END_ARGS
1462 }
1463 },
1464#ifdef CONFIG_WPS
1465 { "Event", WPAS_DBUS_NEW_IFACE_WPS,

--- 4 unchanged lines hidden (view full) ---

1470 }
1471 },
1472 { "Credentials", WPAS_DBUS_NEW_IFACE_WPS,
1473 {
1474 { "credentials", "a{sv}", ARG_OUT },
1475 END_ARGS
1476 }
1477 },
1478 { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_WPS,
1479 {
1480 { "properties", "a{sv}", ARG_OUT },
1481 END_ARGS
1482 }
1483 },
1484#endif /* CONFIG_WPS */
1485 { NULL, NULL, { END_ARGS } }
1486};
1487
1488
1489int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
1490{
1491
1492 struct wpa_dbus_object_desc *obj_desc = NULL;

--- 51 unchanged lines hidden (view full) ---

1544 if (wpa_s == NULL || wpa_s->global == NULL)
1545 return 0;
1546 ctrl_iface = wpa_s->global->dbus;
1547 if (ctrl_iface == NULL)
1548 return 0;
1549
1550 wpa_printf(MSG_DEBUG, "dbus: Unregister interface object '%s'",
1551 wpa_s->dbus_new_path);
1552 if (wpa_dbus_unregister_object_per_iface(ctrl_iface,
1553 wpa_s->dbus_new_path))
1554 return -1;
1555
1556 wpas_dbus_signal_interface_removed(wpa_s);
1557
1558 os_free(wpa_s->dbus_new_path);
1559 wpa_s->dbus_new_path = NULL;
1560
1561 return 0;
1562}