Deleted Added
full compact
nfsargs.h (60833) nfsargs.h (60938)
1/*
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs.h 8.4 (Berkeley) 5/1/95
1/*
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfs.h 8.4 (Berkeley) 5/1/95
37 * $FreeBSD: head/sys/nfsclient/nfsargs.h 60833 2000-05-23 20:41:01Z jake $
37 * $FreeBSD: head/sys/nfsclient/nfsargs.h 60938 2000-05-26 02:09:24Z jake $
38 */
39
40#ifndef _NFS_NFS_H_
41#define _NFS_NFS_H_
42
43#ifdef _KERNEL
44#include "opt_nfs.h"
45#endif

--- 282 unchanged lines hidden (view full) ---

328#define NFSIGNORE_SOERROR(s, e) \
329 ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
330 ((s) & PR_CONNREQUIRED) == 0)
331
332/*
333 * Nfs outstanding request list element
334 */
335struct nfsreq {
38 */
39
40#ifndef _NFS_NFS_H_
41#define _NFS_NFS_H_
42
43#ifdef _KERNEL
44#include "opt_nfs.h"
45#endif

--- 282 unchanged lines hidden (view full) ---

328#define NFSIGNORE_SOERROR(s, e) \
329 ((e) != EINTR && (e) != ERESTART && (e) != EWOULDBLOCK && \
330 ((s) & PR_CONNREQUIRED) == 0)
331
332/*
333 * Nfs outstanding request list element
334 */
335struct nfsreq {
336 TAILQ_ENTRY(struct nfsreq) r_chain;
336 TAILQ_ENTRY(nfsreq) r_chain;
337 struct mbuf *r_mreq;
338 struct mbuf *r_mrep;
339 struct mbuf *r_md;
340 caddr_t r_dpos;
341 struct nfsmount *r_nmp;
342 struct vnode *r_vp;
343 u_int32_t r_xid;
344 int r_flags; /* flags on request, see below */
345 int r_retry; /* max retransmission count */
346 int r_rexmit; /* current retrans count */
347 int r_timer; /* tick counter on reply */
348 u_int32_t r_procnum; /* NFS procedure number */
349 int r_rtt; /* RTT for rpc */
350 struct proc *r_procp; /* Proc that did I/O system call */
351};
352
353/*
354 * Queue head for nfsreq's
355 */
337 struct mbuf *r_mreq;
338 struct mbuf *r_mrep;
339 struct mbuf *r_md;
340 caddr_t r_dpos;
341 struct nfsmount *r_nmp;
342 struct vnode *r_vp;
343 u_int32_t r_xid;
344 int r_flags; /* flags on request, see below */
345 int r_retry; /* max retransmission count */
346 int r_rexmit; /* current retrans count */
347 int r_timer; /* tick counter on reply */
348 u_int32_t r_procnum; /* NFS procedure number */
349 int r_rtt; /* RTT for rpc */
350 struct proc *r_procp; /* Proc that did I/O system call */
351};
352
353/*
354 * Queue head for nfsreq's
355 */
356extern TAILQ_HEAD(nfs_reqq, struct nfsreq) nfs_reqq;
356extern TAILQ_HEAD(nfs_reqq, nfsreq) nfs_reqq;
357
358/* Flag values for r_flags */
359#define R_TIMING 0x01 /* timing request (in mntp) */
360#define R_SENT 0x02 /* request has been sent */
361#define R_SOFTTERM 0x04 /* soft mnt, too many retries */
362#define R_INTR 0x08 /* intr mnt, signal pending */
363#define R_SOCKERR 0x10 /* Fatal error on socket */
364#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */

--- 28 unchanged lines hidden (view full) ---

