use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class DeviceFlowRegistryImplTest method testFill.
@Test
public void testFill() throws Exception {
final InstanceIdentifier<FlowCapableNode> path = nodeInstanceIdentifier.augmentation(FlowCapableNode.class);
final Flow flow = new FlowBuilder().setTableId((short) 1).setPriority(10).setCookie(new FlowCookie(BigInteger.TEN)).setId(new FlowId("HELLO")).build();
final Table table = new TableBuilder().setFlow(Collections.singletonList(flow)).build();
final FlowCapableNode flowCapableNode = new FlowCapableNodeBuilder().setTable(Collections.singletonList(table)).build();
final Map<FlowRegistryKey, FlowDescriptor> allFlowDescriptors = fillRegistry(path, flowCapableNode);
key = FlowRegistryKeyFactory.create(OFConstants.OFP_VERSION_1_3, flow);
InOrder order = inOrder(dataBroker, readOnlyTransaction);
order.verify(dataBroker).newReadOnlyTransaction();
order.verify(readOnlyTransaction).read(LogicalDatastoreType.CONFIGURATION, path);
order.verify(dataBroker).newReadOnlyTransaction();
order.verify(readOnlyTransaction).read(LogicalDatastoreType.OPERATIONAL, path);
assertTrue(allFlowDescriptors.containsKey(key));
deviceFlowRegistry.addMark(key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class DeviceFlowRegistryImplTest method testFailedFill.
@Test
public void testFailedFill() throws Exception {
final InstanceIdentifier<FlowCapableNode> path = nodeInstanceIdentifier.augmentation(FlowCapableNode.class);
fillRegistry(path, null);
fillRegistry(path, new FlowCapableNodeBuilder().setTable(null).build());
fillRegistry(path, new FlowCapableNodeBuilder().setTable(Collections.singletonList(null)).build());
fillRegistry(path, new FlowCapableNodeBuilder().setTable(Collections.singletonList(new TableBuilder().setFlow(null).build())).build());
fillRegistry(path, new FlowCapableNodeBuilder().setTable(Collections.singletonList(new TableBuilder().setFlow(Collections.singletonList(null)).build())).build());
fillRegistry(path, new FlowCapableNodeBuilder().setTable(Collections.singletonList(new TableBuilder().setFlow(Collections.singletonList(new FlowBuilder().setId(null).build())).build())).build());
verify(dataBroker, times(12)).newReadOnlyTransaction();
verify(readOnlyTransaction, times(6)).read(LogicalDatastoreType.CONFIGURATION, path);
verify(readOnlyTransaction, times(6)).read(LogicalDatastoreType.OPERATIONAL, path);
Assert.assertEquals(1, deviceFlowRegistry.getAllFlowDescriptors().size());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class NodeConnectorRefToPortTranslator method toNodeConnectorRef.
/**
* Converts {@link PacketIn} to {@link NodeConnectorRef}.
* @param packetIn Packet input
* @param dataPathId Data path id
* @return packet input converted to node connector reference
*/
@Nullable
public static NodeConnectorRef toNodeConnectorRef(@Nonnull PacketIn packetIn, BigInteger dataPathId) {
Preconditions.checkNotNull(packetIn);
NodeConnectorRef ref = null;
Long port = getPortNoFromPacketIn(packetIn);
if (port != null) {
OpenflowVersion version = OpenflowVersion.get(packetIn.getVersion());
ref = InventoryDataServiceUtil.nodeConnectorRefFromDatapathIdPortno(dataPathId, port, version);
}
return ref;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class OutputRegConvertor method convert.
@Override
public org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action convert(final Action input, final ActionPath path) {
NxActionOutputReg action = ((ActionOutputReg) input.getActionChoice()).getNxActionOutputReg();
SrcBuilder srcBuilder = new SrcBuilder();
srcBuilder.setSrcChoice(RegMoveConvertor.resolveSrcValue(action.getSrc()));
srcBuilder.setOfsNbits(action.getNBits());
NxOutputRegBuilder builder = new NxOutputRegBuilder();
builder.setSrc(srcBuilder.build());
builder.setMaxLen(action.getMaxLen());
return resolveAction(builder.build(), path);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcupd.message.pcupd.message.updates.Path in project openflowplugin by opendaylight.
the class ArpTpaConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
ArpTpaCaseValue arpTpaCaseValue = (ArpTpaCaseValue) input.getMatchEntryValue();
Ipv4Address ipv4Address = IpConverter.longToIpv4Address(arpTpaCaseValue.getArpTpaValues().getValue());
return resolveAugmentation(new NxmOfArpTpaBuilder().setIpv4Address(ipv4Address).build(), path, NxmOfArpTpaKey.class);
}
Aggregations