Postby lalitahuja33 » Tue Jul 28, 2020 5:08 pm
I'm trying to impliment DNS in the AP mode. The code is working fine with the local Ip which is 192.168.1.1
What changes needs to done to make it work?
error: implicit declaration of function 'dns_local_addhost'
tcpip_adapter_ip_info_t ipInfo;
tcpip_adapter_dns_info_t dns_info;
ip_addr_t dnsip;
dnsip.type = IPADDR_TYPE_V4;
IP4_ADDR(&dnsip.u_addr.ip4, 192,168,1,1);
IP4_ADDR(&ipInfo.ip, 192,168,1,1);
IP4_ADDR(&ipInfo.ip, 192,168,1,1);
IP4_ADDR(&ipInfo.gw, 192,168,1,1);
IP4_ADDR(&ipInfo.netmask, 255,255,255,0);
IP4_ADDR(&dns_info.ip.u_addr.ip4, 192,168,1,1);
tcpip_adapter_init();
tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &ipInfo);
tcpip_adapter_set_dns_info(TCPIP_ADAPTER_IF_AP, TCPIP_ADAPTER_DNS_MAIN, &dns_info) ;
dns_init();
dns_local_addhost("www.mylocalserver.com",&dnsip);
tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP);