summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/jioctl.h
blob: f79d4df24df89b633c7ec12ca1ce4263e28158ed (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
/*	  All Rights Reserved  	*/


#ifndef _SYS_JIOCTL_H
#define	_SYS_JIOCTL_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 11.5	*/

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * jioctl.h
 *
 * Low level control codes for communication between the host and a
 * windowing terminal. See windows.h for additional messages used by
 * libwindows.
 *
 * In case you are wondering what the "j" in jioctl stands for,
 * the "j" stands for jerq which was the first windowing terminal.
 * The jerq became the Blit which begot the 5620 DMD which begot
 * the 615, the 620 and the 630 MTG.
 */


/*
 * Ioctl requests sent to the xt driver. The types JMPX, JWINSIZE,
 * and JTRUN are processed locally by xt. The others involve sending
 * a control message to the terminal on channel 0 (the control
 * channel). In the control message, the lower bytes of these defines
 * are used as the first byte of the control message.
 *
 * Note that packets sent from the host to the terminal on channels
 * other than 0 are implicitly data packets.
 */

#define	JTYPE		('j'<<8)
#define	JBOOT		(JTYPE|1)  /* start a download in a window */
#define	JTERM		(JTYPE|2)  /* return to default terminal emulator */
#define	JMPX		(JTYPE|3)  /* currently running layers? */

/*
 * Timeout in seconds. Not supported by streams xt, but reserve
 * this number to avoid confusion.
 * #define	JTIMO		(JTYPE|4)
 */

#define	JWINSIZE	(JTYPE|5)  /* inquire window size */
#define	JTIMOM		(JTYPE|6)  /* timeouts in millisecs */
#define	JZOMBOOT	(JTYPE|7)  /* JBOOT but wait for debugger to run */
#define	JAGENT		(JTYPE|9)  /* control for both directions */
#define	JTRUN		(JTYPE|10) /* send runlayer command to layers cmd */
#define	JXTPROTO	(JTYPE|11) /* set xt protocol type */

/*
 * jwinsize structure used by JWINSIZE message.
 */

struct jwinsize
{
	char	bytesx, bytesy;	/* Window size in characters */
	short	bitsx, bitsy;	/* Window size in bits */
};

/*
 * Channel 0 control message format.
 */

struct jerqmesg
{
	char	cmd;		/* A control code above */
	char	chan;		/* Channel it refers to */
};

/*
 * The first byte of every xt packet from the terminal to the host
 * is one of these control codes. Data packets start with either
 * C_SENDCHAR or C_SENDNCHARS.
 *
 * The usual format is: [command][data]
 */

#define	C_SENDCHAR	1	/* Send character to layer process */
#define	C_NEW		2	/* Create a new layer */
#define	C_UNBLK		3	/* Unblock layer process */
#define	C_DELETE	4	/* Delete layer process group */
#define	C_EXIT		5	/* Exit layers */
#define	C_DEFUNCT	6	/* Send terminate signal to proc. group */
#define	C_SENDNCHARS	7	/* Send several characters to layer proc. */
#define	C_RESHAPE	8	/* Layer has been reshaped */
#define	C_RUN		9	/* Run command in layer (local to xt/layers) */
#define	C_NOFLOW	10	/* Disable network xt flow control */
#define	C_YESFLOW	11	/* Enable network xt flow control */

/*
 * Format of JAGENT packets.
 */

struct bagent {
	int size;	/* size of src string going in and dest string out */
	char * src;	/* address of the source byte string */
	char * dest;	/* address of the destination byte string */
};

#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_JIOCTL_H */