diff options
-rw-r--r-- | include/arpa/inet.h | 24 | ||||
-rw-r--r-- | sys/netinet/in.h | 7 | ||||
-rw-r--r-- | sys/netinet6/in6.h | 4 |
3 files changed, 31 insertions, 4 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); diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 11ef0ff92f6..18f275bb84d 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in.h,v 1.91 2012/06/26 06:39:27 guenther Exp $ */ +/* $OpenBSD: in.h,v 1.92 2012/07/10 11:49:42 guenther Exp $ */ /* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */ /* @@ -141,12 +141,15 @@ #define IPPORT_HIFIRSTAUTO 49152 #define IPPORT_HILASTAUTO 65535 +#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 /* last return value of *_input(), meaning "all job for this pkt is done". */ #define IPPROTO_DONE 257 @@ -351,7 +354,9 @@ struct ip_mreq { /* * Buffer lengths for strings containing printable IP addresses */ +#ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 +#endif #if __BSD_VISIBLE diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 72fd35c3139..664bca96119 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.h,v 1.56 2012/06/26 06:39:27 guenther Exp $ */ +/* $OpenBSD: in6.h,v 1.57 2012/07/10 11:49:42 guenther Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* @@ -94,7 +94,9 @@ struct in6_addr { #define s6_addr32 __u6_addr.__u6_addr32 #endif +#ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 +#endif /* * Socket address for IPv6 |