add util function for multiple pkt in reasons
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/MultiplePktInReasonUtil.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/MultiplePktInReasonUtil.java
new file mode 100644
index 0000000..09da5a6
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/util/MultiplePktInReasonUtil.java
@@ -0,0 +1,25 @@
+package org.projectfloodlight.openflow.util;
+
+import java.util.Set;
+
+import org.projectfloodlight.openflow.protocol.OFBsnPktinFlag;
+import org.projectfloodlight.openflow.protocol.OFPacketIn;
+import org.projectfloodlight.openflow.protocol.OFVersion;
+import org.projectfloodlight.openflow.protocol.match.MatchField;
+import org.projectfloodlight.openflow.protocol.ver13.OFBsnPktinFlagSerializerVer13;
+import org.projectfloodlight.openflow.types.OFMetadata;
+
+public class MultiplePktInReasonUtil {
+ private MultiplePktInReasonUtil() {}
+
+ public static Set<OFBsnPktinFlag> getOFBsnPktinFlags(OFPacketIn pktIn) {
+ if(pktIn.getVersion() != OFVersion.OF_13) {
+ throw new IllegalArgumentException("multiple pkt in reasons are "
+ + "only supported by BVS using "
+ + "openflow 1.3");
+ }
+ OFMetadata metaData = pktIn.getMatch().get(MatchField.METADATA);
+ return OFBsnPktinFlagSerializerVer13.ofWireValue(metaData.getValue()
+ .getValue());
+ }
+}