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.

198 lines
4.5 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: packetio.cpp
  4. //
  5. // Synopsis: Implementation of CPacketIo class methods
  6. //
  7. //
  8. // History: 9/23/97 MKarki Created
  9. // 8/28/98 MKarki Update to use Perimeter class
  10. //
  11. // Copyright (C) 1997-98 Microsoft Corporation
  12. // All rights reserved.
  13. //
  14. //----------------------------------------------------------------
  15. #include "radcommon.h"
  16. #include "packetio.h"
  17. //++--------------------------------------------------------------
  18. //
  19. // Function: CPacketIo
  20. //
  21. // Synopsis: This is the constructor of the CPacketIo class
  22. //
  23. // Arguments: NONE
  24. //
  25. // Returns: NONE
  26. //
  27. //
  28. // History: MKarki Created 11/25/97
  29. //
  30. //----------------------------------------------------------------
  31. CPacketIo::CPacketIo(
  32. VOID
  33. )
  34. {
  35. } // end of CPacketIo constructor
  36. //++--------------------------------------------------------------
  37. //
  38. // Function: ~CPacketIo
  39. //
  40. // Synopsis: This is the destructor of the CPacketIo class
  41. //
  42. // Arguments: NONE
  43. //
  44. // Returns: NONE
  45. //
  46. // History: MKarki Created 11/25/97
  47. //
  48. //----------------------------------------------------------------
  49. CPacketIo::~CPacketIo(
  50. VOID
  51. )
  52. {
  53. } // end of CPacketIo destructor
  54. //++--------------------------------------------------------------
  55. //
  56. // Function: StartProcessing
  57. //
  58. // Synopsis: This is the CPacketIo public method enables
  59. // sending packets out to the net
  60. //
  61. // Arguments:
  62. // [in] DWORD - authentication handle
  63. // [in] DWORD - accounting handle
  64. //
  65. //
  66. // Returns: BOOL - bStatus
  67. //
  68. // History: MKarki Created 11/25/97
  69. //
  70. //----------------------------------------------------------------
  71. BOOL CPacketIo::StartProcessing ( )
  72. {
  73. //
  74. // enable
  75. //
  76. EnableProcessing ();
  77. return (TRUE);
  78. } // end of CPacketIo::StartProcessing method
  79. //++--------------------------------------------------------------
  80. //
  81. // Function: StopProcessing
  82. //
  83. // Synopsis: This is the CPacketIo public method disables
  84. // sending packets out to the net
  85. //
  86. // Arguments: NONE
  87. //
  88. // Returns: BOOL - bStatus
  89. //
  90. // History: MKarki Created 11/25/97
  91. //
  92. //----------------------------------------------------------------
  93. BOOL
  94. CPacketIo::StopProcessing (
  95. VOID
  96. )
  97. {
  98. //
  99. // disable
  100. //
  101. DisableProcessing ();
  102. return (TRUE);
  103. } // end of CPacketIo::StopProcessing method
  104. //++--------------------------------------------------------------
  105. //
  106. // Function: EnableProcessing
  107. //
  108. // Synopsis: This is the CPacketIo class private method
  109. // that enables the processing flag
  110. //
  111. // Arguments:
  112. //
  113. // Returns: BOOL - status
  114. //
  115. //
  116. // History: MKarki Created 11/19/97
  117. //
  118. //----------------------------------------------------------------
  119. BOOL
  120. CPacketIo::EnableProcessing (
  121. VOID
  122. )
  123. {
  124. LockExclusive ();
  125. m_bProcessData = TRUE;
  126. Unlock ();
  127. return (TRUE);
  128. }
  129. //++--------------------------------------------------------------
  130. //
  131. // Function: DisableProcessing
  132. //
  133. // Synopsis: This is the CPacketIo class private method
  134. // that disables the processing flag
  135. //
  136. // Arguments:
  137. //
  138. // Returns: BOOL - status
  139. //
  140. //
  141. // History: MKarki Created 11/19/97
  142. //
  143. //----------------------------------------------------------------
  144. BOOL
  145. CPacketIo::DisableProcessing (
  146. VOID
  147. )
  148. {
  149. LockExclusive ();
  150. m_bProcessData = FALSE;
  151. Unlock ();
  152. return (TRUE);
  153. } // end of CPacketIo::DisableProcessing method
  154. //++--------------------------------------------------------------
  155. //
  156. // Function: IsProcessingEnabled
  157. //
  158. // Synopsis: This is the CPacketIo class private method
  159. // that checks if the processing is enabled
  160. //
  161. // Arguments:
  162. //
  163. // Returns: BOOL - status
  164. //
  165. //
  166. // History: MKarki Created 11/19/97
  167. //
  168. //----------------------------------------------------------------
  169. BOOL
  170. CPacketIo::IsProcessingEnabled(
  171. VOID
  172. )
  173. {
  174. BOOL bRetVal = FALSE;
  175. Lock ();
  176. bRetVal = m_bProcessData;
  177. Unlock ();
  178. return (bRetVal);
  179. } // end of CPacketIo::IsProcessingEnabled method