Last active
December 11, 2015 06:03
-
-
Save crossle/ebcd32a4097257c7290d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define RANDOM(x) (rand()%x) | |
#define MAC_ADDR_LENGTH 6 | |
void macGen() { | |
uint8_t HEXCHAR[256]; | |
uint8_t MACAddr[MAC_ADDR_LENGTH]; | |
for (int j = 0; j < 256; j ++) { | |
HEXCHAR[j] = j; | |
} | |
srand(getpid()); | |
for(int i = 0;i < MAC_ADDR_LENGTH; i++) { | |
int n = RANDOM(255); | |
MACAddr[i] = HEXCHAR[n]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment