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