NetworkManager/src/NetworkManagerMain.h

111 lines
2.9 KiB
C
Raw Normal View History

/* 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_MAIN_H
#define NETWORK_MANAGER_MAIN_H
#include <glib.h>
#include <glib/gthread.h>
2004-07-27 Dan Williams <dcbw@redhat.com> * src/NetworkManagerAPList.[ch] src/Makefile.am - Add. Deal with allowed network list additions, deletions, and updates * dispatcher-daemon/NetworkManagerDispatcher.c - Add missing <dbus/dbus.h> header * info-daemon/NetworkManagerInfo.[ch] - Add missing <dbus/dbus.h> header - Implement the GConf notify callback to signal NetworkManager of an allowed network change - Better error checking * info-daemon/NetworkManagerInfoDbus.[ch] - Add missing <dbus/dbus.h> header - Convert to using dbus_message_append_args/dbus_message_get_args - Implement nmi_dbus_signal_update_allowed_network() to signal NetworkManager that an allowed network changed. We don't want to signal on individual keys _inside_ an allowed network really, just want NM to query the info daemon for updated info on all keys. - Better error checking * src/NetworkManager.[ch] - Add missing <dbus/dbus.h> header - Move allowed_ap_list free functions to NetworkManagerAPList.[ch] - Zero out NMData structure on free - No longer use a thread for allowed_ap_list updating, instead its now done through dbus queries against NetworkManagerInfo - Populate allowed_ap_list initially before adding existing network devices to the device list, so wireless devices can get their "best" AP * src/NetworkManagerDbus.[ch] - Convert to using dbus_message_append_args/dbus_message_get_args - Better error checking - Implement Allowed Network info functions to request allowed network info from NetworkManagerInfo - Implement the filter function to process signals from NetworkManagerInfo about changing allowed networks * src/NetworkManagerDevice.c - Fix file descriptor leak in nm_device_update_ip4_address() `CVS: Modified Files: git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@22 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-07-27 16:15:36 +00:00
#include <dbus/dbus.h>
#include <libhal.h>
#include "NetworkManager.h"
#include "NetworkManagerAP.h"
#include "nm-netlink-monitor.h"
#include "nm-named-manager.h"
typedef enum NMIntState
{
NM_INT_STATE_UNKNOWN = 0,
NM_INT_STATE_ASLEEP,
NM_INT_STATE_CONFIGURE_AP,
NM_INT_STATE_CONFIGURE_DEV,
NM_INT_STATE_CONFIGURE_IP,
NM_INT_STATE_CONNECTED,
NM_INT_STATE_DISCONNECTED
} NMIntState;
2005-02-07 Dan Williams <dcbw@redhat.com> * panel-applet/NMWirelessApplet.[ch] - Add a context menu that contains: Pause/Resume Wireless Scanning Stop/Start All Wireless Devices About... - Grab active device strength off active device, not its network * panel-applet/NMWirelessAppletDbus.[ch] - Add DBUS accessors for "getSupportsCarrierDetect", "setScanningEnabled", "getScanningEnabled", "setWirelessEnabled", and "getWirelessEnabled" - Update active device strength every 2 seconds, not every 1 second * panel-applet/menu-info.c - Only disable wired devices in the menu when they support carrier detection, and don't currently have a link. Non-carrier-detect devices will always remain choosable * src/Makefile.am src/NetworkManagerDbusUtils.[ch] - Add new new dbus utils sources * src/NetworkManager.c - Fixes for new link detection, we no longer need to call nm_device_update_link_active() with the boolean parameter - Set scanning_enabled & wireless_enabled to TRUE * src/NetworkManagerDbus.c - Use new dbus util method dispatcher functions for org.freedesktop.NetworkManager methods - Implement scanning & wireless enable/disable calls - Remove the dbus vtable unregister handlers, weren't doing anything with them anyway * src/NetworkManagerDevice.c - New link detection stuff again... o Create device's mainloop earlier (but don't run it earlier) o Hook up new carrier-detect support stuff o Add in the ethtool & mii support detection code - Don't scan if scanning is disabled * src/NetworkManagerPolicy.c - Never automatically choose a device that doesn't support carrier detection - Don't automatically choose a wireless device if wireless is disabled git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@416 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-02-07 23:04:05 +00:00
typedef struct NMDbusMethodList NMDbusMethodList;
typedef struct NMActRequest NMActRequest;
typedef struct NMVPNActRequest NMVPNActRequest;
typedef struct NMVPNManager NMVPNManager;
typedef struct NMDHCPManager NMDHCPManager;
2005-02-07 Dan Williams <dcbw@redhat.com> * panel-applet/NMWirelessApplet.[ch] - Add a context menu that contains: Pause/Resume Wireless Scanning Stop/Start All Wireless Devices About... - Grab active device strength off active device, not its network * panel-applet/NMWirelessAppletDbus.[ch] - Add DBUS accessors for "getSupportsCarrierDetect", "setScanningEnabled", "getScanningEnabled", "setWirelessEnabled", and "getWirelessEnabled" - Update active device strength every 2 seconds, not every 1 second * panel-applet/menu-info.c - Only disable wired devices in the menu when they support carrier detection, and don't currently have a link. Non-carrier-detect devices will always remain choosable * src/Makefile.am src/NetworkManagerDbusUtils.[ch] - Add new new dbus utils sources * src/NetworkManager.c - Fixes for new link detection, we no longer need to call nm_device_update_link_active() with the boolean parameter - Set scanning_enabled & wireless_enabled to TRUE * src/NetworkManagerDbus.c - Use new dbus util method dispatcher functions for org.freedesktop.NetworkManager methods - Implement scanning & wireless enable/disable calls - Remove the dbus vtable unregister handlers, weren't doing anything with them anyway * src/NetworkManagerDevice.c - New link detection stuff again... o Create device's mainloop earlier (but don't run it earlier) o Hook up new carrier-detect support stuff o Add in the ethtool & mii support detection code - Don't scan if scanning is disabled * src/NetworkManagerPolicy.c - Never automatically choose a device that doesn't support carrier detection - Don't automatically choose a wireless device if wireless is disabled git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@416 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-02-07 23:04:05 +00:00
#define DHCP_SERVICE_NAME "com.redhat.dhcp"
#define DHCP_OBJECT_PATH "/com/redhat/dhcp"
2005-02-07 Dan Williams <dcbw@redhat.com> * panel-applet/NMWirelessApplet.[ch] - Add a context menu that contains: Pause/Resume Wireless Scanning Stop/Start All Wireless Devices About... - Grab active device strength off active device, not its network * panel-applet/NMWirelessAppletDbus.[ch] - Add DBUS accessors for "getSupportsCarrierDetect", "setScanningEnabled", "getScanningEnabled", "setWirelessEnabled", and "getWirelessEnabled" - Update active device strength every 2 seconds, not every 1 second * panel-applet/menu-info.c - Only disable wired devices in the menu when they support carrier detection, and don't currently have a link. Non-carrier-detect devices will always remain choosable * src/Makefile.am src/NetworkManagerDbusUtils.[ch] - Add new new dbus utils sources * src/NetworkManager.c - Fixes for new link detection, we no longer need to call nm_device_update_link_active() with the boolean parameter - Set scanning_enabled & wireless_enabled to TRUE * src/NetworkManagerDbus.c - Use new dbus util method dispatcher functions for org.freedesktop.NetworkManager methods - Implement scanning & wireless enable/disable calls - Remove the dbus vtable unregister handlers, weren't doing anything with them anyway * src/NetworkManagerDevice.c - New link detection stuff again... o Create device's mainloop earlier (but don't run it earlier) o Hook up new carrier-detect support stuff o Add in the ethtool & mii support detection code - Don't scan if scanning is disabled * src/NetworkManagerPolicy.c - Never automatically choose a device that doesn't support carrier detection - Don't automatically choose a wireless device if wireless is disabled git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@416 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-02-07 23:04:05 +00:00
2004-08-31 Dan Williams <dcbw@redhat.com> * Remove 'debug' extern global from all files since we now use syslog() * src/NetworkManager.[ch] - Break out routine that get the net.interface property from HAL, removing that logic from nm_create_device_and_add_to_list() - (nm_create_device_and_add_to_list): make this a bit more general so it doesn't do the talking to HAL. Also add arguments to facilitate the create of test devices. - (nm_data_mark_state_changed): rename from nm_data_set_state_modified() - (nm_data_new, main, nm_print_usage): add new argument "--enable-test-devices" which makes NetworkManager listen for dbus commands to create test devices, which have no backing hardware. Use when you're on a plane for example, and/or forgot your wireless card at home. Test devices _cannot_ be created unless NM is started with --enable-test-devices. * src/NetworkManagerDbus.[ch] - New "getLinkActive" method for devices - New "setLinkActive" method for devices (only works on test devices) - New "createTestDevice" method on NetworkManager object to create a test device of a specified type (ie wired, wireless). UDI is created from scratch, as is the interface name. Only works when NM is started with --enable-test-devices switch. - New "removeTestDevice" method on NetworkManager object which removes a test device. Only works when NM is started with --enable-test-devices * src/NetworkManagerDevice.[ch] - Logic to facilitate test devices. Add variables to NMDevice struct to indicate whether a device is a test device or not, and what its link status is. - Deal with test devices in most functions. For those that work directly on hardware special-case test devices. - (nm_device_new): don't create a test device if test devices weren't enabled on the command-line. - (nm_device_update_link_active): split out logic for wired and wireless device link checking to separate functions to facilitate test device link checking. - (nm_device_set_enc_key): Since some drivers for wireless cards are daft and don't make a distinction between System Authentication and Encryption (namely Cisco aironet), we use Open System auth when setting a WEP key on the card. We don't deal with Shared Key auth yet. - (nm_device_activation_worker): split the activation cancel check logic out into a separate routine nm_device_activation_cancel_if_needed() - (nm_device_activation_signal_cancel): rename from nm_device_activation_cancel() - (nm_device_fake_ap_list): Test wireless devices obviously cannot scan, so create a list of fake access points that they can "see" - (nm_device_is_test_device): return whether or not a device is a test device * src/NetworkManagerPolicy.c - (nm_policy_get_best_device): attempt to deal with wireless network selection, previously if you "locked"/forced NM to use a wireless device but then selected a wireless network for NM to use, it would switch to a wired device. So, if the active device is wireless and it has a "forced" best AP, use it if the "forced" best AP is still valid - (nm_state_modification_monitor): deal with NULL best devices, for example there were no usable network devices, or the last one was removed * src/backends/NetworkManager*.c - Deal with test devices, mostly just return success for operations like getting a DHCP address * test/nmtestdevices.c - Test tool to create/remove/link-switch test devices git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@112 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-31 16:09:15 +00:00
typedef struct NMData
{
GIOChannel * sigterm_iochannel;
int sigterm_pipe[2];
LibHalContext * hal_ctx;
NmNetlinkMonitor * netlink_monitor;
NMNamedManager * named_manager;
NMVPNManager * vpn_manager;
NMDHCPManager * dhcp_manager;
DBusConnection * dbus_connection;
NMDbusMethodList * nm_methods;
NMDbusMethodList * device_methods;
NMDbusMethodList * net_methods;
NMDbusMethodList * vpn_methods;
2005-02-07 Dan Williams <dcbw@redhat.com> * panel-applet/NMWirelessApplet.[ch] - Add a context menu that contains: Pause/Resume Wireless Scanning Stop/Start All Wireless Devices About... - Grab active device strength off active device, not its network * panel-applet/NMWirelessAppletDbus.[ch] - Add DBUS accessors for "getSupportsCarrierDetect", "setScanningEnabled", "getScanningEnabled", "setWirelessEnabled", and "getWirelessEnabled" - Update active device strength every 2 seconds, not every 1 second * panel-applet/menu-info.c - Only disable wired devices in the menu when they support carrier detection, and don't currently have a link. Non-carrier-detect devices will always remain choosable * src/Makefile.am src/NetworkManagerDbusUtils.[ch] - Add new new dbus utils sources * src/NetworkManager.c - Fixes for new link detection, we no longer need to call nm_device_update_link_active() with the boolean parameter - Set scanning_enabled & wireless_enabled to TRUE * src/NetworkManagerDbus.c - Use new dbus util method dispatcher functions for org.freedesktop.NetworkManager methods - Implement scanning & wireless enable/disable calls - Remove the dbus vtable unregister handlers, weren't doing anything with them anyway * src/NetworkManagerDevice.c - New link detection stuff again... o Create device's mainloop earlier (but don't run it earlier) o Hook up new carrier-detect support stuff o Add in the ethtool & mii support detection code - Don't scan if scanning is disabled * src/NetworkManagerPolicy.c - Never automatically choose a device that doesn't support carrier detection - Don't automatically choose a wireless device if wireless is disabled git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@416 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-02-07 23:04:05 +00:00
GMainContext * main_context;
GMainLoop * main_loop;
gboolean enable_test_devices;
guint dev_change_check_idle_id;
GSList * dev_list;
GMutex * dev_list_mutex;
gboolean wireless_enabled;
gboolean asleep;
2005-02-07 Dan Williams <dcbw@redhat.com> * panel-applet/NMWirelessApplet.[ch] - Add a context menu that contains: Pause/Resume Wireless Scanning Stop/Start All Wireless Devices About... - Grab active device strength off active device, not its network * panel-applet/NMWirelessAppletDbus.[ch] - Add DBUS accessors for "getSupportsCarrierDetect", "setScanningEnabled", "getScanningEnabled", "setWirelessEnabled", and "getWirelessEnabled" - Update active device strength every 2 seconds, not every 1 second * panel-applet/menu-info.c - Only disable wired devices in the menu when they support carrier detection, and don't currently have a link. Non-carrier-detect devices will always remain choosable * src/Makefile.am src/NetworkManagerDbusUtils.[ch] - Add new new dbus utils sources * src/NetworkManager.c - Fixes for new link detection, we no longer need to call nm_device_update_link_active() with the boolean parameter - Set scanning_enabled & wireless_enabled to TRUE * src/NetworkManagerDbus.c - Use new dbus util method dispatcher functions for org.freedesktop.NetworkManager methods - Implement scanning & wireless enable/disable calls - Remove the dbus vtable unregister handlers, weren't doing anything with them anyway * src/NetworkManagerDevice.c - New link detection stuff again... o Create device's mainloop earlier (but don't run it earlier) o Hook up new carrier-detect support stuff o Add in the ethtool & mii support detection code - Don't scan if scanning is disabled * src/NetworkManagerPolicy.c - Never automatically choose a device that doesn't support carrier detection - Don't automatically choose a wireless device if wireless is disabled git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@416 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2005-02-07 23:04:05 +00:00
GSList * dialup_list;
GMutex * dialup_list_mutex;
2004-09-08 Dan Williams <dcbw@redhat.com> * panel-applet/no-networkmanager.png panel-applet/Makefile.am panel-applet/NMWirelessApplet.c - Add a "NetworkManager not running" icon and use it - Use new consolidated GConf keys rather than Preferred/Trusted * TODO: update * info-daemon/NetworkManagerInfo.c info-daemon/NetworkManagerInfoDbus.[ch] info-daemon/NetworkManagerInfoPassphraseDialog.c - There are now no longer two separate lists of wireless networks, but one list where each network is "trusted" or not trusted - Add a "getNetworkTrusted" dbus method - "WirelessNetworkUpdate" signal now sent rather than "PreferredNetworkUpdate/TrustedNetworkUpdate" signals - Start freeing some dbus errors (not completed yet) * info-daemon/passphrase.glade - Remove the "don't show" hints for pager and taskbar - Add a title since its going to be in the taskbar * src/NetworkManager.[ch] src/NetworkManagerAPList.[ch] - There are now no longer two separate lists of wireless networks, but one list where each network is "trusted" or not trusted * src/NetworkManagerAP.[ch] - Add get/set "trusted" accessors and data bit * src/NetworkManagerDbus.[ch] - Add function to get "trusted" status of a network from NetworkManagerInfo - Trap new WirelessNetworkUpdate signal rather than old separate signals * src/NetworkManagerDevice.[ch] - Add per-device config data (ip4 addr, gateway, netmask) and accessors - (nm_device_new): Get device config from backend when initializing devices - (nm_device_activation_worker): Split out device configuration on activation to deal with static/dynamic IP differences, and try encryption fallbacks on a device if the encryption method for the best AP is not good - (nm_device_update_best_ap): convert to new consolidated access point lists from NetworkManagerInfo, and copy over latest NMI info to best_ap when setting it * src/NetworkManagerWireless.c - libgcrypt code wasn't converting the MD5 digest to an ascii string, fix it * src/backends/NetworkManagerRedHat.c src/backends/NetworkManagerSystem.h - (nm_system_device_update_config_info): Add function to get device configuration from system data in ifcfg-* files * src/backends/NetworkManagerDebian.c src/backends/NetworkManagerGentoo.c src/backends/NetworkManagerSlackware.c - Add stub functions for getting device configuration git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@131 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-09-08 18:14:42 +00:00
struct NMAccessPointList *allowed_ap_list;
struct NMAccessPointList *invalid_ap_list;
2004-08-31 Dan Williams <dcbw@redhat.com> * Remove 'debug' extern global from all files since we now use syslog() * src/NetworkManager.[ch] - Break out routine that get the net.interface property from HAL, removing that logic from nm_create_device_and_add_to_list() - (nm_create_device_and_add_to_list): make this a bit more general so it doesn't do the talking to HAL. Also add arguments to facilitate the create of test devices. - (nm_data_mark_state_changed): rename from nm_data_set_state_modified() - (nm_data_new, main, nm_print_usage): add new argument "--enable-test-devices" which makes NetworkManager listen for dbus commands to create test devices, which have no backing hardware. Use when you're on a plane for example, and/or forgot your wireless card at home. Test devices _cannot_ be created unless NM is started with --enable-test-devices. * src/NetworkManagerDbus.[ch] - New "getLinkActive" method for devices - New "setLinkActive" method for devices (only works on test devices) - New "createTestDevice" method on NetworkManager object to create a test device of a specified type (ie wired, wireless). UDI is created from scratch, as is the interface name. Only works when NM is started with --enable-test-devices switch. - New "removeTestDevice" method on NetworkManager object which removes a test device. Only works when NM is started with --enable-test-devices * src/NetworkManagerDevice.[ch] - Logic to facilitate test devices. Add variables to NMDevice struct to indicate whether a device is a test device or not, and what its link status is. - Deal with test devices in most functions. For those that work directly on hardware special-case test devices. - (nm_device_new): don't create a test device if test devices weren't enabled on the command-line. - (nm_device_update_link_active): split out logic for wired and wireless device link checking to separate functions to facilitate test device link checking. - (nm_device_set_enc_key): Since some drivers for wireless cards are daft and don't make a distinction between System Authentication and Encryption (namely Cisco aironet), we use Open System auth when setting a WEP key on the card. We don't deal with Shared Key auth yet. - (nm_device_activation_worker): split the activation cancel check logic out into a separate routine nm_device_activation_cancel_if_needed() - (nm_device_activation_signal_cancel): rename from nm_device_activation_cancel() - (nm_device_fake_ap_list): Test wireless devices obviously cannot scan, so create a list of fake access points that they can "see" - (nm_device_is_test_device): return whether or not a device is a test device * src/NetworkManagerPolicy.c - (nm_policy_get_best_device): attempt to deal with wireless network selection, previously if you "locked"/forced NM to use a wireless device but then selected a wireless network for NM to use, it would switch to a wired device. So, if the active device is wireless and it has a "forced" best AP, use it if the "forced" best AP is still valid - (nm_state_modification_monitor): deal with NULL best devices, for example there were no usable network devices, or the last one was removed * src/backends/NetworkManager*.c - Deal with test devices, mostly just return success for operations like getting a DHCP address * test/nmtestdevices.c - Test tool to create/remove/link-switch test devices git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@112 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-31 16:09:15 +00:00
} NMData;
2004-08-31 Dan Williams <dcbw@redhat.com> * Remove 'debug' extern global from all files since we now use syslog() * src/NetworkManager.[ch] - Break out routine that get the net.interface property from HAL, removing that logic from nm_create_device_and_add_to_list() - (nm_create_device_and_add_to_list): make this a bit more general so it doesn't do the talking to HAL. Also add arguments to facilitate the create of test devices. - (nm_data_mark_state_changed): rename from nm_data_set_state_modified() - (nm_data_new, main, nm_print_usage): add new argument "--enable-test-devices" which makes NetworkManager listen for dbus commands to create test devices, which have no backing hardware. Use when you're on a plane for example, and/or forgot your wireless card at home. Test devices _cannot_ be created unless NM is started with --enable-test-devices. * src/NetworkManagerDbus.[ch] - New "getLinkActive" method for devices - New "setLinkActive" method for devices (only works on test devices) - New "createTestDevice" method on NetworkManager object to create a test device of a specified type (ie wired, wireless). UDI is created from scratch, as is the interface name. Only works when NM is started with --enable-test-devices switch. - New "removeTestDevice" method on NetworkManager object which removes a test device. Only works when NM is started with --enable-test-devices * src/NetworkManagerDevice.[ch] - Logic to facilitate test devices. Add variables to NMDevice struct to indicate whether a device is a test device or not, and what its link status is. - Deal with test devices in most functions. For those that work directly on hardware special-case test devices. - (nm_device_new): don't create a test device if test devices weren't enabled on the command-line. - (nm_device_update_link_active): split out logic for wired and wireless device link checking to separate functions to facilitate test device link checking. - (nm_device_set_enc_key): Since some drivers for wireless cards are daft and don't make a distinction between System Authentication and Encryption (namely Cisco aironet), we use Open System auth when setting a WEP key on the card. We don't deal with Shared Key auth yet. - (nm_device_activation_worker): split the activation cancel check logic out into a separate routine nm_device_activation_cancel_if_needed() - (nm_device_activation_signal_cancel): rename from nm_device_activation_cancel() - (nm_device_fake_ap_list): Test wireless devices obviously cannot scan, so create a list of fake access points that they can "see" - (nm_device_is_test_device): return whether or not a device is a test device * src/NetworkManagerPolicy.c - (nm_policy_get_best_device): attempt to deal with wireless network selection, previously if you "locked"/forced NM to use a wireless device but then selected a wireless network for NM to use, it would switch to a wired device. So, if the active device is wireless and it has a "forced" best AP, use it if the "forced" best AP is still valid - (nm_state_modification_monitor): deal with NULL best devices, for example there were no usable network devices, or the last one was removed * src/backends/NetworkManager*.c - Deal with test devices, mostly just return success for operations like getting a DHCP address * test/nmtestdevices.c - Test tool to create/remove/link-switch test devices git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@112 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-31 16:09:15 +00:00
struct NMDevice * nm_get_active_device (NMData *data);
struct NMDevice * nm_create_device_and_add_to_list (NMData *data, const char *udi, const char *iface,
gboolean test_device, NMDeviceType test_device_type);
2004-08-31 Dan Williams <dcbw@redhat.com> * Remove 'debug' extern global from all files since we now use syslog() * src/NetworkManager.[ch] - Break out routine that get the net.interface property from HAL, removing that logic from nm_create_device_and_add_to_list() - (nm_create_device_and_add_to_list): make this a bit more general so it doesn't do the talking to HAL. Also add arguments to facilitate the create of test devices. - (nm_data_mark_state_changed): rename from nm_data_set_state_modified() - (nm_data_new, main, nm_print_usage): add new argument "--enable-test-devices" which makes NetworkManager listen for dbus commands to create test devices, which have no backing hardware. Use when you're on a plane for example, and/or forgot your wireless card at home. Test devices _cannot_ be created unless NM is started with --enable-test-devices. * src/NetworkManagerDbus.[ch] - New "getLinkActive" method for devices - New "setLinkActive" method for devices (only works on test devices) - New "createTestDevice" method on NetworkManager object to create a test device of a specified type (ie wired, wireless). UDI is created from scratch, as is the interface name. Only works when NM is started with --enable-test-devices switch. - New "removeTestDevice" method on NetworkManager object which removes a test device. Only works when NM is started with --enable-test-devices * src/NetworkManagerDevice.[ch] - Logic to facilitate test devices. Add variables to NMDevice struct to indicate whether a device is a test device or not, and what its link status is. - Deal with test devices in most functions. For those that work directly on hardware special-case test devices. - (nm_device_new): don't create a test device if test devices weren't enabled on the command-line. - (nm_device_update_link_active): split out logic for wired and wireless device link checking to separate functions to facilitate test device link checking. - (nm_device_set_enc_key): Since some drivers for wireless cards are daft and don't make a distinction between System Authentication and Encryption (namely Cisco aironet), we use Open System auth when setting a WEP key on the card. We don't deal with Shared Key auth yet. - (nm_device_activation_worker): split the activation cancel check logic out into a separate routine nm_device_activation_cancel_if_needed() - (nm_device_activation_signal_cancel): rename from nm_device_activation_cancel() - (nm_device_fake_ap_list): Test wireless devices obviously cannot scan, so create a list of fake access points that they can "see" - (nm_device_is_test_device): return whether or not a device is a test device * src/NetworkManagerPolicy.c - (nm_policy_get_best_device): attempt to deal with wireless network selection, previously if you "locked"/forced NM to use a wireless device but then selected a wireless network for NM to use, it would switch to a wired device. So, if the active device is wireless and it has a "forced" best AP, use it if the "forced" best AP is still valid - (nm_state_modification_monitor): deal with NULL best devices, for example there were no usable network devices, or the last one was removed * src/backends/NetworkManager*.c - Deal with test devices, mostly just return success for operations like getting a DHCP address * test/nmtestdevices.c - Test tool to create/remove/link-switch test devices git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@112 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-31 16:09:15 +00:00
void nm_add_initial_devices (NMData *data);
void nm_remove_device (NMData *data, struct NMDevice *dev);
void nm_schedule_state_change_signal_broadcast (NMData *data);
void nm_hal_init (NMData *data);
void nm_hal_deinit (NMData *data);
#endif