1 | /* |
---|
2 | |
---|
3 | ttymodes.h |
---|
4 | |
---|
5 | Author: Tatu Ylonen <ylo@cs.hut.fi> |
---|
6 | SGTTY stuff contributed by Janne Snabb <snabb@niksula.hut.fi> |
---|
7 | |
---|
8 | Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
---|
9 | All rights reserved |
---|
10 | |
---|
11 | Created: Tue Mar 21 15:42:09 1995 ylo |
---|
12 | |
---|
13 | */ |
---|
14 | |
---|
15 | /* |
---|
16 | * $Id: ttymodes.h,v 1.1.1.2 1999-03-08 17:43:36 danw Exp $ |
---|
17 | * $Log: not supported by cvs2svn $ |
---|
18 | * Revision 1.2 1996/11/03 15:57:14 ttsalo |
---|
19 | * tc_statusc -> ts_statusc (line 86) |
---|
20 | * |
---|
21 | * Revision 1.1.1.1 1996/02/18 21:38:10 ylo |
---|
22 | * Imported ssh-1.2.13. |
---|
23 | * |
---|
24 | * Revision 1.3 1995/08/18 22:59:00 ylo |
---|
25 | * Added acknowledgement about Janne Snabb contributing the sgtty |
---|
26 | * code. |
---|
27 | * |
---|
28 | * Revision 1.2 1995/07/13 01:41:22 ylo |
---|
29 | * Removed "Last modified" header. |
---|
30 | * Added cvs log. |
---|
31 | * |
---|
32 | * $Endlog$ |
---|
33 | */ |
---|
34 | |
---|
35 | /* The tty mode description is a stream of bytes. The stream consists of |
---|
36 | opcode-arguments pairs. It is terminated by opcode TTY_OP_END (0). |
---|
37 | Opcodes 1-127 have one-byte arguments. Opcodes 128-159 have integer |
---|
38 | arguments. Opcodes 160-255 are not yet defined, and cause parsing to |
---|
39 | stop (they should only be used after any other data). |
---|
40 | |
---|
41 | The client puts in the stream any modes it knows about, and the |
---|
42 | server ignores any modes it does not know about. This allows some degree |
---|
43 | of machine-independence, at least between systems that use a posix-like |
---|
44 | tty interface. The protocol can support other systems as well, but might |
---|
45 | require reimplementing as mode names would likely be different. */ |
---|
46 | |
---|
47 | /* Some constants and prototypes are defined in packet.h; this file |
---|
48 | is only intended for including from ttymodes.h. */ |
---|
49 | |
---|
50 | /* termios macro */ /* sgtty macro */ |
---|
51 | /* name, op */ |
---|
52 | TTYCHAR(VINTR, 1) SGTTYCHAR(tiotc.t_intrc, 1) |
---|
53 | TTYCHAR(VQUIT, 2) SGTTYCHAR(tiotc.t_quitc, 2) |
---|
54 | TTYCHAR(VERASE, 3) SGTTYCHAR(tio.sg_erase, 3) |
---|
55 | #if defined(VKILL) || defined(USING_SGTTY) |
---|
56 | TTYCHAR(VKILL, 4) SGTTYCHAR(tio.sg_kill, 4) |
---|
57 | #endif /* VKILL */ |
---|
58 | TTYCHAR(VEOF, 5) SGTTYCHAR(tiotc.t_eofc, 5) |
---|
59 | #if defined(VEOL) || defined(USING_SGTTY) |
---|
60 | TTYCHAR(VEOL, 6) SGTTYCHAR(tiotc.t_brkc, 6) |
---|
61 | #endif /* VEOL */ |
---|
62 | #ifdef VEOL2 /* n/a */ |
---|
63 | TTYCHAR(VEOL2, 7) |
---|
64 | #endif /* VEOL2 */ |
---|
65 | TTYCHAR(VSTART, 8) SGTTYCHAR(tiotc.t_startc, 8) |
---|
66 | TTYCHAR(VSTOP, 9) SGTTYCHAR(tiotc.t_stopc, 9) |
---|
67 | #if defined(VSUSP) || defined(USING_SGTTY) |
---|
68 | TTYCHAR(VSUSP, 10) SGTTYCHAR(tioltc.t_suspc, 10) |
---|
69 | #endif /* VSUSP */ |
---|
70 | #if defined(VDSUSP) || defined(USING_SGTTY) |
---|
71 | TTYCHAR(VDSUSP, 11) SGTTYCHAR(tioltc.t_dsuspc, 11) |
---|
72 | #endif /* VDSUSP */ |
---|
73 | #if defined(VREPRINT) || defined(USING_SGTTY) |
---|
74 | TTYCHAR(VREPRINT, 12) SGTTYCHAR(tioltc.t_rprntc, 12) |
---|
75 | #endif /* VREPRINT */ |
---|
76 | #if defined(VWERASE) || defined(USING_SGTTY) |
---|
77 | TTYCHAR(VWERASE, 13) SGTTYCHAR(tioltc.t_werasc, 13) |
---|
78 | #endif /* VWERASE */ |
---|
79 | #if defined(VLNEXT) || defined(USING_SGTTY) |
---|
80 | TTYCHAR(VLNEXT, 14) SGTTYCHAR(tioltc.t_lnextc, 14) |
---|
81 | #endif /* VLNEXT */ |
---|
82 | #if defined(VFLUSH) || defined(USING_SGTTY) |
---|
83 | TTYCHAR(VFLUSH, 15) SGTTYCHAR(tioltc.t_flushc, 15) |
---|
84 | #endif /* VFLUSH */ |
---|
85 | #ifdef VSWTCH |
---|
86 | TTYCHAR(VSWTCH, 16) /* n/a */ |
---|
87 | #endif /* VSWTCH */ |
---|
88 | #if defined(VSTATUS) || (defined(USING_SGTTY) && defined(TIOCGSTAT)) |
---|
89 | TTYCHAR(VSTATUS, 17) SGTTYCHAR(tiots.ts_statusc, 17) |
---|
90 | #endif /* VSTATUS */ |
---|
91 | #ifdef VDISCARD |
---|
92 | TTYCHAR(VDISCARD, 18) /* n/a */ |
---|
93 | #endif /* VDISCARD */ |
---|
94 | |
---|
95 | /* name, field, op */ |
---|
96 | TTYMODE(IGNPAR, c_iflag, 30) /* n/a */ |
---|
97 | TTYMODE(PARMRK, c_iflag, 31) /* n/a */ |
---|
98 | TTYMODE(INPCK, c_iflag, 32) SGTTYMODEN(ANYP, tio.sg_flags, 32) |
---|
99 | TTYMODE(ISTRIP, c_iflag, 33) SGTTYMODEN(LPASS8, tiolm, 33) |
---|
100 | TTYMODE(INLCR, c_iflag, 34) /* n/a */ |
---|
101 | TTYMODE(IGNCR, c_iflag, 35) /* n/a */ |
---|
102 | TTYMODE(ICRNL, c_iflag, 36) SGTTYMODE(CRMOD, tio.sg_flags, 36) |
---|
103 | #if defined(IUCLC) || defined(USING_SGTTY) |
---|
104 | TTYMODE(IUCLC, c_iflag, 37) SGTTYMODE(LCASE, tio.sg_flags, 37) |
---|
105 | #endif |
---|
106 | TTYMODE(IXON, c_iflag, 38) /* n/a */ |
---|
107 | TTYMODE(IXANY, c_iflag, 39) SGTTYMODEN(LDECCTQ, tiolm, 39) |
---|
108 | TTYMODE(IXOFF, c_iflag, 40) SGTTYMODE(TANDEM, tio.sg_flags, 40) |
---|
109 | #ifdef IMAXBEL |
---|
110 | TTYMODE(IMAXBEL,c_iflag, 41) /* n/a */ |
---|
111 | #endif /* IMAXBEL */ |
---|
112 | |
---|
113 | TTYMODE(ISIG, c_lflag, 50) /* n/a */ |
---|
114 | TTYMODE(ICANON, c_lflag, 51) SGTTYMODEN(CBREAK, tio.sg_flags, 51) |
---|
115 | #ifdef XCASE |
---|
116 | TTYMODE(XCASE, c_lflag, 52) /* n/a */ |
---|
117 | #endif |
---|
118 | TTYMODE(ECHO, c_lflag, 53) SGTTYMODE(ECHO, tio.sg_flags, 53) |
---|
119 | TTYMODE(ECHOE, c_lflag, 54) SGTTYMODE(LCRTERA, tiolm, 54) |
---|
120 | TTYMODE(ECHOK, c_lflag, 55) SGTTYMODE(LCRTKIL, tiolm, 55) |
---|
121 | TTYMODE(ECHONL, c_lflag, 56) /* n/a */ |
---|
122 | TTYMODE(NOFLSH, c_lflag, 57) SGTTYMODE(LNOFLSH, tiolm, 57) |
---|
123 | TTYMODE(TOSTOP, c_lflag, 58) SGTTYMODE(LTOSTOP, tiolm, 58) |
---|
124 | #ifdef IEXTEN |
---|
125 | TTYMODE(IEXTEN, c_lflag, 59) /* n/a */ |
---|
126 | #endif /* IEXTEN */ |
---|
127 | #if defined(ECHOCTL) || defined(USING_SGTTY) |
---|
128 | TTYMODE(ECHOCTL,c_lflag, 60) SGTTYMODE(LCTLECH, tiolm, 60) |
---|
129 | #endif /* ECHOCTL */ |
---|
130 | #ifdef ECHOKE |
---|
131 | TTYMODE(ECHOKE, c_lflag, 61) /* n/a */ |
---|
132 | #endif /* ECHOKE */ |
---|
133 | #if defined(PENDIN) || defined(USING_SGTTY) |
---|
134 | TTYMODE(PENDIN, c_lflag, 62) SGTTYMODE(LPENDIN, tiolm, 62) |
---|
135 | #endif /* PENDIN */ |
---|
136 | |
---|
137 | TTYMODE(OPOST, c_oflag, 70) /* n/a */ |
---|
138 | #if defined(OLCUC) || defined(USING_SGTTY) |
---|
139 | TTYMODE(OLCUC, c_oflag, 71) SGTTYMODE(LCASE, tio.sg_flags, 71) |
---|
140 | #endif |
---|
141 | TTYMODE(ONLCR, c_oflag, 72) SGTTYMODE(CRMOD, tio.sg_flags, 72) |
---|
142 | #ifdef OCRNL |
---|
143 | TTYMODE(OCRNL, c_oflag, 73) /* n/a */ |
---|
144 | #endif |
---|
145 | #ifdef ONOCR |
---|
146 | TTYMODE(ONOCR, c_oflag, 74) /* n/a */ |
---|
147 | #endif |
---|
148 | #ifdef ONLRET |
---|
149 | TTYMODE(ONLRET, c_oflag, 75) /* n/a */ |
---|
150 | #endif |
---|
151 | |
---|
152 | TTYMODE(CS7, c_cflag, 90) /* n/a */ |
---|
153 | TTYMODE(CS8, c_cflag, 91) SGTTYMODE(LPASS8, tiolm, 91) |
---|
154 | TTYMODE(PARENB, c_cflag, 92) /* n/a */ |
---|
155 | TTYMODE(PARODD, c_cflag, 93) SGTTYMODE(ODDP, tio.sg_flags, 93) |
---|
156 | |
---|