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.

54 lines
1.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 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. ///////////////////////////////////////////////////////////////////////////////
  15. #ifndef _RADUTIL_H_
  16. #define _RADUTIL_H_
  17. #if _MSC_VER >= 1000
  18. #pragma once
  19. #endif
  20. namespace RadiusUtil
  21. {
  22. //////////
  23. // Decodes an octet string into a newly-allocated IAS Attribute of the
  24. // specified type.
  25. //////////
  26. PIASATTRIBUTE decode(
  27. IASTYPE dstType,
  28. PBYTE src,
  29. ULONG srclen
  30. );
  31. //////////
  32. // Returns the size in bytes of the IASATTRIBUTE when converted to RADIUS
  33. // wire format. This does NOT include the attribute header.
  34. //////////
  35. ULONG getEncodedSize(
  36. const IASATTRIBUTE& src
  37. );
  38. //////////
  39. // Encodes the IASATTRIBUTE into RADIUS wire format and copies the value
  40. // to the buffer pointed to by 'dst'. The caller should ensure that the
  41. // destination buffer is large enough by first calling getEncodedSize.
  42. // This method only encodes the attribute value, not the header.
  43. //////////
  44. void encode(
  45. PBYTE dst,
  46. const IASATTRIBUTE& src
  47. ) throw ();
  48. };
  49. #endif // _RADUTIL_H_