use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeBase in project genius by opendaylight.
the class ItmInternalTunnelAddWorker method createLogicalTunnelInterface.
private static void createLogicalTunnelInterface(BigInteger srcDpnId, Class<? extends TunnelTypeBase> tunType, String interfaceName) {
Interface iface = ItmUtils.buildLogicalTunnelInterface(srcDpnId, interfaceName, String.format("%s %s", ItmUtils.convertTunnelTypetoString(tunType), "Interface"), true);
InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(interfaceName);
ITMBatchingUtils.update(trunkIdentifier, iface, ITMBatchingUtils.EntityType.DEFAULT_CONFIG);
ItmUtils.ITM_CACHE.addInterface(iface);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeBase in project genius by opendaylight.
the class InterfaceManagerTestUtil method buildTunnelInterface.
static Interface buildTunnelInterface(BigInteger dpn, String ifName, String desc, boolean enabled, Class<? extends TunnelTypeBase> tunType, String remoteIpStr, String localIpStr) {
InterfaceBuilder builder = new InterfaceBuilder().setKey(new InterfaceKey(ifName)).setName(ifName).setDescription(desc).setEnabled(enabled).setType(Tunnel.class);
ParentRefs parentRefs = new ParentRefsBuilder().setDatapathNodeIdentifier(dpn).build();
builder.addAugmentation(ParentRefs.class, parentRefs);
IpAddress remoteIp = new IpAddress(Ipv4Address.getDefaultInstance(remoteIpStr));
IpAddress localIp = new IpAddress(Ipv4Address.getDefaultInstance(localIpStr));
IfTunnel tunnel = new IfTunnelBuilder().setTunnelDestination(remoteIp).setTunnelGateway(localIp).setTunnelSource(localIp).setTunnelInterfaceType(tunType).setInternal(true).setMonitorEnabled(false).build();
builder.addAugmentation(IfTunnel.class, tunnel);
return builder.build();
}
Aggregations