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.

173 lines
4.3 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: procacct.cpp
  4. //
  5. // Synopsis: Implementation of CProcAccounting class methods
  6. //
  7. //
  8. // History: 10/20/97 MKarki Created
  9. //
  10. // Copyright (C) 1997-98 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //----------------------------------------------------------------
  14. #include "radcommon.h"
  15. #include "procacct.h"
  16. //++--------------------------------------------------------------
  17. //
  18. // Function: CProcAccounting
  19. //
  20. // Synopsis: This is CProcAccounting class constructor
  21. //
  22. // Arguments: NONE
  23. //
  24. // Returns: NONE
  25. //
  26. //
  27. // History: MKarki Created 10/20/97
  28. //
  29. //----------------------------------------------------------------
  30. CProcAccounting::CProcAccounting()
  31. : m_pCPreValidator (NULL),
  32. m_pCProxyState (NULL),
  33. m_pCPacketSender (NULL),
  34. m_pCSendToPipe (NULL)
  35. {
  36. } // end of CProcAccounting class constructor
  37. //++--------------------------------------------------------------
  38. //
  39. // Function: CProcAccounting
  40. //
  41. // Synopsis: This is CProcAccounting class destructor
  42. //
  43. // Arguments: NONE
  44. //
  45. // Returns: NONE
  46. //
  47. //
  48. // History: MKarki Created 10/20/97
  49. //
  50. //----------------------------------------------------------------
  51. CProcAccounting::~CProcAccounting()
  52. {
  53. } // end of CProcAccounting class destructor
  54. //++--------------------------------------------------------------
  55. //
  56. // Function: Init
  57. //
  58. // Synopsis: This is CProcAccounting class public
  59. // initialization method
  60. //
  61. // Arguments: NONE
  62. //
  63. // Returns: status
  64. //
  65. //
  66. // History: MKarki Created 10/20/97
  67. //
  68. //----------------------------------------------------------------
  69. BOOL
  70. CProcAccounting::Init(
  71. CPreValidator *pCPreValidator,
  72. CProxyState *pCProxyState,
  73. CPacketSender *pCPacketSender,
  74. CSendToPipe *pCSendToPipe
  75. )
  76. {
  77. _ASSERT ((NULL != pCPreValidator) ||
  78. (NULL != pCProxyState) ||
  79. (NULL != pCPacketSender) ||
  80. (NULL != pCSendToPipe)
  81. );
  82. m_pCPreValidator = pCPreValidator;
  83. m_pCProxyState = pCProxyState;
  84. m_pCPacketSender = pCPacketSender;
  85. m_pCSendToPipe = pCSendToPipe;
  86. return (TRUE);
  87. } // end of CProcAccounting::Init method
  88. //++--------------------------------------------------------------
  89. //
  90. // Function: ProcessOutPacket
  91. //
  92. // Synopsis: This is CProcAccounting class public method
  93. // which carries out the processing of an outbound
  94. // RADIUS accounting packet
  95. //
  96. //
  97. // Arguments:
  98. // [in] CPacketRadius*
  99. //
  100. // Returns: HRESULT - status
  101. //
  102. //
  103. // History: MKarki Created 10/20/97
  104. //
  105. // Called By:
  106. //
  107. //----------------------------------------------------------------
  108. HRESULT
  109. CProcAccounting::ProcessOutPacket (
  110. CPacketRadius *pCPacketRadius
  111. )
  112. {
  113. BOOL bStatus = FALSE;
  114. BYTE InAuthenticator[AUTHENTICATOR_SIZE];
  115. BYTE OutAuthenticator[AUTHENTICATOR_SIZE];
  116. _ASSERT (pCPacketRadius);
  117. /*
  118. __try
  119. {
  120. //
  121. // to calcuate the authenticator for an outbound
  122. // proxy packet we take the request authenticator
  123. // as all zero's
  124. //
  125. ZeroMemory (InAuthenticator, AUTHENTICATOR_SIZE);
  126. //
  127. //
  128. // generate the request authenticator here
  129. //
  130. bStatus = pCPacketRadius->GenerateOutAuthenticator (
  131. reinterpret_cast <PBYTE> (InAuthenticator),
  132. reinterpret_cast <PBYTE> (OutAuthenticator)
  133. );
  134. if (FALSE == bStatus) { __leave; }
  135. //
  136. // put the request authenticator in the outbound
  137. // packet
  138. //
  139. bStatus = pCPacketRadius->SetOutAuthenticator (
  140. reinterpret_cast <PBYTE> (OutAuthenticator)
  141. );
  142. if (FALSE == bStatus) { __leave; }
  143. //
  144. // send the packet on its way
  145. //
  146. bStatus = m_pCPacketSender->SendPacket (pCPacketRadius);
  147. if (FALSE == bStatus) { __leave; }
  148. }
  149. __finally
  150. {
  151. }
  152. */
  153. return (S_OK);
  154. } // end of CProcAccounting::ProcessOutPacket method