mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 03:30:09 +01:00
* panel-applet/NMWirelessApplet.c - Add function to print out applet_state in a readable manner * src/NetworkManager.c - (main): Don't segfault when nm_dbus_init() fails, we had a left-over call to hal_shutdown() into which we passed NULL * src/NetworkManagerAP.c - (nm_ap_set_essid): Allow NULL essids * src/NetworkManagerAPList.[ch] - More use of nm_ap_list_[un]lock () - (nm_ap_list_get_ap_by_essid): don't warn when looking for a NULL network/essid, just return nothing. Also skip over NULL essid access points in the list when searching - (nm_ap_list_get_ap_by_address): new function - (nm_ap_list_update_network): set the access point's key source to NULL when the key returned from NetworkManagerInfo is NULL or of 0 length - nm_ap_list_update_keys() -> nm_ap_list_update_properties(), and copy timestamp over too - (nm_ap_list_copy_essids_by_address): new function, attempt to find the correct ESSID for a blank-essid access point by searching through another list and matching access point MAC addresses - (nm_ap_list_diff): exclude blank-essid access points from the diffs * src/NetworkManagerDbus.c - (nm_dbus_nm_set_active_device): deal with random networks the user may specify. This is mainly for access points that don't broadcast their essid. So if the user tells us to associate with some random ESSID that's not in our access point list, we find out if the access point does in fact exist (by attempting association and then matching that access point's MAC address with the essid the user gave us) and then we switch to it. - (nm_dbus_devices_handle_request): don't add blank-essid access points to the returned list of networks for the "getNetworks" method * src/NetworkManagerDevice.[ch] - Extra debugging info for link detection - (nm_device_ap_list_get_ap_by_address): new function, return an AP based on MAC address - (nm_device_get_path_for_ap): ignore blank-essid access points - (nm_device_wireless_network_exists): new function, find out whether a random ESSID exists by attempting to associate with it - (nm_device_do_normal_scan): allow blank-essid access points in our device list as long as they have an AP MAC address we can use. Also send WirelessNetwork[Dis]Appeared signals for non-active devices too. Lets the applet update more frequently. * src/backends/NetworkManagerGentoo.c - Patch from: Robert Paskowitz - Update backend code for Gentoo - Implement nm_system_device_update_config_info () * test/nmclienttest.c - (set_network_device): new function, takes a command-line argument and tells NetworkManager to use that wireless network git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@222 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
124 lines
5.1 KiB
C
124 lines
5.1 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"
|
|
|
|
typedef struct NMDevice NMDevice;
|
|
|
|
NMDevice * nm_device_new (const char *iface, gboolean test_device,
|
|
NMDeviceType test_dev_type, 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);
|
|
gboolean nm_device_wireless_network_exists (NMDevice *dev, const char *network, struct ether_addr *addr);
|
|
|
|
void nm_device_set_mode_managed (NMDevice *dev);
|
|
void nm_device_set_mode_adhoc (NMDevice *dev);
|
|
|
|
gint8 nm_device_get_signal_strength (NMDevice *dev);
|
|
void nm_device_update_signal_strength (NMDevice *dev);
|
|
guint8 nm_device_get_noise (NMDevice *dev);
|
|
guint8 nm_device_get_max_quality (NMDevice *dev);
|
|
guint32 nm_device_get_bad_crypt_packets (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_is_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_is_just_activated (NMDevice *dev);
|
|
gboolean nm_device_is_activating (NMDevice *dev);
|
|
gboolean nm_device_deactivate (NMDevice *dev, gboolean just_added);
|
|
|
|
gboolean nm_device_is_scanning (NMDevice *dev);
|
|
|
|
void nm_device_set_user_key_for_network (NMDevice *dev, struct NMAccessPointList *invalid_list,
|
|
unsigned char *network, unsigned char *key,
|
|
NMAPEncMethod enc_method);
|
|
|
|
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_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);
|
|
NMAccessPoint *nm_device_ap_list_get_ap_by_address(NMDevice *dev, const struct ether_addr *addr);
|
|
|
|
/* System config data accessors */
|
|
gboolean nm_device_config_get_use_dhcp (NMDevice *dev);
|
|
void nm_device_config_set_use_dhcp (NMDevice *dev, gboolean use_dhcp);
|
|
guint32 nm_device_config_get_ip4_address (NMDevice *dev);
|
|
void nm_device_config_set_ip4_address (NMDevice *dev, guint32 addr);
|
|
guint32 nm_device_config_get_ip4_gateway (NMDevice *dev);
|
|
void nm_device_config_set_ip4_gateway (NMDevice *dev, guint32 gateway);
|
|
guint32 nm_device_config_get_ip4_netmask (NMDevice *dev);
|
|
void nm_device_config_set_ip4_netmask (NMDevice *dev, guint32 netmask);
|
|
|
|
/* Utility routines */
|
|
NMDevice * nm_get_device_by_udi (NMData *data, const char *udi);
|
|
NMDevice * nm_get_device_by_iface (NMData *data, const char *iface);
|
|
|
|
/* Test device routines */
|
|
gboolean nm_device_is_test_device (NMDevice *dev);
|
|
|
|
#endif
|