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;

public class RSTPacket extends KLALBPacket implements PortPacket{
	private static final int HEADER_LENGTH=9;
	public RSTPacket(int sport,int dport) {
		super(RST,HEADER_LENGTH);
		klalbHeader.putInt(sport);
		klalbHeader.putInt(dport);
	}

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


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

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

	@Override
	public String toString() {
		return "RST "+getSrcPort()+"->"+getDstPort();
	}

	

}
