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 * 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 struct sta_handler_args { 26 struct wpa_supplicant *wpa_s; 27 const u8 *sta; 28 }; 29 30 dbus_bool_t wpas_dbus_simple_property_getter(DBusMessageIter *iter, 31 const int type, 32 const void *val, 33 DBusError *error); 34 35 dbus_bool_t wpas_dbus_simple_property_setter(DBusMessageIter *iter, 36 DBusError *error, 37 const int type, void *val); 38 39 dbus_bool_t wpas_dbus_simple_array_property_getter(DBusMessageIter *iter, 40 const int type, 41 const void *array, 42 size_t array_len, 43 DBusError *error); 44 45 dbus_bool_t wpas_dbus_simple_array_array_property_getter(DBusMessageIter *iter, 46 const int type, 47 struct wpabuf **array, 48 size_t array_len, 49 DBusError *error); 50 51 dbus_bool_t wpas_dbus_string_property_getter(DBusMessageIter *iter, 52 const void *val, 53 DBusError *error); 54 55 DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message, 56 struct wpa_global *global); 57 58 DBusMessage * wpas_dbus_handler_remove_interface(DBusMessage *message, 59 struct wpa_global *global); 60 61 DBusMessage * wpas_dbus_handler_get_interface(DBusMessage *message, 62 struct wpa_global *global); 63 64 DBusMessage * wpas_dbus_handler_expect_disconnect(DBusMessage *message, 65 struct wpa_global *global); 66 67 DECLARE_ACCESSOR(wpas_dbus_getter_debug_level); 68 DECLARE_ACCESSOR(wpas_dbus_getter_debug_timestamp); 69 DECLARE_ACCESSOR(wpas_dbus_getter_debug_show_keys); 70 DECLARE_ACCESSOR(wpas_dbus_setter_debug_level); 71 DECLARE_ACCESSOR(wpas_dbus_setter_debug_timestamp); 72 DECLARE_ACCESSOR(wpas_dbus_setter_debug_show_keys); 73 DECLARE_ACCESSOR(wpas_dbus_getter_interfaces); 74 DECLARE_ACCESSOR(wpas_dbus_getter_eap_methods); 75 DECLARE_ACCESSOR(wpas_dbus_getter_global_capabilities); 76 DECLARE_ACCESSOR(wpas_dbus_getter_iface_global); 77 DECLARE_ACCESSOR(wpas_dbus_setter_iface_global); 78 79 DBusMessage * wpas_dbus_handler_scan(DBusMessage *message, 80 struct wpa_supplicant *wpa_s); 81 82 DBusMessage * wpas_dbus_handler_abort_scan(DBusMessage *message, 83 struct wpa_supplicant *wpa_s); 84 85 DBusMessage * wpas_dbus_handler_signal_poll(DBusMessage *message, 86 struct wpa_supplicant *wpa_s); 87 88 DBusMessage * wpas_dbus_handler_disconnect(DBusMessage *message, 89 struct wpa_supplicant *wpa_s); 90 91 dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s, 92 struct wpa_ssid *ssid, 93 DBusMessageIter *iter, 94 DBusError *error); 95 96 DBusMessage * wpas_dbus_handler_add_network(DBusMessage *message, 97 struct wpa_supplicant *wpa_s); 98 99 DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message, 100 struct wpa_supplicant *wpa_s); 101 102 DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message, 103 struct wpa_supplicant *wpa_s); 104 105 DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message, 106 struct wpa_supplicant *wpa_s); 107 108 DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message, 109 struct wpa_supplicant *wpa_s); 110 111 DBusMessage * wpas_dbus_handler_remove_all_networks( 112 DBusMessage *message, struct wpa_supplicant *wpa_s); 113 114 DBusMessage * wpas_dbus_handler_select_network(DBusMessage *message, 115 struct wpa_supplicant *wpa_s); 116 117 DBusMessage * wpas_dbus_handler_network_reply(DBusMessage *message, 118 struct wpa_supplicant *wpa_s); 119 120 DBusMessage * wpas_dbus_handler_roam(DBusMessage *message, 121 struct wpa_supplicant *wpa_s); 122 123 DBusMessage * wpas_dbus_handler_add_blob(DBusMessage *message, 124 struct wpa_supplicant *wpa_s); 125 126 DBusMessage * wpas_dbus_handler_get_blob(DBusMessage *message, 127 struct wpa_supplicant *wpa_s); 128 129 DBusMessage * wpas_dbus_handler_remove_blob(DBusMessage *message, 130 struct wpa_supplicant *wpa_s); 131 132 DBusMessage * wpas_dbus_handler_set_pkcs11_engine_and_module_path( 133 DBusMessage *message, struct wpa_supplicant *wpa_s); 134 135 DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message, 136 struct wpa_supplicant *wpa_s); 137 138 DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, 139 struct wpa_supplicant *wpa_s); 140 141 DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message, 142 struct wpa_supplicant *wpa_s); 143 144 DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message, 145 struct wpa_supplicant *wpa_s); 146 147 DBusMessage * wpas_dbus_handler_add_cred(DBusMessage *message, 148 struct wpa_supplicant *wpa_s); 149 150 DBusMessage * wpas_dbus_handler_remove_cred(DBusMessage *message, 151 struct wpa_supplicant *wpa_s); 152 153 DBusMessage * wpas_dbus_handler_remove_all_creds(DBusMessage *message, 154 struct wpa_supplicant *wpa_s); 155 156 DBusMessage * 157 wpas_dbus_handler_interworking_select(DBusMessage *message, 158 struct wpa_supplicant *wpa_s); 159 160 DBusMessage * 161 wpas_dbus_handler_anqp_get(DBusMessage *message, struct wpa_supplicant *wpa_s); 162 163 DECLARE_ACCESSOR(wpas_dbus_getter_capabilities); 164 DECLARE_ACCESSOR(wpas_dbus_getter_state); 165 DECLARE_ACCESSOR(wpas_dbus_getter_scanning); 166 DECLARE_ACCESSOR(wpas_dbus_getter_ap_scan); 167 DECLARE_ACCESSOR(wpas_dbus_setter_ap_scan); 168 DECLARE_ACCESSOR(wpas_dbus_getter_fast_reauth); 169 DECLARE_ACCESSOR(wpas_dbus_setter_fast_reauth); 170 DECLARE_ACCESSOR(wpas_dbus_getter_disconnect_reason); 171 DECLARE_ACCESSOR(wpas_dbus_getter_disassociate_reason); 172 DECLARE_ACCESSOR(wpas_dbus_getter_auth_status_code); 173 DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code); 174 DECLARE_ACCESSOR(wpas_dbus_getter_roam_time); 175 DECLARE_ACCESSOR(wpas_dbus_getter_roam_complete); 176 DECLARE_ACCESSOR(wpas_dbus_getter_session_length); 177 DECLARE_ACCESSOR(wpas_dbus_getter_bss_tm_status); 178 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); 179 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age); 180 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count); 181 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_count); 182 DECLARE_ACCESSOR(wpas_dbus_getter_country); 183 DECLARE_ACCESSOR(wpas_dbus_setter_country); 184 DECLARE_ACCESSOR(wpas_dbus_getter_scan_interval); 185 DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval); 186 DECLARE_ACCESSOR(wpas_dbus_getter_ifname); 187 DECLARE_ACCESSOR(wpas_dbus_getter_driver); 188 DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname); 189 DECLARE_ACCESSOR(wpas_dbus_setter_bridge_ifname); 190 DECLARE_ACCESSOR(wpas_dbus_getter_config_file); 191 DECLARE_ACCESSOR(wpas_dbus_getter_current_bss); 192 DECLARE_ACCESSOR(wpas_dbus_getter_current_network); 193 DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode); 194 DECLARE_ACCESSOR(wpas_dbus_getter_bsss); 195 DECLARE_ACCESSOR(wpas_dbus_getter_networks); 196 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_engine_path); 197 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_module_path); 198 DECLARE_ACCESSOR(wpas_dbus_getter_blobs); 199 DECLARE_ACCESSOR(wpas_dbus_getter_stas); 200 DECLARE_ACCESSOR(wpas_dbus_getter_mac_address_randomization_mask); 201 DECLARE_ACCESSOR(wpas_dbus_setter_mac_address_randomization_mask); 202 DECLARE_ACCESSOR(wpas_dbus_getter_mac_address); 203 DECLARE_ACCESSOR(wpas_dbus_getter_sta_address); 204 DECLARE_ACCESSOR(wpas_dbus_getter_sta_aid); 205 DECLARE_ACCESSOR(wpas_dbus_getter_sta_caps); 206 DECLARE_ACCESSOR(wpas_dbus_getter_sta_rx_packets); 207 DECLARE_ACCESSOR(wpas_dbus_getter_sta_tx_packets); 208 DECLARE_ACCESSOR(wpas_dbus_getter_sta_tx_bytes); 209 DECLARE_ACCESSOR(wpas_dbus_getter_sta_rx_bytes); 210 DECLARE_ACCESSOR(wpas_dbus_getter_bss_bssid); 211 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ssid); 212 DECLARE_ACCESSOR(wpas_dbus_getter_bss_privacy); 213 DECLARE_ACCESSOR(wpas_dbus_getter_bss_mode); 214 DECLARE_ACCESSOR(wpas_dbus_getter_bss_signal); 215 DECLARE_ACCESSOR(wpas_dbus_getter_bss_frequency); 216 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rates); 217 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wpa); 218 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rsn); 219 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wps); 220 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ies); 221 DECLARE_ACCESSOR(wpas_dbus_getter_bss_age); 222 DECLARE_ACCESSOR(wpas_dbus_getter_bss_anqp); 223 DECLARE_ACCESSOR(wpas_dbus_getter_enabled); 224 DECLARE_ACCESSOR(wpas_dbus_setter_enabled); 225 DECLARE_ACCESSOR(wpas_dbus_getter_network_properties); 226 DECLARE_ACCESSOR(wpas_dbus_setter_network_properties); 227 228 DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message, 229 struct wpa_supplicant *wpa_s); 230 231 DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message, 232 struct wpa_supplicant *wpa_s); 233 234 DECLARE_ACCESSOR(wpas_dbus_getter_process_credentials); 235 DECLARE_ACCESSOR(wpas_dbus_setter_process_credentials); 236 DECLARE_ACCESSOR(wpas_dbus_getter_config_methods); 237 DECLARE_ACCESSOR(wpas_dbus_setter_config_methods); 238 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_name); 239 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_name); 240 DECLARE_ACCESSOR(wpas_dbus_getter_wps_manufacturer); 241 DECLARE_ACCESSOR(wpas_dbus_setter_wps_manufacturer); 242 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_name); 243 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_name); 244 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_number); 245 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_number); 246 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_serial_number); 247 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_serial_number); 248 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_device_type); 249 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_device_type); 250 251 DECLARE_ACCESSOR(wpas_dbus_getter_mesh_peers); 252 DECLARE_ACCESSOR(wpas_dbus_getter_mesh_group); 253 254 DECLARE_ACCESSOR(wpas_dbus_getter_signal_change); 255 256 DBusMessage * wpas_dbus_handler_tdls_discover(DBusMessage *message, 257 struct wpa_supplicant *wpa_s); 258 DBusMessage * wpas_dbus_handler_tdls_setup(DBusMessage *message, 259 struct wpa_supplicant *wpa_s); 260 DBusMessage * wpas_dbus_handler_tdls_status(DBusMessage *message, 261 struct wpa_supplicant *wpa_s); 262 DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message, 263 struct wpa_supplicant *wpa_s); 264 DBusMessage * 265 wpas_dbus_handler_tdls_channel_switch(DBusMessage *message, 266 struct wpa_supplicant *wpa_s); 267 DBusMessage * 268 wpas_dbus_handler_tdls_cancel_channel_switch(DBusMessage *message, 269 struct wpa_supplicant *wpa_s); 270 271 DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message, 272 struct wpa_supplicant *wpa_s); 273 DBusMessage * wpas_dbus_handler_vendor_elem_get(DBusMessage *message, 274 struct wpa_supplicant *wpa_s); 275 DBusMessage * wpas_dbus_handler_vendor_elem_remove( 276 DBusMessage *message, struct wpa_supplicant *wpa_s); 277 278 DBusMessage * wpas_dbus_handler_save_config(DBusMessage *message, 279 struct wpa_supplicant *wpa_s); 280 281 DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message, 282 const char *arg); 283 DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message, 284 const char *arg); 285 DBusMessage * wpas_dbus_error_no_memory(DBusMessage *message); 286 287 DBusMessage * wpas_dbus_handler_subscribe_preq( 288 DBusMessage *message, struct wpa_supplicant *wpa_s); 289 DBusMessage * wpas_dbus_handler_unsubscribe_preq( 290 DBusMessage *message, struct wpa_supplicant *wpa_s); 291 292 #endif /* CTRL_IFACE_DBUS_HANDLERS_NEW_H */ 293