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.

165 lines
6.4 KiB

  1. /* comwsock.hh -- Private header file for winsock communications driver module
  2. *
  3. * Copyright 1996 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 3 $
  7. * $Date: 9/20/00 4:54p $
  8. */
  9. // -=-=-=-=-=-=-=-=-=-=-=- EXPORTED PROTOTYPES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  10. int WINAPI WsckDeviceInitialize(HCOM hCom, unsigned usInterfaceVersion,
  11. void **ppvDriverData);
  12. int WINAPI WsckDeviceClose(void *pstPrivate);
  13. int WINAPI WsckDeviceDialog(void *pstPrivate, HWND hwndParent);
  14. int WINAPI WsckDeviceSpecial(void *pstPrivate,
  15. const TCHAR *pszInstructions,
  16. TCHAR *pszResult,
  17. int nBufrSize);
  18. int WINAPI WsckDeviceLoadHdl(void *pstPrivate, SF_HANDLE sfHdl);
  19. int WINAPI WsckDeviceSaveHdl(void *pstPrivate, SF_HANDLE sfHdl);
  20. int WINAPI WsckDeviceStub(void *pstPrivate);
  21. int WINAPI WsckPortActivate(void *pstPrivate,
  22. TCHAR *pszPortName,
  23. DWORD_PTR dwMediaHdl);
  24. int WINAPI WsckPortDeactivate(void *pstPrivate);
  25. int WINAPI WsckPortConnected(void *pstPrivate);
  26. int WINAPI WsckRcvRefill(void *pstPrivate);
  27. int WINAPI WsckRcvClear(void *pstPrivate);
  28. int WINAPI WsckSndBufrSend(void *pstPrivate, void *pvBufr,
  29. int nSize);
  30. int WINAPI WsckSndBufrIsBusy(void *pstPrivate);
  31. int WINAPI WsckSndBufrQuery(void *pstPrivate, unsigned *pafStatus,
  32. long *plHandshakeDelay);
  33. int WINAPI WsckSndBufrClear(void *pstPrivate);
  34. int WINAPI WsckPortConfigure(void *pstPrivate);
  35. DWORD WINAPI WsckComConnectThread(void *pvData);
  36. DWORD WINAPI WsckComReadThread(void *pvData);
  37. DWORD WINAPI WsckComWriteThread(void *pvData);
  38. #if defined(INCL_WINSOCK)
  39. /*
  40. * This block of defines is used by the Telnet / NVT code,
  41. * and is taken from RFC1143
  42. */
  43. #define NO 1
  44. #define YES 2
  45. #define WANTNO 3
  46. #define WANTYES 4
  47. #define EMPTY 1
  48. #define OPPOSITE 2
  49. #define NONE 3
  50. #define NVT_THRU 0
  51. #define NVT_IAC 1
  52. #define NVT_WILL 2
  53. #define NVT_WONT 3
  54. #define NVT_DO 4
  55. #define NVT_DONT 5
  56. #define NVT_SB 6
  57. #define NVT_SB_TT 7
  58. #define NVT_SB_TT_S 8
  59. #define NVT_SB_TT_S_I 9
  60. #define ECHO_MODE 0
  61. #define SGA_MODE 1
  62. #define TTYPE_MODE 2
  63. #define BINARY_MODE 3
  64. #define NAWS_MODE 4
  65. // If any new modes are added, be sure to update MODE_MAX in comstd.
  66. #define NVT_DISCARD 1
  67. #define NVT_KEEP 2
  68. /*
  69. * Definitions for the TELNET protocol.
  70. */
  71. #define IAC 255 /* interpret as command: */
  72. #define DONT 254 /* you are not to use option */
  73. #define DO 253 /* please, you use option */
  74. #define WONT 252 /* I won't use option */
  75. #define WILL 251 /* I will use option */
  76. #define SB 250 /* interpret as subnegotiation */
  77. #define GA 249 /* you may reverse the line */
  78. #define EL 248 /* erase the current line */
  79. #define EC 247 /* erase the current character */
  80. #define AYT 246 /* are you there */
  81. #define AO 245 /* abort output--but let prog finish */
  82. #define IP 244 /* interrupt process--permanently */
  83. #define BREAK 243 /* break */
  84. #define DM 242 /* data mark--for connect. cleaning */
  85. #define NOP 241 /* nop */
  86. #define SE 240 /* end sub negotiation */
  87. #define EOR 239 /* end of record (transparent mode) */
  88. #define SYNCH 242 /* for telfunc calls */
  89. /* telnet options */
  90. #define TELOPT_BINARY 0 /* 8-bit data path */
  91. #define TELOPT_ECHO 1 /* echo */
  92. #define TELOPT_RCP 2 /* prepare to reconnect */
  93. #define TELOPT_SGA 3 /* suppress go ahead */
  94. #define TELOPT_NAMS 4 /* approximate message size */
  95. #define TELOPT_STATUS 5 /* give status */
  96. #define TELOPT_TM 6 /* timing mark */
  97. #define TELOPT_RCTE 7 /* remote controlled transmission and echo */
  98. #define TELOPT_NAOL 8 /* negotiate about output line width */
  99. #define TELOPT_NAOP 9 /* negotiate about output page size */
  100. #define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
  101. #define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
  102. #define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
  103. #define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
  104. #define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
  105. #define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
  106. #define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
  107. #define TELOPT_XASCII 17 /* extended ascic character set */
  108. #define TELOPT_LOGOUT 18 /* force logout */
  109. #define TELOPT_BM 19 /* byte macro */
  110. #define TELOPT_DET 20 /* data entry terminal */
  111. #define TELOPT_SUPDUP 21 /* supdup protocol */
  112. #define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
  113. #define TELOPT_SNDLOC 23 /* send location */
  114. #define TELOPT_TTYPE 24 /* terminal type */
  115. #define TELOPT_EOR 25 /* end or record */
  116. #define TELOPT_TACACS 26 /* TACACS user identification */
  117. #define TELOPT_OUTMARK 27 /* output marking */
  118. #define TELOPT_TERMLOC 28 /* terminal location number */
  119. #define TELOPT_X3_PAD 30
  120. #define TELOPT_NAWS 31 /* negotiate about terminal size */
  121. #define TELOPT_SPEED 32 /* negotiate terminal speed */
  122. #define TELOPT_TOGGLEFLOW 33 /* toggle flow control */
  123. #define TELOPT_XDISPLOC 35 /* X display location */
  124. #define TELOPT_EXOPL 255 /* extended-options-list */
  125. /* sub-option qualifiers */
  126. #define TELQUAL_IS 0 /* option is... */
  127. #define TELQUAL_SEND 1 /* send option */
  128. #define TELQUAL_OFF 0 /* turn off option */
  129. #define TELQUAL_ON 1 /* turn on option */
  130. #define MAX_IP_ADDR_LEN 128
  131. /* --- These implement the Telnet NVT(network virtual terminal) --- */
  132. VOID WinSockCreateNVT(ST_STDCOM * pstWS);
  133. VOID WinSockReleaseNVT(ST_STDCOM * pstWS);
  134. int FAR PASCAL WinSockNetworkVirtualTerminal(ECHAR mc, void *pD);
  135. VOID WinSockSendMessage(ST_STDCOM * pstWS, INT nMsg, INT nChar);
  136. VOID WinSockSendBuffer(ST_STDCOM * pstWS, INT nSize, LPSTR pszBuffer);
  137. VOID WinSockGotDO (ST_STDCOM * pstWS, const PSTOPT pstO);
  138. VOID WinSockGotWILL(ST_STDCOM * pstWS, const PSTOPT pstO);
  139. VOID WinSockGotDONT(ST_STDCOM * pstWS, const PSTOPT pstO);
  140. VOID WinSockGotWONT(ST_STDCOM * pstWS, const PSTOPT pstO);
  141. VOID WinSockSendNAWS( ST_STDCOM * hhDriver );
  142. #endif