use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class ApplySetfieldTablePropertySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final ApplySetfield property = new ApplySetfieldBuilder().setApplySetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder().setSetFieldMatch(ImmutableList.<SetFieldMatch>builder().add(new SetFieldMatchBuilder().setMatchType(ArpOp.class).setHasMask(false).build()).build()).build()).build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
// Skip match entry length
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class WriteSetfieldTablePropertySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final WriteSetfield property = new WriteSetfieldBuilder().setWriteSetfield(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder().setSetFieldMatch(ImmutableList.<SetFieldMatch>builder().add(new SetFieldMatchBuilder().setMatchType(ArpOp.class).setHasMask(false).build()).build()).build()).build();
assertProperty(property, out -> {
assertEquals(out.readUnsignedShort(), OxmMatchConstants.OPENFLOW_BASIC_CLASS);
assertEquals(out.readUnsignedByte(), OxmMatchConstants.ARP_OP << 1);
// Skip match entry length
out.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class TableFeaturesResponseConvertor method setSetFieldTableFeatureProperty.
private static List<SetFieldMatch> setSetFieldTableFeatureProperty(final TableFeatureProperties properties, final boolean setHasMask) {
List<SetFieldMatch> setFieldMatchList = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBuilder = new SetFieldMatchBuilder();
// This handles only OpenflowBasicClass oxm class.
for (MatchEntry currMatch : properties.getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry()) {
Class<? extends MatchField> ofMatchField = currMatch.getOxmMatchField();
if (setHasMask) {
setFieldMatchBuilder.setHasMask(currMatch.isHasMask());
}
setFieldMatchBuilder.setMatchType(OF_TO_SAL_TABLE_FEATURE_PROPERTIES.get(ofMatchField));
setFieldMatchList.add(setFieldMatchBuilder.build());
}
return setFieldMatchList;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class TableFeaturesConvertorTest method setupFieldTableFeatures.
private static void setupFieldTableFeatures() {
SetFieldMatchBuilder setFieldMatchBuilder = new SetFieldMatchBuilder();
setFieldMatchBuilder.setHasMask(true);
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpOp.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSha.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpSpa.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTha.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.ArpTpa.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthDst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthSrc.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.EthType.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Code.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv4Type.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Code.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Icmpv6Type.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPhyPort.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.InPort.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpDscp.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpEcn.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.IpProto.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Dst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv4Src.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Dst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Exthdr.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Flabel.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdSll.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTarget.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6NdTll.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Ipv6Src.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Metadata.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsBos.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsLabel.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.MplsTc.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.PbbIsid.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpDst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.SctpSrc.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpDst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpSrc.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelId.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.UdpDst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanPcp.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.VlanVid.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TcpFlags.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Dst.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
setFieldMatchBuilder.setMatchType(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TunnelIpv4Src.class);
FIELD_TABLE_FEATURES.add(setFieldMatchBuilder.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatchBuilder in project openflowplugin by opendaylight.
the class TableFeaturesMatchFieldDeserializer method processHeader.
/**
* Processes match entry header and returns if it have mask, or not.
*
* @param in input buffer
* @return SetFieldMatchBuilder with hasMask properly set
*/
protected static SetFieldMatchBuilder processHeader(ByteBuf in) {
// skip oxm_class
in.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
boolean hasMask = (in.readUnsignedByte() & 1) != 0;
// skip match entry length
in.skipBytes(EncodeConstants.SIZE_OF_BYTE_IN_BYTES);
return new SetFieldMatchBuilder().setHasMask(hasMask);
}
Aggregations