Copyright update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / PortStatusMessageFactory.java
index 9b789ec81bc50074df095cea3571b75abf8c1390..1252e4ebda19e2fcc4fa23e4d72f7f7a1ccc15a4 100644 (file)
@@ -1,10 +1,18 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
 
 import io.netty.buffer.ByteBuf;
 
 import org.opendaylight.openflowjava.protocol.impl.deserialization.OFDeserializer;
 import org.opendaylight.openflowjava.protocol.impl.util.ByteBufUtils;
+import org.opendaylight.openflowjava.protocol.impl.util.EncodeConstants;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeatures;
@@ -24,7 +32,6 @@ public class PortStatusMessageFactory implements OFDeserializer<PortStatusMessag
     private static final byte PADDING_IN_PORT_STATUS_HEADER = 7;
     private static final byte PADDING_IN_OFP_PORT_HEADER_1 = 4;
     private static final byte PADDING_IN_OFP_PORT_HEADER_2 = 2;
-    private static final int MAC_ADDRESS_LENGTH = 6;
     
     private PortStatusMessageFactory() {
         // Singleton
@@ -49,7 +56,7 @@ public class PortStatusMessageFactory implements OFDeserializer<PortStatusMessag
         rawMessage.skipBytes(PADDING_IN_PORT_STATUS_HEADER);
         builder.setPortNo(rawMessage.readUnsignedInt());
         rawMessage.skipBytes(PADDING_IN_OFP_PORT_HEADER_1);
-        byte[] hwAddress = new byte[MAC_ADDRESS_LENGTH];
+        byte[] hwAddress = new byte[EncodeConstants.MAC_ADDRESS_LENGTH];
         rawMessage.readBytes(hwAddress);
         builder.setHwAddr(new MacAddress(ByteBufUtils.macAddressToString(hwAddress)));
         rawMessage.skipBytes(PADDING_IN_OFP_PORT_HEADER_2);