xref: /original-bsd/sys/nfs/nfsrvcache.h (revision 3dd635ca)
1 /*
2  * Copyright (c) 1989, 1993
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  * %sccs.include.redist.c%
9  *
10  *	@(#)nfsrvcache.h	8.3 (Berkeley) 03/30/95
11  */
12 
13 
14 #ifndef _NFS_NFSRVCACHE_H_
15 #define _NFS_NFSRVCACHE_H_
16 
17 /*
18  * Definitions for the server recent request cache
19  */
20 
21 #define	NFSRVCACHESIZ	64
22 
23 struct nfsrvcache {
24 	TAILQ_ENTRY(nfsrvcache) rc_lru;		/* LRU chain */
25 	LIST_ENTRY(nfsrvcache) rc_hash;		/* Hash chain */
26 	u_long	rc_xid;				/* rpc id number */
27 	union {
28 		struct mbuf *ru_repmb;		/* Reply mbuf list OR */
29 		int ru_repstat;			/* Reply status */
30 	} rc_un;
31 	union nethostaddr rc_haddr;		/* Host address */
32 	short	rc_proc;			/* rpc proc number */
33 	u_char	rc_state;		/* Current state of request */
34 	u_char	rc_flag;		/* Flag bits */
35 };
36 
37 #define	rc_reply	rc_un.ru_repmb
38 #define	rc_status	rc_un.ru_repstat
39 #define	rc_inetaddr	rc_haddr.had_inetaddr
40 #define	rc_nam		rc_haddr.had_nam
41 
42 /* Cache entry states */
43 #define	RC_UNUSED	0
44 #define	RC_INPROG	1
45 #define	RC_DONE		2
46 
47 /* Return values */
48 #define	RC_DROPIT	0
49 #define	RC_REPLY	1
50 #define	RC_DOIT		2
51 #define	RC_CHECKIT	3
52 
53 /* Flag bits */
54 #define	RC_LOCKED	0x01
55 #define	RC_WANTED	0x02
56 #define	RC_REPSTATUS	0x04
57 #define	RC_REPMBUF	0x08
58 #define	RC_NQNFS	0x10
59 #define	RC_INETADDR	0x20
60 #define	RC_NAM		0x40
61 
62 #endif
63