mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-13 03:36:59 +08:00
netconn: Add LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE (patch #9427)
This adds a new hook allowing an external DNS resolver to be hooked into netconn_gethostbyname(). The hook can handle some or all of the queries One use case for this hook is to run mDNSResponder in the same system as LwIP (mDNSResponder also uses LwIP's socekt APIs) and have it handle .local queries while LwIP stack handles unicast DNS queries
This commit is contained in:
@@ -2911,6 +2911,28 @@
|
||||
#ifdef __DOXYGEN__
|
||||
#define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)
|
||||
* Called from netconn APIs (not usable with callback apps) allowing an
|
||||
* external DNS resolver (which uses sequential API) to handle the query.
|
||||
* Signature:
|
||||
* int my_hook(const char *name, ip_addr_t *addr, u8_t addrtype, err_t *err)
|
||||
* Arguments:
|
||||
* - name: hostname to resolve
|
||||
* - addr: output host address
|
||||
* - addrtype: type of address to query
|
||||
* - err: output error
|
||||
* Return values:
|
||||
* - 0: Hook has not consumed hostname query, query continues into DNS module
|
||||
* - != 0: Hook has consumed the query
|
||||
*
|
||||
* err must also be checked to determine if the hook consumed the query, but
|
||||
* the query failed
|
||||
*/
|
||||
#ifdef __DOXYGEN__
|
||||
#define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user