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