From: Michal Rehak Date: Thu, 5 Dec 2013 21:32:59 +0000 (+0100) Subject: OF-1.0 related fixes X-Git-Tag: jenkins-openflowjava-bulk-release-prepare-only-1~38 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F3515%2F1;p=openflowjava.git OF-1.0 related fixes errorType typo statRequest encoding length match encoding macAddress, ipv4 address fixed Change-Id: I05808f9d5426ff645ed1c727170eac2426e98284 Signed-off-by: Michal Rehak --- diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10ErrorMessageFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10ErrorMessageFactory.java index 910070e3..d6816630 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10ErrorMessageFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/OF10ErrorMessageFactory.java @@ -120,7 +120,7 @@ public class OF10ErrorMessageFactory implements OFDeserializer { private static void decodeType(ErrorMessageBuilder builder, ErrorTypeV10 type) { if (type != null) { - builder.setType(NO_CORRECT_ENUM_FOUND_VALUE); + builder.setType(type.getIntValue()); builder.setTypeString(type.name()); } else { builder.setType(NO_CORRECT_ENUM_FOUND_VALUE); diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java index 7ae59b03..4a4f7605 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/serialization/factories/OF10StatsRequestInputFactory.java @@ -27,8 +27,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 */ public class OF10StatsRequestInputFactory implements OFSerializer { - private static final byte MESSAGE_TYPE = 18; - private static final int MESSAGE_LENGTH = 16; + private static final byte MESSAGE_TYPE = 16; + private static final int MESSAGE_LENGTH = 12; private static OF10StatsRequestInputFactory instance; diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java index d7b61ca3..faf6b6ca 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/OF10MatchSerializer.java @@ -22,8 +22,8 @@ public abstract class OF10MatchSerializer { public static void encodeMatchV10(ByteBuf out, MatchV10 match) { out.writeInt(match.getWildcards().intValue()); out.writeShort(match.getInPort()); - out.writeBytes(match.getDlSrc().getValue().getBytes()); - out.writeBytes(match.getDlDst().getValue().getBytes()); + out.writeBytes(ByteBufUtils.macAddressToBytes(match.getDlSrc().getValue())); + out.writeBytes(ByteBufUtils.macAddressToBytes(match.getDlDst().getValue())); out.writeShort(match.getDlVlan()); out.writeByte(match.getDlVlanPcp()); ByteBufUtils.padBuffer(PADDING_IN_MATCH, out); @@ -31,11 +31,11 @@ public abstract class OF10MatchSerializer { out.writeByte(match.getNwTos()); out.writeByte(match.getNwProto()); ByteBufUtils.padBuffer(PADDING_IN_MATCH_2, out); - String[] srcGroups = match.getNwSrc().getValue().split("."); + String[] srcGroups = match.getNwSrc().getValue().split("\\."); for (int i = 0; i < srcGroups.length; i++) { out.writeByte(Integer.parseInt(srcGroups[i])); } - String[] dstGroups = match.getNwSrc().getValue().split("."); + String[] dstGroups = match.getNwSrc().getValue().split("\\."); for (int i = 0; i < dstGroups.length; i++) { out.writeByte(Integer.parseInt(dstGroups[i])); }