June 2025 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
001: /* @(#)rex.x 2.1 88/08/01 4.0 RPCSRC */ 002: 003: /* 004: * Copyright (c) 2010, Oracle America, Inc. 005: * Redistribution and use in source and binary forms, with or without 006: * modification, are permitted provided that the following conditions are 007: * met: 008: * 009: * * Redistributions of source code must retain the above copyright 010: * notice, this list of conditions and the following disclaimer. 011: * * Redistributions in binary form must reproduce the above 012: * copyright notice, this list of conditions and the following 013: * disclaimer in the documentation and/or other materials 014: * provided with the distribution. 015: * * Neither the name of the "Oracle America, Inc." nor the names of its 016: * contributors may be used to endorse or promote products derived 017: * from this software without specific prior written permission. 018: * 019: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 020: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 021: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 022: * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 023: * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 024: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 025: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 026: * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 027: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 028: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 029: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 030: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 031: */ 032: 033: /* 034: * Remote execution (rex) protocol specification 035: */ 036: 037: const STRINGSIZE = 1024; 038: typedef string rexstring<1024>; 039: 040: /* 041: * values to pass to REXPROC_SIGNAL 042: */ 043: const SIGINT = 2; /* interrupt */ 044: 045: /* 046: * Values for rst_flags, below 047: */ 048: const REX_INTERACTIVE = 1; /* interactive mode */ 049: 050: struct rex_start { 051: rexstring rst_cmd<>; /* list of command and args */ 052: rexstring rst_host; /* working directory host name */ 053: rexstring rst_fsname; /* working directory file system name */ 054: rexstring rst_dirwithin;/* working directory within file system */ 055: rexstring rst_env<>; /* list of environment */ 056: unsigned int rst_port0; /* port for stdin */ 057: unsigned int rst_port1; /* port for stdout */ 058: unsigned int rst_port2; /* port for stderr */ 059: unsigned int rst_flags; /* options - see const above */ 060: }; 061: 062: struct rex_result { 063: int rlt_stat; /* integer status code */ 064: rexstring rlt_message; /* string message for human consumption */ 065: }; 066: 067: 068: struct sgttyb { 069: unsigned four; /* always equals 4 */ 070: opaque chars[4]; 071: /* chars[0] == input speed */ 072: /* chars[1] == output speed */ 073: /* chars[2] == kill character */ 074: /* chars[3] == erase character */ 075: unsigned flags; 076: }; 077: /* values for speeds above (baud rates) */ 078: const B0 = 0; 079: const B50 = 1; 080: const B75 = 2; 081: const B110 = 3; 082: const B134 = 4; 083: const B150 = 5; 084: const B200 = 6; 085: const B300 = 7; 086: const B600 = 8; 087: const B1200 = 9; 088: const B1800 = 10; 089: const B2400 = 11; 090: const B4800 = 12; 091: const B9600 = 13; 092: const B19200 = 14; 093: const B38400 = 15; 094: 095: /* values for flags above */ 096: const TANDEM = 0x00000001; /* send stopc on out q full */ 097: const CBREAK = 0x00000002; /* half-cooked mode */ 098: const LCASE = 0x00000004; /* simulate lower case */ 099: const ECHO = 0x00000008; /* echo input */ 100: const CRMOD = 0x00000010; /* map \r to \r\n on output */ 101: const RAW = 0x00000020; /* no i/o processing */ 102: const ODDP = 0x00000040; /* get/send odd parity */ 103: const EVENP = 0x00000080; /* get/send even parity */ 104: const ANYP = 0x000000c0; /* get any parity/send none */ 105: const NLDELAY = 0x00000300; /* \n delay */ 106: const NL0 = 0x00000000; 107: const NL1 = 0x00000100; /* tty 37 */ 108: const NL2 = 0x00000200; /* vt05 */ 109: const NL3 = 0x00000300; 110: const TBDELAY = 0x00000c00; /* horizontal tab delay */ 111: const TAB0 = 0x00000000; 112: const TAB1 = 0x00000400; /* tty 37 */ 113: const TAB2 = 0x00000800; 114: const XTABS = 0x00000c00; /* expand tabs on output */ 115: const CRDELAY = 0x00003000; /* \r delay */ 116: const CR0 = 0x00000000; 117: const CR1 = 0x00001000; /* tn 300 */ 118: const CR2 = 0x00002000; /* tty 37 */ 119: const CR3 = 0x00003000; /* concept 100 */ 120: const VTDELAY = 0x00004000; /* vertical tab delay */ 121: const FF0 = 0x00000000; 122: const FF1 = 0x00004000; /* tty 37 */ 123: const BSDELAY = 0x00008000; /* \b delay */ 124: const BS0 = 0x00000000; 125: const BS1 = 0x00008000; 126: const CRTBS = 0x00010000; /* do backspacing for crt */ 127: const PRTERA = 0x00020000; /* \ ... / erase */ 128: const CRTERA = 0x00040000; /* " \b " to wipe out char */ 129: const TILDE = 0x00080000; /* hazeltine tilde kludge */ 130: const MDMBUF = 0x00100000; /* start/stop output on carrier intr */ 131: const LITOUT = 0x00200000; /* literal output */ 132: const TOSTOP = 0x00400000; /* SIGTTOU on background output */ 133: const FLUSHO = 0x00800000; /* flush output to terminal */ 134: const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */ 135: const L001000 = 0x02000000; 136: const CRTKIL = 0x04000000; /* kill line with " \b " */ 137: const PASS8 = 0x08000000; 138: const CTLECH = 0x10000000; /* echo control chars as ^X */ 139: const PENDIN = 0x20000000; /* tp->t_rawq needs reread */ 140: const DECCTQ = 0x40000000; /* only ^Q starts after ^S */ 141: const NOFLSH = 0x80000000; /* no output flush on signal */ 142: 143: struct 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 */ 151: /* chars[5] == input delimiter (like nl) */ 152: }; 153: 154: struct 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: 166: struct rex_ttysize { 167: int ts_lines; 168: int ts_cols; 169: }; 170: 171: struct 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 */ 179: const LCRTBS = 0x0001; /* do backspacing for crt */ 180: const LPRTERA = 0x0002; /* \ ... / erase */ 181: const LCRTERA = 0x0004; /* " \b " to wipe out char */ 182: const LTILDE = 0x0008; /* hazeltine tilde kludge */ 183: const LMDMBUF = 0x0010; /* start/stop output on carrier intr */ 184: const LLITOUT = 0x0020; /* literal output */ 185: const LTOSTOP = 0x0040; /* SIGTTOU on background output */ 186: const LFLUSHO = 0x0080; /* flush output to terminal */ 187: const LNOHANG = 0x0100; /* no SIGHUP on carrier drop */ 188: const LL001000 = 0x0200; 189: const LCRTKIL = 0x0400; /* kill line with " \b " */ 190: const LPASS8 = 0x0800; 191: const LCTLECH = 0x1000; /* echo control chars as ^X */ 192: const LPENDIN = 0x2000; /* needs reread */ 193: const LDECCTQ = 0x4000; /* only ^Q starts after ^S */ 194: const LNOFLSH = 0x8000; /* no output flush on signal */ 195: 196: program REXPROG { 197: version REXVERS { 198: 199: /* 200: * Start remote execution 201: */ 202: rex_result 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; 230: