dbus_old.h revision 214501
1139823Simp/* 21541Srgrimes * WPA Supplicant / dbus-based control interface 31541Srgrimes * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc. 41541Srgrimes * 51541Srgrimes * This program is free software; you can redistribute it and/or modify 61541Srgrimes * it under the terms of the GNU General Public License version 2 as 71541Srgrimes * published by the Free Software Foundation. 81541Srgrimes * 91541Srgrimes * Alternatively, this software may be distributed under the terms of BSD 101541Srgrimes * license. 111541Srgrimes * 121541Srgrimes * See README and COPYING for more details. 131541Srgrimes */ 141541Srgrimes 151541Srgrimes#ifndef CTRL_IFACE_DBUS_H 161541Srgrimes#define CTRL_IFACE_DBUS_H 171541Srgrimes 181541Srgrimesstruct wps_credential; 191541Srgrimes 201541Srgrimes#ifdef CONFIG_CTRL_IFACE_DBUS 211541Srgrimes 221541Srgrimes#define WPAS_DBUS_OBJECT_PATH_MAX 150 231541Srgrimes 241541Srgrimes#define WPAS_DBUS_SERVICE "fi.epitest.hostap.WPASupplicant" 251541Srgrimes#define WPAS_DBUS_PATH "/fi/epitest/hostap/WPASupplicant" 261541Srgrimes#define WPAS_DBUS_INTERFACE "fi.epitest.hostap.WPASupplicant" 271541Srgrimes 281541Srgrimes#define WPAS_DBUS_PATH_INTERFACES WPAS_DBUS_PATH "/Interfaces" 291541Srgrimes#define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface" 301541Srgrimes 311541Srgrimes#define WPAS_DBUS_NETWORKS_PART "Networks" 3222521Sdyson#define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network" 331541Srgrimes 341541Srgrimes#define WPAS_DBUS_BSSIDS_PART "BSSIDs" 3583651Speter#define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID" 3683654Speter 3722521Sdyson 381541Srgrimes/* Errors */ 391541Srgrimes#define WPAS_ERROR_INVALID_NETWORK \ 4079247Sjhb WPAS_DBUS_IFACE_INTERFACE ".InvalidNetwork" 4179247Sjhb#define WPAS_ERROR_INVALID_BSSID \ 4279247Sjhb WPAS_DBUS_IFACE_INTERFACE ".InvalidBSSID" 4379247Sjhb 4479247Sjhb#define WPAS_ERROR_INVALID_OPTS \ 451541Srgrimes WPAS_DBUS_INTERFACE ".InvalidOptions" 463305Sphk#define WPAS_ERROR_INVALID_IFACE \ 4779247Sjhb WPAS_DBUS_INTERFACE ".InvalidInterface" 481541Srgrimes 491541Srgrimes#define WPAS_ERROR_ADD_ERROR \ 501541Srgrimes WPAS_DBUS_INTERFACE ".AddError" 5112662Sdg#define WPAS_ERROR_EXISTS_ERROR \ 5225930Sdfr WPAS_DBUS_INTERFACE ".ExistsError" 5325930Sdfr#define WPAS_ERROR_REMOVE_ERROR \ 5425930Sdfr WPAS_DBUS_INTERFACE ".RemoveError" 5525930Sdfr 561541Srgrimes#define WPAS_ERROR_SCAN_ERROR \ 57122698Salfred WPAS_DBUS_IFACE_INTERFACE ".ScanError" 58122698Salfred#define WPAS_ERROR_ADD_NETWORK_ERROR \ 591541Srgrimes WPAS_DBUS_IFACE_INTERFACE ".AddNetworkError" 609336Sdfr#define WPAS_ERROR_INTERNAL_ERROR \ 6183651Speter WPAS_DBUS_IFACE_INTERFACE ".InternalError" 6283651Speter#define WPAS_ERROR_REMOVE_NETWORK_ERROR \ 6383651Speter WPAS_DBUS_IFACE_INTERFACE ".RemoveNetworkError" 641541Srgrimes 65122698Salfred#define WPAS_ERROR_WPS_PBC_ERROR \ 66122698Salfred WPAS_DBUS_IFACE_INTERFACE ".WpsPbcError" 6783651Speter#define WPAS_ERROR_WPS_PIN_ERROR \ 6883651Speter WPAS_DBUS_IFACE_INTERFACE ".WpsPinError" 69138899Sps#define WPAS_ERROR_WPS_REG_ERROR \ 70138899Sps WPAS_DBUS_IFACE_INTERFACE ".WpsRegError" 7175580Sphk 72138899Sps#define WPAS_DBUS_BSSID_FORMAT "%02x%02x%02x%02x%02x%02x" 73138899Sps 74158739Smohansstruct wpa_global; 751541Srgrimesstruct wpa_supplicant; 7625930Sdfr 7725930Sdfrint wpa_supplicant_dbus_ctrl_iface_init(struct wpas_dbus_priv *iface); 7825930Sdfrvoid wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s); 7983651Spetervoid wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s); 8025930Sdfrvoid wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s, 8146349Salc enum wpa_states new_state, 8232755Sdyson enum wpa_states old_state); 8332755Sdysonvoid wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s, 8432755Sdyson const struct wps_credential *cred); 8534206Sdyson 8636563Speterchar * wpas_dbus_decompose_object_path(const char *path, char **network, 8783366Sjulian char **bssid); 8836563Speter 8936563Speterint wpas_dbus_register_iface(struct wpa_supplicant *wpa_s); 90116461Salcint wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s); 9136563Speter 92138899Sps 9325930Sdfr/* Methods internal to the dbus control interface */ 9436563Speterstruct wpa_supplicant * wpa_supplicant_get_iface_by_dbus_path( 95138899Sps struct wpa_global *global, const char *path); 9683366Sjulian 9791406Sjhb#else /* CONFIG_CTRL_IFACE_DBUS */ 9836563Speter 9936563Speterstatic inline void 10036563Speterwpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s) 10136563Speter{ 102116461Salc} 103158739Smohans 10436563Speterstatic inline void 10525930Sdfrwpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s) 10625930Sdfr{ 107158739Smohans} 108158739Smohans 109158739Smohans#define wpa_supplicant_dbus_notify_state_change(w,n,o) do { } while (0) 110158739Smohans 111158739Smohansstatic inline void 112158739Smohanswpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s, 113158739Smohans const struct wps_credential *cred) 114158739Smohans{ 115138899Sps} 116138899Sps 117158739Smohansstatic inline int 11836563Speterwpas_dbus_register_iface(struct wpa_supplicant *wpa_s) 119158739Smohans{ 120158739Smohans return 0; 121122698Salfred} 12283366Sjulian 123158739Smohansstatic inline int 124158739Smohanswpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s) 12546349Salc{ 12646349Salc return 0; 12746349Salc} 12834206Sdyson 12946349Salc#endif /* CONFIG_CTRL_IFACE_DBUS */ 13046349Salc 13146349Salc#endif /* CTRL_IFACE_DBUS_H */ 13246349Salc