1 /* $OpenBSD: ttymodes.h,v 1.12 2002/03/04 17:27:39 stevesk Exp $ */
3 #pragma ident "%Z%%M% %I% %E% SMI"
6 * NOTE: This file MUST NOT have a header guard added!!!
8 * This header is included twice in ttymodes.c, which defines the TTYCHAR()
9 * and TTYMODE() macros, used below, twice, once prior to inclusion of this
10 * file in tty_make_modes() and once prior to inclusion of this file in
15 * Author: Tatu Ylonen <ylo@cs.hut.fi>
16 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
19 * As far as I am concerned, the code I have written for this software
20 * can be used freely for any purpose. Any derived versions of this
21 * software must be clearly marked as such, and if the derived work is
22 * incompatible with the protocol description in the RFC file, it must be
23 * called by a name other than "ssh" or "Secure Shell".
27 * SSH2 tty modes support by Kevin Steves.
28 * Copyright (c) 2001 Kevin Steves. All rights reserved.
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions
33 * 1. Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * 2. Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in the
37 * documentation and/or other materials provided with the distribution.
39 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
40 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
42 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
43 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
48 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
52 * Use is subject to license terms.
57 * The tty mode description is a stream of bytes. The stream consists of
58 * opcode-arguments pairs. It is terminated by opcode TTY_OP_END (0).
59 * Opcodes 1-127 have one-byte arguments. Opcodes 128-159 have integer
60 * arguments. Opcodes 160-255 are not yet defined, and cause parsing to
61 * stop (they should only be used after any other data).
64 * Differences between SSH1 and SSH2 terminal mode encoding include:
65 * 1. Encoded terminal modes are represented as a string, and a stream
66 * of bytes within that string.
67 * 2. Opcode arguments are uint32 (1-159); 160-255 remain undefined.
68 * 3. The values for TTY_OP_ISPEED and TTY_OP_OSPEED are different;
69 * 128 and 129 vs. 192 and 193 respectively.
71 * The client puts in the stream any modes it knows about, and the
72 * server ignores any modes it does not know about. This allows some degree
73 * of machine-independence, at least between systems that use a posix-like
74 * tty interface. The protocol can support other systems as well, but might
75 * require reimplementing as mode names would likely be different.
79 * Some constants and prototypes are defined in packet.h; this file
80 * is only intended for including from ttymodes.c.
106 #if defined(VREPRINT)
107 TTYCHAR(VREPRINT
, 12)
108 #endif /* VREPRINT */
125 TTYCHAR(VDISCARD
, 18)
126 #endif /* VDISCARD */
128 /* name, field, op */
129 TTYMODE(IGNPAR
, c_iflag
, 30)
130 TTYMODE(PARMRK
, c_iflag
, 31)
131 TTYMODE(INPCK
, c_iflag
, 32)
132 TTYMODE(ISTRIP
, c_iflag
, 33)
133 TTYMODE(INLCR
, c_iflag
, 34)
134 TTYMODE(IGNCR
, c_iflag
, 35)
135 TTYMODE(ICRNL
, c_iflag
, 36)
137 TTYMODE(IUCLC
, c_iflag
, 37)
139 TTYMODE(IXON
, c_iflag
, 38)
140 TTYMODE(IXANY
, c_iflag
, 39)
141 TTYMODE(IXOFF
, c_iflag
, 40)
143 TTYMODE(IMAXBEL
,c_iflag
, 41)
146 TTYMODE(ISIG
, c_lflag
, 50)
147 TTYMODE(ICANON
, c_lflag
, 51)
149 TTYMODE(XCASE
, c_lflag
, 52)
151 TTYMODE(ECHO
, c_lflag
, 53)
152 TTYMODE(ECHOE
, c_lflag
, 54)
153 TTYMODE(ECHOK
, c_lflag
, 55)
154 TTYMODE(ECHONL
, c_lflag
, 56)
155 TTYMODE(NOFLSH
, c_lflag
, 57)
156 TTYMODE(TOSTOP
, c_lflag
, 58)
158 TTYMODE(IEXTEN
, c_lflag
, 59)
161 TTYMODE(ECHOCTL
,c_lflag
, 60)
164 TTYMODE(ECHOKE
, c_lflag
, 61)
167 TTYMODE(PENDIN
, c_lflag
, 62)
170 TTYMODE(OPOST
, c_oflag
, 70)
172 TTYMODE(OLCUC
, c_oflag
, 71)
175 TTYMODE(ONLCR
, c_oflag
, 72)
178 TTYMODE(OCRNL
, c_oflag
, 73)
181 TTYMODE(ONOCR
, c_oflag
, 74)
184 TTYMODE(ONLRET
, c_oflag
, 75)
187 TTYMODE(CS7
, c_cflag
, 90)
188 TTYMODE(CS8
, c_cflag
, 91)
189 TTYMODE(PARENB
, c_cflag
, 92)
190 TTYMODE(PARODD
, c_cflag
, 93)