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 DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message, 47 struct wpa_global *global); 48 49 DBusMessage * wpas_dbus_handler_remove_interface(DBusMessage *message, 50 struct wpa_global *global); 51 52 DBusMessage * wpas_dbus_handler_get_interface(DBusMessage *message, 53 struct wpa_global *global); 54 55 DBusMessage * wpas_dbus_handler_expect_disconnect(DBusMessage *message, 56 struct wpa_global *global); 57 58 DECLARE_ACCESSOR(wpas_dbus_getter_debug_level); 59 DECLARE_ACCESSOR(wpas_dbus_getter_debug_timestamp); 60 DECLARE_ACCESSOR(wpas_dbus_getter_debug_show_keys); 61 DECLARE_ACCESSOR(wpas_dbus_setter_debug_level); 62 DECLARE_ACCESSOR(wpas_dbus_setter_debug_timestamp); 63 DECLARE_ACCESSOR(wpas_dbus_setter_debug_show_keys); 64 DECLARE_ACCESSOR(wpas_dbus_getter_interfaces); 65 DECLARE_ACCESSOR(wpas_dbus_getter_eap_methods); 66 DECLARE_ACCESSOR(wpas_dbus_getter_global_capabilities); 67 DECLARE_ACCESSOR(wpas_dbus_getter_iface_global); 68 DECLARE_ACCESSOR(wpas_dbus_setter_iface_global); 69 70 DBusMessage * wpas_dbus_handler_scan(DBusMessage *message, 71 struct wpa_supplicant *wpa_s); 72 73 DBusMessage * wpas_dbus_handler_signal_poll(DBusMessage *message, 74 struct wpa_supplicant *wpa_s); 75 76 DBusMessage * wpas_dbus_handler_disconnect(DBusMessage *message, 77 struct wpa_supplicant *wpa_s); 78 79 dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s, 80 struct wpa_ssid *ssid, 81 DBusMessageIter *iter, 82 DBusError *error); 83 84 DBusMessage * wpas_dbus_handler_add_network(DBusMessage *message, 85 struct wpa_supplicant *wpa_s); 86 87 DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message, 88 struct wpa_supplicant *wpa_s); 89 90 DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message, 91 struct wpa_supplicant *wpa_s); 92 93 DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message, 94 struct wpa_supplicant *wpa_s); 95 96 DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message, 97 struct wpa_supplicant *wpa_s); 98 99 DBusMessage * wpas_dbus_handler_remove_all_networks( 100 DBusMessage *message, struct wpa_supplicant *wpa_s); 101 102 DBusMessage * wpas_dbus_handler_select_network(DBusMessage *message, 103 struct wpa_supplicant *wpa_s); 104 105 DBusMessage * wpas_dbus_handler_network_reply(DBusMessage *message, 106 struct wpa_supplicant *wpa_s); 107 108 DBusMessage * wpas_dbus_handler_add_blob(DBusMessage *message, 109 struct wpa_supplicant *wpa_s); 110 111 DBusMessage * wpas_dbus_handler_get_blob(DBusMessage *message, 112 struct wpa_supplicant *wpa_s); 113 114 DBusMessage * wpas_dbus_handler_remove_blob(DBusMessage *message, 115 struct wpa_supplicant *wpa_s); 116 117 DBusMessage * wpas_dbus_handler_set_pkcs11_engine_and_module_path( 118 DBusMessage *message, struct wpa_supplicant *wpa_s); 119 120 DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message, 121 struct wpa_supplicant *wpa_s); 122 123 DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message, 124 struct wpa_supplicant *wpa_s); 125 126 DBusMessage * wpas_dbus_handler_eap_logoff(DBusMessage *message, 127 struct wpa_supplicant *wpa_s); 128 129 DBusMessage * wpas_dbus_handler_eap_logon(DBusMessage *message, 130 struct wpa_supplicant *wpa_s); 131 132 DECLARE_ACCESSOR(wpas_dbus_getter_capabilities); 133 DECLARE_ACCESSOR(wpas_dbus_getter_state); 134 DECLARE_ACCESSOR(wpas_dbus_getter_scanning); 135 DECLARE_ACCESSOR(wpas_dbus_getter_ap_scan); 136 DECLARE_ACCESSOR(wpas_dbus_setter_ap_scan); 137 DECLARE_ACCESSOR(wpas_dbus_getter_fast_reauth); 138 DECLARE_ACCESSOR(wpas_dbus_setter_fast_reauth); 139 DECLARE_ACCESSOR(wpas_dbus_getter_disconnect_reason); 140 DECLARE_ACCESSOR(wpas_dbus_getter_disassociate_reason); 141 DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code); 142 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); 143 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_age); 144 DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_count); 145 DECLARE_ACCESSOR(wpas_dbus_setter_bss_expire_count); 146 DECLARE_ACCESSOR(wpas_dbus_getter_country); 147 DECLARE_ACCESSOR(wpas_dbus_setter_country); 148 DECLARE_ACCESSOR(wpas_dbus_getter_scan_interval); 149 DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval); 150 DECLARE_ACCESSOR(wpas_dbus_getter_ifname); 151 DECLARE_ACCESSOR(wpas_dbus_getter_driver); 152 DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname); 153 DECLARE_ACCESSOR(wpas_dbus_getter_config_file); 154 DECLARE_ACCESSOR(wpas_dbus_getter_current_bss); 155 DECLARE_ACCESSOR(wpas_dbus_getter_current_network); 156 DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode); 157 DECLARE_ACCESSOR(wpas_dbus_getter_bsss); 158 DECLARE_ACCESSOR(wpas_dbus_getter_networks); 159 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_engine_path); 160 DECLARE_ACCESSOR(wpas_dbus_getter_pkcs11_module_path); 161 DECLARE_ACCESSOR(wpas_dbus_getter_blobs); 162 DECLARE_ACCESSOR(wpas_dbus_getter_bss_bssid); 163 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ssid); 164 DECLARE_ACCESSOR(wpas_dbus_getter_bss_privacy); 165 DECLARE_ACCESSOR(wpas_dbus_getter_bss_mode); 166 DECLARE_ACCESSOR(wpas_dbus_getter_bss_signal); 167 DECLARE_ACCESSOR(wpas_dbus_getter_bss_frequency); 168 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rates); 169 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wpa); 170 DECLARE_ACCESSOR(wpas_dbus_getter_bss_rsn); 171 DECLARE_ACCESSOR(wpas_dbus_getter_bss_wps); 172 DECLARE_ACCESSOR(wpas_dbus_getter_bss_ies); 173 DECLARE_ACCESSOR(wpas_dbus_getter_bss_age); 174 DECLARE_ACCESSOR(wpas_dbus_getter_enabled); 175 DECLARE_ACCESSOR(wpas_dbus_setter_enabled); 176 DECLARE_ACCESSOR(wpas_dbus_getter_network_properties); 177 DECLARE_ACCESSOR(wpas_dbus_setter_network_properties); 178 179 DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message, 180 struct wpa_supplicant *wpa_s); 181 182 DBusMessage * wpas_dbus_handler_wps_cancel(DBusMessage *message, 183 struct wpa_supplicant *wpa_s); 184 185 DECLARE_ACCESSOR(wpas_dbus_getter_process_credentials); 186 DECLARE_ACCESSOR(wpas_dbus_setter_process_credentials); 187 DECLARE_ACCESSOR(wpas_dbus_getter_config_methods); 188 DECLARE_ACCESSOR(wpas_dbus_setter_config_methods); 189 190 DBusMessage * wpas_dbus_handler_tdls_discover(DBusMessage *message, 191 struct wpa_supplicant *wpa_s); 192 DBusMessage * wpas_dbus_handler_tdls_setup(DBusMessage *message, 193 struct wpa_supplicant *wpa_s); 194 DBusMessage * wpas_dbus_handler_tdls_status(DBusMessage *message, 195 struct wpa_supplicant *wpa_s); 196 DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message, 197 struct wpa_supplicant *wpa_s); 198 199 DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message, 200 struct wpa_supplicant *wpa_s); 201 DBusMessage * wpas_dbus_handler_vendor_elem_get(DBusMessage *message, 202 struct wpa_supplicant *wpa_s); 203 DBusMessage * wpas_dbus_handler_vendor_elem_remove( 204 DBusMessage *message, struct wpa_supplicant *wpa_s); 205 206 DBusMessage * wpas_dbus_handler_save_config(DBusMessage *message, 207 struct wpa_supplicant *wpa_s); 208 209 DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message, 210 const char *arg); 211 DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message, 212 const char *arg); 213 DBusMessage * wpas_dbus_error_no_memory(DBusMessage *message); 214 215 DBusMessage * wpas_dbus_handler_subscribe_preq( 216 DBusMessage *message, struct wpa_supplicant *wpa_s); 217 DBusMessage * wpas_dbus_handler_unsubscribe_preq( 218 DBusMessage *message, struct wpa_supplicant *wpa_s); 219 220 #endif /* CTRL_IFACE_DBUS_HANDLERS_NEW_H */ 221