Index: EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/net_cons.c
===================================================================
--- EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/net_cons.c	(revision 321)
+++ EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/net_cons.c	(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
  *
@@ -60,13 +60,4 @@
 #endif	/* of #ifdef TARGET_KERNEL_JSP */
 
-#include <tinet_defs.h>
-
-#include <net/if.h>
-#include <net/if_ppp.h>
-#include <net/if_loop.h>
-#include <net/ethernet.h>
-#include <net/net.h>
-#include <net/net_timer.h>
-
 #include <netinet/in.h>
 #include <netinet/in_itron.h>
@@ -109,4 +100,10 @@
 #define TELNET_OPT_IAC		(255)
 
+#if defined(SUPPORT_INET6)
+#define API_PROTO		'6'
+#else
+#define API_PROTO		'4'
+#endif
+
 /*
  *  変数
@@ -121,4 +118,10 @@
 bool_t	wait_accept	= false;	/* 接続要求待ち中	*/
 
+#if defined(SUPPORT_INET6)
+
+T_IPV6EP	dst;
+
+#else	/* of #if defined(SUPPORT_INET6) */
+
 #if defined(SUPPORT_INET4)
 
@@ -126,8 +129,4 @@
 
 #endif	/* of #if defined(SUPPORT_INET4) */
-
-#if defined(SUPPORT_INET6)
-
-T_IPV6EP	dst;
 
 #endif	/* of #if defined(SUPPORT_INET6) */
@@ -156,10 +155,11 @@
 		get_tim(&now);
 		if (*(ER*)p_parblk == E_OK) {
-			syslog(LOG_NOTICE, "[NCS:%02u CBN] connected:  %6lu, from: %s.%u",
-			                   cepid, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno);
+			syslog(LOG_NOTICE, "[NCS%c:%02u CBN] conct: %7lu, from: %s.%u",
+			                   API_PROTO, cepid, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno);
 			connected = true;
 			}
 		else
-			syslog(LOG_NOTICE, "[NCS:%02d CBN] error: %s", itron_strerror(*(ER*)p_parblk));
+			syslog(LOG_NOTICE, "[NCS%c:%02d CBN] error: %s",
+			                   API_PROTO, itron_strerror(*(ER*)p_parblk));
 		snd_len = snd_off = rcv_len = rcv_off = 0;
 		wait_accept = false;
@@ -193,6 +193,6 @@
 		if (snd_off > 0) {
 			if ((error = tcp_snd_buf(NET_CONS_CEPID, snd_off)) != E_OK && error != E_CLS)
-				syslog(LOG_NOTICE, "[NCS:%02d SND] flush send error: %s",
-				                   NET_CONS_CEPID, itron_strerror(error));
+				syslog(LOG_NOTICE, "[NCS%c:%02d SND] flush send error: %s",
+				                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 			snd_len = snd_off = 0;
 			}
@@ -218,6 +218,6 @@
 			if ((error = tcp_snd_buf(NET_CONS_CEPID, snd_off)) != E_OK) {
 				if (error != E_CLS)
-					syslog(LOG_NOTICE, "[NCS:%02d SND] send buff error: %s",
-					                   NET_CONS_CEPID, itron_strerror(error));
+					syslog(LOG_NOTICE, "[NCS%c:%02d SND] send buff error: %s",
+					                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 				syscall(sig_sem(SEM_NET_CONS_SEND));
 				return;
@@ -226,6 +226,6 @@
 			if ((snd_len = tcp_get_buf(NET_CONS_CEPID, (void*)&snd_buff, TMO_FEVR)) <= 0) {
 				if (snd_len != E_CLS)
-					syslog(LOG_NOTICE, "[NCS:%02d SND] get buff error: %s",
-					                   NET_CONS_CEPID, itron_strerror(snd_len));
+					syslog(LOG_NOTICE, "[NCS%c:%02d SND] get buff error: %s",
+					                   API_PROTO, NET_CONS_CEPID, itron_strerror(snd_len));
 				syscall(sig_sem(SEM_NET_CONS_SEND));
 				return;
@@ -253,6 +253,6 @@
 			if ((error = tcp_rel_buf(NET_CONS_CEPID, rcv_len)) != E_OK) {
 				if (error != E_CLS)
-					syslog(LOG_NOTICE, "[NCS:%02d RCV] release buff error: %s",
-					                   NET_CONS_CEPID, itron_strerror(error));
+					syslog(LOG_NOTICE, "[NCS%c:%02d RCV] release buff error: %s",
+					                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 				discon_net_cons();
 				return EOF;
@@ -264,6 +264,6 @@
 			else if (rcv_len < 0) {
 				if (rcv_len != E_CLS)
-					syslog(LOG_NOTICE, "[NCS:%02d RCV] recieve buff error: %s",
-					                   NET_CONS_CEPID, itron_strerror(rcv_len));
+					syslog(LOG_NOTICE, "[NCS%c:%02d RCV] recieve buff error: %s",
+					                   API_PROTO, NET_CONS_CEPID, itron_strerror(rcv_len));
 				discon_net_cons();
 				return EOF;
@@ -284,5 +284,5 @@
 {
 	T_SERIAL_RPOR	rpor;
-	int_t		ch, req;
+	int_t		ch;
 	char		uch;
 	ER		error;
@@ -292,5 +292,6 @@
 		error = TCP_ACP_CEP(NET_CONS_CEPID, NET_CONS_REPID, &dst, TMO_NBLK);
 #if 0
-		syslog(LOG_NOTICE, "[NCS:%02d ACP] status: %s",NET_CONS_CEPID, itron_strerror(error));
+		syslog(LOG_NOTICE, "[NCS%c:%02d ACP] status: %s",
+		                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 #endif
 		if (error != E_WBLK)
@@ -307,5 +308,5 @@
 					case TELNET_OPT_DO:
 					case TELNET_OPT_DONT:
-						req = cons_getchar_raw();
+						cons_getchar_raw();
 						break;
 					case TELNET_OPT_SB:
@@ -354,18 +355,18 @@
 		if (snd_off > 0) {
 			if ((error = tcp_snd_buf(NET_CONS_CEPID, snd_off)) != E_OK && error != E_CLS)
-				syslog(LOG_NOTICE, "[NCS:%02d SND] send buff error: %s",
-				                   NET_CONS_CEPID, itron_strerror(error));
+				syslog(LOG_NOTICE, "[NCS%c:%02d SND] send buff error: %s",
+				                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 			}
 		if ((error = tcp_sht_cep(NET_CONS_CEPID)) != E_OK)
-			syslog(LOG_NOTICE, "[NCS:%02d SHT] shutdown error: %s",
-			                   NET_CONS_CEPID, itron_strerror(error));
+			syslog(LOG_NOTICE, "[NCS%c:%02d SHT] shutdown error: %s",
+			                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 		if ((error = tcp_cls_cep(NET_CONS_CEPID, TMO_FEVR)) != E_OK)
-			syslog(LOG_NOTICE, "[NCS:%02d CLS] close error: %s",
-			                   NET_CONS_CEPID, itron_strerror(error));
+			syslog(LOG_NOTICE, "[NCS%c:%02d CLS] close error: %s",
+			                   API_PROTO, NET_CONS_CEPID, itron_strerror(error));
 		connected = false;
 		syscall(sig_sem(SEM_NET_CONS_SEND));
 		get_tim(&now);
-		syslog(LOG_NOTICE, "[NCS:%02u SND] disconnected:%5lu, from: %s.%u",
-		                   NET_CONS_CEPID, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno);
+		syslog(LOG_NOTICE, "[NCS%c:%02u SND] discn: %7lu, from: %s.%u",
+		                   API_PROTO, NET_CONS_CEPID, now / SYSTIM_HZ, IP2STR(NULL, &dst.ipaddr), dst.portno);
 		}
 	return error;
@@ -499,5 +500,5 @@
 			case 'M':
 				str = va_arg(ap, char*);
-				put_macaddr(CONSOLE_PORTID, str, width);
+				put_macaddr(CONSOLE_PORTID, (uint8_t *)str, width);
 				break;
 
