Lines Matching +full:sec +full:- +full:v4
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
73 /* Table for af,sotype -> netid conversions. */
98 static int retrycnt = -1;
109 static int secflavor = -1;
117 V4 enumerator
128 static int sec_name_to_num(const char *sec);
160 "23a:bcdD:g:I:iLlNo:PR:r:sTt:w:x:U")) != -1) in main()
169 printf("-a deprecated, use -o readahead=<value>\n"); in main()
170 build_iovec(&iov, &iovlen, "readahead", optarg, (size_t)-1); in main()
176 printf("-c deprecated, use -o noconn\n"); in main()
181 printf("-D deprecated, use -o deadthresh=<value>\n"); in main()
182 build_iovec(&iov, &iovlen, "deadthresh", optarg, (size_t)-1); in main()
185 printf("-d deprecated, use -o dumbtimer"); in main()
189 printf("-g deprecated, use -o maxgroups"); in main()
192 errx(1, "illegal -g value -- %s", optarg); in main()
194 build_iovec(&iov, &iovlen, "maxgroups", optarg, (size_t)-1); in main()
197 printf("-I deprecated, use -o readdirsize=<value>\n"); in main()
198 build_iovec(&iov, &iovlen, "readdirsize", optarg, (size_t)-1); in main()
201 printf("-i deprecated, use -o intr\n"); in main()
206 printf("-L deprecated, use -o nolockd\n"); in main()
210 printf("-l deprecated, -o rdirplus\n"); in main()
214 printf("-N deprecated, do not specify -o resvport\n"); in main()
241 /* same as not specifying -o bg */ in main()
268 mountmode = V4; in main()
306 "illegal proto value -- %s", in main()
309 } else if (strcmp(opt, "sec") == 0) { in main()
312 * the iovec yet - we will in main()
313 * negotiate which sec flavor in main()
321 "illegal sec value -- %s", in main()
328 errx(1, "illegal retrycnt value -- %s", val); in main()
333 errx(1, "illegal maxgroups value -- %s", val); in main()
338 errx(1, "illegal vers value -- " in main()
350 mountmode = V4; in main()
357 "value -- %s", val); in main()
367 errx(1, "illegal port num -- " in main()
382 /* obsolete for -o noresvport now default */ in main()
383 printf("-P deprecated, use -o noresvport\n"); in main()
387 printf("-R deprecated, use -o retrycnt=<retrycnt>\n"); in main()
390 errx(1, "illegal -R value -- %s", optarg); in main()
394 printf("-r deprecated, use -o rsize=<rsize>\n"); in main()
395 build_iovec(&iov, &iovlen, "rsize", optarg, (size_t)-1); in main()
398 printf("-s deprecated, use -o soft\n"); in main()
404 printf("-T deprecated, use -o tcp\n"); in main()
407 printf("-t deprecated, use -o timeout=<value>\n"); in main()
408 build_iovec(&iov, &iovlen, "timeout", optarg, (size_t)-1); in main()
411 printf("-w deprecated, use -o wsize=<value>\n"); in main()
412 build_iovec(&iov, &iovlen, "wsize", optarg, (size_t)-1); in main()
415 printf("-x deprecated, use -o retrans=<value>\n"); in main()
416 build_iovec(&iov, &iovlen, "retrans", optarg, (size_t)-1); in main()
419 printf("-U deprecated, use -o mntudp\n"); in main()
428 argc -= optind; in main()
440 if (mountmode == V4 && softintr) in main()
447 if (retrycnt == -1) in main()
480 build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); in main()
485 if (mountmode == V4 && nmount_errstr != NULL) in main()
490 } else if (mountmode != V4 && !add_mtab(host, spec)) { in main()
499 sec_name_to_num(const char *sec) in sec_name_to_num() argument
501 if (!strcmp(sec, "krb5")) in sec_name_to_num()
503 if (!strcmp(sec, "krb5i")) in sec_name_to_num()
505 if (!strcmp(sec, "krb5p")) in sec_name_to_num()
507 if (!strcmp(sec, "sys")) in sec_name_to_num()
509 return (-1); in sec_name_to_num()
533 rtm_ifinfo_sleep(time_t sec) in rtm_ifinfo_sleep() argument
546 for (tv.tv_sec = sec, tv.tv_usec = 0; in rtm_ifinfo_sleep()
549 tv.tv_sec = sec - (tv.tv_sec - start.tv_sec)) { in rtm_ifinfo_sleep()
555 if (n == -1) { in rtm_ifinfo_sleep()
568 if (ifm->ifm_version == RTM_VERSION && in rtm_ifinfo_sleep()
569 ifm->ifm_type == RTM_IFINFO && in rtm_ifinfo_sleep()
570 (ifm->ifm_flags & IFF_UP) && in rtm_ifinfo_sleep()
571 ifm->ifm_data.ifi_link_state != LINK_STATE_DOWN) in rtm_ifinfo_sleep()
605 warnx("no <host>:<dirpath> nfs-name"); in getnfsargs()
616 speclen > 1 && spec[speclen - 1] == '/'; in getnfsargs()
617 speclen--) in getnfsargs()
618 spec[speclen - 1] = '\0'; in getnfsargs()
682 ai_nfs->ai_canonname != NULL) { in getnfsargs()
684 ai_nfs->ai_canonname); in getnfsargs()
695 for (ai = ai_nfs; ai != NULL; ai = ai->ai_next) { in getnfsargs()
696 if ((ai->ai_family == AF_INET6) && in getnfsargs()
699 if ((ai->ai_family == AF_INET) && in getnfsargs()
722 if (retrycnt != 0 && --retrycnt == 0) in getnfsargs()
733 * If rtm_ifinfo_sleep() returns non-zero, don't count in getnfsargs()
741 build_iovec(iov, iovlen, "hostname", nam, (size_t)-1); in getnfsargs()
757 * In all error cases, *errstr will be set to a statically-allocated string
787 if ((netid = netidbytype(ai->ai_family, sotype)) == NULL) { in nfs_tryproto()
789 "af %d sotype %d not supported", ai->ai_family, sotype); in nfs_tryproto()
801 if ((netid_mnt = netidbytype(ai->ai_family, SOCK_DGRAM)) in nfs_tryproto()
805 ai->ai_family); in nfs_tryproto()
816 if (trymntmode == V4) { in nfs_tryproto()
829 nfs_nb.buf = ai->ai_addr; in nfs_tryproto()
830 nfs_nb.len = nfs_nb.maxlen = ai->ai_addrlen; in nfs_tryproto()
897 if (trymntmode == V4) { in nfs_tryproto()
911 build_iovec(iov, iovlen, "sec", in nfs_tryproto()
912 __DECONST(void *, secname), (size_t)-1); in nfs_tryproto()
915 build_iovec(iov, iovlen, "dirpath", spec, (size_t)-1); in nfs_tryproto()
939 switch (sad->sa_family) { in nfs_tryproto()
942 sin->sin_port = htons(mntproto_port); in nfs_tryproto()
946 sin6->sin6_port = htons(mntproto_port); in nfs_tryproto()
950 "Mnt port bad addr family %d\n", sad->sa_family); in nfs_tryproto()
966 clp->cl_auth = authsys_create_default(); in nfs_tryproto()
971 auth_destroy(clp->cl_auth); in nfs_tryproto()
1008 build_iovec(iov, iovlen, "sec", in nfs_tryproto()
1009 __DECONST(void *, secname), (size_t)-1); in nfs_tryproto()
1036 switch (rpcerr->re_errno) { in returncode()
1062 for (p = nc_protos; p->netid != NULL; p++) { in netidbytype()
1063 if (af != p->af || sotype != p->sotype) in netidbytype()
1065 return (p->netid); in netidbytype()
1087 for (p = head; p != NULL; p = p->next) in getnetconf_cached()
1088 if (strcmp(netid, p->nconf->nc_netid) == 0) in getnetconf_cached()
1089 return (p->nconf); in getnetconf_cached()
1095 p->nconf = nconf; in getnetconf_cached()
1096 p->next = head; in getnetconf_cached()
1099 return (p->nconf); in getnetconf_cached()
1117 if (!xdr_u_long(xdrsp, &np->stat)) in xdr_fh()
1119 if (np->stat) in xdr_fh()
1121 switch (np->vers) { in xdr_fh()
1123 np->fhsize = NFS_FHSIZE; in xdr_fh()
1124 return (xdr_opaque(xdrsp, (caddr_t)np->nfh, NFS_FHSIZE)); in xdr_fh()
1126 if (!xdr_long(xdrsp, &np->fhsize)) in xdr_fh()
1128 if (np->fhsize <= 0 || np->fhsize > NFS3_FHSIZE) in xdr_fh()
1130 if (!xdr_opaque(xdrsp, (caddr_t)np->nfh, np->fhsize)) in xdr_fh()
1137 if (np->auth == -1) { in xdr_fh()
1138 np->auth = auth; in xdr_fh()
1140 } else if (auth == np->auth) { in xdr_fh()
1148 if (authcnt == 0 && np->auth == -1) in xdr_fh()
1149 np->auth = AUTH_SYS; in xdr_fh()
1150 if (!authfnd && (authcnt > 0 || np->auth != AUTH_SYS)) in xdr_fh()
1151 np->stat = EAUTH; in xdr_fh()
1161 "usage: mount_nfs [-23bcdiLlNPsTU] [-a maxreadahead] [-D deadthresh]", in usage()
1162 " [-g maxgroups] [-I readdirsize] [-o options] [-R retrycnt]", in usage()
1163 " [-r readsize] [-t timeout] [-w writesize] [-x retrans]", in usage()