xref: /illumos-gate/usr/src/uts/common/sys/jioctl.h (revision 2d6eb4a5)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate #ifndef _SYS_JIOCTL_H
27*7c478bd9Sstevel@tonic-gate #define	_SYS_JIOCTL_H
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
30*7c478bd9Sstevel@tonic-gate extern "C" {
31*7c478bd9Sstevel@tonic-gate #endif
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate /*
34*7c478bd9Sstevel@tonic-gate  * jioctl.h
35*7c478bd9Sstevel@tonic-gate  *
36*7c478bd9Sstevel@tonic-gate  * Low level control codes for communication between the host and a
37*7c478bd9Sstevel@tonic-gate  * windowing terminal. See windows.h for additional messages used by
38*7c478bd9Sstevel@tonic-gate  * libwindows.
39*7c478bd9Sstevel@tonic-gate  *
40*7c478bd9Sstevel@tonic-gate  * In case you are wondering what the "j" in jioctl stands for,
41*7c478bd9Sstevel@tonic-gate  * the "j" stands for jerq which was the first windowing terminal.
42*7c478bd9Sstevel@tonic-gate  * The jerq became the Blit which begot the 5620 DMD which begot
43*7c478bd9Sstevel@tonic-gate  * the 615, the 620 and the 630 MTG.
44*7c478bd9Sstevel@tonic-gate  */
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate /*
48*7c478bd9Sstevel@tonic-gate  * Ioctl requests sent to the xt driver. The types JMPX, JWINSIZE,
49*7c478bd9Sstevel@tonic-gate  * and JTRUN are processed locally by xt. The others involve sending
50*7c478bd9Sstevel@tonic-gate  * a control message to the terminal on channel 0 (the control
51*7c478bd9Sstevel@tonic-gate  * channel). In the control message, the lower bytes of these defines
52*7c478bd9Sstevel@tonic-gate  * are used as the first byte of the control message.
53*7c478bd9Sstevel@tonic-gate  *
54*7c478bd9Sstevel@tonic-gate  * Note that packets sent from the host to the terminal on channels
55*7c478bd9Sstevel@tonic-gate  * other than 0 are implicitly data packets.
56*7c478bd9Sstevel@tonic-gate  */
57*7c478bd9Sstevel@tonic-gate 
58*7c478bd9Sstevel@tonic-gate #define	JTYPE		('j'<<8)
59*7c478bd9Sstevel@tonic-gate #define	JBOOT		(JTYPE|1)  /* start a download in a window */
60*7c478bd9Sstevel@tonic-gate #define	JTERM		(JTYPE|2)  /* return to default terminal emulator */
61*7c478bd9Sstevel@tonic-gate #define	JMPX		(JTYPE|3)  /* currently running layers? */
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate /*
64*7c478bd9Sstevel@tonic-gate  * Timeout in seconds. Not supported by streams xt, but reserve
65*7c478bd9Sstevel@tonic-gate  * this number to avoid confusion.
66*7c478bd9Sstevel@tonic-gate  * #define	JTIMO		(JTYPE|4)
67*7c478bd9Sstevel@tonic-gate  */
68*7c478bd9Sstevel@tonic-gate 
69*7c478bd9Sstevel@tonic-gate #define	JWINSIZE	(JTYPE|5)  /* inquire window size */
70*7c478bd9Sstevel@tonic-gate #define	JTIMOM		(JTYPE|6)  /* timeouts in millisecs */
71*7c478bd9Sstevel@tonic-gate #define	JZOMBOOT	(JTYPE|7)  /* JBOOT but wait for debugger to run */
72*7c478bd9Sstevel@tonic-gate #define	JAGENT		(JTYPE|9)  /* control for both directions */
73*7c478bd9Sstevel@tonic-gate #define	JTRUN		(JTYPE|10) /* send runlayer command to layers cmd */
74*7c478bd9Sstevel@tonic-gate #define	JXTPROTO	(JTYPE|11) /* set xt protocol type */
75*7c478bd9Sstevel@tonic-gate 
76*7c478bd9Sstevel@tonic-gate /*
77*7c478bd9Sstevel@tonic-gate  * jwinsize structure used by JWINSIZE message.
78*7c478bd9Sstevel@tonic-gate  */
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate struct jwinsize
81*7c478bd9Sstevel@tonic-gate {
82*7c478bd9Sstevel@tonic-gate 	char	bytesx, bytesy;	/* Window size in characters */
83*7c478bd9Sstevel@tonic-gate 	short	bitsx, bitsy;	/* Window size in bits */
84*7c478bd9Sstevel@tonic-gate };
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate /*
87*7c478bd9Sstevel@tonic-gate  * Channel 0 control message format.
88*7c478bd9Sstevel@tonic-gate  */
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate struct jerqmesg
91*7c478bd9Sstevel@tonic-gate {
92*7c478bd9Sstevel@tonic-gate 	char	cmd;		/* A control code above */
93*7c478bd9Sstevel@tonic-gate 	char	chan;		/* Channel it refers to */
94*7c478bd9Sstevel@tonic-gate };
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /*
97*7c478bd9Sstevel@tonic-gate  * The first byte of every xt packet from the terminal to the host
98*7c478bd9Sstevel@tonic-gate  * is one of these control codes. Data packets start with either
99*7c478bd9Sstevel@tonic-gate  * C_SENDCHAR or C_SENDNCHARS.
100*7c478bd9Sstevel@tonic-gate  *
101*7c478bd9Sstevel@tonic-gate  * The usual format is: [command][data]
102*7c478bd9Sstevel@tonic-gate  */
103*7c478bd9Sstevel@tonic-gate 
104*7c478bd9Sstevel@tonic-gate #define	C_SENDCHAR	1	/* Send character to layer process */
105*7c478bd9Sstevel@tonic-gate #define	C_NEW		2	/* Create a new layer */
106*7c478bd9Sstevel@tonic-gate #define	C_UNBLK		3	/* Unblock layer process */
107*7c478bd9Sstevel@tonic-gate #define	C_DELETE	4	/* Delete layer process group */
108*7c478bd9Sstevel@tonic-gate #define	C_EXIT		5	/* Exit layers */
109*7c478bd9Sstevel@tonic-gate #define	C_DEFUNCT	6	/* Send terminate signal to proc. group */
110*7c478bd9Sstevel@tonic-gate #define	C_SENDNCHARS	7	/* Send several characters to layer proc. */
111*7c478bd9Sstevel@tonic-gate #define	C_RESHAPE	8	/* Layer has been reshaped */
112*7c478bd9Sstevel@tonic-gate #define	C_RUN		9	/* Run command in layer (local to xt/layers) */
113*7c478bd9Sstevel@tonic-gate #define	C_NOFLOW	10	/* Disable network xt flow control */
114*7c478bd9Sstevel@tonic-gate #define	C_YESFLOW	11	/* Enable network xt flow control */
115*7c478bd9Sstevel@tonic-gate 
116*7c478bd9Sstevel@tonic-gate /*
117*7c478bd9Sstevel@tonic-gate  * Format of JAGENT packets.
118*7c478bd9Sstevel@tonic-gate  */
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate struct bagent {
121*7c478bd9Sstevel@tonic-gate 	int size;	/* size of src string going in and dest string out */
122*7c478bd9Sstevel@tonic-gate 	char * src;	/* address of the source byte string */
123*7c478bd9Sstevel@tonic-gate 	char * dest;	/* address of the destination byte string */
124*7c478bd9Sstevel@tonic-gate };
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
127*7c478bd9Sstevel@tonic-gate }
128*7c478bd9Sstevel@tonic-gate #endif
129*7c478bd9Sstevel@tonic-gate 
130*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_JIOCTL_H */
131