|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ ! 26: /* ! 27: * Copyright (c) 1991, 1993 ! 28: * The Regents of the University of California. All rights reserved. ! 29: * ! 30: * This code is derived from software contributed to Berkeley by ! 31: * Rick Macklem at The University of Guelph. ! 32: * ! 33: * Redistribution and use in source and binary forms, with or without ! 34: * modification, are permitted provided that the following conditions ! 35: * are met: ! 36: * 1. Redistributions of source code must retain the above copyright ! 37: * notice, this list of conditions and the following disclaimer. ! 38: * 2. Redistributions in binary form must reproduce the above copyright ! 39: * notice, this list of conditions and the following disclaimer in the ! 40: * documentation and/or other materials provided with the distribution. ! 41: * 3. All advertising materials mentioning features or use of this software ! 42: * must display the following acknowledgement: ! 43: * This product includes software developed by the University of ! 44: * California, Berkeley and its contributors. ! 45: * 4. Neither the name of the University nor the names of its contributors ! 46: * may be used to endorse or promote products derived from this software ! 47: * without specific prior written permission. ! 48: * ! 49: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ! 50: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ! 51: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ! 52: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ! 53: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ! 54: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ! 55: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! 56: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ! 57: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ! 58: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ! 59: * SUCH DAMAGE. ! 60: * ! 61: * @(#)nfsdiskless.h 8.2 (Berkeley) 3/30/95 ! 62: * FreeBSD-Id: nfsdiskless.h,v 1.10 1997/09/07 12:56:46 bde Exp $ ! 63: */ ! 64: ! 65: ! 66: #ifndef _NFS_NFSDISKLESS_H_ ! 67: #define _NFS_NFSDISKLESS_H_ ! 68: ! 69: /* ! 70: * Structure that must be initialized for a diskless nfs client. ! 71: * This structure is used by nfs_mountroot() to set up the root and swap ! 72: * vnodes plus do a partial ifconfig(8) and route(8) so that the critical net ! 73: * interface can communicate with the server. ! 74: * The primary bootstrap is expected to fill in the appropriate fields before ! 75: * starting the kernel. Whether or not the swap area is nfs mounted is ! 76: * determined by the value in swdevt[0]. (equal to NODEV --> swap over nfs) ! 77: * Currently only works for AF_INET protocols. ! 78: * NB: All fields are stored in net byte order to avoid hassles with ! 79: * client/server byte ordering differences. ! 80: */ ! 81: ! 82: /* ! 83: * I have defined a new structure that can handle an NFS Version 3 file handle ! 84: * but the kernel still expects the old Version 2 one to be provided. The ! 85: * changes required in nfs_vfsops.c for using the new are documented there in ! 86: * comments. (I felt that breaking network booting code by changing this ! 87: * structure would not be prudent at this time, since almost all servers are ! 88: * still Version 2 anyhow.) ! 89: */ ! 90: struct nfsv3_diskless { ! 91: struct ifaliasreq myif; /* Default interface */ ! 92: struct sockaddr_in mygateway; /* Default gateway */ ! 93: struct nfs_args swap_args; /* Mount args for swap file */ ! 94: int swap_fhsize; /* Size of file handle */ ! 95: u_char swap_fh[NFSX_V3FHMAX]; /* Swap file's file handle */ ! 96: struct sockaddr_in swap_saddr; /* Address of swap server */ ! 97: char swap_hostnam[MNAMELEN]; /* Host name for mount pt */ ! 98: int swap_nblks; /* Size of server swap file */ ! 99: struct ucred swap_ucred; /* Swap credentials */ ! 100: struct nfs_args root_args; /* Mount args for root fs */ ! 101: int root_fhsize; /* Size of root file handle */ ! 102: u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */ ! 103: struct sockaddr_in root_saddr; /* Address of root server */ ! 104: char root_hostnam[MNAMELEN]; /* Host name for mount pt */ ! 105: long root_time; /* Timestamp of root fs */ ! 106: char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */ ! 107: }; ! 108: ! 109: struct nfs_dlmount { ! 110: struct sockaddr_in ndm_saddr; /* Address of file server */ ! 111: char ndm_host[MNAMELEN]; /* Host name for mount pt */ ! 112: u_char ndm_fh[NFSX_V2FH]; /* The file's file handle */ ! 113: }; ! 114: ! 115: /* ! 116: * Old arguments to mount NFS ! 117: */ ! 118: struct onfs_args { ! 119: struct sockaddr *addr; /* file server address */ ! 120: int addrlen; /* length of address */ ! 121: int sotype; /* Socket type */ ! 122: int proto; /* and Protocol */ ! 123: u_char *fh; /* File handle to be mounted */ ! 124: int fhsize; /* Size, in bytes, of fh */ ! 125: int flags; /* flags */ ! 126: int wsize; /* write size in bytes */ ! 127: int rsize; /* read size in bytes */ ! 128: int readdirsize; /* readdir size in bytes */ ! 129: int timeo; /* initial timeout in .1 secs */ ! 130: int retrans; /* times to retry send */ ! 131: int maxgrouplist; /* Max. size of group list */ ! 132: int readahead; /* # of blocks to readahead */ ! 133: int leaseterm; /* Term (sec) of lease */ ! 134: int deadthresh; /* Retrans threshold */ ! 135: char *hostname; /* server's name */ ! 136: }; ! 137: ! 138: struct nfs_diskless { ! 139: struct nfs_dlmount nd_root; /* Mount info for root */ ! 140: struct nfs_dlmount nd_private; /* Mount info for private */ ! 141: }; ! 142: ! 143: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.