]> git.saurik.com Git - apple/xnu.git/blob - bsd/nfs/rpcv2.h
xnu-1504.15.3.tar.gz
[apple/xnu.git] / bsd / nfs / rpcv2.h
1 /*
2 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
29 /*
30 * Copyright (c) 1989, 1993
31 * The Regents of the University of California. All rights reserved.
32 *
33 * This code is derived from software contributed to Berkeley by
34 * Rick Macklem at The University of Guelph.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. All advertising materials mentioning features or use of this software
45 * must display the following acknowledgement:
46 * This product includes software developed by the University of
47 * California, Berkeley and its contributors.
48 * 4. Neither the name of the University nor the names of its contributors
49 * may be used to endorse or promote products derived from this software
50 * without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE.
63 *
64 * @(#)rpcv2.h 8.2 (Berkeley) 3/30/95
65 * FreeBSD-Id: rpcv2.h,v 1.8 1997/05/11 18:05:39 tegge Exp $
66 */
67
68
69 #ifndef _NFS_RPCV2_H_
70 #define _NFS_RPCV2_H_
71
72 #include <sys/appleapiopts.h>
73
74 #ifdef __APPLE_API_PRIVATE
75 /*
76 * Definitions for Sun RPC Version 2, from
77 * "RPC: Remote Procedure Call Protocol Specification" RFC1057
78 */
79
80 /* Version # */
81 #define RPC_VER2 2
82
83 /* Authentication */
84 #define RPCAUTH_NULL 0
85 #define RPCAUTH_UNIX 1
86 #define RPCAUTH_SYS RPCAUTH_UNIX
87 #define RPCAUTH_SHORT 2
88 #define RPCAUTH_KERB4 4
89 #define RPCAUTH_KRB5 390003
90 #define RPCAUTH_KRB5I 390004
91 #define RPCAUTH_KRB5P 390005
92
93 #define RPCAUTH_MAXSIZ 400
94 #define RPCAUTH_UNIXGIDS 16
95
96 /*
97 * Constants associated with authentication flavours.
98 */
99 #define RPCAKN_FULLNAME 0
100 #define RPCAKN_NICKNAME 1
101
102 /* Rpc Constants */
103 #define RPC_CALL 0
104 #define RPC_REPLY 1
105 #define RPC_MSGACCEPTED 0
106 #define RPC_MSGDENIED 1
107 #define RPC_SUCCESS 0
108 #define RPC_PROGUNAVAIL 1
109 #define RPC_PROGMISMATCH 2
110 #define RPC_PROCUNAVAIL 3
111 #define RPC_GARBAGE 4 /* I like this one */
112 #define RPC_SYSTEM_ERR 5
113 #define RPC_MISMATCH 0
114 #define RPC_AUTHERR 1
115
116 /* Authentication failures */
117 #define AUTH_BADCRED 1
118 #define AUTH_REJECTCRED 2
119 #define AUTH_BADVERF 3
120 #define AUTH_REJECTVERF 4
121 #define AUTH_TOOWEAK 5 /* Give em wheaties */
122 #define AUTH_INVALIDRESP 6
123 #define AUTH_FAILED 7
124 #define AUTH_KERB_GENERIC 8
125 #define AUTH_TIMEEXPIRE 9
126 #define AUTH_TKT_FILE 10
127 #define AUTH_DECODE 11
128 #define AUTH_NET_ADDR 12
129 #define RPCSEC_GSS_CREDPROBLEM 13
130 #define RPCSEC_GSS_CTXPROBLEM 14
131
132 /* Sizes of rpc header parts */
133 #define RPC_SIZ 24
134 #define RPC_REPLYSIZ 28
135
136 /* RPC Prog definitions */
137 #define RPCPROG_MNT 100005
138 #define RPCMNT_VER1 1
139 #define RPCMNT_VER3 3
140 #define RPCMNT_MOUNT 1
141 #define RPCMNT_DUMP 2
142 #define RPCMNT_UMOUNT 3
143 #define RPCMNT_UMNTALL 4
144 #define RPCMNT_EXPORT 5
145 #define RPCMNT_NAMELEN 255
146 #define RPCMNT_PATHLEN 1024
147 #define RPCPROG_NFS 100003
148
149 #define RPCPROG_RQUOTA 100011
150 #define RPCRQUOTA_VER 1
151 #define RPCRQUOTA_EXT_VER 2
152 #define RPCRQUOTA_GET 1
153 #define RQUOTA_STAT_OK 1
154 #define RQUOTA_STAT_NOQUOTA 2
155 #define RQUOTA_STAT_EPERM 3
156
157 #endif /* __APPLE_API_PRIVATE */
158 #endif /* _NFS_RPCV2_H_ */