diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2002-07-22 17:19:54 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2002-07-22 17:19:54 +0000 |
commit | 3daa8471081a7517e777011474109f8117939e9f (patch) | |
tree | 83e6c1fda530bca72256aaf5459f09f353071f05 /usr.bin/finger/finger.c | |
parent | 9b44a25f1fcaf94fe5ba1cc8a06b728101f37ae0 (diff) |
add -4 and -6 option to be able to specify an address family.
Requested by: matusita
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=100521
Diffstat (limited to 'usr.bin/finger/finger.c')
-rw-r--r-- | usr.bin/finger/finger.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c index 0e6c176dc23e..a695672bd1ac 100644 --- a/usr.bin/finger/finger.c +++ b/usr.bin/finger/finger.c @@ -73,6 +73,8 @@ __FBSDID("$FreeBSD$"); * well as home directory, shell, mail info, and .plan/.project files. */ +#include <sys/types.h> +#include <sys/socket.h> #include <db.h> #include <err.h> #include <pwd.h> @@ -90,6 +92,7 @@ __FBSDID("$FreeBSD$"); DB *db; time_t now; int entries, gflag, lflag, mflag, pplan, sflag, oflag, Tflag; +sa_family_t family = PF_UNSPEC; int d_first = -1; char tbuf[1024]; @@ -107,8 +110,14 @@ option(argc, argv) optind = 1; /* reset getopt */ - while ((ch = getopt(argc, argv, "glmpshoT")) != -1) + while ((ch = getopt(argc, argv, "46glmpshoT")) != -1) switch(ch) { + case '4': + family = AF_INET; + break; + case '6': + family = AF_INET6; + break; case 'g': gflag = 1; break; @@ -144,7 +153,7 @@ option(argc, argv) static void usage() { - (void)fprintf(stderr, "usage: finger [-lmpshoT] [login ...]\n"); + (void)fprintf(stderr, "usage: finger [-46lmpshoT] [login ...]\n"); exit(1); } |