nfs_var.h revision 1.1 1 1.1 christos /* $NetBSD: nfs_var.h,v 1.1 1996/02/09 21:48:37 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.1 christos
56 1.1 christos
57 1.1 christos /* nfs_bio.c */
58 1.1 christos int nfs_bioread __P((struct vnode *, struct uio *, int, struct ucred *));
59 1.1 christos struct buf *nfs_getcacheblk __P((struct vnode *, daddr_t, int, struct proc *));
60 1.1 christos int nfs_vinvalbuf __P((struct vnode *, int, struct ucred *, struct proc *,
61 1.1 christos int));
62 1.1 christos int nfs_asyncio __P((struct buf *, struct ucred *));
63 1.1 christos int nfs_doio __P((struct buf *, struct ucred *, struct proc *));
64 1.1 christos
65 1.1 christos /* nfs_boot.c */
66 1.1 christos int nfs_boot_init __P((struct nfs_diskless *, struct proc *));
67 1.1 christos int nfs_boot_init __P((struct nfs_diskless *, struct proc *));
68 1.1 christos
69 1.1 christos /* nfs_node.c */
70 1.1 christos void nfs_nhinit __P((void));
71 1.1 christos struct nfsnodehashhead *nfs_hash __P((nfsv2fh_t *));
72 1.1 christos int nfs_nget __P((struct mount *, nfsv2fh_t *, struct nfsnode **));
73 1.1 christos
74 1.1 christos /* nfs_vnops.c */
75 1.1 christos int nfs_null __P((struct vnode *, struct ucred *, struct proc *));
76 1.1 christos int nfs_readlinkrpc __P((struct vnode *, struct uio *, struct ucred *));
77 1.1 christos int nfs_readrpc __P((struct vnode *, struct uio *, struct ucred *));
78 1.1 christos int nfs_writerpc __P((struct vnode *, struct uio *, struct ucred *, int));
79 1.1 christos int nfs_removeit __P((struct sillyrename *));
80 1.1 christos int nfs_renameit __P((struct vnode *, struct componentname *,
81 1.1 christos struct sillyrename *));
82 1.1 christos int nfs_readdirrpc __P((struct vnode *, struct uio *, struct ucred *));
83 1.1 christos int nfs_readdirlookrpc __P((struct vnode *, struct uio *, struct ucred *));
84 1.1 christos int nfs_sillyrename __P((struct vnode *, struct vnode *,
85 1.1 christos struct componentname *));
86 1.1 christos int nfs_lookitup __P((struct sillyrename *, nfsv2fh_t *, struct proc *));
87 1.1 christos
88 1.1 christos /* nfs_nqlease.c */
89 1.1 christos int nqsrv_getlease __P((struct vnode *, u_int *, int, struct nfsd *,
90 1.1 christos struct mbuf *, int *, u_quad_t *, struct ucred *));
91 1.1 christos int lease_check __P((void *));
92 1.1 christos void nqsrv_addhost __P((struct nqhost *, struct nfssvc_sock *, struct mbuf *));
93 1.1 christos void nqsrv_instimeq __P((struct nqlease *, u_long));
94 1.1 christos int nqsrv_cmpnam __P((struct nfssvc_sock *, struct mbuf *, struct nqhost *));
95 1.1 christos void nqsrv_send_eviction __P((struct vnode *, struct nqlease *,
96 1.1 christos struct nfssvc_sock *, struct mbuf *,
97 1.1 christos struct ucred *));
98 1.1 christos void nqsrv_waitfor_expiry __P((struct nqlease *));
99 1.1 christos void nqnfs_serverd __P((void));
100 1.1 christos int nqnfsrv_getlease __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
101 1.1 christos struct ucred *, struct mbuf *, struct mbuf **));
102 1.1 christos int nqnfsrv_vacated __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
103 1.1 christos struct ucred *, struct mbuf *, struct mbuf **));
104 1.1 christos int nqnfs_getlease __P((struct vnode *, int, struct ucred *, struct proc *));
105 1.1 christos int nqnfs_vacated __P((struct vnode *, struct ucred *));
106 1.1 christos int nqnfs_callback __P((struct nfsmount *, struct mbuf *, struct mbuf *,
107 1.1 christos caddr_t));
108 1.1 christos int nqnfs_clientd __P((struct nfsmount *, struct ucred *, struct nfsd_cargs *,
109 1.1 christos int, caddr_t, struct proc *));
110 1.1 christos void nqnfs_clientlease __P((struct nfsmount *, struct nfsnode *, int, int ,
111 1.1 christos time_t, u_quad_t));
112 1.1 christos void lease_updatetime __P((int));
113 1.1 christos void nqsrv_locklease __P((struct nqlease *));
114 1.1 christos void nqsrv_unlocklease __P((struct nqlease *));
115 1.1 christos
116 1.1 christos /* nfs_serv.c */
117 1.1 christos int nqnfsrv_access __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
118 1.1 christos struct ucred *, struct mbuf *, struct mbuf **));
119 1.1 christos int nfsrv_getattr __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_setattr __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_lookup __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_readlink __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_read __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_write __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_create __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_remove __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_rename __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_link __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_symlink __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_mkdir __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_rmdir __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_readdir __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
146 1.1 christos struct ucred *, struct mbuf *, struct mbuf **));
147 1.1 christos int nqnfsrv_readdirlook __P((struct nfsd *, struct mbuf *, struct mbuf *,
148 1.1 christos caddr_t, struct ucred *, struct mbuf *,
149 1.1 christos struct mbuf **));
150 1.1 christos int nfsrv_statfs __P((struct nfsd *, struct mbuf *, struct mbuf *, caddr_t,
151 1.1 christos struct ucred *, struct mbuf *, struct mbuf **));
152 1.1 christos int nfsrv_null __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_noop __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_access __P((struct vnode *, int, struct ucred *, int, struct proc *));
157 1.1 christos
158 1.1 christos /* nfs_socket.c */
159 1.1 christos int nfs_connect __P((struct nfsmount *, struct nfsreq *));
160 1.1 christos int nfs_reconnect __P((struct nfsreq *));
161 1.1 christos void nfs_disconnect __P((struct nfsmount *));
162 1.1 christos int nfs_send __P((struct socket *, struct mbuf *, struct mbuf *,
163 1.1 christos struct nfsreq *));
164 1.1 christos int nfs_receive __P((struct nfsreq *, struct mbuf **, struct mbuf **));
165 1.1 christos int nfs_reply __P((struct nfsreq *));
166 1.1 christos int nfs_request __P((struct vnode *, struct mbuf *, int, struct proc *,
167 1.1 christos struct ucred *, struct mbuf **, struct mbuf **,
168 1.1 christos caddr_t *));
169 1.1 christos int nfs_rephead __P((int, struct nfsd *, int, int, u_quad_t *, struct mbuf **,
170 1.1 christos struct mbuf **, caddr_t *));
171 1.1 christos void nfs_timer __P((void *));
172 1.1 christos int nfs_sigintr __P((struct nfsmount *, struct nfsreq *, struct proc *));
173 1.1 christos int nfs_sndlock __P((int *, struct nfsreq *));
174 1.1 christos void nfs_sndunlock __P((int *));
175 1.1 christos int nfs_rcvlock __P((struct nfsreq *));
176 1.1 christos void nfs_rcvunlock __P((int *));
177 1.1 christos void nfs_realign __P((struct mbuf *, int));
178 1.1 christos int nfs_getreq __P((struct nfsd *, int));
179 1.1 christos void nfs_msg __P((struct proc *, char *, char *));
180 1.1 christos void nfsrv_rcv __P((struct socket *, caddr_t, int));
181 1.1 christos int nfsrv_getstream __P((struct nfssvc_sock *, int));
182 1.1 christos int nfsrv_dorec __P((struct nfssvc_sock *, struct nfsd *));
183 1.1 christos void nfsrv_wakenfsd __P((struct nfssvc_sock *));
184 1.1 christos
185 1.1 christos /* nfs_srvcache.c */
186 1.1 christos void nfsrv_initcache __P((void));
187 1.1 christos int nfsrv_getcache __P((struct mbuf *, struct nfsd *, struct mbuf **));
188 1.1 christos void nfsrv_updatecache __P((struct mbuf *, struct nfsd *, int, struct mbuf *));
189 1.1 christos void nfsrv_cleancache __P((void));
190 1.1 christos
191 1.1 christos /* nfs_subs.c */
192 1.1 christos struct mbuf *nfsm_reqh __P((struct vnode *, u_long, int, caddr_t *));
193 1.1 christos struct mbuf *nfsm_rpchead __P((struct ucred *, int, int, int, int, char *,
194 1.1 christos struct mbuf *, int, struct mbuf **,
195 1.1 christos u_int32_t *));
196 1.1 christos int nfsm_mbuftouio __P((struct mbuf **, struct uio *, int, caddr_t *));
197 1.1 christos int nfsm_uiotombuf __P((struct uio *, struct mbuf **, int, caddr_t *));
198 1.1 christos int nfsm_disct __P((struct mbuf **, caddr_t *, int, int, caddr_t *));
199 1.1 christos int nfs_adv __P((struct mbuf **, caddr_t *, int, int));
200 1.1 christos int nfsm_strtmbuf __P((struct mbuf **, char **, char *, long));
201 1.1 christos int nfs_loadattrcache __P((struct vnode **, struct mbuf **, caddr_t *,
202 1.1 christos struct vattr *));
203 1.1 christos int nfs_getattrcache __P((struct vnode *, struct vattr *));
204 1.1 christos int nfs_namei __P((struct nameidata *, fhandle_t *, int, struct nfssvc_sock *,
205 1.1 christos struct mbuf *, struct mbuf **, caddr_t *, struct proc *));
206 1.1 christos void nfsm_adj __P((struct mbuf *, int, int));
207 1.1 christos int nfsrv_fhtovp __P((fhandle_t *, int, struct vnode **, struct ucred *,
208 1.1 christos struct nfssvc_sock *, struct mbuf *, int *));
209 1.1 christos int netaddr_match __P((int, union nethostaddr *, struct mbuf *));
210 1.1 christos
211 1.1 christos /* nfs_syscalls.c */
212 1.1 christos int nfssvc_addsock __P((struct file *, struct mbuf *));
213 1.1 christos int nfssvc_nfsd __P((struct nfsd_srvargs *, caddr_t, struct proc *));
214 1.1 christos void nfsrv_zapsock __P((struct nfssvc_sock *));
215 1.1 christos void nfsrv_slpderef __P((struct nfssvc_sock *));
216 1.1 christos void nfsrv_init __P((int));
217 1.1 christos int nfssvc_iod __P((struct proc *));
218 1.1 christos int nfs_getauth __P((struct nfsmount *, struct nfsreq *, struct ucred *,
219 1.1 christos int *, char **, int *));
220 1.1 christos
221