package org.kne.cloud.network.klalb;

import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicInteger;

public class NACKTPacket extends KLALBPacket implements PortPacket{

	private static final int HEADER_LENGTH=18;

	public NACKTPacket(int sport,int dport,long number) {
		super(NACKT,HEADER_LENGTH);
		klalbHeader.putInt(sport);
		klalbHeader.putInt(dport);
		klalbHeader.putLong(number);
	}

	public NACKTPacket(ByteBuffer bb) {
		super(bb,HEADER_LENGTH);
	}

	@Override
	public String toString() {
		return "NACKT "+getSrcPort()+"->"+getDstPort()+" "+getNumber()+"[]";
	}

	public int getSrcPort() {
		return klalbHeader.getInt(1);
	}

	public int getDstPort() {
		return klalbHeader.getInt(5);
	}

	public long getNumber() {
		return klalbHeader.getLong(9);
	}



}
