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.

89 lines
2.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // eapstate.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class EAPState.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 01/15/1998 Original version.
  16. // 08/26/1998 Consolidated into a single class.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef _EAPSTATE_H_
  20. #define _EAPSTATE_H_
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. #include <iaspolcy.h>
  25. #include <iasutil.h>
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // STRUCT
  29. //
  30. // EAPState
  31. //
  32. // DESCRIPTION
  33. //
  34. // The EAPState struct describes the wire-format of the RADIUS State
  35. // attribute used for EAP.
  36. //
  37. ///////////////////////////////////////////////////////////////////////////////
  38. struct EAPState : IAS_OCTET_STRING
  39. {
  40. struct Layout
  41. {
  42. BYTE checksum[4];
  43. BYTE vendorID[4];
  44. BYTE version[2];
  45. BYTE serverAddress[4];
  46. BYTE sourceID[4];
  47. BYTE sessionID[4];
  48. };
  49. Layout& get() throw ()
  50. { return *(Layout*)lpValue; }
  51. const Layout& get() const throw ()
  52. { return *(Layout*)lpValue; }
  53. bool isValid() const throw ();
  54. //////////
  55. // Miscellaneous accessors.
  56. //////////
  57. DWORD getChecksum() const throw ()
  58. { return IASExtractDWORD(get().checksum); }
  59. DWORD getVendorID() const throw ()
  60. { return IASExtractDWORD(get().vendorID); }
  61. WORD getVersion() const throw ()
  62. { return IASExtractWORD(get().version); }
  63. DWORD getServerAddress() const throw ()
  64. { return IASExtractDWORD(get().serverAddress); }
  65. DWORD getSourceID() const throw ()
  66. { return IASExtractDWORD(get().sourceID); }
  67. DWORD getSessionID() const throw ()
  68. { return IASExtractDWORD(get().sessionID); }
  69. // Must be called before any calls to createAttribute.
  70. static void initialize() throw ();
  71. static PIASATTRIBUTE createAttribute(DWORD sessionID);
  72. };
  73. #endif // _EAPSTATE_H_