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