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