Warning, /include/rpcsvc/rex.x is written in an unsupported language. File is not indexed.
0001 /* @(#)rex.x 2.1 88/08/01 4.0 RPCSRC */
0002
0003 /*
0004 * Copyright (c) 2010, Oracle America, Inc.
0005 * Redistribution and use in source and binary forms, with or without
0006 * modification, are permitted provided that the following conditions are
0007 * met:
0008 *
0009 * * Redistributions of source code must retain the above copyright
0010 * notice, this list of conditions and the following disclaimer.
0011 * * Redistributions in binary form must reproduce the above
0012 * copyright notice, this list of conditions and the following
0013 * disclaimer in the documentation and/or other materials
0014 * provided with the distribution.
0015 * * Neither the name of the "Oracle America, Inc." nor the names of its
0016 * contributors may be used to endorse or promote products derived
0017 * from this software without specific prior written permission.
0018 *
0019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0022 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0023 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
0024 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0025 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0026 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0027 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0029 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0030 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0031 */
0032
0033 /*
0034 * Remote execution (rex) protocol specification
0035 */
0036
0037 const STRINGSIZE = 1024;
0038 typedef string rexstring<1024>;
0039
0040 /*
0041 * values to pass to REXPROC_SIGNAL
0042 */
0043 const SIGINT = 2; /* interrupt */
0044
0045 /*
0046 * Values for rst_flags, below
0047 */
0048 const REX_INTERACTIVE = 1; /* interactive mode */
0049
0050 struct rex_start {
0051 rexstring rst_cmd<>; /* list of command and args */
0052 rexstring rst_host; /* working directory host name */
0053 rexstring rst_fsname; /* working directory file system name */
0054 rexstring rst_dirwithin;/* working directory within file system */
0055 rexstring rst_env<>; /* list of environment */
0056 unsigned int rst_port0; /* port for stdin */
0057 unsigned int rst_port1; /* port for stdout */
0058 unsigned int rst_port2; /* port for stderr */
0059 unsigned int rst_flags; /* options - see const above */
0060 };
0061
0062 struct rex_result {
0063 int rlt_stat; /* integer status code */
0064 rexstring rlt_message; /* string message for human consumption */
0065 };
0066
0067
0068 struct sgttyb {
0069 unsigned four; /* always equals 4 */
0070 opaque chars[4];
0071 /* chars[0] == input speed */
0072 /* chars[1] == output speed */
0073 /* chars[2] == kill character */
0074 /* chars[3] == erase character */
0075 unsigned flags;
0076 };
0077 /* values for speeds above (baud rates) */
0078 const B0 = 0;
0079 const B50 = 1;
0080 const B75 = 2;
0081 const B110 = 3;
0082 const B134 = 4;
0083 const B150 = 5;
0084 const B200 = 6;
0085 const B300 = 7;
0086 const B600 = 8;
0087 const B1200 = 9;
0088 const B1800 = 10;
0089 const B2400 = 11;
0090 const B4800 = 12;
0091 const B9600 = 13;
0092 const B19200 = 14;
0093 const B38400 = 15;
0094
0095 /* values for flags above */
0096 const TANDEM = 0x00000001; /* send stopc on out q full */
0097 const CBREAK = 0x00000002; /* half-cooked mode */
0098 const LCASE = 0x00000004; /* simulate lower case */
0099 const ECHO = 0x00000008; /* echo input */
0100 const CRMOD = 0x00000010; /* map \r to \r\n on output */
0101 const RAW = 0x00000020; /* no i/o processing */
0102 const ODDP = 0x00000040; /* get/send odd parity */
0103 const EVENP = 0x00000080; /* get/send even parity */
0104 const ANYP = 0x000000c0; /* get any parity/send none */
0105 const NLDELAY = 0x00000300; /* \n delay */
0106 const NL0 = 0x00000000;
0107 const NL1 = 0x00000100; /* tty 37 */
0108 const NL2 = 0x00000200; /* vt05 */
0109 const NL3 = 0x00000300;
0110 const TBDELAY = 0x00000c00; /* horizontal tab delay */
0111 const TAB0 = 0x00000000;
0112 const TAB1 = 0x00000400; /* tty 37 */
0113 const TAB2 = 0x00000800;
0114 const XTABS = 0x00000c00; /* expand tabs on output */
0115 const CRDELAY = 0x00003000; /* \r delay */
0116 const CR0 = 0x00000000;
0117 const CR1 = 0x00001000; /* tn 300 */
0118 const CR2 = 0x00002000; /* tty 37 */
0119 const CR3 = 0x00003000; /* concept 100 */
0120 const VTDELAY = 0x00004000; /* vertical tab delay */
0121 const FF0 = 0x00000000;
0122 const FF1 = 0x00004000; /* tty 37 */
0123 const BSDELAY = 0x00008000; /* \b delay */
0124 const BS0 = 0x00000000;
0125 const BS1 = 0x00008000;
0126 const CRTBS = 0x00010000; /* do backspacing for crt */
0127 const PRTERA = 0x00020000; /* \ ... / erase */
0128 const CRTERA = 0x00040000; /* " \b " to wipe out char */
0129 const TILDE = 0x00080000; /* hazeltine tilde kludge */
0130 const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
0131 const LITOUT = 0x00200000; /* literal output */
0132 const TOSTOP = 0x00400000; /* SIGTTOU on background output */
0133 const FLUSHO = 0x00800000; /* flush output to terminal */
0134 const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
0135 const L001000 = 0x02000000;
0136 const CRTKIL = 0x04000000; /* kill line with " \b " */
0137 const PASS8 = 0x08000000;
0138 const CTLECH = 0x10000000; /* echo control chars as ^X */
0139 const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
0140 const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
0141 const NOFLSH = 0x80000000; /* no output flush on signal */
0142
0143 struct tchars {
0144 unsigned six; /* always equals 6 */
0145 opaque chars[6];
0146 /* chars[0] == interrupt char */
0147 /* chars[1] == quit char */
0148 /* chars[2] == start output char */
0149 /* chars[3] == stop output char */
0150 /* chars[4] == end-of-file char */
0151 /* chars[5] == input delimiter (like nl) */
0152 };
0153
0154 struct ltchars {
0155 unsigned six; /* always equals 6 */
0156 opaque chars[6];
0157 /* chars[0] == stop process signal */
0158 /* chars[1] == delayed stop process signal */
0159 /* chars[2] == reprint line */
0160 /* chars[3] == flush output */
0161 /* chars[4] == word erase */
0162 /* chars[5] == literal next character */
0163 unsigned mode;
0164 };
0165
0166 struct rex_ttysize {
0167 int ts_lines;
0168 int ts_cols;
0169 };
0170
0171 struct rex_ttymode {
0172 sgttyb basic; /* standard unix tty flags */
0173 tchars more; /* interrupt, kill characters, etc. */
0174 ltchars yetmore; /* special Berkeley characters */
0175 unsigned andmore; /* and Berkeley modes */
0176 };
0177
0178 /* values for andmore above */
0179 const LCRTBS = 0x0001; /* do backspacing for crt */
0180 const LPRTERA = 0x0002; /* \ ... / erase */
0181 const LCRTERA = 0x0004; /* " \b " to wipe out char */
0182 const LTILDE = 0x0008; /* hazeltine tilde kludge */
0183 const LMDMBUF = 0x0010; /* start/stop output on carrier intr */
0184 const LLITOUT = 0x0020; /* literal output */
0185 const LTOSTOP = 0x0040; /* SIGTTOU on background output */
0186 const LFLUSHO = 0x0080; /* flush output to terminal */
0187 const LNOHANG = 0x0100; /* no SIGHUP on carrier drop */
0188 const LL001000 = 0x0200;
0189 const LCRTKIL = 0x0400; /* kill line with " \b " */
0190 const LPASS8 = 0x0800;
0191 const LCTLECH = 0x1000; /* echo control chars as ^X */
0192 const LPENDIN = 0x2000; /* needs reread */
0193 const LDECCTQ = 0x4000; /* only ^Q starts after ^S */
0194 const LNOFLSH = 0x8000; /* no output flush on signal */
0195
0196 program REXPROG {
0197 version REXVERS {
0198
0199 /*
0200 * Start remote execution
0201 */
0202 rex_result
0203 REXPROC_START(rex_start) = 1;
0204
0205 /*
0206 * Wait for remote execution to terminate
0207 */
0208 rex_result
0209 REXPROC_WAIT(void) = 2;
0210
0211 /*
0212 * Send tty modes
0213 */
0214 void
0215 REXPROC_MODES(rex_ttymode) = 3;
0216
0217 /*
0218 * Send window size change
0219 */
0220 void
0221 REXPROC_WINCH(rex_ttysize) = 4;
0222
0223 /*
0224 * Send other signal
0225 */
0226 void
0227 REXPROC_SIGNAL(int) = 5;
0228 } = 1;
0229 } = 100017;