use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method setAggregate.
private MultipartRequestAggregateCase setAggregate(ByteBuf input) {
final MultipartRequestAggregateCaseBuilder caseBuilder = new MultipartRequestAggregateCaseBuilder();
MultipartRequestAggregateBuilder aggregateBuilder = new MultipartRequestAggregateBuilder();
OFDeserializer<MatchV10> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EMPTY_VALUE, MatchV10.class));
aggregateBuilder.setMatchV10(matchDeserializer.deserialize(input));
aggregateBuilder.setTableId(input.readUnsignedByte());
input.skipBytes(AGGREGATE_PADDING_1);
aggregateBuilder.setOutPort((long) input.readUnsignedShort());
caseBuilder.setMultipartRequestAggregate(aggregateBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method setFlow.
private MultipartRequestFlowCase setFlow(ByteBuf input) {
final MultipartRequestFlowCaseBuilder caseBuilder = new MultipartRequestFlowCaseBuilder();
MultipartRequestFlowBuilder flowBuilder = new MultipartRequestFlowBuilder();
OFDeserializer<MatchV10> matchDeserializer = registry.getDeserializer(new MessageCodeKey(EncodeConstants.OF10_VERSION_ID, EncodeConstants.EMPTY_VALUE, MatchV10.class));
flowBuilder.setMatchV10(matchDeserializer.deserialize(input));
flowBuilder.setTableId(input.readUnsignedByte());
input.skipBytes(FLOW_PADDING_1);
flowBuilder.setOutPort((long) input.readUnsignedShort());
caseBuilder.setMultipartRequestFlow(flowBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.
the class FlowCreatorUtil method createWildcardedMatchV10.
/**
* Method creates openflow 1.0 format match, that can match all the flow entries.
*
* @return V10 Match object
*/
public static MatchV10 createWildcardedMatchV10() {
MatchV10Builder builder = new MatchV10Builder();
builder.setWildcards(new FlowWildcardsV10(true, true, true, true, true, true, true, true, true, true));
builder.setNwSrcMask((short) 0);
builder.setNwDstMask((short) 0);
builder.setInPort(0);
builder.setDlSrc(new MacAddress("00:00:00:00:00:00"));
builder.setDlDst(new MacAddress("00:00:00:00:00:00"));
builder.setDlVlan(0);
builder.setDlVlanPcp((short) 0);
builder.setDlType(0);
builder.setNwTos((short) 0);
builder.setNwProto((short) 0);
builder.setNwSrc(new Ipv4Address("0.0.0.0"));
builder.setNwDst(new Ipv4Address("0.0.0.0"));
builder.setTpSrc(0);
builder.setTpDst(0);
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.
the class DeserializerRegistryImplTest method testGetDeserializer.
/**
* Test - get deserializer.
*/
@Test(expected = IllegalStateException.class)
public void testGetDeserializer() {
DeserializerRegistryImpl registry = new DeserializerRegistryImpl();
registry.init();
registry.getDeserializer(new MessageCodeKey((short) 5000, EncodeConstants.EMPTY_VALUE, MatchV10.class));
Assert.fail();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.v10.grouping.MatchV10 in project openflowplugin by opendaylight.
the class MatchInjector method addInjectors.
private static void addInjectors(final Map<ConvertorKey, ResultInjector<?, ?>> injectionMapping) {
// OF-1.3|List<MatchEntries> --> FlowModInputBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, FlowModInputBuilder.class), (ResultInjector<List<MatchEntry>, FlowModInputBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
// OF-1.3|List<MatchEntries> --> OxmFieldsActionBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, SetFieldActionBuilder.class), (ResultInjector<List<MatchEntry>, SetFieldActionBuilder>) (value, target) -> target.setMatchEntry(value));
// OF-1.0|MatchV10Builder --> FlowModInputBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, FlowModInputBuilder.class), (ResultInjector<MatchV10, FlowModInputBuilder>) (value, target) -> target.setMatchV10(value));
// OF-1.3|List<MatchEntries> --> MultipartRequestFlowBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, MultipartRequestFlowBuilder.class), (ResultInjector<List<MatchEntry>, MultipartRequestFlowBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
// OF-1.0|List<MatchEntries> --> MultipartRequestFlowBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, MultipartRequestFlowBuilder.class), (ResultInjector<MatchV10, MultipartRequestFlowBuilder>) (value, target) -> target.setMatchV10(value));
// OF-1.3|List<MatchEntries> --> MultipartRequestAggregateBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_3, MultipartRequestAggregateBuilder.class), (ResultInjector<List<MatchEntry>, MultipartRequestAggregateBuilder>) (value, target) -> target.setMatch(wrapMatchV13(value).build()));
// OF-1.0|List<MatchEntries> --> MultipartRequestAggregateBuilder
injectionMapping.put(new ConvertorKey(OFConstants.OFP_VERSION_1_0, MultipartRequestAggregateBuilder.class), (ResultInjector<MatchV10, MultipartRequestAggregateBuilder>) (value, target) -> target.setMatchV10(value));
}
Aggregations