diff options
author | pst <pst@FreeBSD.org> | 1994-09-30 05:45:07 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1994-09-30 05:45:07 +0000 |
commit | 68e1cd350c0146bb7a6af8a084a7eb13d724ec1b (patch) | |
tree | 8c70e536438757114c4e79a725249f364f81be06 /libexec/bootpd/trygetea.c | |
download | FreeBSD-src-68e1cd350c0146bb7a6af8a084a7eb13d724ec1b.zip FreeBSD-src-68e1cd350c0146bb7a6af8a084a7eb13d724ec1b.tar.gz |
Rearrange bootpd
Diffstat (limited to 'libexec/bootpd/trygetea.c')
-rw-r--r-- | libexec/bootpd/trygetea.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libexec/bootpd/trygetea.c b/libexec/bootpd/trygetea.c new file mode 100644 index 0000000..e9314ae --- /dev/null +++ b/libexec/bootpd/trygetea.c @@ -0,0 +1,46 @@ +/* + * trygetea.c - test program for getether.c + */ + +#include <sys/types.h> +#include <sys/socket.h> + +#if defined(SUNOS) || defined(SVR4) +#include <sys/sockio.h> +#endif + +#include <net/if.h> /* for struct ifreq */ +#include <netinet/in.h> +#include <arpa/inet.h> /* inet_ntoa */ + +#include <netdb.h> +#include <stdio.h> +#include <ctype.h> +#include <errno.h> + +int debug = 0; +char *progname; + +main(argc, argv) + char **argv; +{ + u_char ea[16]; /* Ethernet address */ + int i; + + progname = argv[0]; /* for report */ + + if (argc < 2) { + printf("need interface name\n"); + exit(1); + } + if ((i = getether(argv[1], ea)) < 0) { + printf("Could not get Ethernet address (rc=%d)\n", i); + exit(1); + } + printf("Ether-addr"); + for (i = 0; i < 6; i++) + printf(":%x", ea[i] & 0xFF); + printf("\n"); + + exit(0); +} |