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
|
|
|
*
|
2017-04-13 10:42:32 +02:00
|
|
|
* Copyright (C) 2006 - 2017 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
|
|
|
*/
|
|
|
|
|
|
2017-01-18 17:41:12 +01:00
|
|
|
#ifndef __NM_SUPPLICANT_INTERFACE_H__
|
|
|
|
|
#define __NM_SUPPLICANT_INTERFACE_H__
|
2006-11-25 15:41:04 +00:00
|
|
|
|
|
|
|
|
#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
|
|
|
*/
|
2017-02-14 01:30:25 +01:00
|
|
|
typedef enum {
|
|
|
|
|
NM_SUPPLICANT_INTERFACE_STATE_INVALID = -1,
|
2006-11-25 15:41:04 +00:00
|
|
|
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,
|
2017-02-14 01:30:25 +01:00
|
|
|
} NMSupplicantInterfaceState;
|
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))
|
|
|
|
|
|
2015-04-05 23:31:02 -05:00
|
|
|
/* Properties */
|
2016-01-19 16:08:29 +01:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_IFACE "iface"
|
2018-10-10 22:43:49 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_OBJECT_PATH "object-path"
|
2016-01-19 16:08:29 +01:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_SCANNING "scanning"
|
2015-04-05 23:31:02 -05:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_CURRENT_BSS "current-bss"
|
2018-10-10 23:08:15 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_P2P_GROUP_JOINED "p2p-group-joined"
|
2018-12-11 18:21:37 +01:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_P2P_GROUP_PATH "p2p-group-path"
|
2018-10-10 23:08:15 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_P2P_GROUP_OWNER "p2p-group-owner"
|
2016-06-30 18:20:48 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_DRIVER "driver"
|
2018-10-10 18:35:20 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_P2P_AVAILABLE "p2p-available"
|
2017-01-18 17:41:12 +01:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_FAST_SUPPORT "fast-support"
|
2016-01-19 16:08:29 +01:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_AP_SUPPORT "ap-support"
|
2017-03-18 14:56:38 +01:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_PMF_SUPPORT "pmf-support"
|
2018-01-16 06:28:37 +09:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_FILS_SUPPORT "fils-support"
|
2018-10-10 17:50:34 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_P2P_SUPPORT "p2p-support"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_WFD_SUPPORT "wfd-support"
|
2015-04-05 23:31:02 -05:00
|
|
|
|
|
|
|
|
/* Signals */
|
2010-11-22 08:25:09 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_STATE "state"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_REMOVED "removed"
|
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"
|
2018-10-10 21:27:34 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_PEER_UPDATED "peer-updated"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_PEER_REMOVED "peer-removed"
|
2010-11-22 08:25:09 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_SCAN_DONE "scan-done"
|
2011-12-19 19:47:43 -06:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_CREDENTIALS_REQUEST "credentials-request"
|
2017-04-13 10:42:32 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_WPS_CREDENTIALS "wps-credentials"
|
2018-10-10 23:08:15 +02:00
|
|
|
#define NM_SUPPLICANT_INTERFACE_GROUP_STARTED "group-started"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_GROUP_FINISHED "group-finished"
|
|
|
|
|
#define NM_SUPPLICANT_INTERFACE_GROUP_FORMATION_FAILURE "group-formation-failure"
|
2010-11-22 08:25:09 -06:00
|
|
|
|
2016-09-28 15:58:24 +02:00
|
|
|
typedef struct _NMSupplicantInterfaceClass 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,
|
2018-10-10 22:43:49 +02:00
|
|
|
const char *object_path,
|
2016-06-30 18:20:48 +02:00
|
|
|
NMSupplicantDriver driver,
|
2017-01-18 17:41:12 +01:00
|
|
|
NMSupplicantFeature fast_support,
|
2017-03-18 14:56:38 +01:00
|
|
|
NMSupplicantFeature ap_support,
|
2018-01-16 06:28:37 +09:00
|
|
|
NMSupplicantFeature pmf_support,
|
2018-10-10 17:50:34 +02:00
|
|
|
NMSupplicantFeature fils_support,
|
|
|
|
|
NMSupplicantFeature p2p_support,
|
|
|
|
|
NMSupplicantFeature wfd_support);
|
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);
|
|
|
|
|
|
2017-02-14 19:30:21 +01:00
|
|
|
typedef void (*NMSupplicantInterfaceAssocCb) (NMSupplicantInterface *iface,
|
|
|
|
|
GError *error,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
nm_supplicant_interface_assoc (NMSupplicantInterface *self,
|
|
|
|
|
NMSupplicantConfig *cfg,
|
|
|
|
|
NMSupplicantInterfaceAssocCb callback,
|
|
|
|
|
gpointer user_data);
|
2006-12-19 19:15:31 +00:00
|
|
|
|
|
|
|
|
void nm_supplicant_interface_disconnect (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);
|
|
|
|
|
|
2018-08-12 11:43:25 +02:00
|
|
|
void nm_supplicant_interface_request_scan (NMSupplicantInterface *self,
|
|
|
|
|
GBytes *const*ssids,
|
|
|
|
|
guint ssids_len);
|
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
|
|
|
|
2017-02-14 01:30:25 +01:00
|
|
|
NMSupplicantInterfaceState nm_supplicant_interface_get_state (NMSupplicantInterface * self);
|
2006-12-04 19:09:44 +00:00
|
|
|
|
2017-02-14 01:30:25 +01:00
|
|
|
const char *nm_supplicant_interface_state_to_string (NMSupplicantInterfaceState state);
|
2008-10-26 16:32:29 +00:00
|
|
|
|
2009-05-13 11:16:29 -04:00
|
|
|
gboolean nm_supplicant_interface_get_scanning (NMSupplicantInterface *self);
|
|
|
|
|
|
2015-04-05 23:31:02 -05:00
|
|
|
const char *nm_supplicant_interface_get_current_bss (NMSupplicantInterface *self);
|
|
|
|
|
|
2018-06-15 13:57:30 +02:00
|
|
|
gint64 nm_supplicant_interface_get_last_scan (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);
|
|
|
|
|
|
2018-10-10 23:08:15 +02:00
|
|
|
gboolean nm_supplicant_interface_get_p2p_group_joined (NMSupplicantInterface *self);
|
|
|
|
|
|
2018-12-11 18:21:37 +01:00
|
|
|
const char* nm_supplicant_interface_get_p2p_group_path (NMSupplicantInterface *self);
|
|
|
|
|
|
2018-10-10 23:08:15 +02:00
|
|
|
gboolean nm_supplicant_interface_get_p2p_group_owner (NMSupplicantInterface *self);
|
|
|
|
|
|
2011-12-19 19:47:43 -06:00
|
|
|
gboolean nm_supplicant_interface_credentials_reply (NMSupplicantInterface *self,
|
|
|
|
|
const char *field,
|
|
|
|
|
const char *value,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2018-10-15 15:11:34 +02:00
|
|
|
void nm_supplicant_interface_p2p_start_find (NMSupplicantInterface *self,
|
|
|
|
|
guint timeout);
|
|
|
|
|
void nm_supplicant_interface_p2p_stop_find (NMSupplicantInterface *self);
|
|
|
|
|
|
2018-10-10 23:14:08 +02:00
|
|
|
void nm_supplicant_interface_p2p_connect (NMSupplicantInterface * self,
|
|
|
|
|
const char * peer,
|
|
|
|
|
const char * wps_method,
|
|
|
|
|
const char * wps_pin);
|
|
|
|
|
void nm_supplicant_interface_p2p_cancel_connect (NMSupplicantInterface * self);
|
|
|
|
|
void nm_supplicant_interface_p2p_disconnect (NMSupplicantInterface * self);
|
|
|
|
|
|
2015-10-06 20:02:40 -05:00
|
|
|
NMSupplicantFeature nm_supplicant_interface_get_ap_support (NMSupplicantInterface *self);
|
2017-04-18 13:39:43 +02:00
|
|
|
NMSupplicantFeature nm_supplicant_interface_get_pmf_support (NMSupplicantInterface *self);
|
2018-01-16 06:28:37 +09:00
|
|
|
NMSupplicantFeature nm_supplicant_interface_get_fils_support (NMSupplicantInterface *self);
|
2018-10-10 17:50:34 +02:00
|
|
|
NMSupplicantFeature nm_supplicant_interface_get_p2p_support (NMSupplicantInterface *self);
|
|
|
|
|
NMSupplicantFeature nm_supplicant_interface_get_wfd_support (NMSupplicantInterface *self);
|
2012-09-18 17:33:57 -05:00
|
|
|
|
|
|
|
|
void nm_supplicant_interface_set_ap_support (NMSupplicantInterface *self,
|
2015-10-06 20:02:40 -05:00
|
|
|
NMSupplicantFeature apmode);
|
2012-09-18 17:33:57 -05:00
|
|
|
|
2017-01-18 17:41:12 +01:00
|
|
|
void nm_supplicant_interface_set_fast_support (NMSupplicantInterface *self,
|
|
|
|
|
NMSupplicantFeature fast_support);
|
|
|
|
|
|
2017-03-18 14:56:38 +01:00
|
|
|
void nm_supplicant_interface_set_pmf_support (NMSupplicantInterface *self,
|
|
|
|
|
NMSupplicantFeature pmf_support);
|
2017-04-13 10:42:32 +02:00
|
|
|
|
2018-01-16 06:28:37 +09:00
|
|
|
void nm_supplicant_interface_set_fils_support (NMSupplicantInterface *self,
|
|
|
|
|
NMSupplicantFeature fils_support);
|
|
|
|
|
|
2018-10-10 17:50:34 +02:00
|
|
|
void nm_supplicant_interface_set_p2p_support (NMSupplicantInterface *self,
|
|
|
|
|
NMSupplicantFeature p2p_support);
|
|
|
|
|
|
|
|
|
|
void nm_supplicant_interface_set_wfd_support (NMSupplicantInterface *self,
|
|
|
|
|
NMSupplicantFeature wfd_support);
|
|
|
|
|
|
2017-04-13 10:42:32 +02:00
|
|
|
void nm_supplicant_interface_enroll_wps (NMSupplicantInterface *self,
|
|
|
|
|
const char *const type,
|
|
|
|
|
const char *bssid,
|
|
|
|
|
const char *pin);
|
|
|
|
|
|
|
|
|
|
void nm_supplicant_interface_cancel_wps (NMSupplicantInterface *self);
|
|
|
|
|
|
2017-01-18 17:41:12 +01:00
|
|
|
#endif /* __NM_SUPPLICANT_INTERFACE_H__ */
|