Home | History | Annotate | Line # | Download | only in libsa
      1  1.1  mlelstv /*	$NetBSD: nfsv3.h,v 1.1 2023/12/12 09:12:55 mlelstv Exp $	*/
      2  1.1  mlelstv 
      3  1.1  mlelstv /*
      4  1.1  mlelstv  * Copyright (c) 2023 Michael van Elst
      5  1.1  mlelstv  *
      6  1.1  mlelstv  * This code is derived from software contributed to Berkeley by
      7  1.1  mlelstv  * Rick Macklem at The University of Guelph.
      8  1.1  mlelstv  *
      9  1.1  mlelstv  * Redistribution and use in source and binary forms, with or without
     10  1.1  mlelstv  * modification, are permitted provided that the following conditions
     11  1.1  mlelstv  * are met:
     12  1.1  mlelstv  * 1. Redistributions of source code must retain the above copyright
     13  1.1  mlelstv  *    notice, this list of conditions and the following disclaimer.
     14  1.1  mlelstv  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  mlelstv  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  mlelstv  *    documentation and/or other materials provided with the distribution.
     17  1.1  mlelstv  *
     18  1.1  mlelstv  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     19  1.1  mlelstv  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     20  1.1  mlelstv  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     21  1.1  mlelstv  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     22  1.1  mlelstv  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23  1.1  mlelstv  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     24  1.1  mlelstv  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25  1.1  mlelstv  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     26  1.1  mlelstv  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27  1.1  mlelstv  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28  1.1  mlelstv  * SUCH DAMAGE.
     29  1.1  mlelstv  */
     30  1.1  mlelstv 
     31  1.1  mlelstv /*
     32  1.1  mlelstv  * nfs definitions as per the version 3 specs
     33  1.1  mlelstv  */
     34  1.1  mlelstv 
     35  1.1  mlelstv #define NFS_VER3	3
     36  1.1  mlelstv #define	NFS_V3FHSIZE	64
     37  1.1  mlelstv 
     38  1.1  mlelstv /* Sizes in bytes of various nfs rpc components */
     39  1.1  mlelstv #define	NFSX_V3FH	64
     40  1.1  mlelstv #define	NFSX_V3FATTR	84
     41  1.1  mlelstv 
     42  1.1  mlelstv /* Different V3 procedure numbers that we need */
     43  1.1  mlelstv #define NFSV3PROC_LOOKUP          3
     44  1.1  mlelstv 
     45  1.1  mlelstv /* Structs for common parts of the rpc's */
     46  1.1  mlelstv struct nfsv3_time {
     47  1.1  mlelstv 	n_long	nfs_sec;
     48  1.1  mlelstv 	n_long	nfs_nsec;
     49  1.1  mlelstv };
     50  1.1  mlelstv 
     51  1.1  mlelstv struct nfsv3_spec {
     52  1.1  mlelstv         n_long specdata1;
     53  1.1  mlelstv         n_long specdata2;
     54  1.1  mlelstv };
     55  1.1  mlelstv 
     56  1.1  mlelstv /*
     57  1.1  mlelstv  * File attributes and setable attributes.
     58  1.1  mlelstv  */
     59  1.1  mlelstv struct nfsv3_fattr {
     60  1.1  mlelstv 	n_long	fa_type;
     61  1.1  mlelstv 	n_long	fa_mode;
     62  1.1  mlelstv 	n_long	fa_nlink;
     63  1.1  mlelstv 	n_long	fa_uid;
     64  1.1  mlelstv 	n_long	fa_gid;
     65  1.1  mlelstv 	n_long	fa_size[2]; /* nfsuint64 */
     66  1.1  mlelstv 	n_long	fa_used[2]; /* nfsuint64 */
     67  1.1  mlelstv 	struct nfsv3_spec fa_rdev;
     68  1.1  mlelstv 	n_long	fa_fsid[2]; /* nfsuint64 */
     69  1.1  mlelstv 	n_long	fa_fileid[2]; /* nfsuint64 */
     70  1.1  mlelstv 	struct nfsv3_time fa_atime;
     71  1.1  mlelstv 	struct nfsv3_time fa_mtime;
     72  1.1  mlelstv 	struct nfsv3_time fa_ctime;
     73  1.1  mlelstv };
     74