示例#1
0
/*-----------------------------------------------------------------------------------*/
static void
makestrings(void)
{
  uip_ipaddr_t addr, *addrptr;

  uip_gethostaddr(&addr);
  makeaddr(&addr, ipaddr);
  
  uip_getnetmask(&addr);
  makeaddr(&addr, netmask);
  
  uip_getdraddr(&addr);
  makeaddr(&addr, gateway);

#if WITH_DNS
  addrptr = resolv_getserver();
  if(addrptr != NULL) {
    makeaddr(addrptr, dnsserver);
  }
#endif /* WITH_DNS */
}
示例#2
0
int16_t parse_cmd_dns_server(char *cmd, char *output, uint16_t len)
{
    uip_ipaddr_t dnsaddr;

    while (*cmd == ' ')
	cmd++;

    if (*cmd != '\0') {
	/* try to parse ip */
	if (parse_ip(cmd, &dnsaddr))
	    return ECMD_ERR_PARSE_ERROR;

	resolv_conf(&dnsaddr);

	eeprom_save(dns_server, &dnsaddr, IPADDR_LEN);
	eeprom_update_chksum();
	return ECMD_FINAL_OK;
    }
    else {
	return ECMD_FINAL(print_ipaddr(resolv_getserver(), output, len));
    }
}