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