use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node in project netvirt by opendaylight.
the class L2GwValidateCli method verfiyLogicalSwitch.
private boolean verfiyLogicalSwitch(String logicalSwitchName, InstanceIdentifier<Node> nodeIid) {
NodeId nodeId = nodeIid.firstKeyOf(Node.class).getNodeId();
InstanceIdentifier<LogicalSwitches> logicalSwitchPath = HwvtepSouthboundUtils.createLogicalSwitchesInstanceIdentifier(nodeId, new HwvtepNodeName(logicalSwitchName));
if (!isPresent(configNodesData, nodeIid, logicalSwitchPath)) {
pw.println("Failed to find config logical switch " + logicalSwitchName + " for node " + nodeId.getValue());
return false;
}
if (!isPresent(operationalNodesData, nodeIid, logicalSwitchPath)) {
pw.println("Failed to find operational logical switch " + logicalSwitchName + " for node " + nodeId.getValue());
return false;
}
return true;
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node 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.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node in project netvirt by opendaylight.
the class NetworkL2gwDeviceInfoCli method printLocalUcastMacs.
@SuppressWarnings("checkstyle:HiddenField")
void printLocalUcastMacs(Node hwvtepNode, String elanName) {
session.getConsole().println("LocalUCast macs :");
session.getConsole().println(HEADINGUCAST);
if (hwvtepNode == null || hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<LocalUcastMacs> localUcastMacs = hwvtepNode.getAugmentation(HwvtepGlobalAugmentation.class).getLocalUcastMacs();
if (localUcastMacs == null || localUcastMacs.isEmpty()) {
return;
}
for (LocalUcastMacs localMac : localUcastMacs) {
String lsFromLocalMac = getLogicalSwitchValue(localMac.getLogicalSwitchRef());
if (elanName.equals(lsFromLocalMac)) {
String mac = localMac.getMacEntryKey().getValue();
String locator = getLocatorValue(localMac.getLocatorRef());
session.getConsole().println(mac + GAP + locator);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node 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.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node in project netvirt by opendaylight.
the class NetworkL2gwDeviceInfoCli method process.
@SuppressWarnings("checkstyle:HiddenField")
void process(NodeId hwvtepNodeId, String elanName) {
Node hwvtepConfigNode = configNodes.get(hwvtepNodeId);
session.getConsole().println("Config Data >>");
printLocalUcastMacs(hwvtepConfigNode, elanName);
session.getConsole().println("Operational Data >>");
Node hwvtepOpNode = opNodes.get(hwvtepNodeId);
printLocalUcastMacs(hwvtepOpNode, elanName);
session.getConsole().println("Config Data >>");
printLocalMcastMacs(hwvtepConfigNode, elanName);
session.getConsole().println("Operational Data >>");
printLocalMcastMacs(hwvtepOpNode, elanName);
session.getConsole().println("Config Data >>");
printRemoteUcastMacs(hwvtepConfigNode, elanName);
session.getConsole().println("Operational Data >>");
printRemoteUcastMacs(hwvtepOpNode, elanName);
session.getConsole().println("Config Data >>");
printRemoteMcastMacs(hwvtepConfigNode, elanName);
session.getConsole().println("Operational Data >>");
printRemoteMcastMacs(hwvtepOpNode, elanName);
Node hwvtepConfigPsNode = configPSNodes.get(hwvtepNodeId);
session.getConsole().println("Config Data >>");
printVlanBindings(hwvtepConfigPsNode, elanName);
session.getConsole().println("Operational Data >>");
Node hwvtepOpPsNode = opPSNodes.get(hwvtepNodeId);
printVlanBindings(hwvtepOpPsNode, elanName);
}
Aggregations