use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs in project netvirt by opendaylight.
the class NetworkL2gwDeviceInfoCli method printRemoteUcastMacs.
@SuppressWarnings("checkstyle:HiddenField")
void printRemoteUcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("RemoteUCast macs :");
session.getConsole().println(HEADINGUCAST);
if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<RemoteUcastMacs> remoteUcastMacs = hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getRemoteUcastMacs();
if (remoteUcastMacs == null || remoteUcastMacs.isEmpty()) {
return;
}
for (RemoteUcastMacs remoteMac : remoteUcastMacs) {
String lsFromRemoteMac = getLogicalSwitchValue(remoteMac.getLogicalSwitchRef());
if (elanName.equals(lsFromRemoteMac)) {
String mac = remoteMac.getMacEntryKey().getValue();
String locator = getLocatorValue(remoteMac.getLocatorRef());
session.getConsole().println(mac + GAP + locator);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs in project netvirt by opendaylight.
the class RemoteUcastCmd method areEqual.
@Override
public boolean areEqual(RemoteUcastMacs updated, RemoteUcastMacs orig) {
InstanceIdentifier<?> updatedMacRefIdentifier = updated.getLogicalSwitchRef().getValue();
HwvtepNodeName updatedMacNodeName = updatedMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
InstanceIdentifier<?> origMacRefIdentifier = orig.getLogicalSwitchRef().getValue();
HwvtepNodeName origMacNodeName = origMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
return updated.getMacEntryKey().equals(orig.getMacEntryKey()) && updatedMacNodeName.equals(origMacNodeName);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs in project netvirt by opendaylight.
the class RemoteUcastCmd method generateId.
@Override
public InstanceIdentifier<RemoteUcastMacs> generateId(InstanceIdentifier<Node> id, RemoteUcastMacs node) {
HwvtepLogicalSwitchRef lsRef = HwvtepHAUtil.convertLogicalSwitchRef(node.getKey().getLogicalSwitchRef(), id);
RemoteUcastMacsKey key = new RemoteUcastMacsKey(lsRef, node.getMacEntryKey());
return id.augmentation(HwvtepGlobalAugmentation.class).child(RemoteUcastMacs.class, key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.RemoteUcastMacs in project netvirt by opendaylight.
the class RemoteUcastCmd method transform.
@Override
public RemoteUcastMacs transform(InstanceIdentifier<Node> nodePath, RemoteUcastMacs src) {
RemoteUcastMacsBuilder ucmlBuilder = new RemoteUcastMacsBuilder(src);
ucmlBuilder.setLocatorRef(HwvtepHAUtil.convertLocatorRef(src.getLocatorRef(), nodePath));
ucmlBuilder.setLogicalSwitchRef(HwvtepHAUtil.convertLogicalSwitchRef(src.getLogicalSwitchRef(), nodePath));
ucmlBuilder.setMacEntryUuid(HwvtepHAUtil.getUUid(src.getMacEntryKey().getValue()));
RemoteUcastMacsKey key = new RemoteUcastMacsKey(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.global.attributes.RemoteUcastMacs in project netvirt by opendaylight.
the class ElanL2GatewayUtils method getElanMacTableEntriesMacs.
/**
* Gets the elan mac table entries as remote ucast macs. <br>
* Note: ELAN MAC table only contains internal switches MAC's. It doesn't
* contain external device MAC's.
*
* @param elanName
* the elan name
* @param hwVtepNodeId
* the hw vtep node id
* @param logicalSwitchName
* the logical switch name
* @return the elan mac table entries as remote ucast macs
*/
public List<RemoteUcastMacs> getElanMacTableEntriesMacs(String elanName, NodeId hwVtepNodeId, String logicalSwitchName) {
List<RemoteUcastMacs> lstRemoteUcastMacs = new ArrayList<>();
MacTable macTable = ElanUtils.getElanMacTable(broker, elanName);
if (macTable == null || macTable.getMacEntry() == null || macTable.getMacEntry().isEmpty()) {
LOG.trace("MacTable is empty for elan: {}", elanName);
return lstRemoteUcastMacs;
}
for (MacEntry macEntry : macTable.getMacEntry()) {
BigInteger dpnId = getDpidFromInterface(macEntry.getInterface());
if (dpnId == null) {
LOG.error("DPN ID not found for interface {}", macEntry.getInterface());
continue;
}
IpAddress dpnTepIp = elanItmUtils.getSourceDpnTepIp(dpnId, hwVtepNodeId);
LOG.trace("Dpn Tep IP: {} for dpnId: {} and nodeId: {}", dpnTepIp, dpnId, hwVtepNodeId.getValue());
if (dpnTepIp == null) {
LOG.error("TEP IP not found for dpnId {} and nodeId {}", dpnId, hwVtepNodeId.getValue());
continue;
}
HwvtepPhysicalLocatorAugmentation physLocatorAug = HwvtepSouthboundUtils.createHwvtepPhysicalLocatorAugmentation(String.valueOf(dpnTepIp.getValue()));
// TODO: Query ARP cache to get IP address corresponding to the
// MAC
RemoteUcastMacs remoteUcastMac = HwvtepSouthboundUtils.createRemoteUcastMac(hwVtepNodeId, macEntry.getMacAddress().getValue().toLowerCase(Locale.getDefault()), null, /*IpAddress*/
logicalSwitchName, physLocatorAug);
lstRemoteUcastMacs.add(remoteUcastMac);
}
return lstRemoteUcastMacs;
}
Aggregations