Home | History | Annotate | Download | only in rpcsvc
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 /*
     22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     23  * Use is subject to license terms.
     24  */
     25 
     26 #if defined(USE_FOR_SNOOP)
     27 %#include "ds_nfs_com.h"
     28 #else
     29 #if defined(RPC_XDR) || defined(RPC_SVC) || defined(RPC_CLNT)
     30 %#include <nfs/ds.h>
     31 #endif
     32 #endif
     33 
     34 /*
     35  *  Dot-x file for common parts of NFS41 pcol and data
     36  *  server control protocol.
     37  */
     38 
     39 #ifdef USE_FOR_SNOOP
     40 
     41 struct netaddr4 {
     42 	string na_r_netid<>;	/* network id */
     43 	string na_r_addr<>;	/* universal address */
     44 };
     45 
     46 const NFS4_FHSIZE		= 128;
     47 typedef opaque		nfs_fh4<NFS4_FHSIZE>;
     48 
     49 typedef opaque		utf8string<>;
     50 typedef utf8string	utf8str_cs;
     51 typedef utf8str_cs	component4;
     52 
     53 /*
     54  * File access handle
     55  */
     56 
     57 typedef uint64_t	offset4;
     58 typedef uint32_t	count4;
     59 typedef	uint64_t	length4;
     60 typedef uint64_t	clientid4;
     61 
     62 
     63 struct stateid4 {
     64 	uint32_t	seqid;
     65 	opaque		other[12];
     66 };
     67 
     68 /*
     69  * FSID structure for major/minor
     70  */
     71 struct fsid4 {
     72 	uint64_t	major;
     73 	uint64_t	minor;
     74 };
     75 
     76 /*
     77  * From RFC 2203
     78  */
     79 enum rpc_gss_svc_t {
     80 	RPC_GSS_SVC_NONE	= 1,
     81 	RPC_GSS_SVC_INTEGRITY	= 2,
     82 	RPC_GSS_SVC_PRIVACY	= 3
     83 };
     84 
     85 typedef opaque		sec_oid4<>;
     86 #endif
     87 
     88 typedef uint32_t	qop4;
     89 
     90 struct rpcsec_gss_info {
     91 	sec_oid4	oid;
     92 	qop4		qop;
     93 	rpc_gss_svc_t	service;
     94 };
     95 
     96 /*
     97  * WRITE: Write to file
     98  */
     99 enum stable_how4 {
    100 	UNSTABLE4	= 0,
    101 	DATA_SYNC4	= 1,
    102 	FILE_SYNC4	= 2
    103 };
    104 
    105 #ifdef USE_FOR_SNOOP
    106 
    107 const NFS4_OPAQUE_LIMIT = 1024;
    108 const NFS4_VERIFIER_SIZE = 8;
    109 typedef opaque verifier4[NFS4_VERIFIER_SIZE];
    110 
    111 /*
    112  * NFSv4.1 Client Owner (aka long hand client ID)
    113  */
    114 struct client_owner4 {
    115 	verifier4       co_verifier;
    116 	opaque          co_ownerid<NFS4_OPAQUE_LIMIT>;
    117 };
    118 
    119 /*
    120  * data structures new to NFSv4.1
    121  */
    122 enum layouttype4 {
    123 	LAYOUT4_NFSV4_1_FILES  = 0x1,
    124 	LAYOUT4_OSD2_OBJECTS   = 0x2,
    125 	LAYOUT4_BLOCK_VOLUME   = 0x3
    126 };
    127 
    128 struct layout_content4 {
    129         layouttype4 loc_type;
    130         opaque      loc_body<>;
    131 };
    132 
    133 struct layouthint4 {
    134 	layouttype4		loh_type;
    135 	opaque			loh_body<>;
    136 };
    137 
    138 enum layoutiomode4 {
    139 	LAYOUTIOMODE4_READ	= 1,
    140 	LAYOUTIOMODE4_RW	= 2,
    141 	LAYOUTIOMODE4_ANY	= 3
    142 };
    143 
    144 struct layout4 {
    145 	offset4			lo_offset;
    146 	length4			lo_length;
    147 	layoutiomode4		lo_iomode;
    148 	layout_content4		lo_content;
    149 };
    150 #endif
    151