use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.info.router.ports.Ports in project openflowplugin by opendaylight.
the class PortConvertorTest method testtoPortDescwithAllParameters.
/**
* test of {@link PortConvertor#toPortDesc(FlowCapablePort , short)}.
*/
@Test
public void testtoPortDescwithAllParameters() {
State state = new StateBuilder().setBlocked(false).setLinkDown(false).setLive(false).build();
FlowCapableNodeConnectorBuilder flowCapableNodeConnectorBuilder = new FlowCapableNodeConnectorBuilder();
flowCapableNodeConnectorBuilder.setAdvertisedFeatures(features);
flowCapableNodeConnectorBuilder.setConfiguration(config);
flowCapableNodeConnectorBuilder.setCurrentFeature(features);
flowCapableNodeConnectorBuilder.setCurrentSpeed(null);
flowCapableNodeConnectorBuilder.setHardwareAddress(new MacAddress(DEFAULT_MAC_ADDRESS));
flowCapableNodeConnectorBuilder.setMaximumSpeed(null);
flowCapableNodeConnectorBuilder.setName("foo");
flowCapableNodeConnectorBuilder.setPeerFeatures(features);
flowCapableNodeConnectorBuilder.setPortNumber(new PortNumberUni(42L));
flowCapableNodeConnectorBuilder.setState(state);
flowCapableNodeConnectorBuilder.setSupported(features);
final Ports portsOut = PortConvertor.toPortDesc(flowCapableNodeConnectorBuilder.build(), EncodeConstants.OF13_VERSION_ID);
PortsBuilder portsB = new PortsBuilder();
portsB.setAdvertisedFeatures(portf31);
portsB.setConfig(config31);
portsB.setCurrentFeatures(portf31);
portsB.setCurrSpeed(null);
portsB.setHwAddr(new MacAddress(DEFAULT_MAC_ADDRESS));
portsB.setMaxSpeed(null);
portsB.setName("foo");
portsB.setPeerFeatures(portf31);
portsB.setPortNo(42L);
portsB.setState(new PortState(false, false, false));
portsB.setSupportedFeatures(portf31);
Assert.assertEquals(portsB.build(), portsOut);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.info.router.ports.Ports in project genius by opendaylight.
the class InterfacemgrProvider method getTunnelPortsOnBridge.
/**
* Get all termination points of type tunnel on a given DPN.
*
* @param dpnId
* Datapath Node Identifier
*
* @return If the data at the supplied path exists, returns a list of all termination point
* Augmentations of type tunnel
*/
@Override
public List<OvsdbTerminationPointAugmentation> getTunnelPortsOnBridge(BigInteger dpnId) {
List<OvsdbTerminationPointAugmentation> tunnelPorts = new ArrayList<>();
List<TerminationPoint> portList = interfaceMetaUtils.getTerminationPointsOnBridge(dpnId);
for (TerminationPoint ovsPort : portList) {
OvsdbTerminationPointAugmentation portAug = ovsPort.getAugmentation(OvsdbTerminationPointAugmentation.class);
if (portAug != null && SouthboundUtils.isInterfaceTypeTunnel(portAug.getInterfaceType())) {
tunnelPorts.add(portAug);
}
}
LOG.debug("Found {} tunnel ports on bridge {}", tunnelPorts.size(), dpnId);
return tunnelPorts;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.info.router.ports.Ports in project genius by opendaylight.
the class InterfacemgrProvider method getPortsOnBridge.
@Override
public /**
* Get all termination points on a given DPN.
* This API uses read on Operational DS. If there are perf issues in cluster
* setup, we can consider caching later.
*
* @param dpnId
* Datapath Node Identifier
*
* @return If the data at the supplied path exists, returns a list of all termination point
* Augmentations
*/
List<OvsdbTerminationPointAugmentation> getPortsOnBridge(BigInteger dpnId) {
List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
List<TerminationPoint> portList = interfaceMetaUtils.getTerminationPointsOnBridge(dpnId);
for (TerminationPoint ovsPort : portList) {
if (ovsPort.getAugmentation(OvsdbTerminationPointAugmentation.class) != null) {
ports.add(ovsPort.getAugmentation(OvsdbTerminationPointAugmentation.class));
}
}
LOG.debug("Found {} ports on bridge {}", ports.size(), dpnId);
return ports;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.floating.ip.info.router.ports.Ports in project genius by opendaylight.
the class ShowOvsPorts method doExecute.
@Override
protected Object doExecute() {
LOG.debug("Executing show ovs-ports command");
List<OvsdbTerminationPointAugmentation> ports = interfaceManager.getPortsOnBridge(dpnId);
if (!ports.isEmpty()) {
IfmCLIUtil.showBridgePortsHeader(session, dpnId);
}
for (OvsdbTerminationPointAugmentation port : ports) {
IfmCLIUtil.showBridgePortsOutput(session, port);
}
return null;
}
Aggregations