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.

545 lines
20 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. routing\ip\rtrmgr\defs.c
  5. Abstract:
  6. IP Router Manager defines
  7. Revision History:
  8. Gurdeep Singh Pall 6/16/95 Created
  9. --*/
  10. #ifndef __DEFS_H__
  11. #define __DEFS_H__
  12. #include "logtrdef.h"
  13. //
  14. // Neat macros to avoid errors
  15. //
  16. #define is ==
  17. #define isnot !=
  18. #define and &&
  19. #define or ||
  20. #define INVALID_INDEX_OR_INSTANCE 0xffffffff
  21. #define INVALID_ADAPTER_ID INVALID_INDEX_OR_INSTANCE
  22. #define INVALID_IF_INSTANCE INVALID_INDEX_OR_INSTANCE
  23. #define INVALID_AT_INSTANCE INVALID_INDEX_OR_INSTANCE
  24. #define INVALID_IF_INDEX INVALID_INDEX_OR_INSTANCE
  25. #define INVALID_IP_ADDRESS 0x00000000
  26. #define HOST_ROUTE_MASK 0xFFFFFFFF
  27. #define IP_LOOPBACK_ADDRESS 0x0100007F
  28. #define ALL_ONES_BROADCAST 0xFFFFFFFF
  29. #define ALL_ONES_MASK 0xFFFFFFFF
  30. #define LOCAL_NET_MULTICAST 0x000000E0
  31. #define LOCAL_NET_MULTICAST_MASK 0x000000F0
  32. #define CLASSA_ADDR(a) (( (*((uchar *)&(a))) & 0x80) == 0)
  33. #define CLASSB_ADDR(a) (( (*((uchar *)&(a))) & 0xc0) == 0x80)
  34. #define CLASSC_ADDR(a) (( (*((uchar *)&(a))) & 0xe0) == 0xc0)
  35. #define CLASSE_ADDR(a) ((( (*((uchar *)&(a))) & 0xf0) == 0xf0) && \
  36. ((a) != 0xffffffff))
  37. #define CLASSA_MASK 0x000000ff
  38. #define CLASSB_MASK 0x0000ffff
  39. #define CLASSC_MASK 0x00ffffff
  40. #define CLASSD_MASK 0x000000e0
  41. #define CLASSE_MASK 0xffffffff
  42. #define INET_CMP(a,b,c) \
  43. (((c) = (((a) & 0x000000ff) - ((b) & 0x000000ff))) ? (c) : \
  44. (((c) = (((a) & 0x0000ff00) - ((b) & 0x0000ff00))) ? (c) : \
  45. (((c) = (((a) & 0x00ff0000) - ((b) & 0x00ff0000))) ? (c) : \
  46. (((c) = ((((a)>>8) & 0x00ff0000) - (((b)>>8) & 0x00ff0000)))))))
  47. #define GetClassMask(a)\
  48. (CLASSA_ADDR((a)) ? CLASSA_MASK : \
  49. (CLASSB_ADDR((a)) ? CLASSB_MASK : \
  50. (CLASSC_ADDR((a)) ? CLASSC_MASK : CLASSE_MASK)))
  51. #define IsValidIpAddress(a) \
  52. ((((ULONG)((a) & 0x000000FF)) < ((ULONG)0x000000E0)) && \
  53. (((a) & 0x000000FF) != 0))
  54. //
  55. // Number of pending IRPs
  56. //
  57. #define NUM_MCAST_IRPS 3
  58. #define NUM_ROUTE_CHANGE_IRPS 3
  59. #define EVENT_DEMANDDIAL 0
  60. #ifdef KSL_IPINIP
  61. #define EVENT_IPINIP (EVENT_DEMANDDIAL + 1)
  62. #endif //KSL_IPINIP
  63. #define EVENT_STOP_ROUTER (EVENT_DEMANDDIAL + 1)
  64. #define EVENT_SET_FORWARDING (EVENT_STOP_ROUTER + 1)
  65. #define EVENT_FORWARDING_CHANGE (EVENT_SET_FORWARDING + 1)
  66. #define EVENT_STACK_CHANGE (EVENT_FORWARDING_CHANGE + 1)
  67. #define EVENT_ROUTINGPROTOCOL (EVENT_STACK_CHANGE + 1)
  68. #define EVENT_RTRDISCTIMER (EVENT_ROUTINGPROTOCOL + 1)
  69. #define EVENT_RTRDISCSOCKET (EVENT_RTRDISCTIMER + 1)
  70. #define EVENT_MCMISCSOCKET (EVENT_RTRDISCSOCKET + 1)
  71. #define EVENT_MHBEAT (EVENT_MCMISCSOCKET + 1)
  72. #define EVENT_MZAPTIMER (EVENT_MHBEAT + 1)
  73. #define EVENT_MZAPSOCKET (EVENT_MZAPTIMER + 1)
  74. #define EVENT_RASADVTIMER (EVENT_MZAPSOCKET + 1)
  75. #define EVENT_MCAST_0 (EVENT_RASADVTIMER + 1)
  76. #define EVENT_MCAST_1 (EVENT_MCAST_0 + 1)
  77. #define EVENT_MCAST_2 (EVENT_MCAST_1 + 1)
  78. #define EVENT_ROUTE_CHANGE_0 (EVENT_MCAST_2 + 1)
  79. #define EVENT_ROUTE_CHANGE_1 (EVENT_ROUTE_CHANGE_0 + 1)
  80. #define EVENT_ROUTE_CHANGE_2 (EVENT_ROUTE_CHANGE_1 + 1)
  81. //
  82. // Last one + 1
  83. //
  84. #define NUMBER_OF_EVENTS (EVENT_ROUTE_CHANGE_2 + 1)
  85. //
  86. // The polling time to see if all interfaces have been deleted
  87. //
  88. #define INTERFACE_DELETE_POLL_TIME 2500
  89. //
  90. // Number of times we try to read the server adapter address
  91. //
  92. #define MAX_SERVER_INIT_TRIES 1
  93. //
  94. // Number of millisecs we sleep between tries
  95. //
  96. #define SERVER_INIT_SLEEP_TIME 3000
  97. #define REGISTER register
  98. #define IP_ROUTE_HASH_TABLE_SIZE 257
  99. #define IP_ROUTE_TABLE_MEMORY 64 * 50000 // 64 approx size of route, 50000 routes
  100. #define MGM_IF_TABLE_SIZE 29
  101. #define MGM_GROUP_TABLE_SIZE 257
  102. #define MGM_SOURCE_TABLE_SIZE 257
  103. #define ICB_HASH_TABLE_SIZE 57
  104. #define BINDING_HASH_TABLE_SIZE 57
  105. #define BIND_HASH(X) ((X) % BINDING_HASH_TABLE_SIZE)
  106. //#define ADAPTER_HASH_TABLE_SIZE 57
  107. //#define ADAPTER_HASH(X) ((X) % ADAPTER_HASH_TABLE_SIZE)
  108. //
  109. // A coherency number put into the ICBs. It is incremented with each added
  110. // interface. The internal interface is 1, and the loopback interface is 2
  111. // hence this must be > 2
  112. //
  113. #define LOOPBACK_INTERFACE_INDEX 1
  114. //#define SERVER_INTERFACE_INDEX 2
  115. #define INITIAL_SEQUENCE_NUMBER 1
  116. //
  117. // For links we dont know about, we set the MTU to 1500
  118. //
  119. #define DEFAULT_MTU 1500
  120. #define LOOPBACK_STRID 9990
  121. #define INTERNAL_STRID 9991
  122. #define WAN_STRID 9992
  123. #ifdef KSL_IPINIP
  124. #define IPIP_STRID 9993
  125. #endif //KSL_IPINIP
  126. //
  127. // Macros called each time an api is called and exited. This is to
  128. // facilitate RouterStop() functionality.
  129. //
  130. #define EnterRouterApi() { \
  131. EnterCriticalSection(&RouterStateLock) ; \
  132. if (RouterState.IRS_State == RTR_STATE_RUNNING) { \
  133. RouterState.IRS_RefCount++ ; \
  134. LeaveCriticalSection(&RouterStateLock) ; \
  135. } else { \
  136. LeaveCriticalSection(&RouterStateLock) ; \
  137. Trace1(ANY, "error %d on RM API", ERROR_ROUTER_STOPPED); \
  138. return ERROR_ROUTER_STOPPED ; \
  139. } \
  140. }
  141. #define ExitRouterApi() { \
  142. EnterCriticalSection(&RouterStateLock) ; \
  143. RouterState.IRS_RefCount-- ; \
  144. LeaveCriticalSection(&RouterStateLock) ; \
  145. }
  146. //++
  147. //
  148. // BOOL
  149. // IsIfP2P(
  150. // IN DWORD dwRouterIfType
  151. // )
  152. //
  153. //--
  154. #define IsIfP2P(t) \
  155. (((t) == ROUTER_IF_TYPE_FULL_ROUTER) || \
  156. ((t) == ROUTER_IF_TYPE_HOME_ROUTER) || \
  157. ((t) == ROUTER_IF_TYPE_DIALOUT))
  158. //
  159. // Additional flags for the IP route structure
  160. // These are not in RTM.H because we dont want to expose them
  161. // to the public's prying eyes.
  162. //
  163. // NOTE IP_VALID_ROUTE is #defined as 0x00000001
  164. //
  165. #define IP_VALID_ROUTE 0x00000001
  166. #define IP_STACK_ROUTE 0x00000002
  167. #define IP_P2P_ROUTE 0x00000004
  168. #define RTM_NOT_STACK_ROUTE 0xFFFF0001
  169. #define HOST_MASK_LENGTH 32
  170. #define IP_SETTABLE_ROUTE (IP_VALID_ROUTE | IP_STACK_ROUTE)
  171. #define ClearRouteFlags(pRoute) \
  172. ((pRoute)->Flags1 = 0x00000000)
  173. #define IsRouteValid(pRoute) \
  174. ((pRoute)->Flags1 & IP_VALID_ROUTE)
  175. #define SetRouteValid(pRoute) \
  176. ((pRoute)->Flags1 |= IP_VALID_ROUTE)
  177. #define ClearRouteValid(pRoute) \
  178. ((pRoute)->Flags1 &= ~IP_VALID_ROUTE)
  179. #define IsRouteStack(pRoute) \
  180. ((pRoute)->Flags1 & IP_STACK_ROUTE)
  181. #define SetRouteStack(pRoute) \
  182. ((pRoute)->Flags1 |= IP_STACK_ROUTE)
  183. #define ClearRouteStack(pRoute) \
  184. ((pRoute)->Flags1 &= ~IP_STACK_ROUTE)
  185. #define IsRouteP2P(pRoute) \
  186. ((pRoute)->Flags1 & IP_P2P_ROUTE)
  187. #define SetRouteP2P(pRoute) \
  188. ((pRoute)->Flags1 |= IP_P2P_ROUTE)
  189. #define ClearRouteP2P(pRoute) \
  190. ((pRoute)->Flags1 &= ~IP_P2P_ROUTE)
  191. /*
  192. //
  193. // VOID
  194. // ConvertRTMToForward(PMIB_IPFORWARDROW forwardRow, RTM_IP_ROUTE *route)
  195. //
  196. #define ConvertRTMToForward(f,route){ \
  197. (f)->dwForwardDest = (route)->RR_Network.N_NetNumber; \
  198. (f)->dwForwardIfIndex = (route)->RR_InterfaceID; \
  199. (f)->dwForwardMetric1 = (route)->RR_FamilySpecificData.FSD_Metric1; \
  200. (f)->dwForwardMetric2 = (route)->RR_FamilySpecificData.FSD_Metric2; \
  201. (f)->dwForwardMetric3 = (route)->RR_FamilySpecificData.FSD_Metric3; \
  202. (f)->dwForwardMetric4 = (route)->RR_FamilySpecificData.FSD_Metric4; \
  203. (f)->dwForwardMetric5 = (route)->RR_FamilySpecificData.FSD_Metric5; \
  204. (f)->dwForwardNextHop = (route)->RR_NextHopAddress.N_NetNumber; \
  205. (f)->dwForwardType = (route)->RR_FamilySpecificData.FSD_Type; \
  206. (f)->dwForwardProto = (route)->RR_RoutingProtocol; \
  207. (f)->dwForwardAge = RtmGetRouteAge((route)); \
  208. (f)->dwForwardMask = (route)->RR_Network.N_NetMask; \
  209. (f)->dwForwardNextHopAS = (route)->RR_FamilySpecificData.FSD_NextHopAS; \
  210. (f)->dwForwardPolicy = (route)->RR_FamilySpecificData.FSD_Policy;}
  211. //
  212. // VOID
  213. // ConvertForwardToRTM(PMIB_IPFORWARDROW forwardRow,
  214. // RTM_IP_ROUTE *route,
  215. // DWORD dwNextHopMask)
  216. //
  217. #define ConvertForwardToRTM(f,route,mask){ \
  218. (route)->RR_Network.N_NetNumber = (f)->dwForwardDest; \
  219. (route)->RR_InterfaceID = (f)->dwForwardIfIndex; \
  220. (route)->RR_FamilySpecificData.FSD_Metric = \
  221. (route)->RR_FamilySpecificData.FSD_Metric1 = (f)->dwForwardMetric1; \
  222. (route)->RR_FamilySpecificData.FSD_Metric2 = (f)->dwForwardMetric2; \
  223. (route)->RR_FamilySpecificData.FSD_Metric3 = (f)->dwForwardMetric3; \
  224. (route)->RR_FamilySpecificData.FSD_Metric4 = (f)->dwForwardMetric4; \
  225. (route)->RR_FamilySpecificData.FSD_Metric5 = (f)->dwForwardMetric5; \
  226. (route)->RR_FamilySpecificData.FSD_Priority = 0; \
  227. (route)->RR_NextHopAddress.N_NetNumber = (f)->dwForwardNextHop; \
  228. (route)->RR_NextHopAddress.N_NetMask = (mask); \
  229. (route)->RR_Network.N_NetMask = (f)->dwForwardMask; \
  230. (route)->RR_FamilySpecificData.FSD_Policy = (f)->dwForwardPolicy; \
  231. (route)->RR_FamilySpecificData.FSD_NextHopAS = (f)->dwForwardNextHopAS;\
  232. (route)->RR_FamilySpecificData.FSD_Type = (f)->dwForwardType; \
  233. (route)->RR_RoutingProtocol = (f)->dwForwardProto; \
  234. ClearRouteFlags((route)); \
  235. SetRouteValid((route)); \
  236. SetRouteStack((route)); }
  237. //
  238. // VOID
  239. // ConvertStackToRTM(RTM_IP_ROUTE *route,
  240. // IPRouteEntry *ipreRow
  241. // DWORD dwNextHopMask)
  242. //
  243. #define ConvertStackToRTM(route,ipreRow,mask){ \
  244. (route)->RR_Network.N_NetNumber = (ipreRow)->ire_dest; \
  245. (route)->RR_InterfaceID = (ipreRow)->ire_index; \
  246. (route)->RR_FamilySpecificData.FSD_Metric = \
  247. (route)->RR_FamilySpecificData.FSD_Metric1 = (ipreRow)->ire_metric1; \
  248. (route)->RR_FamilySpecificData.FSD_Metric2 = (ipreRow)->ire_metric2; \
  249. (route)->RR_FamilySpecificData.FSD_Metric3 = (ipreRow)->ire_metric3; \
  250. (route)->RR_FamilySpecificData.FSD_Metric4 = (ipreRow)->ire_metric4; \
  251. (route)->RR_FamilySpecificData.FSD_Metric5 = (ipreRow)->ire_metric5; \
  252. (route)->RR_FamilySpecificData.FSD_Priority = 0; \
  253. (route)->RR_NextHopAddress.N_NetNumber = (ipreRow)->ire_nexthop; \
  254. (route)->RR_NextHopAddress.N_NetMask = (mask); \
  255. (route)->RR_Network.N_NetMask = (ipreRow)->ire_mask; \
  256. (route)->RR_FamilySpecificData.FSD_Policy = 0; \
  257. (route)->RR_FamilySpecificData.FSD_NextHopAS = 0; \
  258. (route)->RR_FamilySpecificData.FSD_Type = (ipreRow)->ire_type; \
  259. (route)->RR_RoutingProtocol = (ipreRow)->ire_proto; \
  260. ClearRouteFlags((route)); \
  261. SetRouteValid((route)); \
  262. SetRouteStack((route)); }
  263. //
  264. // VOID
  265. // ConvertStackToForward(PMIB_IPFORWARDROW forwardRow,
  266. // IPRouteEntry *ipreRow)
  267. //
  268. #define ConvertStackToForward(forwardRow,ipreRow) { \
  269. (forwardRow)->dwForwardDest = (ipreRow)->ire_dest; \
  270. (forwardRow)->dwForwardIfIndex = (ipreRow)->ire_index; \
  271. (forwardRow)->dwForwardMetric1 = (ipreRow)->ire_metric1; \
  272. (forwardRow)->dwForwardMetric2 = (ipreRow)->ire_metric2; \
  273. (forwardRow)->dwForwardMetric3 = (ipreRow)->ire_metric3; \
  274. (forwardRow)->dwForwardMetric4 = (ipreRow)->ire_metric4; \
  275. (forwardRow)->dwForwardMetric5 = (ipreRow)->ire_metric5; \
  276. (forwardRow)->dwForwardNextHop = (ipreRow)->ire_nexthop; \
  277. (forwardRow)->dwForwardType = (ipreRow)->ire_type; \
  278. (forwardRow)->dwForwardProto = (ipreRow)->ire_proto; \
  279. (forwardRow)->dwForwardAge = (ipreRow)->ire_age; \
  280. (forwardRow)->dwForwardMask = (ipreRow)->ire_mask; \
  281. (forwardRow)->dwForwardNextHopAS = 0; \
  282. (forwardRow)->dwForwardPolicy = 0; }
  283. */
  284. #define IPADDRCACHE 0
  285. #define IPFORWARDCACHE IPADDRCACHE + 1
  286. #define IPNETCACHE IPFORWARDCACHE + 1
  287. #define TCPCACHE IPNETCACHE + 1
  288. #define UDPCACHE TCPCACHE + 1
  289. //
  290. // Last Cache + 1
  291. //
  292. #define NUM_CACHE UDPCACHE + 1
  293. //
  294. // We tag the ICB_LIST and the PROTOCOL_CB_LIST locks at the end of the
  295. // locks used by the MIB handler.
  296. //
  297. #define ICB_LIST NUM_CACHE
  298. #define PROTOCOL_CB_LIST ICB_LIST + 1
  299. #define BINDING_LIST PROTOCOL_CB_LIST + 1
  300. #define BOUNDARY_TABLE BINDING_LIST + 1
  301. #define MZAP_TIMER BOUNDARY_TABLE + 1
  302. #define ZBR_LIST MZAP_TIMER + 1
  303. #define ZLE_LIST ZBR_LIST + 1
  304. #define ZAM_CACHE ZLE_LIST + 1
  305. #define STACK_ROUTE_LIST ZAM_CACHE + 1
  306. //
  307. // Number of locks
  308. //
  309. #define NUM_LOCKS STACK_ROUTE_LIST + 1
  310. #define IPADDRCACHE_TIMEOUT 1000
  311. #define IPFORWARDCACHE_TIMEOUT 1000
  312. #define IPNETCACHE_TIMEOUT 1000
  313. #define TCPCACHE_TIMEOUT 1000
  314. #define UDPCACHE_TIMEOUT 1000
  315. #define ARPENTCACHE_TIMEOUT 300 * IPNETCACHE_TIMEOUT
  316. #define SPILLOVER 5
  317. #define MAX_DIFF 5
  318. //
  319. // All ACCESS_XXX > ACCESS_GET_NEXT are SETS
  320. // All ACCESS_XXX which have bit0 set require an EXACT MATCH
  321. //
  322. #define ACCESS_GET 1
  323. #define ACCESS_GET_FIRST 2
  324. #define ACCESS_GET_NEXT 4
  325. #define ACCESS_SET 5
  326. #define ACCESS_CREATE_ENTRY 7
  327. #define ACCESS_DELETE_ENTRY 9
  328. #define EXACT_MATCH(X) ((X) & 0x00000001)
  329. #ifdef DEADLOCK_DEBUG
  330. extern PBYTE g_pszLockNames[];
  331. #define EXIT_LOCK(id) { \
  332. Trace1(LOCK,"Exit lock %s",g_pszLockNames[id]); \
  333. RtlReleaseResource(&(g_LockTable[(id)])); \
  334. Trace1(LOCK,"Exited lock %s",g_pszLockNames[id]); \
  335. }
  336. #define READER_TO_WRITER(id) { \
  337. Trace1(LOCK,"Reader To Writer %s",g_pszLockNames[id]); \
  338. RtlConvertSharedToExclusive(&(g_LockTable[(id)])); \
  339. Trace1(LOCK,"Promoted for %s",g_pszLockNames[id]); \
  340. }
  341. #define ENTER_READER(id) { \
  342. Trace1(LOCK,"Entering Reader %s",g_pszLockNames[id]); \
  343. RtlAcquireResourceShared(&(g_LockTable[(id)]),TRUE); \
  344. Trace1(LOCK,"Entered %s",g_pszLockNames[id]); \
  345. }
  346. #define ENTER_WRITER(id) { \
  347. Trace1(LOCK,"Entering Writer %s",g_pszLockNames[id]); \
  348. RtlAcquireResourceExclusive(&(g_LockTable[(id)]),TRUE); \
  349. Trace1(LOCK,"Entered %s",g_pszLockNames[id]); \
  350. }
  351. #define WRITER_TO_READER(id) { \
  352. Trace1(LOCK,"Writer To Reader %s",g_pszLockNames[id]); \
  353. RtlConvertExclusiveToShared(&(g_LockTable[(id)])); \
  354. Trace1(LOCK,"Demoted for %s",g_pszLockNames[id]); \
  355. }
  356. #else // DEADLOCK_DEBUG
  357. #define EXIT_LOCK(id) RtlReleaseResource(&(g_LockTable[(id)]))
  358. #define READER_TO_WRITER(id) RtlConvertSharedToExclusive(&(g_LockTable[(id)]))
  359. #define ENTER_READER(id) RtlAcquireResourceShared(&(g_LockTable[(id)]),TRUE)
  360. #define ENTER_WRITER(id) RtlAcquireResourceExclusive(&(g_LockTable[(id)]),TRUE)
  361. #define WRITER_TO_READER(id) RtlConvertExclusiveToShared(&(g_LockTable[(id)]))
  362. #endif // DEADLOCK_DEBUG
  363. #if DBG
  364. #define IpRtAssert(exp){ \
  365. if(!(exp)) \
  366. { \
  367. TracePrintf(TraceHandle, \
  368. "Assertion failed in %s : %d \n",__FILE__,__LINE__);\
  369. RouterAssert(#exp,__FILE__,__LINE__,NULL); \
  370. } \
  371. }
  372. #else
  373. #define IpRtAssert(exp)
  374. #endif
  375. //
  376. // Registry defines
  377. //
  378. #define REGISTRY_ENABLE_DHCP "EnableDHCP"
  379. #define REGISTRY_IPADDRESS "IPAddress"
  380. #define REGISTRY_SUBNETMASK "SubnetMask"
  381. #define REGISTRY_DHCPSUBNETMASK "DhcpSubnetMask"
  382. #define REGISTRY_DHCPIPADDRESS "DhcpIPAddress"
  383. #define REGISTRY_AUTOCONFIGSUBNETMASK "IPAutoconfigurationMask"
  384. #define REGISTRY_AUTOCONFIGIPADDRESS "IPAutoconfigurationAddress"
  385. #define REG_KEY_TCPIP_INTERFACES \
  386. "System\\CurrentControlSet\\Services\\TCPIP\\Parameters\\Interfaces"
  387. #define net_long(x) (((((ulong)(x))&0xffL)<<24) | \
  388. ((((ulong)(x))&0xff00L)<<8) | \
  389. ((((ulong)(x))&0xff0000L)>>8) | \
  390. ((((ulong)(x))&0xff000000L)>>24))
  391. #define SIZEOF_ROUTEINFO(X) ((X) * sizeof (MIB_IPFORWARDROW))
  392. #define MAX_ROUTES_IN_BUFFER(X) ((X) / sizeof (MIB_IPFORWARDROW))
  393. #define PRINT_IPADDR(x) \
  394. ((x)&0x000000ff),(((x)&0x0000ff00)>>8),(((x)&0x00ff0000)>>16),(((x)&0xff000000)>>24)
  395. //
  396. // VOID
  397. // PrintRoute(IPMultihopRouteEntry pRoute)
  398. //
  399. #define PrintRoute(ID,p) \
  400. { \
  401. ULONG _i; \
  402. Trace4(ID,"%d.%d.%d.%d/%d.%d.%d.%d Proto: %d Metric %d", \
  403. PRINT_IPADDR((p)->imre_routeinfo.ire_dest), \
  404. PRINT_IPADDR((p)->imre_routeinfo.ire_mask), \
  405. (p)->imre_routeinfo.ire_proto, (p)->imre_routeinfo.ire_metric1); \
  406. Trace4(ID,"Via %d.%d.%d.%d/0x%x Type %d Context 0x%x", \
  407. PRINT_IPADDR((p)->imre_routeinfo.ire_nexthop), \
  408. (p)->imre_routeinfo.ire_index, \
  409. (p)->imre_routeinfo.ire_type, \
  410. (p)->imre_routeinfo.ire_context); \
  411. for(_i = 1; _i < (p)->imre_numnexthops; i++) { \
  412. Trace4(ID,"Via %d.%d.%d.%d/0x%x Type %d Context 0x%x\n", \
  413. PRINT_IPADDR((p)->imre_morenexthops[_i].ine_nexthop), \
  414. (p)->imre_morenexthops[_i].ine_ifindex, \
  415. (p)->imre_morenexthops[_i].ine_iretype, \
  416. (p)->imre_morenexthops[_i].ine_context);} \
  417. }
  418. //
  419. // System Unit is in 100s of NanoSecs = 1 * 10^7
  420. //
  421. #define SYS_UNITS_IN_1_SEC 10000000
  422. #define SecsToSysUnits(X) RtlEnlargedIntegerMultiply((X),SYS_UNITS_IN_1_SEC)
  423. #endif // __DEFS_H__