BUG-1994: IP ToS bits match field for OF 1.0
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / util / ActionUtil.java
index 18ef67a41143c3ced55df728e145ba1151e1c370..a416f59b5ec473d67703886bd427678f4a5078a5 100644 (file)
@@ -27,6 +27,14 @@ public final class ActionUtil {
     public static Short tosToDscp(short tosValue) {
         return (short) (tosValue >>> ActionUtil.ENC_FIELD_BIT_SIZE);
     }
+    
+    /**
+     * @param dscpValue TypeOfService value
+     * @return TOS value
+     */
+    public static Short dscpToTos(short dscpValue) {
+        return (short) (dscpValue << ActionUtil.ENC_FIELD_BIT_SIZE);
+    }
 
     
 }