amd64: Copy MPTable PCI interrput routing code from i386
[dragonfly.git] / libexec / bootpd / trygetea.c
blob94f60ff0337947b5996ba7e1d60b71f75461740f
1 /*
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 $
6 */
8 #include <sys/types.h>
9 #include <sys/socket.h>
11 #if defined(SUNOS) || defined(SVR4)
12 #include <sys/sockio.h>
13 #endif
15 #ifdef _AIX32
16 #include <sys/time.h> /* for struct timeval in net/if.h */
17 #endif
18 #include <net/if.h> /* for struct ifreq */
19 #include <netinet/in.h>
20 #include <arpa/inet.h> /* inet_ntoa */
22 #include <netdb.h>
23 #include <stdio.h>
24 #include <ctype.h>
25 #include <errno.h>
27 #include "getether.h"
29 int debug = 0;
30 char *progname;
32 void
33 main(argc, argv)
34 int argc;
35 char **argv;
37 u_char ea[16]; /* Ethernet address */
38 int i;
40 progname = argv[0]; /* for report */
42 if (argc < 2) {
43 printf("need interface name\n");
44 exit(1);
46 if ((i = getether(argv[1], (char*)ea)) < 0) {
47 printf("Could not get Ethernet address (rc=%d)\n", i);
48 exit(1);
50 printf("Ether-addr");
51 for (i = 0; i < 6; i++)
52 printf(":%x", ea[i] & 0xFF);
53 printf("\n");
55 exit(0);