Expand PMF_FN_* macros.
[netbsd-mini2440.git] / usr.sbin / bootp / common / trylook.c
blob4f51ff801f252e27ccd220391c1ca9f47ecf0ae7
1 /* $NetBSD: trylook.c,v 1.3 1998/03/14 04:39:55 lukem Exp $ */
3 #include <sys/cdefs.h>
4 #ifndef lint
5 __RCSID("$NetBSD: trylook.c,v 1.3 1998/03/14 04:39:55 lukem Exp $");
6 #endif
8 /*
9 * trylook.c - test program for lookup.c
12 #include <sys/types.h>
13 #include <netinet/in.h>
14 #include <stdio.h>
16 #include "report.h"
17 #include "lookup.h"
19 extern char *ether_ntoa(struct ether_addr *);
20 extern char *inet_ntoa(struct in_addr);
22 int debug = 0;
23 char *progname;
25 int
26 main(int argc, char **argv)
28 int i;
29 struct in_addr in;
30 char *a;
31 u_char *hwa;
33 progname = argv[0]; /* for report */
35 for (i = 1; i < argc; i++) {
37 /* Host name */
38 printf("%s:", argv[i]);
40 /* IP addr */
41 if (lookup_ipa(argv[i], &in.s_addr))
42 a = "?";
43 else
44 a = inet_ntoa(in);
45 printf(" ipa=%s", a);
47 /* Ether addr */
48 hwa = lookup_hwa(argv[i], 1);
49 if (!hwa)
50 a = "?";
51 else
52 a = ether_ntoa(hwa);
53 printf(" hwa=%s\n", a);
56 exit(0);