#include <stdlib.h>
 #include <string.h>
 #include <signal.h>
+#include <nfsidmap.h>
 #include "nfslib.h"
 #include "svcgssd.h"
 #include "gss_util.h"
 static void
 usage(char *progname)
 {
-       fprintf(stderr, "usage: %s [-n] [-f] [-v] [-r]\n",
+       fprintf(stderr, "usage: %s [-n] [-f] [-v] [-r] [-i]\n",
                progname);
        exit(1);
 }
        int fg = 0;
        int verbosity = 0;
        int rpc_verbosity = 0;
+       int idmap_verbosity = 0;
        int opt;
        extern char *optarg;
        char *progname;
 
-       while ((opt = getopt(argc, argv, "fvrnp:")) != -1) {
+       while ((opt = getopt(argc, argv, "fivrnp:")) != -1) {
                switch (opt) {
                        case 'f':
                                fg = 1;
                                break;
+                       case 'i':
+                               idmap_verbosity++;
+                               break;
                        case 'n':
                                get_creds = 0;
                                break;
                printerr(0, "Warning: rpcsec_gss library does not "
                            "support setting debug level\n");
 #endif
+#ifdef HAVE_NFS4_SET_DEBUG
+        nfs4_set_debug(idmap_verbosity, NULL);
+#else
+       if (idmap_verbosity > 0)
+               printerr(0, "Warning: your nfsidmap library does not "
+                           "support setting debug level\n");
+#endif
 
        if (gssd_check_mechs() != 0) {
                printerr(0, "ERROR: Problem with gssapi library\n");
 
 .\" rpc.svcgssd(8)
 .\"
 .\" Copyright (C) 2003 J. Bruce Fields <bfields@umich.edu>
-.TH rpc.svcgssd 8 "17 Mar 2003"
+.TH rpc.svcgssd 8 "12 Jan 2007"
 .SH NAME
 rpc.svcgssd \- server-side rpcsec_gss daemon
 .SH SYNOPSIS
-.B "rpc.svcgssd [-v] [-r] [-f] [-p pipefsdir]"
+.B "rpc.svcgssd [-v] [-r] [-i] [-f] [-p pipefsdir]"
 .SH DESCRIPTION
 The rpcsec_gss protocol gives a means of using the gss-api generic security
 api to provide security for protocols using rpc (in particular, nfs).  Before
 .B -r
 If the rpcsec_gss library supports setting debug level,
 increases the verbosity of the output (can be specified multiple times).
+.TP
+.B -i
+If the nfsidmap library supports setting debug level,
+increases the verbosity of the output (can be specified multiple times).
 
 .SH SEE ALSO
 .BR rpc.gssd(8),