1 /* $NetBSD: trygetea.c,v 1.4 2002/07/14 00:07:01 wiz Exp $ */
5 __RCSID("$NetBSD: trygetea.c,v 1.4 2002/07/14 00:07:01 wiz Exp $");
9 * trygetea.c - test program for getether.c
12 #include <sys/types.h>
13 #include <sys/socket.h>
15 #if defined(SUNOS) || defined(SVR4)
16 #include <sys/sockio.h>
19 #include <net/if.h> /* for struct ifreq */
20 #include <netinet/in.h>
21 #include <arpa/inet.h> /* inet_ntoa */
28 main(int argc
, char **argv
)
30 u_char ea
[16]; /* Ethernet address */
34 fprintf(stderr
, "need interface name\n");
37 if ((i
= getether(argv
[1], ea
)) < 0) {
38 fprintf(stderr
, "Could not get Ethernet address (rc=%d)\n", i
);
42 for (i
= 0; i
< 6; i
++)
43 printf(":%x", ea
[i
] & 0xFF);