393 * Network address hash list element
394 */
395union nethostaddr {
396 u_int32_t had_inetaddr;
397 struct sockaddr *had_nam;
398};
399
400struct nfsuid {
357
358/* Flag values for r_flags */
359#define R_TIMING 0x01 /* timing request (in mntp) */
360#define R_SENT 0x02 /* request has been sent */
361#define R_SOFTTERM 0x04 /* soft mnt, too many retries */
362#define R_INTR 0x08 /* intr mnt, signal pending */
363#define R_SOCKERR 0x10 /* Fatal error on socket */
364#define R_TPRINTFMSG 0x20 /* Did a tprintf msg. */

--- 28 unchanged lines hidden (view full) ---

393 * Network address hash list element
394 */
395union nethostaddr {
396 u_int32_t had_inetaddr;
397 struct sockaddr *had_nam;
398};
399
400struct nfsuid {
401 TAILQ_ENTRY(struct nfsuid) nu_lru; /* LRU chain */
402 LIST_ENTRY(struct nfsuid) nu_hash; /* Hash list */
401 TAILQ_ENTRY(nfsuid) nu_lru; /* LRU chain */
402 LIST_ENTRY(nfsuid) nu_hash; /* Hash list */
403 int nu_flag; /* Flags */
404 union nethostaddr nu_haddr; /* Host addr. for dgram sockets */
405 struct ucred nu_cr; /* Cred uid mapped to */
406 int nu_expire; /* Expiry time (sec) */
407 struct timeval nu_timestamp; /* Kerb. timestamp */
408 u_int32_t nu_nickname; /* Nickname on server */
409 NFSKERBKEY_T nu_key; /* and session key */
410};
411
412#define nu_inetaddr nu_haddr.had_inetaddr
413#define nu_nam nu_haddr.had_nam
414/* Bits for nu_flag */
415#define NU_INETADDR 0x1
416#define NU_NAM 0x2
417#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
418
419struct nfsrv_rec {
403 int nu_flag; /* Flags */
404 union nethostaddr nu_haddr; /* Host addr. for dgram sockets */
405 struct ucred nu_cr; /* Cred uid mapped to */
406 int nu_expire; /* Expiry time (sec) */
407 struct timeval nu_timestamp; /* Kerb. timestamp */
408 u_int32_t nu_nickname; /* Nickname on server */
409 NFSKERBKEY_T nu_key; /* and session key */
410};
411
412#define nu_inetaddr nu_haddr.had_inetaddr
413#define nu_nam nu_haddr.had_nam
414/* Bits for nu_flag */
415#define NU_INETADDR 0x1
416#define NU_NAM 0x2
417#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
418
419struct nfsrv_rec {
420 STAILQ_ENTRY(struct nfsrv_rec) nr_link;
420 STAILQ_ENTRY(nfsrv_rec) nr_link;
421 struct sockaddr *nr_address;
422 struct mbuf *nr_packet;
423};
424
425struct nfssvc_sock {
421 struct sockaddr *nr_address;
422 struct mbuf *nr_packet;
423};
424
425struct nfssvc_sock {
426 TAILQ_ENTRY(struct nfssvc_sock) ns_chain;/* List of all nfssvc_sock's */
427 TAILQ_HEAD(, struct nfsuid) ns_uidlruhead;
426 TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */
427 TAILQ_HEAD(, nfsuid) ns_uidlruhead;
428 struct file *ns_fp;
429 struct socket *ns_so;
430 struct sockaddr *ns_nam;
431 struct mbuf *ns_raw;
432 struct mbuf *ns_rawend;
428 struct file *ns_fp;
429 struct socket *ns_so;
430 struct sockaddr *ns_nam;
431 struct mbuf *ns_raw;
432 struct mbuf *ns_rawend;
433 STAILQ_HEAD(, struct nfsrv_rec) ns_rec;
433 STAILQ_HEAD(, nfsrv_rec) ns_rec;
434 struct mbuf *ns_frag;
435 int ns_flag;
436 int ns_solock;
437 int ns_cc;
438 int ns_reclen;
439 int ns_numuids;
440 u_int32_t ns_sref;
434 struct mbuf *ns_frag;
435 int ns_flag;
436 int ns_solock;
437 int ns_cc;
438 int ns_reclen;
439 int ns_numuids;
440 u_int32_t ns_sref;
441 LIST_HEAD(, struct nfsrv_descript) ns_tq; /* Write gather lists */
442 LIST_HEAD(, struct nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
443 LIST_HEAD(nfsrvw_delayhash, struct nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
441 LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
442 LIST_HEAD(, nfsuid) ns_uidhashtbl[NFS_UIDHASHSIZ];
443 LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
444};
445
446/* Bits for "ns_flag" */
447#define SLP_VALID 0x01
448#define SLP_DOREC 0x02
449#define SLP_NEEDQ 0x04
450#define SLP_DISCONN 0x08
451#define SLP_GETSTREAM 0x10
452#define SLP_LASTFRAG 0x20
453#define SLP_ALLFLAGS 0xff
454
444};
445
446/* Bits for "ns_flag" */
447#define SLP_VALID 0x01
448#define SLP_DOREC 0x02
449#define SLP_NEEDQ 0x04
450#define SLP_DISCONN 0x08
451#define SLP_GETSTREAM 0x10
452#define SLP_LASTFRAG 0x20
453#define SLP_ALLFLAGS 0xff
454
455extern TAILQ_HEAD(nfssvc_sockhead, struct nfssvc_sock) nfssvc_sockhead;
455extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead;
456extern int nfssvc_sockhead_flag;
457#define SLP_INIT 0x01
458#define SLP_WANTINIT 0x02
459
460/*
461 * One of these structures is allocated for each nfsd.
462 */
463struct nfsd {
456extern int nfssvc_sockhead_flag;
457#define SLP_INIT 0x01
458#define SLP_WANTINIT 0x02
459
460/*
461 * One of these structures is allocated for each nfsd.
462 */
463struct nfsd {
464 TAILQ_ENTRY(struct nfsd) nfsd_chain; /* List of all nfsd's */
464 TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */
465 int nfsd_flag; /* NFSD_ flags */
466 struct nfssvc_sock *nfsd_slp; /* Current socket */
467 int nfsd_authlen; /* Authenticator len */
468 u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
469 int nfsd_verflen; /* and the Verifier */
470 u_char nfsd_verfstr[RPCVERF_MAXSIZ];
471 struct proc *nfsd_procp; /* Proc ptr */
472 struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */

--- 8 unchanged lines hidden (view full) ---

481/*
482 * This structure is used by the server for describing each request.
483 * Some fields are used only when write request gathering is performed.
484 */
485struct nfsrv_descript {
486 u_quad_t nd_time; /* Write deadline (usec) */
487 off_t nd_off; /* Start byte offset */
488 off_t nd_eoff; /* and end byte offset */
465 int nfsd_flag; /* NFSD_ flags */
466 struct nfssvc_sock *nfsd_slp; /* Current socket */
467 int nfsd_authlen; /* Authenticator len */
468 u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
469 int nfsd_verflen; /* and the Verifier */
470 u_char nfsd_verfstr[RPCVERF_MAXSIZ];
471 struct proc *nfsd_procp; /* Proc ptr */
472 struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */

--- 8 unchanged lines hidden (view full) ---

481/*
482 * This structure is used by the server for describing each request.
483 * Some fields are used only when write request gathering is performed.
484 */
485struct nfsrv_descript {
486 u_quad_t nd_time; /* Write deadline (usec) */
487 off_t nd_off; /* Start byte offset */
488 off_t nd_eoff; /* and end byte offset */
489 LIST_ENTRY(struct nfsrv_descript) nd_hash; /* Hash list */
490 LIST_ENTRY(struct nfsrv_descript) nd_tq; /* and timer list */
491 LIST_HEAD(, struct nfsrv_descript) nd_coalesce; /* coalesced writes */
489 LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */
490 LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */
491 LIST_HEAD(,nfsrv_descript) nd_coalesce; /* coalesced writes */
492 struct mbuf *nd_mrep; /* Request mbuf list */
493 struct mbuf *nd_md; /* Current dissect mbuf */
494 struct mbuf *nd_mreq; /* Reply mbuf list */
495 struct sockaddr *nd_nam; /* and socket addr */
496 struct sockaddr *nd_nam2; /* return socket addr */
497 caddr_t nd_dpos; /* Current dissect pos */
498 u_int32_t nd_procnum; /* RPC # */
499 int nd_stable; /* storage type */

--- 13 unchanged lines hidden (view full) ---

513#define ND_CHECK 0x04
514#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
515#define ND_NFSV3 0x08
516#define ND_NQNFS 0x10
517#define ND_KERBNICK 0x20
518#define ND_KERBFULL 0x40
519#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
520
492 struct mbuf *nd_mrep; /* Request mbuf list */
493 struct mbuf *nd_md; /* Current dissect mbuf */
494 struct mbuf *nd_mreq; /* Reply mbuf list */
495 struct sockaddr *nd_nam; /* and socket addr */
496 struct sockaddr *nd_nam2; /* return socket addr */
497 caddr_t nd_dpos; /* Current dissect pos */
498 u_int32_t nd_procnum; /* RPC # */
499 int nd_stable; /* storage type */

--- 13 unchanged lines hidden (view full) ---

513#define ND_CHECK 0x04
514#define ND_LEASE (ND_READ | ND_WRITE | ND_CHECK)
515#define ND_NFSV3 0x08
516#define ND_NQNFS 0x10
517#define ND_KERBNICK 0x20
518#define ND_KERBFULL 0x40
519#define ND_KERBAUTH (ND_KERBNICK | ND_KERBFULL)
520
521extern TAILQ_HEAD(nfsd_head, struct nfsd) nfsd_head;
521extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
522extern int nfsd_head_flag;
523#define NFSD_CHECKSLP 0x01
524
525/*
526 * These macros compare nfsrv_descript structures.
527 */
528#define NFSW_CONTIG(o, n) \
529 ((o)->nd_eoff >= (n)->nd_off && \

--- 198 unchanged lines hidden ---
522extern int nfsd_head_flag;
523#define NFSD_CHECKSLP 0x01
524
525/*
526 * These macros compare nfsrv_descript structures.
527 */
528#define NFSW_CONTIG(o, n) \
529 ((o)->nd_eoff >= (n)->nd_off && \

--- 198 unchanged lines hidden ---