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
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <dbus/dbus.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <hal/libhal.h>
|
||||
#include <getopt.h>
|
||||
@@ -35,6 +36,7 @@
|
||||
#include "NetworkManagerPolicy.h"
|
||||
#include "NetworkManagerWireless.h"
|
||||
#include "NetworkManagerDbus.h"
|
||||
#include "NetworkManagerAPList.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -414,19 +416,6 @@ static NMData *nm_data_new (void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_data_allowed_ap_list_element_free
|
||||
*
|
||||
* Frees each member of the allowed access point list before the list is
|
||||
* disposed of.
|
||||
*
|
||||
*/
|
||||
static void nm_data_allowed_ap_list_element_free (void *element, void *user_data)
|
||||
{
|
||||
nm_ap_unref (element);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_data_dev_list_element_free
|
||||
*
|
||||
@@ -457,9 +446,10 @@ static void nm_data_free (NMData *data)
|
||||
g_slist_free (data->dev_list);
|
||||
g_mutex_free (data->dev_list_mutex);
|
||||
|
||||
g_slist_foreach (data->allowed_ap_list, nm_data_allowed_ap_list_element_free, NULL);
|
||||
g_slist_free (data->allowed_ap_list);
|
||||
nm_ap_list_free (data->allowed_ap_list);
|
||||
g_mutex_free (data->allowed_ap_list_mutex);
|
||||
|
||||
memset (data, 0, sizeof (NMData));
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +502,6 @@ int main( int argc, char *argv[] )
|
||||
guint policy_source;
|
||||
guint wireless_scan_source;
|
||||
gboolean become_daemon = TRUE;
|
||||
GThread *allowed_ap_thread = NULL;
|
||||
|
||||
/* Parse options */
|
||||
while (1)
|
||||
@@ -610,17 +599,16 @@ int main( int argc, char *argv[] )
|
||||
nm_data->hal_ctx = ctx;
|
||||
hal_ctx_set_user_data (nm_data->hal_ctx, nm_data);
|
||||
|
||||
/* Grab network devices that are already present and add them to our list */
|
||||
nm_add_current_devices (nm_data);
|
||||
|
||||
/* Initialize our list of allowed access points */
|
||||
nm_policy_update_allowed_access_points (nm_data);
|
||||
allowed_ap_thread = g_thread_create (nm_policy_allowed_ap_refresh_worker, nm_data, FALSE, NULL);
|
||||
|
||||
/* Create our dbus service */
|
||||
nm_data->dbus_connection = nm_dbus_init (nm_data);
|
||||
if (nm_data->dbus_connection)
|
||||
{
|
||||
/* Initialize our list of allowed access points */
|
||||
nm_ap_list_populate (nm_data);
|
||||
|
||||
/* Grab network devices that are already present and add them to our list */
|
||||
nm_add_current_devices (nm_data);
|
||||
|
||||
/* Create a watch function that monitors cards for link status (hal doesn't do
|
||||
* this for wireless cards yet).
|
||||
*/
|
||||
@@ -648,8 +636,7 @@ int main( int argc, char *argv[] )
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (loop);
|
||||
|
||||
/* Kill the watch functions & threads */
|
||||
allowed_ap_worker_exit = TRUE;
|
||||
/* Kill the watch functions */
|
||||
g_source_remove (link_source);
|
||||
g_source_remove (policy_source);
|
||||
g_source_remove (wireless_scan_source);
|
||||
|
Reference in New Issue
Block a user