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.

102 lines
2.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // proxy.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class RadiusProxy.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 01/26/2000 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef PROXY_H
  19. #define PROXY_H
  20. #if _MSC_VER >= 1000
  21. #pragma once
  22. #endif
  23. #define IDS_RadiusProxy 201
  24. #include <radproxy.h>
  25. #include <counters.h>
  26. #include <translate.h>
  27. #include <iastl.h>
  28. #include <iastlutl.h>
  29. using namespace IASTL;
  30. class __declspec(uuid("6BC0989F-0CE6-11D1-BAAE-00C04FC2E20D")) RadiusProxy;
  31. ///////////////////////////////////////////////////////////////////////////////
  32. //
  33. // CLASS
  34. //
  35. // RadiusProxy
  36. //
  37. // DESCRIPTION
  38. //
  39. // Implements the RadiusProxy request handler.
  40. //
  41. ///////////////////////////////////////////////////////////////////////////////
  42. class ATL_NO_VTABLE RadiusProxy :
  43. public IASTL::IASRequestHandler,
  44. public CComCoClass<RadiusProxy, &__uuidof(RadiusProxy)>,
  45. public RadiusProxyClient
  46. {
  47. public:
  48. IAS_DECLARE_REGISTRY(RadiusProxy, 1, IAS_REGISTRY_AUTO, IASTypeLibrary)
  49. RadiusProxy();
  50. ~RadiusProxy() throw ();
  51. HRESULT FinalConstruct() throw ()
  52. {
  53. HRESULT hr = counters.FinalConstruct();
  54. if (SUCCEEDED(hr)) { hr = translator.FinalConstruct(); }
  55. return hr;
  56. }
  57. STDMETHOD(PutProperty)(LONG Id, VARIANT* pValue);
  58. // RadiusProxyClient methods.
  59. virtual void onEvent(
  60. const RadiusEvent& event
  61. ) throw ();
  62. virtual void onComplete(
  63. RadiusProxyEngine::Result result,
  64. PVOID context,
  65. RemoteServer* server,
  66. BYTE code,
  67. const RadiusAttribute* begin,
  68. const RadiusAttribute* end
  69. ) throw ();
  70. protected:
  71. // Receives requests from the pipeline.
  72. void onAsyncRequest(IRequest* pRequest) throw ();
  73. // Update configuration.
  74. void configure(IUnknown* unk);
  75. // Default vector for retrieving attributes.
  76. typedef IASAttributeVectorWithBuffer<32> AttributeVector;
  77. typedef AttributeVector::iterator AttributeIterator;
  78. Translator translator; // Converts attributes to RADIUS format.
  79. RadiusProxyEngine engine; // The actual proxy code.
  80. ProxyCounters counters; // Maintains the PerfMon/SNMP counters.
  81. // Not implemented.
  82. RadiusProxy(const RadiusProxy&);
  83. RadiusProxy& operator=(const RadiusProxy&);
  84. };
  85. #endif // PROXY_H