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.

182 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1999, Microsoft Corporation
  3. Module Name:
  4. sample\configurationentry.h
  5. Abstract:
  6. The file contains definitions for the configuration entry.
  7. --*/
  8. #ifndef _CONFIGURATIONENTRY_H_
  9. #define _CONFIGURATIONENTRY_H_
  10. //
  11. // type: EVENT_ENTRY
  12. //
  13. // stores events for the ip router manager
  14. //
  15. // protected by the read-write lock CONFIGURATION_ENTRY::rwlLock
  16. //
  17. typedef struct _EVENT_ENTRY
  18. {
  19. QUEUE_ENTRY qeEventQueueLink;
  20. ROUTING_PROTOCOL_EVENTS rpeEvent;
  21. MESSAGE mMessage;
  22. } EVENT_ENTRY, *PEVENT_ENTRY;
  23. DWORD
  24. EE_Create (
  25. IN ROUTING_PROTOCOL_EVENTS rpeEvent,
  26. IN MESSAGE mMessage,
  27. OUT PEVENT_ENTRY *ppeeEventEntry);
  28. DWORD
  29. EE_Destroy (
  30. IN PEVENT_ENTRY peeEventEntry);
  31. #ifdef DEBUG
  32. DWORD
  33. EE_Display (
  34. IN PEVENT_ENTRY peeEventEntry);
  35. #else
  36. #define EE_Display(peeEventEntry)
  37. #endif // DEBUG
  38. DWORD
  39. EnqueueEvent(
  40. IN ROUTING_PROTOCOL_EVENTS rpeEvent,
  41. IN MESSAGE mMessage);
  42. DWORD
  43. DequeueEvent(
  44. OUT ROUTING_PROTOCOL_EVENTS *prpeEvent,
  45. OUT MESSAGE *pmMessage);
  46. //
  47. // various codes describing states of IPSAMPLE.
  48. //
  49. typedef enum _IPSAMPLE_STATUS_CODE
  50. {
  51. IPSAMPLE_STATUS_RUNNING = 101,
  52. IPSAMPLE_STATUS_STOPPING = 102,
  53. IPSAMPLE_STATUS_STOPPED = 103
  54. } IPSAMPLE_STATUS_CODE, *PIPSAMPLE_STATUS_CODE;
  55. //
  56. // type: CONFIGURATION_ENTRY
  57. //
  58. // stores global state.
  59. //
  60. // igsStats is protected through interlocked increments or decrements
  61. // lqEventQueue is protected by its own lock
  62. // rest protected by the read-write lock CONFIGURATION_ENTRY::rwlLock
  63. //
  64. typedef struct _CONFIGURATION_ENTRY
  65. {
  66. //
  67. // Following are PERSISTENT, across Start and Stop Protocol
  68. //
  69. // Lock
  70. READ_WRITE_LOCK rwlLock;
  71. // Global Heap
  72. HANDLE hGlobalHeap;
  73. // Clean Stop (Protocol)
  74. ULONG ulActivityCount;
  75. HANDLE hActivitySemaphore;
  76. // Logging & Tracing Information
  77. DWORD dwLogLevel;
  78. HANDLE hLogHandle;
  79. DWORD dwTraceID;
  80. // Event Queue
  81. LOCKED_QUEUE lqEventQueue;
  82. // Protocol State
  83. IPSAMPLE_STATUS_CODE iscStatus;
  84. //
  85. // Following are INITIALIZE'd and CLEANUP'd every Start & Stop Protocol
  86. //
  87. // Store of Dynamic Locks
  88. DYNAMIC_LOCKS_STORE dlsDynamicLocksStore;
  89. // Timer Entry
  90. HANDLE hTimerQueue;
  91. // Router Manager Information
  92. HANDLE hMgrNotificationEvent;
  93. SUPPORT_FUNCTIONS sfSupportFunctions;
  94. // RTMv2 Information
  95. RTM_ENTITY_INFO reiRtmEntity;
  96. RTM_REGN_PROFILE rrpRtmProfile;
  97. HANDLE hRtmHandle;
  98. HANDLE hRtmNotificationHandle;
  99. // MGM Information
  100. HANDLE hMgmHandle;
  101. // Network Entry
  102. PNETWORK_ENTRY pneNetworkEntry;
  103. // Global Statistics
  104. IPSAMPLE_GLOBAL_STATS igsStats;
  105. } CONFIGURATION_ENTRY, *PCONFIGURATION_ENTRY;
  106. // create all fields on DLL_PROCESS_ATTACH
  107. DWORD
  108. CE_Create (
  109. IN PCONFIGURATION_ENTRY pce);
  110. // destroy all fields on DLL_PROCESS_DEATTACH
  111. DWORD
  112. CE_Destroy (
  113. IN PCONFIGURATION_ENTRY pce);
  114. // initialize non persistent fields on StartProtocol
  115. DWORD
  116. CE_Initialize (
  117. IN PCONFIGURATION_ENTRY pce,
  118. IN HANDLE hMgrNotificationEvent,
  119. IN PSUPPORT_FUNCTIONS psfSupportFunctions,
  120. IN PIPSAMPLE_GLOBAL_CONFIG pigc);
  121. // cleanup non persistent fields on StopProtocol
  122. DWORD
  123. CE_Cleanup (
  124. IN PCONFIGURATION_ENTRY pce,
  125. IN BOOL bCleanupWinsock);
  126. #ifdef DEBUG
  127. DWORD
  128. CE_Display (
  129. IN PCONFIGURATION_ENTRY pce);
  130. #else
  131. #define CE_Display(pce)
  132. #endif // DEBUG
  133. #endif // _CONFIGURATIONENTRY_H_