Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
8.1 KiB

  1. #pragma once
  2. #define CVY_MAX_CALLB_QUEUE_RETRIES 100 /* maximum number of times to
  3. attempt queueing miniport
  4. callback in Nic_sync_queue */
  5. #define CVY_MAX_ALLOCS 50 /* maximum number of allocations
  6. we can perform for packets
  7. and actions */
  8. #define CVY_MAX_SEND_PACKETS 50 /* maximum number of packets
  9. Prot_packets_send can send
  10. down at one time */
  11. #define CVY_MAX_PENDING_PACKETS 100 /* maximum number of packets that
  12. can be queued in a deserialized
  13. wlbs driver */
  14. /* Structure to hold the bi-directional affinity registry settings. */
  15. typedef struct _CVY_BDA {
  16. WCHAR team_id[CVY_MAX_BDA_TEAM_ID + 1]; /* The team ID - user-level support should enforce that it is a GUID. */
  17. ULONG active; /* Is this adapter part of a BDA team? */
  18. ULONG master; /* Boolean indication of master status (Slave=0). */
  19. ULONG reverse_hash; /* Sets direction of hashing - forward (normal) or reverse. */
  20. } CVY_BDA, PCVY_BDA;
  21. /* port group rule - keep it 64bit in size for encryption */
  22. typedef struct
  23. {
  24. ULONG start_port, /* starting port number */
  25. end_port; /* ending port number */
  26. ULONG virtual_ip_addr; /* Virtual clusters - the VIP to which the rule applies.
  27. All VIPs is represented by 0xffffffff. */
  28. ULONG code; /* unique rule code */
  29. ULONG mode; /* filtering mode */
  30. ULONG protocol; /* CVY_TCP, CVY_UDP or CVY_TCP_UDP */
  31. ULONG valid; /* for rule management in user mode */
  32. union
  33. {
  34. struct
  35. {
  36. ULONG priority; /* mastership priority: 1->N or 0 for
  37. not-specified */
  38. } single; /* data for single server mode */
  39. struct
  40. {
  41. USHORT equal_load; /* TRUE => even load distribution */
  42. USHORT affinity; /* TRUE - map all client connections to one server */
  43. ULONG load; /* percentage of load to handle locally */
  44. } multi; /* data for multi-server mode */
  45. } mode_data; /* data for appropriate port group mode */
  46. }
  47. CVY_RULE, * PCVY_RULE;
  48. /* host parameters */
  49. typedef struct
  50. {
  51. /* obtained from the registry */
  52. ULONG parms_ver; /* parameter structure version */
  53. ULONG effective_ver; /* what WLBS version we are effectively operating in. */
  54. ULONG host_priority; /* host's priority for single-server mastership */
  55. ULONG alive_period; /* period for sending "I am alive" messages
  56. in milliseconds */
  57. ULONG alive_tolerance; /* how many "I am alive" messages can be
  58. missed from other servers before assuming
  59. that the host is dead */
  60. ULONG num_actions; /* number of actions to allocate */
  61. ULONG num_packets; /* number of packets to allocate */
  62. ULONG num_send_msgs; /* number of send packets to allocate */
  63. ULONG install_date; /* install time stamp */
  64. ULONG rmt_password; /* remote maintenance password */
  65. ULONG rct_password; /* remote control password */
  66. ULONG rct_port; /* remote control UDP port */
  67. ULONG rct_enabled; /* TRUE - remote control enabled */
  68. ULONG num_rules; /* # active port group rules */
  69. ULONG cleanup_delay; /* dirty connection cleanup delay in
  70. milliseconds, 0 - delay */
  71. ULONG cluster_mode; /* TRUE - enabled on startup */
  72. ULONG dscr_per_alloc; /* number of connection tracking
  73. descriptor per allocation */
  74. ULONG max_dscr_allocs; /* maximum number of connection tracking
  75. descriptor allocations */
  76. ULONG scale_client; /* TRUE - load balance connections from a
  77. given client across cluster servers */
  78. ULONG nbt_support; /* TRUE - NBT cluster name support enabled */
  79. ULONG mcast_support; /* TRUE - enable multicast MAC address support
  80. for switched V1.3.0b */
  81. ULONG mcast_spoof; /* TRUE - if mcast_support is TRUE - enable
  82. TCP/IP spoofing so that remote hosts can
  83. resolve cluster IP address to multicast
  84. address via ARPs V1.3.0b */
  85. ULONG igmp_support; /* TRUE - if IGMP support is enabled */
  86. ULONG mask_src_mac; /* TRUE - spoof source MAC when sending
  87. frames in unicast mode to prevent
  88. switches from getting confused V 2.0.6 */
  89. ULONG netmon_alive; /* TRUE - pass heartbeat frames to the
  90. protocols */
  91. ULONG convert_mac; /* TRUE - automatically match MAC address
  92. to primary cluster IP address */
  93. ULONG ip_chg_delay; /* delay in milliseconds to block outgoing
  94. ARPs while IP address change is in
  95. process */
  96. CVY_BDA bda_teaming; /* the bi-directional affinity teaming config. */
  97. /* strings */
  98. WCHAR cl_mac_addr [CVY_MAX_NETWORK_ADDR + 1];
  99. /* cluster MAC address */
  100. WCHAR cl_ip_addr [CVY_MAX_CL_IP_ADDR + 1];
  101. /* cluster IP address */
  102. WCHAR cl_net_mask [CVY_MAX_CL_NET_MASK + 1];
  103. /* netmask for cluster IP address or "" for none */
  104. WCHAR ded_ip_addr [CVY_MAX_DED_IP_ADDR + 1];
  105. /* dedicated IP address or "" for none */
  106. WCHAR ded_net_mask [CVY_MAX_DED_NET_MASK + 1];
  107. /* netmask for dedicated IP address or "" for none */
  108. WCHAR domain_name [CVY_MAX_DOMAIN_NAME + 1];
  109. /* client's domain name */
  110. WCHAR cl_igmp_addr [CVY_MAX_CL_IGMP_ADDR + 1];
  111. /* dedicated IP address or "" for none */
  112. CVY_RULE port_rules[CVY_MAX_RULES - 1];
  113. /* port rules (account for internal default) */
  114. WCHAR hostname[CVY_MAX_HOST_NAME + 1];
  115. /* hostname.domain for this host if available. */
  116. }
  117. CVY_PARAMS, * PCVY_PARAMS;
  118. #define CVY_DRIVER_RULE_CODE_GET(rulep) ((rulep) -> code)
  119. #define CVY_DRIVER_RULE_CODE_SET(rulep) ((rulep) -> code = \
  120. ((ULONG) (((rulep) -> start_port) << 0) | \
  121. (ULONG) (((rulep) -> end_port) << 12) | \
  122. (ULONG) (((rulep) -> protocol) << 24) | \
  123. (ULONG) (((rulep) -> mode) << 28) | \
  124. (ULONG) (((rulep) -> mode == CVY_MULTI ? (rulep) -> mode_data . multi . affinity : 0) << 30)) \
  125. ^ ~((rulep) -> virtual_ip_addr))
  126. extern LONG Params_init (
  127. PVOID nlbctxt,
  128. PVOID reg_path,
  129. PVOID adapter_guid, /* GUID of the adapter for multiple nics*/
  130. PCVY_PARAMS paramp);