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.

137 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1998, Microsoft Corporation
  3. Module:
  4. vrrp\vrrprm.h
  5. Abstract:
  6. Contains type definitions and declarations for VRRP,
  7. used by the IP Router Manager.
  8. Revistion History:
  9. Harry Heymann July-07-1998 Created.
  10. Peeyush Ranjan Mar-10-1999 Modified.
  11. --*/
  12. #ifndef _VRRPRM_H_
  13. #define _VRRPRM_H_
  14. //---------------------------------------------------------------------------
  15. // CONSTANT DECLARATIONS
  16. //---------------------------------------------------------------------------
  17. #define VRRP_CONFIG_VERSION_500 500
  18. //---------------------------------------------------------------------------
  19. // constants identifying VRRP's MIB tables
  20. //---------------------------------------------------------------------------
  21. //---------------------------------------------------------------------------
  22. // constants used for the field VRRP_GLOBAL_CONFIG::LoggingLevel
  23. //---------------------------------------------------------------------------
  24. #define VRRP_LOGGING_NONE 0
  25. #define VRRP_LOGGING_ERROR 1
  26. #define VRRP_LOGGING_WARN 2
  27. #define VRRP_LOGGING_INFO 3
  28. //---------------------------------------------------------------------------
  29. // constant for the field VRRP_IF_CONFIG::AuthenticationKey;
  30. // defines maximum authentication key size
  31. //---------------------------------------------------------------------------
  32. #define VRRP_MAX_AUTHKEY_SIZE 8
  33. //---------------------------------------------------------------------------
  34. // constants for the field VRRP_IF_CONFIG::AuthenticationType
  35. //---------------------------------------------------------------------------
  36. #define VRRP_AUTHTYPE_NONE 0
  37. #define VRRP_AUTHTYPE_PLAIN 1
  38. #define VRRP_AUTHTYPE_IPHEAD 2
  39. //---------------------------------------------------------------------------
  40. // STRUCTURE DEFINITIONS
  41. //---------------------------------------------------------------------------
  42. //----------------------------------------------------------------------------
  43. // struct: VRRP_GLOBAL_CONFIG
  44. //
  45. // This MIB entry stores global configuration for VRRP
  46. // There is only one instance, so this entry has no index.
  47. //
  48. //---------------------------------------------------------------------------
  49. typedef struct _VRRP_GLOBAL_CONFIG {
  50. DWORD LoggingLevel;
  51. } VRRP_GLOBAL_CONFIG, *PVRRP_GLOBAL_CONFIG;
  52. //---------------------------------------------------------------------------
  53. // struct: VRRP_VROUTER_CONFIG
  54. //
  55. // THIS STRUCTURE IS VARIABLE LENGTH:
  56. //
  57. // After the base structure comes a variable lenght array (IPAddress) of
  58. // IP Addresses for the VRouter
  59. //
  60. // IPCount indicates the size of this array.
  61. //---------------------------------------------------------------------------
  62. typedef struct _VRRP_VROUTER_CONFIG {
  63. BYTE VRID;
  64. BYTE ConfigPriority;
  65. BYTE AdvertisementInterval;
  66. BOOL PreemptMode;
  67. BYTE IPCount;
  68. BYTE AuthenticationType;
  69. BYTE AuthenticationData[VRRP_MAX_AUTHKEY_SIZE];
  70. DWORD IPAddress[1];
  71. } VRRP_VROUTER_CONFIG, *PVRRP_VROUTER_CONFIG;
  72. //---------------------------------------------------------------------------
  73. // struct: VRRP_IF_CONFIG
  74. //
  75. // This MIB entry describes per-interface configuration.
  76. // All IP address fields must be in network order.
  77. //
  78. // THIS STRUCTURE IS VARIABLE LENGTH:
  79. //
  80. // After the base structure comes VrouterCount VRRP_VROUTER_CONFIG structures.
  81. //---------------------------------------------------------------------------
  82. typedef struct _VRRP_IF_CONFIG {
  83. BYTE VrouterCount;
  84. } VRRP_IF_CONFIG, *PVRRP_IF_CONFIG;
  85. //---------------------------------------------------------------------------
  86. // MACRO DECLARATIONS
  87. //---------------------------------------------------------------------------
  88. //---------------------------------------------------------------------------
  89. // macro: VRRP_IF_CONFIG_SIZE
  90. //
  91. // determines thge space requirements for an interface config block based
  92. // on the number of vrouters and total number of IPAddresses.
  93. //---------------------------------------------------------------------------
  94. #define VRRP_IF_CONFIG_SIZE(VRCount,IPCount) \
  95. sizeof(VRRP_IF_CONFIG) + \
  96. VRCount * sizeof(VRRP_VROUTER_CONFIG) + \
  97. (IPCount-VRCount) * sizeof(DWORD)
  98. #define VRRP_FIRST_VROUTER_CONFIG(pic) ((PVRRP_VROUTER_CONFIG)(pic + 1))
  99. #define VRRP_NEXT_VROUTER_CONFIG(pvc) \
  100. (PVRRP_VROUTER_CONFIG)((PDWORD)(pvc + 1) + (pvc->IPCount-1))
  101. #define VRRP_VROUTER_CONFIG_SIZE(pvc) \
  102. (sizeof(VRRP_VROUTER_CONFIG) + \
  103. (((pvc)->IPCount - 1) * sizeof(DWORD)))
  104. #endif // _VRRPRM_H_