xref: /openbsd/gnu/usr.bin/cvs/windows-NT/rcmd.h (revision d415bd75)
1 /* rcmd.h --- interface to executing commands on remote hosts
2    Jim Blandy <jimb@cyclic.com> --- August 1995  */
3 
4 /* Run the command CMD on the host *AHOST, and return a file descriptor for
5    a bidirectional stream socket connected to the command's standard input
6    and output.
7 
8    rcmd looks up *AHOST using gethostbyname, and sets *AHOST to the host's
9    canonical name.  If *AHOST is not found, rcmd returns -1.
10 
11    rcmd connects to the remote host at TCP port INPORT.  This should
12    probably be the "shell" service, port 514.
13 
14    LOCUSER is the name of the user on the local machine, and REMUSER is
15    the name of the user on the remote machine; the remote machine uses this,
16    along with the source address of the TCP connection, to authenticate
17    the connection.
18 
19    CMD is the command to execute.  The remote host will tokenize it any way
20    it damn well pleases.  Welcome to Unix.
21 
22    FD2P is a feature we don't support, but there's no point in making mindless
23    deviations from the interface.  Callers should always pass this argument
24    as zero.  */
25 extern int rcmd (const char **AHOST,
26 		 unsigned short INPORT,
27 		 char *LOCUSER,
28 		 char *REMUSER,
29 		 char *CMD,
30 		 int *fd2p);
31