Index: EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dbg_cons.c
===================================================================
--- EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dbg_cons.c	(revision 321)
+++ EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/dbg_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
  *
@@ -37,4 +37,5 @@
 
 #include <stdlib.h>
+#include <string.h>
 
 #ifdef TARGET_KERNEL_ASP
@@ -44,7 +45,8 @@
 #include <syssvc/serial.h>
 #include <syssvc/logtask.h>
-#include "kernel_cfg.h"
 #include "kernel/kernel_impl.h"
 #include "kernel/task.h"
+#include "kernel_cfg.h"
+#include "tinet_cfg.h"
 
 #endif	/* of #ifdef TARGET_KERNEL_ASP */
@@ -55,4 +57,5 @@
 #include <t_services.h>
 #include "kernel_id.h"
+#include "tinet_id.h"
 
 #include "../kernel/jsp_kernel.h"
@@ -69,4 +72,5 @@
 #include <net/ethernet.h>
 #include <net/net.h>
+#include <net/net_endian.h>
 #include <net/net_buf.h>
 #include <net/net_timer.h>
@@ -83,36 +87,38 @@
 #include <netinet/ip.h>
 #include <netinet/ip_var.h>
-#include <netinet/ip6.h>
-#include <netinet6/ip6_var.h>
-#include <netinet6/nd6.h>
 #include <netinet/if_ether.h>
 #include <netinet/tcp.h>
-#include <netinet/tcp_timer.h>
 #include <netinet/tcp_var.h>
 #include <netinet/tcp_fsm.h>
+#include <netinet/tcp_timer.h>
 #include <netinet/udp.h>
 #include <netinet/udp_var.h>
 
+#include <netinet6/nd6.h>
+
 #include <net/if_var.h>
-#include <net/if6_var.h>
 
 #include <netapp/netapp.h>
 #include <netapp/netapp_var.h>
-#include <netapp/echo.h>
-#include <netapp/discard.h>
+#include <netapp/wwws.h>
+#include <netapp/tcp_echo_srv1.h>
+#include <netapp/tcp_echo_srv2.h>
+#include <netapp/tcp_echo_cli.h>
+#include <netapp/tcp_discard_cli.h>
+#include <netapp/udp6_echo_srv.h>
+#include <netapp/udp4_echo_srv.h>
+#include <netapp/udp6_echo_cli.h>
+#include <netapp/udp4_echo_cli.h>
+#include <netapp/udp_discard_cli.h>
+#include <netapp/resolver.h>
 #include <netapp/dbg_cons.h>
-
-#ifdef USE_LCD
-
-#include "sc1602/lcd.h"
-
-#endif	/* of #ifdef USE_LCD */
+#include <netapp/dhcp6_cli.h>
+#include <netapp/dhcp4_cli.h>
+#include "lcd.h"
 
 #ifdef USE_DBG_CONS
 
-#define DBG_LINE_SIZE	63
-
 /*
- *  task_status -- タスクの状態の出力
+ *  dbg_cons_task_status -- タスクの状態の出力
  */
 
@@ -127,6 +133,6 @@
 	};
 
-static void
-task_status (ID portid, char *line)
+void
+dbg_cons_task_status (ID portid, char *line)
 {
 	TCB	*tcb;
@@ -149,5 +155,5 @@
 			st >>= 1;
 			}
-		cons_printf(portid, "\n");
+		cons_putchar(portid, '\n');
 		}
 
@@ -176,8 +182,138 @@
 	};
 
