Index: EcnlProtoTool/trunk/ntshell/src/netcmd.c
===================================================================
--- EcnlProtoTool/trunk/ntshell/src/netcmd.c	(revision 441)
+++ EcnlProtoTool/trunk/ntshell/src/netcmd.c	(revision 442)
@@ -40,5 +40,4 @@
 #include <t_stdlib.h>
 #include <sil.h>
-#include <string.h>
 #include "syssvc/serial.h"
 #include "syssvc/syslog.h"
@@ -59,6 +58,4 @@
 #include <netapp/resolver.h>
 #include "core/ntlibc.h"
-#include "util/ntstdio.h"
-#include <stdio.h>
 #include "ntp_cli.h"
 #include "kernel_cfg.h"
@@ -71,5 +68,4 @@
 extern void ping6(T_IN6_ADDR *addr, uint_t tmo, uint_t len);
 extern void ping4(T_IN4_ADDR *addr, uint_t tmo, uint_t len);
-extern ntstdio_t *ntstdio;
 
 /*
@@ -255,9 +251,9 @@
 
 	if (apip == '1')
-		ntlibc_strcpy(line, i6rlp_pmtu_str1);
+		strcpy(line, i6rlp_pmtu_str1);
 	else if (apip == '2')
-		ntlibc_strcpy(line, i6rlp_pmtu_str2);
+		strcpy(line, i6rlp_pmtu_str2);
 	else if (apip == '3')
-		ntlibc_strcpy(line, i6rlp_pmtu_str3);
+		strcpy(line, i6rlp_pmtu_str3);
 
 #if defined(SUPPORT_INET6) && defined(SUPPORT_INET4)
@@ -280,5 +276,5 @@
 
 	if ((line = lookup_ipaddr(&addr, line, apip)) == NULL) {
-		ntstdio_printf(ntstdio, "[PING] unknown host.\n");
+		printf("[PING] unknown host.\n");
 		return 0;
 	}
@@ -299,18 +295,18 @@
 #if defined(SUPPORT_INET4)
 	if (apip == API_PROTO_IPV6) {
-		ntstdio_printf(ntstdio, "[PING6] size: %d, tmo: %d, host: %s\n", size, tmo, ipv62str(NULL, &addr));
+		printf("[PING6] size: %d, tmo: %d, host: %s\n", size, tmo, ipv62str(NULL, &addr));
 		ping6(&addr, (uint_t)tmo, (uint_t)size);
 	}
 	else {
 		addr4 = ntohl(addr.s6_addr32[3]);
-		ntstdio_printf(ntstdio, "[PING4] size: %d, tmo: %d, host: %s\n", size, tmo, ip2str(NULL, &addr4));
+		printf("[PING4] size: %d, tmo: %d, host: %s\n", size, tmo, ip2str(NULL, &addr4));
 		ping4(&addr4, (uint_t)tmo, (uint_t)size);
 	}
 #else /* of #if defined(SUPPORT_INET4) */
-	ntstdio_printf(ntstdio, "[PING6] size: %d, tmo: %d, host: %s\n", size, tmo, ipv62str(NULL, &addr));
+	printf("[PING6] size: %d, tmo: %d, host: %s\n", 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) */
-	ntstdio_printf(ntstdio, "[PING4] size: %d, tmo: %d, host: %s\n", size, tmo, ip2str(NULL, &addr));
+	printf("[PING4] size: %d, tmo: %d, host: %s\n", size, tmo, ip2str(NULL, &addr));
 	ping4(&addr, (uint_t)tmo, (uint_t)size);
 #endif	/* of #if defined(SUPPORT_INET6) */
@@ -331,13 +327,13 @@
 		pos = str_ipv4addr(temp, sizeof(temp), &svaddr, 0);
 		temp[pos] = '\0';
