Skip to content

Instantly share code, notes, and snippets.

@jbiason
Created November 6, 2015 11:06
Show Gist options
  • Save jbiason/ded68df0290e0ef772f2 to your computer and use it in GitHub Desktop.
Save jbiason/ded68df0290e0ef772f2 to your computer and use it in GitHub Desktop.
ether functions do not work with -std=c11
#include "netinet/ether.h"
#include "net/ethernet.h"
#include "stdio.h"
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
struct ether_addr address;
char buffer[30];
ether_aton_r("f8:b1:56:fb:e9:57", &address);
memset(buffer, 0, 30);
ether_ntoa_r((const struct ether_addr*)&address, buffer);
printf("%s\n", buffer);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment