blob: 41aad79d61b7974fe362ea737f4b86da9e95265f [file] [log] [blame]
Damien Millerd4a8b7e1999-10-27 13:42:43 +10001/*
Damien Miller4af51302000-04-16 11:18:38 +10002 *
Damien Miller95def091999-11-25 00:26:21 +11003 * ttymodes.h
Damien Miller4af51302000-04-16 11:18:38 +10004 *
Damien Miller95def091999-11-25 00:26:21 +11005 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 * SGTTY stuff contributed by Janne Snabb <snabb@niksula.hut.fi>
Damien Miller4af51302000-04-16 11:18:38 +10007 *
Damien Miller95def091999-11-25 00:26:21 +11008 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
9 * All rights reserved
Damien Miller4af51302000-04-16 11:18:38 +100010 *
Damien Miller95def091999-11-25 00:26:21 +110011 * Created: Tue Mar 21 15:42:09 1995 ylo
Damien Miller4af51302000-04-16 11:18:38 +100012 *
Damien Miller95def091999-11-25 00:26:21 +110013 */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100014
Damien Miller4af51302000-04-16 11:18:38 +100015/* RCSID("$Id: ttymodes.h,v 1.4 2000/04/16 01:18:49 damien Exp $"); */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100016
17/* The tty mode description is a stream of bytes. The stream consists of
Damien Miller95def091999-11-25 00:26:21 +110018 * opcode-arguments pairs. It is terminated by opcode TTY_OP_END (0).
19 * Opcodes 1-127 have one-byte arguments. Opcodes 128-159 have integer
20 * arguments. Opcodes 160-255 are not yet defined, and cause parsing to
21 * stop (they should only be used after any other data).
22 *
23 * The client puts in the stream any modes it knows about, and the
24 * server ignores any modes it does not know about. This allows some degree
25 * of machine-independence, at least between systems that use a posix-like
26 * tty interface. The protocol can support other systems as well, but might
27 * require reimplementing as mode names would likely be different.
28 */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100029
Damien Miller95def091999-11-25 00:26:21 +110030/*
31 * Some constants and prototypes are defined in packet.h; this file
Damien Miller5428f641999-11-25 11:54:57 +110032 * is only intended for including from ttymodes.c.
Damien Miller95def091999-11-25 00:26:21 +110033 */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100034
Damien Miller5428f641999-11-25 11:54:57 +110035/* termios macro */ /* sgtty macro */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100036/* name, op */
Damien Miller5428f641999-11-25 11:54:57 +110037TTYCHAR(VINTR, 1) SGTTYCHAR(tiotc.t_intrc, 1)
38TTYCHAR(VQUIT, 2) SGTTYCHAR(tiotc.t_quitc, 2)
39TTYCHAR(VERASE, 3) SGTTYCHAR(tio.sg_erase, 3)
Damien Millerd4a8b7e1999-10-27 13:42:43 +100040#if defined(VKILL)
Damien Miller5428f641999-11-25 11:54:57 +110041TTYCHAR(VKILL, 4) SGTTYCHAR(tio.sg_kill, 4)
42#endif /* VKILL */
43TTYCHAR(VEOF, 5) SGTTYCHAR(tiotc.t_eofc, 5)
Damien Millerd4a8b7e1999-10-27 13:42:43 +100044#if defined(VEOL)
Damien Miller5428f641999-11-25 11:54:57 +110045TTYCHAR(VEOL, 6) SGTTYCHAR(tiotc.t_brkc, 6)
46#endif /* VEOL */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100047#ifdef VEOL2 /* n/a */
48TTYCHAR(VEOL2, 7)
Damien Miller5428f641999-11-25 11:54:57 +110049#endif /* VEOL2 */
50TTYCHAR(VSTART, 8) SGTTYCHAR(tiotc.t_startc, 8)
51TTYCHAR(VSTOP, 9) SGTTYCHAR(tiotc.t_stopc, 9)
Damien Millerd4a8b7e1999-10-27 13:42:43 +100052#if defined(VSUSP)
Damien Miller5428f641999-11-25 11:54:57 +110053TTYCHAR(VSUSP, 10) SGTTYCHAR(tioltc.t_suspc, 10)
54#endif /* VSUSP */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100055#if defined(VDSUSP)
Damien Miller5428f641999-11-25 11:54:57 +110056TTYCHAR(VDSUSP, 11) SGTTYCHAR(tioltc.t_dsuspc, 11)
57#endif /* VDSUSP */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100058#if defined(VREPRINT)
Damien Miller5428f641999-11-25 11:54:57 +110059TTYCHAR(VREPRINT, 12) SGTTYCHAR(tioltc.t_rprntc, 12)
60#endif /* VREPRINT */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100061#if defined(VWERASE)
Damien Miller5428f641999-11-25 11:54:57 +110062TTYCHAR(VWERASE, 13) SGTTYCHAR(tioltc.t_werasc, 13)
63#endif /* VWERASE */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100064#if defined(VLNEXT)
Damien Miller5428f641999-11-25 11:54:57 +110065TTYCHAR(VLNEXT, 14) SGTTYCHAR(tioltc.t_lnextc, 14)
66#endif /* VLNEXT */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100067#if defined(VFLUSH)
Damien Miller5428f641999-11-25 11:54:57 +110068TTYCHAR(VFLUSH, 15) SGTTYCHAR(tioltc.t_flushc, 15)
69#endif /* VFLUSH */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100070#ifdef VSWTCH
71TTYCHAR(VSWTCH, 16) /* n/a */
Damien Miller5428f641999-11-25 11:54:57 +110072#endif /* VSWTCH */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100073#if defined(VSTATUS)
Damien Miller5428f641999-11-25 11:54:57 +110074TTYCHAR(VSTATUS, 17) SGTTYCHAR(tiots.tc_statusc, 17)
75#endif /* VSTATUS */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100076#ifdef VDISCARD
77TTYCHAR(VDISCARD, 18) /* n/a */
Damien Miller5428f641999-11-25 11:54:57 +110078#endif /* VDISCARD */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100079
80/* name, field, op */
Damien Miller5428f641999-11-25 11:54:57 +110081TTYMODE(IGNPAR, c_iflag, 30) /* n/a */
82TTYMODE(PARMRK, c_iflag, 31) /* n/a */
83TTYMODE(INPCK, c_iflag, 32) SGTTYMODEN(ANYP, tio.sg_flags, 32)
84TTYMODE(ISTRIP, c_iflag, 33) SGTTYMODEN(LPASS8, tiolm, 33)
85TTYMODE(INLCR, c_iflag, 34) /* n/a */
86TTYMODE(IGNCR, c_iflag, 35) /* n/a */
87TTYMODE(ICRNL, c_iflag, 36) SGTTYMODE(CRMOD, tio.sg_flags, 36)
Damien Millerd4a8b7e1999-10-27 13:42:43 +100088#if defined(IUCLC)
Damien Miller5428f641999-11-25 11:54:57 +110089TTYMODE(IUCLC, c_iflag, 37) SGTTYMODE(LCASE, tio.sg_flags, 37)
Damien Millerd4a8b7e1999-10-27 13:42:43 +100090#endif
Damien Miller5428f641999-11-25 11:54:57 +110091TTYMODE(IXON, c_iflag, 38) /* n/a */
92TTYMODE(IXANY, c_iflag, 39) SGTTYMODEN(LDECCTQ, tiolm, 39)
93TTYMODE(IXOFF, c_iflag, 40) SGTTYMODE(TANDEM, tio.sg_flags, 40)
Damien Millerd4a8b7e1999-10-27 13:42:43 +100094#ifdef IMAXBEL
Damien Miller5428f641999-11-25 11:54:57 +110095TTYMODE(IMAXBEL,c_iflag, 41) /* n/a */
96#endif /* IMAXBEL */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100097
Damien Miller5428f641999-11-25 11:54:57 +110098TTYMODE(ISIG, c_lflag, 50) /* n/a */
99TTYMODE(ICANON, c_lflag, 51) SGTTYMODEN(CBREAK, tio.sg_flags, 51)
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000100#ifdef XCASE
Damien Miller5428f641999-11-25 11:54:57 +1100101TTYMODE(XCASE, c_lflag, 52) /* n/a */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000102#endif
Damien Miller5428f641999-11-25 11:54:57 +1100103TTYMODE(ECHO, c_lflag, 53) SGTTYMODE(ECHO, tio.sg_flags, 53)
104TTYMODE(ECHOE, c_lflag, 54) SGTTYMODE(LCRTERA, tiolm, 54)
105TTYMODE(ECHOK, c_lflag, 55) SGTTYMODE(LCRTKIL, tiolm, 55)
106TTYMODE(ECHONL, c_lflag, 56) /* n/a */
107TTYMODE(NOFLSH, c_lflag, 57) SGTTYMODE(LNOFLSH, tiolm, 57)
108TTYMODE(TOSTOP, c_lflag, 58) SGTTYMODE(LTOSTOP, tiolm, 58)
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000109#ifdef IEXTEN
110TTYMODE(IEXTEN, c_lflag, 59) /* n/a */
Damien Miller5428f641999-11-25 11:54:57 +1100111#endif /* IEXTEN */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000112#if defined(ECHOCTL)
Damien Miller5428f641999-11-25 11:54:57 +1100113TTYMODE(ECHOCTL,c_lflag, 60) SGTTYMODE(LCTLECH, tiolm, 60)
114#endif /* ECHOCTL */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000115#ifdef ECHOKE
Damien Miller5428f641999-11-25 11:54:57 +1100116TTYMODE(ECHOKE, c_lflag, 61) /* n/a */
117#endif /* ECHOKE */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000118#if defined(PENDIN)
Damien Miller5428f641999-11-25 11:54:57 +1100119TTYMODE(PENDIN, c_lflag, 62) SGTTYMODE(LPENDIN, tiolm, 62)
120#endif /* PENDIN */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000121
Damien Miller5428f641999-11-25 11:54:57 +1100122TTYMODE(OPOST, c_oflag, 70) /* n/a */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000123#if defined(OLCUC)
Damien Miller5428f641999-11-25 11:54:57 +1100124TTYMODE(OLCUC, c_oflag, 71) SGTTYMODE(LCASE, tio.sg_flags, 71)
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000125#endif
Damien Miller5428f641999-11-25 11:54:57 +1100126TTYMODE(ONLCR, c_oflag, 72) SGTTYMODE(CRMOD, tio.sg_flags, 72)
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000127#ifdef OCRNL
Damien Miller5428f641999-11-25 11:54:57 +1100128TTYMODE(OCRNL, c_oflag, 73) /* n/a */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000129#endif
130#ifdef ONOCR
Damien Miller5428f641999-11-25 11:54:57 +1100131TTYMODE(ONOCR, c_oflag, 74) /* n/a */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000132#endif
133#ifdef ONLRET
Damien Miller5428f641999-11-25 11:54:57 +1100134TTYMODE(ONLRET, c_oflag, 75) /* n/a */
Damien Millerd4a8b7e1999-10-27 13:42:43 +1000135#endif
136
Damien Miller5428f641999-11-25 11:54:57 +1100137TTYMODE(CS7, c_cflag, 90) /* n/a */
138TTYMODE(CS8, c_cflag, 91) SGTTYMODE(LPASS8, tiolm, 91)
139TTYMODE(PARENB, c_cflag, 92) /* n/a */
140TTYMODE(PARODD, c_cflag, 93) SGTTYMODE(ODDP, tio.sg_flags, 93)
141