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.

140 lines
3.1 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: proxyinfo.cpp
  4. //
  5. // Synopsis: Implementation of CProxyInfo class methods
  6. //
  7. //
  8. // History: 10/2/97 MKarki Created
  9. //
  10. // Copyright (C) 1997-98 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //----------------------------------------------------------------
  14. #include "radcommon.h"
  15. #include "proxyinfo.h"
  16. //++--------------------------------------------------------------
  17. //
  18. // Function: CProxyInfo
  19. //
  20. // Synopsis: This is CProxyInfo class constructor
  21. //
  22. // Arguments: NONE
  23. //
  24. // Returns: NONE
  25. //
  26. //
  27. // History: MKarki Created 10/2/97
  28. //
  29. //----------------------------------------------------------------
  30. CProxyInfo::CProxyInfo()
  31. {
  32. ZeroMemory (m_ProxyReqAuthenticator, AUTHENTICATOR_SIZE);
  33. ZeroMemory (m_ClientReqAuthenticator, AUTHENTICATOR_SIZE);
  34. m_dwClientIPAddress = 0;
  35. m_wClientPort = 0;
  36. } // end of CProxyInfo constructor
  37. CProxyInfo::~CProxyInfo()
  38. {
  39. }
  40. BOOL
  41. CProxyInfo::Init (
  42. PBYTE pbyClientAuthenticator,
  43. PBYTE pbyProxyAuthenticator,
  44. DWORD dwClientIPAddress,
  45. WORD wClientPort
  46. )
  47. {
  48. BOOL bRetVal = FALSE;
  49. __try
  50. {
  51. if ((NULL == pbyClientAuthenticator) ||
  52. (NULL == pbyProxyAuthenticator)
  53. )
  54. __leave;
  55. CopyMemory (
  56. m_ClientReqAuthenticator,
  57. pbyClientAuthenticator,
  58. AUTHENTICATOR_SIZE
  59. );
  60. CopyMemory (
  61. m_ProxyReqAuthenticator,
  62. pbyProxyAuthenticator,
  63. AUTHENTICATOR_SIZE
  64. );
  65. m_dwClientIPAddress = dwClientIPAddress;
  66. m_wClientPort = wClientPort;
  67. bRetVal = TRUE;
  68. }
  69. __finally
  70. {
  71. //
  72. // nothing here for now
  73. //
  74. }
  75. return (bRetVal);
  76. } // end of SetProxyReqAuthenticator::method
  77. //++--------------------------------------------------------------
  78. //
  79. // Function: GetProxyReqAuthenticator
  80. //
  81. // Synopsis: This is the CProxyInfo class public method
  82. // used to
  83. //
  84. // Arguments:
  85. //
  86. // Returns: BOOL status
  87. //
  88. //
  89. // History: MKarki Created 10/22/97
  90. //
  91. // Called By:
  92. //
  93. //----------------------------------------------------------------
  94. BOOL
  95. CProxyInfo::GetProxyReqAuthenticator (
  96. PBYTE pbyProxyReqAuthenticator
  97. )
  98. {
  99. BOOL bRetVal = FALSE;
  100. __try
  101. {
  102. if (NULL == pbyProxyReqAuthenticator)
  103. __leave;
  104. CopyMemory (
  105. pbyProxyReqAuthenticator,
  106. m_ProxyReqAuthenticator,
  107. AUTHENTICATOR_SIZE
  108. );
  109. //
  110. // success
  111. //
  112. bRetVal = TRUE;
  113. }
  114. __finally
  115. {
  116. //
  117. // nothing here for now
  118. //
  119. }
  120. return (bRetVal);
  121. } // end of CProxyInfo::GetProxyReqAuthenticator method