base if:interface-type;
}
- identity sub-interface {
- base if:interface-type;
- }
-
typedef vxlan-vni {
// FIXME: should be in a vxlan-specific model
description "VNI used in a VXLAN tunnel";
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.EthernetCsmacd;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfaceType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Gauge64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Tap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VhostUser;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VxlanTunnel;
return VhostUser.class;
}
- if (interfaceName.contains(".")) {
- return SubInterface.class;
- }
-
return EthernetCsmacd.class;
}
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.EthernetCsmacd;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.SubInterface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.Tap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VhostUser;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VxlanTunnel;
assertEquals(VxlanTunnel.class, InterfaceUtils.getInterfaceType("vxlan0"));
assertEquals(VxlanGpeTunnel.class, InterfaceUtils.getInterfaceType("vxlanGpe0"));
assertEquals(VhostUser.class, InterfaceUtils.getInterfaceType("VirtualEthernet0/0/0"));
- assertEquals(SubInterface.class, InterfaceUtils.getInterfaceType("eth0.0"));
+ assertEquals(EthernetCsmacd.class, InterfaceUtils.getInterfaceType("eth0.0"));
assertEquals(EthernetCsmacd.class, InterfaceUtils.getInterfaceType("local0"));
}
}
\ No newline at end of file