nfsdiskless.h revision 1.1.1.1.4.2 1 1.1.1.1.4.2 rmind /* $NetBSD: nfsdiskless.h,v 1.1.1.1.4.2 2014/05/18 17:46:05 rmind Exp $ */
2 1.1.1.1.4.2 rmind /*-
3 1.1.1.1.4.2 rmind * Copyright (c) 1991, 1993
4 1.1.1.1.4.2 rmind * The Regents of the University of California. All rights reserved.
5 1.1.1.1.4.2 rmind *
6 1.1.1.1.4.2 rmind * This code is derived from software contributed to Berkeley by
7 1.1.1.1.4.2 rmind * Rick Macklem at The University of Guelph.
8 1.1.1.1.4.2 rmind *
9 1.1.1.1.4.2 rmind * Redistribution and use in source and binary forms, with or without
10 1.1.1.1.4.2 rmind * modification, are permitted provided that the following conditions
11 1.1.1.1.4.2 rmind * are met:
12 1.1.1.1.4.2 rmind * 1. Redistributions of source code must retain the above copyright
13 1.1.1.1.4.2 rmind * notice, this list of conditions and the following disclaimer.
14 1.1.1.1.4.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
15 1.1.1.1.4.2 rmind * notice, this list of conditions and the following disclaimer in the
16 1.1.1.1.4.2 rmind * documentation and/or other materials provided with the distribution.
17 1.1.1.1.4.2 rmind * 4. Neither the name of the University nor the names of its contributors
18 1.1.1.1.4.2 rmind * may be used to endorse or promote products derived from this software
19 1.1.1.1.4.2 rmind * without specific prior written permission.
20 1.1.1.1.4.2 rmind *
21 1.1.1.1.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 1.1.1.1.4.2 rmind * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1.1.1.4.2 rmind * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1.1.1.4.2 rmind * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 1.1.1.1.4.2 rmind * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1.1.1.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1.1.1.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1.1.1.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1.1.1.4.2 rmind * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1.1.1.4.2 rmind * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1.1.1.4.2 rmind * SUCH DAMAGE.
32 1.1.1.1.4.2 rmind *
33 1.1.1.1.4.2 rmind * @(#)nfsdiskless.h 8.2 (Berkeley) 3/30/95
34 1.1.1.1.4.2 rmind * FreeBSD: head/sys/nfs/nfsdiskless.h 221032 2011-04-25 22:22:51Z rmacklem
35 1.1.1.1.4.2 rmind * $NetBSD: nfsdiskless.h,v 1.1.1.1.4.2 2014/05/18 17:46:05 rmind Exp $
36 1.1.1.1.4.2 rmind */
37 1.1.1.1.4.2 rmind
38 1.1.1.1.4.2 rmind #ifndef _NFSCLIENT_NFSDISKLESS_H_
39 1.1.1.1.4.2 rmind #define _NFSCLIENT_NFSDISKLESS_H_
40 1.1.1.1.4.2 rmind
41 1.1.1.1.4.2 rmind /*
42 1.1.1.1.4.2 rmind * Structure that must be initialized for a diskless nfs client.
43 1.1.1.1.4.2 rmind * This structure is used by nfs_mountroot() to set up the root vnode,
44 1.1.1.1.4.2 rmind * and to do a partial ifconfig(8) and route(8) so that the critical net
45 1.1.1.1.4.2 rmind * interface can communicate with the server.
46 1.1.1.1.4.2 rmind * The primary bootstrap is expected to fill in the appropriate fields before
47 1.1.1.1.4.2 rmind * starting the kernel.
48 1.1.1.1.4.2 rmind * Currently only works for AF_INET protocols.
49 1.1.1.1.4.2 rmind * NB: All fields are stored in net byte order to avoid hassles with
50 1.1.1.1.4.2 rmind * client/server byte ordering differences.
51 1.1.1.1.4.2 rmind */
52 1.1.1.1.4.2 rmind
53 1.1.1.1.4.2 rmind /*
54 1.1.1.1.4.2 rmind * I have defined a new structure that can handle an NFS Version 3 file handle
55 1.1.1.1.4.2 rmind * but the kernel still expects the old Version 2 one to be provided. The
56 1.1.1.1.4.2 rmind * changes required in nfs_vfsops.c for using the new are documented there in
57 1.1.1.1.4.2 rmind * comments. (I felt that breaking network booting code by changing this
58 1.1.1.1.4.2 rmind * structure would not be prudent at this time, since almost all servers are
59 1.1.1.1.4.2 rmind * still Version 2 anyhow.)
60 1.1.1.1.4.2 rmind */
61 1.1.1.1.4.2 rmind struct nfsv3_diskless {
62 1.1.1.1.4.2 rmind struct ifaliasreq myif; /* Default interface */
63 1.1.1.1.4.2 rmind struct sockaddr_in mygateway; /* Default gateway */
64 1.1.1.1.4.2 rmind struct nfs_args root_args; /* Mount args for root fs */
65 1.1.1.1.4.2 rmind int root_fhsize; /* Size of root file handle */
66 1.1.1.1.4.2 rmind u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */
67 1.1.1.1.4.2 rmind struct sockaddr_in root_saddr; /* Address of root server */
68 1.1.1.1.4.2 rmind char root_hostnam[MNAMELEN]; /* Host name for mount pt */
69 1.1.1.1.4.2 rmind long root_time; /* Timestamp of root fs */
70 1.1.1.1.4.2 rmind char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
71 1.1.1.1.4.2 rmind };
72 1.1.1.1.4.2 rmind
73 1.1.1.1.4.2 rmind /*
74 1.1.1.1.4.2 rmind * Old arguments to mount NFS
75 1.1.1.1.4.2 rmind */
76 1.1.1.1.4.2 rmind struct onfs_args {
77 1.1.1.1.4.2 rmind struct sockaddr *addr; /* file server address */
78 1.1.1.1.4.2 rmind int addrlen; /* length of address */
79 1.1.1.1.4.2 rmind int sotype; /* Socket type */
80 1.1.1.1.4.2 rmind int proto; /* and Protocol */
81 1.1.1.1.4.2 rmind u_char *fh; /* File handle to be mounted */
82 1.1.1.1.4.2 rmind int fhsize; /* Size, in bytes, of fh */
83 1.1.1.1.4.2 rmind int flags; /* flags */
84 1.1.1.1.4.2 rmind int wsize; /* write size in bytes */
85 1.1.1.1.4.2 rmind int rsize; /* read size in bytes */
86 1.1.1.1.4.2 rmind int readdirsize; /* readdir size in bytes */
87 1.1.1.1.4.2 rmind int timeo; /* initial timeout in .1 secs */
88 1.1.1.1.4.2 rmind int retrans; /* times to retry send */
89 1.1.1.1.4.2 rmind int maxgrouplist; /* Max. size of group list */
90 1.1.1.1.4.2 rmind int readahead; /* # of blocks to readahead */
91 1.1.1.1.4.2 rmind int leaseterm; /* Term (sec) of lease */
92 1.1.1.1.4.2 rmind int deadthresh; /* Retrans threshold */
93 1.1.1.1.4.2 rmind char *hostname; /* server's name */
94 1.1.1.1.4.2 rmind };
95 1.1.1.1.4.2 rmind
96 1.1.1.1.4.2 rmind struct nfs_diskless {
97 1.1.1.1.4.2 rmind struct ifaliasreq myif; /* Default interface */
98 1.1.1.1.4.2 rmind struct sockaddr_in mygateway; /* Default gateway */
99 1.1.1.1.4.2 rmind struct onfs_args root_args; /* Mount args for root fs */
100 1.1.1.1.4.2 rmind u_char root_fh[NFSX_V2FH]; /* File handle of root dir */
101 1.1.1.1.4.2 rmind struct sockaddr_in root_saddr; /* Address of root server */
102 1.1.1.1.4.2 rmind char root_hostnam[MNAMELEN]; /* Host name for mount pt */
103 1.1.1.1.4.2 rmind long root_time; /* Timestamp of root fs */
104 1.1.1.1.4.2 rmind char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
105 1.1.1.1.4.2 rmind };
106 1.1.1.1.4.2 rmind
107 1.1.1.1.4.2 rmind #ifdef _KERNEL
108 1.1.1.1.4.2 rmind extern struct nfsv3_diskless nfsv3_diskless;
109 1.1.1.1.4.2 rmind extern struct nfs_diskless nfs_diskless;
110 1.1.1.1.4.2 rmind extern int nfs_diskless_valid;
111 1.1.1.1.4.2 rmind void bootpc_init(void);
112 1.1.1.1.4.2 rmind void nfs_setup_diskless(void);
113 1.1.1.1.4.2 rmind void nfs_parse_options(const char *, struct nfs_args *);
114 1.1.1.1.4.2 rmind #endif
115 1.1.1.1.4.2 rmind
116 1.1.1.1.4.2 rmind #endif
117