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.

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