OF-1.0 related fixes 15/3515/1
authorMichal Rehak <mirehak@cisco.com>
Thu, 5 Dec 2013 21:32:59 +0000 (22:32 +0100)
committerMichal Rehak <mirehak@cisco.com>
Thu, 5 Dec 2013 21:33:04 +0000 (22:33 +0100)
errorType typo
statRequest encoding length
match encoding macAddress, ipv4 address fixed

Change-Id: I05808f9d5426ff645ed1c727170eac2426e98284
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10ErrorMessageFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java

index 910070e38a0c105283be3e2b37ffaccd255006fa..d68166305aa140b312482a4a22945aa105d2d843 100644 (file)
@@ -120,7 +120,7 @@ public class OF10ErrorMessageFactory implements OFDeserializer<ErrorMessage> {
 \r
     private static void decodeType(ErrorMessageBuilder builder, ErrorTypeV10 type) {\r
         if (type != null) {\r
-            builder.setType(NO_CORRECT_ENUM_FOUND_VALUE);\r
+            builder.setType(type.getIntValue());\r
             builder.setTypeString(type.name());\r
         } else {\r
             builder.setType(NO_CORRECT_ENUM_FOUND_VALUE);\r
index 7ae59b030ddb751ee8e2c2129c582327c78194d6..4a4f760505ffb69cbc3ee72504cbe69f372ba06e 100644 (file)
@@ -27,8 +27,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
  */\r
 public class OF10StatsRequestInputFactory implements OFSerializer<MultipartRequestInput> {\r
 \r
-    private static final byte MESSAGE_TYPE = 18;\r
-    private static final int MESSAGE_LENGTH = 16;\r
+    private static final byte MESSAGE_TYPE = 16;\r
+    private static final int MESSAGE_LENGTH = 12;\r
 \r
     private static OF10StatsRequestInputFactory instance; \r
     \r
index d7b61ca36353f553e98fe16d75ed6a702eb8739d..faf6b6caa7e46dfbb956b2a43ab17c4c41b579b9 100644 (file)
@@ -22,8 +22,8 @@ public abstract class OF10MatchSerializer {
     public static void encodeMatchV10(ByteBuf out, MatchV10 match) {\r
         out.writeInt(match.getWildcards().intValue());\r
         out.writeShort(match.getInPort());\r
-        out.writeBytes(match.getDlSrc().getValue().getBytes());\r
-        out.writeBytes(match.getDlDst().getValue().getBytes());\r
+        out.writeBytes(ByteBufUtils.macAddressToBytes(match.getDlSrc().getValue()));\r
+        out.writeBytes(ByteBufUtils.macAddressToBytes(match.getDlDst().getValue()));\r
         out.writeShort(match.getDlVlan());\r
         out.writeByte(match.getDlVlanPcp());\r
         ByteBufUtils.padBuffer(PADDING_IN_MATCH, out);\r
@@ -31,11 +31,11 @@ public abstract class OF10MatchSerializer {
         out.writeByte(match.getNwTos());\r
         out.writeByte(match.getNwProto());\r
         ByteBufUtils.padBuffer(PADDING_IN_MATCH_2, out);\r
-        String[] srcGroups = match.getNwSrc().getValue().split(".");\r
+        String[] srcGroups = match.getNwSrc().getValue().split("\\.");\r
         for (int i = 0; i < srcGroups.length; i++) {\r
             out.writeByte(Integer.parseInt(srcGroups[i]));\r
         }\r
-        String[] dstGroups = match.getNwSrc().getValue().split(".");\r
+        String[] dstGroups = match.getNwSrc().getValue().split("\\.");\r
         for (int i = 0; i < dstGroups.length; i++) {\r
             out.writeByte(Integer.parseInt(dstGroups[i]));\r
         }\r