hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame sunrpc/rpcsvc/rex.x

Packit 6c4009
/* @(#)rex.x	2.1 88/08/01 4.0 RPCSRC */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 2010, Oracle America, Inc.
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions are
Packit 6c4009
 * met:
Packit 6c4009
 *
Packit 6c4009
 *     * Redistributions of source code must retain the above copyright
Packit 6c4009
 *       notice, this list of conditions and the following disclaimer.
Packit 6c4009
 *     * Redistributions in binary form must reproduce the above
Packit 6c4009
 *       copyright notice, this list of conditions and the following
Packit 6c4009
 *       disclaimer in the documentation and/or other materials
Packit 6c4009
 *       provided with the distribution.
Packit 6c4009
 *     * Neither the name of the "Oracle America, Inc." nor the names of its
Packit 6c4009
 *       contributors may be used to endorse or promote products derived
Packit 6c4009
 *       from this software without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 6c4009
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 6c4009
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Packit 6c4009
 *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Packit 6c4009
 *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Packit 6c4009
 *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit 6c4009
 *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 6c4009
 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit 6c4009
 *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Packit 6c4009
 *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 6c4009
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Remote execution (rex) protocol specification
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
const STRINGSIZE = 1024;
Packit 6c4009
typedef string rexstring<1024>;
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * values to pass to REXPROC_SIGNAL
Packit 6c4009
 */
Packit 6c4009
const SIGINT = 2;	/* interrupt */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Values for rst_flags, below
Packit 6c4009
 */
