macinfo.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * TAP-Windows -- A kernel driver to provide virtual tap
  3. * device functionality on Windows.
  4. *
  5. * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
  6. *
  7. * This source code is Copyright (C) 2002-2014 OpenVPN Technologies, Inc.,
  8. * and is released under the GPL version 2 (see below).
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program (see the file COPYING included with this
  21. * distribution); if not, write to the Free Software Foundation, Inc.,
  22. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. */
  24. #ifndef MacInfoDefined
  25. #define MacInfoDefined
  26. //===================================================================================
  27. // Macros
  28. //===================================================================================
  29. #define IsMacDelimiter(a) (a == ':' || a == '-' || a == '.')
  30. #define IsHexDigit(c) ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'))
  31. #define CLEAR_MAC(dest) NdisZeroMemory ((dest), sizeof (MACADDR))
  32. #define MAC_EQUAL(a,b) (memcmp ((a), (b), sizeof (MACADDR)) == 0)
  33. BOOLEAN
  34. ParseMAC (MACADDR dest, const char *src);
  35. VOID
  36. GenerateRandomMac(
  37. __in MACADDR mac,
  38. __in const unsigned char *adapter_name
  39. );
  40. VOID
  41. GenerateRelatedMAC(
  42. __in MACADDR dest,
  43. __in const MACADDR src,
  44. __in const int delta
  45. );
  46. #endif