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.

180 lines
2.6 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1999
  3. Module Name:
  4. lan.hxx
  5. Abstract:
  6. This file contains all the LAN-specific routines for the Connectivity
  7. APIs implementation.
  8. Author:
  9. Gopal Parupudi <GopalP>
  10. [Notes:]
  11. optional-notes
  12. Revision History:
  13. GopalP 10/11/1997 Start.
  14. --*/
  15. #ifndef __LAN_HXX__
  16. #define __LAN_HXX__
  17. #define MAX_LAN_INTERVAL 3*60*1000 // 3 minutes
  18. #define MAX_IFTABLE_SIZE 5
  19. #define MAX_IF_ENTRIES 5
  20. // Media-sense Registration States
  21. enum MEDIA_SENSE_STATE
  22. {
  23. INVALID_STATE = 0x00000000,
  24. SENSSVC_START,
  25. REGISTERED,
  26. SENSSVC_STOP,
  27. UNREGISTERED
  28. };
  29. //
  30. // Externs
  31. //
  32. extern BOOL gbIpInitSuccessful;
  33. extern long gdwLastLANTime;
  34. extern long gdwLANState;
  35. #if defined(AOL_PLATFORM)
  36. extern long gdwAOLState;
  37. #endif // AOL_PLATFORM
  38. //
  39. // Typedefs
  40. //
  41. typedef struct _IF_STATE
  42. {
  43. DWORD fValid;
  44. DWORD dwIndex;
  45. DWORD dwInUcastPkts;
  46. DWORD dwOutUcastPkts;
  47. DWORD dwInNUcastPkts;
  48. DWORD dwOutNUcastPkts;
  49. DWORD dwInErrors;
  50. DWORD dwOutErrors;
  51. DWORD dwInDiscards;
  52. DWORD dwOutDiscards;
  53. } IF_STATE;
  54. //
  55. // Forward declarations
  56. //
  57. extern DWORD gdwMediaSenseState;
  58. void
  59. EventCallbackRoutine(
  60. IN PWNODE_HEADER WnodeHeader,
  61. IN ULONG Context
  62. );
  63. BOOL
  64. MediaSenseRegister(
  65. void
  66. );
  67. SENS_TIMER_CALLBACK_RETURN
  68. MediaSenseRegisterHelper(
  69. PVOID pvIgnore,
  70. BOOLEAN bIgnore
  71. );
  72. BOOL
  73. MediaSenseUnregister(
  74. void
  75. );
  76. extern "C" ULONG WMIAPI
  77. WMINotificationRegistration(
  78. IN LPGUID Guid,
  79. IN BOOLEAN Enable,
  80. IN PVOID DeliveryInfo,
  81. IN ULONG DeliveryContext,
  82. IN ULONG Flags
  83. );
  84. #ifdef DBG
  85. void
  86. PrintIfState(
  87. void
  88. );
  89. #endif // DBG
  90. BOOL
  91. HasIfStateChanged(
  92. IF_STATE ifEntry,
  93. BOOL bForceInvalid
  94. );
  95. BOOL WINAPI
  96. EvaluateLanConnectivityDelayed(
  97. OUT LPDWORD lpdwLastError
  98. );
  99. BOOL WINAPI
  100. EvaluateLanConnectivity(
  101. OUT LPDWORD lpdwLastError
  102. );
  103. BOOL
  104. GetIfEntryStats(
  105. IN DWORD dwIfIndex,
  106. IN LPQOCINFO lpQOCInfo,
  107. OUT LPDWORD lpdwLastError,
  108. OUT LPBOOL lpbIsWanIf
  109. );
  110. BOOL
  111. CheckForReachability(
  112. IN IPAddr DestIpAddr,
  113. IN OUT LPQOCINFO lpQOCInfo,
  114. OUT LPDWORD lpdwLastError
  115. );
  116. BOOL
  117. GetActiveWanInterfaceStatistics(
  118. OUT LPDWORD lpdwLastError,
  119. OUT LPDWORD lpdwWanSpeed
  120. );
  121. BOOL
  122. PurgeStaleInterfaces(
  123. IN MIB_IFTABLE *pTable,
  124. OUT LPDWORD lpdwLastError
  125. );
  126. #if defined(AOL_PLATFORM)
  127. BOOL
  128. IsAOLInstalled(
  129. void
  130. );
  131. BOOL WINAPI
  132. EvaluateAOLConnectivity(
  133. OUT LPDWORD lpdwLastError
  134. );
  135. #endif // AOL_PLATFORM
  136. #endif // __LAN_HXX__