device: add new NMDeviceType NM_DEVICE_TYPE_VETH

Based-on-patch-by: Jiří Klimeš <jklimes@redhat.com>
This commit is contained in:
Thomas Haller 2016-02-23 17:40:54 +01:00
parent 26718e989e
commit 1b00009169
9 changed files with 16 additions and 1 deletions

View file

@ -40,6 +40,7 @@ devtypes = { 1: "Ethernet",
17: "IPTunnel"
18: "MACVLAN"
19: "VXLAN"
20: "Veth"
}
states = { 0: "Unknown",

View file

@ -43,6 +43,7 @@ devtypes = { 1 => "Ethernet",
17 => "IPTunnel",
18 => "MACVLAN",
19 => "VXLAN",
20 => "Veth",
}
states = { 0 => "Unknown",

View file

@ -52,6 +52,7 @@ devtype_to_name()
17) echo "IPTunnel" ;;
18) echo "MACVLAN" ;;
19) echo "VXLAN" ;;
20) echo "Veth" ;;
*) echo "Unknown" ;;
esac
}

View file

@ -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;
/**

View file

@ -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:
@ -1876,6 +1877,8 @@ get_type_name (NMDevice *device)
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:

View file

@ -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;
/**

View file

@ -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:
@ -1827,6 +1828,8 @@ get_type_name (NMDevice *device)
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:

View file

@ -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);
}

View file

@ -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: