diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-23 17:41:57 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-23 23:17:40 +0100 |
commit | f41aebf8973a70a0e0f44d93c52ccecee5c1f25e (patch) | |
tree | b622e9dfe46413ee749853639832ab5d854cc652 | |
parent | a1eb5eba303dea77524c9b890de805cf247f5f34 (diff) | |
parent | 1b00009169254d0a8fc9c2da1ccd99a716d2715f (diff) | |
download | NetworkManager-f41aebf8973a70a0e0f44d93c52ccecee5c1f25e.tar.gz |
device: merge branch 'jk/device-types-bgo762538'
https://bugzilla.gnome.org/show_bug.cgi?id=762538
-rwxr-xr-x | examples/python/dbus/list-devices.py | 1 | ||||
-rwxr-xr-x | examples/ruby/list-devices.rb | 1 | ||||
-rwxr-xr-x | examples/shell/list-devices.sh | 1 | ||||
-rw-r--r-- | libnm-core/nm-dbus-interface.h | 2 | ||||
-rw-r--r-- | libnm-glib/nm-device.c | 19 | ||||
-rw-r--r-- | libnm-util/NetworkManager.h | 2 | ||||
-rw-r--r-- | libnm/nm-device.c | 19 | ||||
-rw-r--r-- | src/devices/nm-device-veth.c | 2 | ||||
-rw-r--r-- | src/devices/nm-device.c | 2 |
9 files changed, 44 insertions, 5 deletions
diff --git a/examples/python/dbus/list-devices.py b/examples/python/dbus/list-devices.py index c9c753ec8b..8dd41f6164 100755 --- a/examples/python/dbus/list-devices.py +++ b/examples/python/dbus/list-devices.py @@ -40,6 +40,7 @@ devtypes = { 1: "Ethernet", 17: "IPTunnel" 18: "MACVLAN" 19: "VXLAN" + 20: "Veth" } states = { 0: "Unknown", diff --git a/examples/ruby/list-devices.rb b/examples/ruby/list-devices.rb index 9949a40977..bf37425839 100755 --- a/examples/ruby/list-devices.rb +++ b/examples/ruby/list-devices.rb @@ -43,6 +43,7 @@ devtypes = { 1 => "Ethernet", 17 => "IPTunnel", 18 => "MACVLAN", 19 => "VXLAN", + 20 => "Veth", } states = { 0 => "Unknown", diff --git a/examples/shell/list-devices.sh b/examples/shell/list-devices.sh index 817c8b7cc4..c5c4114012 100755 --- a/examples/shell/list-devices.sh +++ b/examples/shell/list-devices.sh @@ -52,6 +52,7 @@ devtype_to_name() 17) echo "IPTunnel" ;; 18) echo "MACVLAN" ;; 19) echo "VXLAN" ;; + 20) echo "Veth" ;; *) echo "Unknown" ;; esac } diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-interface.h index 2edc8cb49d..1b16cce527 100644 --- a/libnm-core/nm-dbus-interface.h +++ b/libnm-core/nm-dbus-interface.h @@ -152,6 +152,7 @@ typedef enum { * @NM_DEVICE_TYPE_IP_TUNNEL: a IP tunnel interface * @NM_DEVICE_TYPE_MACVLAN: a MACVLAN interface * @NM_DEVICE_TYPE_VXLAN: a VXLAN interface + * @NM_DEVICE_TYPE_VETH: a VETH interface * * #NMDeviceType values indicate the type of hardware represented by * an #NMDevice. @@ -179,6 +180,7 @@ typedef enum { NM_DEVICE_TYPE_IP_TUNNEL = 17, NM_DEVICE_TYPE_MACVLAN = 18, NM_DEVICE_TYPE_VXLAN = 19, + NM_DEVICE_TYPE_VETH = 20, } NMDeviceType; /** diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index 377784b82d..312f970059 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -296,6 +296,7 @@ static GType _nm_device_gtype_from_dtype (NMDeviceType dtype) { switch (dtype) { + case NM_DEVICE_TYPE_VETH: case NM_DEVICE_TYPE_ETHERNET: return NM_TYPE_DEVICE_ETHERNET; case NM_DEVICE_TYPE_WIFI: @@ -1868,9 +1869,23 @@ get_type_name (NMDevice *device) return _("VLAN"); case NM_DEVICE_TYPE_ADSL: return _("ADSL"); - default: - return _("Unknown"); + case NM_DEVICE_TYPE_MACVLAN: + return _("MACVLAN"); + case NM_DEVICE_TYPE_VXLAN: + return _("VXLAN"); + case NM_DEVICE_TYPE_IP_TUNNEL: + return _("IPTunnel"); + case NM_DEVICE_TYPE_TUN: + return _("Tun"); + case NM_DEVICE_TYPE_VETH: + return _("Veth"); + case NM_DEVICE_TYPE_GENERIC: + case NM_DEVICE_TYPE_UNUSED1: + case NM_DEVICE_TYPE_UNUSED2: + case NM_DEVICE_TYPE_UNKNOWN: + break; } + return _("Unknown"); } static char * diff --git a/libnm-util/NetworkManager.h b/libnm-util/NetworkManager.h index 8b083b91bf..c4105fd4c0 100644 --- a/libnm-util/NetworkManager.h +++ b/libnm-util/NetworkManager.h @@ -155,6 +155,7 @@ typedef enum { * @NM_DEVICE_TYPE_IP_TUNNEL: an IP tunnel interface * @NM_DEVICE_TYPE_MACVLAN: a MACVLAN interface * @NM_DEVICE_TYPE_VXLAN: a VXLAN interface + * @NM_DEVICE_TYPE_VETH: a VETH interface * * #NMDeviceType values indicate the type of hardware represented by * an #NMDevice. @@ -182,6 +183,7 @@ typedef enum { NM_DEVICE_TYPE_IP_TUNNEL = 17, NM_DEVICE_TYPE_MACVLAN = 18, NM_DEVICE_TYPE_VXLAN = 19, + NM_DEVICE_TYPE_VETH = 20, } NMDeviceType; /** diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 5545e8be31..53f42f82b2 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -341,6 +341,7 @@ static GType _nm_device_gtype_from_dtype (NMDeviceType dtype) { switch (dtype) { + case NM_DEVICE_TYPE_VETH: case NM_DEVICE_TYPE_ETHERNET: return NM_TYPE_DEVICE_ETHERNET; case NM_DEVICE_TYPE_WIFI: @@ -1819,9 +1820,23 @@ get_type_name (NMDevice *device) return _("VLAN"); case NM_DEVICE_TYPE_ADSL: return _("ADSL"); - default: - return _("Unknown"); + case NM_DEVICE_TYPE_MACVLAN: + return _("MACVLAN"); + case NM_DEVICE_TYPE_VXLAN: + return _("VXLAN"); + case NM_DEVICE_TYPE_IP_TUNNEL: + return _("IPTunnel"); + case NM_DEVICE_TYPE_TUN: + return _("Tun"); + case NM_DEVICE_TYPE_VETH: + return _("Veth"); + case NM_DEVICE_TYPE_GENERIC: + case NM_DEVICE_TYPE_UNUSED1: + case NM_DEVICE_TYPE_UNUSED2: + case NM_DEVICE_TYPE_UNKNOWN: + break; } + return _("Unknown"); } static char * diff --git a/src/devices/nm-device-veth.c b/src/devices/nm-device-veth.c index 3b845642b2..ff198a7d76 100644 --- a/src/devices/nm-device-veth.c +++ b/src/devices/nm-device-veth.c @@ -187,7 +187,7 @@ create_device (NMDeviceFactory *factory, return (NMDevice *) g_object_new (NM_TYPE_DEVICE_VETH, NM_DEVICE_IFACE, iface, NM_DEVICE_TYPE_DESC, "Veth", - NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_ETHERNET, + NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_VETH, NM_DEVICE_LINK_TYPE, NM_LINK_TYPE_VETH, NULL); } diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index bbad10946b..6e399cabcf 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -803,6 +803,8 @@ nm_device_get_priority (NMDevice *self) return 600; case NM_DEVICE_TYPE_OLPC_MESH: return 650; + case NM_DEVICE_TYPE_VETH: + return 665; case NM_DEVICE_TYPE_IP_TUNNEL: return 675; case NM_DEVICE_TYPE_MODEM: |