nfsrvcache.h revision 2175
11541Srgrimes/*
21541Srgrimes * Copyright (c) 1989, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * This code is derived from software contributed to Berkeley by
61541Srgrimes * Rick Macklem at The University of Guelph.
71541Srgrimes *
81541Srgrimes * Redistribution and use in source and binary forms, with or without
91541Srgrimes * modification, are permitted provided that the following conditions
101541Srgrimes * are met:
111541Srgrimes * 1. Redistributions of source code must retain the above copyright
121541Srgrimes *    notice, this list of conditions and the following disclaimer.
131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer in the
151541Srgrimes *    documentation and/or other materials provided with the distribution.
161541Srgrimes * 3. All advertising materials mentioning features or use of this software
171541Srgrimes *    must display the following acknowledgement:
181541Srgrimes *	This product includes software developed by the University of
191541Srgrimes *	California, Berkeley and its contributors.
201541Srgrimes * 4. Neither the name of the University nor the names of its contributors
211541Srgrimes *    may be used to endorse or promote products derived from this software
221541Srgrimes *    without specific prior written permission.
231541Srgrimes *
241541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
251541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
261541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
271541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
281541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
291541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
301541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
311541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
321541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
331541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
341541Srgrimes * SUCH DAMAGE.
351541Srgrimes *
361541Srgrimes *	@(#)nfsrvcache.h	8.1 (Berkeley) 6/10/93
372175Spaul * $Id: nfsrvcache.h,v 1.2 1994/08/02 07:52:25 davidg Exp $
381541Srgrimes */
391541Srgrimes
402175Spaul#ifndef _NFS_NFSRVCACHE_H_
412175Spaul#define _NFS_NFSRVCACHE_H_
422175Spaul
431541Srgrimes/*
441541Srgrimes * Definitions for the server recent request cache
451541Srgrimes */
461541Srgrimes
471541Srgrimes#define	NFSRVCACHESIZ	256
481541Srgrimes
491541Srgrimesstruct nfsrvcache {
501541Srgrimes	struct	nfsrvcache *rc_forw;		/* Hash chain links */
511541Srgrimes	struct	nfsrvcache **rc_back;		/* Hash chain links */
521541Srgrimes	struct	nfsrvcache *rc_next;		/* Lru list */
531541Srgrimes	struct	nfsrvcache **rc_prev;		/* Lru list */
541541Srgrimes	u_long	rc_xid;				/* rpc id number */
551541Srgrimes	union {
561541Srgrimes		struct mbuf *ru_repmb;		/* Reply mbuf list OR */
571541Srgrimes		int ru_repstat;			/* Reply status */
581541Srgrimes	} rc_un;
591541Srgrimes	union nethostaddr rc_haddr;		/* Host address */
601541Srgrimes	short	rc_proc;			/* rpc proc number */
611541Srgrimes	u_char	rc_state;		/* Current state of request */
621541Srgrimes	u_char	rc_flag;		/* Flag bits */
631541Srgrimes};
641541Srgrimes
651541Srgrimes#define	rc_reply	rc_un.ru_repmb
661541Srgrimes#define	rc_status	rc_un.ru_repstat
671541Srgrimes#define	rc_inetaddr	rc_haddr.had_inetaddr
681541Srgrimes#define	rc_nam		rc_haddr.had_nam
691541Srgrimes
701541Srgrimes/* Cache entry states */
711541Srgrimes#define	RC_UNUSED	0
721541Srgrimes#define	RC_INPROG	1
731541Srgrimes#define	RC_DONE		2
741541Srgrimes
751541Srgrimes/* Return values */
761541Srgrimes#define	RC_DROPIT	0
771541Srgrimes#define	RC_REPLY	1
781541Srgrimes#define	RC_DOIT		2
791541Srgrimes#define	RC_CHECKIT	3
801541Srgrimes
811541Srgrimes/* Flag bits */
821541Srgrimes#define	RC_LOCKED	0x01
831541Srgrimes#define	RC_WANTED	0x02
841541Srgrimes#define	RC_REPSTATUS	0x04
851541Srgrimes#define	RC_REPMBUF	0x08
861541Srgrimes#define	RC_NQNFS	0x10
871541Srgrimes#define	RC_INETADDR	0x20
881541Srgrimes#define	RC_NAM		0x40
892175Spaul
902175Spaul#endif
91