Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Inetd for NT

1 view
Skip to first unread message

Johan Van Barel

unread,
Jul 22, 1997, 3:00:00 AM7/22/97
to

Inetd for NTnow available!
Inetd for NT: the Internet services daemon for NT is now available
as shareware from http://www.ockham.be/inetd.html

1. About Inetd
--------------
The inetd daemon for NT is the Internet superserver, which invokes
Internet
server processes as needed. It must be running before other hosts can
connect to the local host through such services as ftp, telnet, etc.

The inetd daemon is designed to invoke all the Internet servers as
needed, thus reducing load on the system. It is normally started at
system boot time. Only one inetd can run at any given time.

The NT inetd daemon starts servers for stream type services.
Inetd listens for connection requests on Internet stream sockets.
When a connection is requested for one of its sockets, inetd decides
which
service the socket will support, starts a process, invokes an
appropriate
server for the connection, and passes the connected socket to the
server as
stdin and stdout. Then inetd returns to listening for connection
requests.

2. Installation
---------------

Unzip the inetd.zip archive to a directory called c:\inetd

3. Startup and configuration
----------------------------

The inetd daemon is built as an NT service and thus has the standard
features of
NT services like running in the background. The daemon is normally
started at
NT boot time, if the inetd service startup is set to automatic in the
NT
services control panel applet. If startup is set to manual, The NT
system
administrator can also start inetd manually. All system messages,
warnings
or messages from inetd are logged in the NT event log and can be viewed
with
the NT event viewer.

The daemon can also be started from the command line by using the
command:

net start inetd

At install time one has to notify NT that a new service called inetd is
to be registered into the Service Control Manager. This can be done by
using
the following command from the command line:

inetd -install

Inetd can be stopped using the Service Control Manager or by using the
command:

net stop inetd

Note that stopping inetd only affects new programs being started.
Existing programs, like a telnet serving a user that is already logged
on,
are not affected. If inetd is stopped, no new inetd services can start.
If you want to deregister inetd completely from the Service Control
Manager,
you can type the following command from the command line:

inetd -remove

The strength of inetd for NT is that any character mode program can be
started
by inetd and run over winsock. The program does not even have to be
network
aware. When inetd starts a program, it maps the program's standard
input,
output and error handles to the socket connected to the remote user.
Thus as a program does its I/O using standard C-runtime calls (like
scanf(),
printf(), etc.) or WIN32 calls (like ReadFile(), WriteFile()), they get
redirected over the connected winsock session. Even a simple 'hello
world'
program can be run via inetd over winsock. If the program uses stream
type I/O
(like printf(),scanf(),...) to its standard handles, it should contain
the
following code somewhere at startup:

setvbuf(stdout,NULL,_IONBF,0);
setvbuf(stderr,NULL,_IONBF,0);

Network aware programs, which do I/O over a windows socket, need to use
the
environment variable passed, INETD_SOCK, to obtain the socket handle
that inetd
has created for connecting the program to a remote user.
Inetd sets up this environment variable to the handle of a connected
socket
for a program. This socket handle is inherited by a program and is
already
accessible. So a network aware program only needs to add code similar
to the
following to make the program work:

sock=atoi(getenv("INETD_SOCK"));
recv(sock,...);
send(sock,...);

To tell inetd what port to listen for your program, specify your
service as a
TCP/IP service in Windows NT and have an entry in
\winnt\system32\drivers\etc\services file, where inetd finds the
listening port
to use by a winsock call.

When invoked, inetd reads \winnt\system32\drivers\etc\inetd.conf
and configures itself to support whatever services are included in
that file. One can use a text editor to edit the text file inetd.conf
to add,
delete or modify program information.
An example of the default inetd.conf file is listed below:

# INETD.CONF: configuration information for inetd of Ockham Technology
inetdecho c:\inetd\echo.exe arg1 arg2

You can add lines to this file in the format:
<service> <programnamepath> <arg1> <arg2> ...

The unregistered shareware version is limited to specify only 1 server
process.
You can also mail us to get a demo version which is fully functional
for a period of at least 1 month.
If you register after your evaluation, you are allowed to specify up to
1024 servers.
For the example above, the NT services file
\winnt\system32\drivers\etc\services
should have a line like:

inetdecho 22222/tcp INETDECHO

So, for each entry in inetd.conf, an entry in the NT services file is
required.
The echo server program will first print its arguments and then echo
all data
typed by the client. The program terminates when the client writes a ~
to the echo server. You can test this server by opening a telnet
session
to port 22222. If your client machine is a UNIX and your server NT is
called
crimson you type:

telnet 22222 crimson

The source of the echo program is very simple:

#include <stdio.h>

int main(int argc,char *argv[])
{
char buf[256];
int i;
setvbuf(stdout,NULL,_IONBF,0);
setvbuf(stderr,NULL,_IONBF,0);
for(i=0;i<argc;i++)
printf("argv[%d]=[%s]\n",i,argv[i]);
while(buf[0]!='~')
{
gets(buf);
printf("%s\n",buf);
}
}

4. Registration
---------------
If you register after evaluation, you receive the full version,
which does not have the shareware limitation of 1 service.
You are free to distribute or copy the unregistered shareware version
of Inetd as long as you respect the copyright.
You may however not reverse engineer or change any part of the code!
You can register by sending 399,- US Dollars to:

Ockham Technology
Olivetenvest 52/4
B-2800 Mechelen
Belgium

International Bank Account Number: 789-5869142-78 (BACOB Bank
Belgium).
Tel: +32-15-281820
Fax: +32-15-281821
e-mail: in...@ockham.be
http://www.ockham.be

If you register, do not forget to specify your email address,
so we can send you the full version as soon as possible.
Multiple or corporate licence policies or source code licences are
available on demand.

5. Disclamer
------------
Ockham Technology takes no responsibility for any losses due to the use
of
this product, including damages to the user's computer, or its
information.
Using this software is at your own risk, and we are in no way liable
for any of the user's problems. However feel free to mail your
suggestions
and bugs to in...@ockham.be or call our hotline at: +32-15-281820

6. Release info
---------------
28 Mar 1997: release 1.0
first release of Inetd for NT
01 Jul 1997: release 1.1
official release as shareware with 1 service nag

Inetd for NT was developed by Ockham Technology.

0 new messages