nfsdiskless.h revision 2175
11541Srgrimes/* 21541Srgrimes * Copyright (c) 1991, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * 51541Srgrimes * This code is derived from software contributed to Berkeley by 61541Srgrimes * Rick Macklem at The University of Guelph. 71541Srgrimes * 81541Srgrimes * Redistribution and use in source and binary forms, with or without 91541Srgrimes * modification, are permitted provided that the following conditions 101541Srgrimes * are met: 111541Srgrimes * 1. Redistributions of source code must retain the above copyright 121541Srgrimes * notice, this list of conditions and the following disclaimer. 131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141541Srgrimes * notice, this list of conditions and the following disclaimer in the 151541Srgrimes * documentation and/or other materials provided with the distribution. 161541Srgrimes * 3. All advertising materials mentioning features or use of this software 171541Srgrimes * must display the following acknowledgement: 181541Srgrimes * This product includes software developed by the University of 191541Srgrimes * California, Berkeley and its contributors. 201541Srgrimes * 4. Neither the name of the University nor the names of its contributors 211541Srgrimes * may be used to endorse or promote products derived from this software 221541Srgrimes * without specific prior written permission. 231541Srgrimes * 241541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 341541Srgrimes * SUCH DAMAGE. 351541Srgrimes * 361541Srgrimes * @(#)nfsdiskless.h 8.1 (Berkeley) 6/10/93 372175Spaul * $Id: nfsdiskless.h,v 1.3 1994/08/05 09:28:49 davidg Exp $ 381541Srgrimes */ 391541Srgrimes 402175Spaul#ifndef _NFS_NFSDISKLESS_H_ 412175Spaul#define _NFS_NFSDISKLESS_H_ 422175Spaul 431541Srgrimes/* 441541Srgrimes * Structure that must be initialized for a diskless nfs client. 451541Srgrimes * This structure is used by nfs_mountroot() to set up the root and swap 461541Srgrimes * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net 471541Srgrimes * interface can communicate with the server. 481541Srgrimes * The primary bootstrap is expected to fill in the appropriate fields before 491858Sdg * starting the kernel. Whether or not the swap area is nfs mounted is determined 501541Srgrimes * by the value in swdevt[0]. (equal to NODEV --> swap over nfs) 511541Srgrimes * Currently only works for AF_INET protocols. 521541Srgrimes * NB: All fields are stored in net byte order to avoid hassles with 531541Srgrimes * client/server byte ordering differences. 541541Srgrimes */ 551541Srgrimesstruct nfs_diskless { 561541Srgrimes struct ifaliasreq myif; /* Default interface */ 571541Srgrimes struct sockaddr_in mygateway; /* Default gateway */ 581541Srgrimes struct nfs_args swap_args; /* Mount args for swap file */ 591541Srgrimes u_char swap_fh[NFS_FHSIZE]; /* Swap file's file handle */ 601541Srgrimes struct sockaddr_in swap_saddr; /* Address of swap server */ 611541Srgrimes char swap_hostnam[MNAMELEN]; /* Host name for mount pt */ 621541Srgrimes int swap_nblks; /* Size of server swap file */ 631541Srgrimes struct ucred swap_ucred; /* Swap credentials */ 641541Srgrimes struct nfs_args root_args; /* Mount args for root fs */ 651541Srgrimes u_char root_fh[NFS_FHSIZE]; /* File handle of root dir */ 661541Srgrimes struct sockaddr_in root_saddr; /* Address of root server */ 671541Srgrimes char root_hostnam[MNAMELEN]; /* Host name for mount pt */ 681541Srgrimes long root_time; /* Timestamp of root fs */ 691541Srgrimes char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */ 701541Srgrimes}; 712175Spaul 722175Spaul#endif 73