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
128 static int sec_name_to_num(const char *sec);
160 "23a:bcdD:g:I:iLlNo:PR:r:sTt:w:x:U")) != -1)
169 printf("-a deprecated, use -o readahead=<value>\n");
170 build_iovec(&iov, &iovlen, "readahead", optarg, (size_t)-1);
176 printf("-c deprecated, use -o noconn\n");
181 printf("-D deprecated, use -o deadthresh=<value>\n");
182 build_iovec(&iov, &iovlen, "deadthresh", optarg, (size_t)-1);
185 printf("-d deprecated, use -o dumbtimer");
189 printf("-g deprecated, use -o maxgroups");
192 errx(1, "illegal -g value -- %s", optarg);
194 build_iovec(&iov, &iovlen, "maxgroups", optarg, (size_t)-1);
197 printf("-I deprecated, use -o readdirsize=<value>\n");
198 build_iovec(&iov, &iovlen, "readdirsize", optarg, (size_t)-1);
201 printf("-i deprecated, use -o intr\n");
206 printf("-L deprecated, use -o nolockd\n");
210 printf("-l deprecated, -o rdirplus\n");
214 printf("-N deprecated, do not specify -o resvport\n");
241 /* same as not specifying -o bg */
268 mountmode = V4;
306 "illegal proto value -- %s",
309 } else if (strcmp(opt, "sec") == 0) {
312 * the iovec yet - we will
313 * negotiate which sec flavor
321 "illegal sec value -- %s",
328 errx(1, "illegal retrycnt value -- %s", val);
333 errx(1, "illegal maxgroups value -- %s", val);
338 errx(1, "illegal vers value -- "
350 mountmode = V4;
357 "value -- %s", val);
367 errx(1, "illegal port num -- "
382 /* obsolete for -o noresvport now default */
383 printf("-P deprecated, use -o noresvport\n");
387 printf("-R deprecated, use -o retrycnt=<retrycnt>\n");
390 errx(1, "illegal -R value -- %s", optarg);
394 printf("-r deprecated, use -o rsize=<rsize>\n");
395 build_iovec(&iov, &iovlen, "rsize", optarg, (size_t)-1);
398 printf("-s deprecated, use -o soft\n");
404 printf("-T deprecated, use -o tcp\n");
407 printf("-t deprecated, use -o timeout=<value>\n");
408 build_iovec(&iov, &iovlen, "timeout", optarg, (size_t)-1);
411 printf("-w deprecated, use -o wsize=<value>\n");
412 build_iovec(&iov, &iovlen, "wsize", optarg, (size_t)-1);
415 printf("-x deprecated, use -o retrans=<value>\n");
416 build_iovec(&iov, &iovlen, "retrans", optarg, (size_t)-1);
419 printf("-U deprecated, use -o mntudp\n");
428 argc -= optind;
440 if (mountmode == V4 && softintr)
447 if (retrycnt == -1)
480 build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
485 if (mountmode == V4 && nmount_errstr != NULL)
490 } else if (mountmode != V4 && !add_mtab(host, spec)) {
499 sec_name_to_num(const char *sec)
501 if (!strcmp(sec, "krb5"))
503 if (!strcmp(sec, "krb5i"))
505 if (!strcmp(sec, "krb5p"))
507 if (!strcmp(sec, "sys"))
509 return (-1);
533 rtm_ifinfo_sleep(time_t sec)
546 for (tv.tv_sec = sec, tv.tv_usec = 0;
549 tv.tv_sec = sec - (tv.tv_sec - start.tv_sec)) {
555 if (n == -1) {
568 if (ifm->ifm_version == RTM_VERSION &&
569 ifm->ifm_type == RTM_IFINFO &&
570 (ifm->ifm_flags & IFF_UP) &&
571 ifm->ifm_data.ifi_link_state != LINK_STATE_DOWN)
604 warnx("no <host>:<dirpath> nfs-name");
615 speclen > 1 && spec[speclen - 1] == '/';
616 speclen--)
617 spec[speclen - 1] = '\0';
663 ai_nfs->ai_canonname != NULL) {
665 ai_nfs->ai_canonname);
686 for (ai = ai_nfs; ai != NULL; ai = ai->ai_next) {
687 if ((ai->ai_family == AF_INET6) &&
690 if ((ai->ai_family == AF_INET) &&
713 if (retrycnt != 0 && --retrycnt == 0)
724 * If rtm_ifinfo_sleep() returns non-zero, don't count
732 build_iovec(iov, iovlen, "hostname", nam, (size_t)-1);
748 * In all error cases, *errstr will be set to a statically-allocated string
778 if ((netid = netidbytype(ai->ai_family, sotype)) == NULL) {
780 "af %d sotype %d not supported", ai->ai_family, sotype);
792 if ((netid_mnt = netidbytype(ai->ai_family, SOCK_DGRAM))
796 ai->ai_family);
807 if (trymntmode == V4) {
820 nfs_nb.buf = ai->ai_addr;
821 nfs_nb.len = nfs_nb.maxlen = ai->ai_addrlen;
888 if (trymntmode == V4) {
902 build_iovec(iov, iovlen, "sec",
903 __DECONST(void *, secname), (size_t)-1);
906 build_iovec(iov, iovlen, "dirpath", spec, (size_t)-1);
930 switch (sad->sa_family) {
933 sin->sin_port = htons(mntproto_port);
937 sin6->sin6_port = htons(mntproto_port);
941 "Mnt port bad addr family %d\n", sad->sa_family);
957 clp->cl_auth = authsys_create_default();
962 auth_destroy(clp->cl_auth);
999 build_iovec(iov, iovlen, "sec",
1000 __DECONST(void *, secname), (size_t)-1);
1027 switch (rpcerr->re_errno) {
1053 for (p = nc_protos; p->netid != NULL; p++) {
1054 if (af != p->af || sotype != p->sotype)
1056 return (p->netid);
1078 for (p = head; p != NULL; p = p->next)
1079 if (strcmp(netid, p->nconf->nc_netid) == 0)
1080 return (p->nconf);
1086 p->nconf = nconf;
1087 p->next = head;
1090 return (p->nconf);
1108 if (!xdr_u_long(xdrsp, &np->stat))
1110 if (np->stat)
1112 switch (np->vers) {
1114 np->fhsize = NFS_FHSIZE;
1115 return (xdr_opaque(xdrsp, (caddr_t)np->nfh, NFS_FHSIZE));
1117 if (!xdr_long(xdrsp, &np->fhsize))
1119 if (np->fhsize <= 0 || np->fhsize > NFS3_FHSIZE)
1121 if (!xdr_opaque(xdrsp, (caddr_t)np->nfh, np->fhsize))
1128 if (np->auth == -1) {
1129 np->auth = auth;
1131 } else if (auth == np->auth) {
1139 if (authcnt == 0 && np->auth == -1)
1140 np->auth = AUTH_SYS;
1141 if (!authfnd && (authcnt > 0 || np->auth != AUTH_SYS))
1142 np->stat = EAUTH;
1152 "usage: mount_nfs [-23bcdiLlNPsTU] [-a maxreadahead] [-D deadthresh]",
1153 " [-g maxgroups] [-I readdirsize] [-o options] [-R retrycnt]",
1154 " [-r readsize] [-t timeout] [-w writesize] [-x retrans]",