-		ntstdio_printf(ntstdio, "DHCPv4 server: %s,\n", temp);
-		ntstdio_printf(ntstdio, "  Renew:       %u:%02u:%02u,\n",
+		printf("DHCPv4 server: %s,\n", temp);
+		printf("  Renew:       %u:%02u:%02u,\n",
 			renew / 3600, (renew / 60) % 60, renew % 60);
-		ntstdio_printf(ntstdio, "  Rebind:      %u:%02u:%02u, Expire:   %u:%02u:%02u.\n",
+		printf("  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 (ret == E_OBJ)
-		ntstdio_printf(ntstdio, "DHCPv4 server: not available.\n");
+		printf("DHCPv4 server: not available.\n");
 }
 
@@ -349,11 +345,11 @@
 		return 0;
 
-	if (ntlibc_strcmp(argv[1], "rel") == 0) {
+	if (strcmp(argv[1], "rel") == 0) {
 		ret = dhcp4c_rel_info();
-		ntstdio_printf(ntstdio, "dhcp4c_rel_info %d\n", ret);
-	}
-	else if (ntlibc_strcmp(argv[1], "renew") == 0) {
+		printf("dhcp4c_rel_info %d\n", ret);
+	}
+	else if (strcmp(argv[1], "renew") == 0) {
 		ret = dhcp4c_renew_info();
-		ntstdio_printf(ntstdio, "dhcp4c_renew_info %d\n", ret);
+		printf("dhcp4c_renew_info %d\n", ret);
 	}
 	else {
@@ -383,8 +379,8 @@
 		else {
 			for (c = 1; c <= *ptr; c++)
-				ntstdio_printf(ntstdio, "%c", *(ptr + c));
+				printf("%c", *(ptr + c));
 			ptr += *ptr + 1;
 			if (*ptr)
-				ntstdio_printf(ntstdio, ".");
+				printf(".");
 		}
 	}
@@ -406,16 +402,16 @@
 		return error;
 
-	ntstdio_printf(ntstdio, "    mname:   ");
+	printf("    mname:   ");
 	rn_offset = s_show_dns_domain_name(msg, offset);
 	putchar('\n');
-	ntstdio_printf(ntstdio, "    rname:   ");
+	printf("    rname:   ");
 	s_show_dns_domain_name(msg, rn_offset);
 	putchar('\n');
 
-	ntstdio_printf(ntstdio, "    serial:  %d\n", soa.serial);
-	ntstdio_printf(ntstdio, "    refresh: %d\n", soa.refresh);
-	ntstdio_printf(ntstdio, "    retry:   %d\n", soa.retry);
-	ntstdio_printf(ntstdio, "    expirel: %d\n", soa.expire);
-	ntstdio_printf(ntstdio, "    minimum: %d\n", soa.minimum);
+	printf("    serial:  %d\n", soa.serial);
+	printf("    refresh: %d\n", soa.refresh);
+	printf("    retry:   %d\n", soa.retry);
+	printf("    expirel: %d\n", soa.expire);
+	printf("    minimum: %d\n", soa.minimum);
 
 	return E_OK;
@@ -433,5 +429,5 @@
 	int		scount;
 
-	ntstdio_printf(ntstdio, "question   section: %d\n", rslv->dns_hdr.qdcount);
+	printf("question   section: %d\n", rslv->dns_hdr.qdcount);
 	offset = rslv->qd_offset;
 	for (scount = 1; scount <= rslv->dns_hdr.qdcount; scount++) {
@@ -439,7 +435,7 @@
 			return error;
 
-		ntstdio_printf(ntstdio, "%2d: ", scount);
+		printf("%2d: ", scount);
 		s_show_dns_domain_name(msg, offset);
-		ntstdio_printf(ntstdio, "\n    type: %-4s, class: %2s\n", dns_strtype(qd.type), dns_strclass(qd.class));
+		printf("\n    type: %-4s, class: %2s\n", dns_strtype(qd.type), dns_strclass(qd.class));
 		offset = error;
 	}
@@ -463,12 +459,12 @@
 	int pos;
 
-	ntstdio_printf(ntstdio, "%10s section: %d\n", title, scount);
+	printf("%10s section: %d\n", title, scount);
 	for (count = 1; count <= scount; count++) {
 		if ((error = dns_analyze_rr(&rr, offset, msg, length)) < 0)
 			return error;
 
-		ntstdio_printf(ntstdio, "%2d: ", count);
+		printf("%2d: ", count);
 		s_show_dns_domain_name(msg, offset);
-		ntstdio_printf(ntstdio, "\n    type: %-4s, class: %2s, TTL: %2d, len: %3d, offset: 0x%02x\n",
+		printf("\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);
 
@@ -479,13 +475,13 @@
 			pos = str_ipv4addr(temp, sizeof(temp), &in4_addr, 0);
 			temp[pos] = '\0';
-			ntstdio_printf(ntstdio, "    IPv4 addr: %s\n", temp);
+			printf("    IPv4 addr: %s\n", temp);
 			break;
 		case DNS_TYPE_NS:
-			ntstdio_printf(ntstdio, "    host: ");
+			printf("    host: ");
 			s_show_dns_domain_name(msg, rr.rdata_offset);
 			putchar('\n');
 			break;
 		case DNS_TYPE_CNAME:
-			ntstdio_printf(ntstdio, "    host: ");
+			printf("    host: ");
 			s_show_dns_domain_name(msg, rr.rdata_offset);
 			putchar('\n');
@@ -495,5 +491,5 @@
 			break;
 		case DNS_TYPE_PTR:
-			ntstdio_printf(ntstdio, "     PTR: ");
+			printf("     PTR: ");
 			s_show_dns_domain_name(msg, rr.rdata_offset);
 			putchar('\n');
@@ -503,13 +499,13 @@
 			pos = str_ipv6addr(temp, sizeof(temp), &in6_addr, 0);
 			temp[pos] = '\0';
-			ntstdio_printf(ntstdio, "    IPv6 addr: %s\n", temp);
+			printf("    IPv6 addr: %s\n", temp);
 			break;
 		default:
-			ntstdio_printf(ntstdio, "    data: ");
+			printf("    data: ");
 			col = 32;
 			for (dcount = 0; dcount < rr.rdlength; dcount++) {
-				ntstdio_printf(ntstdio, "%02x", *(msg + rr.rdata_offset + dcount));
+				printf("%02x", *(msg + rr.rdata_offset + dcount));
 				if (--col == 0) {
-					ntstdio_printf(ntstdio, "\n          ");
+					printf("\n          ");
 					col = 32;
 				}
@@ -539,9 +535,9 @@
 #if defined(SUPPORT_INET6)
 
-	ntstdio_printf(ntstdio, "domain name:     %s\n", dns_in6_get_dname());
+	printf("domain name:     %s\n", dns_in6_get_dname());
 
 #else	/* of #if defined(SUPPORT_INET6) */
 
-	ntstdio_printf(ntstdio, "domain name:     %s\n", dns_in4_get_dname());
+	printf("domain name:     %s\n", dns_in4_get_dname());
 
 #endif	/* of #if defined(SUPPORT_INET6) */
@@ -549,11 +545,11 @@
 #if defined(SUPPORT_INET6)
 	dns_in6_get_addr(&in6_addr);
-	ntstdio_printf(ntstdio, "IPv6 DNS server: ");
+	printf("IPv6 DNS server: ");
 	if (IN6_IS_ADDR_UNSPECIFIED(&in6_addr))
-		ntstdio_printf(ntstdio, "not available.\n");
+		printf("not available.\n");
 	else {
 		pos = str_ipv6addr(temp, sizeof(temp), &in6_addr, 0);
 		temp[pos] = '\0';
-		ntstdio_printf(ntstdio, "%s.\n", temp);
+		printf("%s.\n", temp);
 	}
 #endif	/* of #if defined(SUPPORT_INET6) */
@@ -561,11 +557,11 @@
 #if defined(SUPPORT_INET4)
 	dns_in4_get_addr(&in4_addr);
-	ntstdio_printf(ntstdio, "IPv4 DNS server: ");
+	printf("IPv4 DNS server: ");
 	if (in4_addr == IPV4_ADDRANY)
-		ntstdio_printf(ntstdio, "not available.\n");
+		printf("not available.\n");
 	else {
 		pos = str_ipv4addr(temp, sizeof(temp), &in4_addr, 0);
 		temp[pos] = '\0';
-		ntstdio_printf(ntstdio, "%s.\n", temp);
+		printf("%s.\n", temp);
 	}
 #endif	/* of #if defined(SUPPORT_INET4) */
@@ -596,5 +592,5 @@
 	uint8_t 	*msg;
 
-	if (ntlibc_strcmp(line, "info") == 0) {
+	if (strcmp(line, "info") == 0) {
 		dns_info();
 		return 0;
@@ -604,5 +600,5 @@
 	line = skip_blanks(resolv_options(&flags, line, DEFAULT_API_PROTO));
 	if ((flags & (DNS_LUP_FLAGS_PROTO_IPV6 | DNS_LUP_FLAGS_PROTO_IPV4)) == 0) {
-		ntstdio_printf(ntstdio, "DNS server not available.\n");
+		printf("DNS server not available.\n");
 		return 0;
 	}
@@ -620,47 +616,47 @@
 
 	if ((error = tget_mpf(MPF_RSLV_SRBUF, (void*)&msg, TMO_FEVR)) != E_OK) {
-		ntstdio_printf(ntstdio, "get buffer error: %s.\n", itron_strerror(error));
+		printf("get buffer error: %s.\n", itron_strerror(error));
 		return 0;
 	}
 
 	if ((length = dns_lookup_host(flags | DNS_LUP_FLAGS_MSG, line, msg, DNS_UDP_MSG_LENGTH, &rslv)) < 0) {
-		//ntstdio_printf(ntstdio, "error: %s.\n", itron_strerror(length));
+		//printf("error: %s.\n", itron_strerror(length));
 		goto err_ret;
 	}
 
 	dly_tsk(1 * 1000);
-	ntstdio_printf(ntstdio, "DNS header: flags: ");
+	printf("DNS header: flags: ");
 	if (rslv.dns_hdr.code & (DNS_QR_RESPONSE | DNS_AUTHORITATIVE |
 		DNS_TRUN_CATION | DNS_RECURSION_DESIRED | DNS_RECURSION_AVAILABLE)) {
-		ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_QR_RESPONSE) ? "QR," : "");
-		ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_AUTHORITATIVE) ? "AA," : "");
-		ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_TRUN_CATION) ? "TC," : "");
-		ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_RECURSION_DESIRED) ? "RD," : "");
-		ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_RECURSION_AVAILABLE) ? "RA," : "");
-		ntstdio_printf(ntstdio, " ");
-	}
-	ntstdio_printf(ntstdio, "opcode: ");
-	ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_OPCODE_REVERSE) ? "RV" : "FW");
-	ntstdio_printf(ntstdio, (rslv.dns_hdr.code & DNS_OPCODE_STATUS) ? ",ST" : "");
-	ntstdio_printf(ntstdio, ", rcode: %s.\n",
+		printf((rslv.dns_hdr.code & DNS_QR_RESPONSE) ? "QR," : "");
+		printf((rslv.dns_hdr.code & DNS_AUTHORITATIVE) ? "AA," : "");
+		printf((rslv.dns_hdr.code & DNS_TRUN_CATION) ? "TC," : "");
+		printf((rslv.dns_hdr.code & DNS_RECURSION_DESIRED) ? "RD," : "");
+		printf((rslv.dns_hdr.code & DNS_RECURSION_AVAILABLE) ? "RA," : "");
+		printf(" ");
+	}
+	printf("opcode: ");
+	printf((rslv.dns_hdr.code & DNS_OPCODE_REVERSE) ? "RV" : "FW");
+	printf((rslv.dns_hdr.code & DNS_OPCODE_STATUS) ? ",ST" : "");
+	printf(", 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(msg, length, &rslv)) < 0) {
-		ntstdio_printf(ntstdio, "msg error: %s.\n", itron_strerror(offset));
+		printf("msg error: %s.\n", itron_strerror(offset));
 	}
 	if ((offset = show_dns_section(msg, length, rslv.dns_hdr.ancount, rslv.an_offset, "answer")) < 0) {
-		ntstdio_printf(ntstdio, "msg error: %s.\n", itron_strerror(offset));
+		printf("msg error: %s.\n", itron_strerror(offset));
 	}
 	if ((offset = show_dns_section(msg, length, rslv.dns_hdr.nscount, rslv.ns_offset, "authority")) < 0) {
-		ntstdio_printf(ntstdio, "msg error: %s.\n", itron_strerror(offset));
+		printf("msg error: %s.\n", itron_strerror(offset));
 	}
 	if ((offset = show_dns_section(msg, length, rslv.dns_hdr.arcount, rslv.ar_offset, "additional")) < 0) {
-		ntstdio_printf(ntstdio, "msg error: %s.\n", itron_strerror(offset));
+		printf("msg error: %s.\n", itron_strerror(offset));
 	}
 
 err_ret:
 	if ((error = rel_mpf(MPF_RSLV_SRBUF, msg)) != E_OK)
-		ntstdio_printf(ntstdio, "release buffer error: %s.\n", itron_strerror(error));
+		printf("release buffer error: %s.\n", itron_strerror(error));
 	return 0;
 }
