public ARPHeader(SocketBuffer skbuf) throws SocketException { hwtype = skbuf.get16(0); ptype = skbuf.get16(2);   op = skbuf.get16(6); if ((hwtype == 1) && (ptype == EthernetConstants.ETH_P_IP)) { srcHWAddress = new EthernetAddress(skbuf, 8); srcPAddress = new IPv4Address(skbuf, 14); targetHWAddress = new EthernetAddress(skbuf, 18); targetPAddress = new IPv4Address(skbuf, 24); } else { throw new SocketException("Unknown hw,ptype: " + hwtype + "," + ptype); }
public ARPHeader( HardwareAddress srcHWAddress, ProtocolAddress srcPAddress, HardwareAddress targetHWAddress, ProtocolAddress targetPAddress, int op, int hwtype, int ptype) {  this.srcHWAddress = srcHWAddress; this.srcPAddress = srcPAddress; this.targetHWAddress = targetHWAddress; this.targetPAddress = targetPAddress; this.op = op; this.hwtype = hwtype; this.ptype = ptype;
	public ARPHeader(SocketBuffer skbuf) 	throws SocketException {		hwtype = skbuf.get16(0);		ptype = skbuf.get16(2);		//int hwsize = skbuf.get(4);		//int psize = skbuf.get(5);		op = skbuf.get16(6);		if ((hwtype == 1) && (ptype == EthernetConstants.ETH_P_IP)) {			srcHWAddress = new EthernetAddress(skbuf, 8);			srcPAddress = new IPv4Address(skbuf, 14);			targetHWAddress = new EthernetAddress(skbuf, 18);			targetPAddress = new IPv4Address(skbuf, 24);		} else {			throw new SocketException("Unknown hw,ptype: " + hwtype + "," + ptype);		}	}