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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef NETWORK_MANAGER_AP_H
|
|
|
|
|
#define NETWORK_MANAGER_AP_H
|
|
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
|
|
typedef struct NMAccessPoint NMAccessPoint;
|
|
|
|
|
|
2004-08-02 21:12:40 +00:00
|
|
|
typedef enum NMAPEncMethod
|
|
|
|
|
{
|
2004-08-24 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerAP.[ch]
- Add a "enc_method_good" member and accessors to an Access Point
to signal when we've found the correct encryption method
for an access point
- Add a "timestamp" member and accessors, remove "priority" member
and accessors (use timestamps instead)
- Rename "wep_key"->"enc_key"
- (nm_ap_get_enc_key_hashed): new, return the correct mangled key
for a specified encryption method using the access points
source encryption key/passphrase
* src/NetworkManagerAPList.c
- When updating a network with dbus, grab timestamp now instead of
priority
* src/NetworkManagerDBus.[ch]
- Add signal for "DeviceActivating"
- Switch priority->timestamp
* src/NetworkManagerDevice.c
- Change references of "wep_key" -> "enc_key" or "key"
- Signal DeviceActivating when starting activation
- When activating a wireless device, if the access point we are connecting
to is encrypted, and we have a source key, try to generate a mangled
key and use that (ie, generate real WEP key from a passphrase)
- Rework device activation to fallback to other encryption methods if
a previous one didn't work (ie, try mangling a key as a 104-bit passphrase
first, then if that doesn't work fall back to direct hex key).
- (nm_device_update_best_ap): fix a deadlock, and use timestamps instead of
priority. We now prefer the latest access point used, rather than using
a priority scheme
- (nm_device_do_normal_scan): make the encryption method "unknown" on access
points we've just discovered, and merge in correct info from the global
access point lists
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@68 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-25 22:41:12 +00:00
|
|
|
NM_AP_ENC_METHOD_UNKNOWN = 0,
|
|
|
|
|
NM_AP_ENC_METHOD_NONE,
|
2004-10-08 05:22:17 +00:00
|
|
|
NM_AP_ENC_METHOD_128_BIT_HEX_KEY,
|
2004-08-02 21:12:40 +00:00
|
|
|
NM_AP_ENC_METHOD_40_BIT_PASSPHRASE,
|
2004-10-08 05:22:17 +00:00
|
|
|
NM_AP_ENC_METHOD_128_BIT_PASSPHRASE /* Well, 104-bit really... */
|
2004-08-02 21:12:40 +00:00
|
|
|
} NMAPEncMethod;
|
|
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-08 18:14:42 +00:00
|
|
|
NMAccessPoint * nm_ap_new (void);
|
2004-09-13 17:43:16 +00:00
|
|
|
NMAccessPoint * nm_ap_new_from_ap (NMAccessPoint *ap);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-13 17:43:16 +00:00
|
|
|
void nm_ap_unref (NMAccessPoint *ap);
|
2004-09-08 18:14:42 +00:00
|
|
|
void nm_ap_ref (NMAccessPoint *ap);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-08-29 05:40:32 +00:00
|
|
|
const GTimeVal * nm_ap_get_timestamp (NMAccessPoint *ap);
|
2004-09-08 18:14:42 +00:00
|
|
|
void nm_ap_set_timestamp (NMAccessPoint *ap, const GTimeVal *timestamp);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-10-08 05:22:17 +00:00
|
|
|
char * nm_ap_get_essid (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_essid (NMAccessPoint *ap, char *essid);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-10-08 05:22:17 +00:00
|
|
|
char * nm_ap_get_enc_key_source (NMAccessPoint *ap);
|
|
|
|
|
char * nm_ap_get_enc_key_hashed (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_enc_key_source (NMAccessPoint *ap, char *key, NMAPEncMethod method);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-08 18:14:42 +00:00
|
|
|
gboolean nm_ap_get_encrypted (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_encrypted (NMAccessPoint *ap, gboolean encrypted);
|
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
|
|
|
|
2004-09-13 17:43:16 +00:00
|
|
|
struct ether_addr * nm_ap_get_address (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_address (NMAccessPoint *ap, const struct ether_addr *addr);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-13 17:43:16 +00:00
|
|
|
gint8 nm_ap_get_strength (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_strength (NMAccessPoint *ap, gint8 strength);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-08 18:14:42 +00:00
|
|
|
double nm_ap_get_freq (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_freq (NMAccessPoint *ap, double freq);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-08 18:14:42 +00:00
|
|
|
guint16 nm_ap_get_rate (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_rate (NMAccessPoint *ap, guint16 rate);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-13 17:43:16 +00:00
|
|
|
gboolean nm_ap_get_invalid (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_invalid (NMAccessPoint *ap, gboolean invalid);
|
2004-06-24 14:18:37 +00:00
|
|
|
|
2004-09-13 17:43:16 +00:00
|
|
|
gboolean nm_ap_get_matched (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_matched (NMAccessPoint *ap, gboolean matched);
|
2004-08-02 21:12:40 +00:00
|
|
|
|
2004-09-13 17:43:16 +00:00
|
|
|
gboolean nm_ap_get_trusted (NMAccessPoint *ap);
|
|
|
|
|
void nm_ap_set_trusted (NMAccessPoint *ap, gboolean trusted);
|
2004-08-24 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerAP.[ch]
- Add a "enc_method_good" member and accessors to an Access Point
to signal when we've found the correct encryption method
for an access point
- Add a "timestamp" member and accessors, remove "priority" member
and accessors (use timestamps instead)
- Rename "wep_key"->"enc_key"
- (nm_ap_get_enc_key_hashed): new, return the correct mangled key
for a specified encryption method using the access points
source encryption key/passphrase
* src/NetworkManagerAPList.c
- When updating a network with dbus, grab timestamp now instead of
priority
* src/NetworkManagerDBus.[ch]
- Add signal for "DeviceActivating"
- Switch priority->timestamp
* src/NetworkManagerDevice.c
- Change references of "wep_key" -> "enc_key" or "key"
- Signal DeviceActivating when starting activation
- When activating a wireless device, if the access point we are connecting
to is encrypted, and we have a source key, try to generate a mangled
key and use that (ie, generate real WEP key from a passphrase)
- Rework device activation to fallback to other encryption methods if
a previous one didn't work (ie, try mangling a key as a 104-bit passphrase
first, then if that doesn't work fall back to direct hex key).
- (nm_device_update_best_ap): fix a deadlock, and use timestamps instead of
priority. We now prefer the latest access point used, rather than using
a priority scheme
- (nm_device_do_normal_scan): make the encryption method "unknown" on access
points we've just discovered, and merge in correct info from the global
access point lists
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@68 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-25 22:41:12 +00:00
|
|
|
|
2004-10-11 21:32:19 +00:00
|
|
|
const NMAPEncMethod nm_ap_get_enc_method (NMAccessPoint *ap);
|
2004-10-08 05:22:17 +00:00
|
|
|
|
2004-06-24 14:18:37 +00:00
|
|
|
#endif
|