mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-14 12:16:21 +08:00
Added sequential dns resolver function for netconn api (netconn_gethostbyname)
This commit is contained in:
@@ -181,6 +181,9 @@ err_t netconn_join_leave_group (struct netconn *conn,
|
||||
struct ip_addr *interface,
|
||||
enum netconn_igmp join_or_leave);
|
||||
#endif /* LWIP_IGMP */
|
||||
#if LWIP_DNS
|
||||
err_t netconn_gethostbyname(const char *name, struct ip_addr *addr);
|
||||
#endif /* LWIP_DNS */
|
||||
|
||||
#define netconn_err(conn) ((conn)->err)
|
||||
#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize)
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/err.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -86,6 +88,15 @@ struct api_msg {
|
||||
struct api_msg_msg msg;
|
||||
};
|
||||
|
||||
#if LWIP_DNS
|
||||
struct dns_api_msg {
|
||||
const char *name;
|
||||
struct ip_addr *addr;
|
||||
sys_sem_t sem;
|
||||
err_t *err;
|
||||
};
|
||||
#endif /* LWIP_DNS */
|
||||
|
||||
void do_newconn ( struct api_msg_msg *msg);
|
||||
void do_delconn ( struct api_msg_msg *msg);
|
||||
void do_bind ( struct api_msg_msg *msg);
|
||||
@@ -101,6 +112,10 @@ void do_close ( struct api_msg_msg *msg);
|
||||
void do_join_leave_group( struct api_msg_msg *msg);
|
||||
#endif /* LWIP_IGMP */
|
||||
|
||||
#if LWIP_DNS
|
||||
void do_gethostbyname(void *arg);
|
||||
#endif /* LWIP_DNS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user