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