* 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.action;
+import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.readUint16;
+
import io.netty.buffer.ByteBuf;
import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.impl.util.ActionConstants;
* @author michal.polkorab
*/
public class OF10SetTpSrcActionDeserializer extends AbstractActionDeserializer {
-
@Override
public Action deserialize(ByteBuf input) {
final ActionBuilder builder = new ActionBuilder();
input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
SetTpSrcCaseBuilder caseBuilder = new SetTpSrcCaseBuilder();
SetTpSrcActionBuilder actionBuilder = new SetTpSrcActionBuilder();
- actionBuilder.setPort(new PortNumber((long) input.readUnsignedShort()));
+ actionBuilder.setPort(new PortNumber(readUint16(input).toUint32()));
caseBuilder.setSetTpSrcAction(actionBuilder.build());
builder.setActionChoice(caseBuilder.build());
input.skipBytes(ActionConstants.PADDING_IN_TP_PORT_ACTION);