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.1 KiB

  1. /*++
  2. Copyright (c) 1998, Microsoft Corporation
  3. Module Name:
  4. range.h
  5. Abstract:
  6. This module implements an efficient mapping from an arbitrary range of
  7. IP addresses to a minimal set of IP address-mask pairs covering the range.
  8. The key to the approach is to regard the set of all possible IP addresses
  9. as a full 32-bit deep binary tree. Then a single IP address is a path
  10. through that tree, and a range of addresses is the area between two paths
  11. through the tree. We then describe such a path-delineated area by pruning
  12. full subtrees of the area recursively from left to right.
  13. Author:
  14. Abolade Gbadegesin (aboladeg) 20-Mar-1998
  15. Revision History:
  16. --*/
  17. #ifndef _NATHLP_RANGE_H_
  18. #define _NATHLP_RANGE_H_
  19. typedef
  20. VOID
  21. (*PDECOMPOSE_RANGE_CALLBACK)(
  22. ULONG Address,
  23. ULONG Mask,
  24. PVOID Context
  25. );
  26. VOID
  27. DecomposeRange(
  28. ULONG StartAddress,
  29. ULONG EndAddress,
  30. ULONG Mask,
  31. PDECOMPOSE_RANGE_CALLBACK Callback,
  32. PVOID CallbackContext
  33. );
  34. ULONG
  35. MostGeneralMask(
  36. ULONG StartAddress,
  37. ULONG EndAddress
  38. );
  39. #endif // _NATHLP_RANGE_H_