2007-02-19 Tambet Ingo <tambet@ximian.com>
* src/vpn-manager/nm-vpn-manager.c: Handle the DBUS state changes itself. Handle device state changes and disconnect VPN if it's device deactivates. * src/nm-dbus-nm.c: * src/nm-dbus-nm.h: * src/nm-dbus-device.c: * src/nm-dbus-device.c: * src/nm-dbus-net.c: * src/nm-dbus-net.h: Remove. All of it is implemented byt the new dbus API. * src/NetworkManagerMain.h: Get rid of all but 3 properties of NMData. * src/nm-device.c (nm_device_get_by_udi): (nm_device_get_by_iface): Remove. This doesn't belong here and is already implemented in the correct location (NMManager). Rip out all the test_device stuff. * src/NetworkManagerPolicy.c: Remove the leftover activation success and failure handlers, it's all done by NMDevice already. * src/NetworkManager.c: Move the signal handling here from nm-logging.c Remove the iochannel hack to route the unix signals to the main thread since we're not threaded anymore. * src/NetworkManagerAP.c: Implement HWAddress property. * src/NetworkManagerDbus.c: Remove the dbus signal sending code, it happens automatically with dbus-glib. * src/nm-netlink-monitor.c: * src/nm-netlink-monitor.h: - Move it low in the class hierarchy, don't reference any NM types. - Remove private data from the header. - Use type safe checks in public API methods. - Make it a singleton so we don't have to pass the single reference around. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2339 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -58,125 +58,6 @@ static void schedule_change_check (NMPolicy *policy);
|
||||
static NMPolicy *global_policy;
|
||||
|
||||
|
||||
/*
|
||||
* nm_policy_activation_finish
|
||||
*
|
||||
* Finishes up activation by sending out dbus signals, which has to happen
|
||||
* on the main thread.
|
||||
*
|
||||
*/
|
||||
static gboolean nm_policy_activation_finish (gpointer user_data)
|
||||
{
|
||||
NMActRequest * req = (NMActRequest *) user_data;
|
||||
NMDevice * dev = NULL;
|
||||
NMData * data = NULL;
|
||||
NMAccessPoint * ap = NULL;
|
||||
|
||||
g_return_val_if_fail (req != NULL, FALSE);
|
||||
|
||||
data = nm_act_request_get_data (req);
|
||||
g_assert (data);
|
||||
|
||||
dev = nm_act_request_get_dev (req);
|
||||
g_assert (dev);
|
||||
|
||||
if (NM_IS_DEVICE_802_11_WIRELESS (dev))
|
||||
ap = nm_act_request_get_ap (req);
|
||||
|
||||
nm_dbus_schedule_device_status_change_signal (data, dev, ap, DEVICE_NOW_ACTIVE);
|
||||
nm_schedule_state_change_signal_broadcast (data);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_policy_schedule_activation_finish
|
||||
*
|
||||
*/
|
||||
void nm_policy_schedule_activation_finish (NMActRequest *req)
|
||||
{
|
||||
GSource * source;
|
||||
NMDevice * dev;
|
||||
guint id;
|
||||
|
||||
g_return_if_fail (req != NULL);
|
||||
|
||||
dev = nm_act_request_get_dev (req);
|
||||
g_assert (dev);
|
||||
|
||||
nm_act_request_set_stage (req, NM_ACT_STAGE_ACTIVATED);
|
||||
id = g_idle_add (nm_policy_activation_finish, req);
|
||||
source = g_main_context_find_source_by_id (NULL, id);
|
||||
if (source) {
|
||||
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
|
||||
}
|
||||
|
||||
nm_info ("Activation (%s) Finish handler scheduled.",
|
||||
nm_device_get_iface (dev));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_policy_activation_failed
|
||||
*
|
||||
* Clean up a failed activation.
|
||||
*
|
||||
*/
|
||||
static gboolean nm_policy_activation_failed (gpointer user_data)
|
||||
{
|
||||
NMActRequest * req = (NMActRequest *) user_data;
|
||||
NMDevice * dev = NULL;
|
||||
NMData * data = NULL;
|
||||
NMAccessPoint * ap = NULL;
|
||||
|
||||
g_return_val_if_fail (req != NULL, FALSE);
|
||||
|
||||
data = nm_act_request_get_data (req);
|
||||
g_assert (data);
|
||||
|
||||
dev = nm_act_request_get_dev (req);
|
||||
g_assert (dev);
|
||||
|
||||
if (NM_IS_DEVICE_802_11_WIRELESS (dev))
|
||||
ap = nm_act_request_get_ap (req);
|
||||
|
||||
nm_dbus_schedule_device_status_change_signal (data, dev, ap, DEVICE_ACTIVATION_FAILED);
|
||||
|
||||
nm_device_interface_deactivate (NM_DEVICE_INTERFACE (dev));
|
||||
nm_schedule_state_change_signal_broadcast (data);
|
||||
schedule_change_check ((gpointer) global_policy);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_policy_schedule_activation_failed
|
||||
*
|
||||
*/
|
||||
void nm_policy_schedule_activation_failed (NMActRequest *req)
|
||||
{
|
||||
GSource * source;
|
||||
NMDevice * dev;
|
||||
guint id;
|
||||
|
||||
g_return_if_fail (req != NULL);
|
||||
|
||||
dev = nm_act_request_get_dev (req);
|
||||
g_assert (dev);
|
||||
|
||||
nm_act_request_set_stage (req, NM_ACT_STAGE_FAILED);
|
||||
id = g_idle_add (nm_policy_activation_failed, req);
|
||||
source = g_main_context_find_source_by_id (NULL, id);
|
||||
if (source) {
|
||||
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
|
||||
}
|
||||
|
||||
nm_info ("Activation (%s) failure scheduled...", nm_device_get_iface (dev));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* nm_policy_auto_get_best_device
|
||||
*
|
||||
|
Reference in New Issue
Block a user