Commit | Line | Data |
---|---|---|
0348afce | 1 | /* |
99315dca KB |
2 | * Copyright (c) 1991, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
0348afce KM |
4 | * |
5 | * This code is derived from software contributed to Berkeley by | |
6 | * Rick Macklem at The University of Guelph. | |
7 | * | |
8 | * %sccs.include.redist.c% | |
9 | * | |
4acac3d6 | 10 | * @(#)nfsdiskless.h 8.2 (Berkeley) %G% |
0348afce KM |
11 | */ |
12 | ||
4acac3d6 KM |
13 | |
14 | #ifndef _NFS_NFSDISKLESS_H_ | |
15 | #define _NFS_NFSDISKLESS_H_ | |
16 | ||
0348afce KM |
17 | /* |
18 | * Structure that must be initialized for a diskless nfs client. | |
19 | * This structure is used by nfs_mountroot() to set up the root and swap | |
20 | * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net | |
21 | * interface can communicate with the server. | |
2c5b44a2 | 22 | * The primary bootstrap is expected to fill in the appropriate fields before |
4acac3d6 KM |
23 | * starting the kernel. Whether or not the swap area is nfs mounted is |
24 | * determined by the value in swdevt[0]. (equal to NODEV --> swap over nfs) | |
2c5b44a2 KM |
25 | * Currently only works for AF_INET protocols. |
26 | * NB: All fields are stored in net byte order to avoid hassles with | |
27 | * client/server byte ordering differences. | |
0348afce | 28 | */ |
4acac3d6 KM |
29 | |
30 | /* | |
31 | * I have defined a new structure that can handle an NFS Version 3 file handle | |
32 | * but the kernel still expects the old Version 2 one to be provided. The | |
33 | * changes required in nfs_vfsops.c for using the new are documented there in | |
34 | * comments. (I felt that breaking network booting code by changing this | |
35 | * structure would not be prudent at this time, since almost all servers are | |
36 | * still Version 2 anyhow.) | |
37 | */ | |
38 | struct nfsv3_diskless { | |
39 | struct ifaliasreq myif; /* Default interface */ | |
40 | struct sockaddr_in mygateway; /* Default gateway */ | |
41 | struct nfs_args swap_args; /* Mount args for swap file */ | |
42 | int swap_fhsize; /* Size of file handle */ | |
43 | u_char swap_fh[NFSX_V3FHMAX]; /* Swap file's file handle */ | |
44 | struct sockaddr_in swap_saddr; /* Address of swap server */ | |
45 | char swap_hostnam[MNAMELEN]; /* Host name for mount pt */ | |
46 | int swap_nblks; /* Size of server swap file */ | |
47 | struct ucred swap_ucred; /* Swap credentials */ | |
48 | struct nfs_args root_args; /* Mount args for root fs */ | |
49 | int root_fhsize; /* Size of root file handle */ | |
50 | u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */ | |
51 | struct sockaddr_in root_saddr; /* Address of root server */ | |
52 | char root_hostnam[MNAMELEN]; /* Host name for mount pt */ | |
53 | long root_time; /* Timestamp of root fs */ | |
54 | char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */ | |
55 | }; | |
56 | ||
0348afce | 57 | struct nfs_diskless { |
2c5b44a2 KM |
58 | struct ifaliasreq myif; /* Default interface */ |
59 | struct sockaddr_in mygateway; /* Default gateway */ | |
60 | struct nfs_args swap_args; /* Mount args for swap file */ | |
4acac3d6 | 61 | u_char swap_fh[NFSX_V2FH]; /* Swap file's file handle */ |
2c5b44a2 KM |
62 | struct sockaddr_in swap_saddr; /* Address of swap server */ |
63 | char swap_hostnam[MNAMELEN]; /* Host name for mount pt */ | |
64 | int swap_nblks; /* Size of server swap file */ | |
ffbde618 | 65 | struct ucred swap_ucred; /* Swap credentials */ |
2c5b44a2 | 66 | struct nfs_args root_args; /* Mount args for root fs */ |
4acac3d6 | 67 | u_char root_fh[NFSX_V2FH]; /* File handle of root dir */ |
2c5b44a2 KM |
68 | struct sockaddr_in root_saddr; /* Address of root server */ |
69 | char root_hostnam[MNAMELEN]; /* Host name for mount pt */ | |
6d73426c | 70 | long root_time; /* Timestamp of root fs */ |
ab84b0a7 | 71 | char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */ |
0348afce | 72 | }; |
4acac3d6 KM |
73 | |
74 | #endif |