1 /* $NetBSD: ttymodes.h,v 1.8 2017/10/07 19:39:19 christos Exp $ */ 2 /* $OpenBSD: ttymodes.h,v 1.16 2017/04/30 23:26:54 djm Exp $ */ 3 4 /* 5 * Author: Tatu Ylonen <ylo@cs.hut.fi> 6 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 7 * All rights reserved 8 * 9 * As far as I am concerned, the code I have written for this software 10 * can be used freely for any purpose. Any derived versions of this 11 * software must be clearly marked as such, and if the derived work is 12 * incompatible with the protocol description in the RFC file, it must be 13 * called by a name other than "ssh" or "Secure Shell". 14 */ 15 16 /* 17 * SSH2 tty modes support by Kevin Steves. 18 * Copyright (c) 2001 Kevin Steves. All rights reserved. 19 * 20 * Redistribution and use in source and binary forms, with or without 21 * modification, are permitted provided that the following conditions 22 * are met: 23 * 1. Redistributions of source code must retain the above copyright 24 * notice, this list of conditions and the following disclaimer. 25 * 2. Redistributions in binary form must reproduce the above copyright 26 * notice, this list of conditions and the following disclaimer in the 27 * documentation and/or other materials provided with the distribution. 28 * 29 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 30 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 31 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 32 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 33 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 34 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 38 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 */ 40 41 /* 42 * The tty mode description is a string, consisting of 43 * opcode-arguments pairs. It is terminated by opcode TTY_OP_END (0). 44 * Opcodes 1-159 have uint32 arguments. 45 * Opcodes 160-255 are not yet defined and cause parsing to stop (they 46 * should only be used after any other data). 47 * 48 * The client puts in the string any modes it knows about, and the 49 * server ignores any modes it does not know about. This allows some degree 50 * of machine-independence, at least between systems that use a posix-like 51 * tty interface. The protocol can support other systems as well, but might 52 * require reimplementing as mode names would likely be different. 53 */ 54 55 /* 56 * Some constants and prototypes are defined in packet.h; this file 57 * is only intended for including from ttymodes.c. 58 */ 59 60 /* termios macro */ 61 /* name, op */ 62 TTYCHAR(VINTR, 1) 63 TTYCHAR(VQUIT, 2) 64 TTYCHAR(VERASE, 3) 65 #if defined(VKILL) 66 TTYCHAR(VKILL, 4) 67 #endif /* VKILL */ 68 TTYCHAR(VEOF, 5) 69 #if defined(VEOL) 70 TTYCHAR(VEOL, 6) 71 #endif /* VEOL */ 72 #ifdef VEOL2 73 TTYCHAR(VEOL2, 7) 74 #endif /* VEOL2 */ 75 TTYCHAR(VSTART, 8) 76 TTYCHAR(VSTOP, 9) 77 #if defined(VSUSP) 78 TTYCHAR(VSUSP, 10) 79 #endif /* VSUSP */ 80 #if defined(VDSUSP) 81 TTYCHAR(VDSUSP, 11) 82 #endif /* VDSUSP */ 83 #if defined(VREPRINT) 84 TTYCHAR(VREPRINT, 12) 85 #endif /* VREPRINT */ 86 #if defined(VWERASE) 87 TTYCHAR(VWERASE, 13) 88 #endif /* VWERASE */ 89 #if defined(VLNEXT) 90 TTYCHAR(VLNEXT, 14) 91 #endif /* VLNEXT */ 92 #if defined(VFLUSH) 93 TTYCHAR(VFLUSH, 15) 94 #endif /* VFLUSH */ 95 #ifdef VSWTCH 96 TTYCHAR(VSWTCH, 16) 97 #endif /* VSWTCH */ 98 #if defined(VSTATUS) 99 TTYCHAR(VSTATUS, 17) 100 #endif /* VSTATUS */ 101 #ifdef VDISCARD 102 TTYCHAR(VDISCARD, 18) 103 #endif /* VDISCARD */ 104 105 /* name, field, op */ 106 TTYMODE(IGNPAR, c_iflag, 30) 107 TTYMODE(PARMRK, c_iflag, 31) 108 TTYMODE(INPCK, c_iflag, 32) 109 TTYMODE(ISTRIP, c_iflag, 33) 110 TTYMODE(INLCR, c_iflag, 34) 111 TTYMODE(IGNCR, c_iflag, 35) 112 TTYMODE(ICRNL, c_iflag, 36) 113 #if defined(IUCLC) 114 TTYMODE(IUCLC, c_iflag, 37) 115 #endif 116 TTYMODE(IXON, c_iflag, 38) 117 TTYMODE(IXANY, c_iflag, 39) 118 TTYMODE(IXOFF, c_iflag, 40) 119 #ifdef IMAXBEL 120 TTYMODE(IMAXBEL,c_iflag, 41) 121 #endif /* IMAXBEL */ 122 #ifdef IUTF8 123 TTYMODE(IUTF8, c_iflag, 42) 124 #endif /* IUTF8 */ 125 126 TTYMODE(ISIG, c_lflag, 50) 127 TTYMODE(ICANON, c_lflag, 51) 128 #ifdef XCASE 129 TTYMODE(XCASE, c_lflag, 52) 130 #endif 131 TTYMODE(ECHO, c_lflag, 53) 132 TTYMODE(ECHOE, c_lflag, 54) 133 TTYMODE(ECHOK, c_lflag, 55) 134 TTYMODE(ECHONL, c_lflag, 56) 135 TTYMODE(NOFLSH, c_lflag, 57) 136 TTYMODE(TOSTOP, c_lflag, 58) 137 #ifdef IEXTEN 138 TTYMODE(IEXTEN, c_lflag, 59) 139 #endif /* IEXTEN */ 140 #if defined(ECHOCTL) 141 TTYMODE(ECHOCTL,c_lflag, 60) 142 #endif /* ECHOCTL */ 143 #ifdef ECHOKE 144 TTYMODE(ECHOKE, c_lflag, 61) 145 #endif /* ECHOKE */ 146 #if defined(PENDIN) 147 TTYMODE(PENDIN, c_lflag, 62) 148 #endif /* PENDIN */ 149 150 TTYMODE(OPOST, c_oflag, 70) 151 #if defined(OLCUC) 152 TTYMODE(OLCUC, c_oflag, 71) 153 #endif 154 TTYMODE(ONLCR, c_oflag, 72) 155 #ifdef OCRNL 156 TTYMODE(OCRNL, c_oflag, 73) 157 #endif 158 #ifdef ONOCR 159 TTYMODE(ONOCR, c_oflag, 74) 160 #endif 161 #ifdef ONLRET 162 TTYMODE(ONLRET, c_oflag, 75) 163 #endif 164 165 TTYMODE(CS7, c_cflag, 90) 166 TTYMODE(CS8, c_cflag, 91) 167 TTYMODE(PARENB, c_cflag, 92) 168 TTYMODE(PARODD, c_cflag, 93) 169