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.

58 lines
1.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // radutil.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file declares methods for converting attributes to and from
  12. // RADIUS wire format.
  13. //
  14. // MODIFICATION HISTORY
  15. //
  16. // 03/08/1998 Original version.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef _RADUTIL_H_
  20. #define _RADUTIL_H_
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. namespace RadiusUtil
  25. {
  26. //////////
  27. // Decodes an octet string into a newly-allocated IAS Attribute of the
  28. // specified type.
  29. //////////
  30. PIASATTRIBUTE decode(
  31. IASTYPE dstType,
  32. PBYTE src,
  33. ULONG srclen
  34. );
  35. //////////
  36. // Returns the size in bytes of the IASATTRIBUTE when converted to RADIUS
  37. // wire format. This does NOT include the attribute header.
  38. //////////
  39. ULONG getEncodedSize(
  40. const IASATTRIBUTE& src
  41. ) throw ();
  42. //////////
  43. // Encodes the IASATTRIBUTE into RADIUS wire format and copies the value
  44. // to the buffer pointed to by 'dst'. The caller should ensure that the
  45. // destination buffer is large enough by first calling getEncodedSize.
  46. // This method only encodes the attribute value, not the header.
  47. //////////
  48. void encode(
  49. PBYTE dst,
  50. const IASATTRIBUTE& src
  51. ) throw ();
  52. };
  53. #endif // _RADUTIL_H_