use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet in project netvirt by opendaylight.
the class NetworkL2gwDeviceInfoCli method printRemoteMcastMacs.
@SuppressWarnings("checkstyle:HiddenField")
void printRemoteMcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("RemoteMCast macs :");
session.getConsole().println(HEADINGMCAST);
if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<RemoteMcastMacs> remoteMcastMacs = hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getRemoteMcastMacs();
if (remoteMcastMacs == null || remoteMcastMacs.isEmpty()) {
return;
}
for (RemoteMcastMacs remoteMac : remoteMcastMacs) {
String lsFromremoteMac = getLogicalSwitchValue(remoteMac.getLogicalSwitchRef());
if (elanName.equals(lsFromremoteMac)) {
String mac = remoteMac.getMacEntryKey().getValue();
List<String> locatorsets = new ArrayList<>();
for (LocatorSet locatorSet : remoteMac.getLocatorSet()) {
locatorsets.add(getLocatorValue(locatorSet.getLocatorRef()));
}
session.getConsole().println(mac + GAP + locatorsets.toString());
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet in project netvirt by opendaylight.
the class LocalMcastCmd method transform.
@Override
public LocalMcastMacs transform(InstanceIdentifier<Node> nodePath, LocalMcastMacs src) {
LocalMcastMacsBuilder ucmlBuilder = new LocalMcastMacsBuilder(src);
List<LocatorSet> locatorSet = new ArrayList<>();
for (LocatorSet locator : src.getLocatorSet()) {
locatorSet.add(new LocatorSetBuilder().setLocatorRef(HwvtepHAUtil.buildLocatorRef(nodePath, HwvtepHAUtil.getTepIpVal(locator.getLocatorRef()))).build());
}
ucmlBuilder.setLocatorSet(locatorSet);
ucmlBuilder.setLogicalSwitchRef(HwvtepHAUtil.convertLogicalSwitchRef(src.getLogicalSwitchRef(), nodePath));
ucmlBuilder.setMacEntryUuid(HwvtepHAUtil.getUUid(src.getMacEntryKey().getValue()));
LocalMcastMacsKey key = new LocalMcastMacsKey(ucmlBuilder.getLogicalSwitchRef(), ucmlBuilder.getMacEntryKey());
ucmlBuilder.setKey(key);
return ucmlBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet in project netvirt by opendaylight.
the class RemoteMcastCmd method transform.
@Override
public RemoteMcastMacs transform(InstanceIdentifier<Node> nodePath, RemoteMcastMacs src) {
RemoteMcastMacsBuilder ucmlBuilder = new RemoteMcastMacsBuilder(src);
List<LocatorSet> locatorSet = new ArrayList<>();
for (LocatorSet locator : src.getLocatorSet()) {
locatorSet.add(new LocatorSetBuilder().setLocatorRef(HwvtepHAUtil.buildLocatorRef(nodePath, HwvtepHAUtil.getTepIpVal(locator.getLocatorRef()))).build());
}
ucmlBuilder.setLocatorSet(locatorSet);
ucmlBuilder.setLogicalSwitchRef(HwvtepHAUtil.convertLogicalSwitchRef(src.getLogicalSwitchRef(), nodePath));
ucmlBuilder.setMacEntryUuid(HwvtepHAUtil.getUUid(src.getMacEntryKey().getValue()));
RemoteMcastMacsKey key = new RemoteMcastMacsKey(ucmlBuilder.getLogicalSwitchRef(), ucmlBuilder.getMacEntryKey());
ucmlBuilder.setKey(key);
return ucmlBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet in project netvirt by opendaylight.
the class ElanL2GatewayUtils method checkIfPhyLocatorAlreadyExistsInRemoteMcastEntry.
/**
* Check if phy locator already exists in remote mcast entry.
*
* @param nodeId
* the node id
* @param remoteMcastMac
* the remote mcast mac
* @param expectedPhyLocatorIp
* the expected phy locator ip
* @return true, if successful
*/
public static boolean checkIfPhyLocatorAlreadyExistsInRemoteMcastEntry(NodeId nodeId, RemoteMcastMacs remoteMcastMac, IpAddress expectedPhyLocatorIp) {
if (remoteMcastMac != null) {
HwvtepPhysicalLocatorAugmentation expectedPhyLocatorAug = HwvtepSouthboundUtils.createHwvtepPhysicalLocatorAugmentation(String.valueOf(expectedPhyLocatorIp.getValue()));
HwvtepPhysicalLocatorRef expectedPhyLocRef = new HwvtepPhysicalLocatorRef(HwvtepSouthboundUtils.createPhysicalLocatorInstanceIdentifier(nodeId, expectedPhyLocatorAug));
if (remoteMcastMac.getLocatorSet() != null) {
for (LocatorSet locatorSet : remoteMcastMac.getLocatorSet()) {
if (locatorSet.getLocatorRef().equals(expectedPhyLocRef)) {
LOG.trace("matched phyLocRef: {}", expectedPhyLocRef);
return true;
}
}
}
}
return false;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet 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();
}
Aggregations