mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 22:00:32 +01:00
core: move nm_device_interface_spec_match_list() to nm-device.c
This commit is contained in:
parent
2db920659f
commit
c71656ff07
5 changed files with 10 additions and 29 deletions
|
|
@ -359,17 +359,6 @@ nm_device_interface_deactivate (NMDeviceInterface *device, NMDeviceStateReason r
|
|||
NM_DEVICE_INTERFACE_GET_INTERFACE (device)->deactivate (device, reason);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -100,8 +100,6 @@ struct _NMDeviceInterface {
|
|||
void (*deactivate) (NMDeviceInterface *device, NMDeviceStateReason reason);
|
||||
gboolean (*disconnect) (NMDeviceInterface *device, GError **error);
|
||||
|
||||
gboolean (*spec_match_list) (NMDeviceInterface *device, const GSList *specs);
|
||||
|
||||
void (*set_enabled) (NMDeviceInterface *device, gboolean enabled);
|
||||
|
||||
gboolean (*get_enabled) (NMDeviceInterface *device);
|
||||
|
|
@ -126,9 +124,6 @@ gboolean nm_device_interface_activate (NMDeviceInterface *device,
|
|||
|
||||
void nm_device_interface_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason);
|
||||
|
||||
gboolean nm_device_interface_spec_match_list (NMDeviceInterface *device,
|
||||
const GSList *specs);
|
||||
|
||||
gboolean nm_device_interface_get_enabled (NMDeviceInterface *device);
|
||||
|
||||
void nm_device_interface_set_enabled (NMDeviceInterface *device, gboolean enabled);
|
||||
|
|
|
|||
|
|
@ -173,7 +173,6 @@ static gboolean nm_device_activate (NMDeviceInterface *device,
|
|||
GError **error);
|
||||
static void nm_device_deactivate (NMDeviceInterface *device, NMDeviceStateReason reason);
|
||||
static gboolean device_disconnect (NMDeviceInterface *device, GError **error);
|
||||
static gboolean spec_match_list (NMDeviceInterface *device, const GSList *specs);
|
||||
|
||||
static void nm_device_take_down (NMDevice *dev, gboolean wait, NMDeviceStateReason reason);
|
||||
|
||||
|
|
@ -203,7 +202,6 @@ device_interface_init (NMDeviceInterface *device_interface_class)
|
|||
device_interface_class->activate = nm_device_activate;
|
||||
device_interface_class->deactivate = nm_device_deactivate;
|
||||
device_interface_class->disconnect = device_disconnect;
|
||||
device_interface_class->spec_match_list = spec_match_list;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4039,17 +4037,14 @@ nm_device_set_managed (NMDevice *device,
|
|||
nm_device_state_changed (device, NM_DEVICE_STATE_UNMANAGED, reason);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
spec_match_list (NMDeviceInterface *device, const GSList *specs)
|
||||
gboolean
|
||||
nm_device_spec_match_list (NMDevice *device, const GSList *specs)
|
||||
{
|
||||
NMDevice *self;
|
||||
|
||||
g_return_val_if_fail (device != NULL, FALSE);
|
||||
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
|
||||
|
||||
self = NM_DEVICE (device);
|
||||
if (NM_DEVICE_GET_CLASS (self)->spec_match_list)
|
||||
return NM_DEVICE_GET_CLASS (self)->spec_match_list (self, specs);
|
||||
|
||||
if (NM_DEVICE_GET_CLASS (device)->spec_match_list)
|
||||
return NM_DEVICE_GET_CLASS (device)->spec_match_list (device, specs);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@ gboolean nm_device_can_assume_connections (NMDevice *device);
|
|||
NMConnection * nm_device_connection_match_config (NMDevice *device,
|
||||
const GSList *connections);
|
||||
|
||||
gboolean nm_device_spec_match_list (NMDevice *device, const GSList *specs);
|
||||
|
||||
gboolean nm_device_is_activating (NMDevice *dev);
|
||||
gboolean nm_device_can_interrupt_activation (NMDevice *self);
|
||||
gboolean nm_device_autoconnect_allowed (NMDevice *self);
|
||||
|
|
|
|||
|
|
@ -1032,7 +1032,7 @@ system_unmanaged_devices_changed_cb (NMSettings *settings,
|
|||
NMDevice *device = NM_DEVICE (iter->data);
|
||||
gboolean managed;
|
||||
|
||||
managed = !nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs);
|
||||
managed = !nm_device_spec_match_list (device, unmanaged_specs);
|
||||
nm_device_set_managed (device,
|
||||
managed,
|
||||
managed ? NM_DEVICE_STATE_REASON_NOW_MANAGED :
|
||||
|
|
@ -1579,7 +1579,7 @@ add_device (NMManager *self, NMDevice *device)
|
|||
/* Start the device if it's supposed to be managed */
|
||||
unmanaged_specs = nm_settings_get_unmanaged_specs (priv->settings);
|
||||
if ( !manager_sleeping (self)
|
||||
&& !nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs)) {
|
||||
&& !nm_device_spec_match_list (device, unmanaged_specs)) {
|
||||
nm_device_set_managed (device,
|
||||
TRUE,
|
||||
existing ? NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED :
|
||||
|
|
@ -2480,7 +2480,7 @@ do_sleep_wake (NMManager *self)
|
|||
}
|
||||
|
||||
nm_device_clear_autoconnect_inhibit (device);
|
||||
if (nm_device_interface_spec_match_list (NM_DEVICE_INTERFACE (device), unmanaged_specs))
|
||||
if (nm_device_spec_match_list (device, unmanaged_specs))
|
||||
nm_device_set_managed (device, FALSE, NM_DEVICE_STATE_REASON_NOW_UNMANAGED);
|
||||
else
|
||||
nm_device_set_managed (device, TRUE, NM_DEVICE_STATE_REASON_NOW_MANAGED);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue