2004-06-24 14:18:37 +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 2004 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
#ifndef NM_ACCESS_POINT_H
|
|
|
|
|
#define NM_ACCESS_POINT_H
|
2004-06-24 14:18:37 +00:00
|
|
|
|
|
|
|
|
#include <glib.h>
|
2007-02-16 11:23:49 +00:00
|
|
|
#include <glib/gtypes.h>
|
|
|
|
|
#include <glib-object.h>
|
2004-06-24 14:18:37 +00:00
|
|
|
#include <time.h>
|
2004-10-21 17:42:14 +00:00
|
|
|
#include "NetworkManager.h"
|
2007-09-10 19:11:40 +00:00
|
|
|
#include "nm-connection.h"
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
#define NM_TYPE_AP (nm_ap_get_type ())
|
|
|
|
|
#define NM_AP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AP, NMAccessPoint))
|
|
|
|
|
#define NM_AP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AP, NMAccessPointClass))
|
|
|
|
|
#define NM_IS_AP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_AP))
|
|
|
|
|
#define NM_IS_AP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_AP))
|
|
|
|
|
#define NM_AP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AP, NMAccessPointClass))
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
#define NM_AP_FLAGS "flags"
|
|
|
|
|
#define NM_AP_WPA_FLAGS "wpa-flags"
|
|
|
|
|
#define NM_AP_RSN_FLAGS "rsn-flags"
|
2007-06-27 16:18:52 +00:00
|
|
|
#define NM_AP_SSID "ssid"
|
2007-02-16 11:23:49 +00:00
|
|
|
#define NM_AP_FREQUENCY "frequency"
|
2007-02-19 13:09:32 +00:00
|
|
|
#define NM_AP_HW_ADDRESS "hw-address"
|
2007-02-16 11:23:49 +00:00
|
|
|
#define NM_AP_MODE "mode"
|
|
|
|
|
#define NM_AP_RATE "rate"
|
|
|
|
|
#define NM_AP_STRENGTH "strength"
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GObject parent;
|
|
|
|
|
} NMAccessPoint;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
GObjectClass parent;
|
|
|
|
|
|
|
|
|
|
/* Signals */
|
2007-09-19 20:44:37 +00:00
|
|
|
void (*properties_changed) (NMAccessPoint *ap, GHashTable *properties);
|
2007-02-16 11:23:49 +00:00
|
|
|
} NMAccessPointClass;
|
|
|
|
|
|
|
|
|
|
GType nm_ap_get_type (void);
|
2005-10-15 04:11:01 +00:00
|
|
|
|
2004-09-08 18:14:42 +00:00
|
|
|
NMAccessPoint * nm_ap_new (void);
|
2007-02-05 12:14:09 +00:00
|
|
|
NMAccessPoint * nm_ap_new_from_properties (GHashTable *properties);
|
2007-10-22 03:15:05 +00:00
|
|
|
NMAccessPoint * nm_ap_new_fake_from_connection (NMConnection *connection);
|
2007-09-19 20:44:37 +00:00
|
|
|
void nm_ap_export_to_dbus (NMAccessPoint *ap);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-03-16 09:06:48 +00:00
|
|
|
const char * nm_ap_get_dbus_path (NMAccessPoint *ap);
|
2006-03-09 Robert Love <rml@novell.com>
* src/NetworkManagerAP.c, src/NetworkManagerAP.h: Have the function
nm_ap_set_timestamp() take the second and micro-second parameters as
direct arguments, which avoids both a dynamic memory allocation and a
structure-to-structure copy! Add a new interface, the aptly named
nm_ap_set_timestamp_via_timestamp(), to set the timestamp from an
existing GTimeVal, as nm_ap_set_timestamp() once did, for use with
the return from nm_ap_get_timestamp(). New users should use the new
nm_ap_set_timestamp(), not nm_ap_set_timestamp_via_timestamp(), for
the extreme benefit to performance.
* src/NetworkManagerAPList.c, src/nm-dbus-nmi.c,
src/backends/NetworkManagerSuSE.c: Use the new functions as needed.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2006-03-09 15:24:30 +00:00
|
|
|
const GTimeVal * nm_ap_get_timestamp (const NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_timestamp (NMAccessPoint *ap, glong sec, glong usec);
|
|
|
|
|
void nm_ap_set_timestamp_via_timestamp (NMAccessPoint *ap, const GTimeVal *timestamp);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-06-27 16:18:52 +00:00
|
|
|
const GByteArray * nm_ap_get_ssid (const NMAccessPoint * ap);
|
|
|
|
|
void nm_ap_set_ssid (NMAccessPoint * ap, const GByteArray * ssid);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
guint32 nm_ap_get_flags (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_flags (NMAccessPoint *ap, guint32 flags);
|
2005-12-21 21:08:00 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
guint32 nm_ap_get_wpa_flags (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_wpa_flags (NMAccessPoint *ap, guint32 flags);
|
2004-07-15 Dan Williams <dcbw@redhat.com>
* src/Makefile.am
- Turn on warnings
* src/NetworkManager.c
- nm_create_device_and_add_to_list(): call nm_device_deactivate() rather
that doing the deactivation ourselves
- Cancel an pending actions on a device if its being removed
- Break up link state checking a bit, make non-active wireless cards
deactivated to save power
- Remove unused variables
* src/NetworkManager.h
- Add support for "pending" device
* src/NetworkManagerAP.h
src/NetworkManagerAP.c
- Add support for determining whether and AP has encryption enabled or not
- AP address is now "struct ether_addr" rather than a string
* src/NetworkManagerDbus.h
src/NetworkManagerDbus.c
- Add signal NeedKeyForNetwork, method SetKeyForNetwork (testing only)
- Changes for AP address from struct ether_addr->string
* src/NetworkManagerDevice.h
src/NetworkManagerDevice.c
- Remove unused variables, fix warnings
- Add support for Pending Actions (things that block a device from being "active"
until they are completed).
- First pending action: Get a WEP key from the user
- Add nm_device_is_wire[d|less](), rename nm_device_is_wireless()
- Clean up explicit testing of dev->iface_type to use nm_device_is_wireless()
- Update wireless link checking to try to determine if the AP we are associated
with is correct, but the WEP key we are using is just wrong. If its wrong,
trigger the GetUserKey pending action on the device
- If dhclient can't get an IP address, it brings the device down. Bring it back
up in that case, otherwise we can't scan or link-check on it
- Add IP address change notifications at appropriate points (still needs some work)
- Add nm_device_need_ap_switch(), checks whether we need to switch access points or not
* src/NetworkManagerPolicy.h
src/NetworkManagerPolicy.c
- Split out "best" access point determiniation into separate function
- Make device activation 2-stage: first the device is pending, then
in the next iteration through it becomes "active" unless it has
pending actions
* src/NetworkManagerUtils.h
src/NetworkManagerUtils.c
- Clean up unused variables and warnings
- Wrap our debug macros in {} to prevent possible confusion
* src/NetworkManagerWireless.c
- Forgot to return current best priority, which lead to last available AP always
being chosen no matter what its priority was. Corrected.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@15 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-07-15 16:51:48 +00:00
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
guint32 nm_ap_get_rsn_flags (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_rsn_flags (NMAccessPoint *ap, guint32 flags);
|
2005-12-16 03:23:36 +00:00
|
|
|
|
2005-12-14 20:48:08 +00:00
|
|
|
const struct ether_addr * nm_ap_get_address (const NMAccessPoint *ap);
|
2004-09-13 17:43:16 +00:00
|
|
|
void nm_ap_set_address (NMAccessPoint *ap, const struct ether_addr *addr);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
int nm_ap_get_mode (NMAccessPoint *ap);
|
2005-12-07 17:40:37 +00:00
|
|
|
void nm_ap_set_mode (NMAccessPoint *ap, const int mode);
|
2004-12-16 04:24:20 +00:00
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
gint8 nm_ap_get_strength (NMAccessPoint *ap);
|
2004-09-13 17:43:16 +00:00
|
|
|
void nm_ap_set_strength (NMAccessPoint *ap, gint8 strength);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-09-10 19:56:31 +00:00
|
|
|
guint32 nm_ap_get_freq (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_freq (NMAccessPoint *ap, guint32 freq);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-10-27 02:58:32 +00:00
|
|
|
guint32 nm_ap_get_rate (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_rate (NMAccessPoint *ap, guint32 rate);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2005-01-18 Dan Williams <dcbw@redhat.com>
* dhcpcd/client.c
- Remove some debug messages
- Wrap others in #ifdef DEBUG/#endif
* src/NetworkManager.c
- Remove some debug messages
- Clarify some debug messages
- Remove code related to old single-thread wireless scanning
* src/NetworkManagerAP.[ch]
- New AP property "last_seen" to track how recently an AP was
found in a scan
- Start using 'const' more in function arguments
* src/NetworkManagerAPList.[ch]
- (nm_ap_list_merge_scanned_ap): new, selectively update attributes
of an AP found in an AP list from a source AP, or if not found
in the list add the source AP
- (nm_ap_list_combine): remove, no longer needed
* src/NetworkManagerDevice.c
- Each device now has a "worker" thread from start to end of its life.
Scanning for wireless devices now happens in that thread,
not in a single "wireless scanning thread" for all devices as
previously. Activation consists of adding an idle handler to the
thread's main loop/context, which gets run at the next available
opportunity.
- Wireless scanning is also simplified, there is now only one list of
access points per wireless device, and APs older than 60s are
removed from the list. Previously, we kept results for the last
3 scans and merged whole lists, which was complicated.
- Cleaned up activation debug messages.
- Wireless activation and access-point search routines now use Open System
authentication before trying Shared Key.
- Removed some code in nm_device_update_best_ap() that could cause cards
to loose their link to the access point.
- Scanning now uses a backoff algorithm, where the inverval becomes
progressively longer between scans when the list of scanned access
points doesn't change. A change will revert to the shortest scan
interval (20s).
* src/NetworkManagerWireless.[ch]
- Remove code related to old single-thread wireless scanning
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@382 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-01-18 22:08:22 +00:00
|
|
|
gboolean nm_ap_get_invalid (const NMAccessPoint *ap);
|
2004-09-13 17:43:16 +00:00
|
|
|
void nm_ap_set_invalid (NMAccessPoint *ap, gboolean invalid);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2007-10-22 03:15:05 +00:00
|
|
|
gboolean nm_ap_get_fake (const NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_fake (NMAccessPoint *ap, gboolean fake);
|
2004-10-15 17:04:57 +00:00
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
gboolean nm_ap_get_broadcast (NMAccessPoint *ap);
|
2006-02-02 18:05:19 +00:00
|
|
|
void nm_ap_set_broadcast (NMAccessPoint *ap, gboolean broadcast);
|
|
|
|
|
|
2007-03-26 12:29:49 +00:00
|
|
|
glong nm_ap_get_last_seen (const NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_last_seen (NMAccessPoint *ap, const glong last_seen);
|
2005-01-18 Dan Williams <dcbw@redhat.com>
* dhcpcd/client.c
- Remove some debug messages
- Wrap others in #ifdef DEBUG/#endif
* src/NetworkManager.c
- Remove some debug messages
- Clarify some debug messages
- Remove code related to old single-thread wireless scanning
* src/NetworkManagerAP.[ch]
- New AP property "last_seen" to track how recently an AP was
found in a scan
- Start using 'const' more in function arguments
* src/NetworkManagerAPList.[ch]
- (nm_ap_list_merge_scanned_ap): new, selectively update attributes
of an AP found in an AP list from a source AP, or if not found
in the list add the source AP
- (nm_ap_list_combine): remove, no longer needed
* src/NetworkManagerDevice.c
- Each device now has a "worker" thread from start to end of its life.
Scanning for wireless devices now happens in that thread,
not in a single "wireless scanning thread" for all devices as
previously. Activation consists of adding an idle handler to the
thread's main loop/context, which gets run at the next available
opportunity.
- Wireless scanning is also simplified, there is now only one list of
access points per wireless device, and APs older than 60s are
removed from the list. Previously, we kept results for the last
3 scans and merged whole lists, which was complicated.
- Cleaned up activation debug messages.
- Wireless activation and access-point search routines now use Open System
authentication before trying Shared Key.
- Removed some code in nm_device_update_best_ap() that could cause cards
to loose their link to the access point.
- Scanning now uses a backoff algorithm, where the inverval becomes
progressively longer between scans when the list of scanned access
points doesn't change. A change will revert to the shortest scan
interval (20s).
* src/NetworkManagerWireless.[ch]
- Remove code related to old single-thread wireless scanning
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@382 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-01-18 22:08:22 +00:00
|
|
|
|
|
|
|
|
gboolean nm_ap_get_user_created (const NMAccessPoint *ap);
|
2004-12-17 17:16:22 +00:00
|
|
|
void nm_ap_set_user_created (NMAccessPoint *ap, gboolean user_created);
|
|
|
|
|
|
2005-01-18 Dan Williams <dcbw@redhat.com>
* dhcpcd/client.c
- Remove some debug messages
- Wrap others in #ifdef DEBUG/#endif
* src/NetworkManager.c
- Remove some debug messages
- Clarify some debug messages
- Remove code related to old single-thread wireless scanning
* src/NetworkManagerAP.[ch]
- New AP property "last_seen" to track how recently an AP was
found in a scan
- Start using 'const' more in function arguments
* src/NetworkManagerAPList.[ch]
- (nm_ap_list_merge_scanned_ap): new, selectively update attributes
of an AP found in an AP list from a source AP, or if not found
in the list add the source AP
- (nm_ap_list_combine): remove, no longer needed
* src/NetworkManagerDevice.c
- Each device now has a "worker" thread from start to end of its life.
Scanning for wireless devices now happens in that thread,
not in a single "wireless scanning thread" for all devices as
previously. Activation consists of adding an idle handler to the
thread's main loop/context, which gets run at the next available
opportunity.
- Wireless scanning is also simplified, there is now only one list of
access points per wireless device, and APs older than 60s are
removed from the list. Previously, we kept results for the last
3 scans and merged whole lists, which was complicated.
- Cleaned up activation debug messages.
- Wireless activation and access-point search routines now use Open System
authentication before trying Shared Key.
- Removed some code in nm_device_update_best_ap() that could cause cards
to loose their link to the access point.
- Scanning now uses a backoff algorithm, where the inverval becomes
progressively longer between scans when the list of scanned access
points doesn't change. A change will revert to the shortest scan
interval (20s).
* src/NetworkManagerWireless.[ch]
- Remove code related to old single-thread wireless scanning
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@382 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-01-18 22:08:22 +00:00
|
|
|
GSList * nm_ap_get_user_addresses (const NMAccessPoint *ap);
|
2004-11-17 Dan Williams <dcbw@redhat.com>
* Cache access point MAC addresses in NetworkManagerInfo after you've explicitly
connected to them. Then, after a scan, match up non-ESSID-broadcasting access
points with any cached MAC addresses from NetworkManagerInfo. Allows us to
show known access points that don't broadcast their ESSID in the menus without
any user intervention whatsoever.
* info-daemon/NetworkManagerInfoDbus.c
- (nmi_dbus_get_network_addresses, nmi_dbus_add_network_address): new functions
for dbus method calls "getNetworkAddresses" and "addNetworkAddress"
* src/NetworkManagerAP.[ch]
- Add a "user_addresses" data member to the NMAccessPoint structure
- (nm_ap_get_user_addresses, nm_ap_set_user_addresses): new functions for accessing
the user_addresses data member
* src/NetworkManagerAPList.c
- (nm_ap_list_get_ap_by_address): check user_addresses list too, instead of just
the AP's reported address
- (nm_ap_list_update_network): grab the user_addresses list from NetworkManagerInfo
* src/NetworkManagerDHCP.c
- Increase DHCP timeout from 25s -> 30s
* src/NetworkManagerDbus.[ch]
- (nm_dbus_get_network_addresses, nm_dbus_add_network_address): have NMI get/set
user addresses
* src/NetworkManagerDevice.c
- (nm_device_set_wireless_config): bring down the interface, wait 4s, bring it up,
wait 2s, then configure it. Sometimes Prism54 cards will freeze up with
"mgnt tx queue full", seemingly in response to NM controlling the card too much.
So, we take the card down to clear it out.
- (nm_device_do_normal_scan): Copy over AP ESSIDs from the allowed access point list
too, since that's where the user_addresses are
* src/NetworkManagerPolicy.c
- (nm_state_modification_monitor): Tell NMI to add an AP's hardware address to
that wireless networks' user_addresses list upon successful activation
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@319 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-11-17 17:51:36 +00:00
|
|
|
void nm_ap_set_user_addresses (NMAccessPoint *ap, GSList *list);
|
|
|
|
|
|
2007-08-28 14:47:31 +00:00
|
|
|
guint32 nm_ap_add_security_from_ie (guint32 flags,
|
|
|
|
|
const guint8 *wpa_ie,
|
|
|
|
|
guint32 length);
|
2005-10-15 04:11:01 +00:00
|
|
|
|
2007-09-10 19:11:40 +00:00
|
|
|
gboolean nm_ap_check_compatible (NMAccessPoint *self,
|
|
|
|
|
NMConnection *connection);
|
|
|
|
|
|
2007-10-22 03:15:05 +00:00
|
|
|
NMAccessPoint * nm_ap_match_in_list (NMAccessPoint *find_ap,
|
|
|
|
|
GSList *ap_list,
|
|
|
|
|
gboolean strict_match);
|
|
|
|
|
|
2007-08-21 01:41:04 +00:00
|
|
|
void nm_ap_print_self (NMAccessPoint *ap, const char * prefix);
|
|
|
|
|
|
2007-09-10 19:51:25 +00:00
|
|
|
guint32 freq_to_channel (guint32 freq);
|
|
|
|
|
guint32 channel_to_freq (guint32 channel);
|
2007-09-10 19:11:40 +00:00
|
|
|
|
2007-02-16 11:23:49 +00:00
|
|
|
#endif /* NM_ACCESS_POINT_H */
|