Source code of Windows XP (NT5)
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.

151 lines
4.8 KiB

  1. /*--------------------------------------------------------
  2. servdefs.h
  3. Contains the global type definitions and constant
  4. definitions used for the service & server attributes
  5. used on the server-side of the datacenter.
  6. Copyright (C) 1993 Microsoft Corporation
  7. All rights reserved.
  8. Authors:
  9. rsraghav R.S. Raghavan
  10. History:
  11. 01-14-94 rsraghav Created.
  12. 06-05-94 rsraghav Changed the service state values
  13. 04-19-95 rsraghav Added IP address definitions
  14. -------------------------------------------------------*/
  15. #ifndef _SERVDEFS_H_
  16. #define _SERVDEFS_H_
  17. #if defined(DEBUG) && defined(INLINE)
  18. #undef THIS_FILE
  19. static char BASED_CODE SERVDEFS_H[] = "servdefs.h";
  20. #define THIS_FILE SERVDEFS_H
  21. #endif
  22. // Type definitions of server related attributes.
  23. typedef unsigned short MOS_SERVER_ID; // MSID
  24. typedef unsigned long CPU_INDEX; // CI
  25. typedef WORD MOS_LOCATE_TYPE; // MLT
  26. #if !defined(_MHANDLE_DEFINED)
  27. typedef WORD MHANDLE;
  28. typedef WORD HMCONNECT;
  29. typedef WORD HMSESSION;
  30. typedef WORD HMPIPE;
  31. #define _MHANDLE_DEFINED
  32. #endif
  33. // Constants for server values
  34. #define INVALID_MOS_SERVER_ID_VALUE (0xFFF0)
  35. #define msidInvalid (INVALID_MOS_SERVER_ID_VALUE)
  36. #define msidReservedForTest1 (0XFFEF)
  37. #define msidReservedForTest2 (0XFFEE)
  38. #define msidReservedForTest3 (0XFFED)
  39. #define msidReservedForTest4 (0XFFEC)
  40. #define msidReservedForTest5 (0XFFEB)
  41. #define msidReservedForTest6 (0XFFEA)
  42. // Locate redir values.
  43. #define USE_LOCAL_SERVER 0xffff
  44. #define USE_NO_SERVER 0xfffe
  45. #define USE_LOAD_BALANCED_LOCATE 0xfffd
  46. #define USE_LOAD_BALANCED_LOCATE_INCLUDE_SELF 0xfffc
  47. // Type definitions of service attributes.
  48. typedef unsigned long SERVICE_STATE; // SS
  49. typedef unsigned long SERVICE_VERSION; // SV
  50. // Type definitions of attachment state.
  51. typedef unsigned long ATTACHMENT_STATE; // AS
  52. // Constants for service states (values are kept so that ORing of two states will always give the highest of the two).
  53. // NOTE: This strange number pattern is to reserve 2 bits between each value so that we can add new values without
  54. // changing the existing values and still be able to OR one or more states and get the highest state.
  55. #define SSINVALID (0x00000000)
  56. #define SSSTOPPED (0x00000001)
  57. #define SSLAUNCHING (0x00000009)
  58. #define SSLAUNCHED (0x00000049)
  59. #define SSSYNCHRONIZING (0x00000249)
  60. #define SSSTOPPING (0x00001249)
  61. #define SSACTIVE (0x00009249)
  62. #define SSACTIVEACCEPTING (0x00049249)
  63. // Constants for attachment states.
  64. #define ASATTACHPENDING (0)
  65. #define ASATTACHED (1)
  66. #define ASDETACHPENDING (2)
  67. // Constants for service version. SVANY is used for searching in the Service Map.
  68. #define INVALID_SERVICE_VERSION_VALUE (0xFFFFFFFF)
  69. #define SVDEFAULT (0)
  70. #define SVANY (0xFFFFFFFE)
  71. // IP Address related definitions
  72. typedef DWORD IPADDRESS; // IPA
  73. #define IPADDRESS_INVALID (0xFFFFFFFF)
  74. #define MAX_IPADDRESS_STRING_LENGTH 16 // xxx.xxx.xxx.xxx format (max of 15 chars + \0)
  75. //////////////////////////////////////////////////////////////////////
  76. // CContext related definitions
  77. // Disconnect cause.
  78. enum CONTEXTCLOSESTATUS
  79. {
  80. CCS_DATALINKDROP,
  81. CCS_CLIENTREQ,
  82. CCS_SRVREQ,
  83. CCS_SYSOP,
  84. CCS_COLDREDIR,
  85. CCS_HOTREDIR,
  86. CCS_NOP
  87. };
  88. #define PIPE_CLOSED_STATUS CONTEXTCLOSESTATUS
  89. //////////////////////////////////////////////////////////////////////
  90. // CRouter related definitions
  91. #define ROUTER_NC 0
  92. #define ROUTER_CONNECTED 1
  93. #define ROUTER_CLOSING 2
  94. #define ROUTER_IDLE 3
  95. #define ROUTER_WAIT_OPEN 4
  96. #define ROUTER_WAIT_CLOSE 5
  97. #define ROUTER_GHOST 6 // no more available
  98. #define MCP_VERSION_V1 0
  99. #define MCP_VERSION_V2 1 // transmit intl info @ connect
  100. #define MCP_VERSION_V3 2 // transmit intl info @ connect + failed addr
  101. #define MCP_VERSION_V4 3 // transmit MCP config to client
  102. #define MCP_VERSION_V5 4 // nothing new
  103. #define MCP_VERSION_V6 5 // NAK
  104. #define MCP_VERSION_V7 6 // transmit CLVER (client version)
  105. #define MCP_VERSION_CURRENT MCP_VERSION_V7
  106. #define MCP_VERSION_NA 0x0 // not available
  107. // Disconnect cause.
  108. enum ROUTERUNCONNECTSTATUS
  109. {
  110. RUS_DATALINKDROP, // data link dropped
  111. RUS_CLIENTREQ, // client requested data link drop
  112. RUS_SRVREQ, // server requested data link drop
  113. RUS_SYSOP, // sysop requested data link drop
  114. RUS_NOP,
  115. RUS_DATALINKTIMEOUT, // inactivity time-out
  116. RUS_TOOMANYRETRANS, // too many retransmission
  117. RUS_PUBLICTIMEOUT, // public account access timeout
  118. RUS_TOOMANYPIPES, // attempt to open too many pipes on a public account
  119. RUS_TOOMANY_BAD_PACKETS, // too many back packets from client
  120. RUS_TRANSPORT_ERROR // transport error
  121. };
  122. #define CONNECTION_CLOSED_STATUS ROUTERUNCONNECTSTATUS
  123. #endif // _SERVDEFS_H_