1994-05-24 10:09:53 +00:00
|
|
|
/*
|
1997-02-10 02:22:35 +00:00
|
|
|
* Copyright (c) 1989, 1993, 1995
|
1994-05-24 10:09:53 +00:00
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Rick Macklem at The University of Guelph.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1997-02-10 02:22:35 +00:00
|
|
|
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
1994-05-24 10:09:53 +00:00
|
|
|
*/
|
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
#ifndef _NFSSERVER_NFS_H_
|
|
|
|
#define _NFSSERVER_NFS_H_
|
1994-08-21 06:50:16 +00:00
|
|
|
|
1999-12-29 05:07:58 +00:00
|
|
|
#ifdef _KERNEL
|
1998-06-30 03:01:37 +00:00
|
|
|
#include "opt_nfs.h"
|
1998-06-30 11:19:22 +00:00
|
|
|
#endif
|
1998-06-30 03:01:37 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
/*
|
|
|
|
* Tunable constants for nfs
|
|
|
|
*/
|
|
|
|
|
1995-06-27 11:07:30 +00:00
|
|
|
#define NFS_TICKINTVL 5 /* Desired time for a tick (msec) */
|
|
|
|
#define NFS_HZ (hz / nfs_ticks) /* Ticks/sec */
|
|
|
|
#define NFS_TIMEO (1 * NFS_HZ) /* Default timeout = 1 second */
|
|
|
|
#define NFS_MINTIMEO (1 * NFS_HZ) /* Min timeout to use */
|
|
|
|
#define NFS_MAXTIMEO (60 * NFS_HZ) /* Max timeout to backoff to */
|
|
|
|
#define NFS_MINIDEMTIMEO (5 * NFS_HZ) /* Min timeout for non-idempotent ops*/
|
1994-05-24 10:09:53 +00:00
|
|
|
#define NFS_MAXUIDHASH 64 /* Max. # of hashed uid entries/mp */
|
1995-06-27 11:07:30 +00:00
|
|
|
#ifndef NFS_GATHERDELAY
|
|
|
|
#define NFS_GATHERDELAY 10 /* Default write gather delay (msec) */
|
|
|
|
#endif
|
1999-12-29 05:07:58 +00:00
|
|
|
#ifdef _KERNEL
|
1997-03-29 12:34:33 +00:00
|
|
|
#define DIRBLKSIZ 512 /* XXX we used to use ufs's DIRBLKSIZ */
|
|
|
|
#endif
|
1995-06-27 11:07:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Oddballs
|
|
|
|
*/
|
|
|
|
#define NFS_SRVMAXDATA(n) \
|
|
|
|
(((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
|
|
|
|
NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX
|
|
|
|
* The B_INVAFTERWRITE flag should be set to whatever is required by the
|
|
|
|
* buffer cache code to say "Invalidate the block after it is written back".
|
|
|
|
*/
|
|
|
|
#define B_INVAFTERWRITE B_NOCACHE
|
|
|
|
|
|
|
|
/*
|
2002-05-16 21:28:32 +00:00
|
|
|
* The IO_METASYNC flag should be implemented for local filesystems.
|
1995-06-27 11:07:30 +00:00
|
|
|
* (Until then, it is nothin at all.)
|
|
|
|
*/
|
|
|
|
#ifndef IO_METASYNC
|
|
|
|
#define IO_METASYNC 0
|
|
|
|
#endif
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
/* NFS state flags XXX -Wunused */
|
|
|
|
#define NFSRV_SNDLOCK 0x01000000 /* Send socket lock */
|
|
|
|
#define NFSRV_WANTSND 0x02000000 /* Want above */
|
1997-02-10 02:22:35 +00:00
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
/*
|
|
|
|
* Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs
|
|
|
|
* should ever try and use it.
|
|
|
|
*/
|
|
|
|
struct nfsd_args {
|
|
|
|
int sock; /* Socket to serve */
|
1997-02-10 02:22:35 +00:00
|
|
|
caddr_t name; /* Client addr for connection based sockets */
|
1994-05-24 10:09:53 +00:00
|
|
|
int namelen; /* Length of name */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nfsd_srvargs {
|
|
|
|
struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
|
|
|
|
uid_t nsd_uid; /* Effective uid mapped to cred */
|
1998-05-31 20:09:01 +00:00
|
|
|
u_int32_t nsd_haddr; /* Ip address of client */
|
2001-02-18 13:30:20 +00:00
|
|
|
struct xucred nsd_cr; /* Cred. uid maps to */
|
2001-09-10 11:28:07 +00:00
|
|
|
u_int nsd_authlen; /* Length of auth string (ret) */
|
1995-06-27 11:07:30 +00:00
|
|
|
u_char *nsd_authstr; /* Auth string (ret) */
|
2001-09-10 11:28:07 +00:00
|
|
|
u_int nsd_verflen; /* and the verfier */
|
1995-06-27 11:07:30 +00:00
|
|
|
u_char *nsd_verfstr;
|
|
|
|
struct timeval nsd_timestamp; /* timestamp from verifier */
|
1998-05-31 20:09:01 +00:00
|
|
|
u_int32_t nsd_ttl; /* credential ttl (sec) */
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct nfsd_cargs {
|
|
|
|
char *ncd_dirp; /* Mount dir path */
|
|
|
|
uid_t ncd_authuid; /* Effective uid */
|
|
|
|
int ncd_authtype; /* Type of authenticator */
|
2001-09-10 11:28:07 +00:00
|
|
|
u_int ncd_authlen; /* Length of authenticator string */
|
1995-06-27 11:07:30 +00:00
|
|
|
u_char *ncd_authstr; /* Authenticator string */
|
2001-09-10 11:28:07 +00:00
|
|
|
u_int ncd_verflen; /* and the verifier */
|
1995-06-27 11:07:30 +00:00
|
|
|
u_char *ncd_verfstr;
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
1997-02-10 02:22:35 +00:00
|
|
|
/*
|
|
|
|
* XXX to allow amd to include nfs.h without nfsproto.h
|
|
|
|
*/
|
|
|
|
#ifdef NFS_NPROCS
|
2001-09-18 23:32:09 +00:00
|
|
|
#include <nfsserver/nfsrvstats.h>
|
1997-02-10 02:22:35 +00:00
|
|
|
#endif
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Flags for nfssvc() system call.
|
|
|
|
*/
|
|
|
|
#define NFSSVC_NFSD 0x004
|
|
|
|
#define NFSSVC_ADDSOCK 0x008
|
|
|
|
|
1994-10-23 23:26:18 +00:00
|
|
|
/*
|
2001-09-18 23:32:09 +00:00
|
|
|
* vfs.nfsrv sysctl(3) identifiers
|
1994-10-23 23:26:18 +00:00
|
|
|
*/
|
2001-09-18 23:32:09 +00:00
|
|
|
#define NFS_NFSRVSTATS 1 /* struct: struct nfsrvstats */
|
1997-03-27 20:01:07 +00:00
|
|
|
#define NFS_NFSPRIVPORT 2 /* int: prohibit nfs to resvports */
|
1994-10-23 23:26:18 +00:00
|
|
|
|
1999-12-29 05:07:58 +00:00
|
|
|
#ifdef _KERNEL
|
1994-11-02 00:11:00 +00:00
|
|
|
|
1997-10-12 20:26:33 +00:00
|
|
|
#ifdef MALLOC_DECLARE
|
|
|
|
MALLOC_DECLARE(M_NFSRVDESC);
|
|
|
|
MALLOC_DECLARE(M_NFSD);
|
1998-05-24 14:41:56 +00:00
|
|
|
#endif
|
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
/* Forward declarations */
|
|
|
|
struct nfssvc_sock;
|
|
|
|
struct nfsrv_descript;
|
|
|
|
struct uio;
|
|
|
|
struct vattr;
|
|
|
|
struct nameidata;
|
1997-10-12 20:26:33 +00:00
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
extern struct callout_handle nfsrv_timer_handle;
|
|
|
|
extern struct nfsrvstats nfsrvstats;
|
1998-09-07 05:42:15 +00:00
|
|
|
|
2002-01-08 19:41:06 +00:00
|
|
|
extern int nfsrv_ticks;
|
2001-09-18 23:32:09 +00:00
|
|
|
extern int nfsrvw_procrastinate;
|
|
|
|
extern int nfsrvw_procrastinate_v3;
|
1994-11-02 00:11:00 +00:00
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
/* Various values converted to XDR form. */
|
2002-01-08 19:41:06 +00:00
|
|
|
extern u_int32_t nfsrv_nfs_false, nfsrv_nfs_true, nfsrv_nfs_xdrneg1,
|
|
|
|
nfsrv_nfs_prog;
|
|
|
|
extern u_int32_t nfsrv_rpc_reply, nfsrv_rpc_msgdenied, nfsrv_rpc_mismatch,
|
|
|
|
nfsrv_rpc_vers;
|
|
|
|
extern u_int32_t nfsrv_rpc_auth_unix, nfsrv_rpc_msgaccepted, nfsrv_rpc_call,
|
|
|
|
nfsrv_rpc_autherr;
|
1994-05-24 10:09:53 +00:00
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
/* Procedure table data */
|
|
|
|
extern int nfsrvv2_procid[NFS_NPROCS];
|
2002-01-08 19:41:06 +00:00
|
|
|
extern int nfsrv_nfsv3_procid[NFS_NPROCS];
|
2001-09-18 23:32:09 +00:00
|
|
|
extern int32_t (*nfsrv3_procs[NFS_NPROCS])(struct nfsrv_descript *nd,
|
|
|
|
struct nfssvc_sock *slp, struct thread *td,
|
|
|
|
struct mbuf **mreqp);
|
1994-05-24 10:09:53 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* A list of nfssvc_sock structures is maintained with all the sockets
|
|
|
|
* that require service by the nfsd.
|
|
|
|
*/
|
1995-06-27 11:07:30 +00:00
|
|
|
#ifndef NFS_WDELAYHASHSIZ
|
|
|
|
#define NFS_WDELAYHASHSIZ 16 /* and with this */
|
|
|
|
#endif
|
|
|
|
#define NWDELAYHASH(sock, f) \
|
1998-05-31 20:09:01 +00:00
|
|
|
(&(sock)->ns_wdelayhashtbl[(*((u_int32_t *)(f))) % NFS_WDELAYHASHSIZ])
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1998-05-31 17:27:58 +00:00
|
|
|
/*
|
|
|
|
* Network address hash list element
|
|
|
|
*/
|
|
|
|
union nethostaddr {
|
1998-05-31 20:09:01 +00:00
|
|
|
u_int32_t had_inetaddr;
|
1998-05-31 17:27:58 +00:00
|
|
|
struct sockaddr *had_nam;
|
|
|
|
};
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
#define nu_inetaddr nu_haddr.had_inetaddr
|
|
|
|
#define nu_nam nu_haddr.had_nam
|
|
|
|
/* Bits for nu_flag */
|
|
|
|
#define NU_INETADDR 0x1
|
1995-06-27 11:07:30 +00:00
|
|
|
#define NU_NAM 0x2
|
|
|
|
#define NU_NETFAM(u) (((u)->nu_flag & NU_INETADDR) ? AF_INET : AF_ISO)
|
1994-05-24 10:09:53 +00:00
|
|
|
|
1997-05-13 17:25:44 +00:00
|
|
|
struct nfsrv_rec {
|
2000-05-26 02:09:24 +00:00
|
|
|
STAILQ_ENTRY(nfsrv_rec) nr_link;
|
1997-08-16 19:16:27 +00:00
|
|
|
struct sockaddr *nr_address;
|
1997-05-13 17:25:44 +00:00
|
|
|
struct mbuf *nr_packet;
|
|
|
|
};
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
struct nfssvc_sock {
|
2000-05-26 02:09:24 +00:00
|
|
|
TAILQ_ENTRY(nfssvc_sock) ns_chain; /* List of all nfssvc_sock's */
|
1994-05-24 10:09:53 +00:00
|
|
|
struct file *ns_fp;
|
|
|
|
struct socket *ns_so;
|
1997-08-16 19:16:27 +00:00
|
|
|
struct sockaddr *ns_nam;
|
1994-05-24 10:09:53 +00:00
|
|
|
struct mbuf *ns_raw;
|
|
|
|
struct mbuf *ns_rawend;
|
2000-05-26 02:09:24 +00:00
|
|
|
STAILQ_HEAD(, nfsrv_rec) ns_rec;
|
1995-06-27 11:07:30 +00:00
|
|
|
struct mbuf *ns_frag;
|
|
|
|
int ns_flag;
|
|
|
|
int ns_solock;
|
|
|
|
int ns_cc;
|
|
|
|
int ns_reclen;
|
1998-05-31 20:09:01 +00:00
|
|
|
u_int32_t ns_sref;
|
2000-05-26 02:09:24 +00:00
|
|
|
LIST_HEAD(, nfsrv_descript) ns_tq; /* Write gather lists */
|
|
|
|
LIST_HEAD(nfsrvw_delayhash, nfsrv_descript) ns_wdelayhashtbl[NFS_WDELAYHASHSIZ];
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Bits for "ns_flag" */
|
|
|
|
#define SLP_VALID 0x01
|
|
|
|
#define SLP_DOREC 0x02
|
|
|
|
#define SLP_NEEDQ 0x04
|
|
|
|
#define SLP_DISCONN 0x08
|
|
|
|
#define SLP_GETSTREAM 0x10
|
1995-06-27 11:07:30 +00:00
|
|
|
#define SLP_LASTFRAG 0x20
|
1994-05-24 10:09:53 +00:00
|
|
|
#define SLP_ALLFLAGS 0xff
|
|
|
|
|
2000-05-26 02:09:24 +00:00
|
|
|
extern TAILQ_HEAD(nfssvc_sockhead, nfssvc_sock) nfssvc_sockhead;
|
1995-07-29 11:44:31 +00:00
|
|
|
extern int nfssvc_sockhead_flag;
|
1994-10-17 17:47:45 +00:00
|
|
|
#define SLP_INIT 0x01
|
|
|
|
#define SLP_WANTINIT 0x02
|
|
|
|
|
1994-05-24 10:09:53 +00:00
|
|
|
/*
|
|
|
|
* One of these structures is allocated for each nfsd.
|
|
|
|
*/
|
|
|
|
struct nfsd {
|
2000-05-26 02:09:24 +00:00
|
|
|
TAILQ_ENTRY(nfsd) nfsd_chain; /* List of all nfsd's */
|
1995-06-27 11:07:30 +00:00
|
|
|
int nfsd_flag; /* NFSD_ flags */
|
|
|
|
struct nfssvc_sock *nfsd_slp; /* Current socket */
|
|
|
|
int nfsd_authlen; /* Authenticator len */
|
|
|
|
u_char nfsd_authstr[RPCAUTH_MAXSIZ]; /* Authenticator data */
|
|
|
|
int nfsd_verflen; /* and the Verifier */
|
|
|
|
u_char nfsd_verfstr[RPCVERF_MAXSIZ];
|
2001-09-12 08:38:13 +00:00
|
|
|
struct thread *nfsd_td; /* daemon thread ptr */
|
1995-06-27 11:07:30 +00:00
|
|
|
struct nfsrv_descript *nfsd_nd; /* Associated nfsrv_descript */
|
1994-05-24 10:09:53 +00:00
|
|
|
};
|
|
|
|
|
1995-06-27 11:07:30 +00:00
|
|
|
/* Bits for "nfsd_flag" */
|
1994-05-24 10:09:53 +00:00
|
|
|
#define NFSD_WAITING 0x01
|
1994-10-17 17:47:45 +00:00
|
|
|
#define NFSD_REQINPROG 0x02
|
|
|
|
|
1995-06-27 11:07:30 +00:00
|
|
|
/*
|
|
|
|
* This structure is used by the server for describing each request.
|
|
|
|
* Some fields are used only when write request gathering is performed.
|
|
|
|
*/
|
|
|
|
struct nfsrv_descript {
|
|
|
|
u_quad_t nd_time; /* Write deadline (usec) */
|
|
|
|
off_t nd_off; /* Start byte offset */
|
|
|
|
off_t nd_eoff; /* and end byte offset */
|
2000-05-26 02:09:24 +00:00
|
|
|
LIST_ENTRY(nfsrv_descript) nd_hash; /* Hash list */
|
2001-09-18 23:32:09 +00:00
|
|
|
LIST_ENTRY(nfsrv_descript) nd_tq; /* and timer list */
|
|
|
|
LIST_HEAD(, nfsrv_descript) nd_coalesce;/* coalesced writes */
|
1995-06-27 11:07:30 +00:00
|
|
|
struct mbuf *nd_mrep; /* Request mbuf list */
|
|
|
|
struct mbuf *nd_md; /* Current dissect mbuf */
|
|
|
|
struct mbuf *nd_mreq; /* Reply mbuf list */
|
1997-08-16 19:16:27 +00:00
|
|
|
struct sockaddr *nd_nam; /* and socket addr */
|
|
|
|
struct sockaddr *nd_nam2; /* return socket addr */
|
1995-06-27 11:07:30 +00:00
|
|
|
caddr_t nd_dpos; /* Current dissect pos */
|
1997-06-03 17:22:47 +00:00
|
|
|
u_int32_t nd_procnum; /* RPC # */
|
1995-06-27 11:07:30 +00:00
|
|
|
int nd_stable; /* storage type */
|
|
|
|
int nd_flag; /* nd_flag */
|
|
|
|
int nd_len; /* Length of this write */
|
|
|
|
int nd_repstat; /* Reply status */
|
1998-05-31 20:09:01 +00:00
|
|
|
u_int32_t nd_retxid; /* Reply xid */
|
1995-06-27 11:07:30 +00:00
|
|
|
struct timeval nd_starttime; /* Time RPC initiated */
|
|
|
|
fhandle_t nd_fh; /* File handle */
|
|
|
|
struct ucred nd_cr; /* Credentials */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Bits for "nd_flag" */
|
|
|
|
#define ND_NFSV3 0x08
|
|
|
|
|
2000-05-26 02:09:24 +00:00
|
|
|
extern TAILQ_HEAD(nfsd_head, nfsd) nfsd_head;
|
1995-07-29 11:44:31 +00:00
|
|
|
extern int nfsd_head_flag;
|
1994-10-17 17:47:45 +00:00
|
|
|
#define NFSD_CHECKSLP 0x01
|
1994-10-02 17:27:07 +00:00
|
|
|
|
1995-06-27 11:07:30 +00:00
|
|
|
/*
|
|
|
|
* These macros compare nfsrv_descript structures.
|
|
|
|
*/
|
|
|
|
#define NFSW_CONTIG(o, n) \
|
|
|
|
((o)->nd_eoff >= (n)->nd_off && \
|
|
|
|
!bcmp((caddr_t)&(o)->nd_fh, (caddr_t)&(n)->nd_fh, NFSX_V3FH))
|
|
|
|
|
|
|
|
#define NFSW_SAMECRED(o, n) \
|
2001-09-18 23:32:09 +00:00
|
|
|
(!bcmp((caddr_t)&(o)->nd_cr, (caddr_t)&(n)->nd_cr, \
|
1995-06-27 11:07:30 +00:00
|
|
|
sizeof (struct ucred)))
|
|
|
|
|
1997-07-16 09:06:30 +00:00
|
|
|
/*
|
|
|
|
* Defines for WebNFS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define WEBNFS_ESC_CHAR '%'
|
|
|
|
#define WEBNFS_SPECCHAR_START 0x80
|
|
|
|
|
|
|
|
#define WEBNFS_NATIVE_CHAR 0x80
|
|
|
|
/*
|
|
|
|
* ..
|
|
|
|
* Possibly more here in the future.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Macro for converting escape characters in WebNFS pathnames.
|
|
|
|
* Should really be in libkern.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define HEXTOC(c) \
|
|
|
|
((c) >= 'a' ? ((c) - ('a' - 10)) : \
|
|
|
|
((c) >= 'A' ? ((c) - ('A' - 10)) : ((c) - '0')))
|
|
|
|
#define HEXSTRTOI(p) \
|
|
|
|
((HEXTOC(p[0]) << 4) + HEXTOC(p[1]))
|
|
|
|
|
1997-05-10 16:12:03 +00:00
|
|
|
#ifdef NFS_DEBUG
|
|
|
|
|
|
|
|
extern int nfs_debug;
|
|
|
|
#define NFS_DEBUG_ASYNCIO 1 /* asynchronous i/o */
|
|
|
|
#define NFS_DEBUG_WG 2 /* server write gathering */
|
|
|
|
#define NFS_DEBUG_RC 4 /* server request caching */
|
|
|
|
|
|
|
|
#define NFS_DPF(cat, args) \
|
|
|
|
do { \
|
|
|
|
if (nfs_debug & NFS_DEBUG_##cat) printf args; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define NFS_DPF(cat, args)
|
|
|
|
|
|
|
|
#endif
|
1997-02-10 02:22:35 +00:00
|
|
|
|
2001-09-18 23:32:09 +00:00
|
|
|
int nfs_getreq(struct nfsrv_descript *, struct nfsd *, int);
|
|
|
|
int nfsrv_send(struct socket *, struct sockaddr *, struct mbuf *);
|
2001-09-28 04:37:08 +00:00
|
|
|
struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **,
|
|
|
|
caddr_t *);
|
2001-09-18 23:32:09 +00:00
|
|
|
int nfs_slplock(struct nfssvc_sock *, int);
|
|
|
|
void nfs_slpunlock(struct nfssvc_sock *);
|
|
|
|
void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *,
|
|
|
|
struct nfs_fattr *);
|
|
|
|
void nfsm_srvwcc(struct nfsrv_descript *, int, struct vattr *, int,
|
|
|
|
struct vattr *, struct mbuf **, char **);
|
|
|
|
void nfsm_srvpostopattr(struct nfsrv_descript *, int, struct vattr *,
|
|
|
|
struct mbuf **, char **);
|
|
|
|
int netaddr_match(int, union nethostaddr *, struct sockaddr *);
|
|
|
|
int nfs_namei(struct nameidata *, fhandle_t *, int,
|
|
|
|
struct nfssvc_sock *, struct sockaddr *, struct mbuf **,
|
|
|
|
caddr_t *, struct vnode **, struct thread *, int);
|
|
|
|
void nfsm_adj(struct mbuf *, int, int);
|
|
|
|
int nfsm_mbuftouio(struct mbuf **, struct uio *, int, caddr_t *);
|
|
|
|
void nfsrv_initcache(void);
|
2001-09-28 04:37:08 +00:00
|
|
|
void nfsrv_timer(void *);
|
2001-09-18 23:32:09 +00:00
|
|
|
int nfsrv_dorec(struct nfssvc_sock *, struct nfsd *,
|
|
|
|
struct nfsrv_descript **);
|
2001-09-28 04:37:08 +00:00
|
|
|
int nfsrv_getcache(struct nfsrv_descript *, struct mbuf **);
|
2001-09-18 23:32:09 +00:00
|
|
|
void nfsrv_updatecache(struct nfsrv_descript *, int, struct mbuf *);
|
|
|
|
void nfsrv_cleancache(void);
|
|
|
|
void nfsrv_init(int);
|
|
|
|
int nfsrv_errmap(struct nfsrv_descript *, int);
|
|
|
|
void nfsrvw_sort(gid_t *, int);
|
|
|
|
void nfsrv_setcred(struct ucred *, struct ucred *);
|
|
|
|
int nfsrv_object_create(struct vnode *);
|
|
|
|
void nfsrv_wakenfsd(struct nfssvc_sock *slp);
|
|
|
|
int nfsrv_writegather(struct nfsrv_descript **, struct nfssvc_sock *,
|
|
|
|
struct thread *, struct mbuf **);
|
|
|
|
|
|
|
|
int nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_commit(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_create(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, struct ucred *,
|
|
|
|
struct nfssvc_sock *, struct sockaddr *, int *, int);
|
|
|
|
int nfsrv_setpublicfs(struct mount *, struct netexport *,
|
|
|
|
struct export_args *);
|
|
|
|
int nfs_ispublicfh(fhandle_t *);
|
|
|
|
int nfsrv_fsinfo(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_getattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_link(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_mkdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_noop(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_null(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_pathconf(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_remove(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_rename(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_rmdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_statfs(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
int nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
|
|
|
|
struct thread *td, struct mbuf **mrq);
|
|
|
|
void nfsrv_rcv(struct socket *so, void *arg, int waitflag);
|
|
|
|
void nfsrv_slpderef(struct nfssvc_sock *slp);
|
1999-12-29 05:07:58 +00:00
|
|
|
#endif /* _KERNEL */
|
1994-08-21 06:50:16 +00:00
|
|
|
|
|
|
|
#endif
|