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.

155 lines
4.2 KiB

  1. #ifndef __OSPFCFG_H__
  2. #define __OSPFCFG_H__
  3. // ospf_cfg.h
  4. // structure types
  5. #define OSPF_END_PARAM_TYPE 0
  6. #define OSPF_GLOBAL_PARAM_TYPE 1
  7. #define OSPF_AREA_PARAM_TYPE 2
  8. #define OSPF_AREA_RANGE_PARAM_TYPE 3
  9. #define OSPF_INTF_PARAM_TYPE 4
  10. #define OSPF_NEIGHBOR_PARAM_TYPE 5
  11. #define OSPF_VIRT_INTF_PARAM_TYPE 6
  12. #define OSPF_ROUTE_FILTER_PARAM_TYPE 7
  13. #define OSPF_PROTOCOL_FILTER_PARAM_TYPE 8
  14. #define OSPF_LOGGING_NONE ((DWORD) 0)
  15. #define OSPF_LOGGING_ERROR ((DWORD) 1)
  16. #define OSPF_LOGGING_WARN ((DWORD) 2)
  17. #define OSPF_LOGGING_INFO ((DWORD) 3)
  18. #define OSPF_LOGGING_MAX_VALUE OSPF_LOGGING_INFO
  19. #define OSPF_LOGGING_MIN_VALUE OSPF_LOGGING_NONE
  20. #define OSPF_LOGGING_DEFAULT OSPF_LOGGING_WARN
  21. // Global Parameters
  22. typedef struct _OSPF_GLOBAL_PARAM
  23. {
  24. DWORD type; // OSPF_GLOBAL_PARAM_TYPE
  25. DWORD create; // 1 = created, 2 = deleted
  26. DWORD enable; // 1 = enable, 2 = disable
  27. DWORD routerId;
  28. DWORD ASBrdrRtr; // 1 = yes, 2 = no
  29. DWORD logLevel; // One of the above
  30. }OSPF_GLOBAL_PARAM, *POSPF_GLOBAL_PARAM;
  31. // Area Parameters
  32. typedef struct _OSPF_AREA_PARAM
  33. {
  34. DWORD type; // OSPF_AREA_PARAM_TYPE
  35. DWORD create; // 1 = created, 2 = deleted
  36. DWORD enable; // 1 = enable, 2 = disable
  37. DWORD areaId;
  38. DWORD authType; // 1 = none, 2 = simple password
  39. DWORD importASExtern; // 1 = yes, 2 = no
  40. DWORD stubMetric;
  41. DWORD importSumAdv; // 1 = yes, 2 = no
  42. }OSPF_AREA_PARAM, *POSPF_AREA_PARAM;
  43. // Area Range Parameters
  44. typedef struct _OSPF_AREA_RANGE_PARAM
  45. {
  46. DWORD type; // OSPF_AREA_RANGE_PARAM_TYPE
  47. DWORD create; // 1 = created, 2 = deleted
  48. DWORD enable; // 1 = enable, 2 = disable
  49. DWORD areaId;
  50. DWORD rangeNet;
  51. DWORD rangeMask;
  52. }OSPF_AREA_RANGE_PARAM, *POSPF_AREA_RANGE_PARAM;
  53. // Interface Parameters
  54. typedef struct _OSPF_INTERFACE_PARAM
  55. {
  56. DWORD type; // OSPF_INTF_PARAM_TYPE
  57. DWORD create; // 1 = created, 2 = deleted
  58. DWORD enable; // 1 = enable, 2 = disable
  59. DWORD intfIpAddr;
  60. DWORD intfSubnetMask;
  61. DWORD areaId;
  62. DWORD intfType; // 1 = broadcast, 2 = NBMA,
  63. // 3 = point-to-point
  64. DWORD routerPriority;
  65. DWORD transitDelay;
  66. DWORD retransInterval;
  67. DWORD helloInterval;
  68. DWORD deadInterval;
  69. DWORD pollInterval;
  70. DWORD metricCost;
  71. BYTE password[8];
  72. DWORD mtuSize;
  73. }OSPF_INTERFACE_PARAM, *POSPF_INTERFACE_PARAM;
  74. // NBMA Neighbor Parameters
  75. typedef struct _OSPF_NBMA_NEIGHBOR_PARAM
  76. {
  77. DWORD type; // OSPF_NEIGHBOR_PARAM_TYPE
  78. DWORD create; // 1 = created, 2 = deleted
  79. DWORD enable; // 1 = enable, 2 = disable
  80. DWORD neighborIpAddr;
  81. DWORD intfIpAddr;
  82. DWORD neighborPriority;
  83. }OSPF_NBMA_NEIGHBOR_PARAM, *POSPF_NBMA_NEIGHBOR_PARAM;
  84. // Virtual Interface Parameters
  85. typedef struct _OSPF_VIRT_INTERFACE_PARAM
  86. {
  87. DWORD type; // OSPF_VIRT_INTF_PARAM_TYPE
  88. DWORD create; // 1 = created, 2 = deleted
  89. DWORD enable; // 1 = enable, 2 = disable
  90. DWORD transitAreaId;
  91. DWORD virtNeighborRouterId;
  92. DWORD transitDelay;
  93. DWORD retransInterval;
  94. DWORD helloInterval;
  95. DWORD deadInterval;
  96. BYTE password[8];
  97. }OSPF_VIRT_INTERFACE_PARAM, *POSPF_VIRT_INTERFACE_PARAM;
  98. typedef struct _OSPF_ROUTE_FILTER
  99. {
  100. DWORD dwAddress;
  101. DWORD dwMask;
  102. }OSPF_ROUTE_FILTER, *POSPF_ROUTE_FILTER;
  103. typedef enum _OSPF_FILTER_ACTION
  104. {
  105. ACTION_DROP = 0,
  106. ACTION_ACCEPT = 1
  107. }OSPF_FILTER_ACTION, *POSPF_FILTER_ACTION;
  108. typedef struct _OSPF_ROUTE_FILTER_INFO
  109. {
  110. DWORD type;
  111. OSPF_FILTER_ACTION ofaActionOnMatch;
  112. DWORD dwNumFilters;
  113. OSPF_ROUTE_FILTER pFilters[1];
  114. }OSPF_ROUTE_FILTER_INFO, *POSPF_ROUTE_FILTER_INFO;
  115. #define SIZEOF_OSPF_ROUTE_FILTERS(X) \
  116. (FIELD_OFFSET(OSPF_ROUTE_FILTER_INFO, pFilters[0]) + ((X) * sizeof(OSPF_ROUTE_FILTER)))
  117. typedef struct _OSPF_PROTO_FILTER_INFO
  118. {
  119. DWORD type;
  120. OSPF_FILTER_ACTION ofaActionOnMatch;
  121. DWORD dwNumFilters;
  122. DWORD pdwProtoId[1];
  123. }OSPF_PROTO_FILTER_INFO, *POSPF_PROTO_FILTER_INFO;
  124. #define SIZEOF_OSPF_PROTO_FILTERS(X) \
  125. (FIELD_OFFSET(OSPF_PROTO_FILTER_INFO, pdwProtoId[0]) + ((X) * sizeof(DWORD)))
  126. #endif //__OSPFCFG_H__