rex.x revision 1832
11832Swollman/* 21832Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 31832Swollman * unrestricted use provided that this legend is included on all tape 41832Swollman * media and as a part of the software program in whole or part. Users 51832Swollman * may copy or modify Sun RPC without charge, but are not authorized 61832Swollman * to license or distribute it to anyone else except as part of a product or 71832Swollman * program developed by the user. 81832Swollman * 91832Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 101832Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 111832Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 121832Swollman * 131832Swollman * Sun RPC is provided with no support and without any obligation on the 141832Swollman * part of Sun Microsystems, Inc. to assist in its use, correction, 151832Swollman * modification or enhancement. 161832Swollman * 171832Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 181832Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 191832Swollman * OR ANY PART THEREOF. 201832Swollman * 211832Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue 221832Swollman * or profits or other special, indirect and consequential damages, even if 231832Swollman * Sun has been advised of the possibility of such damages. 241832Swollman * 251832Swollman * Sun Microsystems, Inc. 261832Swollman * 2550 Garcia Avenue 271832Swollman * Mountain View, California 94043 281832Swollman */ 291832Swollman 301832Swollman/* 311832Swollman * Remote execution (rex) protocol specification 321832Swollman */ 331832Swollman 341832Swollman#ifndef RPC_HDR 351832Swollman%#ifndef lint 361832Swollman%/*static char sccsid[] = "from: @(#)rex.x 1.3 87/09/18 Copyr 1987 Sun Micro";*/ 371832Swollman%/*static char sccsid[] = "from: @(#)rex.x 2.1 88/08/01 4.0 RPCSRC";*/ 381832Swollman%static char rcsid[] = "$Id: rex.x,v 1.1 1993/09/14 17:42:46 jtc Exp $"; 391832Swollman%#endif /* not lint */ 401832Swollman#endif 411832Swollman 421832Swollmanconst STRINGSIZE = 1024; 431832Swollmantypedef string rexstring<1024>; 441832Swollman 451832Swollman/* 461832Swollman * values to pass to REXPROC_SIGNAL 471832Swollman */ 481832Swollmanconst SIGINT = 2; /* interrupt */ 491832Swollman 501832Swollman/* 511832Swollman * Values for rst_flags, below 521832Swollman */ 531832Swollmanconst REX_INTERACTIVE = 1; /* interactive mode */ 541832Swollman 551832Swollmanstruct rex_start { 561832Swollman rexstring rst_cmd<>; /* list of command and args */ 571832Swollman rexstring rst_host; /* working directory host name */ 581832Swollman rexstring rst_fsname; /* working directory file system name */ 591832Swollman rexstring rst_dirwithin;/* working directory within file system */ 601832Swollman rexstring rst_env<>; /* list of environment */ 611832Swollman unsigned int rst_port0; /* port for stdin */ 621832Swollman unsigned int rst_port1; /* port for stdout */ 631832Swollman unsigned int rst_port2; /* port for stderr */ 641832Swollman unsigned int rst_flags; /* options - see const above */ 651832Swollman}; 661832Swollman 671832Swollmanstruct rex_result { 681832Swollman int rlt_stat; /* integer status code */ 691832Swollman rexstring rlt_message; /* string message for human consumption */ 701832Swollman}; 711832Swollman 721832Swollman 731832Swollmanstruct sgttyb { 741832Swollman unsigned four; /* always equals 4 */ 751832Swollman opaque chars[4]; 761832Swollman /* chars[0] == input speed */ 771832Swollman /* chars[1] == output speed */ 781832Swollman /* chars[2] == kill character */ 791832Swollman /* chars[3] == erase character */ 801832Swollman unsigned flags; 811832Swollman}; 821832Swollman/* values for speeds above (baud rates) */ 831832Swollmanconst B0 = 0; 841832Swollmanconst B50 = 1; 851832Swollmanconst B75 = 2; 861832Swollmanconst B110 = 3; 871832Swollmanconst B134 = 4; 881832Swollmanconst B150 = 5; 891832Swollmanconst B200 = 6; 901832Swollmanconst B300 = 7; 911832Swollmanconst B600 = 8; 921832Swollmanconst B1200 = 9; 931832Swollmanconst B1800 = 10; 941832Swollmanconst B2400 = 11; 951832Swollmanconst B4800 = 12; 961832Swollmanconst B9600 = 13; 971832Swollmanconst B19200 = 14; 981832Swollmanconst B38400 = 15; 991832Swollman 1001832Swollman/* values for flags above */ 1011832Swollmanconst TANDEM = 0x00000001; /* send stopc on out q full */ 1021832Swollmanconst CBREAK = 0x00000002; /* half-cooked mode */ 1031832Swollmanconst LCASE = 0x00000004; /* simulate lower case */ 1041832Swollmanconst ECHO = 0x00000008; /* echo input */ 1051832Swollmanconst CRMOD = 0x00000010; /* map \r to \r\n on output */ 1061832Swollmanconst RAW = 0x00000020; /* no i/o processing */ 1071832Swollmanconst ODDP = 0x00000040; /* get/send odd parity */ 1081832Swollmanconst EVENP = 0x00000080; /* get/send even parity */ 1091832Swollmanconst ANYP = 0x000000c0; /* get any parity/send none */ 1101832Swollmanconst NLDELAY = 0x00000300; /* \n delay */ 1111832Swollmanconst NL0 = 0x00000000; 1121832Swollmanconst NL1 = 0x00000100; /* tty 37 */ 1131832Swollmanconst NL2 = 0x00000200; /* vt05 */ 1141832Swollmanconst NL3 = 0x00000300; 1151832Swollmanconst TBDELAY = 0x00000c00; /* horizontal tab delay */ 1161832Swollmanconst TAB0 = 0x00000000; 1171832Swollmanconst TAB1 = 0x00000400; /* tty 37 */ 1181832Swollmanconst TAB2 = 0x00000800; 1191832Swollmanconst XTABS = 0x00000c00; /* expand tabs on output */ 1201832Swollmanconst CRDELAY = 0x00003000; /* \r delay */ 1211832Swollmanconst CR0 = 0x00000000; 1221832Swollmanconst CR1 = 0x00001000; /* tn 300 */ 1231832Swollmanconst CR2 = 0x00002000; /* tty 37 */ 1241832Swollmanconst CR3 = 0x00003000; /* concept 100 */ 1251832Swollmanconst VTDELAY = 0x00004000; /* vertical tab delay */ 1261832Swollmanconst FF0 = 0x00000000; 1271832Swollmanconst FF1 = 0x00004000; /* tty 37 */ 1281832Swollmanconst BSDELAY = 0x00008000; /* \b delay */ 1291832Swollmanconst BS0 = 0x00000000; 1301832Swollmanconst BS1 = 0x00008000; 1311832Swollmanconst CRTBS = 0x00010000; /* do backspacing for crt */ 1321832Swollmanconst PRTERA = 0x00020000; /* \ ... / erase */ 1331832Swollmanconst CRTERA = 0x00040000; /* " \b " to wipe out char */ 1341832Swollmanconst TILDE = 0x00080000; /* hazeltine tilde kludge */ 1351832Swollmanconst MDMBUF = 0x00100000; /* start/stop output on carrier intr */ 1361832Swollmanconst LITOUT = 0x00200000; /* literal output */ 1371832Swollmanconst TOSTOP = 0x00400000; /* SIGTTOU on background output */ 1381832Swollmanconst FLUSHO = 0x00800000; /* flush output to terminal */ 1391832Swollmanconst NOHANG = 0x01000000; /* no SIGHUP on carrier drop */ 1401832Swollmanconst L001000 = 0x02000000; 1411832Swollmanconst CRTKIL = 0x04000000; /* kill line with " \b " */ 1421832Swollmanconst PASS8 = 0x08000000; 1431832Swollmanconst CTLECH = 0x10000000; /* echo control chars as ^X */ 1441832Swollmanconst PENDIN = 0x20000000; /* tp->t_rawq needs reread */ 1451832Swollmanconst DECCTQ = 0x40000000; /* only ^Q starts after ^S */ 1461832Swollmanconst NOFLSH = 0x80000000; /* no output flush on signal */ 1471832Swollman 1481832Swollmanstruct tchars { 1491832Swollman unsigned six; /* always equals 6 */ 1501832Swollman opaque chars[6]; 1511832Swollman /* chars[0] == interrupt char */ 1521832Swollman /* chars[1] == quit char */ 1531832Swollman /* chars[2] == start output char */ 1541832Swollman /* chars[3] == stop output char */ 1551832Swollman /* chars[4] == end-of-file char */ 1561832Swollman /* chars[5] == input delimeter (like nl) */ 1571832Swollman}; 1581832Swollman 1591832Swollmanstruct ltchars { 1601832Swollman unsigned six; /* always equals 6 */ 1611832Swollman opaque chars[6]; 1621832Swollman /* chars[0] == stop process signal */ 1631832Swollman /* chars[1] == delayed stop process signal */ 1641832Swollman /* chars[2] == reprint line */ 1651832Swollman /* chars[3] == flush output */ 1661832Swollman /* chars[4] == word erase */ 1671832Swollman /* chars[5] == literal next character */ 1681832Swollman unsigned mode; 1691832Swollman}; 1701832Swollman 1711832Swollmanstruct rex_ttysize { 1721832Swollman int ts_lines; 1731832Swollman int ts_cols; 1741832Swollman}; 1751832Swollman 1761832Swollmanstruct rex_ttymode { 1771832Swollman sgttyb basic; /* standard unix tty flags */ 1781832Swollman tchars more; /* interrupt, kill characters, etc. */ 1791832Swollman ltchars yetmore; /* special Berkeley characters */ 1801832Swollman unsigned andmore; /* and Berkeley modes */ 1811832Swollman}; 1821832Swollman 1831832Swollman/* values for andmore above */ 1841832Swollmanconst LCRTBS = 0x0001; /* do backspacing for crt */ 1851832Swollmanconst LPRTERA = 0x0002; /* \ ... / erase */ 1861832Swollmanconst LCRTERA = 0x0004; /* " \b " to wipe out char */ 1871832Swollmanconst LTILDE = 0x0008; /* hazeltine tilde kludge */ 1881832Swollmanconst LMDMBUF = 0x0010; /* start/stop output on carrier intr */ 1891832Swollmanconst LLITOUT = 0x0020; /* literal output */ 1901832Swollmanconst LTOSTOP = 0x0040; /* SIGTTOU on background output */ 1911832Swollmanconst LFLUSHO = 0x0080; /* flush output to terminal */ 1921832Swollmanconst LNOHANG = 0x0100; /* no SIGHUP on carrier drop */ 1931832Swollmanconst LL001000 = 0x0200; 1941832Swollmanconst LCRTKIL = 0x0400; /* kill line with " \b " */ 1951832Swollmanconst LPASS8 = 0x0800; 1961832Swollmanconst LCTLECH = 0x1000; /* echo control chars as ^X */ 1971832Swollmanconst LPENDIN = 0x2000; /* needs reread */ 1981832Swollmanconst LDECCTQ = 0x4000; /* only ^Q starts after ^S */ 1991832Swollmanconst LNOFLSH = 0x8000; /* no output flush on signal */ 2001832Swollman 2011832Swollmanprogram REXPROG { 2021832Swollman version REXVERS { 2031832Swollman 2041832Swollman /* 2051832Swollman * Start remote execution 2061832Swollman */ 2071832Swollman rex_result 2081832Swollman REXPROC_START(rex_start) = 1; 2091832Swollman 2101832Swollman /* 2111832Swollman * Wait for remote execution to terminate 2121832Swollman */ 2131832Swollman rex_result 2141832Swollman REXPROC_WAIT(void) = 2; 2151832Swollman 2161832Swollman /* 2171832Swollman * Send tty modes 2181832Swollman */ 2191832Swollman void 2201832Swollman REXPROC_MODES(rex_ttymode) = 3; 2211832Swollman 2221832Swollman /* 2231832Swollman * Send window size change 2241832Swollman */ 2251832Swollman void 2261832Swollman REXPROC_WINCH(rex_ttysize) = 4; 2271832Swollman 2281832Swollman /* 2291832Swollman * Send other signal 2301832Swollman */ 2311832Swollman void 2321832Swollman REXPROC_SIGNAL(int) = 5; 2331832Swollman } = 1; 2341832Swollman} = 100017; 235