xref: /dragonfly/include/rpcsvc/rex.x (revision 0db87cb7)
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
28  *
29  * @(#)rex.x 1.3 87/09/18 Copyr 1987 Sun Micro
30  * @(#)rex.x	2.1 88/08/01 4.0 RPCSRC
31  * $FreeBSD: src/include/rpcsvc/rex.x,v 1.6 1999/08/27 23:45:10 peter Exp $
32  * $DragonFly: src/include/rpcsvc/rex.x,v 1.2 2003/06/17 04:25:58 dillon Exp $
33  */
34 
35 /*
36  * Remote execution (rex) protocol specification
37  */
38 
39 const STRINGSIZE = 1024;
40 typedef string rexstring<1024>;
41 
42 /*
43  * values to pass to REXPROC_SIGNAL
44  */
45 const SIGINT = 2;	/* interrupt */
46 
47 /*
48  * Values for rst_flags, below
49  */
50 const REX_INTERACTIVE = 1;	/* interactive mode */
51 
52 struct rex_start {
53 	rexstring rst_cmd<>;	/* list of command and args */
54 	rexstring rst_host;	/* working directory host name */
55 	rexstring rst_fsname;	/* working directory file system name */
56 	rexstring rst_dirwithin;/* working directory within file system */
57 	rexstring rst_env<>;	/* list of environment */
58 	unsigned int rst_port0;	/* port for stdin */
59 	unsigned int rst_port1;	/* port for stdout */
60 	unsigned int rst_port2;	/* port for stderr */
61 	unsigned int rst_flags;	/* options - see const above */
62 };
63 
64 struct rex_result {
65    	int rlt_stat;		/* integer status code */
66 	rexstring rlt_message;	/* string message for human consumption */
67 };
68 
69 
70 struct sgttyb {
71 	unsigned four;	/* always equals 4 */
72 	opaque chars[4];
73 	/* chars[0] == input speed */
74 	/* chars[1] == output speed */
75 	/* chars[2] == kill character */
76 	/* chars[3] == erase character */
77 	unsigned flags;
78 };
79 /* values for speeds above (baud rates)  */
80 const B0  = 0;
81 const B50 = 1;
82 const B75 = 2;
83 const B110 = 3;
84 const B134 = 4;
85 const B150 = 5;
86 const B200 = 6;
87 const B300 = 7;
88 const B600 = 8;
89 const B1200 = 9;
90 const B1800 = 10;
91 const B2400 = 11;
92 const B4800 = 12;
93 const B9600 = 13;
94 const B19200 = 14;
95 const B38400 = 15;
96 
97 /* values for flags above */
98 const TANDEM = 0x00000001; /* send stopc on out q full */
99 const CBREAK = 0x00000002; /* half-cooked mode */
100 const LCASE = 0x00000004; /* simulate lower case */
101 const ECHO = 0x00000008; /* echo input */
102 const CRMOD = 0x00000010; /* map \r to \r\n on output */
103 const RAW = 0x00000020; /* no i/o processing */
104 const ODDP = 0x00000040; /* get/send odd parity */
105 const EVENP = 0x00000080; /* get/send even parity */
106 const ANYP = 0x000000c0; /* get any parity/send none */
107 const NLDELAY = 0x00000300; /* \n delay */
108 const  NL0 = 0x00000000;
109 const  NL1 = 0x00000100; /* tty 37 */
110 const  NL2 = 0x00000200; /* vt05 */
111 const  NL3 = 0x00000300;
112 const TBDELAY = 0x00000c00; /* horizontal tab delay */
113 const  TAB0 = 0x00000000;
114 const  TAB1 = 0x00000400; /* tty 37 */
115 const  TAB2 = 0x00000800;
116 const XTABS = 0x00000c00; /* expand tabs on output */
117 const CRDELAY = 0x00003000; /* \r delay */
118 const  CR0 = 0x00000000;
119 const  CR1 = 0x00001000; /* tn 300 */
120 const  CR2 = 0x00002000; /* tty 37 */
121 const  CR3 = 0x00003000; /* concept 100 */
122 const VTDELAY = 0x00004000; /* vertical tab delay */
123 const  FF0 = 0x00000000;
124 const  FF1 = 0x00004000; /* tty 37 */
125 const BSDELAY = 0x00008000; /* \b delay */
126 const  BS0 = 0x00000000;
127 const  BS1 = 0x00008000;
128 const CRTBS = 0x00010000; /* do backspacing for crt */
129 const PRTERA = 0x00020000; /* \ ... / erase */
130 const CRTERA = 0x00040000; /* " \b " to wipe out char */
131 const TILDE = 0x00080000; /* hazeltine tilde kludge */
132 const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
133 const LITOUT = 0x00200000; /* literal output */
134 const TOSTOP = 0x00400000; /* SIGTTOU on background output */
135 const FLUSHO = 0x00800000; /* flush output to terminal */
136 const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
137 const L001000 = 0x02000000;
138 const CRTKIL = 0x04000000; /* kill line with " \b " */
139 const PASS8 = 0x08000000;
140 const CTLECH = 0x10000000; /* echo control chars as ^X */
141 const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
142 const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
143 const NOFLSH = 0x80000000; /* no output flush on signal */
144 
145 struct tchars {
146 	unsigned six;	/* always equals 6 */
147 	opaque chars[6];
148 	/* chars[0] == interrupt char */
149 	/* chars[1] == quit char */
150 	/* chars[2] == start output char */
151 	/* chars[3] == stop output char */
152 	/* chars[4] == end-of-file char */
153 	/* chars[5] == input delimeter (like nl) */
154 };
155 
156 struct ltchars {
157 	unsigned six;	/* always equals 6 */
158 	opaque chars[6];
159 	/* chars[0] == stop process signal */
160 	/* chars[1] == delayed stop process signal */
161 	/* chars[2] == reprint line */
162 	/* chars[3] == flush output */
163 	/* chars[4] == word erase */
164 	/* chars[5] == literal next character */
165 	unsigned mode;
166 };
167 
168 struct rex_ttysize {
169 	int ts_lines;
170 	int ts_cols;
171 };
172 
173 struct rex_ttymode {
174     sgttyb basic;    /* standard unix tty flags */
175     tchars more; /* interrupt, kill characters, etc. */
176     ltchars yetmore; /* special Berkeley characters */
177     unsigned andmore;     /* and Berkeley modes */
178 };
179 
180 /* values for andmore above */
181 const LCRTBS = 0x0001;	/* do backspacing for crt */
182 const LPRTERA = 0x0002;	/* \ ... / erase */
183 const LCRTERA = 0x0004;	/* " \b " to wipe out char */
184 const LTILDE = 0x0008;	/* hazeltine tilde kludge */
185 const LMDMBUF = 0x0010;	/* start/stop output on carrier intr */
186 const LLITOUT = 0x0020;	/* literal output */
187 const LTOSTOP = 0x0040;	/* SIGTTOU on background output */
188 const LFLUSHO = 0x0080;	/* flush output to terminal */
189 const LNOHANG = 0x0100;	/* no SIGHUP on carrier drop */
190 const LL001000 = 0x0200;
191 const LCRTKIL = 0x0400;	/* kill line with " \b " */
192 const LPASS8 = 0x0800;
193 const LCTLECH = 0x1000;	/* echo control chars as ^X */
194 const LPENDIN = 0x2000;	/* needs reread */
195 const LDECCTQ = 0x4000;	/* only ^Q starts after ^S */
196 const LNOFLSH = 0x8000;	/* no output flush on signal */
197 
198 program REXPROG {
199 	version REXVERS {
200 
201 		/*
202 		 * Start remote execution
203 		 */
204 		rex_result
205 		REXPROC_START(rex_start) = 1;
206 
207 		/*
208 		 * Wait for remote execution to terminate
209 		 */
210 		rex_result
211 		REXPROC_WAIT(void) = 2;
212 
213 		/*
214 		 * Send tty modes
215 		 */
216 		void
217 		REXPROC_MODES(rex_ttymode) = 3;
218 
219 		/*
220 		 * Send window size change
221 		 */
222 		void
223 		REXPROC_WINCH(rex_ttysize) = 4;
224 
225 		/*
226 		 * Send other signal
227 		 */
228 		void
229 		REXPROC_SIGNAL(int) = 5;
230 	} = 1;
231 } = 100017;
232