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