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

* src/nm-device.h
	  src/nm-device.c
		- (nm_device_get_best_connection): new function; get best connection
			for the device at that time



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2774 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2007-09-09 17:58:44 +00:00
parent 8f76d5f2e0
commit 04c7310517
3 changed files with 28 additions and 0 deletions

View File

@@ -380,6 +380,24 @@ nm_device_set_active_link (NMDevice *self,
}
NMConnection *
nm_device_get_best_connection (NMDevice *dev)
{
guint32 caps;
g_return_val_if_fail (NM_IS_DEVICE (dev), NULL);
caps = nm_device_get_capabilities (dev);
/* Don't use devices that SUCK */
if (!(caps & NM_DEVICE_CAP_NM_SUPPORTED))
return NULL;
if (!NM_DEVICE_GET_CLASS (dev)->get_best_connection)
return NULL;
return NM_DEVICE_GET_CLASS (dev)->get_best_connection (dev);
}
/*
* nm_device_activate_stage1_device_prepare
*