nfs_var.h revision 1.1 1 /* $NetBSD: nfs_var.h,v 1.1 1996/02/09 21:48:37 christos Exp $ */
2
3 /*
4 * Copyright (c) 1996 Christos Zoulas. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Christos Zoulas.
17 * 4. The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 struct vnode;
33 struct uio;
34 struct ucred;
35 struct proc;
36 struct buf;
37 struct nfs_diskless;
38 struct sockaddr_in;
39 struct nfs_dlmount;
40 struct vnode;
41 struct nfsd;
42 struct mbuf;
43 struct file;
44 struct nqlease;
45 struct nqhost;
46 struct nfssvc_sock;
47 struct nfsmount;
48 struct socket;
49 struct nfsreq;
50 struct vattr;
51 struct nameidata;
52 struct nfsnode;
53 struct sillyrename;
54 struct componentname;
55
56
57 /* nfs_bio.c */
58 int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *));
59 struct buf *nfs_getcacheblk __P((struct vnode *, daddr_t, int, struct proc *));
60 int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
61 int));
62 int nfs_asyncio __P((struct buf *, struct ucred *));
63 int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
64
65 /* nfs_boot.c */
66 int nfs_boot_init __P((struct nfs_diskless *, struct proc *));
67 int nfs_boot_init __P((struct nfs_diskless *, struct proc *));
68
69 /* nfs_node.c */
70 void nfs_nhinit __P((void));
71 struct nfsnodehashhead *nfs_hash __P((nfsv2fh_t *));
72 int nfs_nget __P((struct mount *, nfsv2fh_t *, struct nfsnode **));
73
74 /* nfs_vnops.c */
75 int nfs_null __P((struct vnode *, struct ucred *, struct proc *));
76 int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
77 int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
78 int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int));
79 int nfs_removeit __P((struct sillyrename *));
80 int nfs_renameit __P((struct vnode *, struct componentname *,
81 struct sillyrename *));
82 int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
83 int nfs_readdirlookrpc __P((struct vnode *, struct uio *, struct ucred *));
84 int nfs_sillyrename __P((struct vnode *, struct vnode *,
85 struct componentname *));
86 int nfs_lookitup __P((struct sillyrename *, nfsv2fh_t *, struct proc *));
87
88 /* nfs_nqlease.c */
89 int nqsrv_getlease __P((struct vnode *, u_int *, int, struct nfsd *,
90 struct mbuf *, int *, u_quad_t *, struct ucred *));
91 int lease_check __P((void *));
92 void nqsrv_addhost __P((struct nqhost *, struct nfssvc_sock *, struct mbuf *));
93 void nqsrv_instimeq __P((struct nqlease *, u_long));
94 int nqsrv_cmpnam __P((struct nfssvc_sock *, struct mbuf *, struct nqhost *));
95 void nqsrv_send_eviction __P((struct vnode *, struct nqlease *,
96 struct nfssvc_sock *, struct mbuf *,
97 struct ucred *));
98 void nqsrv_waitfor_expiry __P((struct nqlease *));
99 void nqnfs_serverd __P((void));
100 int nqnfsrv_getlease __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
101 struct ucred *, struct mbuf *, struct mbuf **));
102 int nqnfsrv_vacated __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
103 struct ucred *, struct mbuf *, struct mbuf **));
104 int nqnfs_getlease __P((struct vnode *, int, struct ucred *, struct proc *));
105 int nqnfs_vacated __P((struct vnode *, struct ucred *));
106 int nqnfs_callback __P((struct nfsmount *, struct mbuf *, struct mbuf *,
107 caddr_t));
108 int nqnfs_clientd __P((struct nfsmount *, struct ucred *, struct nfsd_cargs *,
109 int, caddr_t, struct proc *));
110 void nqnfs_clientlease __P((struct nfsmount *, struct nfsnode *, int, int ,
111 time_t, u_quad_t));
112 void lease_updatetime __P((int));
113 void nqsrv_locklease __P((struct nqlease *));
114 void nqsrv_unlocklease __P((struct nqlease *));
115
116 /* nfs_serv.c */
117 int nqnfsrv_access __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
118 struct ucred *, struct mbuf *, struct mbuf **));
119 int nfsrv_getattr __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
120 struct ucred *, struct mbuf *, struct mbuf **));
121 int nfsrv_setattr __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
122 struct ucred *, struct mbuf *, struct mbuf **));
123 int nfsrv_lookup __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
124 struct ucred *, struct mbuf *, struct mbuf **));
125 int nfsrv_readlink __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
126 struct ucred *, struct mbuf *, struct mbuf **));
127 int nfsrv_read __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
128 struct ucred *, struct mbuf *, struct mbuf **));
129 int nfsrv_write __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
130 struct ucred *, struct mbuf *, struct mbuf **));
131 int nfsrv_create __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
132 struct ucred *, struct mbuf *, struct mbuf **));
133 int nfsrv_remove __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
134 struct ucred *, struct mbuf *, struct mbuf **));
135 int nfsrv_rename __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
136 struct ucred *, struct mbuf *, struct mbuf **));
137 int nfsrv_link __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
138 struct ucred *, struct mbuf *, struct mbuf **));
139 int nfsrv_symlink __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
140 struct ucred *, struct mbuf *, struct mbuf **));
141 int nfsrv_mkdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
142 struct ucred *, struct mbuf *, struct mbuf **));
143 int nfsrv_rmdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
144 struct ucred *, struct mbuf *, struct mbuf **));
145 int nfsrv_readdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
146 struct ucred *, struct mbuf *, struct mbuf **));
147 int nqnfsrv_readdirlook __P((struct nfsd *, struct mbuf *, struct mbuf *,
148 caddr_t, struct ucred *, struct mbuf *,
149 struct mbuf **));
150 int nfsrv_statfs __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
151 struct ucred *, struct mbuf *, struct mbuf **));
152 int nfsrv_null __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
153 struct ucred *, struct mbuf *, struct mbuf **));
154 int nfsrv_noop __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
155 struct ucred *, struct mbuf *, struct mbuf **));
156 int nfsrv_access __P((struct vnode *, int, struct ucred *, int, struct proc *));
157
158 /* nfs_socket.c */
159 int nfs_connect __P((struct nfsmount *, struct nfsreq *));
160 int nfs_reconnect __P((struct nfsreq *));
161 void nfs_disconnect __P((struct nfsmount *));
162 int nfs_send __P((struct socket *, struct mbuf *, struct mbuf *,
163 struct nfsreq *));
164 int nfs_receive __P((struct nfsreq *, struct mbuf **, struct mbuf **));
165 int nfs_reply __P((struct nfsreq *));
166 int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
167 struct ucred *, struct mbuf **, struct mbuf **,
168 caddr_t *));
169 int nfs_rephead __P((int, struct nfsd *, int, int, u_quad_t *, struct mbuf **,
170 struct mbuf **, caddr_t *));
171 void nfs_timer __P((void *));
172 int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
173 int nfs_sndlock __P((int *, struct nfsreq *));
174 void nfs_sndunlock __P((int *));
175 int nfs_rcvlock __P((struct nfsreq *));
176 void nfs_rcvunlock __P((int *));
177 void nfs_realign __P((struct mbuf *, int));
178 int nfs_getreq __P((struct nfsd *, int));
179 void nfs_msg __P((struct proc *, char *, char *));
180 void nfsrv_rcv __P((struct socket *, caddr_t, int));
181 int nfsrv_getstream __P((struct nfssvc_sock *, int));
182 int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *));
183 void nfsrv_wakenfsd __P((struct nfssvc_sock *));
184
185 /* nfs_srvcache.c */
186 void nfsrv_initcache __P((void));
187 int nfsrv_getcache __P((struct mbuf *, struct nfsd *, struct mbuf **));
188 void nfsrv_updatecache __P((struct mbuf *, struct nfsd *, int, struct mbuf *));
189 void nfsrv_cleancache __P((void));
190
191 /* nfs_subs.c */
192 struct mbuf *nfsm_reqh __P((struct vnode *, u_long, int, caddr_t *));
193 struct mbuf *nfsm_rpchead __P((struct ucred *, int, int, int, int, char *,
194 struct mbuf *, int, struct mbuf **,
195 u_int32_t *));
196 int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
197 int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
198 int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
199 int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
200 int nfsm_strtmbuf __P((struct mbuf **, char **, char *, long));
201 int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
202 struct vattr *));
203 int nfs_getattrcache __P((struct vnode *, struct vattr *));
204 int nfs_namei __P((struct nameidata *, fhandle_t *, int, struct nfssvc_sock *,
205 struct mbuf *, struct mbuf **, caddr_t *, struct proc *));
206 void nfsm_adj __P((struct mbuf *, int, int));
207 int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
208 struct nfssvc_sock *, struct mbuf *, int *));
209 int netaddr_match __P((int, union nethostaddr *, struct mbuf *));
210
211 /* nfs_syscalls.c */
212 int nfssvc_addsock __P((struct file *, struct mbuf *));
213 int nfssvc_nfsd __P((struct nfsd_srvargs *, caddr_t, struct proc *));
214 void nfsrv_zapsock __P((struct nfssvc_sock *));
215 void nfsrv_slpderef __P((struct nfssvc_sock *));
216 void nfsrv_init __P((int));
217 int nfssvc_iod __P((struct proc *));
218 int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
219 int *, char **, int *));
220
221