Commit in reactos on MAIN
apps/utils/Makefile+1-11.10 -> 1.11
bootdata/packages/reactos.dff+71.48 -> 1.49
apps/utils/net/whois/.cvsignore+17added 1.1
                    /LICENSE.txt+23added 1.1
                    /makefile+17added 1.1
                    /whois.c+175added 1.1
                    /whois.rc+7added 1.1
+247-1
5 added + 2 modified, total 7 files
2004-11-21  Casper S. Hornstrup  <chorns@users.sourceforge.net>

	* apps/utils/Makefile (UTIL_NET_APPS): Add arp, finger, ipconfig,
	netstat, ping, telnet, and whois.
	* bootdata/packages/reactos.dff: Add arp.exe, finger.exe, ipconfig.exe,
	netstat.exe, ping.exe, telnet.exe, and whois.exe.
	* apps\utils\net\arp: New directory; Move from rosapps.
	* apps\utils\net\finger: Ditto.
	* apps\utils\net\ipconfig: Ditto.
	* apps\utils\net\netstat: Ditto.
	* apps\utils\net\ping: Ditto.
	* apps\utils\net\telnet: Ditto.
	* apps\utils\net\whois: Ditto.

reactos/apps/utils
Makefile 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- Makefile	29 Jul 2004 22:32:37 -0000	1.10
+++ Makefile	21 Nov 2004 22:27:01 -0000	1.11
@@ -11,7 +11,7 @@
 # cabman cat net objdir partinfo pice ps sc stats
 UTIL_APPS = cat objdir partinfo pnpdump sc shutdown stats tickcount consw rundll32 regsvr32 ps
 
-UTIL_NET_APPS = 
+UTIL_NET_APPS = arp finger ipconfig netstat ping telnet whois
 
 
 all: $(UTIL_APPS) $(UTIL_NET_APPS)

reactos/bootdata/packages
reactos.dff 1.48 -> 1.49
diff -u -r1.48 -r1.49
--- reactos.dff	21 Nov 2004 21:02:03 -0000	1.48
+++ reactos.dff	21 Nov 2004 22:27:01 -0000	1.49
@@ -140,6 +140,13 @@
 subsys\system\winefile\winefile.exe     1
 services\eventlog\eventlog.exe          1
 services\rpcss\rpcss.exe                1
+apps\utils\net\arp\arp.exe              1
+apps\utils\net\finger\finger.exe        1
+apps\utils\net\ipconfig\ipconfig.exe    1
+apps\utils\net\netstat\netstat.exe      1
+apps\utils\net\ping\ping.exe            1
+apps\utils\net\telnet\telnet.exe        1
+apps\utils\net\whois\whois.exe          1
 media\fonts\c0419bt_.ttf                3
 media\fonts\c0582bt_.ttf                3
 media\fonts\c0583bt_.ttf                3

reactos/apps/utils/net/whois
.cvsignore added at 1.1
diff -N .cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .cvsignore	21 Nov 2004 22:27:01 -0000	1.1
@@ -0,0 +1,17 @@
+*.sys
+*.exe
+*.dll
+*.cpl
+*.a
+*.o
+*.d
+*.coff
+*.dsp
+*.dsw
+*.aps
+*.ncb
+*.opt
+*.sym
+*.plg
+*.bak
+*.map

reactos/apps/utils/net/whois
LICENSE.txt added at 1.1
diff -N LICENSE.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ LICENSE.txt	21 Nov 2004 22:27:01 -0000	1.1
@@ -0,0 +1,23 @@
+July 22, 1999 
+
+To All Licensees, Distributors of Any Version of BSD: 
+
+As you know, certain of the Berkeley Software Distribution ("BSD") source code files 
+require that further distributions of products containing all or portions of the 
+software, acknowledge within their advertising materials that such products contain 
+software developed by UC Berkeley and its contributors. 
+
+Specifically, the provision reads: 
+
+      * 3. All advertising materials mentioning features or use of this software
+      *    must display the following acknowledgement:
+      *    This product includes software developed by the University of
+      *    California, Berkeley and its contributors.
+
+Effective immediately, licensees and distributors are no longer required to include 
+the acknowledgement within advertising materials. Accordingly, the foregoing paragraph 
+of those BSD Unix files containing it is hereby deleted in its entirety. 
+
+William Hoskins
+Director, Office of Technology Licensing
+University of California, Berkeley " 

reactos/apps/utils/net/whois
makefile added at 1.1
diff -N makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ makefile	21 Nov 2004 22:27:01 -0000	1.1
@@ -0,0 +1,17 @@
+PATH_TO_TOP = ../../../..
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = console
+
+TARGET_NAME = whois
+
+TARGET_SDKLIBS = ws2_32.a
+
+TARGET_OBJECTS = $(TARGET_NAME).o
+
+TARGET_GCCLIBS = iberty
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk

