home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / stm.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  9KB  |  286 lines

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