2008-11-04 22:36:51 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
2006-11-25 15:41:04 +00:00
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
2008-06-26 18:31:52 +00:00
|
|
|
* 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.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2006-11-25 15:41:04 +00:00
|
|
|
*
|
2010-10-05 14:19:56 -05:00
|
|
|
* Copyright (C) 2006 - 2010 Red Hat, Inc.
|
2008-11-04 22:36:51 +00:00
|
|
|
* Copyright (C) 2007 - 2008 Novell, Inc.
|
2006-11-25 15:41:04 +00:00
|
|
|
*/
|
|
|
|
|
|
all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).
Fix this by changing the include guards in the non-API-stable parts of
the tree:
- libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H
- libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__
- src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__
And likewise for all other headers.
The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-13 14:10:11 -04:00
|
|
|
#ifndef __NETWORKMANAGER_SUPPLICANT_INTERFACE_H__
|
|
|
|
|
#define __NETWORKMANAGER_SUPPLICANT_INTERFACE_H__
|
2006-11-25 15:41:04 +00:00
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
#include "nm-supplicant-types.h"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Supplicant interface states
|
2010-10-06 11:05:21 -05:00
|
|
|
* A mix of wpa_supplicant interface states and internal states.
|
2006-11-25 15:41:04 +00:00
|
|
|
*/
|
|
|
|
|
enum {
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_INIT = 0,
|
2010-10-11 20:30:40 -05:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_STARTING,
|
2006-11-25 15:41:04 +00:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_READY,
|
2012-05-11 17:15:40 -05:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_DISABLED,
|
2010-10-06 11:05:21 -05:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_INACTIVE,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_SCANNING,
|
2011-03-17 12:35:58 -05:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_AUTHENTICATING,
|
2010-10-06 11:05:21 -05:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATING,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_ASSOCIATED,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_4WAY_HANDSHAKE,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_GROUP_HANDSHAKE,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_COMPLETED,
|
2006-11-25 15:41:04 +00:00
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_DOWN,
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_LAST
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#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))
|
|
|
|
|
|
2010-11-22 08:25:09 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_STATE "state"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_REMOVED "removed"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_NEW_BSS "new-bss"
|
2012-02-20 15:06:05 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_BSS_UPDATED "bss-updated"
|
2012-03-02 18:17:34 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_BSS_REMOVED "bss-removed"
|
2010-11-22 08:25:09 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_SCAN_DONE "scan-done"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR "connection-error"
|
2011-12-19 19:47:43 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_CREDENTIALS_REQUEST "credentials-request"
|
2010-11-22 08:25:09 -06:00
|
|
|
|
2012-09-18 17:33:57 -05:00
|
|
|
typedef enum {
|
|
|
|
|
AP_SUPPORT_UNKNOWN = 0, /* Can't detect whether supported or not */
|
|
|
|
|
AP_SUPPORT_NO = 1, /* AP mode definitely not supported */
|
|
|
|
|
AP_SUPPORT_YES = 2, /* AP mode definitely supported */
|
|
|
|
|
} ApSupport;
|
|
|
|
|
|
2009-04-29 17:08:02 -04:00
|
|
|
struct _NMSupplicantInterface {
|
2006-11-25 15:41:04 +00:00
|
|
|
GObject parent;
|
|
|
|
|
};
|
|
|
|
|
|
2009-04-29 17:08:02 -04:00
|
|
|
typedef struct {
|
2006-11-25 15:41:04 +00:00
|
|
|
GObjectClass parent;
|
|
|
|
|
|
2009-04-30 10:23:35 -04:00
|
|
|
/* Signals */
|
|
|
|
|
|
|
|
|
|
/* change in the interface's state */
|
2009-04-29 17:08:02 -04:00
|
|
|
void (*state) (NMSupplicantInterface * iface,
|
|
|
|
|
guint32 new_state,
|
2012-09-12 11:58:41 -05:00
|
|
|
guint32 old_state,
|
|
|
|
|
int disconnect_reason);
|
2006-12-04 05:45:05 +00:00
|
|
|
|
2009-04-30 10:23:35 -04:00
|
|
|
/* interface was removed by the supplicant */
|
2009-04-29 17:08:02 -04:00
|
|
|
void (*removed) (NMSupplicantInterface * iface);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2010-11-22 08:25:09 -06:00
|
|
|
/* interface saw a new BSS */
|
|
|
|
|
void (*new_bss) (NMSupplicantInterface *iface,
|
2012-02-20 15:06:05 -06:00
|
|
|
const char *object_path,
|
2015-04-06 16:09:18 -04:00
|
|
|
GVariant *props);
|
2012-02-20 15:06:05 -06:00
|
|
|
|
|
|
|
|
/* a BSS property changed */
|
|
|
|
|
void (*bss_updated) (NMSupplicantInterface *iface,
|
|
|
|
|
const char *object_path,
|
2015-04-06 16:09:18 -04:00
|
|
|
GVariant *props);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2012-03-02 18:17:34 -06:00
|
|
|
/* supplicant removed a BSS from its scan list */
|
|
|
|
|
void (*bss_removed) (NMSupplicantInterface *iface,
|
|
|
|
|
const char *object_path);
|
|
|
|
|
|
2010-11-22 08:25:09 -06:00
|
|
|
/* wireless scan is done */
|
|
|
|
|
void (*scan_done) (NMSupplicantInterface *iface,
|
2009-04-30 10:23:35 -04:00
|
|
|
gboolean success);
|
|
|
|
|
|
|
|
|
|
/* an error occurred during a connection request */
|
2009-04-29 17:08:02 -04:00
|
|
|
void (*connection_error) (NMSupplicantInterface * iface,
|
|
|
|
|
const char * name,
|
|
|
|
|
const char * message);
|
2011-12-19 19:47:43 -06:00
|
|
|
|
|
|
|
|
/* 802.1x credentials requested */
|
|
|
|
|
void (*credentials_request) (NMSupplicantInterface *iface,
|
|
|
|
|
const char *field,
|
|
|
|
|
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);
|
|
|
|
|
|
2015-02-01 03:08:16 -06:00
|
|
|
NMSupplicantInterface * nm_supplicant_interface_new (const char *ifname,
|
2010-10-12 14:18:42 -05:00
|
|
|
gboolean is_wireless,
|
2012-02-07 23:46:12 -06:00
|
|
|
gboolean fast_supported,
|
2012-09-18 17:33:57 -05:00
|
|
|
ApSupport ap_support,
|
2010-10-12 14:18:42 -05:00
|
|
|
gboolean start_now);
|
2006-11-25 15:41:04 +00:00
|
|
|
|
2015-02-01 03:08:16 -06:00
|
|
|
void nm_supplicant_interface_set_supplicant_available (NMSupplicantInterface *self,
|
|
|
|
|
gboolean available);
|
|
|
|
|
|
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
|
|
|
|
2010-10-06 11:05:21 -05:00
|
|
|
const char *nm_supplicant_interface_get_object_path (NMSupplicantInterface * iface);
|
|
|
|
|
|
2012-05-02 11:41:47 -05:00
|
|
|
gboolean nm_supplicant_interface_request_scan (NMSupplicantInterface * self, const GPtrArray *ssids);
|
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 19:09:44 +00:00
|
|
|
guint32 nm_supplicant_interface_get_state (NMSupplicantInterface * self);
|
|
|
|
|
|
2008-10-26 16:32:29 +00:00
|
|
|
const char *nm_supplicant_interface_state_to_string (guint32 state);
|
|
|
|
|
|
2009-05-13 11:16:29 -04:00
|
|
|
gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self);
|
|
|
|
|
|
2013-12-10 16:18:17 +01:00
|
|
|
gint32 nm_supplicant_interface_get_last_scan_time (NMSupplicantInterface *self);
|
2012-06-07 15:04:14 -05:00
|
|
|
|
2010-10-05 14:19:56 -05:00
|
|
|
const char *nm_supplicant_interface_get_ifname (NMSupplicantInterface *self);
|
|
|
|
|
|
2012-05-01 17:59:35 -05:00
|
|
|
guint nm_supplicant_interface_get_max_scan_ssids (NMSupplicantInterface *self);
|
|
|
|
|
|
2011-12-19 19:47:43 -06:00
|
|
|
gboolean nm_supplicant_interface_get_has_credentials_request (NMSupplicantInterface *self);
|
|
|
|
|
|
|
|
|
|
gboolean nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self,
|
|
|
|
|
const char *field,
|
|
|
|
|
const char *value,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2012-09-18 17:33:57 -05:00
|
|
|
ApSupport nm_supplicant_interface_get_ap_support (NMSupplicantInterface *self);
|
|
|
|
|
|
|
|
|
|
void nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
|
|
|
|
|
ApSupport apmode);
|
|
|
|
|
|
2006-11-25 15:41:04 +00:00
|
|
|
#endif /* NM_SUPPLICANT_INTERFACE_H */
|