xref: /csrg-svn/sys/nfs/nfsdiskless.h (revision 68653)
146986Smckusick /*
263236Sbostic  * Copyright (c) 1991, 1993
363236Sbostic  *	The Regents of the University of California.  All rights reserved.
446986Smckusick  *
546986Smckusick  * This code is derived from software contributed to Berkeley by
646986Smckusick  * Rick Macklem at The University of Guelph.
746986Smckusick  *
846986Smckusick  * %sccs.include.redist.c%
946986Smckusick  *
10*68653Smckusick  *	@(#)nfsdiskless.h	8.2 (Berkeley) 03/30/95
1146986Smckusick  */
1246986Smckusick 
13*68653Smckusick 
14*68653Smckusick #ifndef _NFS_NFSDISKLESS_H_
15*68653Smckusick #define _NFS_NFSDISKLESS_H_
16*68653Smckusick 
1746986Smckusick /*
1846986Smckusick  * Structure that must be initialized for a diskless nfs client.
1946986Smckusick  * This structure is used by nfs_mountroot() to set up the root and swap
2046986Smckusick  * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net
2146986Smckusick  * interface can communicate with the server.
2252196Smckusick  * The primary bootstrap is expected to fill in the appropriate fields before
23*68653Smckusick  * starting the kernel. Whether or not the swap area is nfs mounted is
24*68653Smckusick  * determined by the value in swdevt[0]. (equal to NODEV --> swap over nfs)
2552196Smckusick  * Currently only works for AF_INET protocols.
2652196Smckusick  * NB: All fields are stored in net byte order to avoid hassles with
2752196Smckusick  * client/server byte ordering differences.
2846986Smckusick  */
29*68653Smckusick 
30*68653Smckusick /*
31*68653Smckusick  * I have defined a new structure that can handle an NFS Version 3 file handle
32*68653Smckusick  * but the kernel still expects the old Version 2 one to be provided. The
33*68653Smckusick  * changes required in nfs_vfsops.c for using the new are documented there in
34*68653Smckusick  * comments. (I felt that breaking network booting code by changing this
35*68653Smckusick  * structure would not be prudent at this time, since almost all servers are
36*68653Smckusick  * still Version 2 anyhow.)
37*68653Smckusick  */
38*68653Smckusick struct nfsv3_diskless {
39*68653Smckusick 	struct ifaliasreq myif;			/* Default interface */
40*68653Smckusick 	struct sockaddr_in mygateway;		/* Default gateway */
41*68653Smckusick 	struct nfs_args	swap_args;		/* Mount args for swap file */
42*68653Smckusick 	int		swap_fhsize;		/* Size of file handle */
43*68653Smckusick 	u_char		swap_fh[NFSX_V3FHMAX];	/* Swap file's file handle */
44*68653Smckusick 	struct sockaddr_in swap_saddr;		/* Address of swap server */
45*68653Smckusick 	char		swap_hostnam[MNAMELEN];	/* Host name for mount pt */
46*68653Smckusick 	int		swap_nblks;		/* Size of server swap file */
47*68653Smckusick 	struct ucred	swap_ucred;		/* Swap credentials */
48*68653Smckusick 	struct nfs_args	root_args;		/* Mount args for root fs */
49*68653Smckusick 	int		root_fhsize;		/* Size of root file handle */
50*68653Smckusick 	u_char		root_fh[NFSX_V3FHMAX];	/* File handle of root dir */
51*68653Smckusick 	struct sockaddr_in root_saddr;		/* Address of root server */
52*68653Smckusick 	char		root_hostnam[MNAMELEN];	/* Host name for mount pt */
53*68653Smckusick 	long		root_time;		/* Timestamp of root fs */
54*68653Smckusick 	char		my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
55*68653Smckusick };
56*68653Smckusick 
5746986Smckusick struct nfs_diskless {
5852196Smckusick 	struct ifaliasreq myif;			/* Default interface */
5952196Smckusick 	struct sockaddr_in mygateway;		/* Default gateway */
6052196Smckusick 	struct nfs_args	swap_args;		/* Mount args for swap file */
61*68653Smckusick 	u_char		swap_fh[NFSX_V2FH];	/* Swap file's file handle */
6252196Smckusick 	struct sockaddr_in swap_saddr;		/* Address of swap server */
6352196Smckusick 	char		swap_hostnam[MNAMELEN];	/* Host name for mount pt */
6452196Smckusick 	int		swap_nblks;		/* Size of server swap file */
6555081Storek 	struct ucred	swap_ucred;		/* Swap credentials */
6652196Smckusick 	struct nfs_args	root_args;		/* Mount args for root fs */
67*68653Smckusick 	u_char		root_fh[NFSX_V2FH];	/* File handle of root dir */
6852196Smckusick 	struct sockaddr_in root_saddr;		/* Address of root server */
6952196Smckusick 	char		root_hostnam[MNAMELEN];	/* Host name for mount pt */
7057782Smckusick 	long		root_time;		/* Timestamp of root fs */
7152444Smckusick 	char		my_hostnam[MAXHOSTNAMELEN]; /* Client host name */
7246986Smckusick };
73*68653Smckusick 
74*68653Smckusick #endif
75