summaryrefslogtreecommitdiffstats
path: root/libexec/bootpd/trylook.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1994-09-30 05:45:07 +0000
committerpst <pst@FreeBSD.org>1994-09-30 05:45:07 +0000
commit68e1cd350c0146bb7a6af8a084a7eb13d724ec1b (patch)
tree8c70e536438757114c4e79a725249f364f81be06 /libexec/bootpd/trylook.c
downloadFreeBSD-src-68e1cd350c0146bb7a6af8a084a7eb13d724ec1b.zip
FreeBSD-src-68e1cd350c0146bb7a6af8a084a7eb13d724ec1b.tar.gz
Rearrange bootpd
Diffstat (limited to 'libexec/bootpd/trylook.c')
-rw-r--r--libexec/bootpd/trylook.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/libexec/bootpd/trylook.c b/libexec/bootpd/trylook.c
new file mode 100644
index 0000000..40652a2
--- /dev/null
+++ b/libexec/bootpd/trylook.c
@@ -0,0 +1,50 @@
+/*
+ * trylook.c - test program for lookup.c
+ */
+
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <stdio.h>
+
+#include "report.h"
+#include "lookup.h"
+
+extern char *ether_ntoa();
+extern char *inet_ntoa();
+
+int debug = 0;
+char *progname;
+
+main(argc, argv)
+ char **argv;
+{
+ int i;
+ struct in_addr in;
+ char *a;
+ u_char *hwa;
+
+ progname = argv[0]; /* for report */
+
+ for (i = 1; i < argc; i++) {
+
+ /* Host name */
+ printf("%s:", argv[i]);
+
+ /* IP addr */
+ if (lookup_ipa(argv[i], &in.s_addr))
+ a = "?";
+ else
+ a = inet_ntoa(in);
+ printf(" ipa=%s", a);
+
+ /* Ether addr */
+ hwa = lookup_hwa(argv[i], 1);
+ if (!hwa)
+ a = "?";
+ else
+ a = ether_ntoa(hwa);
+ printf(" hwa=%s\n", a);
+
+ }
+ exit(0);
+}
OpenPOWER on IntegriCloud