Commit 2b782920 authored by Dan Williams's avatar Dan Williams
Browse files

2004-09-09 Dan Williams <dcbw@redhat.com>

	NOTE: this commit changes the behavior of wireless devices in
	NetworkManager.  They are now up all the time, scanning all
	the time.  Only the active device has an IP address and routing
	information set up however.  Also, NetworkManager will no longer
	opportunistically switch wireless networks when a better one
	comes in range, it will remain associated with one wireless network
	until that one drops out.

	* panel-applet/NMWirelessApplet.c
	  panel-applet/NMWirelessAppletDbus.c
		- List all wireless cards and their respective networks

	* src/NMLoadModules
		- Use full path to /sbin/ip

	* src/NetworkManager.c
		- Keep wireless devices up all the time so they can scan

	* src/NetworkManagerDbus.c
		- On a WirelessNetworkUpdate signal from NMI, don't update
			the "best" AP

	* src/NetworkManagerDevice.c
		- (nm_device_set_link_active): clear out the best ap for
			wireless devices when the link is set to FALSE
		- Scan on all wireless cards, all the time
		- (nm_device_activation_worker): split out the wireless card
			link-waiting code to a separate function
		- Keep wireless cards up even if device activation fails
		- Don't update the "best" ap as much

	* src/NetworkManagerPolicy.c
		- Don't update the best ap when checking if its frozen,
			let link checking clear out a frozen best ap for us

	* src/NetworkManagerWireless.c
		- Scan on all wireless cards, all the time


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@140 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent f499933f
2004-09-09 Dan Williams <dcbw@redhat.com>
NOTE: this commit changes the behavior of wireless devices in
NetworkManager. They are now up all the time, scanning all
the time. Only the active device has an IP address and routing
information set up however. Also, NetworkManager will no longer
opportunistically switch wireless networks when a better one
comes in range, it will remain associated with one wireless network
until that one drops out.
* panel-applet/NMWirelessApplet.c
panel-applet/NMWirelessAppletDbus.c
- List all wireless cards and their respective networks
* src/NMLoadModules
- Use full path to /sbin/ip
* src/NetworkManager.c
- Keep wireless devices up all the time so they can scan
* src/NetworkManagerDbus.c
- On a WirelessNetworkUpdate signal from NMI, don't update
the "best" AP
* src/NetworkManagerDevice.c
- (nm_device_set_link_active): clear out the best ap for
wireless devices when the link is set to FALSE
- Scan on all wireless cards, all the time
- (nm_device_activation_worker): split out the wireless card
link-waiting code to a separate function
- Keep wireless cards up even if device activation fails
- Don't update the "best" ap as much
* src/NetworkManagerPolicy.c
- Don't update the best ap when checking if its frozen,
let link checking clear out a frozen best ap for us
* src/NetworkManagerWireless.c
- Scan on all wireless cards, all the time
2004-09-09 Francisco Javier F. Serrador <serrador@cvs.gnome.org>
* configure.in: Added 'es' (Spanish) to ALL_LINGUAS.
......@@ -21,6 +61,7 @@
to look like. Also did a Airo card hack to make it show the
correct AP quality
>>>>>>> 1.92
2004-09-08 Dan Williams <dcbw@redhat.com>
* panel-applet/no-networkmanager.png
......
......@@ -69,6 +69,7 @@ static char *glade_file;
static void nmwa_about_cb (BonoboUIComponent *uic, NMWirelessApplet *applet);
static GtkWidget * nmwa_populate_menu (NMWirelessApplet *applet);
static void nmwa_dispose_menu_items (NMWirelessApplet *applet);
static gboolean do_not_eat_button_press (GtkWidget *widget, GdkEventButton *event);
static const BonoboUIVerb nmwa_context_menu_verbs [] =
{
......@@ -373,7 +374,7 @@ static void nmwa_get_menu_pos (GtkMenu *menu, gint *x, gint *y, gboolean *push_i
* NetworkInfoManager that the networks list has changed, and it notifies
* NetworkManager about those changes, triggering an AP switch.
*/
void nmwa_handle_network_choice (NMWirelessApplet *applet, char *network)
static void nmwa_handle_network_choice (NMWirelessApplet *applet, char *network)
{
GConfEntry *gconf_entry;
char *key;
......@@ -406,7 +407,7 @@ void nmwa_handle_network_choice (NMWirelessApplet *applet, char *network)
* Signal function called when user clicks on a menu item
*
*/
void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data)
static void nmwa_menu_item_activate (GtkMenuItem *item, gpointer user_data)
{
NMWirelessApplet *applet = (NMWirelessApplet *)user_data;
char *tag;
......@@ -439,7 +440,7 @@ static void nmwa_toplevel_menu_activate (GtkWidget *menu, NMWirelessApplet *appl
* nmwa_menu_add_separator_item
*
*/
void nmwa_menu_add_separator_item (GtkWidget *menu)
static void nmwa_menu_add_separator_item (GtkWidget *menu)
{
GtkWidget *menu_item;
......@@ -455,7 +456,7 @@ void nmwa_menu_add_separator_item (GtkWidget *menu)
* Add a non-clickable text item to a menu
*
*/
void nmwa_menu_add_text_item (GtkWidget *menu, char *text)
static void nmwa_menu_add_text_item (GtkWidget *menu, char *text)
{
GtkWidget *menu_item;
......@@ -476,7 +477,7 @@ void nmwa_menu_add_text_item (GtkWidget *menu, char *text)
* Add a network device to the menu
*
*/
void nmwa_menu_add_device_item (GtkWidget *menu, GdkPixbuf *icon, char *name, char *nm_device, gboolean current, gpointer user_data)
static void nmwa_menu_add_device_item (GtkWidget *menu, GdkPixbuf *icon, char *name, char *nm_device, gboolean current, gpointer user_data)
{
GtkWidget *menu_item;
GtkWidget *label;
......@@ -518,58 +519,19 @@ void nmwa_menu_add_device_item (GtkWidget *menu, GdkPixbuf *icon, char *name, ch
}
/*
* nmwa_menu_add_devices
*
*/
void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet)
{
GSList *element;
g_return_if_fail (menu != NULL);
g_return_if_fail (applet != NULL);
g_mutex_lock (applet->data_mutex);
element = applet->devices;
if (!element)
nmwa_menu_add_text_item (menu, _("There are no network devices..."));
else
{
/* Add all devices in our device list to the menu */
while (element)
{
NetworkDevice *dev = (NetworkDevice *)(element->data);
if (dev && ((dev->type == DEVICE_TYPE_WIRED_ETHERNET) || (dev->type == DEVICE_TYPE_WIRELESS_ETHERNET)))
{
GdkPixbuf *icon = (dev->type == DEVICE_TYPE_WIRED_ETHERNET) ? applet->wired_icon : applet->wireless_icon;
char *name_string;
gboolean current = applet->active_device ? (strcmp (applet->active_device, dev->nm_device) == 0) : FALSE;
name_string = g_strdup_printf ("%s (%s)", (dev->hal_name ? dev->hal_name : dev->nm_name),
(dev->type == DEVICE_TYPE_WIRED_ETHERNET) ? "wired" : "wireless");
nmwa_menu_add_device_item (menu, icon, name_string, dev->nm_device, current, applet);
}
element = g_slist_next (element);
}
}
g_mutex_unlock (applet->data_mutex);
}
/*
* nmwa_menu_add_network
*
* Add a wireless network menu item
*
*/
void nmwa_menu_add_network (GtkWidget *menu, GdkPixbuf *key, char *text, char *network, gboolean current,
static void nmwa_menu_add_network (GtkWidget *menu, GdkPixbuf *key, char *text, char *network, gboolean current,
gboolean encrypted, guint8 quality, gpointer user_data)
{
GtkWidget *menu_item;
GtkWidget *label;
GtkWidget *hbox;
GtkWidget *foo;
GtkWidget *progress;
float percent;
......@@ -581,6 +543,12 @@ void nmwa_menu_add_network (GtkWidget *menu, GdkPixbuf *key, char *text, char *n
gtk_container_add (GTK_CONTAINER (menu_item), hbox);
gtk_widget_show (hbox);
/* Add spacing container */
foo = gtk_hbox_new (FALSE, 5);
gtk_widget_set_size_request (foo, 7, -1);
gtk_box_pack_start (GTK_BOX (hbox), foo, FALSE, FALSE, 2);
gtk_widget_show (foo);
label = gtk_label_new (text);
if (current)
{
......@@ -619,39 +587,83 @@ void nmwa_menu_add_network (GtkWidget *menu, GdkPixbuf *key, char *text, char *n
/*
* nmwa_menu_add_networks
* nmwa_menu_device_add_networks
*
*/
void nmwa_menu_add_networks (GtkWidget *menu, NMWirelessApplet *applet)
static void nmwa_menu_device_add_networks (GtkWidget *menu, NetworkDevice *dev, NMWirelessApplet *applet)
{
GSList *element;
g_return_if_fail (menu != NULL);
g_return_if_fail (applet != NULL);
g_return_if_fail (dev != NULL);
g_mutex_lock (applet->data_mutex);
element = applet->networks;
if (dev->type != DEVICE_TYPE_WIRELESS_ETHERNET)
return;
element = dev->networks;
if (!element)
nmwa_menu_add_text_item (menu, _("There are no wireless networks..."));
else
{
nmwa_menu_add_text_item (menu, _("Wireless Networks"));
/* Add all networks in our network list to the menu */
while (element)
{
WirelessNetwork *net = (WirelessNetwork *)(element->data);
if (net)
{
nmwa_menu_add_network (menu, applet->key_pixbuf, net->essid,
net->essid, net->active, net->encrypted, net->quality, applet);
}
element = g_slist_next (element);
}
}
}
/*
* nmwa_menu_add_devices
*
*/
static void nmwa_menu_add_devices (GtkWidget *menu, NMWirelessApplet *applet)
{
GSList *element;
g_return_if_fail (menu != NULL);
g_return_if_fail (applet != NULL);
g_mutex_lock (applet->data_mutex);
element = applet->devices;
if (!element)
nmwa_menu_add_text_item (menu, _("There are no network devices..."));
else
{
/* Add all devices in our device list to the menu */
while (element)
{
NetworkDevice *dev = (NetworkDevice *)(element->data);
if (dev && ((dev->type == DEVICE_TYPE_WIRED_ETHERNET) || (dev->type == DEVICE_TYPE_WIRELESS_ETHERNET)))
{
GdkPixbuf *icon = (dev->type == DEVICE_TYPE_WIRED_ETHERNET) ? applet->wired_icon : applet->wireless_icon;
char *name_string;
gboolean current = applet->active_device ? (strcmp (applet->active_device, dev->nm_device) == 0) : FALSE;
name_string = g_strdup_printf ("%s (%s)", (dev->hal_name ? dev->hal_name : dev->nm_name),
(dev->type == DEVICE_TYPE_WIRED_ETHERNET) ? "wired" : "wireless");
nmwa_menu_add_device_item (menu, icon, name_string, dev->nm_device, current, applet);
nmwa_menu_device_add_networks (menu, dev, applet);
nmwa_menu_add_separator_item (menu);
}
element = g_slist_next (element);
}
}
g_mutex_unlock (applet->data_mutex);
}
/*
* nmwa_menu_item_data_free
*
......@@ -683,7 +695,7 @@ static void nmwa_menu_item_data_free (GtkWidget *menu_item, gpointer data)
* Destroy the menu and each of its items data tags
*
*/
void nmwa_dispose_menu_items (NMWirelessApplet *applet)
static void nmwa_dispose_menu_items (NMWirelessApplet *applet)
{
g_return_if_fail (applet != NULL);
......@@ -698,7 +710,7 @@ void nmwa_dispose_menu_items (NMWirelessApplet *applet)
* Set up our networks menu from scratch
*
*/
GtkWidget * nmwa_populate_menu (NMWirelessApplet *applet)
static GtkWidget * nmwa_populate_menu (NMWirelessApplet *applet)
{
GtkWidget *menu = applet->menu;
......@@ -712,27 +724,7 @@ GtkWidget * nmwa_populate_menu (NMWirelessApplet *applet)
nmwa_menu_add_text_item (menu, _("Network Connections"));
nmwa_menu_add_devices (menu, applet);
nmwa_menu_add_separator_item (menu);
switch (applet->applet_state)
{
case (APPLET_STATE_NO_CONNECTION):
nmwa_menu_add_text_item (menu, _("No network connection is currently active..."));
break;
case (APPLET_STATE_WIRED):
case (APPLET_STATE_WIRED_CONNECTING):
nmwa_menu_add_text_item (menu, _("A wired network connection is currently active..."));
break;
case (APPLET_STATE_WIRELESS):
case (APPLET_STATE_WIRELESS_CONNECTING):
nmwa_menu_add_networks (menu, applet);
break;
default:
break;
}
nmwa_menu_add_text_item (menu, _("Other Wireless Network..."));
return (menu);
}
......@@ -785,6 +777,7 @@ static void nmwa_setup_widgets (NMWirelessApplet *applet)
applet->menu = gtk_menu_new();
gtk_menu_item_set_submenu (GTK_MENU_ITEM(applet->toplevel_menu), applet->menu);
g_signal_connect (applet->menu, "button_press_event", G_CALLBACK (do_not_eat_button_press), NULL);
gtk_widget_show (menu_bar);
gtk_widget_show (applet->toplevel_menu);
......@@ -810,10 +803,8 @@ static void change_orient_cb(PanelApplet *pa, gint s, NMWirelessApplet *applet)
static gboolean do_not_eat_button_press (GtkWidget *widget, GdkEventButton *event)
{
printf ("Getting button press\n");
/*if (event->button != 1)
if (event->button != 1)
g_signal_stop_emission_by_name (widget, "button_press_event");
*/
return (FALSE);
}
......@@ -871,7 +862,6 @@ static GtkWidget * nmwa_new (NMWirelessApplet *applet)
}
applet->applet_state = APPLET_STATE_NO_NM;
applet->networks = NULL;
applet->devices = NULL;
applet->active_device = NULL;
......@@ -895,7 +885,6 @@ static GtkWidget * nmwa_new (NMWirelessApplet *applet)
nmwa_setup_widgets (applet);
g_signal_connect (applet,"destroy", G_CALLBACK (nmwa_destroy),NULL);
//g_signal_connect (applet->toplevel_menu, "button_press_event", G_CALLBACK (do_not_eat_button_press), NULL);
panel_applet_setup_menu_from_file (PANEL_APPLET (applet), NULL, "NMWirelessApplet.xml", NULL,
nmwa_context_menu_verbs, applet);
......
......@@ -84,7 +84,6 @@ typedef struct
/* Data model elements */
GMutex *data_mutex;
GSList *devices;
GSList *networks;
char *active_device;
AppletState applet_state;
......@@ -103,6 +102,7 @@ typedef struct
*/
typedef struct
{
char *nm_name;
char *essid;
gboolean encrypted;
gboolean active;
......@@ -120,6 +120,7 @@ typedef struct
char *nm_name;
char *hal_name;
char *udi;
GSList *networks;
} NetworkDevice;
#endif
......@@ -40,6 +40,10 @@
#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist"
#define NM_DBUS_NO_ACTIVE_NET_ERROR "org.freedesktop.NetworkManager.NoActiveNetwork"
static void wireless_network_free (void *element, void *user_data);
/*
* nmwa_dbus_get_string
*
......@@ -50,7 +54,7 @@
* RETURN_NO_NM if NetworkManager service no longer exists
*
*/
int nmwa_dbus_get_string (DBusConnection *connection, const char *path, const char *method, char **string)
static int nmwa_dbus_get_string (DBusConnection *connection, const char *path, const char *method, char **string)
{
DBusMessage *message;
DBusMessage *reply;
......@@ -82,6 +86,7 @@ int nmwa_dbus_get_string (DBusConnection *connection, const char *path, const ch
else if (strcmp (error.name, NM_DBUS_NO_ACTIVE_NET_ERROR) == 0)
ret = RETURN_SUCCESS;
dbus_error_free (&error);
return (ret);
}
......@@ -113,7 +118,7 @@ int nmwa_dbus_get_string (DBusConnection *connection, const char *path, const ch
* RETURN_NO_NM if NetworkManager service no longer exists
*
*/
int nmwa_dbus_get_int (DBusConnection *connection, const char *path, const char *method, gint32 *num)
static int nmwa_dbus_get_int (DBusConnection *connection, const char *path, const char *method, gint32 *num)
{
DBusMessage *message;
DBusMessage *reply;
......@@ -142,6 +147,7 @@ int nmwa_dbus_get_int (DBusConnection *connection, const char *path, const char
if (strcmp (error.name, DBUS_NO_SERVICE_ERROR) == 0)
ret = RETURN_NO_NM;
dbus_error_free (&error);
return (ret);
}
......@@ -172,7 +178,7 @@ int nmwa_dbus_get_int (DBusConnection *connection, const char *path, const char
* RETURN_NO_NM if NetworkManager service no longer exists
*
*/
int nmwa_dbus_get_bool (DBusConnection *connection, const char *path, const char *method, gboolean *val)
static int nmwa_dbus_get_bool (DBusConnection *connection, const char *path, const char *method, gboolean *val)
{
DBusMessage *message;
DBusMessage *reply;
......@@ -200,6 +206,7 @@ int nmwa_dbus_get_bool (DBusConnection *connection, const char *path, const char
if (strcmp (error.name, DBUS_NO_SERVICE_ERROR) == 0)
ret = RETURN_NO_NM;
dbus_error_free (&error);
return (ret);
}
......@@ -226,7 +233,7 @@ int nmwa_dbus_get_bool (DBusConnection *connection, const char *path, const char
* nmwa_dbus_get_double
*
*/
double nmwa_dbus_get_double (DBusConnection *connection, const char *path, const char *method)
static double nmwa_dbus_get_double (DBusConnection *connection, const char *path, const char *method)
{
DBusMessage *message;
DBusMessage *reply;
......@@ -249,6 +256,7 @@ double nmwa_dbus_get_double (DBusConnection *connection, const char *path, const
{
fprintf (stderr, "nmwa_dbus_get_double(): %s raised:\n %s\n\n", error.name, error.message);
dbus_message_unref (message);
dbus_error_free (&error);
return (0);
}
......@@ -280,7 +288,7 @@ double nmwa_dbus_get_double (DBusConnection *connection, const char *path, const
* RETURN_NO_NM if NetworkManager service no longer exists
*
*/
int nmwa_dbus_get_string_array (DBusConnection *connection, const char *path, const char *method,
static int nmwa_dbus_get_string_array (DBusConnection *connection, const char *path, const char *method,
int *num_items, char ***string_array)
{
DBusMessage *message;
......@@ -319,6 +327,7 @@ int nmwa_dbus_get_string_array (DBusConnection *connection, const char *path, co
ret = RETURN_SUCCESS;
}
dbus_error_free (&error);
return (ret);
}
......@@ -349,7 +358,7 @@ int nmwa_dbus_get_string_array (DBusConnection *connection, const char *path, co
* Returns the object_path of the currently active device, if any.
*
*/
char * nmwa_dbus_get_active_device (NMWirelessApplet *applet, AppletState failure_state)
static char * nmwa_dbus_get_active_device (NMWirelessApplet *applet, AppletState failure_state)
{
char *active_device = NULL;
......@@ -378,7 +387,7 @@ char * nmwa_dbus_get_active_device (NMWirelessApplet *applet, AppletState failur
* Returns the object_path of the currently active network of the active device.
*
*/
char * nmwa_dbus_get_active_network (NMWirelessApplet *applet, char *dev_path, AppletState failure_state)
static char * nmwa_dbus_get_active_network (NMWirelessApplet *applet, char *dev_path, AppletState failure_state)
{
char *network = NULL;
......@@ -407,7 +416,7 @@ char * nmwa_dbus_get_active_network (NMWirelessApplet *applet, char *dev_path, A
* Returns the device type of the specified device.
*
*/
int nmwa_dbus_get_device_type (NMWirelessApplet *applet, char *path, AppletState failure_state)
static int nmwa_dbus_get_device_type (NMWirelessApplet *applet, char *path, AppletState failure_state)
{
int type = -1;
......@@ -435,7 +444,7 @@ int nmwa_dbus_get_device_type (NMWirelessApplet *applet, char *path, AppletState
* Returns the quality of a given wireless network
*
*/
guint8 nmwa_dbus_get_network_quality (NMWirelessApplet *applet, char *path)
static guint8 nmwa_dbus_get_network_quality (NMWirelessApplet *applet, char *path)
{
int qual = 0;
......@@ -459,7 +468,7 @@ guint8 nmwa_dbus_get_network_quality (NMWirelessApplet *applet, char *path)
* Returns NetworkManager's status
*
*/
char * nmwa_dbus_get_nm_status (NMWirelessApplet *applet, AppletState failure_state)
static char * nmwa_dbus_get_nm_status (NMWirelessApplet *applet, AppletState failure_state)
{
char *status = NULL;
......@@ -487,7 +496,7 @@ char * nmwa_dbus_get_nm_status (NMWirelessApplet *applet, AppletState failure_st
* Returns the name of a specified wireless network
*
*/
char * nmwa_dbus_get_network_name (NMWirelessApplet *applet, char *net_path)
static char * nmwa_dbus_get_network_name (NMWirelessApplet *applet, char *net_path)
{
char *name = NULL;
......@@ -511,7 +520,7 @@ char * nmwa_dbus_get_network_name (NMWirelessApplet *applet, char *net_path)
* Returns the name of a specified network device
*
*/
char * nmwa_dbus_get_device_name (NMWirelessApplet *applet, char *dev_path)
static char * nmwa_dbus_get_device_name (NMWirelessApplet *applet, char *dev_path)
{
char *name = NULL;
......@@ -535,7 +544,7 @@ char * nmwa_dbus_get_device_name (NMWirelessApplet *applet, char *dev_path)
* Returns the HAL udi of a network device
*
*/
char * nmwa_dbus_get_device_udi (NMWirelessApplet *applet, char *dev_path)
static char * nmwa_dbus_get_device_udi (NMWirelessApplet *applet, char *dev_path)
{
char *udi = NULL;
......@@ -559,7 +568,7 @@ char * nmwa_dbus_get_device_udi (NMWirelessApplet *applet, char *dev_path)
* Returns whether or not the specified network is encrypted
*
*/
gboolean nmwa_dbus_get_network_encrypted (NMWirelessApplet *applet, char *net_path)
static gboolean nmwa_dbus_get_network_encrypted (NMWirelessApplet *applet, char *net_path)
{
gboolean enc = FALSE;
......@@ -583,7 +592,7 @@ gboolean nmwa_dbus_get_network_encrypted (NMWirelessApplet *applet, char *net_pa
* Returns an array of wireless networks that the specified device knows about.
*
*/
char **nmwa_dbus_get_device_networks (NMWirelessApplet *applet, char *path, int *num_items, AppletState failure_state)
static char **nmwa_dbus_get_device_networks (NMWirelessApplet *applet, char *path, int *num_items, AppletState failure_state)
{
char **array = NULL;
int items;
......@@ -616,7 +625,7 @@ char **nmwa_dbus_get_device_networks (NMWirelessApplet *applet, char *path, int
* Get a string property from a device
*
*/
char *nmwa_dbus_get_hal_device_string_property (DBusConnection *connection, const char *udi, const char *property_name)
static char *nmwa_dbus_get_hal_device_string_property (DBusConnection *connection, const char *udi, const char *property_name)
{
DBusError error;
DBusMessage *message;
......@@ -661,7 +670,7 @@ char *nmwa_dbus_get_hal_device_string_property (DBusConnection *connection, cons
* Grab the info.product tag from hal for a specific UDI
*
*/
char *nmwa_dbus_get_hal_device_info (DBusConnection *connection, const char *udi)
static char *nmwa_dbus_get_hal_device_info (DBusConnection *connection, const char *udi)
{
DBusError error;
DBusMessage *message;
......@@ -760,64 +769,85 @@ static void wireless_network_free (void *element, void *user_data)
{
WirelessNetwork *net = (WirelessNetwork *)(element);
if (net) g_free (net->essid);
g_return_if_fail (net != NULL);
g_free (net->nm_name);
g_free (net->essid);
g_free (net);
}
/*
* nmwa_dbus_update_wireless_network_list
* network_device_free_wireless_network_list
*
* Query NetworkManager for the wireless networks the active device
*/
static void network_device_free_wireless_network_list (NetworkDevice *dev)
{
g_return_if_fail (dev != NULL);
g_slist_foreach (dev->networks, wireless_network_free, NULL);
g_slist_free (dev->networks);
dev->networks = NULL;
}
/*
* network_device_free
*
* Frees the representation of a network device
*
*/
static void network_device_free (void *element, void *user_data)
{
NetworkDevice *dev = (NetworkDevice *)(element);
g_return_if_fail (dev != NULL);
network_device_free_wireless_network_list (dev);
g_free (dev->nm_device);
g_free (dev->nm_name);
dbus_free (dev->udi);
dbus_free (dev->hal_name);
g_free (dev);
}
/*
* nmwa_dbus_update_device_wireless_networks
*
* Query NetworkManager for the wireless networks a particular device
* knows about, if the active device is wireless.
*
* NOTE: caller must lock device list if necessary
*
*/
void nmwa_dbus_update_wireless_network_list (NMWirelessApplet *applet)
static void nmwa_dbus_update_device_wireless_networks (NetworkDevice *dev, NMWirelessApplet *applet)
{
char *active_device = NULL;
char *active_network = NULL;