Stm.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:9k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) 1995-1999 Microsoft Corporation
  3. Module Name:
  4.     stm.h
  5. Abstract:
  6.     This module contains the definitions of the IPX Service Table Manger APIs
  7. Author:
  8. Revision History:
  9. --*/
  10. #ifndef __ROUTING_STM_H__
  11. #define __ROUTING_STM_H__
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. #if _MSC_VER >= 1200
  16. #pragma warning(push)
  17. #endif
  18. #pragma warning(disable:4201)
  19. //////////////////////////////////////////////////////////////////////////////
  20. //                                                                          //
  21. // Supported functionality flags                                            //
  22. //                                                                          //
  23. // ROUTING                  Imports Routing Table Manager APIs              //
  24. // SERVICES                 Exports Service Table Manager APIs              //
  25. // DEMAND_UPDATE_ROUTES     IP and IPX RIP support for Autostatic           //
  26. // DEMAND_UPDATE_SERVICES   IPX SAP, NLSP support for Autostatic            //
  27. //                                                                          //
  28. //////////////////////////////////////////////////////////////////////////////
  29. #define SERVICES                0x00000002
  30. #define DEMAND_UPDATE_SERVICES  0x00000008
  31. //
  32. // Server Entry
  33. //
  34. typedef struct _IPX_SERVER_ENTRY
  35. {
  36.     USHORT Type;
  37.     UCHAR Name[48];
  38.     UCHAR Network[4];
  39.     UCHAR Node[6];
  40.     UCHAR Socket[2];
  41.     USHORT HopCount;
  42. } IPX_SERVER_ENTRY, *PIPX_SERVER_ENTRY;
  43. typedef struct _IPX_SERVICE
  44. {
  45.     ULONG         InterfaceIndex;
  46.     ULONG             Protocol; // protocol from which knowledge of the service was obatined
  47.     IPX_SERVER_ENTRY Server;
  48. } IPX_SERVICE, *PIPX_SERVICE;
  49. // Function which returns TRUE if the service exists
  50. typedef
  51. BOOL
  52. (WINAPI * PIS_SERVICE)(
  53.       IN USHORT  Type,
  54.       IN PUCHAR  Name,
  55.       OUT PIPX_SERVICE Service OPTIONAL
  56.       );
  57. // Exclusion flags.  Limit enumeration to only servers that
  58. // have same values of the specified by flags parameter(s) as those of
  59. // criterea service.
  60. #define STM_ONLY_THIS_INTERFACE     0x00000001
  61. #define STM_ONLY_THIS_PROTOCOL     0x00000002
  62. #define STM_ONLY_THIS_TYPE         0x00000004
  63. #define STM_ONLY_THIS_NAME         0x00000008
  64. // Ordering methods. Specify the order in which services should be
  65. // retreived (methods are mutually exclusive).
  66. #define STM_ORDER_BY_TYPE_AND_NAME     0
  67. #define STM_ORDER_BY_INTERFACE_TYPE_NAME 1
  68. // Create handle to start enumeration of the services in the STM table.
  69. // Returns handle to be used for enumerations or NULL if operation failed
  70. // GetLastError () returns the follwing error codes in case of failure:
  71. // ERROR_CAN_NOT_COMPLETE
  72. // ERROR_NOT_ENOUGH_MEMORY
  73. typedef
  74. HANDLE
  75. (WINAPI * PCREATE_SERVICE_ENUMERATION_HANDLE)(
  76.     IN  DWORD           ExclusionFlags, // Flags to limit enumeration to certain
  77.                                         // types of servers
  78.     IN PIPX_SERVICE  CriteriaService // Criteria for exclusion flags
  79.     );
  80. // Get next service in the enumeration started by CreateServiceEnumerationHandle
  81. // Returns NO_ERROR if next service was placed in provided buffer or
  82. // ERROR_NO_MORE_ITEMS when there are no more services to be
  83. // returned in the enumeration; ERROR_CAN_NOT_COMPLETE will be
  84. // returned if operation failed.
  85. typedef
  86. DWORD
  87. (WINAPI * PENUMERATE_GET_NEXT_SERVICE)(
  88.     IN  HANDLE          EnumerationHandle, // Handle that identifies this
  89.                                            // enumeration
  90.     OUT PIPX_SERVICE  Service     // buffer to place parameters of next service entry
  91. // to be returned by enumeration
  92.     );
  93. // Frees resources associated with enumeration.
  94. // Returns NO_ERROR if operation succeded, ERROR_CAN_NOT_COMPLETE
  95. // otherwise
  96. typedef
  97. DWORD
  98. (WINAPI * PCLOSE_SERVICE_ENUMERATION_HANDLE)(
  99.     IN HANDLE        EnumerationHandle
  100.     );
  101. // Get total number of known services
  102. typedef
  103. ULONG
  104. (WINAPI * PGET_SERVICE_COUNT)(
  105. VOID
  106. );
  107. // Add service of IPX_PROTOCOL_STATIC to the table
  108. typedef
  109. DWORD
  110. (WINAPI * PCREATE_STATIC_SERVICE)(IN ULONG InterfaceIndex,
  111.        IN PIPX_SERVER_ENTRY ServerEntry);
  112. // Delete service of IPX_PROTOCOL_STATIC from the table
  113. typedef
  114. DWORD
  115. (WINAPI * PDELETE_STATIC_SERVICE)(IN ULONG InterfaceIndex,
  116.        IN PIPX_SERVER_ENTRY ServerEntry);
  117. // Converts protocol of all services associated with given interface to
  118. // IPX_PROTOCOL_STATIC
  119. typedef
  120. DWORD
  121. (WINAPI * PBLOCK_CONVERT_SERVICES_TO_STATIC) (
  122. IN ULONG InterfaceIndex
  123. );
  124. // Delete all services of IPX_PROTOCOL_STATIC
  125. // associated with  given interface from the table
  126. typedef
  127. DWORD
  128. (WINAPI * PBLOCK_DELETE_STATIC_SERVICES)(
  129. IN ULONG InterfaceIndex
  130. );
  131. // Find and return first service in the order specified by the ordering method.
  132. // Search is limited only to ceratin types of services as specified by the
  133. // exclusion flags end corresponding fields in Service parameter.
  134. // Returns ERROR_NO_MORE_ITEMS if there are no services in the
  135. // table that meet specified criteria.
  136. typedef
  137. DWORD
  138. (WINAPI * PGET_FIRST_ORDERED_SERVICE)(
  139.     IN  DWORD           OrderingMethod,     // What ordering to use
  140.     IN  DWORD           ExclusionFlags,     // Flags to limit search to ceratin
  141.                                             // types of servers
  142.     IN OUT PIPX_SERVICE Service      // On input: criteria for exclusion
  143.                                             //          flags
  144.                                             // On output: first service entry
  145.                                             //          in the specified order
  146.     );
  147. // Find and return next service in the order specified by the ordering method.
  148. // Search starts from specified service and is limited only to ceratin types
  149. // of services as specified by the exclusion flags and corresponding fields
  150. // in Service parameter.
  151. // Returns ERROR_NO_MORE_ITEMS if there are no services in table
  152. // table that meet specified criteria.
  153. typedef
  154. DWORD
  155. (WINAPI * PGET_NEXT_ORDERED_SERVICE)(
  156.     IN  DWORD           OrderingMethod,     // What ordering to use
  157.     IN  DWORD           ExclusionFlags,     // Flags to limit search to ceratin
  158.                                             // types of servers
  159.     IN OUT PIPX_SERVICE Service      // On input: service to start the
  160.                                             //          search from and
  161.                                             //          criteria for exclusion
  162.                                             //          flags
  163.                                             // On output: next service entry
  164.                                             //          in the specified order
  165.     );
  166. typedef
  167. DWORD
  168. (WINAPI * PDO_UPDATE_SERVICES) (
  169.     IN ULONG    InterfaceIndex
  170.     );
  171. typedef
  172. BOOL
  173. (WINAPI * PGET_SERVICE_ID)(
  174.       IN USHORT  Type,
  175.       IN PUCHAR  Name,
  176.       OUT PULONG ServiceID
  177.       );
  178. typedef
  179. BOOL
  180. (WINAPI * PGET_SERVICE_FROM_ID)(
  181.       IN ULONG         ServiceID,
  182.       OUT PIPX_SERVICE  Service
  183.       );
  184. typedef
  185. DWORD
  186. (WINAPI * PGET_NEXT_SERVICE_FROM_ID)(
  187.       IN ULONG         ServiceID,
  188.       OUT PIPX_SERVICE  NextService,
  189.       OUT PULONG        NextServiceID
  190.       );
  191. typedef struct _MPR40_SERVICE_CHARACTERISTICS
  192. {
  193.     DWORD                               dwVersion;
  194.     DWORD                               dwProtocolId;
  195.     DWORD                               fSupportedFunctionality;
  196.     PIS_SERVICE                         pfnIsService;
  197.     PDO_UPDATE_SERVICES                 pfnUpdateServices;
  198.     PCREATE_SERVICE_ENUMERATION_HANDLE  pfnCreateServiceEnumerationHandle;
  199.     PENUMERATE_GET_NEXT_SERVICE         pfnEnumerateGetNextService;
  200.     PCLOSE_SERVICE_ENUMERATION_HANDLE   pfnCloseServiceEnumerationHandle;
  201.     PGET_SERVICE_COUNT                  pfnGetServiceCount;
  202.     PCREATE_STATIC_SERVICE              pfnCreateStaticService;
  203.     PDELETE_STATIC_SERVICE              pfnDeleteStaticService;
  204.     PBLOCK_CONVERT_SERVICES_TO_STATIC   pfnBlockConvertServicesToStatic;
  205.     PBLOCK_DELETE_STATIC_SERVICES       pfnBlockDeleteStaticServices;
  206.     PGET_FIRST_ORDERED_SERVICE          pfnGetFirstOrderedService;
  207.     PGET_NEXT_ORDERED_SERVICE           pfnGetNextOrderedService;
  208. }MPR40_SERVICE_CHARACTERISTICS;
  209. typedef struct _MPR50_SERVICE_CHARACTERISTICS
  210. {
  211. #ifdef __cplusplus
  212.     MPR40_SERVICE_CHARACTERISTICS       mscMpr40ServiceChars;
  213. #else
  214.     MPR40_SERVICE_CHARACTERISTICS;
  215. #endif
  216. }MPR50_SERVICE_CHARACTERISTICS;
  217. #if MPR50
  218.     typedef MPR50_SERVICE_CHARACTERISTICS MPR_SERVICE_CHARACTERISTICS;
  219. #else
  220.     #if MPR40
  221.     typedef MPR40_SERVICE_CHARACTERISTICS MPR_SERVICE_CHARACTERISTICS;
  222.     #endif
  223. #endif
  224. typedef MPR_SERVICE_CHARACTERISTICS *PMPR_SERVICE_CHARACTERISTICS;
  225. #if _MSC_VER >= 1200
  226. #pragma warning(pop)
  227. #else
  228. #pragma warning(default:4201)
  229. #endif
  230. #endif