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