Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
5.0 KiB

  1. //Copyright (c) Microsoft Corporation. All rights reserved.
  2. #ifndef TELNET_INCLUDED
  3. #define TELNET_INCLUDED
  4. /*
  5. * Definitions for the TELNET protocol.
  6. */
  7. #define IAC 255 /* interpret as command: */
  8. #define DONT 254 /* you are not to use option */
  9. #define DO 253 /* please, you use option */
  10. #define WONT 252 /* I won't use option */
  11. #define WILL 251 /* I will use option */
  12. #define SB 250 /* interpret as subnegotiation */
  13. #define GA 249 /* you may reverse the line */
  14. #define EL 248 /* erase the current line */
  15. #define EC 247 /* erase the current character */
  16. #define AYT 246 /* are you there */
  17. #define AO 245 /* abort output--but let prog finish */
  18. #define IP 244 /* interrupt process--permanently */
  19. #define BREAK 243 /* break */
  20. #define DM 242 /* data mark--for connect. cleaning */
  21. #define NOP 241 /* nop */
  22. #define SE 240 /* end sub negotiation */
  23. #define SYNCH 242 /* for telfunc calls */
  24. /* Telnet options - Names have been truncated to be unique in 7 chars */
  25. #define TO_BINARY 0 /* 8-bit data path */
  26. #define TO_ECHO 1 /* echo */
  27. #define TO_RCP 2 /* prepare to reconnect */
  28. #define TO_SGA 3 /* suppress go ahead */
  29. #define TO_NAMS 4 /* approximate message size */
  30. #define TO_STATUS 5 /* give status */
  31. #define TO_TM 6 /* timing mark */
  32. #define TO_RCTE 7 /* remote controlled transmission and echo */
  33. #define TO_NL 8 /* negotiate about output line width */
  34. #define TO_NP 9 /* negotiate about output page size */
  35. #define TO_NCRD 10 /* negotiate about CR disposition */
  36. #define TO_NHTS 11 /* negotiate about horizontal tabstops */
  37. #define TO_NHTD 12 /* negotiate about horizontal tab disposition */
  38. #define TO_NFFD 13 /* negotiate about formfeed disposition */
  39. #define TO_NVTS 14 /* negotiate about vertical tab stops */
  40. #define TO_NVTD 15 /* negotiate about vertical tab disposition */
  41. #define TO_NLFD 16 /* negotiate about output LF disposition */
  42. #define TO_XASCII 17 /* extended ascic character set */
  43. #define TO_LOGOUT 18 /* force logout */
  44. #define TO_BM 19 /* byte macro */
  45. #define TO_DET 20 /* data entry terminal */
  46. #define TO_SUPDUP 21 /* supdup protocol */
  47. #define TO_TERM_TYPE 24 /* terminal type */
  48. #define TO_NAWS 31 // Negotiate About Window Size
  49. #define TO_TOGGLE_FLOW_CONTROL 33 /* Enable & disable Flow control */
  50. #define TO_ENVIRON 36 /* Environment Option */
  51. #define TO_NEW_ENVIRON 39 /* New Environment Option */
  52. #define TO_EXOPL 255 /* extended-options-list */
  53. #define TO_AUTH 37
  54. /* Define (real) long names to be the shorter ones */
  55. #define TELOPT_BINARY TO_BINARY
  56. #define TELOPT_ECHO TO_ECHO
  57. #define TELOPT_RCP TO_RCP
  58. #define TELOPT_SGA TO_SGA
  59. #define TELOPT_NAMS TO_NAMS
  60. #define TELOPT_STATUS TO_STATUS
  61. #define TELOPT_TM TO_TM
  62. #define TELOPT_RCTE TO_RCTE
  63. #define TELOPT_NAOL TO_NL
  64. #define TELOPT_NAOP TO_NP
  65. #define TELOPT_NAOCRD TO_NCRD
  66. #define TELOPT_NAOHTS TO_NHTS
  67. #define TELOPT_NAOHTD TO_NHTD
  68. #define TELOPT_NAOFFD TO_NFFD
  69. #define TELOPT_NAOVTS TO_NVTS
  70. #define TELOPT_NAOVTD TO_NVTD
  71. #define TELOPT_NAOLFD TO_NLFD
  72. #define TELOPT_XASCII TO_XASCII
  73. #define TELOPT_LOGOUT TO_LOGOUT
  74. #define TELOPT_BM TO_BM
  75. #define TELOPT_DET TO_DET
  76. #define TELOPT_SUPDUP TO_SUPDUP
  77. #define TELOPT_EXOPL TO_EXOPL
  78. #define TT_SEND 1
  79. #define TT_IS 0
  80. #define VAR 0
  81. #define VALUE 1
  82. #define ESC 2
  83. #define USERVAR 3
  84. #define AU_IS 0
  85. #define AU_SEND 1
  86. #define AU_REPLY 2
  87. #define AU_NAME 3
  88. //Authentication Types
  89. #define AUTH_TYPE_NULL 0
  90. #define AUTH_TYPE_NTLM 15
  91. //Modifiers
  92. #define AUTH_WHO_MASK 1
  93. #define AUTH_CLIENT_TO_SERVER 0
  94. #define AUTH_SERVER_TO_CLIENT 1
  95. #define AUTH_HOW_MASK 2
  96. #define AUTH_HOW_ONE_WAY 0
  97. #define AUTH_HOW_MUTUAL 2
  98. // NTLM Schemes
  99. #define NTLM_AUTH 0
  100. #define NTLM_CHALLENGE 1
  101. #define NTLM_RESPONSE 2
  102. #define NTLM_ACCEPT 3
  103. #define NTLM_REJECT 4
  104. #ifdef TELCMDS
  105. char *telcmds[] = {
  106. "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
  107. "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC",
  108. };
  109. #endif
  110. #ifdef TELOPTS
  111. char *telopts[] = {
  112. "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
  113. "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
  114. "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
  115. "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
  116. "DATA ENTRY TERMINAL", "SUPDUP"
  117. };
  118. #endif
  119. #endif //TELNET_INCLUDED