2 * trygetea.c - test program for getether.c
4 * $FreeBSD: src/libexec/bootpd/trygetea.c,v 1.5 1999/08/28 00:09:19 peter Exp $
5 * $DragonFly: src/libexec/bootpd/trygetea.c,v 1.2 2003/06/17 04:27:07 dillon Exp $
9 #include <sys/socket.h>
11 #if defined(SUNOS) || defined(SVR4)
12 #include <sys/sockio.h>
16 #include <sys/time.h> /* for struct timeval in net/if.h */
18 #include <net/if.h> /* for struct ifreq */
19 #include <netinet/in.h>
20 #include <arpa/inet.h> /* inet_ntoa */
37 u_char ea
[16]; /* Ethernet address */
40 progname
= argv
[0]; /* for report */
43 printf("need interface name\n");
46 if ((i
= getether(argv
[1], (char*)ea
)) < 0) {
47 printf("Could not get Ethernet address (rc=%d)\n", i
);
51 for (i
= 0; i
< 6; i
++)
52 printf(":%x", ea
[i
] & 0xFF);