IPv4Address network_address;
final IPv4Address networkAddress; final IPv4Address serverAddr = new IPv4Address(hdr.getServerIPAddress()); networkAddress = serverAddr.and(serverAddr.getDefaultSubnetmask());
  protected void configureNetwork(Device device, BOOTPHeader hdr)      throws NetworkException  {    log.info("Got Client IP address  : " + hdr.getClientIPAddress());    log.info("Got Your IP address    : " + hdr.getYourIPAddress());    log.info("Got Server IP address  : " + hdr.getServerIPAddress());    log.info("Got Gateway IP address : " + hdr.getGatewayIPAddress());    final IPv4ConfigurationService cfg;    try    {      cfg = (IPv4ConfigurationService) InitialNaming.lookup(IPv4ConfigurationService.NAME);    }    catch (NameNotFoundException ex)    {      throw new NetworkException(ex);    }    cfg.configureDeviceStatic(device, new IPv4Address(hdr.getYourIPAddress()),        null, false);    IPv4Address network_address;    if (hdr.getServerIPAddress().getAddress()[0] < IPv4Constants.NETWORK_CLASSA)    {      network_address = new IPv4Address(hdr.getServerIPAddress().getAddress()[0] + "." +          hdr.getServerIPAddress().getAddress()[1] + "." +          hdr.getServerIPAddress().getAddress()[2] + ".0");    }    else if (hdr.getServerIPAddress().getAddress()[0] < IPv4Constants.NETWORK_CLASSB)    {      network_address = new IPv4Address(hdr.getServerIPAddress().getAddress()[0] + "." +          hdr.getServerIPAddress().getAddress()[1] + ".0.0");    }    else if (hdr.getServerIPAddress().getAddress()[0] < IPv4Constants.NETWORK_CLASSC)    {      network_address = new IPv4Address(hdr.getServerIPAddress().getAddress()[0] + ".0.0.0");    }    else      network_address = new IPv4Address(hdr.getServerIPAddress());    if (hdr.getGatewayIPAddress().isAnyLocalAddress())    {//      cfg.addRoute(new IPv4Address(hdr.getServerIPAddress()), null, device, false);      cfg.addRoute(network_address, null, device, false);    }    else    {//      cfg.addRoute(new IPv4Address(hdr.getServerIPAddress()), new IPv4Address(hdr.getGatewayIPAddress()), device, false);      cfg.addRoute(network_address, new IPv4Address(hdr.getGatewayIPAddress()), device, false);    }  }