Index: EcnlProtoTool/trunk/asp3_dcre/tinet/Makefile.tinet
===================================================================
--- EcnlProtoTool/trunk/asp3_dcre/tinet/Makefile.tinet	(revision 321)
+++ EcnlProtoTool/trunk/asp3_dcre/tinet/Makefile.tinet	(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
 #   Copyright (C) 2008-2009 by Hokkaido Industrial Research Institute, JAPAN
@@ -63,34 +63,52 @@
 
 #
+#  TINET 1.7 以降は、ネットワーク層の指定を変更した。
+#
+
+ifeq ($(SUPPORT_INET6),true)
+	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_INET6
+endif
+
+ifeq ($(SUPPORT_INET4),true)
+	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_INET4
+endif
+
+ifeq ($API_CFG_IP4MAPPED_ADDR,true)
+	TINET_CDEFS := $(TINET_CDEFS) -DAPI_CFG_IP4MAPPED_ADDR
+endif
+
+ifeq ($(SUPPORT_IGMP),true)
+	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_IGMP
+endif
+
+#
 #  ネットワークサービスに関する定義
 #
-TINET_DIR = $(TINET_ROOT)/net:$(TINET_ROOT)/netinet
-
+
+#  汎用通信機能
+
+TINET_DIRS = $(TINET_ROOT)/net:$(TINET_ROOT)/netinet:$(TINET_ROOT)/netinet6
 TINET_COBJS := $(TINET_COBJS) \
-	       net_buf.o net_count.o net_subr.o net_timer.o \
-               in_subr.o tinet_cfg.o route_cfg.o
-
-ifeq ($(SUPPORT_INET4),true)
-
-	TINET_COBJS := $(TINET_COBJS) \
-	               ip_input.o ip_output.o ip_icmp.o
-	TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/netinet/ip.cfg
-	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_INET4
-
-endif
-
-ifeq ($(SUPPORT_INET6),true)
-
-	TINET_DIR := $(TINET_DIR):$(TINET_ROOT)/netinet6
-	TINET_COBJS := $(TINET_COBJS) \
-	               in6.o in6_ifattach.o nd6_rtr.o \
-	               in6_subr.o ip6_input.o icmp6.o \
-	               dest6.o route6.o frag6.o \
-	               ah_input.o esp_input.o \
-	               nd6.o nd6_nbr.o ip6_output.o scope6.o
-	TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/netinet6/ip6.cfg
-	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_INET6
-
-endif
+               net_buf.o net_count.o net_subr.o net_timer.o if.o \
+               in_subr.o route_cfg.o
+TINET_CFG_COBJS := $(TINET_CFG_COBJS) tinet_cfg.o
+
+#  IPv6
+
+TINET_COBJS := $(TINET_COBJS) \
+               in6.o in6_ifattach.o nd6_rtr.o \
+               in6_subr.o ip6_input.o icmp6.o \
+               dest6.o route6.o frag6.o \
+               ah_input.o esp_input.o \
+               nd6.o nd6_nbr.o ip6_output.o scope6.o
+TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/netinet6/ip6.cfg
+
+#  IPv4
+
+TINET_COBJS := $(TINET_COBJS) \
+               ip_input.o ip_output.o ip_icmp.o ip_igmp.o in4_subr.o
+TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/netinet/ip.cfg
+
+#  loop back
 
 ifeq ($(NET_IF),loop)
@@ -102,11 +120,19 @@
 endif
 
+#  ppp
+
 ifeq ($(NET_IF),ppp)
 
 	TINET_COBJS := $(TINET_COBJS) \
 	               ppp.o ppp_hdlc.o ppp_lcp.o ppp_fsm.o \
-	               ppp_auth.o ppp_ipcp.o ppp_upap.o
+	               ppp_auth.o ppp_upap.o
 	TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/net/ppp.cfg
 	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_PPP
+
+#  IPv6用 cp
+	TINET_COBJS := $(TINET_COBJS) ppp_ipv6cp.o
+
+#  IPv4用 cp
+	TINET_COBJS := $(TINET_COBJS) ppp_ipcp.o
 
 ifeq ($(PPP_CFG_MODEM),true)
@@ -143,27 +169,18 @@
 endif
 
+#  ethernet
+
 ifeq ($(NET_IF),ether)
 
-	TINET_COBJS := $(TINET_COBJS) if.o ethernet.o
-	TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/net/ethernet.cfg
+	TINET_COBJS := $(TINET_COBJS) ethernet.o if6_ether.o if_ether.o
+	TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) \
+	                    $(TINET_ROOT)/net/ethernet.cfg \
+	                    $(TINET_ROOT)/netinet/if_ether.cfg
 	TINET_CDEFS := $(TINET_CDEFS) -DSUPPORT_ETHER
-
-	ifeq ($(SUPPORT_INET4),true)
-
-		TINET_COBJS := $(TINET_COBJS) if_ether.o
-		TINET_KERNEL_CFG := $(TINET_KERNEL_CFG) $(TINET_ROOT)/netinet/if_ether.cfg
-
-	endif
-
-	ifeq ($(SUPPORT_INET6),true)
-
-		TINET_COBJS := $(TINET_COBJS) if6_ether.o 
-
-	endif
-
-
 	include $(TINET_ROOT)/netdev/$(NET_DEV)/Makefile.tinet
 
 endif