Packit 6c4009
const REX_INTERACTIVE = 1;	/* interactive mode */
Packit 6c4009
Packit 6c4009
struct rex_start {
Packit 6c4009
	rexstring rst_cmd<>;	/* list of command and args */
Packit 6c4009
	rexstring rst_host;	/* working directory host name */
Packit 6c4009
	rexstring rst_fsname;	/* working directory file system name */
Packit 6c4009
	rexstring rst_dirwithin;/* working directory within file system */
Packit 6c4009
	rexstring rst_env<>;	/* list of environment */
Packit 6c4009
	unsigned int rst_port0;	/* port for stdin */
Packit 6c4009
	unsigned int rst_port1;	/* port for stdout */
Packit 6c4009
	unsigned int rst_port2;	/* port for stderr */
Packit 6c4009
	unsigned int rst_flags;	/* options - see const above */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct rex_result {
Packit 6c4009
   	int rlt_stat;		/* integer status code */
Packit 6c4009
	rexstring rlt_message;	/* string message for human consumption */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
struct sgttyb {
Packit 6c4009
	unsigned four;	/* always equals 4 */
Packit 6c4009
	opaque chars[4];
Packit 6c4009
	/* chars[0] == input speed */
Packit 6c4009
	/* chars[1] == output speed */
Packit 6c4009
	/* chars[2] == kill character */
Packit 6c4009
	/* chars[3] == erase character */
Packit 6c4009
	unsigned flags;
Packit 6c4009
};
Packit 6c4009
/* values for speeds above (baud rates)  */
Packit 6c4009
const B0  = 0;
Packit 6c4009
const B50 = 1;
Packit 6c4009
const B75 = 2;
Packit 6c4009
const B110 = 3;
Packit 6c4009
const B134 = 4;
Packit 6c4009
const B150 = 5;
Packit 6c4009
const B200 = 6;
Packit 6c4009
const B300 = 7;
Packit 6c4009
const B600 = 8;
Packit 6c4009
const B1200 = 9;
Packit 6c4009
const B1800 = 10;
Packit 6c4009
const B2400 = 11;
Packit 6c4009
const B4800 = 12;
Packit 6c4009
const B9600 = 13;
Packit 6c4009
const B19200 = 14;
Packit 6c4009
const B38400 = 15;
Packit 6c4009
Packit 6c4009
/* values for flags above */
Packit 6c4009
const TANDEM = 0x00000001; /* send stopc on out q full */
Packit 6c4009
const CBREAK = 0x00000002; /* half-cooked mode */
Packit 6c4009
const LCASE = 0x00000004; /* simulate lower case */
Packit 6c4009
const ECHO = 0x00000008; /* echo input */
Packit 6c4009
const CRMOD = 0x00000010; /* map \r to \r\n on output */
Packit 6c4009
const RAW = 0x00000020; /* no i/o processing */
Packit 6c4009
const ODDP = 0x00000040; /* get/send odd parity */
Packit 6c4009
const EVENP = 0x00000080; /* get/send even parity */
Packit 6c4009
const ANYP = 0x000000c0; /* get any parity/send none */
Packit 6c4009
const NLDELAY = 0x00000300; /* \n delay */
Packit 6c4009
const  NL0 = 0x00000000;
Packit 6c4009
const  NL1 = 0x00000100; /* tty 37 */
Packit 6c4009
const  NL2 = 0x00000200; /* vt05 */
Packit 6c4009
const  NL3 = 0x00000300;
Packit 6c4009
const TBDELAY = 0x00000c00; /* horizontal tab delay */
Packit 6c4009
const  TAB0 = 0x00000000;
Packit 6c4009
const  TAB1 = 0x00000400; /* tty 37 */
Packit 6c4009
const  TAB2 = 0x00000800;
Packit 6c4009
const XTABS = 0x00000c00; /* expand tabs on output */
Packit 6c4009
const CRDELAY = 0x00003000; /* \r delay */
Packit 6c4009
const  CR0 = 0x00000000;
Packit 6c4009
const  CR1 = 0x00001000; /* tn 300 */
Packit 6c4009
const  CR2 = 0x00002000; /* tty 37 */
Packit 6c4009
const  CR3 = 0x00003000; /* concept 100 */
Packit 6c4009
const VTDELAY = 0x00004000; /* vertical tab delay */
Packit 6c4009
const  FF0 = 0x00000000;
Packit 6c4009
const  FF1 = 0x00004000; /* tty 37 */
Packit 6c4009
const BSDELAY = 0x00008000; /* \b delay */
Packit 6c4009
const  BS0 = 0x00000000;
Packit 6c4009
const  BS1 = 0x00008000;
Packit 6c4009
const CRTBS = 0x00010000; /* do backspacing for crt */
Packit 6c4009
const PRTERA = 0x00020000; /* \ ... / erase */
Packit 6c4009
const CRTERA = 0x00040000; /* " \b " to wipe out char */
Packit 6c4009
const TILDE = 0x00080000; /* hazeltine tilde kludge */
Packit 6c4009
const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
Packit 6c4009
const LITOUT = 0x00200000; /* literal output */
Packit 6c4009
const TOSTOP = 0x00400000; /* SIGTTOU on background output */
Packit 6c4009
const FLUSHO = 0x00800000; /* flush output to terminal */
Packit 6c4009
const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
Packit 6c4009
const L001000 = 0x02000000;
Packit 6c4009
const CRTKIL = 0x04000000; /* kill line with " \b " */
Packit 6c4009
const PASS8 = 0x08000000;
Packit 6c4009
const CTLECH = 0x10000000; /* echo control chars as ^X */
Packit 6c4009
const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
Packit 6c4009
const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
Packit 6c4009
const NOFLSH = 0x80000000; /* no output flush on signal */
Packit 6c4009
Packit 6c4009
struct tchars {
Packit 6c4009
	unsigned six;	/* always equals 6 */
Packit 6c4009
	opaque chars[6];
Packit 6c4009
	/* chars[0] == interrupt char */
Packit 6c4009
	/* chars[1] == quit char */
Packit 6c4009
	/* chars[2] == start output char */
Packit 6c4009
	/* chars[3] == stop output char */
Packit 6c4009
	/* chars[4] == end-of-file char */
Packit 6c4009
	/* chars[5] == input delimiter (like nl) */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct ltchars {
Packit 6c4009
	unsigned six;	/* always equals 6 */
Packit 6c4009
	opaque chars[6];
Packit 6c4009
	/* chars[0] == stop process signal */
Packit 6c4009
	/* chars[1] == delayed stop process signal */
Packit 6c4009
	/* chars[2] == reprint line */
Packit 6c4009
	/* chars[3] == flush output */
Packit 6c4009
	/* chars[4] == word erase */
Packit 6c4009
	/* chars[5] == literal next character */
Packit 6c4009
	unsigned mode;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct rex_ttysize {
Packit 6c4009
	int ts_lines;
Packit 6c4009
	int ts_cols;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct rex_ttymode {
Packit 6c4009
    sgttyb basic;    /* standard unix tty flags */
Packit 6c4009
    tchars more; /* interrupt, kill characters, etc. */
Packit 6c4009
    ltchars yetmore; /* special Berkeley characters */
Packit 6c4009
    unsigned andmore;     /* and Berkeley modes */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* values for andmore above */
Packit 6c4009
const LCRTBS = 0x0001;	/* do backspacing for crt */
Packit 6c4009
const LPRTERA = 0x0002;	/* \ ... / erase */
Packit 6c4009
const LCRTERA = 0x0004;	/* " \b " to wipe out char */
Packit 6c4009
const LTILDE = 0x0008;	/* hazeltine tilde kludge */
Packit 6c4009
const LMDMBUF = 0x0010;	/* start/stop output on carrier intr */
Packit 6c4009
const LLITOUT = 0x0020;	/* literal output */
Packit 6c4009
const LTOSTOP = 0x0040;	/* SIGTTOU on background output */
Packit 6c4009
const LFLUSHO = 0x0080;	/* flush output to terminal */
Packit 6c4009
const LNOHANG = 0x0100;	/* no SIGHUP on carrier drop */
Packit 6c4009
const LL001000 = 0x0200;
Packit 6c4009
const LCRTKIL = 0x0400;	/* kill line with " \b " */
Packit 6c4009
const LPASS8 = 0x0800;
Packit 6c4009
const LCTLECH = 0x1000;	/* echo control chars as ^X */
Packit 6c4009
const LPENDIN = 0x2000;	/* needs reread */
Packit 6c4009
const LDECCTQ = 0x4000;	/* only ^Q starts after ^S */
Packit 6c4009
const LNOFLSH = 0x8000;	/* no output flush on signal */
Packit 6c4009
Packit 6c4009
program REXPROG {
Packit 6c4009
	version REXVERS {
Packit 6c4009
Packit 6c4009
		/*
Packit 6c4009
		 * Start remote execution
Packit 6c4009
		 */
Packit 6c4009
		rex_result
Packit 6c4009
		REXPROC_START(rex_start) = 1;
Packit 6c4009
Packit 6c4009
		/*
Packit 6c4009
		 * Wait for remote execution to terminate
Packit 6c4009
		 */
Packit 6c4009
		rex_result
Packit 6c4009
		REXPROC_WAIT(void) = 2;
Packit 6c4009
Packit 6c4009
		/*
Packit 6c4009
		 * Send tty modes
Packit 6c4009
		 */
Packit 6c4009
		void
Packit 6c4009
		REXPROC_MODES(rex_ttymode) = 3;
Packit 6c4009
Packit 6c4009
		/*
Packit 6c4009
		 * Send window size change
Packit 6c4009
		 */
Packit 6c4009
		void
Packit 6c4009
		REXPROC_WINCH(rex_ttysize) = 4;
Packit 6c4009
Packit 6c4009
		/*
Packit 6c4009
		 * Send other signal
Packit 6c4009
		 */
Packit 6c4009
		void
Packit 6c4009
		REXPROC_SIGNAL(int) = 5;
Packit 6c4009
	} = 1;
Packit 6c4009
} = 100017;