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.

154 lines
2.9 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. //
  46. // methdos of the IIasClient interface
  47. //
  48. //
  49. // get the Client's IP address
  50. //
  51. STDMETHOD (GetAddress) (PDWORD pdwAddress);
  52. //
  53. // check if signature is required
  54. //
  55. STDMETHOD (NeedSignatureCheck) (PBOOL pbNeedCheck);
  56. //
  57. // get the Vendor Type
  58. //
  59. STDMETHOD (GetVendorType) (PLONG plVendorType);
  60. //
  61. // get client name
  62. //
  63. STDMETHOD_(LPCWSTR, GetClientNameW)()
  64. { return m_wszClientName; }
  65. //
  66. // get the shared secret
  67. //
  68. STDMETHOD (GetSecret) (
  69. /*[out]*/ PBYTE pbySecret,
  70. /*[in/out]*/ PDWORD pdwSecretSize
  71. );
  72. //
  73. // initialize the client object
  74. //
  75. STDMETHOD (Init) (
  76. /*[in]*/ ISdo *pISdo
  77. );
  78. //
  79. // resolve the Client IP address
  80. //
  81. STDMETHOD (ResolveAddress) (VOID);
  82. CClient();
  83. virtual ~CClient();
  84. struct Address
  85. {
  86. ULONG ipAddress;
  87. ULONG width;
  88. };
  89. const Address* GetAddressList() throw ()
  90. { return m_adwAddrList; }
  91. protected:
  92. void ClearAddress() throw ();
  93. private:
  94. BOOL SetAddress (
  95. /*[in]*/ VARIANT varAddress
  96. );
  97. BOOL SetSecret (
  98. /*[in]*/ VARIANT varSecret
  99. );
  100. BOOL SetClientName (
  101. /*[in]*/ VARIANT varClientName
  102. );
  103. BOOL SetSignatureFlag (
  104. /*[in]*/ VARIANT varSigFlag
  105. );
  106. BOOL SetVendorType (
  107. /*[in]*/ VARIANT varAddress
  108. );
  109. Address m_adwAddressBuffer[2];
  110. Address* m_adwAddrList;
  111. CHAR m_szSecret[MAX_SECRET_SIZE + 1];
  112. WCHAR m_wszClientName[MAX_CLIENTNAME_SIZE + 1];
  113. WCHAR m_wszClientAddress[MAX_CLIENT_SIZE +1];
  114. DWORD m_dwSecretSize;
  115. BOOL m_bSignatureCheck;
  116. INT m_lVendorType;
  117. };
  118. #endif // ifndef _CLIENT_H_