diff options
-rw-r--r-- | src/devices/nm-device.c | 16 | ||||
-rw-r--r-- | src/devices/nm-device.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 763008048c..ca2a513212 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -871,6 +871,22 @@ is_loopback (NMDevice *self) && NM_DEVICE_GET_PRIVATE (self)->ifindex == 1; } +gboolean +nm_device_is_vpn (NMDevice *self) +{ + g_return_val_if_fail (NM_IS_DEVICE (self), FALSE); + + /* NetworkManager currently treats VPN connections (loaded from NetworkManager VPN plugins) + * differently. Those are considered VPNs. + * However, some native device types may also be considered VPNs... + * + * We should avoid distinguishing between is-vpn and "regular" devices. Is an (unencrypted) + * IP tunnel a VPN? Is MACSec on top of an IP tunnel a VPN? + * Sometimes we differentiate, but avoid unless reasonable. */ + + return NM_IS_DEVICE_WIREGUARD (self); +} + NMSettings * nm_device_get_settings (NMDevice *self) { diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 66f9aa97bd..0a0ea6250e 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -881,4 +881,6 @@ struct _NMBtVTableNetworkServer { const char *nm_device_state_to_str (NMDeviceState state); const char *nm_device_state_reason_to_str (NMDeviceStateReason reason); +gboolean nm_device_is_vpn (NMDevice *self); + #endif /* __NETWORKMANAGER_DEVICE_H__ */ |