2006-10-13 Dan Williams <dcbw@redhat.com>

* Huge DBus refactor:
		- Create a "DBus Manager" object which manages the connection and
		sends signals on NameOwnerChanged and connection/disconnection events,
		handles reconnection to the bus if NM gets kicked off, and abstracts
		signal handling
		- Remove DBusConnection members from places where they are no
		longer needed due to the refactor, like the dbus-connection
		property of the named manager, and from NMData
		- Reformats a bunch of the code to gnome style
		(8-space tabs, braces on same line as statement, 80-col width).
		Consider it open season to reformat any bits to gnome style.
		style that aren't already.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2061 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2006-10-13 19:41:47 +00:00
parent 129d0ca46d
commit 84678fc9fe
38 changed files with 4569 additions and 2771 deletions

View File

@@ -38,6 +38,7 @@
#include "nm-dbus-nmi.h"
#include "nm-device-802-11-wireless.h"
#include "nm-device-802-3-ethernet.h"
#include "nm-dbus-manager.h"
/*
@@ -537,9 +538,10 @@ static gboolean allowed_list_update_pending = FALSE;
* allowed wireless networks.
*
*/
static gboolean nm_policy_allowed_ap_list_update (gpointer user_data)
static gboolean
nm_policy_allowed_ap_list_update (gpointer user_data)
{
NMData *data = (NMData *)user_data;
NMData * data = (NMData *)user_data;
allowed_list_update_pending = FALSE;
@@ -551,9 +553,8 @@ static gboolean nm_policy_allowed_ap_list_update (gpointer user_data)
if (data->allowed_ap_list)
nm_ap_list_unref (data->allowed_ap_list);
if ((data->allowed_ap_list = nm_ap_list_new (NETWORK_TYPE_ALLOWED)))
nm_dbus_update_allowed_networks (data->dbus_connection, data->allowed_ap_list, data);
return (FALSE);
nm_dbus_update_allowed_networks (data->allowed_ap_list, data);
return FALSE;
}
@@ -597,7 +598,8 @@ static gboolean device_list_update_pending = FALSE;
* allowed wireless networks.
*
*/
static gboolean nm_policy_device_list_update_from_allowed_list (NMData *data)
static gboolean
nm_policy_device_list_update_from_allowed_list (NMData *data)
{
GSList * elt;
@@ -605,27 +607,30 @@ static gboolean nm_policy_device_list_update_from_allowed_list (NMData *data)
g_return_val_if_fail (data != NULL, FALSE);
for (elt = data->dev_list; elt != NULL; elt = g_slist_next (elt))
{
for (elt = data->dev_list; elt != NULL; elt = g_slist_next (elt)) {
NMDevice *dev = (NMDevice *)(elt->data);
if (nm_device_is_802_11_wireless (dev))
{
NMDevice80211Wireless * wdev = NM_DEVICE_802_11_WIRELESS (dev);
NMDevice80211Wireless * wdev;
if (nm_device_get_capabilities (dev) & NM_DEVICE_CAP_WIRELESS_SCAN)
{
/* Once we have the list, copy in any relevant information from our Allowed list and fill
* in the ESSID of base stations that aren't broadcasting their ESSID, if we have their
* MAC address in our allowed list.
*/
nm_ap_list_copy_essids_by_address (data, wdev, nm_device_802_11_wireless_ap_list_get (wdev), data->allowed_ap_list);
nm_ap_list_copy_properties (nm_device_802_11_wireless_ap_list_get (wdev), data->allowed_ap_list);
}
else
nm_device_802_11_wireless_copy_allowed_to_dev_list (wdev, data->allowed_ap_list);
if (!nm_device_is_802_11_wireless (dev))
continue;
nm_ap_list_remove_duplicate_essids (nm_device_802_11_wireless_ap_list_get (wdev));
wdev = NM_DEVICE_802_11_WIRELESS (dev);
if (nm_device_get_capabilities (dev) & NM_DEVICE_CAP_WIRELESS_SCAN) {
/* Once we have the list, copy in any relevant information from our
* Allowed list and fill in the ESSID of base stations that aren't
* broadcasting their ESSID, if we have their MAC address in our
* allowed list.
*/
nm_ap_list_copy_essids_by_address (wdev,
nm_device_802_11_wireless_ap_list_get (wdev),
data->allowed_ap_list);
nm_ap_list_copy_properties (nm_device_802_11_wireless_ap_list_get (wdev),
data->allowed_ap_list);
} else {
nm_device_802_11_wireless_copy_allowed_to_dev_list (wdev, data->allowed_ap_list);
}
nm_ap_list_remove_duplicate_essids (nm_device_802_11_wireless_ap_list_get (wdev));
}
nm_policy_schedule_device_change_check (data);