2 * trygetea.c - test program for getether.c
8 #include <sys/socket.h>
10 #if defined(SUNOS) || defined(SVR4)
11 #include <sys/sockio.h>
15 #include <sys/time.h> /* for struct timeval in net/if.h */
17 #include <net/if.h> /* for struct ifreq */
18 #include <netinet/in.h>
19 #include <arpa/inet.h> /* inet_ntoa */
36 u_char ea[16]; /* Ethernet address */
39 progname = argv[0]; /* for report */
42 printf("need interface name\n");
45 if ((i = getether(argv[1], (char*)ea)) < 0) {
46 printf("Could not get Ethernet address (rc=%d)\n", i);
50 for (i = 0; i < 6; i++)
51 printf(":%x", ea[i] & 0xFF);