codes.cr 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # This module contains the contants used for Telnet
  2. # Based on code by Jon A. Lambert, under the Zlib license.
  3. class Telnet
  4. module Codes
  5. # Telnet commands
  6. TELNET_IAC = 255
  7. TELNET_DONT = 254
  8. TELNET_DO = 253
  9. TELNET_WONT = 252
  10. TELNET_WILL = 251
  11. TELNET_SB = 250
  12. TELNET_GA = 249
  13. TELNET_EL = 248
  14. TELNET_EC = 247
  15. TELNET_AYT = 246
  16. TELNET_AO = 245
  17. TELNET_IP = 244
  18. TELNET_BREAK = 243
  19. TELNET_DM = 242
  20. TELNET_NOP = 241
  21. TELNET_SE = 240
  22. TELNET_EOR = 239
  23. TELNET_ABORT = 238
  24. TELNET_SUSP = 237
  25. TELNET_EOF = 236
  26. # Telnet options.
  27. TELNET_TELOPT_BINARY = 0
  28. TELNET_TELOPT_ECHO = 1
  29. TELNET_TELOPT_RCP = 2
  30. TELNET_TELOPT_SGA = 3
  31. TELNET_TELOPT_NAMS = 4
  32. TELNET_TELOPT_STATUS = 5
  33. TELNET_TELOPT_TM = 6
  34. TELNET_TELOPT_RCTE = 7
  35. TELNET_TELOPT_NAOL = 8
  36. TELNET_TELOPT_NAOP = 9
  37. TELNET_TELOPT_NAOCRD = 10
  38. TELNET_TELOPT_NAOHTS = 11
  39. TELNET_TELOPT_NAOHTD = 12
  40. TELNET_TELOPT_NAOFFD = 13
  41. TELNET_TELOPT_NAOVTS = 14
  42. TELNET_TELOPT_NAOVTD = 15
  43. TELNET_TELOPT_NAOLFD = 16
  44. TELNET_TELOPT_XASCII = 17
  45. TELNET_TELOPT_LOGOUT = 18
  46. TELNET_TELOPT_BM = 19
  47. TELNET_TELOPT_DET = 20
  48. TELNET_TELOPT_SUPDUP = 21
  49. TELNET_TELOPT_SUPDUPOUTPUT = 22
  50. TELNET_TELOPT_SNDLOC = 23
  51. TELNET_TELOPT_TTYPE = 24
  52. TELNET_TELOPT_EOR = 25
  53. TELNET_TELOPT_TUID = 26
  54. TELNET_TELOPT_OUTMRK = 27
  55. TELNET_TELOPT_TTYLOC = 28
  56. TELNET_TELOPT_3270REGIME = 29
  57. TELNET_TELOPT_X3PAD = 30
  58. TELNET_TELOPT_NAWS = 31
  59. TELNET_TELOPT_TSPEED = 32
  60. TELNET_TELOPT_LFLOW = 33
  61. TELNET_TELOPT_LINEMODE = 34
  62. TELNET_TELOPT_XDISPLOC = 35
  63. TELNET_TELOPT_ENVIRON = 36
  64. TELNET_TELOPT_AUTHENTICATION = 37
  65. TELNET_TELOPT_ENCRYPT = 38
  66. TELNET_TELOPT_NEW_ENVIRON = 39
  67. TELNET_TELOPT_MSDP = 69
  68. TELNET_TELOPT_MSSP = 70
  69. TELNET_TELOPT_COMPRESS = 85
  70. TELNET_TELOPT_COMPRESS2 = 86
  71. TELNET_TELOPT_MSP = 90
  72. TELNET_TELOPT_MXP = 91
  73. TELNET_TELOPT_MSP2 = 92
  74. TELNET_TELOPT_MSP2_MUSIC = 0
  75. TELNET_TELOPT_MSP2_SOUND = 1
  76. TELNET_TELOPT_ZMP = 93
  77. TELNET_TELOPT_EXOPL = 255
  78. TELNET_TELOPT_MCCP2 = 86
  79. # TERMINAL-TYPE codes.
  80. TELNET_TTYPE_IS = 0
  81. TELNET_TTYPE_SEND = 1
  82. # MTTS standard codes
  83. TELNET_MTTS_ANSI = 1
  84. TELNET_MTTS_VT100 = 2
  85. TELNET_MTTS_UTF8 = 4
  86. TELNET_MTTS_256_COLORS = 8
  87. TELNET_MTTS_MOUSE_TRACKING = 16
  88. TELNET_MTTS_OSC_COLOR_PALETTE = 32
  89. TELNET_MTTS_SCREEN_READER = 64
  90. TELNET_MTTS_PROXY = 128
  91. # NEW-ENVIRON/ENVIRON codes.
  92. TELNET_ENVIRON_IS = 0
  93. TELNET_ENVIRON_SEND = 1
  94. TELNET_ENVIRON_INFO = 2
  95. TELNET_ENVIRON_VAR = 0
  96. TELNET_ENVIRON_VALUE = 1
  97. TELNET_ENVIRON_ESC = 2
  98. TELNET_ENVIRON_USERVAR = 3
  99. # MSSP codes.
  100. TELNET_MSSP_VAR = 1
  101. TELNET_MSSP_VAL = 2
  102. # MSDP values.
  103. TELNET_MSDP_VAR = 1
  104. TELNET_MSDP_VAL = 2
  105. TELNET_MSDP_TABLE_OPEN = 3
  106. TELNET_MSDP_TABLE_CLOSE = 4
  107. TELNET_MSDP_ARRAY_OPEN = 5
  108. TELNET_MSDP_ARRAY_CLOSE = 6
  109. # newline, cr and nul
  110. TELNET_CR = 13
  111. TELNET_NL = 10
  112. TELNET_NUL = 0
  113. end
  114. end