package org.kne.cloud.network.klalb;

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

public class SYNTPacket extends KLALBPacket {
	private int sport,dport;
	public SYNTPacket(int sport,int dport) {
		super(SYNT);
		this.sport=sport;
		this.dport=dport;
	}

	public int getSport() {
		return sport;
	}

	public int getDport() {
		return dport;
	}

	public SYNTPacket() {
		super(SYNT);
	}

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

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

	@Override
	public long getLength() {
		return super.getLength()+8;
	}

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

}
