[Date Prev][Date Next] [Chronological] [Thread] [Top]

inet_ntop() on OS X



There is no inet_ntop() on Mac OS X and slapd requires it.
As a workaround for me, I added bind-9.0.0/lib/isc/inet_ntop.c
(from the ISC BIND distribution) to liblutil. It would be
good to check for this in configure.

-- Luke

lukeh@off/lennie[61]% diff -u /Volumes/u/Users/lukeh/src/bind-9.0.0/lib/isc/inet_ntop.c inet_ntop.c
--- /Volumes/u/Users/lukeh/src/bind-9.0.0/lib/isc/inet_ntop.c   Thu Jun 22 07:56:38 2000
+++ inet_ntop.c Sun Apr 29 11:09:55 2001
@@ -20,13 +20,11 @@
        "$Id: inet_ntop.c,v 1.7 2000/06/21 21:56:38 tale Exp $";
 #endif /* LIBC_SCCS and not lint */
 
-#include <config.h>
-
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
-
-#include <isc/net.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
 
 #define NS_INT16SZ      2
 #define NS_IN6ADDRSZ   16
@@ -45,7 +43,7 @@
 #endif
 
 /* char *
- * isc_net_ntop(af, src, dst, size)
+ * inet_ntop(af, src, dst, size)
  *     convert a network format address to presentation format.
  * return:
  *     pointer to presentation format address (`dst'), or NULL (see errno).
@@ -53,7 +51,7 @@
  *     Paul Vixie, 1996.
  */
 const char *
-isc_net_ntop(int af, const void *src, char *dst, size_t size)
+inet_ntop(int af, const void *src, char *dst, size_t size)
 {
        switch (af) {
        case AF_INET:
@@ -96,7 +94,7 @@
 }
 
 /* const char *
- * isc_inet_ntop6(src, dst, size)
+ * inet_ntop6(src, dst, size)
  *     convert IPv6 binary address into presentation (printable) format
  * author:
  *     Paul Vixie, 1996.

--
Luke Howard | lukeh@padl.com
PADL Software | www.padl.com