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.

202 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. globals.c
  5. Abstract:
  6. Contains all(most) router manager globals
  7. Author:
  8. Stefan Solomon 03/21/1995
  9. Revision History:
  10. --*/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. //*****************************************************************
  14. // *
  15. // ROUTER CONFIGURATION PARAMETERS *
  16. // *
  17. //*****************************************************************
  18. // Size of the routing table and routing hash table
  19. ULONG MaxRoutingTableSize = IPX_MAX_ROUTING_TABLE_SIZE;
  20. ULONG RoutingTableHashSize = IPX_MEDIUM_ROUTING_TABLE_HASH_SIZE;
  21. //*****************************************************************
  22. // *
  23. // Internal Variables *
  24. // *
  25. //*****************************************************************
  26. // Routing Protocols Oper State
  27. ULONG RipOperState = OPER_STATE_DOWN;
  28. ULONG SapOperState = OPER_STATE_DOWN;
  29. // Pointer to the internal interface
  30. PICB InternalInterfacep = NULL;
  31. // Pointer to the internal adapter
  32. PACB InternalAdapterp = NULL;
  33. // The RouterWorker thread events: adapter, forwarder, autostatic update, stop
  34. // and timer notifications
  35. HANDLE g_hEvents[MAX_EVENTS];
  36. // signatures
  37. // Interface Control Block Signature
  38. UCHAR InterfaceSignature[4] = { 'I', 'P', 'X', 'I' };
  39. // Adapter Control Block Signature
  40. UCHAR AdapterSignature[4] = { 'I', 'P', 'X', 'A' };
  41. // Router Operational State
  42. ULONG RouterOperState = OPER_STATE_DOWN;
  43. //
  44. // Router Database Lock
  45. //
  46. CRITICAL_SECTION DatabaseLock;
  47. //
  48. // RTM Handle
  49. //
  50. HANDLE RtmStaticHandle = NULL;
  51. HANDLE RtmLocalHandle = NULL;
  52. //
  53. // Hash Table of ICBs hashed by interface index
  54. //
  55. LIST_ENTRY IndexIfHt[IF_HASH_TABLE_SIZE];
  56. //
  57. // List of intefaces ordered by interface index
  58. //
  59. LIST_ENTRY IndexIfList;
  60. //
  61. // Global WAN net
  62. //
  63. BOOL WanNetDatabaseInitialized = FALSE;
  64. BOOL EnableGlobalWanNet = FALSE;
  65. UCHAR GlobalWanNet[4] = {0,0,0,0};
  66. //
  67. // Hash Table of ACBs hashed by adapter index
  68. //
  69. LIST_ENTRY IndexAdptHt[ADAPTER_HASH_TABLE_SIZE];
  70. //
  71. // MIB APIs Ref Counter
  72. //
  73. ULONG MibRefCounter = 0;
  74. // null net
  75. UCHAR nullnet[4] = {0,0,0,0};
  76. //
  77. // List of routing protocols control blocks and counter
  78. //
  79. LIST_ENTRY RoutingProtocolCBList;
  80. ULONG RoutingProtocolActiveCount = 0;
  81. // Indicates the mode of the router (lan only) or lan & wan
  82. BOOL LanOnlyMode = TRUE;
  83. // Variable to get the interface index requesting connection
  84. PFW_DIAL_REQUEST ConnRequest;
  85. OVERLAPPED ConnReqOverlapped;
  86. // Variable to count the number of pending work items
  87. ULONG WorkItemsPendingCounter = 0;
  88. //
  89. // ************ DDM ENTRY POINTS ********
  90. //
  91. DWORD
  92. (APIENTRY *ConnectInterface)(IN HANDLE hDIMInterface,
  93. IN DWORD ProtocolId);
  94. DWORD
  95. (APIENTRY *DisconnectInterface)(IN HANDLE hDIMInterface,
  96. IN DWORD ProtocolId);
  97. //
  98. // This call will make DIM store the interface information into the
  99. // Site Object for this interface.
  100. // Either but not both of pInterfaceInfo and pFilterInfo may be NULL
  101. //
  102. DWORD
  103. (APIENTRY *SaveInterfaceInfo)(
  104. IN HANDLE hDIMInterface,
  105. IN DWORD dwProtocolId,
  106. IN LPVOID pInterfaceInfo,
  107. IN DWORD cbInterfaceInfoSize);
  108. //
  109. // This will make DIM get interface information from the Site object.
  110. // Either but not both of pInterfaceInfo and pFilterInfo may be NULL
  111. //
  112. DWORD
  113. (APIENTRY *RestoreInterfaceInfo)(
  114. IN HANDLE hDIMInterface,
  115. IN DWORD dwProtocolId,
  116. IN LPVOID lpInterfaceInfo,
  117. IN LPDWORD lpcbInterfaceInfoSize);
  118. VOID
  119. (APIENTRY *RouterStopped)(
  120. IN DWORD dwProtocolId,
  121. IN DWORD dwError );
  122. VOID
  123. (APIENTRY *InterfaceEnabled)(
  124. IN HANDLE hDIMInterface,
  125. IN DWORD dwProtocolId,
  126. IN BOOL fEnabled );
  127. //
  128. // *********** IPXCP ENTRY POINTS ********
  129. //
  130. DWORD (*IpxcpBind)(PIPXCP_INTERFACE IpxcpInterface);
  131. VOID (*IpxcpRouterStarted)(VOID);
  132. VOID (*IpxcpRouterStopped)(VOID);