1 /* @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC */
4 * Network lock manager protocol definition
5 * Copyright (c) 2010, Oracle America, Inc.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following
14 * disclaimer in the documentation and/or other materials
15 * provided with the distribution.
16 * * Neither the name of the "Oracle America, Inc." nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * protocol used between local lock manager and remote lock manager
37 %#define LM_MAXSTRLEN 1024
38 %#define MAXNAMELEN LM_MAXSTRLEN+1
42 * status of a call to the lock manager
47 nlm_denied_nolocks = 2,
49 nlm_denied_grace_period = 4
60 union nlm_testrply switch (nlm_stats stat) {
62 struct nlm_holder holder;
82 string caller_name<LM_MAXSTRLEN>;
83 netobj fh; /* identify a file */
84 netobj oh; /* identify owner of a lock */
85 int svid; /* generated from pid for svid */
94 struct nlm_lock alock;
95 bool reclaim; /* used for recovering locks */
96 int state; /* specify local status monitor state */
103 struct nlm_lock alock;
106 struct nlm_testargs {
109 struct nlm_lock alock;
112 struct nlm_unlockargs {
114 struct nlm_lock alock;
120 % * The following enums are actually bit encoded for efficient
121 % * boolean algebra.... DON'T change them.....
125 fsm_DN = 0, /* deny none */
126 fsm_DR = 1, /* deny read */
127 fsm_DW = 2, /* deny write */
128 fsm_DRW = 3 /* deny read/write */
132 fsa_NONE = 0, /* for completeness */
133 fsa_R = 1, /* read only */
134 fsa_W = 2, /* write only */
135 fsa_RW = 3 /* read/write */
139 string caller_name<LM_MAXSTRLEN>;
146 struct nlm_shareargs {
152 struct nlm_shareres {
159 string name<MAXNAMELEN>;
164 * Over-the-wire protocol used between the network lock managers
170 nlm_testres NLM_TEST(struct nlm_testargs) = 1;
172 nlm_res NLM_LOCK(struct nlm_lockargs) = 2;
174 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3;
175 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4;
178 * remote lock manager call-back to grant lock
180 nlm_res NLM_GRANTED(struct nlm_testargs)= 5;
182 * message passing style of requesting lock
184 void NLM_TEST_MSG(struct nlm_testargs) = 6;
185 void NLM_LOCK_MSG(struct nlm_lockargs) = 7;
186 void NLM_CANCEL_MSG(struct nlm_cancargs) =8;
187 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
188 void NLM_GRANTED_MSG(struct nlm_testargs) = 10;
189 void NLM_TEST_RES(nlm_testres) = 11;
190 void NLM_LOCK_RES(nlm_res) = 12;
191 void NLM_CANCEL_RES(nlm_res) = 13;
192 void NLM_UNLOCK_RES(nlm_res) = 14;
193 void NLM_GRANTED_RES(nlm_res) = 15;
197 nlm_shareres NLM_SHARE(nlm_shareargs) = 20;
198 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21;
199 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22;
200 void NLM_FREE_ALL(nlm_notify) = 23;