1 #include <netinet/ether.h>
4 #define ETHER_LINE_LEN 256
6 /* This test requires /etc/ethers to exist
7 * and to have host "teeth". For example:
8 * 00:11:22:33:44:55 teeth
13 struct ether_addr addr;
14 char host[ETHER_LINE_LEN];
16 int res = ether_hostton("teeth", &addr);
21 for (i = 0; i < 6; i++) {
22 printf("%02x", addr.ether_addr_octet[i]);
27 res = ether_ntohost(host, &addr);
30 printf(" %s\n", host);