mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-20 07:06:53 +08:00
Worked on dns: local host-list can be put into FLASH (by defining storage target/linker section), external function can be defined for lookup, combined dns_local_removehostname/removehostaddr to dns_local_removehost
This commit is contained in:
@@ -88,8 +88,7 @@ err_t dns_gethostbyname(const char *hostname, struct ip_addr *addr,
|
||||
dns_found_callback found, void *callback_arg);
|
||||
|
||||
#if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
|
||||
int dns_local_removehostname(const char *hostname);
|
||||
int dns_local_removehostaddr(const struct ip_addr *addr);
|
||||
int dns_local_removehost(const char *hostname, const struct ip_addr *addr);
|
||||
err_t dns_local_addhost(const char *hostname, const struct ip_addr *addr);
|
||||
#endif /* DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
|
||||
|
||||
|
||||
@@ -677,6 +677,10 @@
|
||||
* #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}}
|
||||
* (an array of structs name/address, where address is an u32_t in network
|
||||
* byte order).
|
||||
*
|
||||
* Instead, you can also use an external function:
|
||||
* #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name)
|
||||
* that returns the IP address or INADDR_NONE if not found.
|
||||
*/
|
||||
#ifndef DNS_LOCAL_HOSTLIST
|
||||
#define DNS_LOCAL_HOSTLIST 0
|
||||
|
||||
Reference in New Issue
Block a user