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.

1622 lines
90 KiB

  1. /*++
  2. Copyright(c) 1998,99 Microsoft Corporation
  3. Module Name:
  4. wlbsctrl.c
  5. Abstract:
  6. Windows Load Balancing Service (WLBS)
  7. API - specification. This set of API is for internal use only.
  8. another set of WMI API is provided for public use.
  9. Author:
  10. fengsun
  11. --*/
  12. #ifndef _WLBSCTRL_H_
  13. #define _WLBSCTRL_H_
  14. #include "wlbsparm.h"
  15. /* These flags indicate which options are being used/specified and/or additional information for the remote protocol. */
  16. #define NLB_OPTIONS_QUERY_CLUSTER_MEMBER 0x00000001 /* The initiator is part of the cluster it is querying. */
  17. #define NLB_OPTIONS_QUERY_HOSTNAME 0x00000002 /* The hostname was returned as part of a remote query. */
  18. #define NLB_OPTIONS_QUERY_CONVERGENCE 0x00000004 /* Convergence information was provided as part of a local query. */
  19. #define NLB_OPTIONS_PORTS_VIP_SPECIFIED 0x00000001 /* A VIP has been specified to check against. */
  20. /* These are the supported connection notifications. */
  21. typedef enum {
  22. NLB_CONN_UP = 0, /* A connection (session) is going up. */
  23. NLB_CONN_DOWN, /* A connection (session) is going down. */
  24. NLB_CONN_RESET /* A connection (session) is being reset. */
  25. } NLB_OPTIONS_CONN_NOTIFICATION_OPERATION;
  26. /* IOCTL input buffer for connection notification from user space. This notification
  27. is initiated by an upper-layer protocol to inform NLB that a connection/session of
  28. a particular protocol type is going up between a client and server, which will allow
  29. NLB to track the session to provide session stickiness when bucket mappings change. */
  30. typedef struct {
  31. NLB_OPTIONS_CONN_NOTIFICATION_OPERATION Operation; /* The operation to perform - UP/DOWN/RESET. */
  32. ULONG ClientIPAddress; /* The IP address of the client in network byte order. */
  33. ULONG ServerIPAddress; /* The IP address of the server in network byte order. */
  34. USHORT ClientPort; /* The client port number (or other designation). */
  35. USHORT ServerPort; /* The server port number (or other designation). */
  36. USHORT Protocol; /* The protocol of the packet in question. */
  37. USHORT Reserved; /* For byte alignment - reserved for later. */
  38. } NLB_OPTIONS_CONN_NOTIFICATION, * PNLB_OPTIONS_CONN_NOTIFICATION;
  39. /* This structure contains the configuration of an NLB port rule, used to relay
  40. port rule information from the kernel up to user-space. */
  41. typedef struct {
  42. ULONG Valid; /* Whether or not the port rule is valid - not used in the kernel. */
  43. ULONG Code; /* The rule code used for error checking and cluster port rule consistency. */
  44. ULONG VirtualIPAddress; /* The virtual IP address to which this rule applies. */
  45. ULONG StartPort; /* The start port of the port range. */
  46. ULONG EndPort; /* The end port of the port range. */
  47. ULONG Protocol; /* The protocol(s) to which the rule applies. */
  48. ULONG Mode; /* The filtering mode for this rule. */
  49. union {
  50. struct {
  51. ULONG Priority; /* For single host filtering, this handling host's priority. */
  52. } SingleHost;
  53. struct {
  54. USHORT Equal; /* For multiple host filtering, whether the distribution is equal or not. */
  55. USHORT Affinity; /* For multiple host filtering, the client affinity setting. */
  56. ULONG LoadWeight; /* For multiple host filtering, the load weight for this host if the distribution is unequal. */
  57. } MultipleHost;
  58. };
  59. } NLB_OPTIONS_PARAMS_PORT_RULE, * PNLB_OPTIONS_PARAMS_PORT_RULE;
  60. /* This structure encapsulates the BDA teaming state for an NLB instance and is used
  61. to relay BDA static configuration information from the kernel up to user-space. */
  62. typedef struct {
  63. WCHAR TeamID[CVY_MAX_BDA_TEAM_ID + 1]; /* The team to which this adapter belongs - MUST be a {GUID}. */
  64. ULONG Active; /* Whether or not this adapter is part of a team. */
  65. ULONG Master; /* Whether or not this team member is the master of its team. */
  66. ULONG ReverseHash; /* Whether or not this team member is reverse-hashing. */
  67. } NLB_OPTIONS_PARAMS_BDA, * PNLB_OPTIONS_PARAMS_BDA;
  68. /* This structure contains some statistics that may want to be monitored from user-space. */
  69. typedef struct {
  70. ULONG ActiveConnections; /* The current number of connections being serviced. */
  71. ULONG DescriptorsAllocated; /* The number of descriptors allocated so far. */
  72. } NLB_OPTIONS_PARAMS_STATISTICS, * PNLB_OPTIONS_PARAMS_STATISTICS;
  73. /* This structure is used to retrieve the driver's snapshot of the NLB parameters
  74. for a given cluster on the local host. Under normal circumstances, these should
  75. be the same as the parameters in the registry unless (1) the user has changed
  76. the NLB registry parameters without performing a "wlbs reload", or (2) the para-
  77. meters in the registry are erred, in which case the driver will retain its current
  78. settings, rather than use the bad parameters in the registry (note that this only
  79. happens as the result of a "wlbs reload" - on bind, the driver uses the registry
  80. parameters regardless of whether or not they are valid. */
  81. typedef struct {
  82. ULONG Version; /* The version of the parameters. */
  83. ULONG EffectiveVersion; /* The effective version of NLB that this cluster is operating in. */
  84. ULONG HostPriority; /* The host priority. */
  85. ULONG HeartbeatPeriod; /* The periodicity of heartbeats, in miliseconds. */
  86. ULONG HeartbeatLossTolerance; /* The tolerance for lost heartbeats from other cluster hosts. */
  87. ULONG NumActionsAlloc; /* The number of actions to allocate for handling remote control requests. */
  88. ULONG NumPacketsAlloc; /* The number of NDIS packets to initially allocate. */
  89. ULONG NumHeartbeatsAlloc; /* The number of heartbeat frames to allocate. */
  90. ULONG InstallDate; /* The NLB install date - essentially unused. */
  91. ULONG RemoteMaintenancePassword; /* The remote maintanance password - obsolete? */
  92. ULONG RemoteControlPassword; /* The remote control password. */
  93. ULONG RemoteControlPort; /* The remote control port, 2504 by default. */
  94. ULONG RemoteControlEnabled; /* Whether or not remote control is enabled. It is load balanced if not enabled. */
  95. ULONG NumPortRules; /* The number of configured port rules. */
  96. ULONG ConnectionCleanUpDelay; /* The length of time to block "dirty" connections. */
  97. ULONG ClusterModeOnStart; /* The preferred initial start state of this cluster on boot (or bind). */
  98. ULONG HostState; /* The initial start state of this cluster on boot (or bind). */
  99. ULONG PersistedStates; /* The states which will be persisted across reboots. */
  100. ULONG DescriptorsPerAlloc; /* The number of connection descriptors to allocate per allocation. */
  101. ULONG MaximumDescriptorAllocs; /* The maximum number of times to allocate connection descriptors. */
  102. ULONG ScaleClient; /* Obsolete? */
  103. ULONG NBTSupport; /* Whether or not to support NBT - this may not even work anymore? */
  104. ULONG MulticastSupport; /* Whether or not this cluster is in multicast mode. */
  105. ULONG MulticastSpoof; /* Whether or not to spoof MAC addresses in multicast mode. */
  106. ULONG IGMPSupport; /* Whether or not this cluster is in IGMP multicast mode. */
  107. ULONG MaskSourceMAC; /* Whether or not to mask the source MAC addresses from network switches. */
  108. ULONG NetmonReceiveHeartbeats; /* Whether or not to allow heartbeats up the stack for netmon sniffing. */
  109. ULONG ClusterIPToMAC; /* Whether or not to automatically generate cluster MAC addresses from cluster IP addresses. */
  110. ULONG IPChangeDelay; /* The length of time to block ARPs after the cluster IP address has changed. */
  111. ULONG TCPConnectionTimeout; /* The timeout for expired TCP connection descriptors. */
  112. ULONG IPSecConnectionTimeout; /* The timeout for expired IPSec connection descriptors. */
  113. ULONG FilterICMP; /* Whether or not ICMP filtering is enabled. */
  114. ULONG IdentityHeartbeatPeriod; /* Period with which identity heartbeats are transmitted (in ms) */
  115. ULONG IdentityHeartbeatEnabled; /* Whether or not identity heartbeats are transmitted */
  116. WCHAR ClusterIPAddress[CVY_MAX_CL_IP_ADDR + 1]; /* The cluster IP address. */
  117. WCHAR ClusterNetmask[CVY_MAX_CL_NET_MASK + 1]; /* The netmask for the cluster IP address. */
  118. WCHAR DedicatedIPAddress[CVY_MAX_DED_IP_ADDR + 1]; /* The dedicated IP address. */
  119. WCHAR DedicatedNetmask[CVY_MAX_DED_NET_MASK + 1]; /* The netmask for the dedicated IP address. */
  120. WCHAR ClusterMACAddress[CVY_MAX_NETWORK_ADDR + 1]; /* The cluster MAC address. */
  121. WCHAR DomainName[CVY_MAX_DOMAIN_NAME + 1]; /* The cluster name - www.microsoft.com. */
  122. WCHAR IGMPMulticastIPAddress[CVY_MAX_CL_IGMP_ADDR + 1]; /* The IGMP multicast IP address. */
  123. WCHAR HostName[CVY_MAX_FQDN + 1]; /* The hostname.domain for this host. */
  124. NLB_OPTIONS_PARAMS_BDA BDATeaming; /* The BDA teaming parameters for this NLB instance. */
  125. NLB_OPTIONS_PARAMS_PORT_RULE PortRules[CVY_MAX_RULES - 1]; /* The port rules for this cluster. */
  126. NLB_OPTIONS_PARAMS_STATISTICS Statistics; /* Some driver-level statistics. */
  127. } NLB_OPTIONS_PARAMS, * PNLB_OPTIONS_PARAMS;
  128. /* This structure contains the configuration and state of a single BDA team
  129. member including its member ID and state. This is used to relay BDA teaming
  130. membership and state information from the kernel up to user-level applications. */
  131. typedef struct {
  132. ULONG ClusterIPAddress; /* The cluster IP address of this team member. */
  133. ULONG Master; /* Whether or not this adapter is the master of its team. */
  134. ULONG ReverseHash; /* Whether or not this adapter is configured to reverse-hash. */
  135. ULONG MemberID; /* This team member's unique host ID. */
  136. } NLB_OPTIONS_BDA_MEMBER, * PNLB_OPTIONS_BDA_MEMBER;
  137. /* This structure represents a BDA team, including the current state, membership
  138. and list of current members. This is used to relay teaming state from the
  139. kernel up to user-level applications. */
  140. typedef struct {
  141. ULONG Active; /* Whether or not the team is actively handling traffic. */
  142. ULONG MembershipCount; /* The number of members in the team. */
  143. ULONG MembershipFingerprint; /* A "fingerprint" of team members, used for consistency checking. */
  144. ULONG MembershipMap; /* A bitmap of team members, indexed by unique host ID. */
  145. ULONG ConsistencyMap; /* A bitmap of the team members in a consistent state. */
  146. ULONG Master; /* The cluster IP address of the team's master. */
  147. NLB_OPTIONS_BDA_MEMBER Members[CVY_MAX_ADAPTERS]; /* The state and configuration of each team member. */
  148. } NLB_OPTIONS_BDA_TEAM, * PNLB_OPTIONS_BDA_TEAM;
  149. /* This structure is used to convey the current state of a BDA team to a user-
  150. space application. Given a team ID (GUID), the structure provides the team
  151. membership, state and the configuration of each member amongst other things. */
  152. typedef struct {
  153. IN WCHAR TeamID[CVY_MAX_BDA_TEAM_ID + 1]; /* The team ID - MUST be a {GUID}. */
  154. NLB_OPTIONS_BDA_TEAM Team; /* The configuration and state of the given team. */
  155. } NLB_OPTIONS_BDA_TEAMING, * PNLB_OPTIONS_BDA_TEAMING;
  156. /* These are the possible responses from the load packet filter
  157. state query, which returns accept/reject status for a given
  158. IP tuple and protocol, based on the current driver state. */
  159. typedef enum {
  160. NLB_REJECT_LOAD_MODULE_INACTIVE = 0, /* Packet rejected because the load module is inactive. */
  161. NLB_REJECT_CLUSTER_STOPPED, /* Packet rejected because NLB is stopped on this adapter. */
  162. NLB_REJECT_PORT_RULE_DISABLED, /* Packet rejected because the applicable port rule's filtering mode is disabled. */
  163. NLB_REJECT_CONNECTION_DIRTY, /* Packet rejected because the connection was marked dirty. */
  164. NLB_REJECT_OWNED_ELSEWHERE, /* Packet rejected because the packet is owned by another host. */
  165. NLB_REJECT_BDA_TEAMING_REFUSED, /* Packet rejected because BDA teaming refused to process it. */
  166. NLB_REJECT_DIP, /* Packet rejected because its was sent to the DIP of another cluster member. */
  167. NLB_REJECT_HOOK, /* Packet rejected because the query hook unconditionally accepted it. */
  168. NLB_ACCEPT_UNCONDITIONAL_OWNERSHIP, /* Packet accepted because this host owns it unconditionally (optimized mode). */
  169. NLB_ACCEPT_FOUND_MATCHING_DESCRIPTOR, /* Packet accepted because we found a matching connection descriptor. */
  170. NLB_ACCEPT_PASSTHRU_MODE, /* Packet accepted because the cluster is in passthru mode. */
  171. NLB_ACCEPT_DIP, /* Packet accepted because its was sent to a bypassed address. */
  172. NLB_ACCEPT_BROADCAST, /* Packet accepted because its was sent to a bypassed address. */
  173. NLB_ACCEPT_REMOTE_CONTROL_REQUEST, /* Packet accepted because it is an NLB remote control packet. */
  174. NLB_ACCEPT_REMOTE_CONTROL_RESPONSE, /* Packet accepted because it is an NLB remote control packet. */
  175. NLB_ACCEPT_HOOK, /* Packet accepted because the query hook unconditionally accepted it. */
  176. NLB_ACCEPT_UNFILTERED, /* Packet accepted because this packet type is not filtered by NLB. */
  177. NLB_UNKNOWN_NO_AFFINITY /* Packet fate is unknown because a client port was not specified, but the
  178. applicable port rule is configured for "No" affinity. */
  179. } NLB_OPTIONS_QUERY_PACKET_FILTER_RESPONSE;
  180. #define NLB_FILTER_FLAGS_CONN_DATA 0x0
  181. #define NLB_FILTER_FLAGS_CONN_UP 0x1
  182. #define NLB_FILTER_FLAGS_CONN_DOWN 0x2
  183. #define NLB_FILTER_FLAGS_CONN_RESET 0x4
  184. /* This structure is used to query packet filtering information from the driver
  185. about a particular connection. Given a IP tuple (client IP, client port,
  186. server IP, server port) and a protocol, determine whether or not this host
  187. would accept the packet and why or why not. It is important that this is
  188. performed completely unobtrusively and has no side-effects on the actual
  189. operation of NLB and the load module. */
  190. typedef struct {
  191. IN ULONG ClientIPAddress; /* The IP address of the client in network byte order. */
  192. IN ULONG ServerIPAddress; /* The IP address of the server in network byte order. */
  193. IN USHORT ClientPort; /* The client port number. */
  194. IN USHORT ServerPort; /* The server port number. */
  195. IN USHORT Protocol; /* The protocol of the packet in question. */
  196. IN UCHAR Flags; /* Flags, including TCP SYN, FIN, RST, etc. */
  197. UCHAR Reserved1; /* For byte alignment - reserved for later. */
  198. NLB_OPTIONS_QUERY_PACKET_FILTER_RESPONSE Accept; /* The response - reason for accepting or rejecting the packet. */
  199. ULONG Reserved2; /* To keep 8-byte alignment */
  200. struct {
  201. USHORT Valid; /* Whether or not the driver has filled in the descriptor information. */
  202. USHORT Reserved1; /* For byte alignment - reserved for later. */
  203. USHORT Alloc; /* Whether this descriptor is from the hash table or queue. */
  204. USHORT Dirty; /* Whether this connection is dirty or not. */
  205. ULONG RefCount; /* The number of references on this descriptor. */
  206. ULONG Reserved2; /* For 8-byte alignment */
  207. } DescriptorInfo;
  208. struct {
  209. USHORT Valid; /* Whether or not the driver has filled in the hashing information. */
  210. USHORT Reserved1; /* For byte alignment - reserved for later. */
  211. ULONG Bin; /* The "bucket" which this tuple mapped to - from 0 to 59. */
  212. ULONG ActiveConnections; /* The number of active connections on this "bucket". */
  213. ULONG Reserved2; /* For 8-byte alignment */
  214. ULONGLONG CurrentMap; /* The current "bucket" map for the applicable port rule. */
  215. ULONGLONG AllIdleMap; /* The all idle "bucket" map for the applicable port rule. */
  216. } HashInfo;
  217. } NLB_OPTIONS_PACKET_FILTER, * PNLB_OPTIONS_PACKET_FILTER;
  218. /* These are the possible states of a port rule. */
  219. typedef enum {
  220. NLB_PORT_RULE_NOT_FOUND = 0, /* The port rule was not found. */
  221. NLB_PORT_RULE_ENABLED, /* The port rule is enabled. Load weight = User-specified load weight. */
  222. NLB_PORT_RULE_DISABLED, /* The port rule is disabled. Load weight = 0. */
  223. NLB_PORT_RULE_DRAINING /* The port rule is draining. Load weight = 0 and servicing exisiting connections. */
  224. } NLB_OPTIONS_PORT_RULE_STATUS;
  225. /* This structure contains some relevant packet handling statistics including
  226. the number of packets and bytes accepted and dropped. */
  227. typedef struct {
  228. struct {
  229. ULONGLONG Accepted; /* The number of packets accepted on this port rule. */
  230. ULONGLONG Dropped; /* The number of packets dropped on this port rule. */
  231. } Packets;
  232. struct {
  233. ULONGLONG Accepted; /* The number of bytes accepted on this port rule. Not yet used. */
  234. ULONGLONG Dropped; /* The number of bytes dropped on this port rule. Not yet used. */
  235. } Bytes;
  236. } NLB_OPTIONS_PACKET_STATISTICS, * PNLB_OPTIONS_PACKET_STATISTICS;
  237. /* This structure is used to query the state of a port rule. Like the other port rule
  238. commands, the port rule is specified by a port within the port rule range. This
  239. operation will retrieve the state of the port rule and some packet handling statistics. */
  240. typedef struct {
  241. IN ULONG VirtualIPAddress; /* The VIP to distinguish port rules whose ranges overlap. */
  242. IN USHORT Num; /* The port - used to identify the applicable port rule. */
  243. USHORT Reserved1;
  244. NLB_OPTIONS_PORT_RULE_STATUS Status; /* The port rule state - enabled, disabled, draining, etc. */
  245. ULONG Reserved2; /* To preserve 8-byte alignment. */
  246. NLB_OPTIONS_PACKET_STATISTICS Statistics; /* Packet handling statistics for this port rule. */
  247. } NLB_OPTIONS_PORT_RULE_STATE, * PNLB_OPTIONS_PORT_RULE_STATE;
  248. #define NLB_QUERY_TIME_INVALID 0xffffffff
  249. /* This structure is used by user-level applications who communicate with the NLB
  250. APIs, and who could care less whether the operation is local or remote. */
  251. typedef union {
  252. struct {
  253. ULONG flags; /* These flags indicate which options fields have been specified. */
  254. WCHAR hostname[CVY_MAX_HOST_NAME + 1]; /* Host name filled in by NLB on remote control reply. */
  255. ULONG NumConvergences; /* The number of convergences since this host joined the cluster. */
  256. ULONG LastConvergence; /* The amount of time since the last convergence, in seconds. */
  257. } query;
  258. struct {
  259. IN ULONG flags; /* These flags indicate which options fields have been specified. */
  260. union {
  261. NLB_OPTIONS_PARAMS params; /* This is the output buffer for querying the driver parameters & state. */
  262. NLB_OPTIONS_BDA_TEAMING bda; /* This is the output buffer for querying the BDA teaming state. */
  263. NLB_OPTIONS_PORT_RULE_STATE port; /* This is the output buffer for querying the state of a port rule. */
  264. NLB_OPTIONS_PACKET_FILTER filter; /* This is the output buffer for querying the filtering algorithm. */
  265. };
  266. } state;
  267. struct {
  268. ULONG flags; /* These flags indicate which options fields have been specified. */
  269. ULONG vip; /* For virtual clusters, the VIP, which can be 0x00000000, 0xffffffff or a specific VIP. */
  270. } port;
  271. struct {
  272. ULONG flags; /* These flags indicate which options fields have been specified. */
  273. NLB_OPTIONS_CONN_NOTIFICATION conn; /* The input/output buffer for connection notifications from upper-layer protocols. */
  274. } notification;
  275. struct {
  276. WCHAR fqdn[CVY_MAX_FQDN + 1]; /* Fully qualified domain name from from the local identity cache */
  277. } identity;
  278. } NLB_OPTIONS, * PNLB_OPTIONS;
  279. #ifndef KERNEL_MODE /* DO NOT include this malarky if this file is included in kernel mode. The
  280. data structures above are shared between kernel and user mode IOCTLs, so
  281. the driver needs to include this file, but not the junk below. */
  282. #define CVY_MAX_HOST_NAME 100
  283. #define WLBS_API_VER_MAJOR 2 /* WLBS control API major version. */
  284. #define WLBS_API_VER_MINOR 0 /* WLBS control API minor version. */
  285. #define WLBS_API_VER (WLBS_API_VER_MINOR | (WLBS_API_VER_MAJOR << 8))
  286. /* WLBS control API version. */
  287. #define WLBS_PRODUCT_NAME "WLBS"
  288. /* Default product name used for API
  289. initialization. */
  290. #define WLBS_MAX_HOSTS 32 /* Maximum number of cluster hosts. */
  291. #define WLBS_MAX_RULES 32 /* Maximum number of port rules. */
  292. #define WLBS_ALL_CLUSTERS 0 /* Used to specify all clusters in
  293. WLBS...Set routines. */
  294. #define WLBS_LOCAL_CLUSTER 0 /* Used to specify that cluster
  295. operations are to be performed on the
  296. local host. WLBS_LOCAL_HOST value
  297. below has to be used for the host
  298. argument when using
  299. WLBS_LOCAL_CLUSTER. */
  300. #define WLBS_LOCAL_HOST ((DWORD)-2) /* When specifying WLBS_LOCAL_CLUSTER,
  301. this value should be used for the
  302. host argument. */
  303. #define WLBS_DEFAULT_HOST 0 /* Used to specify that remote cluster
  304. operations are to be performed on
  305. the default host. */
  306. #define WLBS_ALL_HOSTS 0xffffffff
  307. /* Used to specify that remote cluster
  308. operation is to be performed on all
  309. hosts. */
  310. #define WLBS_ALL_PORTS 0xffffffff
  311. /* Used to specify all load-balanced
  312. port rules as the target for
  313. enable/disable/drain commands. */
  314. /* WLBS return values. Windows Sockets errors are returned 'as-is'. */
  315. #define WLBS_OK 1000 /* Success. */
  316. #define WLBS_ALREADY 1001 /* Cluster mode is already stopped/
  317. started, or traffic handling is
  318. already enabled/disabled on specified
  319. port. */
  320. #define WLBS_DRAIN_STOP 1002 /* Cluster mode stop or start operation
  321. interrupted connection draining
  322. process. */
  323. #define WLBS_BAD_PARAMS 1003 /* Cluster mode could not be started
  324. due to configuration problems
  325. (bad registry parameters) on the
  326. target host. */
  327. #define WLBS_NOT_FOUND 1004 /* Port number not found among port
  328. rules. */
  329. #define WLBS_STOPPED 1005 /* Cluster mode is stopped on the
  330. host. */
  331. #define WLBS_CONVERGING 1006 /* Cluster is converging. */
  332. #define WLBS_CONVERGED 1007 /* Cluster or host converged
  333. successfully. */
  334. #define WLBS_DEFAULT 1008 /* Host is converged as default host. */
  335. #define WLBS_DRAINING 1009 /* Host is draining after
  336. WLBSDrainStop command. */
  337. #define WLBS_PRESENT 1010 /* WLBS is installed on this host.
  338. Local operations possible. */
  339. #define WLBS_REMOTE_ONLY 1011 /* WLBS is not installed on this host
  340. or is not functioning. Only remote
  341. control operations can be carried
  342. out. */
  343. #define WLBS_LOCAL_ONLY 1012 /* WinSock failed to load. Only local
  344. operations can be carried out. */
  345. #define WLBS_SUSPENDED 1013 /* Cluster control operations are
  346. suspended. */
  347. #define WLBS_DISCONNECTED 1014 /* Media is disconnected. */
  348. #define WLBS_REBOOT 1050 /* Reboot required in order for config
  349. changes to take effect. */
  350. #define WLBS_INIT_ERROR 1100 /* Error initializing control module. */
  351. #define WLBS_BAD_PASSW 1101 /* Specified remote control password
  352. was not accepted by the cluster. */
  353. #define WLBS_IO_ERROR 1102 /* Local I/O error opening or
  354. communicating with WLBS driver. */
  355. #define WLBS_TIMEOUT 1103 /* Timed-out awaiting response from
  356. remote host. */
  357. #define WLBS_PORT_OVERLAP 1150 /* Port rule overlaps with existing
  358. port rules. */
  359. #define WLBS_BAD_PORT_PARAMS 1151 /* Invalid parameter(s) in port rule. */
  360. #define WLBS_MAX_PORT_RULES 1152 /* Maximum number of port rules reached. */
  361. #define WLBS_TRUNCATED 1153 /* Return value truncated */
  362. #define WLBS_REG_ERROR 1154 /* Error while accessing the registry */
  363. #define WLBS_FAILURE 1501
  364. #define WLBS_REFUSED 1502
  365. /* Filtering modes for port rules */
  366. #define WLBS_SINGLE 1 /* single server mode */
  367. #define WLBS_MULTI 2 /* multi-server mode (load balanced) */
  368. #define WLBS_NEVER 3 /* mode for never handled by this server */
  369. #define WLBS_ALL 4 /* all server mode */
  370. /* Protocol qualifiers for port rules */
  371. #define WLBS_TCP 1 /* TCP protocol */
  372. #define WLBS_UDP 2 /* UDP protocol */
  373. #define WLBS_TCP_UDP 3 /* TCP or UDP protocols */
  374. /* Server affinity values for multiple filtering mode */
  375. #define WLBS_AFFINITY_NONE 0 /* no affinity (scale single client) */
  376. #define WLBS_AFFINITY_SINGLE 1 /* single client affinity */
  377. #define WLBS_AFFINITY_CLASSC 2 /* Class C affinity */
  378. /* Response value type returned by each of the cluster hosts during remote
  379. operation. */
  380. typedef struct
  381. {
  382. DWORD id; /* Priority ID of the responding cluster host */
  383. DWORD address; /* Dedicated IP address */
  384. DWORD status; /* Status return value */
  385. DWORD reserved1; /* Reserved for future use */
  386. PVOID reserved2;
  387. NLB_OPTIONS options;
  388. }
  389. WLBS_RESPONSE, * PWLBS_RESPONSE;
  390. /* MACROS */
  391. /* Local operations */
  392. #define WlbsLocalQuery(host_map) \
  393. WlbsQuery (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL, \
  394. host_map, NULL)
  395. #define WlbsLocalSuspend() \
  396. WlbsSuspend (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL)
  397. #define WlbsLocalResume() \
  398. WlbsResume (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL)
  399. #define WlbsLocalStart() \
  400. WlbsStart (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL)
  401. #define WlbsLocalStop() \
  402. WlbsStop (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL)
  403. #define WlbsLocalDrainStop() \
  404. WlbsDrainStop (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL)
  405. #define WlbsLocalEnable(port) \
  406. WlbsEnable (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL, port)
  407. #define WlbsLocalDisable(port) \
  408. WlbsDisable (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL, port)
  409. #define WlbsLocalDrain(port) \
  410. WlbsDrain (WLBS_LOCAL_CLUSTER, WLBS_LOCAL_HOST, NULL, NULL, port)
  411. /* Single host remote operations */
  412. #define WlbsHostQuery(cluster, host, host_map) \
  413. WlbsQuery (cluster, host, NULL, NULL, host_map, NULL)
  414. #define WlbsHostSuspend(cluster, host) \
  415. WlbsSuspend (cluster, host, NULL, NULL)
  416. #define WlbsHostResume(cluster, host) \
  417. WlbsResume (cluster, host, NULL, NULL)
  418. #define WlbsHostStart(cluster, host) \
  419. WlbsStart (cluster, host, NULL, NULL)
  420. #define WlbsHostStop(cluster, host) \
  421. WlbsStop (cluster, host, NULL, NULL)
  422. #define WlbsHostDrainStop(cluster, host) \
  423. WlbsDrainStop (cluster, host, NULL, NULL)
  424. #define WlbsHostEnable(cluster, host, port) \
  425. WlbsEnable (cluster, host, NULL, NULL, port)
  426. #define WlbsHostDisable(cluster, host, port) \
  427. WlbsDisable (cluster, host, NULL, NULL, port)
  428. #define WlbsHostDrain(cluster, host, port) \
  429. WlbsDrain (cluster, host, NULL, NULL, port)
  430. /* Cluster-wide remote operations */
  431. #define WlbsClusterQuery(cluster, response, num_hosts, host_map) \
  432. WlbsQuery (cluster, WLBS_ALL_HOSTS, response, num_hosts, \
  433. host_map, NULL)
  434. #define WlbsClusterSuspend(cluster, response, num_hosts) \
  435. WlbsSuspend (cluster, WLBS_ALL_HOSTS, response, num_hosts)
  436. #define WlbsClusterResume(cluster, response, num_hosts) \
  437. WlbsResume (cluster, WLBS_ALL_HOSTS, response, num_hosts)
  438. #define WlbsClusterStart(cluster, response, num_hosts) \
  439. WlbsStart (cluster, WLBS_ALL_HOSTS, response, num_hosts)
  440. #define WlbsClusterStop(cluster, response, num_hosts) \
  441. WlbsStop (cluster, WLBS_ALL_HOSTS, response, num_hosts)
  442. #define WlbsClusterDrainStop(cluster, response, num_hosts) \
  443. WlbsDrainStop (cluster, WLBS_ALL_HOSTS, response, num_hosts)
  444. #define WlbsClusterEnable(cluster, response, num_hosts, port) \
  445. WlbsEnable (cluster, WLBS_ALL_HOSTS, response, num_hosts, port)
  446. #define WlbsClusterDisable(cluster, response, num_hosts, port) \
  447. WlbsDisable (cluster, WLBS_ALL_HOSTS, response, num_hosts, port)
  448. #define WlbsClusterDrain(cluster, response, num_hosts, port) \
  449. WlbsDrain (cluster, WLBS_ALL_HOSTS, response, num_hosts, port)
  450. /* PROCEDURES */
  451. typedef VOID (CALLBACK *PFN_QUERY_CALLBACK) (PWLBS_RESPONSE);
  452. /*************************************
  453. Initialization and support routines
  454. *************************************/
  455. #ifdef __cplusplus
  456. extern "C" {
  457. #endif
  458. extern DWORD WINAPI WlbsInit
  459. (
  460. WCHAR* Reservered1, /* IN - for backward compatibility */
  461. DWORD version, /* IN - Pass WLBS_API_VER value. */
  462. PVOID Reservered2 /* IN - Pass NULL. Reserved for future use. */
  463. );
  464. /*
  465. Initialize WLBS control module.
  466. returns:
  467. WLBS_PRESENT => WLBS is installed on this host. Local and remote
  468. control operations can be executed.
  469. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  470. functioning properly. Only remote operations can
  471. be carried out.
  472. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  473. be carried out.
  474. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  475. control operations.
  476. */
  477. /******************************************************************************
  478. Cluster control routines:
  479. The following routines can be used to control individual cluster hosts or the
  480. entire cluster, both locally and remotely. They are designed to be as generic
  481. as possible. Macros, defined above, are designed to provide simpler
  482. interfaces for particular types of operations.
  483. It is highly recommended to make all response arrays of size WLBS_MAX_HOSTS
  484. to make your implementation independent of the actual cluster size.
  485. Please note that cluster address has to correspond to the primary cluster
  486. address as entered in the WLBS Setup Dialog. WLBS will not recognize
  487. control messages sent to dedicated or additional multi-homed cluster
  488. addresses.
  489. ******************************************************************************/
  490. extern DWORD WINAPI WlbsQuery
  491. (
  492. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  493. for local or this cluster operation. */
  494. DWORD host, /* IN - Host's dedicated address, priority ID,
  495. WLBS_DEFAULT_HOST for current default,
  496. WLBS_ALL_HOSTS for all hosts, or
  497. WLBS_LOCAL_HOST for local operation. */
  498. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  499. the hosts or NULL if response values
  500. are not desired or operations are being
  501. performed locally. */
  502. PDWORD num_hosts, /* IN - Size of the response array or NULL if
  503. response array is not specified and
  504. host count is not desired.
  505. OUT - Number of responses received. Note that
  506. this value can be larger than the size
  507. of the response array. In this case
  508. only the first few responses that fit
  509. in the array are returned. */
  510. PDWORD host_map, /* OUT - Bitmap with ones in the bit positions
  511. representing priority IDs of the hosts
  512. currently present in the cluster. NULL
  513. if host map information is not
  514. needed. */
  515. PFN_QUERY_CALLBACK pfnQueryCallBack
  516. /* IN - Function pointer callback to return
  517. information on queried hosts as it is
  518. received. Caller must pass NULL if unused
  519. or implement a function with the prototype:
  520. VOID pfnQueryCallback(PWLBS_RESPONSE pResponse)
  521. */
  522. );
  523. /*
  524. Query status of specified host or all cluster hosts.
  525. returns:
  526. For local operations or remote operations on individual cluster hosts,
  527. return value represents status value returned by the target host. For
  528. cluster-wide remote operations, return value represents the summary of
  529. the return values from all cluster hosts. Individual host responses,
  530. corresponding to a single-host, return values are recorded in the
  531. response array.
  532. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  533. control operations.
  534. Single-host:
  535. WLBS_SUSPENDED => Cluster mode control suspended.
  536. WLBS_STOPPED => Cluster mode on the host is stopped.
  537. WLBS_CONVERGING => Host is converging.
  538. WLBS_DRAINING => Host is draining.
  539. WLBS_CONVERGED => Host converged.
  540. WLBS_DEFAULT => Host converged as default host.
  541. Cluster-wide:
  542. <1..32> => Number of active cluster hosts when the cluster
  543. is converged.
  544. WLBS_SUSPENDED => Entire cluster is suspended. All cluster hosts
  545. reported as being suspended.
  546. WLBS_STOPPED => Entire cluster is stopped. All cluster hosts reported
  547. as being stopped.
  548. WLBS_DRAINING => Entire cluster is draining. All cluster hosts
  549. reported as being stopped or draining.
  550. WLBS_CONVERGING => Cluster is converging. At least one cluster host
  551. reported its state as converging.
  552. Remote:
  553. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  554. WLBS_TIMEOUT => No response received. If this value is returned when
  555. accessing default host (using host priority ID
  556. WLBS_DEFAULT_HOST) it might mean that entire cluster
  557. is stopped and there was no default host to respond
  558. to the query.
  559. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  560. be carried out.
  561. WSA... => Specified Winsock error occurred when communicating
  562. with the cluster.
  563. Local:
  564. WLBS_REMOTE_ONLY => WLBS is not installed on this system. Only remote
  565. operations can be carried out.
  566. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  567. driver. WLBS might not be loaded.
  568. */
  569. extern DWORD WINAPI WlbsSuspend
  570. (
  571. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  572. for local or this cluster operation. */
  573. DWORD host, /* IN - Host's dedicated address, priority ID,
  574. WLBS_ALL_HOSTS for all hosts, or
  575. WLBS_LOCAL_HOST for local operation. */
  576. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  577. the hosts or NULL if response values
  578. are not desired or operations are being
  579. performed locally. */
  580. PDWORD num_hosts /* IN - Size of the response array or NULL if
  581. response array is not specified and
  582. host count is not desired.
  583. OUT - Number of responses received. Note that
  584. this value can be larger than the size
  585. of the response array. In this case
  586. only the first few responses that fit
  587. in the array are returned. */
  588. );
  589. /*
  590. Suspend cluster operation control on specified host or all cluster hosts.
  591. returns:
  592. For local operations or remote operations on individual cluster hosts,
  593. return value represents status value returned by the target host. For
  594. cluster-wide remote operations, return value represents the summary of
  595. the return values from all cluster hosts. Individual host responses,
  596. corresponding to a single-host, return values are recorded in the
  597. response array.
  598. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  599. control operations.
  600. Single-host:
  601. WLBS_OK => Cluster mode control suspended.
  602. WLBS_ALREADY => Cluster mode control already suspended.
  603. WLBS_STOPPED => Cluster mode was stopped and control suspended.
  604. WLBS_DRAIN_STOP => Suspending cluster mode control interrupted ongoing
  605. connection draining.
  606. Cluster-wide:
  607. WLBS_OK => Cluster mode control suspended on all hosts.
  608. Remote:
  609. WLBS_BAD_PASSW => Specified password was not accepted by at least one member of the cluster.
  610. WLBS_TIMEOUT => No response received.
  611. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  612. be carried out.
  613. WSA... => Specified Winsock error occurred when communicating
  614. with the cluster.
  615. Local:
  616. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  617. functioning properly. Only remote operations can
  618. be carried out.
  619. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  620. driver. WLBS might not be loaded.
  621. */
  622. extern DWORD WINAPI WlbsResume
  623. (
  624. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  625. for local or this cluster operation. */
  626. DWORD host, /* IN - Host's dedicated address, priority ID,
  627. WLBS_ALL_HOSTS for all hosts, or
  628. WLBS_LOCAL_HOST for local operation. */
  629. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  630. the hosts or NULL if response values
  631. are not desired or operations are being
  632. performed locally. */
  633. PDWORD num_hosts /* IN - Size of the response array or NULL if
  634. response array is not specified and
  635. host count is not desired.
  636. OUT - Number of responses received. Note that
  637. this value can be larger than the size
  638. of the response array. In this case
  639. only the first few responses that fit
  640. in the array are returned. */
  641. );
  642. /*
  643. Resume cluster operation control on specified host or all cluster hosts.
  644. returns:
  645. For local operations or remote operations on individual cluster hosts,
  646. return value represents status value returned by the target host. For
  647. cluster-wide remote operations, return value represents the summary of
  648. the return values from all cluster hosts. Individual host responses,
  649. corresponding to a single-host, return values are recorded in the
  650. response array.
  651. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  652. control operations.
  653. Single-host:
  654. WLBS_OK => Cluster mode control resumed.
  655. WLBS_ALREADY => Cluster mode control already resumed.
  656. Cluster-wide:
  657. WLBS_OK => Cluster mode control resumed on all hosts.
  658. Remote:
  659. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  660. WLBS_TIMEOUT => No response received.
  661. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  662. be carried out.
  663. WSA... => Specified Winsock error occurred when communicating
  664. with the cluster.
  665. Local:
  666. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  667. functioning properly. Only remote operations can
  668. be carried out.
  669. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  670. driver. WLBS might not be loaded.
  671. */
  672. extern DWORD WINAPI WlbsStart
  673. (
  674. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  675. for local or this cluster operation. */
  676. DWORD host, /* IN - Host's dedicated address, priority ID,
  677. WLBS_ALL_HOSTS for all hosts, or
  678. WLBS_LOCAL_HOST for local operation. */
  679. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  680. the hosts or NULL if response values
  681. are not desired or operations are being
  682. performed locally. */
  683. PDWORD num_hosts /* IN - Size of the response array or NULL if
  684. response array is not specified and
  685. host count is not desired.
  686. OUT - Number of responses received. Note that
  687. this value can be larger than the size
  688. of the response array. In this case
  689. only the first few responses that fit
  690. in the array are returned. */
  691. );
  692. /*
  693. Start cluster operations on specified host or all cluster hosts.
  694. returns:
  695. For local operations or remote operations on individual cluster hosts,
  696. return value represents status value returned by the target host. For
  697. cluster-wide remote operations, return value represents the summary of
  698. the return values from all cluster hosts. Individual host responses,
  699. corresponding to a single-host, return values are recorded in the
  700. response array.
  701. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  702. control operations.
  703. Single-host:
  704. WLBS_OK => Cluster mode started.
  705. WLBS_ALREADY => Cluster mode already started.
  706. WLBS_SUSPENDED => Cluster mode control suspended.
  707. WLBS_DRAIN_STOP => Starting cluster mode interrupted ongoing connection
  708. draining.
  709. WLBS_BAD_PARAMS => Could not start cluster mode due to invalid configuration
  710. parameters.
  711. Cluster-wide:
  712. WLBS_OK => Cluster mode started on all hosts.
  713. WLBS_BAD_PARAMS => Could not start cluster mode on at least one host
  714. due to invalid configuration parameters.
  715. WLBS_SUSPENDED => If at least one host is suspended.
  716. Remote:
  717. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  718. WLBS_TIMEOUT => No response received.
  719. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  720. be carried out.
  721. WSA... => Specified Winsock error occurred when communicating
  722. with the cluster.
  723. Local:
  724. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  725. functioning properly. Only remote operations can
  726. be carried out.
  727. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  728. driver. WLBS might not be loaded.
  729. */
  730. extern DWORD WINAPI WlbsStop
  731. (
  732. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  733. for local or this cluster operation. */
  734. DWORD host, /* IN - Host's dedicated address, priority ID,
  735. WLBS_DEFAULT_HOST for current default
  736. host, WLBS_ALL_HOSTS for all hosts, or
  737. WLBS_LOCAL_HOST for local operation. */
  738. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  739. the hosts or NULL if response values
  740. are not desired or operations are being
  741. performed locally. */
  742. PDWORD num_hosts /* IN - Size of the response array or NULL if
  743. response array is not specified and
  744. host count is not desired.
  745. OUT - Number of responses received. Note that
  746. this value can be larger than the size
  747. of the response array. In this case
  748. only the first few responses that fit
  749. in the array are returned. */
  750. );
  751. /*
  752. Stop cluster operations on specified host or all cluster hosts.
  753. returns:
  754. For local operations or remote operations on individual cluster hosts,
  755. return value represents status value returned by the target host. For
  756. cluster-wide remote operations, return value represents the summary of
  757. the return values from all cluster hosts. Individual host responses,
  758. corresponding to a single-host, return values are recorded in the
  759. response array.
  760. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  761. control operations.
  762. Single-host:
  763. WLBS_OK => Cluster mode stopped.
  764. WLBS_ALREADY => Cluster mode already stopped.
  765. WLBS_SUSPENDED => Cluster mode control suspended.
  766. WLBS_DRAIN_STOP => Starting cluster mode interrupted ongoing connection
  767. draining.
  768. Cluster-wide:
  769. WLBS_OK => Cluster mode stopped on all hosts.
  770. WLBS_SUSPENDED => At least one host is suspended.
  771. Remote:
  772. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  773. WLBS_TIMEOUT => No response received. If this value is returned when
  774. accessing default host (using host priority ID
  775. WLBS_DEFAULT_HOST) it might mean that entire cluster
  776. is stopped and there was no default host to respond
  777. to the command.
  778. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  779. be carried out.
  780. WSA... => Specified Winsock error occurred when communicating
  781. with the cluster.
  782. Local:
  783. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  784. functioning properly. Only remote operations can
  785. be carried out.
  786. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  787. driver. WLBS might not be loaded.
  788. */
  789. extern DWORD WINAPI WlbsDrainStop
  790. (
  791. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  792. for local or this cluster operation. */
  793. DWORD host, /* IN - Host's dedicated address, priority ID,
  794. WLBS_DEFAULT_HOST for current default
  795. host, WLBS_ALL_HOSTS for all hosts, or
  796. WLBS_LOCAL_HOST for local operation. */
  797. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  798. the hosts or NULL if response values
  799. are not desired or operations are being
  800. performed locally. */
  801. PDWORD num_hosts /* IN - Size of the response array or NULL if
  802. response array is not specified and
  803. host count is not desired.
  804. OUT - Number of responses received. Note that
  805. this value can be larger than the size
  806. of the response array. In this case
  807. only the first few responses that fit
  808. in the array are returned. */
  809. );
  810. /*
  811. Enter draining mode on specified host or all cluster hosts. New connections
  812. will not be accepted. Cluster mode will be stopped when all existing
  813. connections finish. While draining, host will participate in convergence and
  814. remain part of the cluster.
  815. Draining mode can be interrupted by performing WlbsStop or WlbsStart.
  816. WlbsEnable, WlbsDisable and WlbsDrain commands cannot be executed
  817. while the host is draining.
  818. Note that this command is NOT equivalent to doing WlbsDrain with
  819. WLBS_ALL_PORTS parameter followed by WlbsStop. WlbsDrainStop affects all
  820. ports, not just the ones specified in the multiple host filtering mode port
  821. rules.
  822. returns:
  823. For local operations or remote operations on individual cluster hosts,
  824. return value represents status value returned by the target host. For
  825. cluster-wide remote operations, return value represents the summary of
  826. the return values from all cluster hosts. Individual host responses,
  827. corresponding to a single-host, return values are recorded in the
  828. response array.
  829. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  830. control operations.
  831. Single-host:
  832. WLBS_OK => Host entered draining mode.
  833. WLBS_ALREADY => Host is already draining.
  834. WLBS_SUSPENDED => Cluster mode control suspended.
  835. WLBS_STOPPED => Cluster mode is already stopped.
  836. Cluster-wide:
  837. WLBS_OK => Draining mode entered on all hosts.
  838. WLBS_STOPPED => Cluster mode is already stopped on all hosts.
  839. WLBS_SUSPENDED => At least one host is suspended.
  840. Remote:
  841. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  842. WLBS_TIMEOUT => No response received. If this value is returned when
  843. accessing default host (using host priority ID
  844. WLBS_DEFAULT_HOST) it might mean that entire cluster
  845. is stopped and there was no default host to respond
  846. to the command.
  847. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  848. be carried out.
  849. WSA... => Specified Winsock error occurred when communicating
  850. with the cluster.
  851. Local:
  852. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  853. functioning properly. Only remote operations can
  854. be carried out.
  855. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  856. driver. WLBS might not be loaded.
  857. */
  858. extern DWORD WINAPI WlbsEnable
  859. (
  860. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  861. for local or this cluster operation. */
  862. DWORD host, /* IN - Host's dedicated address, priority ID,
  863. WLBS_DEFAULT_HOST for current default
  864. host, WLBS_ALL_HOSTS for all hosts, or
  865. WLBS_LOCAL_HOST for local operation. */
  866. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  867. the hosts or NULL if response values
  868. are not desired or operations are being
  869. performed locally. */
  870. PDWORD num_hosts, /* IN - Size of the response array or NULL if
  871. response array is not specified and
  872. host count is not desired.
  873. OUT - Number of responses received. Note that
  874. this value can be larger than the size
  875. of the response array. In this case
  876. only the first few responses that fit
  877. in the array are returned. */
  878. DWORD vip, /* IN - Virtual IP Address to specify the target port
  879. rule or WLBS_EVERY_VIP */
  880. DWORD port /* IN - Port number to specify the target port
  881. rule or WLBS_ALL_PORTS. */
  882. );
  883. /*
  884. Enable traffic handling for rule containing the specified port on specified
  885. host or all cluster hosts. Only rules that are set for multiple host
  886. filtering mode are affected.
  887. returns:
  888. For local operations or remote operations on individual cluster hosts,
  889. return value represents status value returned by the target host. For
  890. cluster-wide remote operations, return value represents the summary of
  891. the return values from all cluster hosts. Individual host responses,
  892. corresponding to a single-host, return values are recorded in the
  893. response array.
  894. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  895. control operations.
  896. Single-host:
  897. WLBS_OK => Port rule enabled.
  898. WLBS_ALREADY => Port rule already enabled.
  899. WLBS_SUSPENDED => Cluster mode control suspended.
  900. WLBS_NOT_FOUND => No port rule containing specified port found.
  901. WLBS_STOPPED => Cannot start handling traffic since cluster mode
  902. is stopped.
  903. WLBS_DRAINING => Cannot enable handling traffic since host is draining.
  904. Cluster-wide:
  905. WLBS_OK => Port rule enabled on all hosts with cluster mode
  906. started.
  907. WLBS_NOT_FOUND => At least one host could not find port rule containing
  908. specified port.
  909. WLBS_SUSPENDED => At least one host is suspended.
  910. Remote:
  911. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  912. WLBS_TIMEOUT => No response received. If this value is returned when
  913. accessing default host (using host priority ID
  914. WLBS_DEFAULT_HOST) it might mean that entire cluster
  915. is stopped and there was no default host to respond
  916. to the command.
  917. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  918. be carried out.
  919. WSA... => Specified Winsock error occurred when communicating
  920. with the cluster.
  921. Local:
  922. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  923. functioning properly. Only remote operations can
  924. be carried out.
  925. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  926. driver. WLBS might not be loaded.
  927. */
  928. extern DWORD WINAPI WlbsDisable
  929. (
  930. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  931. for local or this cluster operation. */
  932. DWORD host, /* IN - Host's dedicated address, priority ID,
  933. WLBS_DEFAULT_HOST for current default
  934. host, WLBS_ALL_HOSTS for all hosts, or
  935. WLBS_LOCAL_HOST for local operation. */
  936. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  937. the hosts or NULL if response values
  938. are not desired or operations are being
  939. performed locally. */
  940. PDWORD num_hosts, /* IN - Size of the response array or NULL if
  941. response array is not specified and
  942. host count is not desired.
  943. OUT - Number of responses received. Note that
  944. this value can be larger than the size
  945. of the response array. In this case
  946. only the first few responses that fit
  947. in the array are returned. */
  948. DWORD vip, /* IN - Virtual IP Address to specify the target port
  949. rule or WLBS_EVERY_VIP */
  950. DWORD port /* IN - Port number to specify the target port
  951. rule or WLBS_ALL_PORTS. */
  952. );
  953. /*
  954. Disable ALL traffic handling for rule containing the specified port on
  955. specified host or all cluster hosts. Only rules that are set for multiple
  956. host filtering mode are affected.
  957. returns:
  958. For local operations or remote operations on individual cluster hosts,
  959. return value represents status value returned by the target host. For
  960. cluster-wide remote operations, return value represents the summary of
  961. the return values from all cluster hosts. Individual host responses,
  962. corresponding to a single-host, return values are recorded in the
  963. response array.
  964. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  965. control operations.
  966. Single-host:
  967. WLBS_OK => All traffic handling on the port rule is disabled.
  968. WLBS_ALREADY => Port rule already disabled.
  969. WLBS_SUSPENDED => Cluster mode control suspended.
  970. WLBS_NOT_FOUND => No port rule containing specified port found.
  971. WLBS_STOPPED => Cannot stop handling traffic since cluster mode
  972. is stopped.
  973. WLBS_DRAINING => Cannot stop handling traffic since host is draining.
  974. Cluster-wide:
  975. WLBS_OK => Port rule disabled on all hosts with cluster mode
  976. started.
  977. WLBS_NOT_FOUND => At least one host could not find port rule containing
  978. specified port.
  979. WLBS_SUSPENDED => At least one host is suspended.
  980. Remote:
  981. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  982. WLBS_TIMEOUT => No response received. If this value is returned when
  983. accessing default host (using host priority ID
  984. WLBS_DEFAULT_HOST) it might mean that entire cluster
  985. is stopped and there was no default host to respond
  986. to the command.
  987. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  988. be carried out.
  989. WSA... => Specified Winsock error occurred when communicating
  990. with the cluster.
  991. Local:
  992. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  993. functioning properly. Only remote operations can
  994. be carried out.
  995. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  996. driver. WLBS might not be loaded.
  997. */
  998. extern DWORD WINAPI WlbsDrain
  999. (
  1000. DWORD cluster, /* IN - Cluster address or WLBS_LOCAL_CLUSTER
  1001. for local or this cluster operation. */
  1002. DWORD host, /* IN - Host's dedicated address, priority ID,
  1003. WLBS_DEFAULT_HOST for current default
  1004. host, WLBS_ALL_HOSTS for all hosts, or
  1005. WLBS_LOCAL_HOST for local operation. */
  1006. PWLBS_RESPONSE response, /* OUT - Array of response values from each of
  1007. the hosts or NULL if response values
  1008. are not desired or operations are being
  1009. performed locally. */
  1010. PDWORD num_hosts, /* IN - Size of the response array or NULL if
  1011. response array is not specified and
  1012. host count is not desired.
  1013. OUT - Number of responses received. Note that
  1014. this value can be larger than the size
  1015. of the response array. In this case
  1016. only the first few responses that fit
  1017. in the array are returned. */
  1018. DWORD vip, /* IN - Virtual IP Address to specify the target port
  1019. rule or WLBS_EVERY_VIP */
  1020. DWORD port /* IN - Port number to specify the target port
  1021. rule or WLBS_ALL_PORTS. */
  1022. );
  1023. /*
  1024. Disable NEW traffic handling for rule containing the specified port on
  1025. specified host or all cluster hosts. Only rules that are set for multiple
  1026. host filtering mode are affected.
  1027. returns:
  1028. For local operations or remote operations on individual cluster hosts,
  1029. return value represents status value returned by the target host. For
  1030. cluster-wide remote operations, return value represents the summary of
  1031. the return values from all cluster hosts. Individual host responses,
  1032. corresponding to a single-host, return values are recorded in the
  1033. response array.
  1034. WLBS_INIT_ERROR => Error initializing control module. Cannot perform
  1035. control operations.
  1036. Single-host:
  1037. WLBS_OK => New traffic handling on the port rule is disabled.
  1038. WLBS_ALREADY => Port rule already being drained.
  1039. WLBS_SUSPENDED => Cluster mode control suspended.
  1040. WLBS_NOT_FOUND => No port rule containing specified port found.
  1041. WLBS_STOPPED => Cannot stop handling traffic since cluster mode
  1042. is stopped.
  1043. WLBS_DRAINING => Cannot stop handling traffic since host is draining.
  1044. Cluster-wide:
  1045. WLBS_OK => Port rule disabled on all hosts with cluster mode
  1046. started.
  1047. WLBS_NOT_FOUND => At least one host could not find port rule containing
  1048. specified port.
  1049. WLBS_SUSPENDED => At least one host is suspended.
  1050. Remote:
  1051. WLBS_BAD_PASSW => Specified password was not accepted by the cluster.
  1052. WLBS_TIMEOUT => No response received. If this value is returned when
  1053. accessing default host (using host priority ID
  1054. WLBS_DEFAULT_HOST) it might mean that entire cluster
  1055. is stopped and there was no default host to respond
  1056. to the command.
  1057. WLBS_LOCAL_ONLY => WinSock failed to load. Only local operations can
  1058. be carried out.
  1059. WSA... => Specified Winsock error occurred when communicating
  1060. with the cluster.
  1061. Local:
  1062. WLBS_REMOTE_ONLY => WLBS is not installed on this system or is not
  1063. functioning properly. Only remote operations can
  1064. be carried out.
  1065. WLBS_IO_ERROR => I/O error opening or communicating with WLBS
  1066. driver. WLBS might not be loaded.
  1067. */
  1068. /******************************************************************************
  1069. "Sticky" options for remote operations. Parameters set by these routines will
  1070. apply for all subsequent remote cluster control operations for the specified
  1071. cluster. Use WLBS_ALL_CLUSTERS to adjust parameters for all clusters.
  1072. ******************************************************************************/
  1073. extern VOID WINAPI WlbsPortSet
  1074. (
  1075. DWORD cluster, /* IN - Cluster address or WLBS_ALL_CLUSTERS
  1076. for all clusters. */
  1077. WORD port /* IN - UDP port or 0 to revert to the
  1078. default (2504). */
  1079. );
  1080. /*
  1081. Set UDP port that will be used for sending control messages to the cluster.
  1082. returns:
  1083. */
  1084. extern VOID WINAPI WlbsPasswordSet
  1085. (
  1086. DWORD cluster, /* IN - Cluster address or WLBS_ALL_CLUSTERS
  1087. for all clusters. */
  1088. WCHAR* password /* IN - Password or NULL to revert to the
  1089. default (no password). */
  1090. );
  1091. /*
  1092. Set password to be used in the subsequent control messages sent to the
  1093. cluster.
  1094. returns:
  1095. */
  1096. extern VOID WINAPI WlbsCodeSet
  1097. (
  1098. DWORD cluster, /* IN - Cluster address or WLBS_ALL_CLUSTERS
  1099. for all clusters. */
  1100. DWORD password /* IN - Password or 0 to revert to the
  1101. default (no password). */
  1102. );
  1103. /*
  1104. Set password to be used in the subsequent control messages sent to the
  1105. cluster.
  1106. returns:
  1107. */
  1108. extern VOID WINAPI WlbsDestinationSet
  1109. (
  1110. DWORD cluster, /* IN - Cluster address or WLBS_ALL_CLUSTERS
  1111. for all clusters. */
  1112. DWORD dest /* IN - Destination address or 0 to revert to
  1113. the default (same as the cluster
  1114. address specified during control
  1115. calls). */
  1116. );
  1117. /*
  1118. Set the destination address to send cluster control messages to. This
  1119. parameter in only supplied for debugging or special purposes. By default
  1120. all control messages are sent to the cluster primary address specified
  1121. when invoking cluster control routines.
  1122. returns:
  1123. */
  1124. extern VOID WINAPI WlbsTimeoutSet
  1125. (
  1126. DWORD cluster, /* IN - Cluster address or WLBS_ALL_CLUSTERS
  1127. for all clusters. */
  1128. DWORD milliseconds /*IN - Number of milliseconds or 0 to revert
  1129. to the default (10 seconds). */
  1130. );
  1131. /*
  1132. Set number of milliseconds to wait for replies from cluster hosts when
  1133. performing remote operations.
  1134. returns:
  1135. */
  1136. DWORD WINAPI WlbsEnumClusters(OUT DWORD* pdwAddresses, OUT DWORD* pdwNum);
  1137. DWORD WINAPI WlbsGetAdapterGuid(IN DWORD cluster, OUT GUID* pAdapterGuid);
  1138. /*
  1139. * Function: WlbsQueryState
  1140. * Description: This function is a logical extension of WlbsQuery, which can be used
  1141. * to query state from an NLB cluster other than the conventional membership
  1142. * list and convergence state. Retrievable state includes the driver-
  1143. * resident NLB parameters, the state of a BDA team, the state of a given
  1144. * port rule and the packet filtering decision for an arbitrary packet.
  1145. * Parameters: IN cluster - cluster IP address or WLBS_ALL_CLUSTERS for all clusters. For a
  1146. * IOCTL_CVY_QUERY_BDA_TEAMING operation, which is global to ALL NLB
  1147. * instances on a given host, the cluster should be WLBS_ALL_CLUSTERS.
  1148. * IN host - host's dedicated address, priority ID, WLBS_DEFAULT_HOST for current default
  1149. * host, WLBS_ALL_HOSTS for all hosts, or WLBS_LOCAL_HOST for local operation.
  1150. * For IOCTL_CVY_QUERY_BDA_TEAMING and IOCTL_CVY_QUERY_PARAMS operations, which
  1151. * can only be performed locally, the host should be WLBS_LOCAL_HOST.
  1152. * IN operation - one of IOCTL_CVY_QUERY_BDA_TEAMING, IOCTL_CVY_QUERY_PARAMS,
  1153. * IOCTL_CVY_QUERY_PORT_STATE or IOCTL_CVY_QUERY_FILTER.
  1154. * IN/OUT pOptions - a pointer to an NLB_OPTIONS structure with all appropriate input
  1155. * fields for the particular operation filled-in. WlbsQueryState
  1156. * operations utilize the "state" sub-structure of the NLB_OPTIONS
  1157. * structure. For the particular operation, the necessary input
  1158. * parameters are marked as IN parameters in the definition of the
  1159. * OPTIONS sub-structure for that operation.
  1160. * OUT pResonse - a pointer to an array of WLBS_RESPONSE structures that will be filled-in
  1161. * at the successful completion of the request. The array should be long
  1162. * enough to hold the maximum number of unique responses (one per cluster
  1163. * host), which is bounded by WLBS_MAX_HOSTS. Only responses for which
  1164. * there is room in this array will be returned; all others will be discarded.
  1165. * IN/OUT pcResponses - a pointer to a DWORD that contains that length of the WLBS_RESPONSE
  1166. * array on the way in and the number of successful responses received
  1167. * on the way out.
  1168. * Returns: DWORD - one of:
  1169. * WLBS_INIT_ERROR - an initialization error occurred.
  1170. * WLBS_REMOTE_ONLY - the operation can be performed ONLY remotely.
  1171. * WLBS_LOCAL_ONLY - the operation can be performed ONLY locally.
  1172. * WLBS_IO_ERROR - an I/O error occurred.
  1173. * WLBS_TIMEOUT - no response from the cluster was returned before giving up.
  1174. * WLBS_OK - the request succeeded.
  1175. * >= WSABASEERR - a socket error occurred, see WSA documentation for details.
  1176. * Notes:
  1177. */
  1178. extern DWORD WINAPI WlbsQueryState
  1179. (
  1180. DWORD cluster,
  1181. DWORD host,
  1182. DWORD operation,
  1183. PNLB_OPTIONS pOptions,
  1184. PWLBS_RESPONSE pResponse,
  1185. PDWORD pcResponses
  1186. );
  1187. /*
  1188. * Function: WlbsConnectionUp
  1189. * Description: This thread safe function notifies the NLB kernel-mode driver that a
  1190. * connection, or session, as defined by the caller of this function, is being
  1191. * established. If this type of connection is supported by NLB, it
  1192. * will provide affinity for the duration of the connection. This
  1193. * interface is reference counted and may be called multiple times with
  1194. * the same parameters. If N connection-up notifications are given, N
  1195. * connection-down notifications (or ONE connection-reset notification)
  1196. * are necessary to remove the state that NLB creates to track this
  1197. * connection. The semantics of the information provided here must
  1198. * EXACTLY match that which NLB is expecting. For example, if a
  1199. * notification for an IPSec session is given, then NLB expects the
  1200. * protocol ID to be 50 (ESP) and the ports to be the UDP ports used
  1201. * in the IKE negotiation over UDP.
  1202. * Parameters: IN ServerIp - the server IP address of this connection, in network byte order.
  1203. * IN ServerPort - the server port (if relevant) of this connection, in network byte order.
  1204. * IN ClientIp - the client IP address of this connection, in network byte order.
  1205. * IN ClientPort - the client port (if relevant) of this connection, in network byte order.
  1206. * IN Protocol - the IP protocol of this connection. Support protocos = IPSec (50).
  1207. * OUT NLBStatusEx - the NLB-specific status of this request, as follows:
  1208. * WLBS_OK, if the notification is accepted.
  1209. * WLBS_REFUSED, if the notification is rejected (e.g., if the cluster is stopped)..
  1210. * WLBS_BAD_PARAMS, if the arguments are invalid (e.g., an unsupported protocol ID).
  1211. * WLBS_NOT_FOUND, if NLB was not bound to the specified adapter (identified by server IP address).
  1212. * WLBS_FAILURE, if a non-specific error occurred.
  1213. * Returns: DWORD - a Win32 error code, ERROR_SUCCESS, if successful.
  1214. * Notes:
  1215. */
  1216. DWORD WINAPI WlbsConnectionUp
  1217. (
  1218. ULONG ServerIp,
  1219. USHORT ServerPort,
  1220. ULONG ClientIp,
  1221. USHORT ClientPort,
  1222. BYTE Protocol,
  1223. PULONG NLBStatusEx
  1224. );
  1225. /*
  1226. * Function: WlbsConnectionDown
  1227. * Description: This thread safe function notifies the NLB kernel-mode driver that a
  1228. * connection, or session, as defined by the caller of this function, is being
  1229. * torn-down. This interface is reference counted and must be called
  1230. * the same number of times that the connection-up interface was called
  1231. * for this particular connection (that is, the number of Downs + Resets
  1232. * must be equal to the nubmer of Ups). If N connection-up notifications
  1233. * are given, N connection-down/reset notifications are necessary to remove
  1234. * the state that NLB creates to track this connection. The semantics of
  1235. * the information provided here must EXACTLY match that which NLB is expecting.
  1236. * For example, if a notification for an IPSec session is given, then NLB
  1237. * expects the protocol ID to be 50 (ESP) and the ports to be the UDP ports
  1238. * used in the IKE negotiation over UDP.
  1239. * Parameters: IN ServerIp - the server IP address of this connection, in network byte order.
  1240. * IN ServerPort - the server port (if relevant) of this connection, in network byte order.
  1241. * IN ClientIp - the client IP address of this connection, in network byte order.
  1242. * IN ClientPort - the client port (if relevant) of this connection, in network byte order.
  1243. * IN Protocol - the IP protocol of this connection. Support protocos = IPSec (50).
  1244. * OUT NLBStatusEx - the NLB-specific status of this request, as follows:
  1245. * WLBS_OK, if the notification is accepted.
  1246. * WLBS_REFUSED, if the notification is rejected (e.g., if the cluster is stopped)..
  1247. * WLBS_BAD_PARAMS, if the arguments are invalid (e.g., an unsupported protocol ID).
  1248. * WLBS_NOT_FOUND, if NLB was not bound to the specified adapter (identified by server IP address).
  1249. * WLBS_FAILURE, if a non-specific error occurred.
  1250. * Returns: DWORD - a Win32 error code, ERROR_SUCCESS, if successful.
  1251. * Notes:
  1252. */
  1253. DWORD WINAPI WlbsConnectionDown
  1254. (
  1255. ULONG ServerIp,
  1256. USHORT ServerPort,
  1257. ULONG ClientIp,
  1258. USHORT ClientPort,
  1259. BYTE Protocol,
  1260. PULONG NLBStatusEx
  1261. );
  1262. /*
  1263. * Function: WlbsConnectionReset
  1264. * Description: This function notifies the NLB kernel-mode driver that a connection,
  1265. * or session, as defined by the caller of this function, is being
  1266. * closed immediately. This interface is reference counted and must be called
  1267. * the same number of times that the connection-up interface was called
  1268. * for this particular connection (that is, the number of Downs + Resets
  1269. * must be equal to the nubmer of Ups). If N connection-up notifications
  1270. * are given, N connection-down/reset notifications are necessary to remove
  1271. * the state that NLB creates to track this connection. The semantics of
  1272. * the information provided here must EXACTLY match that which NLB is expecting.
  1273. * For example, if a notification for an IPSec session is given, then NLB
  1274. * expects the protocol ID to be 50 (ESP) and the ports to be the UDP ports
  1275. * used in the IKE negotiation over UDP.
  1276. * Parameters: IN ServerIp - the server IP address of this connection, in network byte order.
  1277. * IN ServerPort - the server port (if relevant) of this connection, in network byte order.
  1278. * IN ClientIp - the client IP address of this connection, in network byte order.
  1279. * IN ClientPort - the client port (if relevant) of this connection, in network byte order.
  1280. * IN Protocol - the IP protocol of this connection. Support protocos = IPSec (50).
  1281. * OUT NLBStatusEx - the NLB-specific status of this request, as follows:
  1282. * WLBS_OK, if the notification is accepted.
  1283. * WLBS_REFUSED, if the notification is rejected (e.g., if the cluster is stopped)..
  1284. * WLBS_BAD_PARAMS, if the arguments are invalid (e.g., an unsupported protocol ID).
  1285. * WLBS_NOT_FOUND, if NLB was not bound to the specified adapter (identified by server IP address).
  1286. * WLBS_FAILURE, if a non-specific error occurred.
  1287. * Returns: DWORD - a Win32 error code, ERROR_SUCCESS, if successful.
  1288. * Notes:
  1289. */
  1290. DWORD WINAPI WlbsConnectionReset
  1291. (
  1292. ULONG ServerIp,
  1293. USHORT ServerPort,
  1294. ULONG ClientIp,
  1295. USHORT ClientPort,
  1296. BYTE Protocol,
  1297. PULONG NLBStatusEx
  1298. );
  1299. /*
  1300. * Function: WlbsCancelConnectionNotify
  1301. * Description: This thread safe function cleans up state maintained in the dll
  1302. * to support connection/session notifications to the NLB driver.
  1303. * The only usage constraint is that this API function must be the
  1304. * last notification call made by (any thread in) the process.
  1305. * Note that it is legal to cancel notifications then reestablish
  1306. * them within the lifetime of a thread of control.
  1307. * Parameters: NONE
  1308. * Returns: DWORD - a Win32 error code, ERROR_SUCCESS, if successful. No correction
  1309. * action is needed if this call fails as it makes best effort.
  1310. * Notes:
  1311. */
  1312. DWORD WINAPI WlbsCancelConnectionNotify();
  1313. /* Typedefs for GetProcAddress calls when dynamically loading wlbsctrl.dll. */
  1314. typedef DWORD (WINAPI * NLBNotificationConnectionUp) (ULONG ServerIp, USHORT ServerPort, ULONG ClientIp, USHORT ClientPort, BYTE Protocol, PULONG NLBStatusEx);
  1315. typedef DWORD (WINAPI * NLBNotificationConnectionDown) (ULONG ServerIp, USHORT ServerPort, ULONG ClientIp, USHORT ClientPort, BYTE Protocol, PULONG NLBStatusEx);
  1316. typedef DWORD (WINAPI * NLBNotificationConnectionReset) (ULONG ServerIp, USHORT ServerPort, ULONG ClientIp, USHORT ClientPort, BYTE Protocol, PULONG NLBStatusEx);
  1317. typedef DWORD (WINAPI * NLBNotificationCancelNotify) ();
  1318. typedef HANDLE (WINAPI *WlbsOpen_FUNC)();
  1319. extern HANDLE WINAPI WlbsOpen();
  1320. typedef DWORD (WINAPI *WlbsLocalClusterControl_FUNC)
  1321. (
  1322. IN HANDLE NlbHdl,
  1323. IN const GUID * pAdapterGuid,
  1324. IN LONG ioctl,
  1325. IN DWORD Vip,
  1326. IN DWORD PortNum,
  1327. OUT DWORD * pdwHostMap
  1328. );
  1329. extern DWORD WINAPI WlbsLocalClusterControl
  1330. (
  1331. IN HANDLE NlbHdl,
  1332. IN const GUID * pAdapterGuid,
  1333. IN LONG ioctl,
  1334. IN DWORD Vip,
  1335. IN DWORD PortNum,
  1336. OUT DWORD * pdwHostMap
  1337. );
  1338. typedef DWORD (WINAPI *WlbsGetClusterMembers_FUNC)
  1339. (
  1340. IN const GUID * pAdapterGuid,
  1341. OUT DWORD * pNumHosts,
  1342. OUT PWLBS_RESPONSE pResponse
  1343. );
  1344. extern DWORD WINAPI WlbsGetClusterMembers
  1345. (
  1346. IN const GUID * pAdapterGuid,
  1347. OUT DWORD * pNumHosts,
  1348. OUT PWLBS_RESPONSE pResponse
  1349. );
  1350. extern DWORD WINAPI WlbsGetSpecifiedClusterMember
  1351. (
  1352. IN const GUID * pAdapterGuid,
  1353. IN ULONG host_id,
  1354. OUT PWLBS_RESPONSE pResponse
  1355. );
  1356. #ifdef __cplusplus
  1357. } /* extern "C" */
  1358. #endif
  1359. #endif /* KERNEL_MODE */
  1360. #endif /* _WLBSCTRL_H_ */