2006-11-25 15:41:04 +00:00
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
|
*
|
|
|
|
|
* Dan Williams <dcbw@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* (C) Copyright 2006 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef NM_SUPPLICANT_INTERFACE_H
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_H
|
|
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2007-02-05 12:14:09 +00:00
|
|
|
#include <dbus/dbus.h>
|
2006-11-25 15:41:04 +00:00
|
|
|
#include "nm-supplicant-types.h"
|
|
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Supplicant interface states
|
|
|
|
|
* The states are linear, ie INIT -> READY -> DOWN and state may only be
|
|
|
|
|
* changed in one direction. If an interface reaches the DOWN state, it
|
|
|
|
|
* cannot be re-initialized; it must be torn down and a new one created.
|
|
|
|
|
*
|
|
|
|
|
* INIT: interface has been created, but cannot be used yet; it is waiting
|
|
|
|
|
* for pending requests of the supplicant to complete.
|
|
|
|
|
* READY: interface is ready for use
|
|
|
|
|
* DOWN: interface has been removed or has otherwise been made invalid; it
|
|
|
|
|
* must be torn down.
|
|
|
|
|
*
|
|
|
|
|
* Note: LAST is an invalid state and only used for boundary checking.
|
|
|
|
|
*/
|
|
|
|
|
enum {
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_INIT = 0,
|
2006-11-25 18:23:06 +00:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_STARTING,
|
2006-11-25 15:41:04 +00:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_READY,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_DOWN,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_LAST
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2006-12-04 05:45:05 +00:00
|
|
|
/*
|
|
|
|
|
* Supplicant interface connection states
|
|
|
|
|
* The wpa_supplicant state for the connection.
|
|
|
|
|
*/
|
|
|
|
|
enum {
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_DISCONNECTED = 0,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_INACTIVE,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_SCANNING,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATING,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_ASSOCIATED,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_4WAY_HANDSHAKE,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_GROUP_HANDSHAKE,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_COMPLETED,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_CON_STATE_LAST
|
|
|
|
|
};
|
|
|
|
|
|
2006-11-25 15:41:04 +00:00
|
|
|
#define NM_TYPE_SUPPLICANT_INTERFACE (nm_supplicant_interface_get_type ())
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterface))
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass))
|
|
|
|
|
#define NM_IS_SUPPLICANT_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SUPPLICANT_INTERFACE))
|
|
|
|
|
#define NM_IS_SUPPLICANT_INTERFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SUPPLICANT_INTERFACE))
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SUPPLICANT_INTERFACE, NMSupplicantInterfaceClass))
|
|
|
|
|
|
|
|
|
|
struct _NMSupplicantInterface
|
|
|
|
|
{
|
|
|
|
|
GObject parent;
|
|
|
|
|
};
|
|
|
|
|
|
2007-02-05 12:14:09 +00:00
|
|
|
typedef struct
|
2006-11-25 15:41:04 +00:00
|
|
|
{
|
|
|
|
|
GObjectClass parent;
|
|
|
|
|
|
|
|
|
|
/* class members */
|
2006-12-04 05:45:05 +00:00
|
|
|
void (* state) (NMSupplicantInterface * iface,
|
|
|
|
|
guint32 new_state,
|
|
|
|
|
guint32 old_state);
|
|
|
|
|
|
|
|
|
|
void (* removed) (NMSupplicantInterface * iface);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2006-12-04 05:45:05 +00:00
|
|
|
void (* scanned_ap) (NMSupplicantInterface * iface,
|
|
|
|
|
DBusMessage * message);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2006-12-04 05:45:05 +00:00
|
|
|
void (* scan_result) (NMSupplicantInterface * iface, guint32 result);
|
2006-11-26 Dan Williams <dcbw@redhat.com>
Scan using wpa_supplicant over DBus.
* src/nm-device-802-11-wireless.c
- remove wireless extensions netlink event handler bits
(wireless_event_helper, nm_device_802_11_wireless_event)
- remove wireless extensions scan event handler bits
(process_scan_results, add_new_ap_to_device_list, hexstr2bin,
hex2byte, hex2num, request_and_convert_scan_results,
free_process_scan_cb_data, scan_results_timeout,
schedule_scan_results_timeout, cancel_scan_results_timeout)
- Rename nm_device_802_11_wireless_scan() -> request_wireless_scan()
and request scans from the supplicant interface rather than directly
- Move functionality of convert_scan_results() to cull_scan_list() and
supplicant_iface_scanned_ap_cb()
- (supplicant_iface_scan_result_cb): new function; schedule a new scan
at the scan interval when the current scan has finished
- (supplicant_iface_state_cb): start scanning when the supplicant
interface enters the READY state, and stop scanning when it
enters the DOWN state
- (cull_scan_list): weed out old access points from the scan list
- (supplicant_iface_scanned_ap_cb): convert a supplicant scanned access
point into an NMAccessPoint and merge it into the device's scan list
* src/supplicant-manager/nm-supplicant-interface.c
src/supplicant-manager/nm-supplicant-interface.h
- Add a new signal "scan-result" which is issued when the supplicant
notifies NM that a scan has completed
- Add a new signal "scanned-ap" that notifies listeners of a new access
point found in the scan. Called once for each access point that
the supplicant interface object receives from the supplicant as a
result of the "scanResults" method call
- (wpas_iface_query_scan_results): don't wait 4s before querying
for the initial scan results
- (scan_request_cb): new function; send listeners the result
(success, error) of a wireless scan request
- (nm_supplicant_interface_request_scan): new function; ask the
supplicant to perform an immediate wireless scan
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2128 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-11-26 20:49:48 +00:00
|
|
|
|
2006-12-04 05:45:05 +00:00
|
|
|
void (* connection_state) (NMSupplicantInterface * iface,
|
|
|
|
|
guint32 new_state,
|
|
|
|
|
guint32 old_state);
|
2006-12-19 19:15:31 +00:00
|
|
|
|
|
|
|
|
void (* connection_error) (NMSupplicantInterface * iface,
|
|
|
|
|
const char * name,
|
|
|
|
|
const char * message);
|
2007-02-05 12:14:09 +00:00
|
|
|
} NMSupplicantInterfaceClass;
|
2006-11-25 15:41:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
GType nm_supplicant_interface_get_type (void);
|
|
|
|
|
|
|
|
|
|
NMSupplicantInterface * nm_supplicant_interface_new (NMSupplicantManager * smgr,
|
2007-02-05 12:14:09 +00:00
|
|
|
const char *ifname,
|
|
|
|
|
gboolean is_wireless);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2006-12-19 19:15:31 +00:00
|
|
|
gboolean nm_supplicant_interface_set_config (NMSupplicantInterface * iface,
|
|
|
|
|
NMSupplicantConfig * cfg);
|
|
|
|
|
|
|
|
|
|
void nm_supplicant_interface_disconnect (NMSupplicantInterface * iface);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2007-02-05 12:14:09 +00:00
|
|
|
const char * nm_supplicant_interface_get_device (NMSupplicantInterface * iface);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2006-11-26 Dan Williams <dcbw@redhat.com>
Scan using wpa_supplicant over DBus.
* src/nm-device-802-11-wireless.c
- remove wireless extensions netlink event handler bits
(wireless_event_helper, nm_device_802_11_wireless_event)
- remove wireless extensions scan event handler bits
(process_scan_results, add_new_ap_to_device_list, hexstr2bin,
hex2byte, hex2num, request_and_convert_scan_results,
free_process_scan_cb_data, scan_results_timeout,
schedule_scan_results_timeout, cancel_scan_results_timeout)
- Rename nm_device_802_11_wireless_scan() -> request_wireless_scan()
and request scans from the supplicant interface rather than directly
- Move functionality of convert_scan_results() to cull_scan_list() and
supplicant_iface_scanned_ap_cb()
- (supplicant_iface_scan_result_cb): new function; schedule a new scan
at the scan interval when the current scan has finished
- (supplicant_iface_state_cb): start scanning when the supplicant
interface enters the READY state, and stop scanning when it
enters the DOWN state
- (cull_scan_list): weed out old access points from the scan list
- (supplicant_iface_scanned_ap_cb): convert a supplicant scanned access
point into an NMAccessPoint and merge it into the device's scan list
* src/supplicant-manager/nm-supplicant-interface.c
src/supplicant-manager/nm-supplicant-interface.h
- Add a new signal "scan-result" which is issued when the supplicant
notifies NM that a scan has completed
- Add a new signal "scanned-ap" that notifies listeners of a new access
point found in the scan. Called once for each access point that
the supplicant interface object receives from the supplicant as a
result of the "scanResults" method call
- (wpas_iface_query_scan_results): don't wait 4s before querying
for the initial scan results
- (scan_request_cb): new function; send listeners the result
(success, error) of a wireless scan request
- (nm_supplicant_interface_request_scan): new function; ask the
supplicant to perform an immediate wireless scan
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2128 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-11-26 20:49:48 +00:00
|
|
|
gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface * self);
|
|
|
|
|
|
2006-12-04 19:09:44 +00:00
|
|
|
guint32 nm_supplicant_interface_get_state (NMSupplicantInterface * self);
|
|
|
|
|
|
2006-12-04 05:45:05 +00:00
|
|
|
guint32 nm_supplicant_interface_get_connection_state (NMSupplicantInterface * self);
|
|
|
|
|
|
2006-11-25 15:41:04 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
#endif /* NM_SUPPLICANT_INTERFACE_H */
|