summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-07-10 11:49:43 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-07-10 11:49:43 +0000
commit8a386e18f9ebed887bd888ffd5bede8694b2ef62 (patch)
tree7455b7625888c2a09dfc87b7a04f5fb4da0b22ec /include
parent91834dd207f4744e52810b7c592606d9b94319f2 (diff)
Instead of <arpa/inet.h> pulling in <netinet/in.h>, just copy in the
three things that it needed from there: INET_ADDRSTRLEN, INET6_ADDRSTRLEN, and struct in_addr. Add protecting #ifndefs to netinet6?/in6?.h for those. ok deraadt@
Diffstat (limited to 'include')
-rw-r--r--include/arpa/inet.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index abbd403242f..af04ccf700f 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.h,v 1.12 2012/06/26 06:39:27 guenther Exp $ */
+/* $OpenBSD: inet.h,v 1.13 2012/07/10 11:49:42 guenther Exp $ */
/*
* ++Copyright++ 1983, 1993
@@ -63,9 +63,29 @@
#include <sys/cdefs.h>
#include <sys/types.h>
-#include <netinet/in.h>
#include <machine/endian.h>
+/*
+ * Buffer lengths for strings containing printable IP addresses
+ */
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN 46
+#endif
+
+#ifndef _IN_ADDR_DECLARED
+#define _IN_ADDR_DECLARED
+/*
+ * IP Version 4 Internet address (a structure for historical reasons)
+ */
+struct in_addr {
+ in_addr_t s_addr;
+};
+#endif
+
+
__BEGIN_DECLS
in_addr_t inet_addr(const char *);
char *inet_ntoa(struct in_addr);