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.

175 lines
9.4 KiB

  1. #pragma once
  2. #define CVY_MAX_ALLOCS 50 /* maximum number of allocations
  3. we can perform for packets
  4. and actions */
  5. #define CVY_MAX_SEND_PACKETS 50 /* maximum number of packets
  6. Prot_packets_send can send
  7. down at one time */
  8. #define CVY_MAX_RCT_PACKETS 10 /* maximum number of RCTL packets
  9. Prot_recv_complete can service
  10. at one time */
  11. /* Structure to hold the bi-directional affinity registry settings. */
  12. typedef struct _CVY_BDA {
  13. WCHAR team_id[CVY_MAX_BDA_TEAM_ID + 1]; /* The team ID - user-level support should enforce that it is a GUID. */
  14. ULONG active; /* Is this adapter part of a BDA team? */
  15. ULONG master; /* Boolean indication of master status (Slave=0). */
  16. ULONG reverse_hash; /* Sets direction of hashing - forward (normal) or reverse. */
  17. } CVY_BDA, PCVY_BDA;
  18. /* port group rule - keep it 64bit in size for encryption */
  19. typedef struct
  20. {
  21. ULONG start_port, /* starting port number */
  22. end_port; /* ending port number */
  23. ULONG virtual_ip_addr; /* Virtual clusters - the VIP to which the rule applies.
  24. All VIPs is represented by 0xffffffff. */
  25. ULONG code; /* unique rule code */
  26. ULONG mode; /* filtering mode */
  27. ULONG protocol; /* CVY_TCP, CVY_UDP or CVY_TCP_UDP */
  28. ULONG valid; /* for rule management in user mode */
  29. union
  30. {
  31. struct
  32. {
  33. ULONG priority; /* mastership priority: 1->N or 0 for
  34. not-specified */
  35. } single; /* data for single server mode */
  36. struct
  37. {
  38. USHORT equal_load; /* TRUE => even load distribution */
  39. USHORT affinity; /* TRUE - map all client connections to one server */
  40. ULONG load; /* percentage of load to handle locally */
  41. } multi; /* data for multi-server mode */
  42. } mode_data; /* data for appropriate port group mode */
  43. }
  44. CVY_RULE, * PCVY_RULE;
  45. /* host parameters */
  46. typedef struct
  47. {
  48. /* obtained from the registry */
  49. ULONG parms_ver; /* parameter structure version */
  50. ULONG effective_ver; /* what WLBS version we are effectively operating in. */
  51. ULONG host_priority; /* host's priority for single-server mastership */
  52. ULONG alive_period; /* period for sending "I am alive" messages
  53. in milliseconds */
  54. ULONG alive_tolerance; /* how many "I am alive" messages can be
  55. missed from other servers before assuming
  56. that the host is dead */
  57. ULONG num_actions; /* number of actions to allocate */
  58. ULONG num_packets; /* number of packets to allocate */
  59. ULONG num_send_msgs; /* number of send packets to allocate */
  60. ULONG install_date; /* install time stamp */
  61. ULONG rmt_password; /* remote maintenance password */
  62. ULONG rct_password; /* remote control password */
  63. ULONG rct_port; /* remote control UDP port */
  64. ULONG rct_enabled; /* TRUE - remote control enabled */
  65. ULONG num_rules; /* # active port group rules */
  66. ULONG cleanup_delay; /* dirty connection cleanup delay in
  67. milliseconds, 0 - delay */
  68. ULONG cluster_mode; /* TRUE - enabled on startup */
  69. ULONG persisted_states; /* which states should be persisted across reboots. */
  70. ULONG init_state; /* 0 = stopped, 1 = started, 2 = suspended */
  71. ULONG dscr_per_alloc; /* number of connection tracking
  72. descriptor per allocation */
  73. ULONG max_dscr_allocs; /* maximum number of connection tracking
  74. descriptor allocations */
  75. ULONG scale_client; /* TRUE - load balance connections from a
  76. given client across cluster servers */
  77. ULONG nbt_support; /* TRUE - NBT cluster name support enabled */
  78. ULONG mcast_support; /* TRUE - enable multicast MAC address support
  79. for switched V1.3.0b */
  80. ULONG mcast_spoof; /* TRUE - if mcast_support is TRUE - enable
  81. TCP/IP spoofing so that remote hosts can
  82. resolve cluster IP address to multicast
  83. address via ARPs V1.3.0b */
  84. ULONG igmp_support; /* TRUE - if IGMP support is enabled */
  85. ULONG mask_src_mac; /* TRUE - spoof source MAC when sending
  86. frames in unicast mode to prevent
  87. switches from getting confused V 2.0.6 */
  88. ULONG netmon_alive; /* TRUE - pass heartbeat frames to the
  89. protocols */
  90. ULONG convert_mac; /* TRUE - automatically match MAC address
  91. to primary cluster IP address */
  92. ULONG ip_chg_delay; /* delay in milliseconds to block outgoing
  93. ARPs while IP address change is in
  94. process */
  95. ULONG tcp_dscr_timeout; /* The timeout for expired TCP connection descriptors. */
  96. ULONG ipsec_dscr_timeout; /* The timeout for expired IPSec connection descriptors. */
  97. ULONG filter_icmp; /* Whether or not ICMP traffic is filtered or accepted by all hosts. */
  98. CVY_BDA bda_teaming; /* the bi-directional affinity teaming config. */
  99. ULONG identity_period; /* Period for transmitting identity heartbeats (in ms) */
  100. ULONG identity_enabled; /* TRUE - identity heartbeats are transmitted */
  101. /* strings */
  102. WCHAR cl_mac_addr [CVY_MAX_NETWORK_ADDR + 1];
  103. /* cluster MAC address */
  104. WCHAR cl_ip_addr [CVY_MAX_CL_IP_ADDR + 1];
  105. /* cluster IP address */
  106. WCHAR cl_net_mask [CVY_MAX_CL_NET_MASK + 1];
  107. /* netmask for cluster IP address or "" for none */
  108. WCHAR ded_ip_addr [CVY_MAX_DED_IP_ADDR + 1];
  109. /* dedicated IP address or "" for none */
  110. WCHAR ded_net_mask [CVY_MAX_DED_NET_MASK + 1];
  111. /* netmask for dedicated IP address or "" for none */
  112. WCHAR domain_name [CVY_MAX_DOMAIN_NAME + 1];
  113. /* client's domain name */
  114. WCHAR cl_igmp_addr [CVY_MAX_CL_IGMP_ADDR + 1];
  115. /* dedicated IP address or "" for none */
  116. CVY_RULE port_rules[CVY_MAX_RULES - 1];
  117. /* port rules (account for internal default) */
  118. WCHAR hostname[CVY_MAX_FQDN + 1];
  119. /* hostname.domain for this host if available. */
  120. }
  121. CVY_PARAMS, * PCVY_PARAMS;
  122. #define CVY_DRIVER_RULE_CODE_GET(rulep) ((rulep) -> code)
  123. #define CVY_DRIVER_RULE_CODE_SET(rulep) ((rulep) -> code = \
  124. ((ULONG) (((rulep) -> start_port) << 0) | \
  125. (ULONG) (((rulep) -> end_port) << 12) | \
  126. (ULONG) (((rulep) -> protocol) << 24) | \
  127. (ULONG) (((rulep) -> mode) << 28) | \
  128. (ULONG) (((rulep) -> mode == CVY_MULTI ? (rulep) -> mode_data . multi . affinity : 0) << 30)) \
  129. ^ ~((rulep) -> virtual_ip_addr))
  130. extern LONG Params_init (
  131. PVOID nlbctxt,
  132. PVOID reg_path,
  133. PVOID adapter_guid, /* GUID of the adapter for multiple nics*/
  134. PCVY_PARAMS paramp);
  135. /* Update the host state registry key. This is called as a result of a local or remote
  136. control operation changing the current state of the host. This state will be persisted
  137. across reboots, adapter disable/enables, etc. */
  138. VOID Params_set_host_state (PNDIS_WORK_ITEM pWorkItem, PVOID nlbctxt);
  139. #if defined (NLB_TCP_NOTIFICATION)
  140. /*
  141. * Function: Params_read_notification
  142. * Desctription: Looks for a global NLB registry to turn notifications on or
  143. * off. By default the key does NOT EVEN EXIST, so this is only
  144. * a method by which to alter the hard-coded default.
  145. * Parameters: None.
  146. * Returns: NTSTATUS - the status of the registry operations.
  147. * Author: shouse, 4.29.02
  148. * Notes:
  149. */
  150. NTSTATUS Params_read_notification (VOID);
  151. #endif