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 DECLARE_ACCESSOR(wpas_dbus_getter_capabilities); 161 DECLARE_ACCESSOR(wpas_dbus_getter_state); 162 DECLARE_ACCESSOR(wpas_dbus_getter_scanning); 163 DECLARE_ACCESSOR(wpas_dbus_getter_ap_scan); 164 DECLARE_ACCESSOR(wpas_dbus_setter_ap_scan); 165 DECLARE_ACCESSOR(wpas_dbus_getter_fast_reauth); 166 DECLARE_ACCESSOR(wpas_dbus_setter_fast_reauth); 167 DECLARE_ACCESSOR(wpas_dbus_getter_disconnect_reason); 168 DECLARE_ACCESSOR(wpas_dbus_getter_disassociate_reason); 169 DECLARE_ACCESSOR(wpas_dbus_getter_auth_status_code); 170 DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code); 171 DECLARE_ACCESSOR(wpas_dbus_getter_roam_time); 172 DECLARE_ACCESSOR(wpas_dbus_getter_roam_complete); 173 DECLARE_ACCESSOR(wpas_dbus_getter_session_length); 174 DECLARE_ACCESSOR(wpas_dbus_getter_bss_tm_status); 175 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); 176 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age); 177 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count); 178 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_count); 179 DECLARE_ACCESSOR(wpas_dbus_getter_country); 180 DECLARE_ACCESSOR(wpas_dbus_setter_country); 181 DECLARE_ACCESSOR(wpas_dbus_getter_scan_interval); 182 DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval); 183 DECLARE_ACCESSOR(wpas_dbus_getter_ifname); 184 DECLARE_ACCESSOR(wpas_dbus_getter_driver); 185 DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname); 186 DECLARE_ACCESSOR(wpas_dbus_setter_bridge_ifname); 187 DECLARE_ACCESSOR(wpas_dbus_getter_config_file); 188 DECLARE_ACCESSOR(wpas_dbus_getter_current_bss); 189 DECLARE_ACCESSOR(wpas_dbus_getter_current_network); 190 DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode); 191 DECLARE_ACCESSOR(wpas_dbus_getter_bsss); 192 DECLARE_ACCESSOR(wpas_dbus_getter_networks); 193 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_engine_path); 194 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_module_path); 195 DECLARE_ACCESSOR(wpas_dbus_getter_blobs); 196 DECLARE_ACCESSOR(wpas_dbus_getter_stas); 197 DECLARE_ACCESSOR(wpas_dbus_getter_mac_address_randomization_mask); 198 DECLARE_ACCESSOR(wpas_dbus_setter_mac_address_randomization_mask); 199 DECLARE_ACCESSOR(wpas_dbus_getter_sta_address); 200 DECLARE_ACCESSOR(wpas_dbus_getter_sta_aid); 201 DECLARE_ACCESSOR(wpas_dbus_getter_sta_caps); 202 DECLARE_ACCESSOR(wpas_dbus_getter_sta_rx_packets); 203 DECLARE_ACCESSOR(wpas_dbus_getter_sta_tx_packets); 204 DECLARE_ACCESSOR(wpas_dbus_getter_sta_tx_bytes); 205 DECLARE_ACCESSOR(wpas_dbus_getter_sta_rx_bytes); 206 DECLARE_ACCESSOR(wpas_dbus_getter_bss_bssid); 207 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ssid); 208 DECLARE_ACCESSOR(wpas_dbus_getter_bss_privacy); 209 DECLARE_ACCESSOR(wpas_dbus_getter_bss_mode); 210 DECLARE_ACCESSOR(wpas_dbus_getter_bss_signal); 211 DECLARE_ACCESSOR(wpas_dbus_getter_bss_frequency); 212 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rates); 213 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wpa); 214 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rsn); 215 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wps); 216 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ies); 217 DECLARE_ACCESSOR(wpas_dbus_getter_bss_age); 218 DECLARE_ACCESSOR(wpas_dbus_getter_enabled); 219 DECLARE_ACCESSOR(wpas_dbus_setter_enabled); 220 DECLARE_ACCESSOR(wpas_dbus_getter_network_properties); 221 DECLARE_ACCESSOR(wpas_dbus_setter_network_properties); 222 223 DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message, 224 struct wpa_supplicant *wpa_s); 225 226 DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message, 227 struct wpa_supplicant *wpa_s); 228 229 DECLARE_ACCESSOR(wpas_dbus_getter_process_credentials); 230 DECLARE_ACCESSOR(wpas_dbus_setter_process_credentials); 231 DECLARE_ACCESSOR(wpas_dbus_getter_config_methods); 232 DECLARE_ACCESSOR(wpas_dbus_setter_config_methods); 233 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_name); 234 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_name); 235 DECLARE_ACCESSOR(wpas_dbus_getter_wps_manufacturer); 236 DECLARE_ACCESSOR(wpas_dbus_setter_wps_manufacturer); 237 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_name); 238 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_name); 239 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_number); 240 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_number); 241 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_serial_number); 242 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_serial_number); 243 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_device_type); 244 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_device_type); 245 246 DECLARE_ACCESSOR(wpas_dbus_getter_mesh_peers); 247 DECLARE_ACCESSOR(wpas_dbus_getter_mesh_group); 248 249 DBusMessage * wpas_dbus_handler_tdls_discover(DBusMessage *message, 250 struct wpa_supplicant *wpa_s); 251 DBusMessage * wpas_dbus_handler_tdls_setup(DBusMessage *message, 252 struct wpa_supplicant *wpa_s); 253 DBusMessage * wpas_dbus_handler_tdls_status(DBusMessage *message, 254 struct wpa_supplicant *wpa_s); 255 DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message, 256 struct wpa_supplicant *wpa_s); 257 DBusMessage * 258 wpas_dbus_handler_tdls_channel_switch(DBusMessage *message, 259 struct wpa_supplicant *wpa_s); 260 DBusMessage * 261 wpas_dbus_handler_tdls_cancel_channel_switch(DBusMessage *message, 262 struct wpa_supplicant *wpa_s); 263 264 DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message, 265 struct wpa_supplicant *wpa_s); 266 DBusMessage * wpas_dbus_handler_vendor_elem_get(DBusMessage *message, 267 struct wpa_supplicant *wpa_s); 268 DBusMessage * wpas_dbus_handler_vendor_elem_remove( 269 DBusMessage *message, struct wpa_supplicant *wpa_s); 270 271 DBusMessage * wpas_dbus_handler_save_config(DBusMessage *message, 272 struct wpa_supplicant *wpa_s); 273 274 DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message, 275 const char *arg); 276 DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message, 277 const char *arg); 278 DBusMessage * wpas_dbus_error_no_memory(DBusMessage *message); 279 280 DBusMessage * wpas_dbus_handler_subscribe_preq( 281 DBusMessage *message, struct wpa_supplicant *wpa_s); 282 DBusMessage * wpas_dbus_handler_unsubscribe_preq( 283 DBusMessage *message, struct wpa_supplicant *wpa_s); 284 285 #endif /* CTRL_IFACE_DBUS_HANDLERS_NEW_H */ 286