summaryrefslogtreecommitdiff
path: root/include/arpa
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-06-26 06:39:28 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-06-26 06:39:28 +0000
commitb93f3e46d88799f1117ba872ab654d1a0e2da3fd (patch)
tree0a3a53b91964b990a25d586c947d2d32f11d420b /include/arpa
parentc0b7fceb2c57f21e0b404f7e31e1939d6ddeb844 (diff)
Improve compliance for <arpa/inet.h> and <netinet/in.h> to define/declare
all the symbols that POSIX says they must and fewer that they can't and, most importantly, to not require a specific ordering of headers. ports testing by naddy@ ok millert@ deraadt@
Diffstat (limited to 'include/arpa')
-rw-r--r--include/arpa/inet.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 77ac649f32b..abbd403242f 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet.h,v 1.11 2008/12/09 19:38:38 otto Exp $ */
+/* $OpenBSD: inet.h,v 1.12 2012/06/26 06:39:27 guenther Exp $ */
/*
* ++Copyright++ 1983, 1993
@@ -61,16 +61,19 @@
/* External definitions for functions in inet(3) */
-#include <sys/param.h>
-#if (!defined(BSD)) || (BSD < 199306)
-# include <sys/bitypes.h>
-#else
-# include <sys/types.h>
-#endif
#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <machine/endian.h>
__BEGIN_DECLS
in_addr_t inet_addr(const char *);
+char *inet_ntoa(struct in_addr);
+const char *inet_ntop(int, const void *__restrict, char *__restrict,
+ socklen_t) __attribute__ ((__bounded__(__string__,3,4)));
+int inet_pton(int, const char *__restrict, void *__restrict);
+
+#if __BSD_VISIBLE
int inet_aton(const char *, struct in_addr *);
in_addr_t inet_lnaof(struct in_addr);
struct in_addr inet_makeaddr(in_addr_t , in_addr_t);
@@ -82,12 +85,9 @@ char *inet_net_ntop(int, const void *, int, char *, size_t)
__attribute__((__bounded__(__string__,4,5)));
int inet_net_pton(int, const char *, void *, size_t)
__attribute__((__bounded__(__string__,3,4)));
-char *inet_ntoa(struct in_addr);
-int inet_pton(int, const char *, void *);
-const char *inet_ntop(int, const void *, char *, socklen_t)
- __attribute__ ((__bounded__(__string__,3,4)));
unsigned int inet_nsap_addr(const char *, unsigned char *, int);
char *inet_nsap_ntoa(int, const unsigned char *, char *);
+#endif /* __BSD_VISIBLE */
__END_DECLS
#endif /* !_INET_H_ */