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.

271 lines
6.9 KiB

  1. /*++
  2. Copyright (c) 1997-1998 Microsoft Corporation
  3. Module Name:
  4. rtmconst.h
  5. Abstract:
  6. Private Constants used in the RTMv2 DLL
  7. Author:
  8. Chaitanya Kodeboyina (chaitk) 17-Aug-1998
  9. Revision History:
  10. --*/
  11. #ifndef __ROUTING_RTMCONST_H__
  12. #define __ROUTING_RTMCONST_H__
  13. //
  14. // Registry Key Names & Limits for configuration parameters
  15. //
  16. #define MAX_CONFIG_KEY_SIZE (260*sizeof(TCHAR))
  17. #define RTM_CONFIG_ROOT TEXT("SYSTEM" \
  18. "\\CurrentControlSet" \
  19. "\\Services" \
  20. "\\RemoteAccess" \
  21. "\\RoutingTableManager")
  22. #define RTM_CONFIG_ROOT_SIZE sizeof(RTM_CONFIG_ROOT)
  23. #define REG_KEY_INSTANCE_SUBKEY TEXT("Instance %05d")
  24. #define REG_KEY_ADDR_FAMILY_SUBKEY TEXT("AddressFamily %05d")
  25. #define REG_KEY_INSTANCE_TEMPLATE TEXT("\\Instance %05d")
  26. #define REG_KEY_ADDR_FAMILY_TEMPLATE TEXT("\\Instance %05d" \
  27. "\\AddressFamily %05d")
  28. #define DEFAULT_INSTANCE_ID 0
  29. #define REG_KEY_VIEWS_SUPPORTED TEXT("ViewsSupported")
  30. #define DEFAULT_VIEWS_SUPPORTED (RTM_VIEW_MASK_UCAST | \
  31. RTM_VIEW_MASK_MCAST)
  32. #define REG_KEY_ADDRESS_SIZE TEXT("AddressSize")
  33. #define MINIMUM_ADDRESS_SIZE 1
  34. #define DEFAULT_ADDRESS_SIZE 4
  35. #define MAXIMUM_ADDRESS_SIZE RTM_MAX_ADDRESS_SIZE
  36. #define REG_KEY_MAX_NOTIFY_REGS TEXT("MaxChangeNotifyRegistrations")
  37. #define MIN_MAX_NOTIFY_REGS 1
  38. #define DEFAULT_MAX_NOTIFY_REGS 16
  39. #define MAX_MAX_NOTIFY_REGS 32
  40. #define REG_KEY_OPAQUE_INFO_PTRS TEXT("MaxOpaqueInfoPointers")
  41. #define MIN_OPAQUE_INFO_PTRS 0
  42. #define DEFAULT_OPAQUE_INFO_PTRS 5
  43. #define MAX_OPAQUE_INFO_PTRS 10
  44. #define REG_KEY_NEXTHOPS_IN_ROUTE TEXT("MaxNextHopsInRoute")
  45. #define MIN_NEXTHOPS_IN_ROUTE 1
  46. #define DEFAULT_NEXTHOPS_IN_ROUTE 3
  47. #define MAX_NEXTHOPS_IN_ROUTE 10
  48. #define REG_KEY_MAX_HANDLES_IN_ENUM TEXT("MaxHandlesReturnedInEnum")
  49. #define MIN_MAX_HANDLES_IN_ENUM 1
  50. #define DEFAULT_MAX_HANDLES_IN_ENUM 25
  51. #define MAX_MAX_HANDLES_IN_ENUM 100
  52. //
  53. // Number of bits in a byte (or an octet)
  54. //
  55. #define BITS_IN_BYTE (UINT) 8
  56. //
  57. // RTM supported view related constants
  58. //
  59. #define VIEW_MASK(id) (DWORD) (1 << (id))
  60. //
  61. // RTM supported CN related constants
  62. //
  63. #define CN_MASK(id) (DWORD) (1 << (id))
  64. #define NUM_CHANGED_DEST_LISTS 16
  65. //
  66. // Types of various data structures
  67. //
  68. #define GENERIC_TYPE 0x00
  69. #define INSTANCE_TYPE 0x01
  70. #define ADDRESS_FAMILY_TYPE 0x02
  71. #define ENTITY_TYPE 0x03
  72. #define DEST_TYPE 0x04
  73. #define ROUTE_TYPE 0x05
  74. #define NEXTHOP_TYPE 0x06
  75. #define DEST_ENUM_TYPE 0x07
  76. #define ROUTE_ENUM_TYPE 0x08
  77. #define NEXTHOP_ENUM_TYPE 0x09
  78. #define NOTIFY_TYPE 0x0A
  79. #define ROUTE_LIST_TYPE 0x0B
  80. #define LIST_ENUM_TYPE 0x0C
  81. #define V1_REGN_TYPE 0x0D
  82. #define V1_ENUM_TYPE 0x0E
  83. #if DBG_HDL
  84. //
  85. // Type & Signature of allocated structures
  86. //
  87. #define GENERIC_ALLOC '+GN0'
  88. #define INSTANCE_ALLOC '+IN1'
  89. #define ADDRESS_FAMILY_ALLOC '+AF2'
  90. #define ENTITY_ALLOC '+EN3'
  91. #define DEST_ALLOC '+DT4'
  92. #define ROUTE_ALLOC '+RT5'
  93. #define NEXTHOP_ALLOC '+NH6'
  94. #define DEST_ENUM_ALLOC '+DE7'
  95. #define ROUTE_ENUM_ALLOC '+RE8'
  96. #define NEXTHOP_ENUM_ALLOC '+NE9'
  97. #define NOTIFY_ALLOC '+NOA'
  98. #define ROUTE_LIST_ALLOC '+ELB'
  99. #define LIST_ENUM_ALLOC '+LEC'
  100. #define V1_REGN_ALLOC '+1RD'
  101. #define V1_ENUM_ALLOC '+1EE'
  102. extern const DWORD OBJECT_SIGNATURE[];
  103. //
  104. // Type & Signature of internal structures
  105. // previously allocated, but are now freed
  106. //
  107. #define INSTANCE_FREED '-IN1'
  108. #define ADDRESS_FAMILY_FREED '-AF2'
  109. #define ENTITY_FREED '-EN3'
  110. #define DEST_FREED '-DT4'
  111. #define ROUTE_FREED '-RT5'
  112. #define NEXTHOP_FREED '-NH6'
  113. #define DEST_ENUM_FREED '-DE7'
  114. #define ROUTE_ENUM_FREED '-RE8'
  115. #define NEXTHOP_ENUM_FREED '-NE9'
  116. #define NOTIFY_FREED '-NOA'
  117. #define ROUTE_LIST_FREED '-ELB'
  118. #define LIST_ENUM_FREED '-LEC'
  119. #define V1_REGN_FREED '-1RD'
  120. #define V1_ENUM_FREED '-1EE'
  121. //
  122. // Signature byte that indicates if memory
  123. // allocated for an object has been freed
  124. //
  125. #define ALLOC '+'
  126. #define FREED '-'
  127. #endif // DBG_HDL
  128. #if _DBG_
  129. //
  130. // Cleanup Functions for internal structures
  131. //
  132. #define DEFINE_DESTROY_FUNC(Name) \
  133. DWORD \
  134. Name (PVOID);
  135. DEFINE_DESTROY_FUNC(DestroyGeneric);
  136. DEFINE_DESTROY_FUNC(DestroyInstance);
  137. DEFINE_DESTROY_FUNC(DestroyAddressFamily);
  138. DEFINE_DESTROY_FUNC(DestroyEntity);
  139. DEFINE_DESTROY_FUNC(DestroyDest);
  140. DEFINE_DESTROY_FUNC(DestroyRoute);
  141. DEFINE_DESTROY_FUNC(DestroyNextHop);
  142. DEFINE_DESTROY_FUNC(DestroyDestEnum);
  143. DEFINE_DESTROY_FUNC(DestroyRouteEnum);
  144. DEFINE_DESTROY_FUNC(DestroyNextHopEnum);
  145. DEFINE_DESTROY_FUNC(DestroyChangeNotification);
  146. DEFINE_DESTROY_FUNC(DestroyEntityList);
  147. DEFINE_DESTROY_FUNC(DestroyEntityListEnum);
  148. typedef DWORD (*DestroyFunc) (PVOID Pointer);
  149. const DestroyFunc OBJECT_DESTROY_FUNCTION[] =
  150. {
  151. DestroyGeneric,
  152. DestroyInstance,
  153. DestroyAddressFamily,
  154. DestroyEntity,
  155. DestroyDest,
  156. DestroyRoute,
  157. DestroyNextHop,
  158. DestroyDestEnum,
  159. DestroyRouteEnum,
  160. DestroyNextHopEnum,
  161. DestroyChangeNotification
  162. DestroyEntityList,
  163. DestroyEntityListEnum
  164. };
  165. #endif // _DBG_
  166. //
  167. // Reference Counting related constants
  168. //
  169. #define MAX_REFS 0x10
  170. #define CREATION_REF 0x00
  171. #define ADDR_FAMILY_REF 0x01
  172. #define ENTITY_REF 0x02
  173. #define DEST_REF 0x03
  174. #define ROUTE_REF 0x04
  175. #define NEXTHOP_REF 0x05
  176. #define ENUM_REF 0x06
  177. #define NOTIFY_REF 0x07
  178. #define LIST_REF 0x08
  179. #define HOLD_REF 0x09
  180. #define TIMER_REF 0x0D
  181. #define TEMP_USE_REF 0x0E
  182. #define HANDLE_REF 0x0F
  183. extern const CHAR *REF_NAME[MAX_REFS];
  184. #endif //__ROUTING_RTMCONST_H__