Lines Matching +full:2 +full:nd

15  * 2. Redistributions in binary form must reproduce the above copyright
56 * Mapping of old NFS Version 2 RPC numbers to generic numbers.
126 struct nfsrv_descript nd; in nfssvc_program() local
136 memset(&nd, 0, sizeof(nd)); in nfssvc_program()
144 nd.nd_procnum = newnfs_nfsv3_procid[rqst->rq_proc]; in nfssvc_program()
145 nd.nd_flag = ND_NFSV2; in nfssvc_program()
152 nd.nd_procnum = rqst->rq_proc; in nfssvc_program()
153 nd.nd_flag = ND_NFSV3; in nfssvc_program()
161 nd.nd_procnum = rqst->rq_proc; in nfssvc_program()
162 nd.nd_flag = ND_NFSV4; in nfssvc_program()
170 nd.nd_mrep = rqst->rq_args; in nfssvc_program()
172 newnfs_realign(&nd.nd_mrep, M_WAITOK); in nfssvc_program()
173 nd.nd_md = nd.nd_mrep; in nfssvc_program()
174 nd.nd_dpos = mtod(nd.nd_md, caddr_t); in nfssvc_program()
175 nd.nd_nam = svc_getrpccaller(rqst); in nfssvc_program()
176 nd.nd_nam2 = rqst->rq_addr; in nfssvc_program()
177 nd.nd_mreq = NULL; in nfssvc_program()
178 nd.nd_cred = NULL; in nfssvc_program()
183 struct sockaddr *nam = nd.nd_nam; in nfssvc_program()
193 nd.nd_procnum != NFSPROC_NULL) { in nfssvc_program()
211 (a)->s6_addr16[2], (a)->s6_addr16[3], \ in nfssvc_program()
232 m_freem(nd.nd_mrep); in nfssvc_program()
237 if (nd.nd_procnum != NFSPROC_NULL) { in nfssvc_program()
238 if (!svc_getcred(rqst, &nd.nd_cred, &credflavor)) { in nfssvc_program()
241 m_freem(nd.nd_mrep); in nfssvc_program()
247 nd.nd_flag |= ND_GSS; in nfssvc_program()
249 nd.nd_flag |= (ND_GSS | ND_GSSINTEGRITY); in nfssvc_program()
251 nd.nd_flag |= (ND_GSS | ND_GSSPRIVACY); in nfssvc_program()
255 m_freem(nd.nd_mrep); in nfssvc_program()
260 if ((nd.nd_flag & (ND_NFSV4 | ND_GSS)) == (ND_NFSV4 | ND_GSS)) { in nfssvc_program()
266 * - 2 byte mech length in nfssvc_program()
280 p = &rcredp->client_principal->name[2]; in nfssvc_program()
282 p += i + 2; in nfssvc_program()
292 (p[2] << 8) | p[3]; in nfssvc_program()
297 nd.nd_principal = malloc(j + 1, M_TEMP, in nfssvc_program()
299 nd.nd_princlen = j; in nfssvc_program()
300 memcpy(nd.nd_principal, p, j); in nfssvc_program()
301 nd.nd_principal[j] = '\0'; in nfssvc_program()
303 "principal=%s\n", nd.nd_principal); in nfssvc_program()
306 if (nd.nd_princlen == 0) in nfssvc_program()
312 nd.nd_flag |= ND_TLS; in nfssvc_program()
314 nd.nd_flag |= ND_TLSCERT; in nfssvc_program()
316 nd.nd_flag |= ND_TLSCERTUSER; in nfssvc_program()
318 nd.nd_maxextsiz = 16384; in nfssvc_program()
320 mac_cred_associate_nfsd(nd.nd_cred); in nfssvc_program()
340 if ((nd.nd_flag & ND_NFSV4) != 0) { in nfssvc_program()
341 nd.nd_repstat = nfsvno_v4rootexport(&nd); in nfssvc_program()
342 if (nd.nd_repstat != 0) { in nfssvc_program()
348 m_freem(nd.nd_mrep); in nfssvc_program()
356 nd.nd_maxextsiz = maxlen; in nfssvc_program()
358 cacherep = nfs_proc(&nd, rqst->rq_xid, xprt, &rp); in nfssvc_program()
363 NFSMGET(nd.nd_mreq); in nfssvc_program()
364 nd.nd_mreq->m_len = 0; in nfssvc_program()
367 if (nd.nd_mrep != NULL) in nfssvc_program()
368 m_freem(nd.nd_mrep); in nfssvc_program()
370 if (nd.nd_cred != NULL) in nfssvc_program()
371 crfree(nd.nd_cred); in nfssvc_program()
374 if (nd.nd_mreq != NULL) in nfssvc_program()
375 m_freem(nd.nd_mreq); in nfssvc_program()
380 if (nd.nd_mreq == NULL) { in nfssvc_program()
386 if (nd.nd_repstat & NFSERR_AUTHERR) { in nfssvc_program()
387 svcerr_auth(rqst, nd.nd_repstat & ~NFSERR_AUTHERR); in nfssvc_program()
388 if (nd.nd_mreq != NULL) in nfssvc_program()
389 m_freem(nd.nd_mreq); in nfssvc_program()
390 } else if (!svc_sendreply_mbuf(rqst, nd.nd_mreq)) { in nfssvc_program()
400 free(nd.nd_principal, M_TEMP); in nfssvc_program()
411 nfs_proc(struct nfsrv_descript *nd, u_int32_t xid, SVCXPRT *xprt, in nfs_proc() argument
421 if (nd->nd_nam2 == NULL) { in nfs_proc()
422 nd->nd_flag |= ND_STREAMSOCK; in nfs_proc()
434 * 2 - nd_repstat == 0 && nd_mreq == NULL, which in nfs_proc()
437 if ((nd->nd_flag & ND_NFSV2) && nd->nd_nam2 != NULL && in nfs_proc()
445 if ((nd->nd_flag & (ND_NFSV4 | ND_STREAMSOCK)) == in nfs_proc()
447 nd->nd_flag |= ND_SAMETCPCONN; in nfs_proc()
448 nd->nd_retxid = xid; in nfs_proc()
449 nd->nd_tcpconntime = NFSD_MONOSEC; in nfs_proc()
450 nd->nd_sockref = xprt->xp_sockref; in nfs_proc()
451 if ((nd->nd_flag & ND_NFSV4) != 0) in nfs_proc()
452 nfsd_getminorvers(nd, tag, &tagstr, &taglen, in nfs_proc()
454 if ((nd->nd_flag & ND_NFSV41) != 0) in nfs_proc()
458 cacherep = nfsrvd_getcache(nd); in nfs_proc()
472 if ((nd->nd_flag & ND_NFSV41) != 0) in nfs_proc()
473 nd->nd_xprt = xprt; in nfs_proc()
474 nfsrvd_dorpc(nd, isdgram, tagstr, taglen, minorvers); in nfs_proc()
475 if ((nd->nd_flag & ND_NFSV41) != 0) { in nfs_proc()
476 if (nd->nd_repstat != NFSERR_REPLYFROMCACHE && in nfs_proc()
477 (nd->nd_flag & ND_SAVEREPLY) != 0) { in nfs_proc()
479 m = m_copym(nd->nd_mreq, 0, M_COPYALL, in nfs_proc()
483 if ((nd->nd_flag & ND_HASSEQUENCE) != 0) in nfs_proc()
484 nfsrv_cache_session(nd, &m); in nfs_proc()
485 if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) { in nfs_proc()
486 nd->nd_repstat = 0; in nfs_proc()
488 m_freem(nd->nd_mreq); in nfs_proc()
489 nd->nd_mreq = m; in nfs_proc()
494 if (nd->nd_repstat == NFSERR_DONTREPLY) in nfs_proc()
498 *rpp = nfsrvd_updatecache(nd); in nfs_proc()
504 NFSEXITCODE2(0, nd); in nfs_proc()