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.

120 lines
2.5 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: client.h
  4. //
  5. // Synopsis: This file holds the declarations of the
  6. // CClient class
  7. //
  8. //
  9. // History: 9/23/97 MKarki Created
  10. //
  11. // Copyright (C) 1997-98 Microsoft Corporation
  12. // All rights reserved.
  13. //
  14. //----------------------------------------------------------------
  15. #ifndef _CLIENT_H_
  16. #define _CLIENT_H_
  17. #include "radcommon.h"
  18. #include "iasradius.h"
  19. #include "resource.h"
  20. #define MAX_SECRET_SIZE 255
  21. #define MAX_CLIENT_SIZE 255
  22. #define MAX_CLIENTNAME_SIZE 255
  23. class CClient :
  24. public IIasClient,
  25. public CComObjectRootEx<CComMultiThreadModel>,
  26. public CComCoClass<CClient, &__uuidof (CClient)>
  27. {
  28. public:
  29. //
  30. // registry declaration for the Client Object
  31. //
  32. IAS_DECLARE_REGISTRY (CClient, 1, 0, IASRadiusLib)
  33. //
  34. // this component is non-aggregatable
  35. //
  36. DECLARE_NOT_AGGREGATABLE (CClient)
  37. //
  38. // macros for ATL required methods
  39. //
  40. BEGIN_COM_MAP (CClient)
  41. COM_INTERFACE_ENTRY_IID (__uuidof(CClient), CClient)
  42. COM_INTERFACE_ENTRY (IIasClient)
  43. END_COM_MAP ()
  44. public:
  45. STDMETHOD_(DWORD, GetAddress)();
  46. STDMETHOD_(BOOL, NeedSignatureCheck)();
  47. STDMETHOD_(LONG, GetVendorType)();
  48. STDMETHOD_(LPCWSTR, GetClientNameW)();
  49. STDMETHOD_(LPCWSTR, GetClientAddressW)();
  50. STDMETHOD_(const BYTE*, GetSecret)(DWORD* pdwSecretSize);
  51. STDMETHOD(Init)(ISdo* pISdo);
  52. STDMETHOD(ResolveAddress)();
  53. CClient();
  54. virtual ~CClient();
  55. struct Address
  56. {
  57. ULONG ipAddress;
  58. ULONG width;
  59. };
  60. const Address* GetAddressList() throw ()
  61. { return m_adwAddrList; }
  62. protected:
  63. void ClearAddress() throw ();
  64. private:
  65. HRESULT SetAddress (const VARIANT& varAddress) throw ();
  66. BOOL SetSecret (
  67. /*[in]*/ VARIANT varSecret
  68. );
  69. HRESULT SetClientName(const VARIANT& varClientName) throw ();
  70. BOOL SetSignatureFlag (
  71. /*[in]*/ VARIANT varSigFlag
  72. );
  73. BOOL SetVendorType (
  74. /*[in]*/ VARIANT varAddress
  75. );
  76. Address m_adwAddressBuffer[2];
  77. Address* m_adwAddrList;
  78. CHAR m_szSecret[MAX_SECRET_SIZE + 1];
  79. WCHAR m_wszClientName[MAX_CLIENTNAME_SIZE + 1];
  80. WCHAR m_wszClientAddress[MAX_CLIENT_SIZE +1];
  81. DWORD m_dwSecretSize;
  82. BOOL m_bSignatureCheck;
  83. INT m_lVendorType;
  84. };
  85. #endif // ifndef _CLIENT_H_