ttymodes.h 4.9 KB

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