diff options
author | Damien Miller <djm@mindrot.org> | 2000-03-14 10:16:34 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-03-14 10:16:34 +1100 |
commit | 1c67c9969c80dbc1fcbbc381f1554e45745622eb (patch) | |
tree | 9d7f1fd24cb5c82fd00797e038b7a31726840bae /defines.h | |
parent | 736540875bf0b818ac19c49d79ba1ee192320e6a (diff) |
- Include macro for IN6_IS_ADDR_V4MAPPED. Report from
peter@frontierflying.com
Diffstat (limited to 'defines.h')
-rw-r--r-- | defines.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -3,9 +3,12 @@ /* Necessary headers */ -#include <sys/types.h> +#include <sys/types.h> /* For [u]intxx_t */ + #include <sys/socket.h> /* For SHUT_XXXX */ +#include <netinet/in.h> /* For IPv6 macros */ + #ifdef HAVE_SYS_BITYPES_H # include <sys/bitypes.h> /* For u_intXX_t */ #endif @@ -234,6 +237,12 @@ typedef unsigned int size_t; # define __P(x) x #endif +#if !defined(IN6_IS_ADDR_V4MAPPED) +# define IN6_IS_ADDR_V4MAPPED(a) \ + ((((uint32_t *) (a))[0] == 0) && (((uint32_t *) (a))[1] == 0) && \ + (((uint32_t *) (a))[2] == htonl (0xffff))) +#endif /* !defined(IN6_IS_ADDR_V4MAPPED) */ + #if !defined(__GNUC__) || (__GNUC__ < 2) # define __attribute__(x) #endif /* !defined(__GNUC__) || (__GNUC__ < 2) */ |