fix constness of IN6_{IS,ARE}_xx with RFC2553. sync with kame.
This commit is contained in:
parent
3cb024a283
commit
dbcd4b8d03
@ -1,5 +1,5 @@
|
||||
/* $NetBSD: in6.h,v 1.24 2001/03/02 04:55:40 itojun Exp $ */
|
||||
/* $KAME: in6.h,v 1.81 2001/03/02 04:54:45 itojun Exp $ */
|
||||
/* $NetBSD: in6.h,v 1.25 2001/03/30 05:53:52 itojun Exp $ */
|
||||
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
|
||||
@ -66,7 +66,7 @@
|
||||
*/
|
||||
|
||||
#ifndef __KAME_NETINET_IN_H_INCLUDED_
|
||||
#error "do not include netinet6/in6.h directly, include netinet/in.h"
|
||||
#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
|
||||
#endif
|
||||
|
||||
#ifndef _NETINET6_IN6_H_
|
||||
@ -242,37 +242,37 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
|
||||
* Unspecified
|
||||
*/
|
||||
#define IN6_IS_ADDR_UNSPECIFIED(a) \
|
||||
((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == 0))
|
||||
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
|
||||
|
||||
/*
|
||||
* Loopback
|
||||
*/
|
||||
#define IN6_IS_ADDR_LOOPBACK(a) \
|
||||
((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[12]) == ntohl(1)))
|
||||
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
|
||||
|
||||
/*
|
||||
* IPv4 compatible
|
||||
*/
|
||||
#define IN6_IS_ADDR_V4COMPAT(a) \
|
||||
((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[12]) != ntohl(1)))
|
||||
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
|
||||
|
||||
/*
|
||||
* Mapped
|
||||
*/
|
||||
#define IN6_IS_ADDR_V4MAPPED(a) \
|
||||
((*(u_int32_t *)(void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(u_int32_t *)(void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
|
||||
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
|
||||
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
|
||||
|
||||
/*
|
||||
* KAME Scope Values
|
||||
|
Loading…
Reference in New Issue
Block a user