use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project genius by opendaylight.
the class HwvtepSouthboundUtils method createRemoteMcastMac.
/**
* Creates the remote mcast mac.
*
* @param nodeId
* the node id
* @param mac
* the mac
* @param ipAddress
* the ip address
* @param logicalSwitchName
* the logical switch name
* @param lstPhysicalLocatorAug
* the lst physical locator aug
* @return the remote mcast macs
*/
public static RemoteMcastMacs createRemoteMcastMac(NodeId nodeId, String mac, IpAddress ipAddress, String logicalSwitchName, List<HwvtepPhysicalLocatorAugmentation> lstPhysicalLocatorAug) {
HwvtepLogicalSwitchRef lsRef = new HwvtepLogicalSwitchRef(createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName)));
List<LocatorSet> lstLocatorSet = new ArrayList<>();
for (HwvtepPhysicalLocatorAugmentation phyLocatorAug : lstPhysicalLocatorAug) {
HwvtepPhysicalLocatorRef phyLocRef = new HwvtepPhysicalLocatorRef(createPhysicalLocatorInstanceIdentifier(nodeId, phyLocatorAug));
lstLocatorSet.add(new LocatorSetBuilder().setLocatorRef(phyLocRef).build());
}
RemoteMcastMacs remoteMcastMacs = new RemoteMcastMacsBuilder().setMacEntryKey(new MacAddress(mac)).setIpaddr(ipAddress).setLogicalSwitchRef(lsRef).setLocatorSet(lstLocatorSet).build();
return remoteMcastMacs;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project genius by opendaylight.
the class HwvtepSouthboundUtils method createHwvtepPhysicalLocatorAugmentation.
/**
* Create hwvtep physical locator augmentation.
*
* @param ipAddress
* the ip address
* @return the hwvtep physical locator augmentation
*/
public static HwvtepPhysicalLocatorAugmentation createHwvtepPhysicalLocatorAugmentation(String ipAddress) {
// FIXME: Get encapsulation type dynamically
Class<? extends EncapsulationTypeBase> encapTypeClass = createEncapsulationType(StringUtils.EMPTY);
HwvtepPhysicalLocatorAugmentationBuilder phyLocBuilder = new HwvtepPhysicalLocatorAugmentationBuilder().setEncapsulationType(encapTypeClass).setDstIp(new IpAddress(ipAddress.toCharArray()));
return phyLocBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project genius by opendaylight.
the class HwvtepUtils method putPhysicalLocator.
/**
* Put physical locator in the transaction.
*
* @param transaction
* the transaction
* @param nodeId
* the node id
* @param phyLocator
* the phy locator
*/
public static void putPhysicalLocator(final WriteTransaction transaction, final NodeId nodeId, final HwvtepPhysicalLocatorAugmentation phyLocator) {
InstanceIdentifier<TerminationPoint> iid = HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, phyLocator);
TerminationPoint terminationPoint = new TerminationPointBuilder().setKey(HwvtepSouthboundUtils.getTerminationPointKey(phyLocator)).addAugmentation(HwvtepPhysicalLocatorAugmentation.class, phyLocator).build();
transaction.put(LogicalDatastoreType.CONFIGURATION, iid, terminationPoint, true);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method putRemoteMcastMac.
/**
* Put remote mcast mac in config DS.
*
* @param nodeId
* the node id
* @param logicalSwitchName
* the logical switch name
* @param tepIps
* the tep ips
*/
private static void putRemoteMcastMac(NodeId nodeId, String logicalSwitchName, ArrayList<IpAddress> tepIps) {
List<LocatorSet> locators = new ArrayList<>();
for (IpAddress tepIp : tepIps) {
HwvtepPhysicalLocatorAugmentation phyLocatorAug = HwvtepSouthboundUtils.createHwvtepPhysicalLocatorAugmentation(String.valueOf(tepIp.getValue()));
HwvtepPhysicalLocatorRef phyLocRef = new HwvtepPhysicalLocatorRef(HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, phyLocatorAug));
locators.add(new LocatorSetBuilder().setLocatorRef(phyLocRef).build());
}
HwvtepLogicalSwitchRef lsRef = new HwvtepLogicalSwitchRef(HwvtepSouthboundUtils.createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName)));
RemoteMcastMacs remoteMcastMac = new RemoteMcastMacsBuilder().setMacEntryKey(new MacAddress(ElanConstants.UNKNOWN_DMAC)).setLogicalSwitchRef(lsRef).setLocatorSet(locators).build();
InstanceIdentifier<RemoteMcastMacs> iid = HwvtepSouthboundUtils.createRemoteMcastMacsInstanceIdentifier(nodeId, remoteMcastMac.getKey());
ResourceBatchingManager.getInstance().put(ResourceBatchingManager.ShardResource.CONFIG_TOPOLOGY, iid, remoteMcastMac);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation in project netvirt by opendaylight.
the class ElanL2GatewayUtils method getOtherDevicesMacs.
/**
* Gets the l2 gateway devices ucast local macs as remote ucast macs.
*
* @param elanName
* the elan name
* @param l2GatewayDeviceToBeConfigured
* the l2 gateway device to be configured
* @param hwVtepNodeId
* the hw vtep node Id to be configured
* @param logicalSwitchName
* the logical switch name
* @return the l2 gateway devices macs as remote ucast macs
*/
public static List<RemoteUcastMacs> getOtherDevicesMacs(String elanName, L2GatewayDevice l2GatewayDeviceToBeConfigured, NodeId hwVtepNodeId, String logicalSwitchName) {
List<RemoteUcastMacs> lstRemoteUcastMacs = new ArrayList<>();
ConcurrentMap<String, L2GatewayDevice> elanL2GwDevicesFromCache = ElanL2GwCacheUtils.getInvolvedL2GwDevices(elanName);
if (elanL2GwDevicesFromCache != null) {
for (L2GatewayDevice otherDevice : elanL2GwDevicesFromCache.values()) {
if (l2GatewayDeviceToBeConfigured.getHwvtepNodeId().equals(otherDevice.getHwvtepNodeId())) {
continue;
}
if (!areMLAGDevices(l2GatewayDeviceToBeConfigured, otherDevice)) {
for (LocalUcastMacs localUcastMac : otherDevice.getUcastLocalMacs()) {
HwvtepPhysicalLocatorAugmentation physLocatorAug = HwvtepSouthboundUtils.createHwvtepPhysicalLocatorAugmentation(String.valueOf(otherDevice.getTunnelIp().getValue()));
RemoteUcastMacs remoteUcastMac = HwvtepSouthboundUtils.createRemoteUcastMac(hwVtepNodeId, localUcastMac.getMacEntryKey().getValue().toLowerCase(Locale.getDefault()), localUcastMac.getIpaddr(), logicalSwitchName, physLocatorAug);
lstRemoteUcastMacs.add(remoteUcastMac);
}
}
}
}
return lstRemoteUcastMacs;
}
Aggregations