Added sequential (socket API) function gethostbyname and the struct hostent it uses

This commit is contained in:
goldsimon
2007-11-16 17:29:30 +00:00
parent e2cd201f6a
commit e6ec23d7cc
3 changed files with 62 additions and 2 deletions

View File

@@ -60,6 +60,19 @@ struct sockaddr {
char sa_data[14];
};
#if LWIP_DNS
struct hostent {
char *h_name; /* Official name of the host. */
char **h_aliases; /* A pointer to an array of pointers to alternative host names,
terminated by a null pointer. */
int h_addrtype; /* Address type. */
int h_length; /* The length, in bytes, of the address. */
char **h_addr_list; /* A pointer to an array of pointers to network addresses (in
network byte order) for the host, terminated by a null pointer. */
#define h_addr h_addr_list[0] /* for backward compatibility */
};
#endif /* LWIP_DNS */
#ifndef socklen_t
# define socklen_t u32_t
#endif
@@ -300,6 +313,10 @@ int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptse
struct timeval *timeout);
int lwip_ioctl(int s, long cmd, void *argp);
#if LWIP_DNS
struct hostent *gethostbyname(const char *name);
#endif /* LWIP_DNS */
#if LWIP_COMPAT_SOCKETS
#define accept(a,b,c) lwip_accept(a,b,c)
#define bind(a,b,c) lwip_bind(a,b,c)