NetworkManager/src/NetworkManagerDevice.h
Dan Williams 305ff0adb0 Thu Aug 26 2004 Dan Williams <dcbw@redhat.com>
* panel-applet/NMWirelessApplet.[ch]
		- Rework menu code to add devices to menu, and to show
			signal strength for each access point.  Code cleanups
			too.

	* panel-applet/NMWirelessAppletDbus.c
		- Grab network devices from NetworkManager too
		- Grab quality information from NM for wireless networks

	* src/NetworkManagerDbus.[ch]
		- Add dbus methods for getting the HAL UDI from a device and
			for getting its base quality, if its wireless
		- Consolidate some functions (wireless network notifications,
			device notifications)
		- Add method for requesting NM to use a particular device

	* src/NetworkManager.c
		- Change for function consolidations from NetworkManagerDbus.c
		- Implement active device locking and user-requested devices
			(ie, tell NM to use a particular device instead of the one
			it autochose)

	* src/NetworkManagerDevice.c
		- Add method for getting the base quality of a device, if its
			wireless
		- Grab device base quailty info from iwlib during scans

	* src/NetworkManagerPolicy.c
		- Use a user-requested device rather than the auto-chosen device
			if we are told to


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@81 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-26 20:05:24 +00:00

109 lines
4 KiB
C

/* 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_DEVICE_H
#define NETWORK_MANAGER_DEVICE_H
#include <net/ethernet.h>
#include "NetworkManager.h"
/*
* Types of NetworkManager devices
*/
enum NMDeviceType
{
DEVICE_TYPE_DONT_KNOW = 0,
DEVICE_TYPE_WIRED_ETHERNET,
DEVICE_TYPE_WIRELESS_ETHERNET
};
typedef struct NMDevice NMDevice;
typedef enum NMDeviceType NMDeviceType;
NMDevice * nm_device_new (const char *iface, NMData *app_data);
void nm_device_ref (NMDevice *dev);
void nm_device_unref (NMDevice *dev);
char * nm_device_get_udi (NMDevice *dev);
void nm_device_set_udi (NMDevice *dev, const char *udi);
char * nm_device_get_iface (NMDevice *dev);
NMDeviceType nm_device_get_type (NMDevice *dev);
gboolean nm_device_is_wireless (NMDevice *dev);
gboolean nm_device_is_wired (NMDevice *dev);
/* There is no nm_device_set_iface_type() because that's determined when you set the device's iface */
gboolean nm_device_get_link_active (NMDevice *dev);
void nm_device_set_link_active (NMDevice *dev, const gboolean active);
void nm_device_update_link_active (NMDevice *dev, gboolean check_mii);
char * nm_device_get_essid (NMDevice *dev);
void nm_device_set_essid (NMDevice *dev, const char *essid);
void nm_device_get_ap_address (NMDevice *dev, struct ether_addr *addr);
guint32 nm_device_get_ip4_address (NMDevice *dev);
void nm_device_update_ip4_address (NMDevice *dev);
void nm_device_get_ip6_address (NMDevice *dev);
gboolean nm_device_get_supports_wireless_scan (NMDevice *dev);
void nm_device_do_wireless_scan (NMDevice *dev);
guint8 nm_device_get_max_quality (NMDevice *dev);
NMAccessPoint *nm_device_get_best_ap (NMDevice *dev);
void nm_device_set_best_ap (NMDevice *dev, NMAccessPoint *ap);
void nm_device_update_best_ap (NMDevice *dev);
gboolean nm_device_need_ap_switch (NMDevice *dev);
void nm_device_freeze_best_ap (NMDevice *dev);
void nm_device_unfreeze_best_ap (NMDevice *dev);
gboolean nm_device_get_best_ap_frozen (NMDevice *dev);
char * nm_device_get_path_for_ap (NMDevice *dev, NMAccessPoint *ap);
/* There is no function to get the WEP key since that's a slight security risk */
void nm_device_set_enc_key (NMDevice *dev, const char *key);
gboolean nm_device_activation_begin (NMDevice *dev);
void nm_device_activation_cancel (NMDevice *dev);
gboolean nm_device_just_activated (NMDevice *dev);
gboolean nm_device_activating (NMDevice *dev);
gboolean nm_device_deactivate (NMDevice *dev, gboolean just_added);
void nm_device_set_user_key_for_network (NMDevice *dev, struct NMAccessPointList *invalid_list,
unsigned char *network, unsigned char *key);
void nm_device_bring_up (NMDevice *dev);
void nm_device_bring_down (NMDevice *dev);
gboolean nm_device_is_up (NMDevice *dev);
void nm_device_ap_list_add (NMDevice *dev, NMAccessPoint *ap);
void nm_device_ap_list_clear (NMDevice *dev);
struct NMAccessPointList *nm_device_ap_list_get (NMDevice *dev);
NMAccessPoint *nm_device_ap_list_get_ap_by_essid (NMDevice *dev, const char *essid);
NMDevice * nm_get_device_by_udi (NMData *data, const char *udi);
NMDevice * nm_get_device_by_iface (NMData *data, const char *iface);
#endif