fi
-for ac_func in inet_aton
+
+for ac_func in inet_aton inet_pton
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
fi
fi
-AC_CHECK_FUNCS(inet_aton)
+AC_CHECK_FUNCS(inet_aton inet_pton)
dnl Check if we can use gethostbyname2 for ipv6
AC_CHECK_FUNCS(gethostbyname gethostbyname2)
*/
/* int
- * inetpton(af, src, dst)
+ * inet_pton(af, src, dst)
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* return:
* Paul Vixie, 1996.
*/
+#ifndef HAVE_INET_PTON
+
static int inet_pton4(src, dst)
const char *src;
unsigned char *dst;
memcpy(dst, tmp, IN6ADDRSZ);
return (1);
}
-#endif
+#endif /* IPv6 */
+
int inetpton(af, src, dst)
int af;
const char *src;
return (inet_pton6(tmp, dst));
} else
return (inet_pton6(src, dst));
-#endif
+#endif /* IPv6 */
default:
return (-1);
}
/* NOTREACHED */
}
+#endif
+
/*
* bopm_gethostbyname
*
struct in_addr in4;
};
-extern int inetpton(int, const char *, void *);
+#ifndef HAVE_INET_PTON
+extern int inet_pton(int, const char *, void *);
+#endif
extern const char *inetntop(int, const void *, char *, unsigned int);
extern struct hostent *opm_gethostbyname(const char *);
scan = libopm_scan_create(scanner, remote);
- if(inetpton(AF_INET, remote->ip, &(scan->addr.sa4.sin_addr) ) <= 0)
+ if(inet_pton(AF_INET, remote->ip, &(scan->addr.sa4.sin_addr) ) <= 0)
{
libopm_scan_free(scan);
return OPM_ERR_BADADDR;
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H