use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class TransportZoneNotificationUtil method addVtep.
/**
* Tries to add a vtep for a transport zone.
*
* @return Whether a vtep was added or not.
*/
private boolean addVtep(TransportZone zone, String subnetIp, BigInteger dpnId, @Nullable String localIp) {
List<Subnets> zoneSubnets = zone.getSubnets();
if (zoneSubnets == null) {
return false;
}
Subnets subnets = getOrAddSubnet(zoneSubnets, subnetIp);
for (Vteps existingVtep : subnets.getVteps()) {
if (existingVtep.getDpnId().equals(dpnId)) {
return false;
}
}
if (localIp != null) {
IpAddress nodeIp = new IpAddress(localIp.toCharArray());
VtepsBuilder vtepsBuilder = new VtepsBuilder().setDpnId(dpnId).setIpAddress(nodeIp).setPortname(TUNNEL_PORT).setOptionOfTunnel(elanConfig.isUseOfTunnels());
subnets.getVteps().add(vtepsBuilder.build());
return true;
}
return false;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class NodeConnectedHandlerUtils method addPsNode.
CheckedFuture<Void, TransactionCommitFailedException> addPsNode(InstanceIdentifier<Node> path, InstanceIdentifier<Node> parentPath, List<String> portNameList, WriteTransaction transaction) throws Exception {
NodeBuilder nodeBuilder = null;
nodeBuilder = prepareOperationalNode(path);
PhysicalSwitchAugmentationBuilder physicalSwitchAugmentationBuilder = new PhysicalSwitchAugmentationBuilder();
physicalSwitchAugmentationBuilder.setManagedBy(new HwvtepGlobalRef(parentPath));
physicalSwitchAugmentationBuilder.setPhysicalSwitchUuid(getUUid("d1s3"));
physicalSwitchAugmentationBuilder.setHwvtepNodeName(new HwvtepNodeName("s3"));
physicalSwitchAugmentationBuilder.setHwvtepNodeDescription("description");
List<TunnelIps> tunnelIps = new ArrayList<>();
IpAddress ip = new IpAddress("192.168.122.30".toCharArray());
tunnelIps.add(new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
physicalSwitchAugmentationBuilder.setTunnelIps(tunnelIps);
nodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, physicalSwitchAugmentationBuilder.build());
PhysicalSwitchHelper.dId = parentPath;
nodeBuilder.setTerminationPoint(PhysicalSwitchHelper.addPhysicalSwitchTerminationPoints(path, transaction, portNameList));
return TestUtil.submitNode(OPERATIONAL, path, nodeBuilder.build(), transaction);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class TestBuilders method buildLocalMcastMacs.
public static LocalMcastMacs buildLocalMcastMacs(InstanceIdentifier<Node> iid, String mac, String logicalSwitchName, String tepIp) {
LocalMcastMacsBuilder localMcastMacsBuilder = new LocalMcastMacsBuilder();
if (mac.equals("unknown-dst")) {
localMcastMacsBuilder.setMacEntryKey(new MacAddress("00:00:00:00:00:00"));
} else {
localMcastMacsBuilder.setMacEntryKey(new MacAddress(mac));
}
localMcastMacsBuilder.setMacEntryUuid(getUUid(mac));
// mMacLocalBuilder.setIpaddr(new IpAddress(ip.toCharArray()));
localMcastMacsBuilder.setLogicalSwitchRef(buildLogicalSwitchesRef(iid, logicalSwitchName));
List<LocatorSet> locatorSets = new ArrayList<>();
locatorSets.add(new LocatorSetBuilder().setLocatorRef(buildLocatorRef(iid, tepIp)).build());
localMcastMacsBuilder.setLocatorSet(locatorSets);
return localMcastMacsBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class TestBuilders method buildTerminationPoint.
public static TerminationPoint buildTerminationPoint(InstanceIdentifier<Node> nodeIid, String ip) {
TerminationPointKey tpKey = new TerminationPointKey(new TpId("vxlan_over_ipv4:" + ip));
TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
if (nodeIid != null && tpKey != null) {
tpBuilder.setKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
InstanceIdentifier<TerminationPoint> tpPath = buildTpId(nodeIid, ip);
HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder = new HwvtepPhysicalLocatorAugmentationBuilder();
tpAugmentationBuilder.setPhysicalLocatorUuid(getUUid(ip));
tpAugmentationBuilder.setEncapsulationType(createEncapsulationType("vxlan_over_ipv4"));
tpAugmentationBuilder.setDstIp(new IpAddress(ip.toCharArray()));
tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
}
return tpBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.endpoint.endpoint.type.IpAddress in project netvirt by opendaylight.
the class IfMgr method addHostIntf.
public void addHostIntf(Uuid portId, Uuid snetId, Uuid networkId, IpAddress fixedIp, String macAddress, String deviceOwner) {
LOG.debug("addHostIntf portId {}, snetId {}, networkId {}, ip {}, mac {}", portId, snetId, networkId, fixedIp, macAddress);
// Save the interface ipv6 address in its fully expanded format
Ipv6Address addr = new Ipv6Address(InetAddresses.forString(fixedIp.getIpv6Address().getValue()).getHostAddress());
fixedIp = new IpAddress(addr);
VirtualPort intf = VirtualPort.builder().intfUUID(portId).networkID(networkId).macAddress(macAddress).routerIntfFlag(false).deviceOwner(deviceOwner).build();
intf.setSubnetInfo(snetId, fixedIp);
VirtualPort prevIntf = vintfs.putIfAbsent(portId, intf);
if (prevIntf == null) {
Long elanTag = getNetworkElanTag(networkId);
// Do service binding for the port and set the serviceBindingStatus to true.
ipv6ServiceUtils.bindIpv6Service(portId.getValue(), elanTag, NwConstants.IPV6_TABLE);
intf.setServiceBindingStatus(true);
/* Update the intf dpnId/ofPort from the Operational Store */
updateInterfaceDpidOfPortInfo(portId);
} else {
intf = prevIntf;
intf.setSubnetInfo(snetId, fixedIp);
}
VirtualSubnet snet = getSubnet(snetId);
if (snet != null) {
intf.setSubnet(snetId, snet);
} else {
addUnprocessed(unprocessedSubnetIntfs, snetId, intf);
}
}
Aggregations