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.

180 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. cachedef.h
  5. Abstract:
  6. contains data definitions for cache code.
  7. Author:
  8. Madan Appiah (madana) 12-Apr-1995
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #include <iisver.h>
  14. #include <spxinfo.h>
  15. #ifndef _SVCDEF_
  16. #define _SVCDEF_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. //
  21. // defines.
  22. //
  23. #define INET_MAJOR_VERSION VER_IISMAJORVERSION
  24. #define INET_MINOR_VERSION VER_IISMINORVERSION
  25. #define LOCK_SVC_GLOBAL_DATA() EnterCriticalSection( &GlobalSvclocCritSect )
  26. #define UNLOCK_SVC_GLOBAL_DATA() LeaveCriticalSection( &GlobalSvclocCritSect )
  27. #define SVCLOC_SRV_RECV_BUFFER_SIZE 0x400 // 1k buffer.
  28. #define SVCLOC_SRV_ADDRESS_BUFFER 0x1000 // 4k buffer
  29. #define SVCLOC_CLI_QUERY_RESP_BUF_SIZE 0x400 // 1 buffer
  30. //
  31. // service location thread shutdown timeout.
  32. //
  33. #define THREAD_TERMINATION_TIMEOUT 60000 // in msecs. 60 secs
  34. #define RESPONSE_WAIT_TIMEOUT 60000 // in msecs. 60 secs
  35. #define WS_VERSION_REQUIRED MAKEWORD( 1, 1)
  36. //
  37. // the fields of the GUID, generated using uuidgen
  38. //
  39. #define ssgData1 0xa5569b20
  40. #define ssgData2 0xabe5
  41. #define ssgData3 0x11ce
  42. #define ssgData41 0x9c
  43. #define ssgData42 0xa4
  44. #define ssgData43 0x00
  45. #define ssgData44 0x00
  46. #define ssgData45 0x4c
  47. #define ssgData46 0x75
  48. #define ssgData47 0x27
  49. #define ssgData48 0x31
  50. #define SERVICE_GUID_STR "A5569B20ABE511CE9CA400004C762832"
  51. #define NETBIOS_INET_GROUP_NAME "INet~Services \034"
  52. #define NETBIOS_INET_GROUP_NAME_LEN \
  53. (sizeof(NETBIOS_INET_GROUP_NAME) - 1)
  54. #define NETBIOS_INET_UNIQUE_NAME "I~"
  55. #define NETBIOS_INET_UNIQUE_NAME_LEN \
  56. (sizeof(NETBIOS_INET_UNIQUE_NAME) - 1)
  57. #define NETBIOS_INET_SERVER_UNIQUE_NAME "IS~"
  58. #define NETBIOS_INET_SERVER_UNIQUE_NAME_LEN \
  59. (sizeof(NETBIOS_INET_SERVER_UNIQUE_NAME) - 1)
  60. #define INET_SERVER_RESPONSE_TIMEOUT 15 * 60 // in secs.
  61. #define INET_DISCOVERY_RETRY_TIMEOUT 5 * 60 // in secs.
  62. #define SVCLOC_NB_RECV_TIMEOUT 2 * 60 // in secs.
  63. #define SAP_SERVICE_NAME_LEN (MAX_COMPUTERNAME_LENGTH + 32)
  64. #define SAP_ADDRESS_LENGTH 15
  65. #define IPX_ADDRESS_LENGTH 12
  66. #define SAP_MAXRECV_LENGTH 544 // ??
  67. //
  68. // typedefs
  69. //
  70. //
  71. // to form a list of server list.
  72. //
  73. typedef struct _LIST_SERVER_INFO {
  74. LIST_ENTRY NextEntry;
  75. INET_SERVER_INFO ServerInfo;
  76. } LIST_SERVER_INFO, *LPLIST_SERVER_INFO;
  77. typedef struct _CLIENT_QUERY_RESPONSE {
  78. LIST_ENTRY NextEntry;
  79. SOCKET ReceivedSocket;
  80. LPBYTE ResponseBuffer;
  81. DWORD ResponseBufferLength;
  82. SOCKADDR *SourcesAddress;
  83. DWORD SourcesAddressLength;
  84. time_t TimeStamp;
  85. } CLIENT_QUERY_RESPONSE, *LPCLIENT_QUERY_RESPONSE;
  86. typedef struct _CLIENT_QUERY_MESSAGE {
  87. DWORD MsgLength;
  88. DWORD MsgVersion;
  89. ULONGLONG ServicesMask;
  90. CHAR ClientName[1]; // embedded string.
  91. } CLIENT_QUERY_MESSAGE, *LPCLIENT_QUERY_MESSAGE;
  92. //
  93. // Sap service query packet format
  94. //
  95. typedef struct _SAP_REQUEST {
  96. WORD QueryType;
  97. WORD ServerType;
  98. } SAP_REQUEST, *PSAP_REQUEST;
  99. //
  100. // Sap server identification packet format
  101. //
  102. typedef struct _SAP_IDENT_HEADER {
  103. WORD ServerType;
  104. BYTE ServerName[48];
  105. BYTE Address[IPX_ADDRESS_LENGTH];
  106. WORD HopCount;
  107. } SAP_IDENT_HEADER, *LPSAP_IDENT_HEADER;
  108. typedef struct _SAP_ADDRESS_INFO {
  109. CHAR ServerName[MAX_COMPUTERNAME_LENGTH+1];
  110. BYTE Address[IPX_ADDRESS_LENGTH];
  111. WORD HopCount;
  112. } SAP_ADDRESS_INFO, *LPSAP_ADDRESS_INFO;
  113. typedef struct _SAP_ADDRESS_ENTRY {
  114. LIST_ENTRY Next;
  115. SAP_ADDRESS_INFO Address;
  116. } SAP_ADDRESS_ENTRY, *LPSAP_ADDRESS_ENTRY;
  117. typedef struct _SVCLOC_NETBIOS_RESPONSE {
  118. LPBYTE ResponseBuffer;
  119. DWORD ResponseBufLen;
  120. SOCKADDR_NB SourcesAddress;
  121. DWORD SourcesAddrLen;
  122. } SVCLOC_NETBIOS_RESPONSE, *LPSVCLOC_NETBIOS_RESPONSE;
  123. typedef struct _SVCLOC_NETBIOS_RESP_ENTRY {
  124. LIST_ENTRY Next;
  125. SVCLOC_NETBIOS_RESPONSE Resp;
  126. } SVCLOC_NETBIOS_RESP_ENTRY, *LPSVCLOC_NETBIOS_RESP_ENTRY;
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130. #endif // _SVCDEF_
  131.