BUG-2825: use provided Ipv4/MacAddress factories
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / OF10PortModInputMessageFactory.java
index 4002b8fc30c1cda02467e5b3a3b2b29e909401ea..be88873c80c6d628c6f82ffc93942aa8dc9a6279 100644 (file)
@@ -9,10 +9,10 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
-
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
+import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.IetfYangUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfigV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput;
@@ -30,7 +30,7 @@ public class OF10PortModInputMessageFactory implements OFSerializer<PortModInput
     public void serialize(final PortModInput message, final ByteBuf outBuffer) {
         ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
         outBuffer.writeShort(message.getPortNo().getValue().intValue());
-        outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(message.getHwAddress().getValue()));
+        outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHwAddress()));
         outBuffer.writeInt(createPortConfigBitmask(message.getConfigV10()));
         outBuffer.writeInt(createPortConfigBitmask(message.getMaskV10()));
         outBuffer.writeInt(createPortFeaturesBitmask(message.getAdvertiseV10()));