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.

282 lines
8.8 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1996 - 1999
  3. //
  4. // File: globals.cpp
  5. //
  6. // History:
  7. // Abolade Gbadegesin Feb-11-1996 Created.
  8. //
  9. // Contains definitions of global constants.
  10. //============================================================================
  11. #include "stdafx.h"
  12. // Include headers needed for IP-specific infobase stuff
  13. #include <fltdefs.h>
  14. #include <ipinfoid.h>
  15. #include <iprtrmib.h>
  16. #include "iprtinfo.h"
  17. // Include headers for IPX-specific stuff
  18. #include <ipxrtdef.h>
  19. // Include headers for IP-specific stuff
  20. extern "C"
  21. {
  22. #include <ipnat.h>
  23. #include <ipnathlp.h>
  24. #include <sainfo.h>
  25. };
  26. #include "globals.h"
  27. //----------------------------------------------------------------------------
  28. // IP interface-status default configuration.
  29. //
  30. //----------------------------------------------------------------------------
  31. INTERFACE_STATUS_INFO
  32. g_ipIfStatusDefault = {
  33. MIB_IF_ADMIN_STATUS_UP // Admin-status setting
  34. };
  35. BYTE* g_pIpIfStatusDefault = (BYTE*)&g_ipIfStatusDefault;
  36. //----------------------------------------------------------------------------
  37. // Router-discovery default configuration
  38. //
  39. //----------------------------------------------------------------------------
  40. //
  41. // Default values for LAN-interface router-discovery
  42. //
  43. RTR_DISC_INFO
  44. g_rtrDiscLanDefault = {
  45. DEFAULT_MAX_ADVT_INTERVAL, // Max advertisement interval
  46. (WORD)(DEFAULT_MIN_ADVT_INTERVAL_RATIO * DEFAULT_MAX_ADVT_INTERVAL),
  47. // Min advertisement interval
  48. (WORD)(DEFAULT_ADVT_LIFETIME_RATIO * DEFAULT_MAX_ADVT_INTERVAL),
  49. // Advertisement lifetime
  50. FALSE, // Enable/disable advertisements
  51. DEFAULT_PREF_LEVEL // Preference level
  52. };
  53. BYTE* g_pRtrDiscLanDefault = (BYTE*)&g_rtrDiscLanDefault;
  54. //
  55. // Default values for WAN-interface router-discovery
  56. //
  57. RTR_DISC_INFO
  58. g_rtrDiscWanDefault = {
  59. DEFAULT_MAX_ADVT_INTERVAL, // Max advertisement interval
  60. (WORD)(DEFAULT_MIN_ADVT_INTERVAL_RATIO * DEFAULT_MAX_ADVT_INTERVAL),
  61. // Min advertisement interval
  62. (WORD)(DEFAULT_ADVT_LIFETIME_RATIO * DEFAULT_MAX_ADVT_INTERVAL),
  63. // Advertisement lifetime
  64. FALSE, // Enable/disable advertisements
  65. DEFAULT_PREF_LEVEL // Preference level
  66. };
  67. BYTE* g_pRtrDiscWanDefault = (BYTE*)&g_rtrDiscWanDefault;
  68. //----------------------------------------------------------------------------
  69. // IP multicast default configuration.
  70. //
  71. //----------------------------------------------------------------------------
  72. MCAST_HBEAT_INFO
  73. g_ipIfMulticastHeartbeatDefault = {
  74. _T(""), //group name
  75. 0, //bActive
  76. 10, //ulDeadInterval
  77. 0, //byProtocol
  78. 0 //wPort
  79. };
  80. BYTE* g_pIpIfMulticastHeartbeatDefault = (BYTE*)&g_ipIfMulticastHeartbeatDefault;
  81. //----------------------------------------------------------------------------
  82. // IPX RIP default interface configuration
  83. // (These values also reside in ipxsnap\globals.cpp).
  84. //
  85. //----------------------------------------------------------------------------
  86. //
  87. // Default values for non-LAN interface RIP configuration
  88. //
  89. RIP_IF_CONFIG
  90. g_ipxripInterfaceDefault = {
  91. {
  92. ADMIN_STATE_ENABLED, // Admin state
  93. IPX_NO_UPDATE, // Update Mode - RIP update mechanism
  94. IPX_STANDARD_PACKET_TYPE, // Packet type - RIP packet type
  95. ADMIN_STATE_ENABLED, // Supply - Send RIP updates
  96. ADMIN_STATE_ENABLED, // Listen - Listen to RIP updates
  97. 0, // Periodic Update interval - in seconds
  98. 0 // AgeIntervalMultiplier
  99. },
  100. {
  101. IPX_SERVICE_FILTER_DENY, // Supply filter action
  102. 0, // Supply filter count
  103. IPX_SERVICE_FILTER_DENY, // Listen filter action
  104. 0, // Listen filter count
  105. }
  106. };
  107. BYTE* g_pIpxRipInterfaceDefault = (BYTE*)&g_ipxripInterfaceDefault;
  108. //
  109. // Default values for LAN interface RIP configuration
  110. // (These values also reside in ipxsnap\globals.cpp).
  111. //
  112. RIP_IF_CONFIG
  113. g_ipxripLanInterfaceDefault = {
  114. {
  115. ADMIN_STATE_ENABLED, // Admin state
  116. IPX_STANDARD_UPDATE, // Update Mode - RIP update mechanism
  117. IPX_STANDARD_PACKET_TYPE, // Packet type - RIP packet type
  118. ADMIN_STATE_ENABLED, // Supply - Send RIP updates
  119. ADMIN_STATE_ENABLED, // Listen - Listen to RIP updates
  120. IPX_UPDATE_INTERVAL_DEFVAL, // Periodic Update interval - in seconds
  121. 3 // AgeIntervalMultiplier
  122. },
  123. {
  124. IPX_SERVICE_FILTER_DENY, // Supply filter action
  125. 0, // Supply filter count
  126. IPX_SERVICE_FILTER_DENY, // Listen filter action
  127. 0, // Listen filter count
  128. }
  129. };
  130. BYTE* g_pIpxRipLanInterfaceDefault = (BYTE*)&g_ipxripLanInterfaceDefault;
  131. //----------------------------------------------------------------------------
  132. // IPX SAP default interface configuration
  133. // (These values also reside in ipxsnap\globals.cpp).
  134. //
  135. //----------------------------------------------------------------------------
  136. //
  137. // Default values for non-LAN interface SAP configuration
  138. //
  139. SAP_IF_CONFIG
  140. g_ipxsapInterfaceDefault = {
  141. {
  142. ADMIN_STATE_ENABLED, // Admin state
  143. IPX_NO_UPDATE, // Update Mode - SAP update mechanism
  144. IPX_STANDARD_PACKET_TYPE, // Packet type - SAP packet type
  145. ADMIN_STATE_ENABLED, // Supply - Send SAP updates
  146. ADMIN_STATE_ENABLED, // Listen - Listen to SAP updates
  147. ADMIN_STATE_ENABLED, // Reply to GetNearestServer
  148. 0, // Periodic Update interval - in seconds
  149. 0 // AgeIntervalMultiplier
  150. },
  151. {
  152. IPX_SERVICE_FILTER_DENY, // Supply filter action
  153. 0, // Supply filter count
  154. IPX_SERVICE_FILTER_DENY, // Listen filter action
  155. 0, // Listen filter count
  156. }
  157. };
  158. BYTE* g_pIpxSapInterfaceDefault = (BYTE*)&g_ipxsapInterfaceDefault;
  159. //
  160. // Default values for LAN interface SAP configuration
  161. // (These values also reside in ipxsnap\globals.cpp).
  162. //
  163. SAP_IF_CONFIG
  164. g_ipxsapLanInterfaceDefault = {
  165. {
  166. ADMIN_STATE_ENABLED, // Admin state
  167. IPX_STANDARD_UPDATE, // Update Mode - SAP update mechanism
  168. IPX_STANDARD_PACKET_TYPE, // Packet type - SAP packet type
  169. ADMIN_STATE_ENABLED, // Supply - Send SAP updates
  170. ADMIN_STATE_ENABLED, // Listen - Listen to SAP updates
  171. ADMIN_STATE_ENABLED, // Reply to GetNearestServer
  172. IPX_UPDATE_INTERVAL_DEFVAL, // Periodic Update interval - in seconds
  173. 3 // AgeIntervalMultiplier
  174. },
  175. {
  176. IPX_SERVICE_FILTER_DENY, // Supply filter action
  177. 0, // Supply filter count
  178. IPX_SERVICE_FILTER_DENY, // Listen filter action
  179. 0, // Listen filter count
  180. }
  181. };
  182. BYTE* g_pIpxSapLanInterfaceDefault = (BYTE*)&g_ipxsapLanInterfaceDefault;
  183. //----------------------------------------------------------------------------
  184. // DHCP allocator default configuration
  185. // (These values also reside in ipsnap\globals.cpp).
  186. //
  187. //----------------------------------------------------------------------------
  188. //
  189. // Default values for global DHCP allocator configuration
  190. //
  191. IP_AUTO_DHCP_GLOBAL_INFO
  192. g_autoDhcpGlobalDefault = {
  193. IPNATHLP_LOGGING_ERROR,
  194. 0,
  195. 7 * 24 * 60,
  196. DEFAULT_SCOPE_ADDRESS & DEFAULT_SCOPE_MASK,
  197. DEFAULT_SCOPE_MASK,
  198. 0
  199. };
  200. BYTE* g_pAutoDhcpGlobalDefault = (BYTE*)&g_autoDhcpGlobalDefault;
  201. //----------------------------------------------------------------------------
  202. // DNS proxy default configuration
  203. // (These values also reside in ipsnap\globals.cpp).
  204. //
  205. //----------------------------------------------------------------------------
  206. //
  207. // Default values for global DNS proxy configuration
  208. //
  209. IP_DNS_PROXY_GLOBAL_INFO
  210. g_dnsProxyGlobalDefault = {
  211. IPNATHLP_LOGGING_ERROR,
  212. IP_DNS_PROXY_FLAG_ENABLE_DNS,
  213. 3
  214. };
  215. BYTE* g_pDnsProxyGlobalDefault = (BYTE*)&g_dnsProxyGlobalDefault;
  216. //----------------------------------------------------------------------------
  217. // ALG default configuration
  218. //
  219. //----------------------------------------------------------------------------
  220. //
  221. // Default values for global DirectPlay proxy configuration
  222. //
  223. IP_ALG_GLOBAL_INFO
  224. g_algGlobalDefault = {
  225. IPNATHLP_LOGGING_ERROR,
  226. 0
  227. };
  228. BYTE* g_pAlgGlobalDefault = (BYTE*)&g_algGlobalDefault;
  229. //----------------------------------------------------------------------------
  230. // H.323 proxy default configuration
  231. //
  232. //----------------------------------------------------------------------------
  233. //
  234. // Default values for global H.323 proxy configuration
  235. //
  236. IP_H323_GLOBAL_INFO
  237. g_h323GlobalDefault = {
  238. IPNATHLP_LOGGING_ERROR,
  239. 0
  240. };
  241. BYTE* g_pH323GlobalDefault = (BYTE*)&g_h323GlobalDefault;