+
+#  TCP
 
 ifeq ($(SUPPORT_TCP),true)
@@ -177,4 +194,6 @@
 endif
 
+#  UDP
+
 ifeq ($(SUPPORT_UDP),true)
 
@@ -193,13 +212,9 @@
 
 	ifeq ($(SUPPORT_TCP),true)
-
 		TINET_COBJS := $(TINET_COBJS) tcp_usrreq.o 
-
 	endif
 
 	ifeq ($(SUPPORT_UDP),true)
-
-		TINET_COBJS := $(TINET_COBJS) udp_usrreq.o
-
+		TINET_COBJS := $(TINET_COBJS) udp_usrreq.o udp_usrreq_nblk.o
 	endif
 
@@ -207,13 +222,9 @@
 
 	ifeq ($(SUPPORT_TCP),true)
-
 		TINET_LCSRCS := $(TINET_LCSRCS) tcp_usrreq.c 
-
 	endif
 
 	ifeq ($(SUPPORT_UDP),true)
-
-		TINET_LCSRCS := $(TINET_LCSRCS) udp_usrreq.c
-
+		TINET_LCSRCS := $(TINET_LCSRCS) udp_usrreq.c udp_usrreq_nblk.c
 	endif
 
@@ -248,8 +259,13 @@
 		tcp_set_opt.o tcp_get_opt.o
 
-udp_usrreq = 	udp_can_snd.o udp_can_rcv.o udp_can_cep.o \
-		udp_cre_cep.o udp_del_cep.o \
-		udp_snd_dat.o udp_rcv_dat.o udp_send_data.o \
-		udp_set_opt.o udp_get_opt.o
+udp_usrreq = 	udp_can_cep.o udp_send_data.o \
+		udp_can_snd.o udp_can_rcv.o \
+		udp_snd_dat.o udp_rcv_dat.o \
+		udp_set_opt.o udp_get_opt.o \
+		udp_cre_cep.o udp_del_cep.o
+
+udp_usrreq_nblk = \
+		udp_can_snd_nblk.o udp_can_rcv_nblk.o \
+		udp_snd_dat_nblk.o udp_rcv_dat_nblk.o
 
 #
@@ -257,6 +273,7 @@
 #  オブジェクトファイルの依存関係の定義
 #
-$(tcp_usrreq) $(tcp_usrreq:.o=.s) $(tcp_usrreq:.o=.d): tcp_usrreq.c
-$(udp_usrreq) $(udp_usrreq:.o=.s) $(udp_usrreq:.o=.d): udp_usrreq.c udp_usrreq_nblk.c
+$(tcp_usrreq) $(tcp_usrreq:.o=.s) $(tcp_usrreq:.o=.d): tcp_usrreq.c tcpn_usrreq.c
+$(udp_usrreq) $(udp_usrreq:.o=.s) $(udp_usrreq:.o=.d): udp_usrreq.c udpn_usrreq.c
+$(udp_usrreq_nblk) $(udp_usrreq_nblk:.o=.s) $(udp_usrreq_nblk:.o=.d): udp_usrreq_nblk.c
 
 #
@@ -271,6 +288,5 @@
 ifeq ($(TARGET_KERNEL),ASP)
 
-TINET_CFG = $(APPLDIR)/tinet_$(APPLNAME).cfg
-TINET_CFG_OUT = tinet_cfg.c tinet_cfg.h
+TINET_CFG_OUT = tinet_cfg.c tinet_cfg.h tinet_kern.cfg
 TINET_KERNEL_CFG :=	$(TINET_KERNEL_CFG) \
 			$(TINET_ROOT)/tinet_asp.cfg $(TINET_ROOT)/net/net_asp.cfg 
@@ -305,5 +321,5 @@
 ifeq ($(TARGET_KERNEL),ASP)
 
-	SYSSVC_DIRS := $(SYSSVC_DIRS):$(TINET_DIR)
+	SYSSVC_DIRS := $(SYSSVC_DIRS):$(TINET_DIRS)
 	SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)
 	SYSSVC_COBJS := $(SYSSVC_COBJS) $(TINET_COBJS)
@@ -311,4 +327,6 @@
 	SYSSVC_LIBS := $(SYSSVC_LIBS) $(LIBTINET) -lc
 
+	CFG_COBJS := $(CFG_COBJS) $(TINET_CFG_COBJS)
+
 	CLEAN_FILES := $(CLEAN_FILES) $(TINET_CFG_OUT) $(MAKE_TINET_LIB)
 
@@ -319,5 +337,5 @@
 	MTASK_CFG := $(MTASK_CFG) $(TINET_CFG)
 	MTASK_KERNEL_CFG := $(MTASK_KERNEL_CFG) $(TINET_KERNEL_CFG)
-	MTASK_DIR := $(MTASK_DIR):$(TINET_DIR)
+	MTASK_DIR := $(MTASK_DIRS):$(TINET_DIRS)
 	MTASK_LCSRCS := $(MTASK_LCSRCS) $(TINET_LCSRCS)
 	MTASK_ASMOBJS := $(MTASK_ASMOBJS)
