Merge "Bug 4957 No empty transaction for every connection fix"
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / OFConstants.java
index 8e85f68909e8244f056c4d6adc3b491500083bba..dce622964b81d15152f15dca1e181da17659d17f 100644 (file)
@@ -8,21 +8,22 @@
 package org.opendaylight.openflowplugin.api;
 
 import java.math.BigInteger;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
 
 /**
  * OFP related constants
  */
-public class OFConstants {
+public final class OFConstants {
 
     private OFConstants() {
-        //hiding implicit constructor
+        throw new UnsupportedOperationException("OF plugin Constants holder class");
     }
 
-    /** reserved port: process with normal L2/L3 switching  */
+    /** enum ofp_port_no, reserved port: process with normal L2/L3 switching  */
     public static final short OFPP_NORMAL = ((short)0xfffa);
-    /** reserved port: all physical ports except input port  */
+    /** enum ofp_port_no, reserved port: all physical ports except input port  */
     public static final short OFPP_ALL  = ((short)0xfffc);
-    /** reserved port: local openflow port  */
+    /** enum ofp_port_no, reserved port: local openflow port  */
     public static final short OFPP_LOCAL = ((short)0xfffe);
 
 
@@ -31,14 +32,34 @@ public class OFConstants {
     /** openflow protocol 1.3 - version identifier */
     public static final short OFP_VERSION_1_3 = 0x04;
 
+    public final static String OF_URI_PREFIX = "openflow:";
+
+    /** enum ofp_table: Table numbering, wildcard table used for table config, flow stats and flow deletes. */
     public static final Short OFPTT_ALL = 0xff;
-    public static final Long ANY = Long.parseLong("ffffffff", 16);
+    public static final Long ANY = 0xffffffffL;
+    /** Wildcard port used only for flow mod (delete) and flow stats requests. Selects
+     *  all flows regardless of output port (including flows with no output port).*/
     public static final Long OFPP_ANY = ANY;
+    /** enum ofp_group: For OFPFC_DELETE* commands, require matching entries to include this as an
+     *  output group. A value of OFPG_ANY indicates no restriction. */
     public static final Long OFPG_ANY = ANY;
-    public static final Long OFPQ_ANY = ANY;
+    /** enum ofp_group: Represents all groups for group delete commands. */
+    public static final Long OFPG_ALL = 0xfffffffcL;
+    /** Refers to all queues configured at the specified port. */
+    public static final Long OFPQ_ALL = ANY;
+    /** Represents all meters for stat requests commands. */
+    public static final Long OFPM_ALL = ANY;
+    /** default cookie */
     public static final BigInteger DEFAULT_COOKIE = BigInteger.ZERO;
     public static final BigInteger DEFAULT_COOKIE_MASK = BigInteger.ZERO;
+    public static final FlowCookie DEFAULT_FLOW_COOKIE = new FlowCookie(DEFAULT_COOKIE);
+    public static final Integer DEFAULT_FLOW_PRIORITY = 0x8000;
+
+    /** indicates that no buffering should be applied and the whole packet is to be
+     *  sent to the controller. */
     public static final Long OFP_NO_BUFFER = 0xffffffffL;
+    /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be
+     *  sent to the controller. */
     public static final Integer OFPCML_NO_BUFFER = 0xffff;