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