+/* $OpenBSD: ttymodes.h,v 1.13 2004/07/11 17:48:47 deraadt Exp $ */
+
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
- * SGTTY stuff contributed by Janne Snabb <snabb@niksula.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
*
* called by a name other than "ssh" or "Secure Shell".
*/
-/* RCSID("$OpenBSD: ttymodes.h,v 1.10 2001/03/10 15:02:05 stevesk Exp $"); */
+/*
+ * SSH2 tty modes support by Kevin Steves.
+ * Copyright (c) 2001 Kevin Steves. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
-/* The tty mode description is a stream of bytes. The stream consists of
+/*
+ * SSH1:
+ * The tty mode description is a stream of bytes. The stream consists of
* opcode-arguments pairs. It is terminated by opcode TTY_OP_END (0).
* Opcodes 1-127 have one-byte arguments. Opcodes 128-159 have integer
* arguments. Opcodes 160-255 are not yet defined, and cause parsing to
* stop (they should only be used after any other data).
*
+ * SSH2:
+ * Differences between SSH1 and SSH2 terminal mode encoding include:
+ * 1. Encoded terminal modes are represented as a string, and a stream
+ * of bytes within that string.
+ * 2. Opcode arguments are uint32 (1-159); 160-255 remain undefined.
+ * 3. The values for TTY_OP_ISPEED and TTY_OP_OSPEED are different;
+ * 128 and 129 vs. 192 and 193 respectively.
+ *
* The client puts in the stream any modes it knows about, and the
* server ignores any modes it does not know about. This allows some degree
* of machine-independence, at least between systems that use a posix-like
/* name, field, op */
TTYMODE(IGNPAR, c_iflag, 30)
TTYMODE(PARMRK, c_iflag, 31)
-TTYMODE(INPCK, c_iflag, 32)
+TTYMODE(INPCK, c_iflag, 32)
TTYMODE(ISTRIP, c_iflag, 33)
-TTYMODE(INLCR, c_iflag, 34)
-TTYMODE(IGNCR, c_iflag, 35)
-TTYMODE(ICRNL, c_iflag, 36)
+TTYMODE(INLCR, c_iflag, 34)
+TTYMODE(IGNCR, c_iflag, 35)
+TTYMODE(ICRNL, c_iflag, 36)
#if defined(IUCLC)
-TTYMODE(IUCLC, c_iflag, 37)
+TTYMODE(IUCLC, c_iflag, 37)
#endif
-TTYMODE(IXON, c_iflag, 38)
-TTYMODE(IXANY, c_iflag, 39)
-TTYMODE(IXOFF, c_iflag, 40)
+TTYMODE(IXON, c_iflag, 38)
+TTYMODE(IXANY, c_iflag, 39)
+TTYMODE(IXOFF, c_iflag, 40)
#ifdef IMAXBEL
TTYMODE(IMAXBEL,c_iflag, 41)
#endif /* IMAXBEL */
#if defined(OLCUC)
TTYMODE(OLCUC, c_oflag, 71)
#endif
+#ifdef ONLCR
TTYMODE(ONLCR, c_oflag, 72)
+#endif
#ifdef OCRNL
TTYMODE(OCRNL, c_oflag, 73)
#endif