Index: EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/in6.h
===================================================================
--- EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/in6.h	(revision 321)
+++ EcnlProtoTool/trunk/asp3_dcre/tinet/netinet6/in6.h	(revision 331)
@@ -2,5 +2,5 @@
  *  TINET (TCP/IP Protocol Stack)
  * 
- *  Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering
+ *  Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering
  *                   Tomakomai National College of Technology, JAPAN
  *
@@ -103,4 +103,10 @@
 
 /*
+ *  IPv6 アドレス構造
+ *
+ *    RFC4291（RFC1884、RFC2373、RFC3513 のアップデート）
+ */
+
+/*
  *  IPv6 アドレス
  */
@@ -150,38 +156,4 @@
 
 /*
- *  アドレスの定義
- */
-
-#ifdef _NET_CFG_BYTE_ORDER
-
-#if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN
-
-#define IPV6_ADDR_INT32_ONE		ULONG_C(0x00000001)
-#define IPV6_ADDR_INT32_TWO		ULONG_C(0x00000002)
-#define IPV6_ADDR_INT32_0000FFFF	ULONG_C(0x0000ffff)
-#define IPV6_ADDR_INT32_MNL		ULONG_C(0xff010000)
-#define IPV6_ADDR_INT32_MLL		ULONG_C(0xff020000)
-#define IPV6_ADDR_INT32_ULL		ULONG_C(0xfe800000)
-#define IPV6_ADDR_INT16_ULL		UINT_C(0xfe80)
-#define IPV6_ADDR_INT16_USL		UINT_C(0xfec0)
-#define IPV6_ADDR_INT16_MLL		UINT_C(0xff02)
-
-#elif _NET_CFG_BYTE_ORDER == _NET_CFG_LITTLE_ENDIAN
-
-#define IPV6_ADDR_INT32_ONE		ULONG_C(0x01000000)
-#define IPV6_ADDR_INT32_TWO		ULONG_C(0x02000000)
-#define IPV6_ADDR_INT32_0000FFFF	ULONG_C(0xffff0000)
-#define IPV6_ADDR_INT32_MNL		ULONG_C(0x000001ff)
-#define IPV6_ADDR_INT32_MLL		ULONG_C(0x000002ff)
-#define IPV6_ADDR_INT32_ULL		ULONG_C(0x000080fe)
-#define IPV6_ADDR_INT16_ULL		UINT_C(0x80fe)
-#define IPV6_ADDR_INT16_USL		UINT_C(0xc0fe)
-#define IPV6_ADDR_INT16_MLL		UINT_C(0x02ff)
-
-#endif	/* #if _NET_CFG_BYTE_ORDER == _NET_CFG_BIG_ENDIAN */
-
-#endif	/* of #ifdef _NET_CFG_BYTE_ORDER */
-
-/*
  *  特別なアドレスのチェック
  */
@@ -197,17 +169,4 @@
 	(memcmp((void *)(a), (void *)&in6_addr_unspecified, sizeof(T_IN6_ADDR) - 1) == 0 && \
 	 (a)->s6_addr8[15] == 0x01)
-
-/* IPv4 互換 */
-
-#define IN6_IS_ADDR_V4COMPAT(a)		\
-	(memcmp((void *)(a), (void *)&in6_addr_unspecified, sizeof(T_IN6_ADDR) - 4) == 0 && \
-	 (a)->s6_addr32[3] > IPV6_ADDR_INT32_ONE)
-
-/* IPv4 マップ */
-
-#define IN6_IS_ADDR_V4MAPPED(a)		\
-	(((a)->s6_addr32[0] == ULONG_C(0x00000000)) && \
-	 ((a)->s6_addr32[1] == ULONG_C(0x00000000)) && \
-	 ((a)->s6_addr32[2] == IPV6_ADDR_INT32_0000FFFF))
 
 /*
@@ -248,12 +207,4 @@
 #define IN6_IS_ADDR_MULTICAST(a)	((a)->s6_addr8[0] == UINT_C(0xff))
 
-/* 要請マルチキャスト */
-
-#define IN6_IS_ADDR_NS_MULTICAST(a)	\
-	(((a)->s6_addr32[0] == IPV6_ADDR_INT32_MLL) && \
-	 ((a)->s6_addr32[1] == ULONG_C(0x00000000)) && \
-	 ((a)->s6_addr32[2] == IPV6_ADDR_INT32_ONE) && \
-	 ((a)->s6_addr8[12] == UINT_C(0xff)))
-
 /*
  *  同一のチェック
@@ -272,5 +223,6 @@
  */
 
