package oldPackets;

import cz.vutbr.feec.packets.IPacket;
import cz.vutbr.feec.packets.PacketGenerateException;
import cz.vutbr.feec.packets.PacketParseException;
import cz.vutbr.feec.packets.PacketUtils;

import org.apache.commons.lang.builder.ToStringBuilder;

//import cz.vutbr.feec.utko.iptv.net.rtp.PacketUtils;

public class LMSLandMarkGroup implements IPacket {
	
	private long landmarkIPaddr;
	
	public int generate(byte[] buffer, int offset)
			throws PacketGenerateException {
		assert PacketUtils.checkSize(getLandmarkIPaddr(), 32);
		PacketUtils.setOctet4(buffer, offset, getLandmarkIPaddr());
		return 4;
	}
	
	public int parse(byte[] buffer, int offset, int length)
			throws PacketParseException {
			setLandmarkIPaddr(PacketUtils.getOctet4(buffer, offset));
		return 4;
	}

	public long getLandmarkIPaddr() {
		return landmarkIPaddr;
	}

	public void setLandmarkIPaddr(long landmarkIPaddr) {
		this.landmarkIPaddr = landmarkIPaddr;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return new ToStringBuilder(this).append("landmarkIPaddr",
				this.landmarkIPaddr).toString();
	}

}
