2007-05-07 Tambet Ingo <tambet@ximian.com>
* libnm-glib/Makefile.am: Link with libnm-util to gain access to NMConnection. * libnm-glib/nm-device-802-11-wireless.c: (nm_device_802_3_ethernet_activate): Remove. * libnm-glib/nm-device-802-3-ethernet.c (nm_device_802_3_ethernet_activate): Remove. * libnm-glib/nm-device.c (nm_device_activate): Implement. * src/nm-device-802-3-ethernet.c: Implement the new activation using NMConnection. * src/nm-device-802-11-wireless.c: Store an activation AP once the activation has started. Implement the new activation using NMConnection. * src/nm-activation-request.c: Store a generic connection object instead of a wireless-specific AP. * src/NetworkManagerPolicy.c (create_connection): Implement. Depending on device type, create a device specific connection object suitable for device activation. * src/nm-device.c (nm_device_activate): Re-implement. Call the device specific check to validate the connection and on success start the activation. * src/nm-device-interface.h: Add a activate virtual function to the interface definition. * src/nm-device-interface.c (nm_device_interface_activate): Implement. (impl_device_activate): Implement. * introspection/nm-device.xml: Add a generic device activation interface that accepts an abstract NMConnection structure that has device-specific information in it. * introspection/nm-device-802-3-ethernet.xml: Remove the wired-specific activation interface. * introspection/nm-device-802-11-wireless.xml: Remove the wireless-specific activation interface. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2569 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -34,7 +34,7 @@ struct NMActRequest
|
||||
{
|
||||
int refcount;
|
||||
NMDevice * dev;
|
||||
NMAccessPoint * ap;
|
||||
NMConnection *connection;
|
||||
NMIP4Config * ip4_config;
|
||||
|
||||
gboolean user_requested;
|
||||
@@ -42,22 +42,18 @@ struct NMActRequest
|
||||
DBusPendingCall * user_key_pcall;
|
||||
};
|
||||
|
||||
|
||||
NMActRequest * nm_act_request_new (NMDevice *dev, NMAccessPoint *ap, gboolean user_requested)
|
||||
NMActRequest * nm_act_request_new (NMDevice *dev, NMConnection *connection, gboolean user_requested)
|
||||
{
|
||||
NMActRequest * req;
|
||||
|
||||
g_return_val_if_fail (dev != NULL, NULL);
|
||||
g_return_val_if_fail (connection != NULL, NULL);
|
||||
|
||||
if (NM_IS_DEVICE_802_11_WIRELESS (dev))
|
||||
g_return_val_if_fail (ap != NULL, NULL);
|
||||
|
||||
req = g_malloc0 (sizeof (NMActRequest));
|
||||
req = g_slice_new0 (NMActRequest);
|
||||
req->refcount = 1;
|
||||
|
||||
g_object_ref (G_OBJECT (dev));
|
||||
req->dev = dev;
|
||||
req->ap = ap ? g_object_ref (ap) : NULL;
|
||||
req->dev = g_object_ref (G_OBJECT (dev));
|
||||
req->connection = connection;
|
||||
req->user_requested = user_requested;
|
||||
|
||||
return req;
|
||||
@@ -78,11 +74,8 @@ void nm_act_request_unref (NMActRequest *req)
|
||||
req->refcount--;
|
||||
if (req->refcount <= 0) {
|
||||
g_object_unref (G_OBJECT (req->dev));
|
||||
if (req->ap)
|
||||
g_object_unref (req->ap);
|
||||
|
||||
memset (req, 0, sizeof (NMActRequest));
|
||||
g_free (req);
|
||||
/* FIXME: destroy connection? */
|
||||
g_slice_free (NMActRequest, req);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,11 +87,11 @@ NMDevice * nm_act_request_get_dev (NMActRequest *req)
|
||||
}
|
||||
|
||||
|
||||
NMAccessPoint * nm_act_request_get_ap (NMActRequest *req)
|
||||
NMConnection * nm_act_request_get_connection (NMActRequest *req)
|
||||
{
|
||||
g_return_val_if_fail (req != NULL, NULL);
|
||||
|
||||
return req->ap;
|
||||
return req->connection;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user