config root man

Current Path : /usr/src/libexec/bootpd/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/src/libexec/bootpd/trylook.c

/*
 * trylook.c - test program for lookup.c
 *
 * $FreeBSD: release/9.1.0/libexec/bootpd/trylook.c 50476 1999-08-28 00:22:10Z peter $
 */

#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;

void
main(argc, argv)
	int argc;
	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 */
		printf(" hwa=");
		hwa = lookup_hwa(argv[i], 1);
		if (!hwa)
			printf("?\n");
		else {
			int i;
			for (i = 0; i < 6; i++)
				printf(":%x", hwa[i] & 0xFF);
			putchar('\n');
		}

	}
	exit(0);
}

Man Man