byte[] dnsValue = msg.getOption(DHCPMessage.DNS_OPTION); IPv4Address dnsIP;  if (dnsValue != null) { for (int i = 0; i < dnsValue.length; i += 4) { dnsIP = new IPv4Address(dnsValue, i);  log.info("Got Dns IP address    : " + dnsIP); ResolverImpl.addDnsServer(dnsIP); } } }
    protected void configureNetwork(Device device, DHCPMessage msg)            throws NetworkException {        configureNetwork(device, msg.getHeader());        byte[] routerValue = msg.getOption(DHCPMessage.ROUTER_OPTION);        if (routerValue != null && routerValue.length >= 4) {            IPv4Address routerIP = new IPv4Address(routerValue, 0);            log.info("Got Router IP address : " + routerIP);            final IPv4ConfigurationService cfg;            try {                cfg = (IPv4ConfigurationService) InitialNaming                        .lookup(IPv4ConfigurationService.NAME);            } catch (NameNotFoundException ex) {                throw new NetworkException(ex);            }            cfg.addRoute(IPv4Address.ANY, routerIP, device, false);        }    }