xref: /openbsd-src/gnu/usr.bin/cvs/os2/rcmd.h (revision 2770ece558b09db842a03eacdf247234131b8970)
113571821Stholo /* rcmd.h --- interface to executing commands on remote hosts
213571821Stholo    Karl Fogel <kfogel@cyclic.com> --- November 1995  */
313571821Stholo 
4*2770ece5Stholo /* This program is free software; you can redistribute it and/or modify
5*2770ece5Stholo    it under the terms of the GNU General Public License as published by
6*2770ece5Stholo    the Free Software Foundation; either version 2, or (at your option)
7*2770ece5Stholo    any later version.
8*2770ece5Stholo 
9*2770ece5Stholo    This program is distributed in the hope that it will be useful,
10*2770ece5Stholo    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*2770ece5Stholo    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*2770ece5Stholo    GNU General Public License for more details.  */
13*2770ece5Stholo 
1413571821Stholo /* Run the command CMD on the host *AHOST, and return a file descriptor for
1513571821Stholo    a bidirectional stream socket connected to the command's standard input
1613571821Stholo    and output.
1713571821Stholo 
1813571821Stholo    rcmd looks up *AHOST using gethostbyname, and sets *AHOST to the host's
1913571821Stholo    canonical name.  If *AHOST is not found, rcmd returns -1.
2013571821Stholo 
2113571821Stholo    rcmd connects to the remote host at TCP port INPORT.  This should
2213571821Stholo    probably be the "shell" service, port 514.
2313571821Stholo 
2413571821Stholo    LOCUSER is the name of the user on the local machine, and REMUSER is
2513571821Stholo    the name of the user on the remote machine; the remote machine uses this,
2613571821Stholo    along with the source address of the TCP connection, to authenticate
2713571821Stholo    the connection.
2813571821Stholo 
2913571821Stholo    CMD is the command to execute.  The remote host will tokenize it any way
3013571821Stholo    it damn well pleases.  Welcome to Unix.
3113571821Stholo 
3213571821Stholo    FD2P is a feature we don't support, but there's no point in making mindless
3313571821Stholo    deviations from the interface.  Callers should always pass this argument
3413571821Stholo    as zero.  */
3513571821Stholo extern int rcmd (const char **AHOST,
3613571821Stholo 		 unsigned short INPORT,
3713571821Stholo 		 char *LOCUSER,
3813571821Stholo 		 char *REMUSER,
3913571821Stholo 		 char *CMD,
4013571821Stholo 		 int *fd2p);
41