reactos/apps/utils/net/whois
whois.c added at 1.1
diff -N whois.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ whois.c	21 Nov 2004 22:27:01 -0000	1.1
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 1980, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * 8/1/97 - Ted Felix <tfelix@fred.net>
+ *          Ported to Win32 from 4.4-BSDLITE2 from wcarchive.
+ *          Added WSAStartup()/WSACleanup() and switched from the
+ *          more convenient fdopen()/fprintf() to send()/recv().
+ */
+
+#ifndef lint
+static char copyright[] =
+"@(#) Copyright (c) 1980, 1993\n\
+	The Regents of the University of California.  All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)whois.c	8.1 (Berkeley) 6/6/93";
+#endif /* not lint */
+
+#include <sys/types.h>
+#include <winsock2.h>
+/* #include <sys/socket.h> */
+/* #include <netinet/in.h> */
+/* #include <netdb.h> */
+#include <stdio.h>
+
+/* #include <various.h> */
+#include <getopt.h>
+#include <io.h>
+
+#define	NICHOST	"whois.internic.net"
+
+void usage();
+void leave(int iExitCode);
+
+int main(int argc, char **argv)
+{
+	extern char *optarg;
+	extern int optind;
+	char ch;
+	struct sockaddr_in sin;
+	struct hostent *hp;
+	struct servent *sp;
+	int s;
+	char *host;
+	WORD wVersionRequested;
+	WSADATA wsaData;
+	int err;
+
+	host = NICHOST;
+	while ((ch = (char)getopt(argc, argv, "h:")) != EOF)
+		switch((char)ch) {
+		case 'h':
+			host = optarg;
+			break;
+		case '?':
+		default:
+			usage();
+		}
+	argc -= optind;
+	argv += optind;
+
+	if (!argc)
+		usage();
+
+	/* Start winsock */ 
+	wVersionRequested = MAKEWORD( 1, 1 );
+	err = WSAStartup( wVersionRequested, &wsaData );
+	if ( err != 0 ) 
+	{
+		/* Tell the user that we couldn't find a usable */
+		/* WinSock DLL.                                 */
+		perror("whois: WSAStartup failed");
+		leave(1);
+	}
+
+	hp = gethostbyname(host);
+	if (hp == NULL) {
+		(void)fprintf(stderr, "whois: %s: ", host);
+		leave(1);
+	}
+	host = hp->h_name;
+
+	s = socket(hp->h_addrtype, SOCK_STREAM, 0);
+	if (s < 0) {
+		perror("whois: socket");
+		leave(1);
+	}
+
+	memset(/*(caddr_t)*/&sin, 0, sizeof(sin));
+	sin.sin_family = hp->h_addrtype;
+	if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+		perror("whois: bind");
+		leave(1);
+	}
+
+	memcpy((char *)&sin.sin_addr, hp->h_addr, hp->h_length);
+	sp = getservbyname("whois", "tcp");
+	if (sp == NULL) {
+		(void)fprintf(stderr, "whois: whois/tcp: unknown service\n");
+		leave(1);
+	}
+
+	sin.sin_port = sp->s_port;
+
+	/* have network connection; identify the host connected with */
+	(void)printf("[%s]\n", hp->h_name);
+
+	if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+		fprintf(stderr, "whois: connect error = %d\n", WSAGetLastError());
+		leave(1);
+	}
+
+	/* WinSock doesn't allow using a socket as a file descriptor. */
+	/* Have to use send() and recv().  whois will drop connection. */
+
+	/* For each request */
+	while (argc-- > 1)
+	{
+		/* Send the request */
+		send(s, *argv, strlen(*argv), 0);
+		send(s, " ", 1, 0);
+		argv++;
+	}
+	/* Send the last request */
+	send(s, *argv, strlen(*argv), 0);
+	send(s, "\r\n", 2, 0);
+
+	/* Receive anything and print it */
+	while (recv(s, &ch, 1, 0) == 1)
+		putchar(ch);
+
+	leave(0);
+}
+
+void usage()
+{
+	(void)fprintf(stderr, "usage: whois [-h hostname] name ...\n");
+	leave(1);
+}
+
+void leave(int iExitCode)
+{
+	WSACleanup();
+	exit(iExitCode);
+}

reactos/apps/utils/net/whois
whois.rc added at 1.1
diff -N whois.rc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ whois.rc	21 Nov 2004 22:27:01 -0000	1.1
@@ -0,0 +1,7 @@
+/* $Id: whois.rc,v 1.1 2004/11/21 22:27:01 chorns Exp $ */
+
+#define REACTOS_STR_FILE_DESCRIPTION	"ReactOS TCP/IPv4 Win32 Whois\0"
+#define REACTOS_STR_INTERNAL_NAME	"whois\0"
+#define REACTOS_STR_ORIGINAL_FILENAME	"whois.exe\0"
+#define REACTOS_STR_ORIGINAL_COPYRIGHT	"Steven Edwards (Isolation@users.sourceforge.net)\0"
+#include <reactos/version.rc>
CVSspam 0.2.8