this.opcode = opcode; this.hwType = clientHwAddress.getType(); this.hopCount = 0; this.transactionID = transactionID; this.secondsElapsed = 0; this.flags = 0; this.clientIPAddress = clientIPAddress; this.yourIPAddress = null; this.serverIPAddress = null; this.gatewayIPAddress = null; this.clientHwAddress = clientHwAddress;
this.opcode = skbuf.get(0); this.hwType = skbuf.get(1); this.hopCount = skbuf.get(3); this.transactionID = skbuf.get32(4); this.secondsElapsed = skbuf.get16(8); this.flags = skbuf.get16(10); this.clientIPAddress = IPv4Address.readFrom(skbuf, 12); this.yourIPAddress = IPv4Address.readFrom(skbuf, 16); this.serverIPAddress = IPv4Address.readFrom(skbuf, 20); this.gatewayIPAddress = IPv4Address.readFrom(skbuf, 24); if (hwType == 1) { clientHwAddress = new EthernetAddress(skbuf, 28); } else { clientHwAddress = null; } byte[] tmp = new byte[128]; skbuf.get(tmp, 0, 32, 64); try { serverHostName = new String(tmp, "US-ASCII").trim(); } catch (UnsupportedEncodingException ex) { throw new RuntimeException(ex); } skbuf.get(tmp, 0, 96, 128); try { bootFileName = new String(tmp, "US-ASCII").trim(); } catch (UnsupportedEncodingException ex) { throw new RuntimeException(ex); }
  public BOOTPHeader(int opcode, int transactionID, Inet4Address clientIPAddress, HardwareAddress clientHwAddress)  {    this.opcode = opcode;    this.hwType = clientHwAddress.getType();    this.hopCount = 0;    this.transactionID = transactionID;    this.secondsElapsed = 0;    this.flags = 0;    this.clientIPAddress = clientIPAddress;    this.yourIPAddress = null;    this.serverIPAddress = null;    this.gatewayIPAddress = null;    this.clientHwAddress = clientHwAddress;/*    dns1IPAddress = null;    dns2IPAddress = null;*/  }