use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSetBuilder 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.hwvtep.physical.locator.set.attributes.LocatorSetBuilder in project netvirt by opendaylight.
the class TestBuilders method buildRemoteMcastMacs.
public static RemoteMcastMacs buildRemoteMcastMacs(InstanceIdentifier<Node> iid, String mac, String logicalSwitchName, String[] tepIps) {
RemoteMcastMacsBuilder remoteMcastMacsBuilder = new RemoteMcastMacsBuilder();
if (mac.equals("unknown-dst")) {
remoteMcastMacsBuilder.setMacEntryKey(new MacAddress("00:00:00:00:00:00"));
} else {
remoteMcastMacsBuilder.setMacEntryKey(new MacAddress(mac));
}
remoteMcastMacsBuilder.setMacEntryUuid(getUUid(mac));
// mMacLocalBuilder.setIpaddr(new IpAddress(ip.toCharArray()));
remoteMcastMacsBuilder.setLogicalSwitchRef(buildLogicalSwitchesRef(iid, logicalSwitchName));
List<LocatorSet> locatorSets = new ArrayList<>();
for (String tepIp : tepIps) {
locatorSets.add(new LocatorSetBuilder().setLocatorRef(buildLocatorRef(iid, tepIp)).build());
}
remoteMcastMacsBuilder.setLocatorSet(locatorSets);
return remoteMcastMacsBuilder.build();
}
Aggregations