package org.kne.cloud.network.klalb;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class SACKTPacket extends KLALBPacket {
	@Override
	public long getLength() {
		return super.getLength()+8;
	}

	public int getSport() {
		return sport;
	}

	public int getDport() {
		return dport;
	}

	private int sport,dport;
	public SACKTPacket(int sport,int dport) {
		super(SACKT);
		this.sport=sport;
		this.dport=dport;
	}

	public SACKTPacket() {
		super(SACKT);
	}

	@Override
	public String toString() {
		return "SACKT "+sport+"->"+dport;
	}

	@Override
	protected void writeToStream(DataOutput dto) throws IOException {
		super.writeToStream(dto);
		dto.writeInt(sport);
		dto.writeInt(dport);
	}

	@Override
	protected void readFromStream(DataInput din) throws IOException {
		super.readFromStream(din);
		sport=din.readInt();
		dport=din.readInt();
	}


}
