core: base infrastructure for connection assumption

Figure out what connections can be assumed when a device is added,
and on shutdown don't blow away connections that can be assumed on
NM restart.
This commit is contained in:
Dan Williams
2009-08-03 17:15:03 -04:00
parent 8f0652a9f0
commit f2eb3dea65
10 changed files with 532 additions and 23 deletions

View File

@@ -282,8 +282,29 @@ gboolean
nm_device_interface_spec_match_list (NMDeviceInterface *device,
const GSList *specs)
{
g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE);
if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->spec_match_list)
return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->spec_match_list (device, specs);
return FALSE;
}
NMConnection *
nm_device_interface_connection_match_config (NMDeviceInterface *device,
const GSList *connections)
{
g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), NULL);
if (NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config)
return NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config (device, connections);
return NULL;
}
gboolean
nm_device_interface_can_assume_connection (NMDeviceInterface *device)
{
g_return_val_if_fail (NM_IS_DEVICE_INTERFACE (device), FALSE);
return !!NM_DEVICE_INTERFACE_GET_INTERFACE (device)->connection_match_config;
}