kernel/ale: Fix one more parentheses issue.
[dragonfly.git] / libexec / bootpd / trylook.c
blob51ec7b182cc0ae704013f549aca03ddbc9f12454
1 /*
2 * trylook.c - test program for lookup.c
4 * $FreeBSD: src/libexec/bootpd/trylook.c,v 1.5 1999/08/28 00:09:20 peter Exp $
5 * $DragonFly: src/libexec/bootpd/trylook.c,v 1.2 2003/06/17 04:27:07 dillon Exp $
6 */
8 #include <sys/types.h>
9 #include <netinet/in.h>
10 #include <stdio.h>
12 #include "report.h"
13 #include "lookup.h"
15 extern char *ether_ntoa();
16 extern char *inet_ntoa();
18 int debug = 0;
19 char *progname;
21 void
22 main(argc, argv)
23 int argc;
24 char **argv;
26 int i;
27 struct in_addr in;
28 char *a;
29 u_char *hwa;
31 progname = argv[0]; /* for report */
33 for (i = 1; i < argc; i++) {
35 /* Host name */
36 printf("%s:", argv[i]);
38 /* IP addr */
39 if (lookup_ipa(argv[i], &in.s_addr))
40 a = "?";
41 else
42 a = inet_ntoa(in);
43 printf(" ipa=%s", a);
45 /* Ether addr */
46 printf(" hwa=");
47 hwa = lookup_hwa(argv[i], 1);
48 if (!hwa)
49 printf("?\n");
50 else {
51 int i;
52 for (i = 0; i < 6; i++)
53 printf(":%x", hwa[i] & 0xFF);
54 putchar('\n');
58 exit(0);