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 25 #ifndef MacInfoDefined 26 #define MacInfoDefined 27 28 //=================================================================================== 29 // Macros 30 //=================================================================================== 31 #define IsMacDelimiter(a) (a == ':' || a == '-' || a == '.') 32 #define IsHexDigit(c) ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')) 33 34 #define CLEAR_MAC(dest) NdisZeroMemory ((dest), sizeof (MACADDR)) 35 #define MAC_EQUAL(a,b) (memcmp ((a), (b), sizeof (MACADDR)) == 0) 36 37 BOOLEAN 38 ParseMAC (MACADDR dest, const char *src); 39 40 VOID 41 GenerateRandomMac( 42 __in MACADDR mac, 43 __in const unsigned char *adapter_name 44 ); 45 46 VOID 47 GenerateRelatedMAC( 48 __in MACADDR dest, 49 __in const MACADDR src, 50 __in const int delta 51 ); 52 53 #endif 54