use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createWildCardsTblFeatureProp.
private TableFeaturePropertiesBuilder createWildCardsTblFeatureProp() {
// t15
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
SetFieldMatchBuilder setFieldMatchBld2 = new SetFieldMatchBuilder();
setFieldMatchBld2.setHasMask(true);
setFieldMatchBld2.setMatchType(InPort.class);
List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
WildcardsBuilder wildCardsBld = new WildcardsBuilder();
WildcardSetfieldBuilder wildcardsBuilder = new WildcardSetfieldBuilder();
wildcardsBuilder.setSetFieldMatch(setFieldMatch);
wildCardsBld.setWildcardSetfield(wildcardsBuilder.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(wildCardsBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.
the class OpenflowpluginTableFeaturesTestCommandProvider method createMatchFieldTblFeatureProp.
private TableFeaturePropertiesBuilder createMatchFieldTblFeatureProp() {
// t10
List<SetFieldMatch> setFieldMatch = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBld = new SetFieldMatchBuilder();
setFieldMatchBld.setHasMask(false);
setFieldMatchBld.setMatchType(MplsLabel.class);
setFieldMatch.add(setFieldMatchBld.build());
MatchBuilder matchBld = new MatchBuilder();
MatchSetfieldBuilder matchSetfieldBld = new MatchSetfieldBuilder();
matchSetfieldBld.setSetFieldMatch(setFieldMatch);
matchBld.setMatchSetfield(matchSetfieldBld.build());
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(matchBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.
the class TableFeaturesMatchFieldDeserializerTest method deserialize.
@Test
public void deserialize() throws Exception {
ByteBuf buffer = UnpooledByteBufAllocator.DEFAULT.buffer();
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP);
Optional<SetFieldMatch> fieldMatch = deserializer.deserialize(buffer);
assertEquals(ArpOp.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_SHA);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(ArpSha.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_SPA);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(ArpSpa.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_THA);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(ArpTha.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_TPA);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(ArpTpa.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_DST);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(EthDst.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_SRC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(EthSrc.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV4_CODE);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Icmpv4Code.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV4_TYPE);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Icmpv4Type.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV6_CODE);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Icmpv6Code.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV6_TYPE);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Icmpv6Type.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PHY_PORT);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(InPhyPort.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PORT);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(InPort.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_DSCP);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(IpDscp.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_ECN);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(IpEcn.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_PROTO);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(IpProto.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV4_SRC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv4Src.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV4_DST);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv4Dst.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_SRC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6Src.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_DST);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6Dst.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_EXTHDR);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6Exthdr.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_FLABEL);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6Flabel.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_SLL);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6NdSll.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_TLL);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6NdTll.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_TARGET);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Ipv6NdTarget.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.METADATA);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(Metadata.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_BOS);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(MplsBos.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_LABEL);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(MplsLabel.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_TC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(MplsTc.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.PBB_ISID);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(PbbIsid.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.SCTP_SRC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(SctpSrc.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.SCTP_DST);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(SctpDst.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TCP_SRC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(TcpSrc.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TCP_DST);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(TcpDst.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TUNNEL_ID);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(TunnelId.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.UDP_SRC);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(UdpSrc.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.UDP_DST);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(UdpDst.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_PCP);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(VlanPcp.class, fieldMatch.get().getKey().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_VID);
fieldMatch = deserializer.deserialize(buffer);
assertEquals(VlanVid.class, fieldMatch.get().getKey().getMatchType());
assertEquals(0, buffer.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setTableFeatureProperty.
private static void setTableFeatureProperty(final Match propType, final TableFeaturePropertiesBuilder propBuilder) {
MatchSetfield matchSetField = propType.getMatchSetfield();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
if (null != matchSetField) {
setFieldMatch = matchSetField.getSetFieldMatch();
}
setSetFieldTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTMATCH, setFieldMatch == null ? new ArrayList<>() : setFieldMatch);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch in project openflowplugin by opendaylight.
the class TableFeaturesConvertor method setTableFeatureProperty.
private static void setTableFeatureProperty(final Wildcards propType, final TableFeaturePropertiesBuilder propBuilder) {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch> setFieldMatch = null;
WildcardSetfield wildcardSetField = propType.getWildcardSetfield();
if (null != wildcardSetField) {
setFieldMatch = wildcardSetField.getSetFieldMatch();
}
setSetFieldTableFeatureProperty(propBuilder, TableFeaturesPropType.OFPTFPTWILDCARDS, setFieldMatch == null ? new ArrayList<>() : setFieldMatch);
}
Aggregations