-#define IPV6_DEFAULT_MULTICAST_HOPS	1	/* マルチキャスト時のホップリミットの規定値 */
+#define IPV6_DEFAULT_MULTICAST_HOPS	1	/* マルチキャスト時のホップリミットの規定値	*/
+#define ND6_INFINITE_LIFETIME		0xffffffff	/* アドレスの無制限有効時間		*/
 
 /*
@@ -282,4 +234,6 @@
 	uint16_t	portno;		/* ポート番号	*/
 	} T_IPV6EP;
+
+#define T_IPV6EP_DEFINED
 
 /*
@@ -299,8 +253,4 @@
 	/* 実装依存 */
 	} T_TCP6_CREP;
-
-#if defined(SUPPORT_INET6)
-#define T_TCP_CREP	T_TCP6_CREP
-#endif
 
 /*
@@ -316,28 +266,4 @@
 	} T_UDP6_CCEP;
 
-#if defined(SUPPORT_INET6)
-#define T_UDP_CCEP	T_UDP6_CCEP
-#endif
-
-/*
- *  IPv4 と IPv6 をコンパイル時に選択するためのマクロ
- */
-
-#if defined(SUPPORT_INET6)
-
-#define T_IN_ADDR			T_IN6_ADDR
-#define T_IPEP				T_IPV6EP
-#define IP_ADDRANY			IPV6_ADDRANY
-
-#define IN_ARE_ADDR_EQUAL(n,h)		IN6_ARE_ADDR_EQUAL(n,h)
-#define IN_ARE_NET_ADDR_EQUAL(n,h)	IN6_ARE_ADDR_EQUAL(n,h)
-#define IN_COPY_TO_NET(d,s)		memcpy(d,s,sizeof(T_IN6_ADDR))
-#define IN_COPY_TO_HOST(d,s)		memcpy(d,s,sizeof(T_IN6_ADDR))
-#define IN_IS_ADDR_MULTICAST(a)		IN6_IS_ADDR_MULTICAST(a)
-#define IN_IS_NET_ADDR_MULTICAST(a)	IN6_IS_ADDR_MULTICAST(a)
-#define IN_IS_ADDR_ANY(a)		IN6_IS_ADDR_UNSPECIFIED(a)
-
-#endif	/* of #if defined(SUPPORT_INET6) */
-
 /*
  *  前方参照
@@ -356,7 +282,7 @@
  */
 
-extern T_IN6_ADDR in6_addr_unspecified;
-extern T_IN6_ADDR in6_addr_linklocal_allnodes;
-extern T_IN6_ADDR in6_addr_linklocal_allrouters;
+extern const T_IN6_ADDR in6_addr_unspecified;
+extern const T_IN6_ADDR in6_addr_linklocal_allnodes;
+extern const T_IN6_ADDR in6_addr_linklocal_allrouters;
 
 #define ipv6_addrany	in6_addr_unspecified
@@ -366,7 +292,12 @@
  */
 
-extern char *ipv62str (char *buf, const T_IN6_ADDR *p_ip6addr);
-extern ER_UINT in6_get_maxnum_ifaddr (void);
+extern char *ipv62str (char *buf, const T_IN6_ADDR *p_addr);
+extern uint_t in6_get_maxnum_ifaddr (void);
 extern const T_IN6_ADDR *in6_get_ifaddr (int_t index);
+extern ER in6_upd_ifaddr (T_IN6_ADDR *addr, uint_t prefixlen,
+                          uint32_t vltime, uint32_t pltime);
+extern ER in6_del_ifaddr (T_IN6_ADDR *addr);
+extern T_IN6_ADDR *in6_make_ipv4mapped (T_IN6_ADDR *dst, T_IN4_ADDR src);
+extern bool_t in6_is_addr_ipv4mapped (const T_IN6_ADDR *addr);
 
 #endif	/* of #ifndef _IN6_H_ */
