No empty .Rs/.Re
[netbsd-mini2440.git] / usr.sbin / bootp / bootptest / trygetea.c
blob7b9be344a130668bfc720d7011e788fd75bbb0d1
1 /* $NetBSD: trygetea.c,v 1.4 2002/07/14 00:07:01 wiz Exp $ */
3 #include <sys/cdefs.h>
4 #ifndef lint
5 __RCSID("$NetBSD: trygetea.c,v 1.4 2002/07/14 00:07:01 wiz Exp $");
6 #endif
8 /*
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>
17 #endif
19 #include <net/if.h> /* for struct ifreq */
20 #include <netinet/in.h>
21 #include <arpa/inet.h> /* inet_ntoa */
23 #include <netdb.h>
24 #include <stdio.h>
25 #include <errno.h>
27 int
28 main(int argc, char **argv)
30 u_char ea[16]; /* Ethernet address */
31 int i;
33 if (argc < 2) {
34 fprintf(stderr, "need interface name\n");
35 exit(1);
37 if ((i = getether(argv[1], ea)) < 0) {
38 fprintf(stderr, "Could not get Ethernet address (rc=%d)\n", i);
39 exit(1);
41 printf("Ether-addr");
42 for (i = 0; i < 6; i++)
43 printf(":%x", ea[i] & 0xFF);
44 printf("\n");
46 return 0;