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_signal_poll(DBusMessage *message, 78 struct wpa_supplicant *wpa_s); 79 80 DBusMessage * wpas_dbus_handler_disconnect(DBusMessage *message, 81 struct wpa_supplicant *wpa_s); 82 83 dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s, 84 struct wpa_ssid *ssid, 85 DBusMessageIter *iter, 86 DBusError *error); 87 88 DBusMessage * wpas_dbus_handler_add_network(DBusMessage *message, 89 struct wpa_supplicant *wpa_s); 90 91 DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message, 92 struct wpa_supplicant *wpa_s); 93 94 DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message, 95 struct wpa_supplicant *wpa_s); 96 97 DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message, 98 struct wpa_supplicant *wpa_s); 99 100 DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message, 101 struct wpa_supplicant *wpa_s); 102 103 DBusMessage * wpas_dbus_handler_remove_all_networks( 104 DBusMessage *message, struct wpa_supplicant *wpa_s); 105 106 DBusMessage * wpas_dbus_handler_select_network(DBusMessage *message, 107 struct wpa_supplicant *wpa_s); 108 109 DBusMessage * wpas_dbus_handler_network_reply(DBusMessage *message, 110 struct wpa_supplicant *wpa_s); 111 112 DBusMessage * wpas_dbus_handler_add_blob(DBusMessage *message, 113 struct wpa_supplicant *wpa_s); 114 115 DBusMessage * wpas_dbus_handler_get_blob(DBusMessage *message, 116 struct wpa_supplicant *wpa_s); 117 118 DBusMessage * wpas_dbus_handler_remove_blob(DBusMessage *message, 119 struct wpa_supplicant *wpa_s); 120 121 DBusMessage * wpas_dbus_handler_set_pkcs11_engine_and_module_path( 122 DBusMessage *message, struct wpa_supplicant *wpa_s); 123 124 DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message, 125 struct wpa_supplicant *wpa_s); 126 127 DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, 128 struct wpa_supplicant *wpa_s); 129 130 DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message, 131 struct wpa_supplicant *wpa_s); 132 133 DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message, 134 struct wpa_supplicant *wpa_s); 135 136 DECLARE_ACCESSOR(wpas_dbus_getter_capabilities); 137 DECLARE_ACCESSOR(wpas_dbus_getter_state); 138 DECLARE_ACCESSOR(wpas_dbus_getter_scanning); 139 DECLARE_ACCESSOR(wpas_dbus_getter_ap_scan); 140 DECLARE_ACCESSOR(wpas_dbus_setter_ap_scan); 141 DECLARE_ACCESSOR(wpas_dbus_getter_pmf); 142 DECLARE_ACCESSOR(wpas_dbus_setter_pmf); 143 DECLARE_ACCESSOR(wpas_dbus_getter_fast_reauth); 144 DECLARE_ACCESSOR(wpas_dbus_setter_fast_reauth); 145 DECLARE_ACCESSOR(wpas_dbus_getter_disconnect_reason); 146 DECLARE_ACCESSOR(wpas_dbus_getter_disassociate_reason); 147 DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code); 148 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); 149 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age); 150 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count); 151 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_count); 152 DECLARE_ACCESSOR(wpas_dbus_getter_country); 153 DECLARE_ACCESSOR(wpas_dbus_setter_country); 154 DECLARE_ACCESSOR(wpas_dbus_getter_scan_interval); 155 DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval); 156 DECLARE_ACCESSOR(wpas_dbus_getter_ifname); 157 DECLARE_ACCESSOR(wpas_dbus_getter_driver); 158 DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname); 159 DECLARE_ACCESSOR(wpas_dbus_getter_config_file); 160 DECLARE_ACCESSOR(wpas_dbus_getter_current_bss); 161 DECLARE_ACCESSOR(wpas_dbus_getter_current_network); 162 DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode); 163 DECLARE_ACCESSOR(wpas_dbus_getter_bsss); 164 DECLARE_ACCESSOR(wpas_dbus_getter_networks); 165 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_engine_path); 166 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_module_path); 167 DECLARE_ACCESSOR(wpas_dbus_getter_blobs); 168 DECLARE_ACCESSOR(wpas_dbus_getter_bss_bssid); 169 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ssid); 170 DECLARE_ACCESSOR(wpas_dbus_getter_bss_privacy); 171 DECLARE_ACCESSOR(wpas_dbus_getter_bss_mode); 172 DECLARE_ACCESSOR(wpas_dbus_getter_bss_signal); 173 DECLARE_ACCESSOR(wpas_dbus_getter_bss_frequency); 174 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rates); 175 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wpa); 176 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rsn); 177 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wps); 178 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ies); 179 DECLARE_ACCESSOR(wpas_dbus_getter_bss_age); 180 DECLARE_ACCESSOR(wpas_dbus_getter_enabled); 181 DECLARE_ACCESSOR(wpas_dbus_setter_enabled); 182 DECLARE_ACCESSOR(wpas_dbus_getter_network_properties); 183 DECLARE_ACCESSOR(wpas_dbus_setter_network_properties); 184 185 DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message, 186 struct wpa_supplicant *wpa_s); 187 188 DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message, 189 struct wpa_supplicant *wpa_s); 190 191 DECLARE_ACCESSOR(wpas_dbus_getter_process_credentials); 192 DECLARE_ACCESSOR(wpas_dbus_setter_process_credentials); 193 DECLARE_ACCESSOR(wpas_dbus_getter_config_methods); 194 DECLARE_ACCESSOR(wpas_dbus_setter_config_methods); 195 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_name); 196 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_name); 197 DECLARE_ACCESSOR(wpas_dbus_getter_wps_manufacturer); 198 DECLARE_ACCESSOR(wpas_dbus_setter_wps_manufacturer); 199 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_name); 200 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_name); 201 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_model_number); 202 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_model_number); 203 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_serial_number); 204 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_serial_number); 205 DECLARE_ACCESSOR(wpas_dbus_getter_wps_device_device_type); 206 DECLARE_ACCESSOR(wpas_dbus_setter_wps_device_device_type); 207 208 DBusMessage * wpas_dbus_handler_tdls_discover(DBusMessage *message, 209 struct wpa_supplicant *wpa_s); 210 DBusMessage * wpas_dbus_handler_tdls_setup(DBusMessage *message, 211 struct wpa_supplicant *wpa_s); 212 DBusMessage * wpas_dbus_handler_tdls_status(DBusMessage *message, 213 struct wpa_supplicant *wpa_s); 214 DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message, 215 struct wpa_supplicant *wpa_s); 216 217 DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message, 218 struct wpa_supplicant *wpa_s); 219 DBusMessage * wpas_dbus_handler_vendor_elem_get(DBusMessage *message, 220 struct wpa_supplicant *wpa_s); 221 DBusMessage * wpas_dbus_handler_vendor_elem_remove( 222 DBusMessage *message, struct wpa_supplicant *wpa_s); 223 224 DBusMessage * wpas_dbus_handler_save_config(DBusMessage *message, 225 struct wpa_supplicant *wpa_s); 226 227 DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message, 228 const char *arg); 229 DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message, 230 const char *arg); 231 DBusMessage * wpas_dbus_error_no_memory(DBusMessage *message); 232 233 DBusMessage * wpas_dbus_handler_subscribe_preq( 234 DBusMessage *message, struct wpa_supplicant *wpa_s); 235 DBusMessage * wpas_dbus_handler_unsubscribe_preq( 236 DBusMessage *message, struct wpa_supplicant *wpa_s); 237 238 #endif /* CTRL_IFACE_DBUS_HANDLERS_NEW_H */ 239