+#if defined(SUPPORT_INET6)
+
+static void
+tcp_cep_status (ID portid, char *line)
+{
+	T_TCP_CEP*	cep;
+	int		len;
+
+#if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0
+
+	T_TCP_TWCEP*	twcep;
+
+#endif	/* of #if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0 */
+
+	cons_printf(portid,
+	            "TCP CEP Status\n"
+	            "ID  Snd-Q Rcv-Q Foreign Address                               State\n");
+
+	for (cep = tcp_cep; cep < &tcp_cep[tmax_tcp_cepid]; cep ++)
+		if (!VALID_TCP_CEP(cep)) {
+			cons_printf(portid,
+			            "%2d%c%c     0     0"
+			            " -                                            "
+			            " INVALID\n",
+			            GET_TCP_CEPID(cep),
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4');
+			}
+		else if (cep->fsm_state == TCP_FSM_CLOSED) {
+			cons_printf(portid,
+			            "%2d%c%c     0     0"
+			            " -                                            "
+			            " CLOSED\n",
+			            GET_TCP_CEPID(cep),
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4');
+			}
+		else if (cep->fsm_state == TCP_FSM_LISTEN) {
+			cons_printf(portid,
+			            "%2d%c%c     0     0"
+			            " -                                            "
+			            " LISTEN\n",
+			            GET_TCP_CEPID(cep),
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4');
+			}
+		else {
+			cons_printf(portid,
+			            "%2d%c%c %5d %5d ",
+			            GET_TCP_CEPID(cep),
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4',
+			            cep->swbuf_count, cep->rwbuf_count);
+
 #if defined(SUPPORT_INET4)
 
+			if (TCP_IS_CEP_IPV4(cep)) {
+				T_IN4_ADDR	addr;
+
+				addr = ntohl(cep->dstaddr.ipaddr.s6_addr32[3]);
+				len  = put_ipv4addr(portid, &addr, 0);
+				}
+			else
+				len  = put_ipv6addr(portid, &cep->dstaddr.ipaddr, 0);
+
+#else	/* of #if defined(SUPPORT_INET4) */
+
+			len  = put_ipv6addr(portid, &cep->dstaddr.ipaddr, 0);
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+			cons_putchar(portid, '.');
+			len += cons_putnumber(portid, cep->dstaddr.portno, 10, radhex, 0, false, ' ');
+			for (len = 44 - len; len -- > 0; )
+				cons_putchar(portid, ' ');
+			if (cep->fsm_state == TCP_FSM_TIME_WAIT)
+				cons_printf(portid, " %s(%d)\n", tcp_fsm_str[cep->fsm_state],
+				                    cep->timer[TCP_TIM_2MSL] / TCP_SLOW_HZ);
+			else
+				cons_printf(portid, " %s\n", tcp_fsm_str[cep->fsm_state]);
+			}
+
+#if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0
+
+	for (twcep = tcp_twcep; twcep < &tcp_twcep[NUM_TCP_TW_CEP_ENTRY]; twcep ++) {
+		if (twcep->fsm_state == TCP_FSM_CLOSED) {
+			cons_printf(portid,
+			            "%2dTW     0     0"
+			            " -                                            "
+			            " CLOSED\n",
+			            GET_TCP_TWCEPID(twcep));
+			}
+		else {
+			cons_printf(portid, "%2dTW     0     0 ", GET_TCP_TWCEPID(twcep));
+
+#if defined(SUPPORT_INET4)
+
+			if (TCP_IS_CEP_IPV4(twcep)) {
+				T_IN4_ADDR	addr;
+
+				addr = ntohl(twcep->dstaddr.ipaddr.s6_addr32[3]);
+				len  = put_ipv4addr(portid, &addr, 0);
+				}
+			else
+				len  = put_ipv6addr(portid, &twcep->dstaddr.ipaddr, 0);
+
+#else	/* of #if defined(SUPPORT_INET4) */
+
+			len  = put_ipv6addr(portid, &twcep->dstaddr.ipaddr, 0);
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+			cons_putchar(portid, '.');
+			len += cons_putnumber(portid, twcep->dstaddr.portno, 10, radhex, 0, false, ' ');
+			for (len = 44 - len; len -- > 0; )
+				cons_putchar(portid, ' ');
+			if (twcep->fsm_state == TCP_FSM_TIME_WAIT)
+				cons_printf(portid, " %s(%d)\n", tcp_fsm_str[twcep->fsm_state],
+				                    twcep->timer_2msl / TCP_SLOW_HZ);
+			else
+				cons_printf(portid, " %s\n", tcp_fsm_str[twcep->fsm_state]);
+			}
+		}
+
+#endif	/* of #if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0 */
+
+	}
+
+#else	/* of #if defined(SUPPORT_INET6) */
+
+#if defined(SUPPORT_INET4)
+
 static void
-tcp_status (ID portid, char *line)
+tcp_cep_status (ID portid, char *line)
 {
 	T_TCP_CEP*	cep;
@@ -190,12 +326,4 @@
 #endif	/* of #if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0 */
 
-#ifdef TCP_CFG_PASSIVE_OPEN
-
-	T_TCP_REP*	rep;
-	int_t		cnt;
-
-#endif	/* of #ifdef TCP_CFG_PASSIVE_OPEN */
-
-	WAI_NET_CONS_PRINTF();
 	cons_printf(portid,
 	            "TCP CEP Status\n"
@@ -205,25 +333,28 @@
 		if (!VALID_TCP_CEP(cep)) {
 			cons_printf(portid,
-			            "%2d%c     0     0"
+			            "%2d%c%c     0     0"
 			            " -                    "
 			            " -                    "
 			            " INVALID\n",
 			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ');
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4');
 			}
 		else if (cep->fsm_state == TCP_FSM_CLOSED) {
 			cons_printf(portid,
-			            "%2d%c     0     0"
+			            "%2d%c%c     0     0"
 			            " -                    "
 			            " -                    "
 			            " CLOSED\n",
 			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ');
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4');
 			}
 		else if (cep->fsm_state == TCP_FSM_LISTEN) {
 			cons_printf(portid,
-			            "%2d%c     0     0 ",
+			            "%2d%c%c     0     0 ",
 			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ');
+			            DYNAMIC_TCP_CEP(cep) ? 'D' : '.',
+			            TCP_IS_CEP_IPV6(cep) ? '6' : '4');
 			len  = PUT_IPADDR(portid, &cep->myaddr.ipaddr, 0);
 			cons_putchar(portid, ':');
@@ -263,5 +394,5 @@
 		if (twcep->fsm_state == TCP_FSM_CLOSED) {
 			cons_printf(portid,
-			            "%2dTW    0     0"
+			            "%2dTW     0     0"
 			            " -                    "
 			            " -                    "
@@ -270,5 +401,5 @@
 			}
 		else {
-			cons_printf(portid, "%2dTW    0     0 ", GET_TCP_TWCEPID(twcep));
+			cons_printf(portid, "%2dTW     0     0 ", GET_TCP_TWCEPID(twcep));
 			len  = PUT_IPADDR(portid, &twcep->myaddr.ipaddr, 0);
 			cons_putchar(portid, ':');
@@ -291,144 +422,27 @@
 #endif	/* of #if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0 */
 
-#ifdef TCP_CFG_PASSIVE_OPEN
+	}
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+#endif	/* of #if defined(SUPPORT_INET6) */
+
+#if TNUM_TCP6_REPID > 0
+
+static void
+tcp6_rep_status (ID portid, char *line)
+{
+	T_TCP_CEP*	cep;
+	T_TCP6_REP*	rep;
+	ID		repid;
+	int_t		cnt;
+	uint_t		len;
 
 	cons_printf(portid,
-	            "TCP REP Status\n"
+	            "TCP6 REP Status\n"
 	            "ID  Local Address         CEP\n");
-	for (rep = tcp_rep; rep < &tcp_rep[tmax_tcp_repid]; rep ++) {
-		cons_printf(portid, "%2d%c ", GET_TCP_REPID(rep), DYNAMIC_TCP_REP(rep) ? 'D' : ' ');
-		if (VALID_TCP_REP(rep)) {
-			len  = PUT_IPADDR(portid, &rep->myaddr.ipaddr, 0);
-			cons_putchar(portid, ':');
-			len += cons_putnumber(portid, rep->myaddr.portno, 10, radhex, 0, false, ' ');
-			for (len = 21 - len; len -- > 0; )
-				cons_putchar(portid, ' ');
-			cnt = 0;
-			for (cep = tcp_cep; cep < &tcp_cep[tmax_tcp_cepid]; cep ++) {
-				if (cep->rep == rep) {
-					if (cnt > 0)
-						cons_printf(portid, ",%d", GET_TCP_CEPID(cep));
-					else
-						cons_printf(portid, "%d", GET_TCP_CEPID(cep));
-					cnt ++;
-					}
-				}
-			}
-		else
-			cons_printf(portid, "INVALID");
-		cons_putchar(portid, '\n');
-		}
-
-#endif	/* of #ifdef TCP_CFG_PASSIVE_OPEN */
-
-	SIG_NET_CONS_PRINTF();
-	FLUSH_SND_BUFF();
-	}
-
-#endif	/* of #if defined(SUPPORT_INET4) */
-
-#if defined(SUPPORT_INET6)
-
-static void
-tcp_status (ID portid, char *line)
-{
-	T_TCP_CEP*	cep;
-	uint_t		len;
-
-#if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0
-
-	T_TCP_TWCEP*	twcep;
-
-#endif	/* of #if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0 */
-
-#ifdef TCP_CFG_PASSIVE_OPEN
-
-	T_TCP_REP*	rep;
-	int_t		cnt;
-
-#endif	/* of #ifdef TCP_CFG_PASSIVE_OPEN */
-
-	WAI_NET_CONS_PRINTF();
-	cons_printf(portid,
-	            "TCP CEP Status\n"
-	            "ID  Snd-Q Rcv-Q Foreign Address                             State\n");
-
-	for (cep = tcp_cep; cep < &tcp_cep[tmax_tcp_cepid]; cep ++)
-		if (!VALID_TCP_CEP(cep)) {
-			cons_printf(portid,
-			            "%2d%c     0     0"
-			            " -                                          "
-			            " INVALID\n",
-			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ');
-			}
-		else if (cep->fsm_state == TCP_FSM_CLOSED) {
-			cons_printf(portid,
-			            "%2d%c     0     0"
-			            " -                                          "
-			            " CLOSED\n",
-			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ');
-			}
-		else if (cep->fsm_state == TCP_FSM_LISTEN) {
-			cons_printf(portid,
-			            "%2d%c     0     0"
-			            " -                                          "
-			            " LISTEN\n",
-			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ');
-			}
-		else {
-			cons_printf(portid,
-			            "%2d%c %5d %5d ",
-			            GET_TCP_CEPID(cep),
-			            DYNAMIC_TCP_CEP(cep) ? 'D' : ' ',
-			            cep->swbuf_count, cep->rwbuf_count);
-			len  = PUT_IPADDR(portid, &cep->dstaddr.ipaddr, 0);
-			cons_putchar(portid, '.');
-			len += cons_putnumber(portid, cep->dstaddr.portno, 10, radhex, 0, false, ' ');
-			for (len = 42 - len; len -- > 0; )
-				cons_putchar(portid, ' ');
-			if (cep->fsm_state == TCP_FSM_TIME_WAIT)
-				cons_printf(portid, " %s(%d)\n", tcp_fsm_str[cep->fsm_state],
-				                    cep->timer[TCP_TIM_2MSL] / TCP_SLOW_HZ);
-			else
-				cons_printf(portid, " %s\n", tcp_fsm_str[cep->fsm_state]);
-			}
-
-#if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0
-
-	for (twcep = tcp_twcep; twcep < &tcp_twcep[NUM_TCP_TW_CEP_ENTRY]; twcep ++) {
-		if (twcep->fsm_state == TCP_FSM_CLOSED) {
-			cons_printf(portid,
-			            "%2dTW    0     0"
-			            " -                                          "
-			            " CLOSED\n",
-			            GET_TCP_TWCEPID(twcep));
-			}
-		else {
-			cons_printf(portid, "%2dTW    0     0 ", GET_TCP_TWCEPID(twcep));
-			len  = PUT_IPADDR(portid, &twcep->dstaddr.ipaddr, 0);
-			cons_putchar(portid, '.');
-			len += cons_putnumber(portid, twcep->dstaddr.portno, 10, radhex, 0, false, ' ');
-			for (len = 42 - len; len -- > 0; )
-				cons_putchar(portid, ' ');
-			if (twcep->fsm_state == TCP_FSM_TIME_WAIT)
-				cons_printf(portid, " %s(%d)\n", tcp_fsm_str[twcep->fsm_state],
-				                    twcep->timer_2msl / TCP_SLOW_HZ);
-			else
-				cons_printf(portid, " %s\n", tcp_fsm_str[twcep->fsm_state]);
-			}
-		}
-
-#endif	/* of #if defined(NUM_TCP_TW_CEP_ENTRY) && NUM_TCP_TW_CEP_ENTRY > 0 */
-
-#ifdef TCP_CFG_PASSIVE_OPEN
-
-	cons_printf(portid,
-	            "TCP REP Status\n"
-	            "ID  Local Address         CEP\n");
-	for (rep = tcp_rep; rep < &tcp_rep[tmax_tcp_repid]; rep ++) {
-		cons_printf(portid, "%2d%c ", GET_TCP_REPID(rep), DYNAMIC_TCP_REP(rep) ? 'D' : ' ');
+	for (repid = TMIN_TCP6_REPID; repid <= tmax_tcp6_repid; repid ++) {
+		rep = GET_TCP6_REP(repid);
+		cons_printf(portid, "%2d%c ", GET_TCP6_REPID(rep), DYNAMIC_TCP_REP(rep) ? 'D' : ' ');
 		if (VALID_TCP_REP(rep)) {
 			len  = PUT_IPADDR(portid, &rep->myaddr.ipaddr, 0);
@@ -439,5 +453,5 @@
 			cnt = 0;
 			for (cep = tcp_cep; cep < &tcp_cep[tmax_tcp_cepid]; cep ++) {
-				if (cep->rep == rep) {
+				if (TCP_IS_CEP_IPV6(cep) && cep->rep == rep) {
 					if (cnt > 0)
 						cons_printf(portid, ",%d", GET_TCP_CEPID(cep));
@@ -452,38 +466,51 @@
 		cons_putchar(portid, '\n');
 		}
-
-#endif	/* of #ifdef TCP_CFG_PASSIVE_OPEN */
-
-	SIG_NET_CONS_PRINTF();
-	FLUSH_SND_BUFF();
-	}
-
-#endif	/* of #if defined(SUPPORT_INET6) */
-
-#endif	/* of #ifdef SUPPORT_TCP */
-
-#ifdef SUPPORT_UDP
-
-/*
- *  udp_status -- UDP の状態の出力
- */
+	}
+
+#endif	/* of #if TNUM_TCP6_REPID > 0 */
+
+#if TNUM_TCP4_REPID > 0
 
 static void
-udp_status (ID portid, char *line)
-{
-	T_UDP_CEP*	cep;
+tcp4_rep_status (ID portid, char *line)
+{
+	T_TCP_CEP*	cep;
+	T_TCP4_REP*	rep;
+	ID		repid;
+	int_t		cnt;
 	uint_t		len;
 
-	WAI_NET_CONS_PRINTF();
 	cons_printf(portid,
-	            "UDP CEP Status\n"
-	            "ID  Local Address\n");
-
-	for (cep = udp_cep; cep < &udp_cep[tmax_udp_ccepid]; cep ++) {
-		cons_printf(portid, "%2d%c ", GET_UDP_CEPID(cep), DYNAMIC_UDP_CEP(cep) ? 'D' : ' ');
-		if (VALID_UDP_CEP(cep)) {
-			len  = PUT_IPADDR(portid, &cep->myaddr.ipaddr, 0);
-			cons_putchar(portid, '.');
-			len += cons_putnumber(portid, cep->myaddr.portno, 10, radhex, 0, false, ' ');
+	            "TCP4 REP Status\n"
+	            "ID  Local Address         CEP\n");
+	for (repid = TMIN_TCP4_REPID; repid <= tmax_tcp4_repid; repid ++) {
+		rep = GET_TCP4_REP(repid);
+		cons_printf(portid, "%2d%c ", GET_TCP4_REPID(rep), DYNAMIC_TCP_REP(rep) ? 'D' : ' ');
+		if (VALID_TCP_REP(rep)) {
+			len  = put_ipv4addr(portid, &rep->myaddr.ipaddr, 0);
+			cons_putchar(portid, ':');
+			len += cons_putnumber(portid, rep->myaddr.portno, 10, radhex, 0, false, ' ');
+			for (len = 21 - len; len -- > 0; )
+				cons_putchar(portid, ' ');
+			cnt = 0;
+			for (cep = tcp_cep; cep < &tcp_cep[tmax_tcp_cepid]; cep ++) {
+
+#if defined(SUPPORT_INET6) && defined(SUPPORT_INET4)
+
+				if (TCP_IS_CEP_IPV4(cep) && cep->rep4 == rep) {
+
+#else	/* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */
+
+				if (TCP_IS_CEP_IPV4(cep) && cep->rep == rep) {
+
+#endif	/* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */
+
+					if (cnt > 0)
+						cons_printf(portid, ",%d", GET_TCP_CEPID(cep));
+					else
+						cons_printf(portid, "%d", GET_TCP_CEPID(cep));
+					cnt ++;
+					}
+				}
 			}
 		else
@@ -491,4 +518,22 @@
 		cons_putchar(portid, '\n');
 		}
+	}
+
+#endif	/* of #if TNUM_TCP4_REPID > 0 */
+
+static void
+tcp_status (ID portid, char *line)
+{
+	WAI_NET_CONS_PRINTF();
+
+	tcp_cep_status(portid, line);
+
+#if TNUM_TCP6_REPID > 0
+	tcp6_rep_status(portid, line);
+#endif
+
+#if TNUM_TCP4_REPID > 0
+	tcp4_rep_status(portid, line);
+#endif
 
 	SIG_NET_CONS_PRINTF();
@@ -496,33 +541,92 @@
 	}
 
-#endif	/* of #ifdef SUPPORT_UDP */
-
-#ifdef SUPPORT_ETHER
-
-#if defined(SUPPORT_INET4)
+#endif	/* of #ifdef SUPPORT_TCP */
+
+#ifdef SUPPORT_UDP
 
 /*
- *  ifa_status -- ARP キャッシュ出力
- */
+ *  udp6_status -- UDP の状態の出力
+ */
+
+#if TNUM_UDP6_CEPID > 0
+
+extern const ID tmax_tcp_cepid;
 
 static void
-ifa_status (ID portid, char *line)
-{
-	const T_ARP_ENTRY	*cache;
-	int_t			ix;
-
+udp6_status (ID portid, char *line)
+{
+	T_UDP6_CEP*	cep;
+	ID		cepid;
+	uint_t		len;
+
+	cons_printf(portid,
+	            "UDP6 CEP Status\n"
+	            "ID  Local Address\n");
+
+	for (cepid = TMIN_UDP6_CEPID; cepid <= tmax_udp6_cepid; cepid ++) {
+		cep = GET_UDP6_CEP(cepid);
+		cons_printf(portid, "%2d%c ", GET_UDP6_CEPID(cep), DYNAMIC_UDP_CEP(cep) ? 'D' : ' ');
+		if (VALID_UDP_CEP(cep)) {
+			len  = put_ipv6addr(portid, &cep->myaddr.ipaddr, 0);
+			cons_putchar(portid, '.');
+			len += cons_putnumber(portid, cep->myaddr.portno, 10, radhex, 0, false, ' ');
+			}
+		else
+			cons_printf(portid, "INVALID");
+		cons_putchar(portid, '\n');
+		}
+
+	SIG_NET_CONS_PRINTF();
+	}
+
+#endif	/* of #if TNUM_UDP6_CEPID > 0 */
+
+/*
+ *  udp4_status -- UDP の状態の出力
+ */
+
+#if TNUM_UDP4_CEPID > 0
+
+static void
+udp4_status (ID portid, char *line)
+{
+	T_UDP4_CEP*	cep;
+	ID		cepid;
+	uint_t		len;
+
+	cons_printf(portid,
+	            "UDP4 CEP Status\n"
+	            "ID  Local Address\n");
+
+	for (cepid = TMIN_UDP4_CEPID; cepid <= tmax_udp4_cepid; cepid ++) {
+		cep = GET_UDP4_CEP(cepid);
+		cons_printf(portid, "%2d%c ", GET_UDP4_CEPID(cep), DYNAMIC_UDP_CEP(cep) ? 'D' : ' ');
+		if (VALID_UDP_CEP(cep)) {
+			len  = put_ipv4addr(portid, &cep->myaddr.ipaddr, 0);
+			cons_putchar(portid, '.');
+			len += cons_putnumber(portid, cep->myaddr.portno, 10, radhex, 0, false, ' ');
+			}
+		else
+			cons_printf(portid, "INVALID");
+		cons_putchar(portid, '\n');
+		}
+
+	SIG_NET_CONS_PRINTF();
+	}
+
+#endif	/* of #if TNUM_UDP4_CEPID > 0 */
+
+static void
+udp_status (ID portid, char *line)
+{
 	WAI_NET_CONS_PRINTF();
-	cons_printf(portid,
-	            "ARP Cache\n"
-	            "IX Expire IP Address      MAC Address\n");
-
-	/* expire の単位は [ms]。*/
-	cache = arp_get_cache();
-	for (ix = 0; ix < NUM_ARP_ENTRY; ix ++) {
-		if (cache[ix].expire != 0)
-			cons_printf(portid, "%2d %6d %15I %M\n",
-			                    ix, cache[ix].expire / NET_TIMER_HZ,
-			                    &cache[ix].ip_addr, cache[ix].mac_addr);
-		}
+
+#if TNUM_UDP6_CEPID > 0
+	udp6_status(portid, line);
+#endif
+
+#if TNUM_UDP4_CEPID > 0
+	udp4_status(portid, line);
+#endif
 
 	SIG_NET_CONS_PRINTF();
@@ -530,10 +634,12 @@
 	}
 
-#endif	/* of #if defined(SUPPORT_INET4) */
+#endif	/* of #ifdef SUPPORT_UDP */
+
+#ifdef SUPPORT_ETHER
 
 #if defined(SUPPORT_INET6)
 
 /*
- * ifa_status -- 近隣キャッシュ状態の出力
+ * ifa6_status -- 近隣キャッシュ状態の出力
  */
 
@@ -549,5 +655,5 @@
 
 static void
-ifa_status (ID portid, char *line)
+ifa6_status (ID portid, char *line)
 {
 	const T_LLINFO_ND6	*cache;
@@ -565,9 +671,9 @@
 	for (ix = 0; ix < NUM_ND6_CACHE_ENTRY; ix ++) {
 		if (cache[ix].state != ND6_LLINFO_FREE) {
-			cons_printf(portid, "%2d %6d %10s %M %I\n",
+			cons_printf(portid, "%2d %6ld %10s %M %lI\n",
 			            ix, 
 			            cache[ix].state == ND6_LLINFO_STALE ||
-			            (uint32_t)(cache[ix].expire - now) <= 0
-			                ? 0 : (cache[ix].expire - now) / SYSTIM_HZ,
+			            (uint32_t)((int32_t)(cache[ix].expire - now) <= 0
+			                 ? 0 : (int32_t)(cache[ix].expire - now) / SYSTIM_HZ),
 			            nd_state_str[cache[ix].state],
 			            &cache[ix].ifaddr,
@@ -581,4 +687,36 @@
 
 #endif	/* of #if defined(SUPPORT_INET6) */
+
+#if defined(SUPPORT_INET4)
+
+/*
+ *  ifa4_status -- ARP キャッシュ出力
+ */
+
+static void
+ifa4_status (ID portid, char *line)
+{
+	const T_ARP_ENTRY	*cache;
+	int_t			ix;
+
+	WAI_NET_CONS_PRINTF();
+	cons_printf(portid,
+	            "ARP Cache\n"
+	            "IX Expire MAC Address       IP Address\n");
+
+	/* expire の単位は [ms]。*/
+	cache = arp_get_cache();
+	for (ix = 0; ix < NUM_ARP_ENTRY; ix ++) {
+		if (cache[ix].expire != 0)
+			cons_printf(portid, "%2d %6d %M %hI\n",
+			                    ix, cache[ix].expire / NET_TIMER_HZ,
+			                    cache[ix].mac_addr, &cache[ix].ip_addr);
+		}
+
+	SIG_NET_CONS_PRINTF();
+	FLUSH_SND_BUFF();
+	}
+
+#endif	/* of #if defined(SUPPORT_INET4) */
 
 #endif	/* of #ifdef SUPPORT_ETHER */
@@ -673,4 +811,46 @@
 
 #endif	/* of #ifdef SUPPORT_ETHER */
+
+#if defined(SUPPORT_INET6)
+
+	cons_printf(portid, "\nIPv6\n");
+	cons_printf(portid, "\t受信オクテット数\t%lu\n",		net_count_ip6[NC_IP6_IN_OCTETS]);
+	cons_printf(portid, "\t受信データグラム数\t%lu\n",		net_count_ip6[NC_IP6_IN_PACKETS]);
+	cons_printf(portid, "\t受信エラーデータグラム数\t%lu\n",	net_count_ip6[NC_IP6_IN_ERR_PACKETS]);
+	cons_printf(portid, "\t長さエラー数\t%lu\n",			net_count_ip6[NC_IP6_IN_ERR_SHORT]);
+	cons_printf(portid, "\tバージョンエラー数\t%lu\n",		net_count_ip6[NC_IP6_IN_ERR_VER]);
+	cons_printf(portid, "\tアドレスエラー数\t%lu\n",		net_count_ip6[NC_IP6_IN_ERR_ADDR]);
+	cons_printf(portid, "\tプロトコルエラー数\t%lu\n",		net_count_ip6[NC_IP6_IN_ERR_PROTO]);
+	cons_printf(portid, "\t分割受信数\t%lu\n",			net_count_ip6[NC_IP6_FRAG_IN]);
+	cons_printf(portid, "\t分割受信フラグメント数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_IN_FRAGS]);
+	cons_printf(portid, "\t分割受信再構成成功数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_IN_OK]);
+	cons_printf(portid, "\t分割受信破棄数\t%lu\n",			net_count_ip6[NC_IP6_FRAG_IN_DROP]);
+	cons_printf(portid, "\t分割受信バッファり当て失敗数\t%lu\n",	net_count_ip6[NC_IP6_FRAG_IN_NO_BUF]);
+	cons_printf(portid, "\t分割受信タイムアウト数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_IN_TMOUT]);
+	cons_printf(portid, "\t送信オクテット数\t%lu\n",		net_count_ip6[NC_IP6_OUT_OCTETS]);
+	cons_printf(portid, "\t送信データグラム数\t%lu\n",		net_count_ip6[NC_IP6_OUT_PACKETS]);
+	cons_printf(portid, "\t送信エラーデータグラム数\t%lu\n",	net_count_ip6[NC_IP6_OUT_ERR_PACKETS]);
+	cons_printf(portid, "\t分割送信数\t%lu\n",			net_count_ip6[NC_IP6_FRAG_OUT]);
+	cons_printf(portid, "\t分割送信フラグメント数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_OUT_FRAGS]);
+
+	cons_printf(portid, "\nICMPv6\n");
+	cons_printf(portid, "\t受信オクテット数\t%lu\n",		net_count_icmp6[NC_ICMP6_IN_OCTETS]);
+	cons_printf(portid, "\t受信パケット数\t%lu\n",			net_count_icmp6[NC_ICMP6_IN_PACKETS]);
+	cons_printf(portid, "\t受信エラーパケット数\t%lu\n",		net_count_icmp6[NC_ICMP6_IN_ERR_PACKETS]);
+	cons_printf(portid, "\t受信チックサムエラー数\t%lu\n",		net_count_icmp6[NC_ICMP6_IN_ERR_CKSUM]);
+	cons_printf(portid, "\t送信オクテット数\t%lu\n",		net_count_icmp6[NC_ICMP6_OUT_OCTETS]);
+	cons_printf(portid, "\t送信パケット数\t%lu\n",			net_count_icmp6[NC_ICMP6_OUT_PACKETS]);
+	cons_printf(portid, "\t送信エラーパケット数\t%lu\n",		net_count_icmp6[NC_ICMP6_OUT_ERR_PACKETS]);
+
+	cons_printf(portid, "\n近隣探索\n");
+	cons_printf(portid, "\tルータ通知受信数\t%lu\n",		net_count_nd6[NC_ND6_RA_IN_PACKETS]);
+	cons_printf(portid, "\tルータ要請送信数\t%lu\n",		net_count_nd6[NC_ND6_RS_OUT_PACKETS]);
+	cons_printf(portid, "\t近隣通知受信数\t%lu\n",			net_count_nd6[NC_ND6_NA_IN_PACKETS]);
+	cons_printf(portid, "\t近隣通知送信数\t%lu\n",			net_count_nd6[NC_ND6_NA_OUT_PACKETS]);
+	cons_printf(portid, "\t近隣要請受信数\t%lu\n",			net_count_nd6[NC_ND6_NS_IN_PACKETS]);
+	cons_printf(portid, "\t近隣要請送信数\t%lu\n",			net_count_nd6[NC_ND6_NS_OUT_PACKETS]);
+	cons_printf(portid, "\t重複アドレス検出送信数\t%lu\n",		net_count_nd6[NC_ND6_DAD_OUT_PACKETS]);
+
+#else	/* of #if defined(SUPPORT_INET6) */
 
 #if defined(SUPPORT_INET4)
@@ -707,44 +887,4 @@
 
 #endif	/* of #if defined(SUPPORT_INET4) */
-
-#if defined(SUPPORT_INET6)
-
-	cons_printf(portid, "\nIPv6\n");
-	cons_printf(portid, "\t受信オクテット数\t%lu\n",		net_count_ip6[NC_IP6_IN_OCTETS]);
-	cons_printf(portid, "\t受信データグラム数\t%lu\n",		net_count_ip6[NC_IP6_IN_PACKETS]);
-	cons_printf(portid, "\t受信エラーデータグラム数\t%lu\n",	net_count_ip6[NC_IP6_IN_ERR_PACKETS]);
-	cons_printf(portid, "\t長さエラー数\t%lu\n",			net_count_ip6[NC_IP6_IN_ERR_SHORT]);
-	cons_printf(portid, "\tバージョンエラー数\t%lu\n",		net_count_ip6[NC_IP6_IN_ERR_VER]);
-	cons_printf(portid, "\tアドレスエラー数\t%lu\n",		net_count_ip6[NC_IP6_IN_ERR_ADDR]);
-	cons_printf(portid, "\tプロトコルエラー数\t%lu\n",		net_count_ip6[NC_IP6_IN_ERR_PROTO]);
-	cons_printf(portid, "\t分割受信数\t%lu\n",			net_count_ip6[NC_IP6_FRAG_IN]);
-	cons_printf(portid, "\t分割受信フラグメント数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_IN_FRAGS]);
-	cons_printf(portid, "\t分割受信再構成成功数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_IN_OK]);
-	cons_printf(portid, "\t分割受信破棄数\t%lu\n",			net_count_ip6[NC_IP6_FRAG_IN_DROP]);
-	cons_printf(portid, "\t分割受信バッファり当て失敗数\t%lu\n",	net_count_ip6[NC_IP6_FRAG_IN_NO_BUF]);
-	cons_printf(portid, "\t分割受信タイムアウト数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_IN_TMOUT]);
-	cons_printf(portid, "\t送信オクテット数\t%lu\n",		net_count_ip6[NC_IP6_OUT_OCTETS]);
-	cons_printf(portid, "\t送信データグラム数\t%lu\n",		net_count_ip6[NC_IP6_OUT_PACKETS]);
-	cons_printf(portid, "\t送信エラーデータグラム数\t%lu\n",	net_count_ip6[NC_IP6_OUT_ERR_PACKETS]);
-	cons_printf(portid, "\t分割送信数\t%lu\n",			net_count_ip6[NC_IP6_FRAG_OUT]);
-	cons_printf(portid, "\t分割送信フラグメント数\t%lu\n",		net_count_ip6[NC_IP6_FRAG_OUT_FRAGS]);
-
-	cons_printf(portid, "\nICMPv6\n");
-	cons_printf(portid, "\t受信オクテット数\t%lu\n",		net_count_icmp6[NC_ICMP6_IN_OCTETS]);
-	cons_printf(portid, "\t受信パケット数\t%lu\n",			net_count_icmp6[NC_ICMP6_IN_PACKETS]);
-	cons_printf(portid, "\t受信エラーパケット数\t%lu\n",		net_count_icmp6[NC_ICMP6_IN_ERR_PACKETS]);
-	cons_printf(portid, "\t受信チックサムエラー数\t%lu\n",		net_count_icmp6[NC_ICMP6_IN_ERR_CKSUM]);
-	cons_printf(portid, "\t送信オクテット数\t%lu\n",		net_count_icmp6[NC_ICMP6_OUT_OCTETS]);
-	cons_printf(portid, "\t送信パケット数\t%lu\n",			net_count_icmp6[NC_ICMP6_OUT_PACKETS]);
-	cons_printf(portid, "\t送信エラーパケット数\t%lu\n",		net_count_icmp6[NC_ICMP6_OUT_ERR_PACKETS]);
-
-	cons_printf(portid, "\n近隣探索\n");
-	cons_printf(portid, "\tルータ通知受信数\t%lu\n",		net_count_nd6[NC_ND6_RA_IN_PACKETS]);
-	cons_printf(portid, "\tルータ要請送信数\t%lu\n",		net_count_nd6[NC_ND6_RS_OUT_PACKETS]);
-	cons_printf(portid, "\t近隣通知受信数\t%lu\n",			net_count_nd6[NC_ND6_NA_IN_PACKETS]);
-	cons_printf(portid, "\t近隣通知送信数\t%lu\n",			net_count_nd6[NC_ND6_NA_OUT_PACKETS]);
-	cons_printf(portid, "\t近隣要請受信数\t%lu\n",			net_count_nd6[NC_ND6_NS_IN_PACKETS]);
-	cons_printf(portid, "\t近隣要請送信数\t%lu\n",			net_count_nd6[NC_ND6_NS_OUT_PACKETS]);
-	cons_printf(portid, "\t重複アドレス検出送信数\t%lu\n",		net_count_nd6[NC_ND6_DAD_OUT_PACKETS]);
 
 #endif	/* of #if defined(SUPPORT_INET6) */
@@ -787,9 +927,10 @@
 
 	tbl = nbuf_get_tbl();
-	cons_printf(portid, "\nネットワークバッファ\n\tサイズ\t用意数\t割当要求数\t割当数\t割当てエラー数\n");
+	cons_printf(portid, "\nネットワークバッファ\n\tサイズ\t用意数\t使用中数\t割当要求数\t割当数\t割当てエラー数\n");
 	for (ix = nbuf_get_tbl_size(); ix -- > 0; ) {
-		cons_printf(portid, "\t%lu\t%lu\t%lu\t%lu\t%lu\n",
+		cons_printf(portid, "\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\n",
 		                    tbl[ix].size,
 		                    tbl[ix].prepares,
+		                    tbl[ix].busies,
 		                    tbl[ix].requests,
 		                    tbl[ix].allocs,
@@ -833,5 +974,5 @@
 	for (ix = nbuf_get_tbl_size(); ix -- > 0; )
 		cons_printf(portid, "\t%d", tbl[ix].size);
-	cons_printf(portid, "\n");
+	cons_putchar(portid, '\n');
 
 	queue = ip_get_frag_queue();
@@ -846,5 +987,5 @@
 				cons_printf(portid, "\t%d", count);
 				}
-			cons_printf(portid, "\n");
+			cons_putchar(portid, '\n');
 			}
 		}
@@ -874,5 +1015,5 @@
 	for (ix = nbuf_get_tbl_size(); ix -- > 0; )
 		cons_printf(portid, "\t%d", tbl[ix].size);
-	cons_printf(portid, "\n");
+	cons_putchar(portid, '\n');
 
 	queue = ip6_get_frag_queue();
@@ -887,5 +1028,5 @@
 				cons_printf(portid, "\t%d", count);
 				}
-			cons_printf(portid, "\n");
+			cons_putchar(portid, '\n');
 			}
 		}
@@ -918,5 +1059,4 @@
 
 #ifdef TCP_CFG_SWBUF_CSAVE
-	T_IP_HDR*		iph;
 	T_TCP_HDR*		tcph;
 #endif	/* of #ifdef TCP_CFG_SWBUF_CSAVE */
@@ -925,14 +1065,15 @@
 	WAI_NET_CONS_PRINTF();
 	get_tim(&now);
-	cons_printf(portid, "ネットワークバッファ情報\t経過時間[ms]\t%lu\n", now);
+	cons_printf(portid, "ネットワークバッファ情報\t経過時間[ms]\t%u\n", now);
 
 #if NET_COUNT_ENABLE
 
-	cons_printf(portid, "\nネットワークバッファ\n\tサイズ\t用意数\t割当要求数\t割当数\t割当てエラー数\n");
+	cons_printf(portid, "\nネットワークバッファ\n\tサイズ\t用意数\t使用中数\t割当要求数\t割当数\t割当てエラー数\n");
 	tbl = nbuf_get_tbl();
 	for (ix = nbuf_get_tbl_size(); ix -- > 0; ) {
-		cons_printf(portid, "\t%lu\t%lu\t%lu\t%lu\t%lu\n",
+		cons_printf(portid, "\t%u\t%u\t%u\t%u\t%u\t%u\n",
 		                    tbl[ix].size,
 		                    tbl[ix].prepares,
+		                    tbl[ix].busies,
 		                    tbl[ix].requests,
 		                    tbl[ix].allocs,
@@ -949,6 +1090,6 @@
 		cons_printf(portid, "%2d", GET_TCP_CEPID(cep));
 		for (nbuf = cep->reassq; nbuf != NULL; nbuf = tqhdr->next) {
-			tqhdr = GET_TCP_Q_HDR(nbuf, GET_TCP_IP_Q_HDR(nbuf)->thoff);
-			cons_printf(portid, "[a:%6d-%6d] ",
+			tqhdr = GET_TCP_Q_HDR(nbuf, GET_TCP_HDR_OFFSET(nbuf));
+			cons_printf(portid, "[a:%6lu-%6lu] ",
 			            ntohl(tqhdr->seq) - cep->irs + tqhdr->soff,
 			            ntohl(tqhdr->seq) - cep->irs + tqhdr->soff + tqhdr->slen);
@@ -957,6 +1098,6 @@
 #ifdef TCP_CFG_RWBUF_CSAVE
 		for (nbuf = cep->rwbufq; nbuf != NULL; nbuf = tqhdr->next) {
-			tqhdr = GET_TCP_Q_HDR(nbuf, GET_TCP_IP_Q_HDR(nbuf)->thoff);
-			cons_printf(portid, "[r:%6d-%6d] ",
+			tqhdr = GET_TCP_Q_HDR(nbuf, GET_TCP_HDR_OFFSET(nbuf));
+			cons_printf(portid, "[r:%6lu-%6lu] ",
 			            ntohl(tqhdr->seq) - cep->irs + tqhdr->soff,
 			            ntohl(tqhdr->seq) - cep->irs + tqhdr->soff + tqhdr->slen);
@@ -966,14 +1107,21 @@
 #ifdef TCP_CFG_SWBUF_CSAVE
 		if (cep->swbufq != NULL) {
-			iph  = GET_IP_HDR(cep->swbufq);
 			tcph = GET_TCP_HDR(cep->swbufq, GET_TCP_HDR_OFFSET(cep->swbufq));
-			cons_printf(portid, "[s:%6d-%6d] ",
+#if 0
+			cons_printf(portid, "[s:%6lu-%6lu] ",
 			            ntohl(tcph->seq) - cep->iss,
-			            ntohl(tcph->seq) - cep->iss + (GET_IP_SDU_SIZE(iph) - 
-			                                           GET_TCP_HDR_SIZE2(cep->swbufq, GET_TCP_HDR_OFFSET(cep->swbufq))));
+			            ntohl(tcph->seq) - cep->iss + (GET_IP_SDU_SIZE(cep->swbufq) - 
+			                                           GET_TCP_HDR_SIZE(cep->swbufq, GET_TCP_HDR_OFFSET(cep->swbufq))));
+#else
+			cons_printf(portid, "[s:%6lu-%6lu,%08x,%08x] ",
+			            ntohl(tcph->seq) - cep->iss,
+			            ntohl(tcph->seq) - cep->iss + (GET_IP_SDU_SIZE(cep->swbufq) - 
+			                                           GET_TCP_HDR_SIZE(cep->swbufq, GET_TCP_HDR_OFFSET(cep->swbufq))),
+			            ntohl(tcph->seq), cep->iss);
+#endif
 			}
 #endif	/* of #ifdef TCP_CFG_SWBUF_CSAVE */
 
-		cons_printf(portid, "\n");
+		cons_putchar(portid, '\n');
 		}
 
@@ -1008,51 +1156,393 @@
 	}
 
+#ifdef USE_RESOLVER
+
+/*
+ *  show_dns_soa -- DNS の SOA RDATA を表示する。
+ */
+
+static ER_UINT
+show_dns_soa (ID portid, uint8_t *msg, ER_UINT length, uint_t offset)
+{
+	T_RSLV_SOA	soa;
+	ER_UINT		error;
+	uint_t		rn_offset;
+
+	if ((error = dns_analyze_soa(&soa, offset, msg, length)) < 0)
+		return error;
+
+	cons_printf(portid, "    mname:   ");
+	rn_offset = show_dns_domain_name(portid, msg, offset);
+	cons_putchar(portid, '\n');
+	cons_printf(portid, "    rname:   ");
+	show_dns_domain_name(portid, msg, rn_offset);
+	cons_putchar(portid, '\n');
+
+	cons_printf(portid, "    serial:  %d\n", soa.serial);
+	cons_printf(portid, "    refresh: %d\n", soa.refresh);
+	cons_printf(portid, "    retry:   %d\n", soa.retry);
+	cons_printf(portid, "    expirel: %d\n", soa.expire);
+	cons_printf(portid, "    minimum: %d\n", soa.minimum);
+
+	return E_OK;
+	}
+
+/*
+ *  show_dns_qdsection -- DNS の Question セクションを表示する。
+ */
+
+static ER_UINT
+show_dns_qdsection (ID portid, uint8_t *msg, ER_UINT length, T_RSLV_DNS_MSG *rslv)
+{
+	T_RSLV_QD	qd;
+	ER_UINT		offset, error;
+	int		scount;
+
+	cons_printf(portid, "question   section: %d\n", rslv->dns_hdr.qdcount);
+	offset = rslv->qd_offset;
+	for (scount = 1; scount <= rslv->dns_hdr.qdcount; scount ++) {
+		if ((error = dns_analyze_qd(&qd, offset, msg, length)) < 0)
+			return error;
+
+		cons_printf(portid, "%2d: ", scount);
+		show_dns_domain_name(portid, msg, offset);
+		cons_printf(portid, "\n    type: %-4s, class: %2s\n", dns_strtype(qd.type), dns_strclass(qd.class));
+		offset = error;
+		}
+
+	return E_OK;
+	}
+
+/*
+ *  show_dns_section -- DNS の各セクションを表示する。
+ */
+
+static ER_UINT
+show_dns_section (ID portid, uint8_t *msg, ER_UINT length, uint_t scount, uint_t offset, char *title)
+{
+	T_RSLV_RR	rr;
+	T_IN4_ADDR	in4_addr;
+	ER_UINT		error;
+	int		count, dcount, col;
+	T_IN6_ADDR	in6_addr;
+
+	cons_printf(portid, "%10s section: %d\n", title, scount);
+	for (count = 1; count <= scount; count ++) {
+		if ((error = dns_analyze_rr(&rr, offset, msg, length)) < 0)
+			return error;
+
+		cons_printf(portid, "%2d: ", count);
+		show_dns_domain_name(portid, msg, offset);
+		cons_printf(portid, "\n    type: %-4s, class: %2s, TTL: %2d, len: %3d, offset: 0x%02x\n",
+		            dns_strtype(rr.type), dns_strclass(rr.class), rr.ttl, rr.rdlength, rr.rdata_offset);
+
+		switch (rr.type) {
+		case DNS_TYPE_A:
+			memcpy((void*)&in4_addr, (void*)(msg + rr.rdata_offset), sizeof(in4_addr));
+			in4_addr = ntohl(in4_addr);
+			cons_printf(portid, "    IPv4 addr: %hI\n", &in4_addr);
+			break;
+		case DNS_TYPE_NS:
+			cons_printf(portid, "    host: ");
+			show_dns_domain_name(portid, msg, rr.rdata_offset);
+			cons_putchar(portid, '\n');
+			break;
+		case DNS_TYPE_CNAME:
+			cons_printf(portid, "    host: ");
+			show_dns_domain_name(portid, msg, rr.rdata_offset);
+			cons_putchar(portid, '\n');
+			break;
+		case DNS_TYPE_SOA:
+			show_dns_soa(portid, msg, length, rr.rdata_offset);
+			break;
+		case DNS_TYPE_PTR:
+			cons_printf(portid, "     PTR: ");
+			show_dns_domain_name(portid, msg, rr.rdata_offset);
+			cons_putchar(portid, '\n');
+			break;
+		case DNS_TYPE_AAAA:
+			memcpy((void*)&in6_addr, (void*)(msg + rr.rdata_offset), sizeof(in6_addr));
+			cons_printf(portid, "    IPv6 addr: %lI\n", &in6_addr);
+			break;
+		default:
+			cons_printf(portid, "    data: ");
+			col = 32;
+			for (dcount = 0; dcount < rr.rdlength; dcount ++) {
+				cons_printf(portid, "%02x", *(msg + rr.rdata_offset + dcount));
+				if (-- col == 0) {
+					cons_printf(portid, "\n          ");
+					col = 32;
+					}
+				}
+			cons_putchar(portid, '\n');
+			break;
+			}
+		}
+
+	return E_OK;
+	}
+/*
+ *  dns_info -- DNS 情報の表示
+ */
+
+static void
+dns_info (ID portid)
+{
+#if defined(SUPPORT_INET6)
+	T_IN6_ADDR	in6_addr;
+#endif
 #if defined(SUPPORT_INET4)
-
-#if NUM_ROUTE_ENTRY > 0
+	T_IN4_ADDR	in4_addr;
+#endif
+
+#if defined(SUPPORT_INET6)
+
+	cons_printf(portid, "domain name:     %s\n", dns_in6_get_dname());
+
+#else	/* of #if defined(SUPPORT_INET6) */
+
+	cons_printf(portid, "domain name:     %s\n", dns_in4_get_dname());
+
+#endif	/* of #if defined(SUPPORT_INET6) */
+
+#if defined(SUPPORT_INET6)
+	dns_in6_get_addr(&in6_addr);
+	cons_printf(portid, "IPv6 DNS server: ");
+	if (IN6_IS_ADDR_UNSPECIFIED(&in6_addr))
+		cons_printf(portid, "not available.\n");
+	else
+		cons_printf(portid, "%lI.\n", &in6_addr);
+#endif	/* of #if defined(SUPPORT_INET6) */
+
+#if defined(SUPPORT_INET4)
+	dns_in4_get_addr(&in4_addr);
+	cons_printf(portid, "IPv4 DNS server: ");
+	if (in4_addr == IPV4_ADDRANY)
+		cons_printf(portid, "not available.\n");
+	else
+		cons_printf(portid, "%hI.\n", &in4_addr);
+#endif	/* of #if defined(SUPPORT_INET4) */
+	}
 
 /*
- *  routing_table_status -- 経路表の出力
- */
+ *  name_lookup -- ホスト名－IP アドレス変換
+ */
+
+const char *rcode_str[] = {
+	"no error",
+	"format error",
+	"server error",
+	"name error",
+	"not implement",
+	"refused",
+	};
 
 static void
-routing_table_status (ID portid, char *line)
-{
-	int_t	ix;
-
-	if ('0' <= *(line = skip_blanks(line)) && *line <= '9') {
-		T_IN4_ADDR	target, mask, gateway;
-
-		ix = atoi(line);
-		while ('0' <= *line && *line <= '9')
-			line ++;
-		line = GET_IPADDR(&target,  skip_blanks(line));
-		line = GET_IPADDR(&mask,    skip_blanks(line));
-		       GET_IPADDR(&gateway, skip_blanks(line));
-		in4_add_route(ix, target, mask, gateway);
-		}
-
+name_lookup (ID portid, char *line)
+{
+	static char hostname[DBG_LINE_SIZE + 1];
+
+	T_RSLV_DNS_MSG	rslv;
+	ER_UINT		length, offset;
+	ER		error;
+	uint_t		flags = 0;
+	uint8_t 	*msg;
+
+	/* コマンドのオプションを設定する。*/
+	line = skip_blanks(resolv_options(&flags, line, DEFAULT_API_PROTO));
+	if ((flags & (DNS_LUP_FLAGS_PROTO_IPV6 | DNS_LUP_FLAGS_PROTO_IPV4)) == 0) {
+		cons_printf(portid, "DNS server not available.\n");
+		return;
+		}
+
+	/* 照会するホスト名・IP アドレスを解析する。*/
+	resolv_hoststr(&flags, hostname, sizeof(hostname), line);
+
+	/* 正引きでも逆引きでもプロトコル上は正引きを指定する。*/
+	flags |= DNS_LUP_OPCODE_FORWARD;
+
+	/* IPv6 アドレス、または IPv4 アドレスが指定された時は、照会タイプは PTR に設定する。*/
+	if (((flags & DNS_LUP_FLAGS_NAME_MASK) == DNS_LUP_FLAGS_NAME_IPV6) ||
+	    ((flags & DNS_LUP_FLAGS_NAME_MASK) == DNS_LUP_FLAGS_NAME_IPV4))
+		flags = (flags & ~DNS_LUP_FLAGS_QTYPE_MASK) | DNS_LUP_FLAGS_QTYPE_PTR;
+
+	if ((error = tget_mpf(MPF_RSLV_SRBUF, (void*)&msg, TMO_FEVR)) != E_OK) {
+		cons_printf(portid, "get buffer error: %s.\n", itron_strerror(error));
+		return;
+		}
+
+	if ((length = dns_lookup_host(flags | DNS_LUP_FLAGS_MSG, line, msg, DNS_UDP_MSG_LENGTH, &rslv)) < 0) {
+		//cons_printf(portid, "error: %s.\n", itron_strerror(length));
+		goto err_ret;
+		}
+
+	dly_tsk(1 * 1000);
+	cons_printf(portid, "DNS header: flags: ");
+	if (rslv.dns_hdr.code & (DNS_QR_RESPONSE | DNS_AUTHORITATIVE     |
+	                         DNS_TRUN_CATION | DNS_RECURSION_DESIRED | DNS_RECURSION_AVAILABLE)) {
+		cons_printf(portid, (rslv.dns_hdr.code & DNS_QR_RESPONSE)         ? "QR," : "");
+		cons_printf(portid, (rslv.dns_hdr.code & DNS_AUTHORITATIVE)       ? "AA," : "");
+		cons_printf(portid, (rslv.dns_hdr.code & DNS_TRUN_CATION)         ? "TC," : "");
+		cons_printf(portid, (rslv.dns_hdr.code & DNS_RECURSION_DESIRED)   ? "RD," : "");
+		cons_printf(portid, (rslv.dns_hdr.code & DNS_RECURSION_AVAILABLE) ? "RA," : "");
+		cons_printf(portid, " ");
+		}
+	cons_printf(portid, "opcode: ");
+	cons_printf(portid, (rslv.dns_hdr.code & DNS_OPCODE_REVERSE)      ? "RV"  : "FW");
+	cons_printf(portid, (rslv.dns_hdr.code & DNS_OPCODE_STATUS)       ? ",ST" : "");
+	cons_printf(portid, ", rcode: %s.\n",
+	            (rslv.dns_hdr.code & DNS_RCODE_MASK) > DNS_RCODE_REFUSED
+	            	? "6" : rcode_str[rslv.dns_hdr.code & DNS_RCODE_MASK]);
+
+	if ((offset = show_dns_qdsection(portid, msg, length, &rslv)) < 0) {
+		cons_printf(portid, "msg error: %s.\n", itron_strerror(offset));
+		}
+	if ((offset = show_dns_section(portid, msg, length, rslv.dns_hdr.ancount, rslv.an_offset, "answer")) < 0) {
+		cons_printf(portid, "msg error: %s.\n", itron_strerror(offset));
+		}
+	if ((offset = show_dns_section(portid, msg, length, rslv.dns_hdr.nscount, rslv.ns_offset, "authority")) < 0) {
+		cons_printf(portid, "msg error: %s.\n", itron_strerror(offset));
+		}
+	if ((offset = show_dns_section(portid, msg, length, rslv.dns_hdr.arcount, rslv.ar_offset, "additional")) < 0) {
+		cons_printf(portid, "msg error: %s.\n", itron_strerror(offset));
+		}
+
+err_ret:
+	if ((error = rel_mpf(MPF_RSLV_SRBUF, msg)) != E_OK)
+		cons_printf(portid, "release buffer error: %s.\n", itron_strerror(error));
+	return;
+	}
+
+#endif	 /* of #ifdef USE_RESOLVER */
+
+#if defined(DHCP6_CLI_CFG)
+
+/*
+ *  dhcp6c_info -- DHCPv6 クライアント情報の表示
+ */
+
+static void
+dhcp6c_info (ID portid)
+{
+	T_IN6_ADDR	svaddr;
+	SYSTIM		bind_start;
+	ER		error;
+	uint32_t	expire, renew, rebind, deprefer;
+
+	if ((error = dhcp6c_get_info(&svaddr, &expire, &renew, &rebind, &deprefer, &bind_start)) == E_OK) {
+		cons_printf(portid, "      DHCPv6 server: %lI.\n", &svaddr);
+
+#if DHCP6_CLI_CFG_MODE == DHCP6_CLI_CFG_STATELESS
+	
+		cons_printf(portid, "      DHCPv6 mode:   stateless.\n");
+
+#elif DHCP6_CLI_CFG_MODE == DHCP6_CLI_CFG_STATEFULL
+
+		cons_printf(portid, "      DHCPv6 mode:   statefull,\n");
+		cons_printf(portid, "        Renew:       %u:%02u:%02u, Deprefer: %u:%02u:%02u,\n",
+		                       renew / 3600, (   renew / 60) % 60,    renew % 60,
+		                    deprefer / 3600, (deprefer / 60) % 60, deprefer % 60);
+		cons_printf(portid, "        Rebind:      %u:%02u:%02u, Expire:   %u:%02u:%02u.\n",
+		                      rebind / 3600, (  rebind / 60) % 60,   rebind % 60,
+		                      expire / 3600, (  expire / 60) % 60,   expire % 60);
+
+#else	/* of #if DHCP6_CLI_CFG_MODE == DHCP6_CLI_CFG_STATELESS */
+
+#endif	/* of #if DHCP6_CLI_CFG_MODE == DHCP6_CLI_CFG_STATELESS */
+
+		}
+	else if (error == E_OBJ)
+		cons_printf(portid, "      DHCPv6 server: not available.\n");
+	}
+
+#endif	/* of #if defined(DHCP6_CLI_CFG) */
+
+#if defined(DHCP4_CLI_CFG)
+
+/*
+ *  dhcp4c_info -- DHCPv4 クライアント情報の表示
+ */
+
+static void
+dhcp4c_info (ID portid)
+{
+	T_IN4_ADDR	svaddr;
+	SYSTIM		bind_start;
+	ER		error;
+	uint32_t	expire, renew, rebind;
+
+	if ((error = dhcp4c_get_info(&svaddr, &expire, &renew, &rebind, &bind_start)) == E_OK) {
+		cons_printf(portid, "      DHCPv4 server: %hI,\n", &svaddr);
+		cons_printf(portid, "        Renew:       %u:%02u:%02u,\n", 
+		                      renew  / 3600, (renew  / 60) % 60, renew % 60);
+		cons_printf(portid, "        Rebind:      %u:%02u:%02u, Expire:   %u:%02u:%02u.\n",
+		                      rebind / 3600, (rebind / 60) % 60, rebind % 60,
+		                      expire / 3600, (expire / 60) % 60, expire % 60);
+		}
+	else if (error == E_OBJ)
+		cons_printf(portid, "      DHCPv4 server: not available.\n");
+	}
+
+#endif	/* of #if defined(DHCP4_CLI_CFG) */
+
+#if defined(DHCP6_CLI_CFG) || defined(DHCP4_CLI_CFG)
+
+/*
+ *  dhcpc -- DHCP クライアント情報の表示と制御
+ */
+
+static void
+dhcpc (ID portid, char *line)
+{
 	WAI_NET_CONS_PRINTF();
-	cons_printf(portid,
-	            "Routing Table Status\n"
-	            "IX Target          Mask            Gateway         Expire\n");
-
-	for (ix = 0; ix < NUM_ROUTE_ENTRY; ix ++) {
-		if ((routing_tbl[ix].flags & IN_RTF_DEFINED) == 0)
-			;
-		else if ((routing_tbl[ix].flags & IN_RTF_REDIRECT) != 0)
-			cons_printf(portid, "%2d %15I %15I %15I %4d\n",
-			            ix,
-			            &routing_tbl[ix].target,
-			            &routing_tbl[ix].mask,
-			            &routing_tbl[ix].gateway,
-			            &routing_tbl[ix].expire);
-		else
-			cons_printf(portid, "%2d %15I %15I %I\n",
-			            ix,
-			            &routing_tbl[ix].target,
-			            &routing_tbl[ix].mask,
-			            &routing_tbl[ix].gateway);
-		            
+
+	switch (*line) {
+
+#if defined(DHCP6_CLI_CFG)
+	case '6':			/* DHCPv6 の制御 */
+		switch (*(line + 1)) {
+		case 'r':		/* アドレス情報を解放する。*/
+			dhcp6c_rel_info();
+			break;
+
+		case 'n':		/* アドレス情報を再取得する。*/
+			dhcp6c_renew_info();
+			break;
+
+		default:
+			dhcp6c_info(portid);
+			break;
+			}
+		break;
+#endif	/* of #if defined(DHCP6_CLI_CFG) */
+
+#if defined(DHCP4_CLI_CFG)
+	case '4':		/* DHCPv4 の制御 */
+		switch (*(line + 1)) {
+		case 'r':		/* アドレス情報を解放する。*/
+			dhcp4c_rel_info();
+			break;
+
+		case 'n':		/* アドレス情報を再取得する。*/
+			dhcp4c_renew_info();
+			break;
+
+		default:
+			dhcp4c_info(portid);
+			break;
+			}
+		break;
+#endif	/* of #if defined(DHCP4_CLI_CFG) */
+
+	default:
+
+#if defined(DHCP6_CLI_CFG)
+		dhcp6c_info(portid);
+#endif
+
+#if defined(DHCP4_CLI_CFG)
+		dhcp4c_info(portid);
+#endif
+		break;
 		}
 
@@ -1061,7 +1551,5 @@
 	}
 
-#endif	/* of #if NUM_ROUTE_ENTRY > 0 */
-
-#endif	/* of #if defined(SUPPORT_INET4) */
+#endif	/* of #if defined(DHCP6_CLI_CFG) || defined(DHCP4_CLI_CFG) */
 
 #if defined(SUPPORT_INET6)
@@ -1124,5 +1612,5 @@
 			while (ptitle -- > 0)
 				cons_printf(portid, " ");
-			cons_printf(portid, " %I\n",  &dr[rix].addr);
+			cons_printf(portid, " %lI\n",  &dr[rix].addr);
 			}
 		}
@@ -1188,5 +1676,5 @@
 			while (rtitle -- > 0)
 				cons_printf(portid, " ");
-			cons_printf(portid, "%4d %I\n",  pr[pix].prefix_len, &pr[pix].prefix);
+			cons_printf(portid, "%4d %lI\n",  pr[pix].prefix_len, &pr[pix].prefix);
 			}
 		}
@@ -1198,12 +1686,12 @@
 #endif	/* of #if NUM_ND6_DEF_RTR_ENTRY > 0 */
 
-#if NUM_ROUTE_ENTRY > 0
+#if NUM_IN6_ROUTE_ENTRY > 0
 
 /*
- *  routing_table_status -- 経路表の出力
+ *  routing6_table_status -- 経路表（IPv6）の出力
  */
 
 static void
-routing_table_status (ID portid, char *line)
+routing6_table_status (ID portid, char *line)
 {
 	SYSTIM	now;
@@ -1212,13 +1700,13 @@
 	WAI_NET_CONS_PRINTF();
 	cons_printf(portid,
-	            "Routing Table Status\n"
+	            "\nRouting Table Status (IPv6)\n"
 	            "IX Expire flags Prefix Target                         Gateway\n");
 
-	for (ix = 0; ix < NUM_STATIC_ROUTE_ENTRY; ix ++) {
-		cons_printf(portid, "%2d STATIC     - %6d %30I %I\n",
+	for (ix = 0; ix < NUM_IN6_STATIC_ROUTE_ENTRY; ix ++) {
+		cons_printf(portid, "%2d STATIC     - %6d %30lI %lI\n",
 		            ix,
-		             routing_tbl[ix].prefix_len,
-		            &routing_tbl[ix].target,
-		            &routing_tbl[ix].gateway);
+		             routing6_tbl[ix].prefix_len,
+		            &routing6_tbl[ix].target,
+		            &routing6_tbl[ix].gateway);
 		            
 		}
@@ -1228,14 +1716,14 @@
 	now /= SYSTIM_HZ;
 
-	for ( ; ix < NUM_ROUTE_ENTRY; ix ++)
-		if (routing_tbl[ix].flags & IN_RTF_DEFINED)
-			cons_printf(portid, "%2d %6d    %02x %6d %30I %I\n",
+	for ( ; ix < NUM_IN6_ROUTE_ENTRY; ix ++)
+		if (routing6_tbl[ix].flags & IN_RTF_DEFINED)
+			cons_printf(portid, "%2d %6d    %02x %6d %30lI %lI\n",
 			            ix,
-			            (uint32_t)(routing_tbl[ix].expire - now) <= 0
-			                ? 0 : routing_tbl[ix].expire - now,
-			             routing_tbl[ix].flags,
-			             routing_tbl[ix].prefix_len,
-			            &routing_tbl[ix].target,
-			            &routing_tbl[ix].gateway);
+			            (uint32_t)(routing6_tbl[ix].expire - now) <= 0
+			                ? 0 : routing6_tbl[ix].expire - now,
+			             routing6_tbl[ix].flags,
+			             routing6_tbl[ix].prefix_len,
+			            &routing6_tbl[ix].target,
+			            &routing6_tbl[ix].gateway);
 
 	SIG_NET_CONS_PRINTF();
@@ -1243,12 +1731,67 @@
 	}
 
-#endif	/* of #if NUM_ROUTE_ENTRY > 0 */
+#endif	/* of #if NUM_IN6_ROUTE_ENTRY > 0 */
 
 #endif	/* of #if defined(SUPPORT_INET6) */
 
-#if NUM_ROUTE_ENTRY > 0
+#if defined(SUPPORT_INET4)
+
+#if NUM_IN4_ROUTE_ENTRY > 0
 
 /*
- *  routing_status -- ルーティング情報
+ *  routing4_table_status -- 経路表（IPv4）の出力
+ */
+
+static void
+routing4_table_status (ID portid, char *line)
+{
+	int_t	ix;
+
+	if ('0' <= *(line = skip_blanks(line)) && *line <= '9') {
+		T_IN4_ADDR	target, mask, gateway;
+
+		ix = atoi(line);
+		while ('0' <= *line && *line <= '9')
+			line ++;
+		line = get_ipv4addr(&target,  skip_blanks(line));
+		line = get_ipv4addr(&mask,    skip_blanks(line));
+		       get_ipv4addr(&gateway, skip_blanks(line));
+		in4_add_route(ix, target, mask, gateway);
+		}
+
+	WAI_NET_CONS_PRINTF();
+	cons_printf(portid,
+	            "\nRouting Table Status (IPv4)\n"
+	            "IX Target          Mask            Gateway         Expire\n");
+
+	for (ix = 0; ix < NUM_IN4_ROUTE_ENTRY; ix ++) {
+		if ((routing4_tbl[ix].flags & IN_RTF_DEFINED) == 0)
+			;
+		else if ((routing4_tbl[ix].flags & IN_RTF_REDIRECT) != 0)
+			cons_printf(portid, "%2d %15hI %15hI %15hI %4d\n",
+			            ix,
+			            &routing4_tbl[ix].target,
+			            &routing4_tbl[ix].mask,
+			            &routing4_tbl[ix].gateway,
+			            &routing4_tbl[ix].expire);
+		else
+			cons_printf(portid, "%2d %15hI %15hI %hI\n",
+			            ix,
+			            &routing4_tbl[ix].target,
+			            &routing4_tbl[ix].mask,
+			            &routing4_tbl[ix].gateway);
+		            
+		}
+
+	SIG_NET_CONS_PRINTF();
+	FLUSH_SND_BUFF();
+	}
+
+#endif	/* of #if NUM_IN4_ROUTE_ENTRY > 0 */
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+/*
+ *  routing_status -- 経路情報
  */
 
@@ -1258,7 +1801,5 @@
 	switch (*line) {
 
-#if defined(SUPPORT_INET6)
-
-#if NUM_ND6_DEF_RTR_ENTRY > 0
+#if defined(SUPPORT_INET6) && NUM_ND6_DEF_RTR_ENTRY > 0
 
 	case 'l':		/* ディフォルトルータ・リスト情報 */
@@ -1270,24 +1811,28 @@
 		break;
 
-#endif	/* of #if NUM_ND6_DEF_RTR_ENTRY > 0 */
-
-#endif	/* of #if defined(SUPPORT_INET6) */
-
-	default:		/* ルーティング表情報 */
-		routing_table_status(portid, line);
+#endif	/* #if defined(SUPPORT_INET6) && NUM_ND6_DEF_RTR_ENTRY > 0 */
+
+	default:
+
+		/* 経路表情報 */
+
+#if defined(SUPPORT_INET6) && NUM_IN6_ROUTE_ENTRY > 0
+		routing6_table_status(portid, line);
+#endif
+
+#if defined(SUPPORT_INET4) && NUM_IN4_ROUTE_ENTRY > 0
+		routing4_table_status(portid, line);
+#endif
+
 		break;
-
-		break;
-		}
-	}
-
-#endif	/* of #if NUM_ROUTE_ENTRY > 0 */
+		}
+	}
 
 /*
- *  network_status -- ネットワークの状態の出力
- */
-
-static void
-network_status (ID portid, char *line)
+ *  dbg_cons_network_status -- ネットワークの状態の出力
+ */
+
+void
+dbg_cons_network_status (ID portid, char *line)
 {
 	switch (*line) {
@@ -1296,5 +1841,12 @@
 
 	case 'a':		/* IF アドレス情報 */
-		ifa_status(portid, line + 1);
+
+#if defined(SUPPORT_INET6)
+		ifa6_status(portid, line + 1);
+#endif
+#if defined(SUPPORT_INET4)
+		ifa4_status(portid, line + 1);
+#endif
+
 		break;
 
@@ -1313,11 +1865,18 @@
 #endif	/* of #if NET_COUNT_ENABLE */
 
-#if NUM_ROUTE_ENTRY > 0
-
-	case 'r':		/* ルーティング情報 */
+	case 'r':		/* 経路情報 */
 		routing_status(portid, line + 1);
 		break;
 
-#endif	/* of #if NUM_ROUTE_ENTRY > 0 */
+#ifdef USE_RESOLVER
+
+	case 's':		/* name lookup */
+		if (*(line = skip_blanks(line + 1)) == '\0')
+			dns_info(portid);
+		else
+			name_lookup(portid, line);
+		break;
+
+#endif	 /* of #ifdef USE_RESOLVER */
 
 #ifdef SUPPORT_TCP
@@ -1338,5 +1897,5 @@
 
 	default:
-		cons_printf(portid, "no such command: '%c%c'\n", *(line - 1), *line);
+		cons_printf(portid, "no such command: '%c%c'.\n", *(line - 1), *line);
 		SIG_NET_CONS_PRINTF();
 		FLUSH_SND_BUFF();
@@ -1345,64 +1904,35 @@
 	}
 
-#if defined(SUPPORT_INET4)
-
 /*
- *  ifconfig -- ネットワークインタフェースの構成情報
- */
-
-static void
-ifconfig (ID portid, char *line)
-{
-	T_IFNET		*ifp = IF_GET_IFNET();
-	T_IN4_ADDR	bc;
-
+ *  dbg_cons_ifconfig -- ネットワークインタフェースの構成情報
+ */
+
+void
+dbg_cons_ifconfig (ID portid, char *line)
+{
 #ifdef SUPPORT_ETHER
 
-	if (*(line = skip_blanks(line))) {
-		T_IN4_ADDR	addr, mask;
-
-		GET_IPADDR(&mask, skip_blanks(GET_IPADDR(&addr, line)));
-		in4_add_ifaddr(addr, mask);
-		}
-
-#endif	/* of #ifdef SUPPORT_ETHER */
+	T_IF_SOFTC	*ic;
 
 	WAI_NET_CONS_PRINTF();
-	cons_printf(portid,
-	            "Network Interface Configurations\n");
-
-#ifdef SUPPORT_ETHER
-
-	cons_printf(portid,
-	            "ether: %M\n",
-	            IF_ETHER_NIC_GET_SOFTC()->ifaddr.lladdr);
-
-#endif	/* of #ifdef SUPPORT_ETHER */
-
-	bc = (ifp->in_ifaddr.addr & ifp->in_ifaddr.mask) | ~ifp->in_ifaddr.mask;
-	cons_printf(portid,
-	            "inet:  %I, mask: %I, broadcast: %I\n",
-	            &ifp->in_ifaddr.addr,
-	            &ifp->in_ifaddr.mask,
-	            &bc);
-
+	ic = IF_ETHER_NIC_GET_SOFTC();
+	cons_printf(portid, "ether: %M\n", ic->ifaddr.lladdr);
 	SIG_NET_CONS_PRINTF();
 	FLUSH_SND_BUFF();
-	}
-
-#endif	/* of #if defined(SUPPORT_INET4) */
-
-#if defined(SUPPORT_INET6)
+
+#endif	/* of #ifdef SUPPORT_ETHER */
+	}
+
+#if defined(NETAPP_IP6_CFG)
 
 /*
- *  ifconfig -- ネットワークインタフェースの構成情報
- */
-
-static void
-ifconfig (ID portid, char *line)
+ *  dbg_cons_ifconfig6 -- ネットワークインタフェース（IPv6）の構成情報
+ */
+
+void
+dbg_cons_ifconfig6 (ID portid, char *line)
 {
 #ifdef SUPPORT_ETHER
 
-	T_IF_SOFTC	*ic;
 	T_IFNET		*ifp = IF_GET_IFNET();
 	int_t		ix;
@@ -1410,7 +1940,4 @@
 
 	WAI_NET_CONS_PRINTF();
-	ic = IF_ETHER_NIC_GET_SOFTC();
-	cons_printf(portid, "ether: %M\ninet6:\nIX   Expire Preffered RTR PFX Flags IP Address\n",
-	                    ic->ifaddr.lladdr);
 
 	/* expire と vltime の単位は [s]。*/
@@ -1418,28 +1945,33 @@
 	now /= SYSTIM_HZ;
 
+	cons_printf(portid, "IPv6:\nIX   Expire Preffered RTR PFX Flags IP Address\n");
 	for (ix = 0; ix < NUM_IN6_IFADDR_ENTRY; ix ++) {
-		if (ifp->in_ifaddrs[ix].flags & IN6_IFF_DEFINED) {
+		if (ifp->in6_ifaddrs[ix].flags & IN6_IFF_DEFINED) {
 			cons_printf(portid, " %d", ix);
-			if (ifp->in_ifaddrs[ix].lifetime.vltime == ND6_INFINITE_LIFETIME)
+			if (ifp->in6_ifaddrs[ix].lifetime.vltime == ND6_INFINITE_LIFETIME)
 				cons_printf(portid, "    INFIN     INFIN");
 			else
 				cons_printf(portid, " %8d %9d",
-				                    (uint32_t)(ifp->in_ifaddrs[ix].lifetime.expire - now) <= 0 
-				                        ? 0 : ifp->in_ifaddrs[ix].lifetime.expire - now,
-				                    (uint32_t)(ifp->in_ifaddrs[ix].lifetime.preferred - now) <= 0
-				                        ? 0 : ifp->in_ifaddrs[ix].lifetime.preferred - now);
-			if (ifp->in_ifaddrs[ix].router_index == IN6_RTR_IX_UNREACH)
+				                    (uint32_t)(ifp->in6_ifaddrs[ix].lifetime.expire - now) <= 0 
+				                         ? 0 : ifp->in6_ifaddrs[ix].lifetime.expire - now,
+				                    (uint32_t)(ifp->in6_ifaddrs[ix].lifetime.preferred - now) <= 0
+				                         ? 0 : ifp->in6_ifaddrs[ix].lifetime.preferred - now);
+			if (ifp->in6_ifaddrs[ix].router_index == IN6_RTR_IX_UNREACH)
 				cons_printf(portid, "   -");
 			else
-				cons_printf(portid, " %3d", ifp->in_ifaddrs[ix].router_index);
-			if (ifp->in_ifaddrs[ix].prefix_index == ND6_PREFIX_IX_INVALID)
+				cons_printf(portid, " %3d", ifp->in6_ifaddrs[ix].router_index);
+			if (ifp->in6_ifaddrs[ix].prefix_index == ND6_PREFIX_IX_INVALID)
 				cons_printf(portid, "   -");
 			else
-				cons_printf(portid, " %3d", ifp->in_ifaddrs[ix].prefix_index);
-			cons_printf(portid, "    %02x %I\n",
-			                    ifp->in_ifaddrs[ix].flags,
-			                    &ifp->in_ifaddrs[ix].addr);
-			}
-		}
+				cons_printf(portid, " %3d", ifp->in6_ifaddrs[ix].prefix_index);
+			cons_printf(portid, "    %02x %lI\n",
+			                     ifp->in6_ifaddrs[ix].flags,
+			                    &ifp->in6_ifaddrs[ix].addr);
+			}
+		}
+
+#ifdef DHCP6_CLI_CFG
+	dhcp6c_info(portid);
+#endif
 
 	SIG_NET_CONS_PRINTF();
@@ -1449,12 +1981,54 @@
 	}
 
-#endif	/* of #if defined(SUPPORT_INET6) */
+#endif	/* of #if defined(NETAPP_IP6_CFG) */
+
+#if defined(NETAPP_IP4_CFG)
 
 /*
- *  show_config -- コンフィギュレーション設定の表示
- */
-
-static void
-show_config (ID portid, char *line)
+ *  dbg_cons_ifconfig4 -- ネットワークインタフェース（IPv4）の構成情報
+ */
+
+void
+dbg_cons_ifconfig4 (ID portid, char *line)
+{
+	T_IFNET		*ifp = IF_GET_IFNET();
+	T_IN4_ADDR	bc;
+
+#ifdef SUPPORT_ETHER
+
+	if (*(line = skip_blanks(line))) {
+		T_IN4_ADDR	addr, mask;
+
+		get_ipv4addr(&mask, skip_blanks(get_ipv4addr(&addr, line)));
+		in4_add_ifaddr(addr, mask);
+		}
+
+#endif	/* of #ifdef SUPPORT_ETHER */
+
+	WAI_NET_CONS_PRINTF();
+
+	bc = (ifp->in4_ifaddr.addr & ifp->in4_ifaddr.mask) | ~ifp->in4_ifaddr.mask;
+	cons_printf(portid,
+	            "IPv4: %hI, mask: %hI, broadcast: %hI\n",
+	            &ifp->in4_ifaddr.addr,
+	            &ifp->in4_ifaddr.mask,
+	            &bc);
+
+#ifdef DHCP4_CLI_CFG
+	dhcp4c_info(portid);
+#endif
+
+	SIG_NET_CONS_PRINTF();
+	FLUSH_SND_BUFF();
+	}
+
+#endif	/* of #if defined(NETAPP_IP4_CFG) */
+
+/*
+ *  dbg_cons_show_config -- コンフィギュレーション設定の表示
+ */
+
+void
+dbg_cons_show_config (ID portid, char *line)
 {
 #if defined(SUPPORT_ETHER)
@@ -1464,22 +2038,43 @@
 #endif	/* of #if defined(SUPPORT_ETHER) */
 
-#if defined(DHCP_CFG)
-
 	cons_printf(portid, "DHCP:\n");
-
-	cons_printf(portid, "  DHCP_CFG: On\n");
-
-#endif	/* of #if define(DHCP_CFG) */
+	cons_printf(portid, "  DHCP6_CLI_CFG: ");
+
+#if defined(DHCP6_CLI_CFG)
+
+	cons_printf(portid, "On\n           Mode: ");
+
+#if DHCP6_CLI_CFG_MODE == DHCP6_CLI_CFG_STATELESS
+	cons_printf(portid, "STATELESS\n");
+#elif DHCP6_CLI_CFG_MODE == DHCP6_CLI_CFG_STATEFULL
+	cons_printf(portid, "STATEFULL\n");
+#endif
+
+#else	/* of #if define(DHCP6_CLI_CFG) */
+
+	cons_printf(portid, "Off\n");
+
+#endif	/* of #if define(DHCP6_CLI_CFG) */
+
+	cons_printf(portid, "  DHCP4_CLI_CFG: ");
+
+#if defined(DHCP4_CLI_CFG)
+	cons_printf(portid, "On\n");
+#else
+	cons_printf(portid, "Off\n");
+#endif
+
+	cons_printf(portid, "Resolver:\n");
+	cons_printf(portid, "  USE_RESOLVER: ");
+
+#if defined(USE_RESOLVER)
+	cons_printf(portid, "On\n");
+#else
+	cons_printf(portid, "Off\n");
+#endif
 
 #if defined(SUPPORT_TCP)
 
 	cons_printf(portid, "TCP:\n");
-
-	cons_printf(portid, "  TCP_CFG_PASSIVE_OPEN: ");
-#if defined(TCP_CFG_PASSIVE_OPEN)
-	cons_printf(portid, "On\n");
-#else
-	cons_printf(portid, "Off\n");
-#endif
 
 	cons_printf(portid, "  TCP_CFG_OPT_MSS:      ");
@@ -1553,16 +2148,23 @@
 #endif
 
+	cons_printf(portid, "  TCP_CFG_NON_BLOCKING_COMPAT14: ");
+#if defined(TCP_CFG_NON_BLOCKING_COMPAT14)
+	cons_printf(portid, "On\n");
+#else
+	cons_printf(portid, "Off\n");
+#endif
+
 	cons_printf(portid, "  TCP_CFG_EXTENTIONS:   ");
 #if defined(TCP_CFG_EXTENTIONS)
 #if defined(USE_TCP_EXTENTIONS)
 	cons_printf(portid, "Use\n");
-#if defined(SUPPORT_INET4)
-	cons_printf(portid, "  NUM_VRID_TCP_REPS:    %3d\n", NUM_VRID_TCP_REPS);
-	cons_printf(portid, "  NUM_VRID_TCP_CEPS:    %3d\n", NUM_VRID_TCP_CEPS);
-#endif	
 #if defined(SUPPORT_INET6)
 	cons_printf(portid, "  NUM_VRID_TCP6_REPS:   %3d\n", NUM_VRID_TCP6_REPS);
 	cons_printf(portid, "  NUM_VRID_TCP6_CEPS:   %3d\n", NUM_VRID_TCP6_CEPS);
-#endif	
+#endif
+#if defined(SUPPORT_INET4)
+	cons_printf(portid, "  NUM_VRID_TCP4_REPS:   %3d\n", NUM_VRID_TCP4_REPS);
+	cons_printf(portid, "  NUM_VRID_TCP4_CEPS:   %3d\n", NUM_VRID_TCP4_CEPS);
+#endif
 #else
 	cons_printf(portid, "On\n");
@@ -1589,5 +2191,5 @@
 #if defined(SUPPORT_INET4)
 	addr = TCP_CFG_TRACE_IPV4_RADDR;
-	cons_printf(portid, "                            TCP_CFG_TRACE_IPV4_RADDR: %I\n", &addr);
+	cons_printf(portid, "                            TCP_CFG_TRACE_IPV4_RADDR: %hI\n", &addr);
 #endif
 	cons_printf(portid, "                            TCP_CFG_TRACE_RPORTNO:    %d\n", TCP_CFG_TRACE_RPORTNO);
@@ -1633,4 +2235,11 @@
 #endif
 
+	cons_printf(portid, "  UDP_CFG_NON_BLOCKING_COMPAT14: ");
+#if defined(UDP_CFG_NON_BLOCKING_COMPAT14)
+	cons_printf(portid, "On\n");
+#else
+	cons_printf(portid, "Off\n");
+#endif
+
 	cons_printf(portid, "  UDP_CFG_EXTENTIONS:   ");
 #if defined(UDP_CFG_EXTENTIONS)
@@ -1640,5 +2249,5 @@
 	cons_printf(portid, "On\n");
 #endif
-	cons_printf(portid, "  NUM_VRID_UDP_CEPS:    %3d\n", NUM_VRID_UDP_CEPS);
+	cons_printf(portid, "  NUM_VRID_UDP4_CEPS:   %3d\n", NUM_VRID_UDP4_CEPS);
 	cons_printf(portid, "  NUM_VRID_UDP6_CEPS:   %3d\n", NUM_VRID_UDP6_CEPS);
 #else
@@ -1667,44 +2276,24 @@
 #endif
 
+#if defined(NUM_REDIRECT_ROUTE_ENTRY)
 #if NUM_REDIRECT_ROUTE_ENTRY > 0
 	cons_printf(portid, "  TMO_IN_REDIRECT: %4d[s]\n", TMO_IN_REDIRECT / NET_TIMER_HZ);
 #endif
-
-#if defined(SUPPORT_INET4)
-
-	cons_printf(portid, "IPv4:\n");
-
-	cons_printf(portid, "  IP4_CFG_FRAGMENT: ");
-
-#if defined(IP4_CFG_FRAGMENT)
+#endif	/* of #if defined(NUM_REDIRECT_ROUTE_ENTRY) */
+
+#if defined(SUPPORT_INET6)
+
+	cons_printf(portid, "IPv6:\n");
+
+	cons_printf(portid, "  IP6_IPV4_MAPPED_ADDR:   ");
+#if defined(IP6_CFG_IPV4_MAPPED_ADDR)
 	cons_printf(portid, "On\n");
-	cons_printf(portid, "    NUM_IP4_FRAG_QUEUE:       %4d\n", NUM_IP4_FRAG_QUEUE);
-	cons_printf(portid, "    IP4_CFG_FRAG_REASSM_SIZE: %4d\n", IP4_CFG_FRAG_REASSM_SIZE);
 #else
 	cons_printf(portid, "Off\n");
-#endif	/* of #if defined(IP4_CFG_FRAGMENT) */
-
-#if defined(SUPPORT_ETHER)
-	addr = IPV4_ADDR_LOCAL;
-	cons_printf(portid, "  IPV4_ADDR_LOCAL:      %I\n", &addr);
-	addr = IPV4_ADDR_LOCAL_MASK;
-	cons_printf(portid, "  IPV4_ADDR_LOCAL_MASK: %I\n", &addr);
-	addr = IPV4_ADDR_DEFAULT_GW;
-	cons_printf(portid, "  IPV4_ADDR_DEFAULT_GW: %I\n", &addr);
-#endif	/* of #if defined(SUPPORT_ETHER) */
+#endif
 
 	cons_printf(portid, "  Routing Table:\n");
-	cons_printf(portid, "    NUM_STATIC_ROUTE_ENTRY:   %d\n", NUM_STATIC_ROUTE_ENTRY);
-	cons_printf(portid, "    NUM_REDIRECT_ROUTE_ENTRY: %d\n", NUM_REDIRECT_ROUTE_ENTRY);
-
-#endif	/* of #if defined(SUPPORT_INET4) */
-
-#if defined(SUPPORT_INET6)
-
-	cons_printf(portid, "IPv6:\n");
-
-	cons_printf(portid, "  Routing Table:\n");
-	cons_printf(portid, "    NUM_STATIC_ROUTE_ENTRY:   %d\n", NUM_STATIC_ROUTE_ENTRY);
-	cons_printf(portid, "    NUM_REDIRECT_ROUTE_ENTRY: %d\n", NUM_REDIRECT_ROUTE_ENTRY);
+	cons_printf(portid, "    NUM_IN6_STATIC_ROUTE_ENTRY:   %d\n", NUM_IN6_STATIC_ROUTE_ENTRY);
+	cons_printf(portid, "    NUM_IN6_REDIRECT_ROUTE_ENTRY: %d\n", NUM_IN6_REDIRECT_ROUTE_ENTRY);
 
 	cons_printf(portid, "ND:\n");
@@ -1730,4 +2319,33 @@
 #endif	/* of #if defined(SUPPORT_INET6) */
 
+#if defined(SUPPORT_INET4)
+
+	cons_printf(portid, "IPv4:\n");
+
+	cons_printf(portid, "  IP4_CFG_FRAGMENT: ");
+
+#if defined(IP4_CFG_FRAGMENT)
+	cons_printf(portid, "On\n");
+	cons_printf(portid, "    NUM_IP4_FRAG_QUEUE:       %4d\n", NUM_IP4_FRAG_QUEUE);
+	cons_printf(portid, "    IP4_CFG_FRAG_REASSM_SIZE: %4d\n", IP4_CFG_FRAG_REASSM_SIZE);
+#else
+	cons_printf(portid, "Off\n");
+#endif	/* of #if defined(IP4_CFG_FRAGMENT) */
+
+#if defined(SUPPORT_ETHER)
+	addr = IPV4_ADDR_LOCAL;
+	cons_printf(portid, "  IPV4_ADDR_LOCAL:      %hI\n", &addr);
+	addr = IPV4_ADDR_LOCAL_MASK;
+	cons_printf(portid, "  IPV4_ADDR_LOCAL_MASK: %hI\n", &addr);
+	addr = IPV4_ADDR_DEFAULT_GW;
+	cons_printf(portid, "  IPV4_ADDR_DEFAULT_GW: %hI\n", &addr);
+#endif	/* of #if defined(SUPPORT_ETHER) */
+
+	cons_printf(portid, "  Routing Table:\n");
+	cons_printf(portid, "    NUM_IN4_STATIC_ROUTE_ENTRY:   %d\n", NUM_IN4_STATIC_ROUTE_ENTRY);
+	cons_printf(portid, "    NUM_IN4_REDIRECT_ROUTE_ENTRY: %d\n", NUM_IN4_REDIRECT_ROUTE_ENTRY);
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
 #if defined(SUPPORT_INET4) && defined(SUPPORT_ETHER)
 
@@ -1771,4 +2389,11 @@
 #endif
 
+	cons_printf(portid, "  ETHER_COLLECT_ADDR:      ");
+#if defined(ETHER_COLLECT_ADDR)
+	cons_printf(portid, "On\n");
+#else
+	cons_printf(portid, "Off\n");
+#endif
+
 #endif	/* of #if defined(SUPPORT_ETHER) */
 
@@ -1854,13 +2479,117 @@
 	}
 
+#ifdef USE_PING
+
+/*
+ *  ping コマンド
+ */
+
+void
+dbg_cons_ping_comd (ID portid, char *line)
+{
+	int_t	tmo, size;
+	char	apip = DEFAULT_API_PROTO;
+
+#if defined(SUPPORT_INET6)
+	T_IN6_ADDR	addr;
+#if defined(SUPPORT_INET4)
+	T_IN4_ADDR	addr4;
+#endif
+#else
+	T_IN4_ADDR	addr;
+#endif
+
+#if defined(PING_CFG_I6RLP)
+
+	static const char i6rlp_pmtu_str1[] = " FF1E::1:2 1 1452";
+	static const char i6rlp_pmtu_str2[] = " FF1E::1:2 1 1352";
+	static const char i6rlp_pmtu_str3[] = " fe80::0200:00ff:fe00:0100 1 2";
+
+	if      (apip == '1')
+		strcpy(line, i6rlp_pmtu_str1);
+	else if (apip == '2')
+		strcpy(line, i6rlp_pmtu_str2);
+	else if (apip == '3')
+		strcpy(line, i6rlp_pmtu_str3);
+
+#endif	/* of #ifdef PING_CFG_I6RLP */
+
+#if defined(SUPPORT_INET6) && defined(SUPPORT_INET4)
+
+	if ('0' <= *line && *line <= '9') {
+		if (*line == '6')
+			apip = API_PROTO_IPV6;
+		if (*line == '4')
+			apip = API_PROTO_IPV4;
+		line ++;
+		}
+
+#endif	/* of #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4) */
+
+	if ((line = lookup_ipaddr(&addr, line, apip)) == NULL) {
+		syslog(LOG_NOTICE, "[PING] unknown host.");
+		return;
+		}
+
+	line = skip_blanks(line);
+	if ('0' <= *line && *line <= '9')
+		line = get_int(&tmo, line);
+	else
+		tmo = 3;
+
+	line = skip_blanks(line);
+	if ('0' <= *line && *line <= '9')
+		line = get_int(&size, line);
+	else
+		size = 64;
+
+#if defined(SUPPORT_INET6)
+
+#if defined(SUPPORT_INET4)
+
+	if (apip == API_PROTO_IPV6) {
+		syslog(LOG_NOTICE, "[PING6] size: %d, tmo: %d, host: %s", size, tmo, ipv62str(NULL, &addr));
+		ping6(&addr, (uint_t)tmo, (uint_t)size);
+		}
+	else {
+		addr4 = ntohl(addr.s6_addr32[3]);
+		syslog(LOG_NOTICE, "[PING4] size: %d, tmo: %d, host: %s", size, tmo, ip2str(NULL, &addr4));
+		ping4(&addr4, (uint_t)tmo, (uint_t)size);
+		}
+
+#else /* of #if defined(SUPPORT_INET4) */
+
+	syslog(LOG_NOTICE, "[PING6] size: %d, tmo: %d, host: %s", size, tmo, ipv62str(NULL, &addr));
+	ping6(&addr, (uint_t)tmo, (uint_t)size);
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+#else	/* of #if defined(SUPPORT_INET6) */
+
+
+	syslog(LOG_NOTICE, "[PING4] size: %d, tmo: %d, host: %s", size, tmo, ip2str(NULL, &addr));
+	ping4(&addr, (uint_t)tmo, (uint_t)size);
+
+#endif	/* of #if defined(SUPPORT_INET6) */
+
+	}
+
+#endif	/* of #ifdef USE_PING */
+
+#ifdef USE_DBG_CONS_PARSER
+
 /*
  *  デバッグコマンド解析
  */
 
-static void
+void
 dbg_parse (ID portid, char *line)
 {
 	int_t	cepid;
-	ER	error;
+	ER	error = E_OK;
+
+#if defined(SUPPORT_UDP) && defined(SUPPORT_INET6) && defined(SUPPORT_INET4)
+	int_t	udp_cep_ipproto;
+#endif
 
 	switch (*line) {
@@ -1870,5 +2599,5 @@
 
 		case 'f':	/* show configurations */
-			show_config(portid, line + 1);
+			dbg_cons_show_config(portid, line + 1);
 			break;
 
@@ -1880,5 +2609,5 @@
 				line ++;
 			if ((error = tcp_can_cep((ID)cepid, atoi(skip_blanks(line)))) != E_OK && error != E_RLWAI) {
-				cons_printf(portid, "[TCP CAN CEP] error: %s\n", itron_strerror(error));
+				cons_printf(portid, "[TCP CAN CEP] error: %s.\n", itron_strerror(error));
 				SIG_NET_CONS_PRINTF();
 				FLUSH_SND_BUFF();
@@ -1891,12 +2620,78 @@
 
 		case 'u':	/* cancel UDP */
+
+#if defined(SUPPORT_INET6)
+
+#if defined(SUPPORT_INET4)
+
+			udp_cep_ipproto = (*(line + 2) == '4' ? API_PROTO_IPV4 : API_PROTO_IPV6);
+			cepid = atoi(line = skip_blanks(line + 3));
+			while ('0' <= *line && *line <= '9')
+				line ++;
+
+#if TNUM_UDP6_CEPID > 0
+
+			if (udp_cep_ipproto == API_PROTO_IPV6) {
+				if ((error = udp_can_cep((ID)cepid, atoi(skip_blanks(line)))) != E_OK && error != E_RLWAI) {
+					cons_printf(portid, "[UDP CAN CEP] error: %s.\n", itron_strerror(error));
+					SIG_NET_CONS_PRINTF();
+					FLUSH_SND_BUFF();
+					}
+				}
+
+#endif	/* of #if TNUM_UDP6_CEPID > 0 */
+
+#if TNUM_UDP4_CEPID > 0
+
+			if (udp_cep_ipproto == API_PROTO_IPV4) {
+				if ((error = udp_can_cep((ID)cepid, atoi(skip_blanks(line)))) != E_OK && error != E_RLWAI) {
+					cons_printf(portid, "[UDP CAN CEP] error: %s.\n", itron_strerror(error));
+					SIG_NET_CONS_PRINTF();
+					FLUSH_SND_BUFF();
+					}
+				}
+
+#endif	/* of #if TNUM_UDP4_CEPID > 0 */
+
+#else	/* of #if defined(SUPPORT_INET4) */
+
+#if TNUM_UDP6_CEPID > 0
+
 			cepid = atoi(line = skip_blanks(line + 2));
 			while ('0' <= *line && *line <= '9')
 				line ++;
+
 			if ((error = udp_can_cep((ID)cepid, atoi(skip_blanks(line)))) != E_OK && error != E_RLWAI) {
-				cons_printf(portid, "[UDP CAN CEP] error: %s\n", itron_strerror(error));
+				cons_printf(portid, "[UDP CAN CEP] error: %s.\n", itron_strerror(error));
 				SIG_NET_CONS_PRINTF();
 				FLUSH_SND_BUFF();
 				}
+
+#endif	/* of #if TNUM_UDP6_CEPID > 0 */
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+#else	/* of #if defined(SUPPORT_INET6) */
+
+#if defined(SUPPORT_INET4)
+
+#if TNUM_UDP4_CEPID > 0
+
+			cepid = atoi(line = skip_blanks(line + 2));
+			while ('0' <= *line && *line <= '9')
+				line ++;
+
+			if ((error = udp_can_cep((ID)cepid, atoi(skip_blanks(line)))) != E_OK && error != E_RLWAI) {
+				cons_printf(portid, "[UDP CAN CEP] error: %s.\n", itron_strerror(error));
+				SIG_NET_CONS_PRINTF();
+				FLUSH_SND_BUFF();
+				}
+
+#endif	/* of #if TNUM_UDP4_CEPID > 0 */
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+
+#endif	/* of #if defined(SUPPORT_INET6) */
+
 			break;
 
@@ -1906,6 +2701,4 @@
 
 		break;
-
-#if defined(USE_UDP_DISCARD_CLI) || defined(USE_TCP_DISCARD_CLI) || defined(SUPPORT_PPP) || defined(SUPPORT_ETHER) && defined(USE_NET_CONS)
 
 	case 'd':	/* discard client */
@@ -1929,4 +2722,12 @@
 #endif	/* of #if defined(SUPPORT_ETHER) && defined(USE_NET_CONS) */
 
+#if defined(DHCP6_CLI_CFG) || defined(DHCP4_CLI_CFG)
+
+		case 'h':		/* DHCP client */
+			dhcpc(portid, line + 2);
+			break;
+
+#endif	/* of #if defined(DHCP6_CLI_CFG) || defined(DHCP4_CLI_CFG) */
+
 #ifdef USE_TCP_DISCARD_CLI
 
@@ -1941,5 +2742,5 @@
 			default:
 				if ((error = psnd_dtq(DTQ_TCP_DISCARD_CLI, (intptr_t)line)) != E_OK) {
-					cons_printf(portid, "[TCP DISCARD CLI] error: %s\n",
+					cons_printf(portid, "[TCP DISCARD CLI] error: %s.\n",
 					       itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
@@ -1965,5 +2766,5 @@
 			default:
 				if ((error = psnd_dtq(DTQ_UDP_DISCARD_CLI, (intptr_t)line)) != E_OK) {
-					cons_printf(portid, "[UDP DISCARD CLI] error: %s\n",
+					cons_printf(portid, "[UDP DISCARD CLI] error: %s.\n",
 					       itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
@@ -1981,7 +2782,5 @@
 		break;
 
-#endif	/* of #if defined(USE_UDP_DISCARD_CLI) || defined(USE_TCP_DISCARD_CLI) || defined(SUPPORT_PPP) || defined(SUPPORT_ETHER) && defined(USE_NET_CONS) */
-
-#if defined(USE_UDP_ECHO_CLI) || defined(USE_TCP_ECHO_CLI)
+#if defined(USE_TCP_ECHO_CLI) || defined(USE_UDP_ECHO_CLI)
 
 	case 'e':	/* echo client */
@@ -2000,5 +2799,5 @@
 			default:
 				if ((error = psnd_dtq(DTQ_TCP_ECHO_CLI_SND, (intptr_t)line)) != E_OK) {
-					cons_printf(portid, "[TCP ECHO CLI] error: %s\n", itron_strerror(error));
+					cons_printf(portid, "[TCP ECHO CLI] error: %s.\n", itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
 					FLUSH_SND_BUFF();
@@ -2011,20 +2810,79 @@
 #endif	/* of #ifdef USE_TCP_ECHO_CLI */
 
-#ifdef USE_UDP_ECHO_CLI
+#if defined(USE_UDP_ECHO_CLI)
 
 		case 'u':	/* UDP echo client */
-			line += 2;
-			switch (*line) {
+			switch (*(line + 2)) {
 
 			case 's':	/* cancel UDP echo */
-				udp_echo_cli_valid = false;
+
+#if defined(USE_UDP6_ECHO_CLI_TSK)
+
+#if defined(USE_UDP4_ECHO_CLI_TSK)
+
+				if (*(line + 3) == '4')
+					udp4_echo_cli_valid = false;
+				else
+					udp6_echo_cli_valid = false;
+
+#else	/* of #if defined(USE_UDP4_ECHO_CLI_TSK) */
+
+				udp6_echo_cli_valid = false;
+
+#endif	/* of #if defined(USE_UDP4_ECHO_CLI_TSK) */
+
+#else	/* of #if defined(USE_UDP6_ECHO_CLI_TSK) */
+
+#if defined(USE_UDP4_CLI_TSK)
+
+				udp4_echo_cli_valid = false;
+
+#endif	/* of #if defined(USE_UDP4_CLI_TSK) */
+
+#endif	/* of #if defined(USE_UDP6_ECHO_CLI_TSK) */
+
+
 				break;
 
 			default:
-				if ((error = psnd_dtq(DTQ_UDP_ECHO_CLI, (intptr_t)line)) != E_OK) {
-					cons_printf(portid, "[UDP ECHO CLI] error: %s\n", itron_strerror(error));
+
+				line += 2;
+
+#if defined(USE_UDP6_ECHO_CLI_TSK)
+
+#if defined(USE_UDP4_ECHO_CLI_TSK)
+
+				if (*line == '4') {
+					line ++;
+					error = psnd_dtq(DTQ_UDP4_ECHO_CLI, (intptr_t)line);
+					}
+				else {
+					if (*line && *line != ' ')
+						line ++;
+					error = psnd_dtq(DTQ_UDP6_ECHO_CLI, (intptr_t)line);
+					}
+
+#else	/* of #if defined(USE_UDP4_ECHO_CLI_TSK) */
+
+				if (*line && *line != ' ')
+					line ++;
+				error = psnd_dtq(DTQ_UDP6_ECHO_CLI, (intptr_t)line);
+
+#endif	/* of #if defined(USE_UDP4_ECHO_CLI_TSK) */
+
+#else	/* of #if defined(USE_UDP6_ECHO_CLI_TSK) */
+
+				if (*line && *line != ' ')
+					line ++;
+				error = psnd_dtq(DTQ_UDP4_ECHO_CLI, (intptr_t)line);
+
+#endif	/* of #if defined(USE_UDP6_ECHO_CLI_TSK) */
+
+				if (error != E_OK) {
+					cons_printf(portid, "[UDP ECHO CLI] error: %s.\n", itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
 					FLUSH_SND_BUFF();
 					}
+
 				break;
 
@@ -2032,5 +2890,5 @@
 			break;
 
-#endif	/* of #ifdef USE_UDP_ECHO_CLI */
+#endif	/* of #if defined(USE_UDP_ECHO_CLI) */
 
 			}
@@ -2038,10 +2896,21 @@
 		break;
 
-#endif	/* of #if defined(USE_UDP_ECHO_CLI) || defined(USE_TCP_ECHO_CLI) */
+#endif	/* of #if defined(USE_TCP_ECHO_CLI) || defined(USE_UDP_ECHO_CLI) */
 
 	case 'i':
 
-		if (*(line + 1) == 'f')
-			ifconfig(portid, line + 2);
+		if (*(line + 1) == 'f') {
+
+			dbg_cons_ifconfig (portid, line + 2);
+
+#if defined(NETAPP_IP6_CFG)
+			dbg_cons_ifconfig6(portid, line + 2);
+#endif
+
+#if defined(NETAPP_IP4_CFG)
+			dbg_cons_ifconfig4(portid, line + 2);
+#endif
+
+			}
 
 #ifdef SUPPORT_PPP
@@ -2064,5 +2933,5 @@
 
 	case 'n':		/* network status */
-		network_status(portid, line + 1);
+		dbg_cons_network_status(portid, line + 1);
 		break;
 
@@ -2070,40 +2939,10 @@
 
 		if (*(line + 1) == 's')
-			task_status(portid, skip_blanks(line + 2));
+			dbg_cons_task_status(portid, skip_blanks(line + 2));
 
 #ifdef USE_PING
 
-		else {
-			int_t		tmo, size;
-			T_IN_ADDR	addr;
-
-#ifdef PING_CFG_I6RLP
-			static const char i6rlp_pmtu_str1[] = " FF1E::1:2 1 1452";
-			static const char i6rlp_pmtu_str2[] = " FF1E::1:2 1 1352";
-			static const char i6rlp_pmtu_str3[] = " fe80::0200:00ff:fe00:0100 1 2";
-
-			if      (*(line + 1) == '1')
-				strcpy(line + 1, i6rlp_pmtu_str1);
-			else if (*(line + 1) == '2')
-				strcpy(line + 1, i6rlp_pmtu_str2);
-			else if (*(line + 1) == '3')
-				strcpy(line + 1, i6rlp_pmtu_str3);
-
-#endif	/* of #ifdef PING_CFG_I6RLP */
-
-			line = skip_blanks(GET_IPADDR(&addr, skip_blanks(line + 1)));
-			if ('0' <= *line && *line <= '9')
-				line = get_int(&tmo, line);
-			else
-				tmo = 3;
-
-			line = skip_blanks(line + 1);
-			if ('0' <= *line && *line <= '9')
-				line = get_int(&size, line);
-			else
-				size = 64;
-
-			PING(&addr, (uint_t)tmo, (uint_t)size);
-			}
+		else
+			dbg_cons_ping_comd(portid, line + 1);
 
 #endif	/* of #ifdef USE_PING */
@@ -2113,5 +2952,5 @@
 	case 'r':		/* release wait task */
 		if ((error = rel_wai(atoi(skip_blanks(line + 1)))) != E_OK) {
-			cons_printf(portid, "[REL WAI TSK] error: %s\n", itron_strerror(error));
+			cons_printf(portid, "[REL WAI TSK] error: %s.\n", itron_strerror(error));
 			SIG_NET_CONS_PRINTF();
 			FLUSH_SND_BUFF();
@@ -2125,6 +2964,10 @@
 
 		case 't':		/* TCP REP */
-			if ((error = tcp_del_rep(atoi(skip_blanks(line + 2)))) != E_OK) {
-				cons_printf(portid, "[TCP DEL REP] error: %s\n", itron_strerror(error));
+	
+			error = tcp_del_rep(atoi(skip_blanks(line + 2)));
+			if (error != E_OK) {
+				cons_printf(portid, "[TCP DEL REP] ID: %d, error: %s.\n", 
+				                    atoi(skip_blanks(line + 2)),
+				                    itron_strerror(error));
 				SIG_NET_CONS_PRINTF();
 				FLUSH_SND_BUFF();
@@ -2137,9 +2980,48 @@
 
 		case 'u':		/* UDP CEP */
-			if ((error = udp_del_cep(atoi(skip_blanks(line + 2)))) != E_OK) {
-				cons_printf(portid, "[UDP DEL CEP] error: %s\n", itron_strerror(error));
+
+#if defined(USE_UDP6_ECHO_SRV_TSK)
+
+#if defined(USE_UDP4_ECHO_SRV_TSK)
+
+			if (*(line + 2) == '4') {
+				if ((error = udp_del_cep(atoi(skip_blanks(line + 3)))) != E_OK) {
+					cons_printf(portid, "[UDP DEL CEP] error: %s.\n", itron_strerror(error));
+					SIG_NET_CONS_PRINTF();
+					FLUSH_SND_BUFF();
+					}
+				}
+			else {
+				if ((error = udp6_del_cep(atoi(skip_blanks(line + 2)))) != E_OK) {
+					cons_printf(portid, "[UDP DEL CEP] error: %s.\n", itron_strerror(error));
+					SIG_NET_CONS_PRINTF();
+					FLUSH_SND_BUFF();
+					}
+				}
+
+#else	/* of #if defined(USE_UDP4_ECHO_SRV_TSK) */
+
+			if ((error = udp6_del_cep(atoi(skip_blanks(line + 2)))) != E_OK) {
+				cons_printf(portid, "[UDP DEL CEP] error: %s.\n", itron_strerror(error));
 				SIG_NET_CONS_PRINTF();
 				FLUSH_SND_BUFF();
 				}
+
+#endif	/* of #if defined(USE_UDP4_ECHO_SRV_TSK) */
+
+#else	/* of #if defined(USE_UDP6_ECHO_SRV_TSK) */
+
+#if defined(USE_UDP4_ECHO_SRV_TSK)
+
+			if ((error = udp_del_cep(atoi(skip_blanks(line + 2)))) != E_OK) {
+				cons_printf(portid, "[UDP DEL CEP] error: %s.\n", itron_strerror(error));
+				SIG_NET_CONS_PRINTF();
+				FLUSH_SND_BUFF();
+				}
+
+#endif	/* of #if defined(USE_UDP4_ECHO_SRV_TSK) */
+
+#endif	/* of #if defined(USE_UDP6_ECHO_SRV_TSK) */
+
 			break;
 
@@ -2163,5 +3045,5 @@
 			case 'd':		/* tcp discard server */
 				if ((error = wup_tsk(TCP_DISCARD_SRV_TASK)) != E_OK) {
-					cons_printf(portid, "[WUP TCP DISCARD SRV] error: %s\n", itron_strerror(error));
+					//cons_printf(portid, "[WUP TCP DISCARD SRV] error: %s.\n", itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
 					FLUSH_SND_BUFF();
@@ -2170,18 +3052,28 @@
 #endif	/* of #ifdef USE_TCP_DISCARD_SRV */
 
-#if defined(USE_TCP_ECHO_SRV1) || defined(USE_TCP_ECHO_SRV2)
+#if defined(USE_TCP_ECHO_SRV1)
 			case 'e':		/* tcp echo server */
-				if ((error = wup_tsk(TCP_ECHO_SRV_TASK)) != E_OK) {
-					cons_printf(portid, "[WUP UDP DISCARD SRV] error: %s\n", itron_strerror(error));
+				if ((error = wakeup_tcp_echo_srv((*(line + 3) == '4' ? API_PROTO_IPV4 : API_PROTO_IPV6))) != E_OK) {
+					//cons_printf(portid, "[WUP TCP ECHO SRV] error: %s.\n", itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
 					FLUSH_SND_BUFF();
 					}
 				break;
-#endif	/* of #if defined(USE_TCP_ECHO_SRV1) || defined(USE_TCP_ECHO_SRV2) */
+#endif	/* of #if defined(USE_TCP_ECHO_SRV1) */
+
+#if defined(USE_TCP_ECHO_SRV2)
+			case 'e':		/* tcp echo server */
+				if ((error = wup_tsk(TCP_ECHO_SRV_TASK2)) != E_OK) {
+					//cons_printf(portid, "[WUP TCP ECHO SRV] error: %s.\n", itron_strerror(error));
+					SIG_NET_CONS_PRINTF();
+					FLUSH_SND_BUFF();
+					}
+				break;
+#endif	/* of #if defined(USE_TCP_ECHO_SRV2) */
 
 #ifdef USE_WWW_SRV
 			case 'w':		/* WWW server */
-				if ((error = wup_tsk(WWW_SRV_TASK1)) != E_OK) {
-					cons_printf(portid, "[WUP WWW SRV] error: %s\n", itron_strerror(error));
+				if ((error = wakeup_www_srv((*(line + 3) == '4' ? API_PROTO_IPV4 : API_PROTO_IPV6))) != E_OK) {
+					//cons_printf(portid, "[WUP WWW SRV] error: %s.\n", itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
 					FLUSH_SND_BUFF();
@@ -2200,13 +3092,54 @@
 			switch (*(line + 2)) {
 
-#if defined(USE_UDP_ECHO_SRV) && !defined(USE_UDP_CALL_BACK)
+#if !defined(USE_UDP_CALL_BACK)
+
 			case 'e':		/* udp echo server */
-				if ((error = wup_tsk(UDP_ECHO_SRV_TASK)) != E_OK) {
-					cons_printf(portid, "[WUP UDP ECHO SRV] error: %s\n", itron_strerror(error));
+
+#if defined(USE_UDP6_ECHO_SRV_TSK)
+
+#if defined(USE_UDP4_ECHO_SRV_TSK)
+
+				if (*(line + 3) == '4') {
+					if ((error = wup_tsk(UDP4_ECHO_SRV_TASK)) != E_OK) {
+						cons_printf(portid, "[WUP UDP4 ECHO SRV] error: %s.\n", itron_strerror(error));
+						SIG_NET_CONS_PRINTF();
+						FLUSH_SND_BUFF();
+						}
+					}
+				else {
+					if ((error = wup_tsk(UDP6_ECHO_SRV_TASK)) != E_OK) {
+						cons_printf(portid, "[WUP UDP6 ECHO SRV] error: %s.\n", itron_strerror(error));
+						SIG_NET_CONS_PRINTF();
+						FLUSH_SND_BUFF();
+						}
+					}
+
+#else	/* of #if defined(USE_UDP4_ECHO_SRV_TSK) */
+
+				if ((error = wup_tsk(UDP6_ECHO_SRV_TASK)) != E_OK) {
+					cons_printf(portid, "[WUP UDP6 ECHO SRV] error: %s.\n", itron_strerror(error));
 					SIG_NET_CONS_PRINTF();
 					FLUSH_SND_BUFF();
 					}
+
+#endif	/* of #if defined(USE_UDP4_ECHO_SRV_TSK) */
+
+#else	/* of #if defined(USE_UDP6_ECHO_SRV_TSK) */
+
+#if defined(USE_UDP4_ECHO_SRV_TSK)
+
+				if ((error = wup_tsk(UDP4_ECHO_SRV_TASK)) != E_OK) {
+					cons_printf(portid, "[WUP UDP4 ECHO SRV] error: %s.\n", itron_strerror(error));
+					SIG_NET_CONS_PRINTF();
+					FLUSH_SND_BUFF();
+					}
+
+#endif	/* of #if defined(USE_UDP4_ECHO_SRV_TSK) */
+
+#endif	/* of #if defined(USE_UDP6_ECHO_SRV_TSK) */
+
 				break;
-#endif	/* of #if defined(USE_UDP_ECHO_SRV) && !defined(USE_UDP_CALL_BACK) */
+
+#endif	/* of #if !defined(USE_UDP_CALL_BACK) */
 
 				}
@@ -2217,5 +3150,5 @@
 		default:
 			if ((error = wup_tsk(atoi(skip_blanks(line + 1)))) != E_OK) {
-				cons_printf(portid, "[WUP TSK] error: %s\n", itron_strerror(error));
+				cons_printf(portid, "[WUP TSK] error: %s.\n", itron_strerror(error));
 				SIG_NET_CONS_PRINTF();
 				FLUSH_SND_BUFF();
@@ -2230,5 +3163,5 @@
 	case 'w':		/* wake up task */
 		if ((error = wup_tsk(atoi(skip_blanks(line + 1)))) != E_OK) {
-			cons_printf(portid, "[WUP TSK] error: %s\n", itron_strerror(error));
+			cons_printf(portid, "[WUP TSK] error: %s.\n", itron_strerror(error));
 			SIG_NET_CONS_PRINTF();
 			FLUSH_SND_BUFF();
@@ -2242,15 +3175,17 @@
 		if (*line) {
 
-#ifdef USE_EXTRA_PARSE
-
-			extra_parse(line);
-
-#else	/* of #ifdef USE_EXTRA_PARSE */
-
-			cons_printf(portid, "no such command: '%c'\n", *line);
+#ifdef USE_DBG_CONS_EXTRA_PARSE
+
+			//cons_printf(portid, "extra command: '%c'.\n", *line);
+			dbg_cons_extra_parse(portid, line);
+
+#else	/* of #ifdef USE_DBG_CONS_EXTRA_PARSE */
+
+			//cons_printf(portid, "command: '%c'.\n", *line);
+			cons_printf(portid, "no such command: '%c'.\n", *line);
 			SIG_NET_CONS_PRINTF();
 			FLUSH_SND_BUFF();
 
-#endif	/* of #ifdef USE_EXTRA_PARSE */
+#endif	/* of #ifdef USE_DBG_CONS_EXTRA_PARSE */
 
 			}
@@ -2258,4 +3193,6 @@
 		}
 	}
+
+#endif	/* of #ifdef USE_DBG_CONS_PARSER */
 
 /*
@@ -2268,5 +3205,4 @@
 	static char line[DBG_LINE_SIZE + 1];
 
-	uint_t	len;
 	ID	tskid;
 
@@ -2274,49 +3210,60 @@
 #ifdef SUPPORT_ETHER
 
+#if 0
 #if defined(SUPPORT_INET6)
 
-	int_t		lllen;
+	uint32_t	lllen;
 	const uint8_t	*lladdr;
 
 #endif	/* of #if defined(SUPPORT_INET6) */
-
-	lcd_init();
+#endif
+
+	lcd_initialize(0);
+
+#if 0
+#if defined(SUPPORT_INET6)
+
+	dly_tsk(1 * 1000);
+	lladdr = IF_ETHER_NIC_GET_SOFTC()->ifaddr.lladdr;
+	for (lllen = ETHER_ADDR_LEN; lllen --; )
+		lcd_printf(LCD_PORTID, "%02x", *lladdr ++);
+	lcd_putc(LCD_PORTID, '\n');
+
+#else	/* of #if defined(SUPPORT_INET6) */
 
 	if ((TINET_PRVER & UINT_C(0x0f)) > 0)
-		lcd_printf("TINET-%d.%d.%d\n",
+		lcd_printf(LCD_PORTID, "TINET-%d.%d.%d\n",
 		       (TINET_PRVER   >> 12) & UINT_C(0x0f),
 		       (TINET_PRVER   >>  4) & UINT_C(0x0f),
 		        TINET_PRVER          & UINT_C(0x0f));
 	else
-		lcd_printf("TINET-%d.%d\n",
+		lcd_printf(LCD_PORTID, "TINET-%d.%d\n",
 		       (TINET_PRVER   >> 12) & UINT_C(0x0f),
 		       (TINET_PRVER   >>  4) & UINT_C(0x0f));
 
-#if defined(SUPPORT_INET6)
-
-	lladdr = IF_ETHER_NIC_GET_SOFTC()->ifaddr.lladdr;
-	for (lllen = ETHER_ADDR_LEN; lllen --; )
-		lcd_printf("%02x", *lladdr ++);
-	lcd_printf("\n");
-
-#else	/* of #if defined(SUPPORT_INET6) */
-
-	lcd_puts(ip2str(NULL, in4_get_ifaddr(0)));
-
 #endif	/* of #if defined(SUPPORT_INET6) */
+#endif
+
+#if 0
+#if defined(SUPPORT_INET4)
+
+	dly_tsk(1 * 1000);
+	lcd_puts(LCD_PORTID, ip2str(NULL, in4_get_ifaddr(0)));
+	lcd_putc(LCD_PORTID, '\n');
+
+#endif	/* of #if defined(SUPPORT_INET4) */
+#endif
 
 #endif	/* of #ifdef SUPPORT_ETHER */
-#else	/* of #ifdef USE_LCD */
+#endif	/* of #ifdef USE_LCD */
 
 	get_tid(&tskid);
 	cons_printf(CONSOLE_PORTID, "[CONSOLE:%d] started.\n", tskid);
-
-#endif	/* of #ifdef USE_LCD */
-
 	serial_ctl_por(CONSOLE_PORTID,
 	               IOCTL_ECHO  | IOCTL_CRLF  |
 	               IOCTL_FCSND | IOCTL_FCANY | IOCTL_FCRCV);
+	netapp_srand (tskid);
 	while (true) {
-		len = cons_getline(CONSOLE_PORTID, line, DBG_LINE_SIZE);
+		cons_getline(CONSOLE_PORTID, line, DBG_LINE_SIZE);
 		dbg_parse(CONSOLE_PORTID, line);
 		}
