1 /* 2 * WPA Supplicant / dbus-based control interface 3 * Copyright (c) 2006, Dan Williams <dcbw (at) redhat.com> and Red Hat, Inc. 4 * Copyright (c) 2009-2010, Witold Sowa <witold.sowa (at) gmail.com> 5 * 6 * This software may be distributed under the terms of the BSD license. 7 * See README for more details. 8 */ 9 10 #ifndef CTRL_IFACE_DBUS_NEW_HANDLERS_H 11 #define CTRL_IFACE_DBUS_NEW_HANDLERS_H 12 13 #include "dbus_new_helpers.h" 14 15 struct network_handler_args { 16 struct wpa_supplicant *wpa_s; 17 struct wpa_ssid *ssid; 18 }; 19 20 struct bss_handler_args { 21 struct wpa_supplicant *wpa_s; 22 unsigned int id; 23 }; 24 25 dbus_bool_t wpas_dbus_simple_property_getter(DBusMessageIter *iter, 26 const int type, 27 const void *val, 28 DBusError *error); 29 30 dbus_bool_t wpas_dbus_simple_property_setter(DBusMessageIter *iter, 31 DBusError *error, 32 const int type, void *val); 33 34 dbus_bool_t wpas_dbus_simple_array_property_getter(DBusMessageIter *iter, 35 const int type, 36 const void *array, 37 size_t array_len, 38 DBusError *error); 39 40 dbus_bool_t wpas_dbus_simple_array_array_property_getter(DBusMessageIter *iter, 41 const int type, 42 struct wpabuf **array, 43 size_t array_len, 44 DBusError *error); 45 46 dbus_bool_t wpas_dbus_string_property_getter(DBusMessageIter *iter, 47 const void *val, 48 DBusError *error); 49 50 DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message, 51 struct wpa_global *global); 52 53 DBusMessage * wpas_dbus_handler_remove_interface(DBusMessage *message, 54 struct wpa_global *global); 55 56 DBusMessage * wpas_dbus_handler_get_interface(DBusMessage *message, 57 struct wpa_global *global); 58 59 DBusMessage * wpas_dbus_handler_expect_disconnect(DBusMessage *message, 60 struct wpa_global *global); 61 62 DECLARE_ACCESSOR(wpas_dbus_getter_debug_level); 63 DECLARE_ACCESSOR(wpas_dbus_getter_debug_timestamp); 64 DECLARE_ACCESSOR(wpas_dbus_getter_debug_show_keys); 65 DECLARE_ACCESSOR(wpas_dbus_setter_debug_level); 66 DECLARE_ACCESSOR(wpas_dbus_setter_debug_timestamp); 67 DECLARE_ACCESSOR(wpas_dbus_setter_debug_show_keys); 68 DECLARE_ACCESSOR(wpas_dbus_getter_interfaces); 69 DECLARE_ACCESSOR(wpas_dbus_getter_eap_methods); 70 DECLARE_ACCESSOR(wpas_dbus_getter_global_capabilities); 71 DECLARE_ACCESSOR(wpas_dbus_getter_iface_global); 72 DECLARE_ACCESSOR(wpas_dbus_setter_iface_global); 73 74 DBusMessage * wpas_dbus_handler_scan(DBusMessage *message, 75 struct wpa_supplicant *wpa_s); 76 77 DBusMessage * wpas_dbus_handler_abort_scan(DBusMessage *message, 78 struct wpa_supplicant *wpa_s); 79 80 DBusMessage * wpas_dbus_handler_signal_poll(DBusMessage *message, 81 struct wpa_supplicant *wpa_s); 82 83 DBusMessage * wpas_dbus_handler_disconnect(DBusMessage *message, 84 struct wpa_supplicant *wpa_s); 85 86 dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s, 87 struct wpa_ssid *ssid, 88 DBusMessageIter *iter, 89 DBusError *error); 90 91 DBusMessage * wpas_dbus_handler_add_network(DBusMessage *message, 92 struct wpa_supplicant *wpa_s); 93 94 DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message, 95 struct wpa_supplicant *wpa_s); 96 97 DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message, 98 struct wpa_supplicant *wpa_s); 99 100 DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message, 101 struct wpa_supplicant *wpa_s); 102 103 DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message, 104 struct wpa_supplicant *wpa_s); 105 106 DBusMessage * wpas_dbus_handler_remove_all_networks( 107 DBusMessage *message, struct wpa_supplicant *wpa_s); 108 109 DBusMessage * wpas_dbus_handler_select_network(DBusMessage *message, 110 struct wpa_supplicant *wpa_s); 111 112 DBusMessage * wpas_dbus_handler_network_reply(DBusMessage *message, 113 struct wpa_supplicant *wpa_s); 114 115 DBusMessage * wpas_dbus_handler_add_blob(DBusMessage *message, 116 struct wpa_supplicant *wpa_s); 117 118 DBusMessage * wpas_dbus_handler_get_blob(DBusMessage *message, 119 struct wpa_supplicant *wpa_s); 120 121 DBusMessage * wpas_dbus_handler_remove_blob(DBusMessage *message, 122 struct wpa_supplicant *wpa_s); 123 124 DBusMessage * wpas_dbus_handler_set_pkcs11_engine_and_module_path( 125 DBusMessage *message, struct wpa_supplicant *wpa_s); 126 127 DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message, 128 struct wpa_supplicant *wpa_s); 129 130 DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, 131 struct wpa_supplicant *wpa_s); 132 133 DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message, 134 struct wpa_supplicant *wpa_s); 135 136 DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message, 137 struct wpa_supplicant *wpa_s); 138 139 DECLARE_ACCESSOR(wpas_dbus_getter_capabilities); 140 DECLARE_ACCESSOR(wpas_dbus_getter_state); 141 DECLARE_ACCESSOR(wpas_dbus_getter_scanning); 142 DECLARE_ACCESSOR(wpas_dbus_getter_ap_scan); 143 DECLARE_ACCESSOR(wpas_dbus_setter_ap_scan); 144 DECLARE_ACCESSOR(wpas_dbus_getter_pmf); 145 DECLARE_ACCESSOR(wpas_dbus_setter_pmf); 146 DECLARE_ACCESSOR(wpas_dbus_getter_fast_reauth); 147 DECLARE_ACCESSOR(wpas_dbus_setter_fast_reauth); 148 DECLARE_ACCESSOR(wpas_dbus_getter_disconnect_reason); 149 DECLARE_ACCESSOR(wpas_dbus_getter_disassociate_reason); 150 DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code); 151 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); 152 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age); 153 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count); 154 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_count); 155 DECLARE_ACCESSOR(wpas_dbus_getter_country); 156 DECLARE_ACCESSOR(wpas_dbus_setter_country); 157 DECLARE_ACCESSOR(wpas_dbus_getter_scan_interval); 158 DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval); 159 DECLARE_ACCESSOR(wpas_dbus_getter_ifname); 160 DECLARE_ACCESSOR(wpas_dbus_getter_driver); 161 DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname); 162 DECLARE_ACCESSOR(wpas_dbus_getter_config_file); 163 DECLARE_ACCESSOR(wpas_dbus_getter_current_bss); 164 DECLARE_ACCESSOR(wpas_dbus_getter_current_network); 165 DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode); 166 DECLARE_ACCESSOR(wpas_dbus_getter_bsss); 167 DECLARE_ACCESSOR(wpas_dbus_getter_networks); 168 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_engine_path); 169 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_module_path); 170 DECLARE_ACCESSOR(wpas_dbus_getter_blobs); 171 DECLARE_ACCESSOR(wpas_dbus_getter_bss_bssid); 172 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ssid); 173 DECLARE_ACCESSOR(wpas_dbus_getter_bss_privacy); 174 DECLARE_ACCESSOR(wpas_dbus_getter_bss_mode); 175 DECLARE_ACCESSOR(wpas_dbus_getter_bss_signal); 176 DECLARE_ACCESSOR(wpas_dbus_getter_bss_frequency); 177 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rates); 178 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wpa); 179 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rsn); 180 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wps); 181 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ies); 182 DECLARE_ACCESSOR(wpas_dbus_getter_bss_age); 183 DECLARE_ACCESSOR(wpas_dbus_getter_enabled); 184 DECLARE_ACCESSOR(wpas_dbus_setter_enabled); 185 DECLARE_ACCESSOR(wpas_dbus_getter_network_properties); 186 DECLARE_ACCESSOR(wpas_dbus_setter_network_properties); 187 188 DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message, 189 struct wpa_supplicant *wpa_s); 190 191 DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message, 192 struct wpa_supplicant *wpa_s); 193 194 DECLARE_ACCESSOR(wpas_dbus_getter_process_credentials); 195 DECLARE_ACCESSOR(wpas_dbus_setter_process_credentials); 196 DECLARE_ACCESSOR(wpas_dbus_getter_config_methods); 197 DECLARE_ACCESSOR(wpas_dbus_setter_config_methods); 198 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_name); 199 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_name); 200 DECLARE_ACCESSOR(wpas_dbus_getter_wps_manufacturer); 201 DECLARE_ACCESSOR(wpas_dbus_setter_wps_manufacturer); 202 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_name); 203 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_name); 204 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_number); 205 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_number); 206 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_serial_number); 207 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_serial_number); 208 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_device_type); 209 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_device_type); 210 211 DECLARE_ACCESSOR(wpas_dbus_getter_mesh_peers); 212 DECLARE_ACCESSOR(wpas_dbus_getter_mesh_group); 213 214 DBusMessage * wpas_dbus_handler_tdls_discover(DBusMessage *message, 215 struct wpa_supplicant *wpa_s); 216 DBusMessage * wpas_dbus_handler_tdls_setup(DBusMessage *message, 217 struct wpa_supplicant *wpa_s); 218 DBusMessage * wpas_dbus_handler_tdls_status(DBusMessage *message, 219 struct wpa_supplicant *wpa_s); 220 DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message, 221 struct wpa_supplicant *wpa_s); 222 DBusMessage * 223 wpas_dbus_handler_tdls_channel_switch(DBusMessage *message, 224 struct wpa_supplicant *wpa_s); 225 DBusMessage * 226 wpas_dbus_handler_tdls_cancel_channel_switch(DBusMessage *message, 227 struct wpa_supplicant *wpa_s); 228 229 DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message, 230 struct wpa_supplicant *wpa_s); 231 DBusMessage * wpas_dbus_handler_vendor_elem_get(DBusMessage *message, 232 struct wpa_supplicant *wpa_s); 233 DBusMessage * wpas_dbus_handler_vendor_elem_remove( 234 DBusMessage *message, struct wpa_supplicant *wpa_s); 235 236 DBusMessage * wpas_dbus_handler_save_config(DBusMessage *message, 237 struct wpa_supplicant *wpa_s); 238 239 DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message, 240 const char *arg); 241 DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message, 242 const char *arg); 243 DBusMessage * wpas_dbus_error_no_memory(DBusMessage *message); 244 245 DBusMessage * wpas_dbus_handler_subscribe_preq( 246 DBusMessage *message, struct wpa_supplicant *wpa_s); 247 DBusMessage * wpas_dbus_handler_unsubscribe_preq( 248 DBusMessage *message, struct wpa_supplicant *wpa_s); 249 250 #endif /* CTRL_IFACE_DBUS_HANDLERS_NEW_H */ 251