]> git.ipfire.org Git - thirdparty/glibc.git/blame - sunrpc/rpcsvc/rex.x
Once again change RPC copyright notices.
[thirdparty/glibc.git] / sunrpc / rpcsvc / rex.x
CommitLineData
28f540f4 1/* @(#)rex.x 2.1 88/08/01 4.0 RPCSRC */
28f540f4
RM
2
3/*
a7ab6ec8
UD
4 * Copyright (c) 2010, Oracle America, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
6d52618b 8 *
a7ab6ec8
UD
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following
13 * disclaimer in the documentation and/or other materials
14 * provided with the distribution.
15 * * Neither the name of the "Oracle America, Inc." nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
6d52618b 18 *
a7ab6ec8
UD
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28f540f4
RM
31 */
32
33/*
34 * Remote execution (rex) protocol specification
35 */
36
37const STRINGSIZE = 1024;
38typedef string rexstring<1024>;
39
40/*
41 * values to pass to REXPROC_SIGNAL
42 */
43const SIGINT = 2; /* interrupt */
44
45/*
6d52618b 46 * Values for rst_flags, below
28f540f4
RM
47 */
48const REX_INTERACTIVE = 1; /* interactive mode */
49
50struct rex_start {
51 rexstring rst_cmd<>; /* list of command and args */
52 rexstring rst_host; /* working directory host name */
53 rexstring rst_fsname; /* working directory file system name */
54 rexstring rst_dirwithin;/* working directory within file system */
55 rexstring rst_env<>; /* list of environment */
56 unsigned int rst_port0; /* port for stdin */
57 unsigned int rst_port1; /* port for stdout */
58 unsigned int rst_port2; /* port for stderr */
59 unsigned int rst_flags; /* options - see const above */
60};
61
62struct rex_result {
63 int rlt_stat; /* integer status code */
64 rexstring rlt_message; /* string message for human consumption */
65};
66
67
68struct sgttyb {
69 unsigned four; /* always equals 4 */
70 opaque chars[4];
71 /* chars[0] == input speed */
72 /* chars[1] == output speed */
73 /* chars[2] == kill character */
74 /* chars[3] == erase character */
75 unsigned flags;
76};
77/* values for speeds above (baud rates) */
78const B0 = 0;
79const B50 = 1;
80const B75 = 2;
81const B110 = 3;
82const B134 = 4;
83const B150 = 5;
84const B200 = 6;
85const B300 = 7;
86const B600 = 8;
87const B1200 = 9;
88const B1800 = 10;
89const B2400 = 11;
90const B4800 = 12;
91const B9600 = 13;
92const B19200 = 14;
93const B38400 = 15;
94
95/* values for flags above */
96const TANDEM = 0x00000001; /* send stopc on out q full */
97const CBREAK = 0x00000002; /* half-cooked mode */
98const LCASE = 0x00000004; /* simulate lower case */
99const ECHO = 0x00000008; /* echo input */
100const CRMOD = 0x00000010; /* map \r to \r\n on output */
101const RAW = 0x00000020; /* no i/o processing */
102const ODDP = 0x00000040; /* get/send odd parity */
103const EVENP = 0x00000080; /* get/send even parity */
104const ANYP = 0x000000c0; /* get any parity/send none */
105const NLDELAY = 0x00000300; /* \n delay */
106const NL0 = 0x00000000;
107const NL1 = 0x00000100; /* tty 37 */
108const NL2 = 0x00000200; /* vt05 */
109const NL3 = 0x00000300;
110const TBDELAY = 0x00000c00; /* horizontal tab delay */
111const TAB0 = 0x00000000;
112const TAB1 = 0x00000400; /* tty 37 */
113const TAB2 = 0x00000800;
114const XTABS = 0x00000c00; /* expand tabs on output */
115const CRDELAY = 0x00003000; /* \r delay */
116const CR0 = 0x00000000;
117const CR1 = 0x00001000; /* tn 300 */
118const CR2 = 0x00002000; /* tty 37 */
119const CR3 = 0x00003000; /* concept 100 */
120const VTDELAY = 0x00004000; /* vertical tab delay */
121const FF0 = 0x00000000;
122const FF1 = 0x00004000; /* tty 37 */
123const BSDELAY = 0x00008000; /* \b delay */
124const BS0 = 0x00000000;
125const BS1 = 0x00008000;
126const CRTBS = 0x00010000; /* do backspacing for crt */
127const PRTERA = 0x00020000; /* \ ... / erase */
128const CRTERA = 0x00040000; /* " \b " to wipe out char */
129const TILDE = 0x00080000; /* hazeltine tilde kludge */
130const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
131const LITOUT = 0x00200000; /* literal output */
132const TOSTOP = 0x00400000; /* SIGTTOU on background output */
133const FLUSHO = 0x00800000; /* flush output to terminal */
134const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
135const L001000 = 0x02000000;
136const CRTKIL = 0x04000000; /* kill line with " \b " */
137const PASS8 = 0x08000000;
138const CTLECH = 0x10000000; /* echo control chars as ^X */
139const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
140const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
141const NOFLSH = 0x80000000; /* no output flush on signal */
142
143struct tchars {
144 unsigned six; /* always equals 6 */
145 opaque chars[6];
146 /* chars[0] == interrupt char */
147 /* chars[1] == quit char */
148 /* chars[2] == start output char */
149 /* chars[3] == stop output char */
150 /* chars[4] == end-of-file char */
6d52618b 151 /* chars[5] == input delimiter (like nl) */
28f540f4
RM
152};
153
154struct ltchars {
155 unsigned six; /* always equals 6 */
156 opaque chars[6];
157 /* chars[0] == stop process signal */
158 /* chars[1] == delayed stop process signal */
159 /* chars[2] == reprint line */
160 /* chars[3] == flush output */
161 /* chars[4] == word erase */
162 /* chars[5] == literal next character */
163 unsigned mode;
164};
165
166struct rex_ttysize {
167 int ts_lines;
168 int ts_cols;
169};
170
171struct rex_ttymode {
172 sgttyb basic; /* standard unix tty flags */
173 tchars more; /* interrupt, kill characters, etc. */
174 ltchars yetmore; /* special Berkeley characters */
175 unsigned andmore; /* and Berkeley modes */
176};
177
178/* values for andmore above */
179const LCRTBS = 0x0001; /* do backspacing for crt */
180const LPRTERA = 0x0002; /* \ ... / erase */
181const LCRTERA = 0x0004; /* " \b " to wipe out char */
182const LTILDE = 0x0008; /* hazeltine tilde kludge */
183const LMDMBUF = 0x0010; /* start/stop output on carrier intr */
184const LLITOUT = 0x0020; /* literal output */
185const LTOSTOP = 0x0040; /* SIGTTOU on background output */
186const LFLUSHO = 0x0080; /* flush output to terminal */
187const LNOHANG = 0x0100; /* no SIGHUP on carrier drop */
188const LL001000 = 0x0200;
189const LCRTKIL = 0x0400; /* kill line with " \b " */
190const LPASS8 = 0x0800;
191const LCTLECH = 0x1000; /* echo control chars as ^X */
192const LPENDIN = 0x2000; /* needs reread */
193const LDECCTQ = 0x4000; /* only ^Q starts after ^S */
194const LNOFLSH = 0x8000; /* no output flush on signal */
195
196program REXPROG {
197 version REXVERS {
198
199 /*
200 * Start remote execution
201 */
6d52618b 202 rex_result
28f540f4
RM
203 REXPROC_START(rex_start) = 1;
204
205 /*
206 * Wait for remote execution to terminate
207 */
208 rex_result
209 REXPROC_WAIT(void) = 2;
210
211 /*
212 * Send tty modes
213 */
214 void
215 REXPROC_MODES(rex_ttymode) = 3;
216
217 /*
218 * Send window size change
219 */
220 void
221 REXPROC_WINCH(rex_ttysize) = 4;
222
223 /*
224 * Send other signal
225 */
226 void
227 REXPROC_SIGNAL(int) = 5;
228 } = 1;
229} = 100017;