Update so after migration we will still try to publish the domain.
[handlervirt.git] / experiment3.c
blob80d06b36872b6a50cba066f69751b561639bd171
1 #include <stdio.h>
3 int main() {
4 FILE *fd;
5 char mac[13];
6 unsigned long int counter = 0;
8 if ((fd = fopen("/tmp/maccounter", "r")) != NULL) {
9 fread(mac, 12, sizeof(char), fd);
10 mac[13] = '\0';
11 counter = strtoul(mac, NULL, 16);
12 counter++;
13 fclose(fd);
16 snprintf(mac, 13, "%012X\n", counter);
17 if ((fd = fopen("/tmp/maccounter", "w")) != NULL) {
18 fwrite(mac, 12, sizeof(char), fd);
19 fclose(fd);