|
|
@ -71,10 +71,12 @@ struct tm *localtime_r(const time_t *t, struct tm *tp) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif /* !defined(HAVE_LOCALTIME_R) */ |
|
|
|
#endif /* !defined(HAVE_LOCALTIME_R) */ |
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_INET_ATON) && defined(CONFIG_NETWORK) |
|
|
|
#ifdef CONFIG_NETWORK |
|
|
|
|
|
|
|
#include "network.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_INET_ATON) |
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <strings.h> |
|
|
|
#include <strings.h> |
|
|
|
#include "network.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int inet_aton (const char * str, struct in_addr * add) |
|
|
|
int inet_aton (const char * str, struct in_addr * add) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -97,7 +99,22 @@ done: |
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif /* !defined(HAVE_INET_ATON) && defined(CONFIG_NETWORK) */ |
|
|
|
#endif /* !defined(HAVE_INET_ATON) */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* resolve host with also IP address parsing */ |
|
|
|
|
|
|
|
int resolve_host(struct in_addr *sin_addr, const char *hostname) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
struct hostent *hp; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!inet_aton(hostname, sin_addr)) { |
|
|
|
|
|
|
|
hp = gethostbyname(hostname); |
|
|
|
|
|
|
|
if (!hp) |
|
|
|
|
|
|
|
return -1; |
|
|
|
|
|
|
|
memcpy(sin_addr, hp->h_addr, sizeof(struct in_addr)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif /* CONFIG_NETWORK */ |
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_FFSERVER |
|
|
|
#ifdef CONFIG_FFSERVER |
|
|
|
#ifndef HAVE_SYS_POLL_H |
|
|
|
#ifndef HAVE_SYS_POLL_H |
|
|
|