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