2 % * @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro
3 % * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC
4 % * $NetBSD: nlm_prot.x,v 1.6 2000/06/07 14:30:15 bouyer Exp $
5 % * $FreeBSD: src/include/rpcsvc/nlm_prot.x,v 1.9 2001/03/19 12:49:48 alfred Exp $
6 % * $DragonFly: src/include/rpcsvc/nlm_prot.x,v 1.2 2003/06/17 04:25:58 dillon Exp $
10 * Network lock manager protocol definition
11 * Copyright (C) 1986 Sun Microsystems, Inc.
13 * protocol used between local lock manager and remote lock manager
17 %#define LM_MAXSTRLEN 1024
18 %#define MAXNAMELEN LM_MAXSTRLEN+1
22 * status of a call to the lock manager
27 nlm_denied_nolocks = 2,
29 nlm_denied_grace_period = 4
40 union nlm_testrply switch (nlm_stats stat) {
42 struct nlm_holder holder;
62 string caller_name<LM_MAXSTRLEN>;
63 netobj fh; /* identify a file */
64 netobj oh; /* identify owner of a lock */
65 int svid; /* generated from pid for svid */
74 struct nlm_lock alock;
75 bool reclaim; /* used for recovering locks */
76 int state; /* specify local status monitor state */
83 struct nlm_lock alock;
89 struct nlm_lock alock;
92 struct nlm_unlockargs {
94 struct nlm_lock alock;
100 % * The following enums are actually bit encoded for efficient
101 % * boolean algebra.... DON'T change them.....
105 fsm_DN = 0, /* deny none */
106 fsm_DR = 1, /* deny read */
107 fsm_DW = 2, /* deny write */
108 fsm_DRW = 3 /* deny read/write */
112 fsa_NONE = 0, /* for completeness */
113 fsa_R = 1, /* read only */
114 fsa_W = 2, /* write only */
115 fsa_RW = 3 /* read/write */
119 string caller_name<LM_MAXSTRLEN>;
126 struct nlm_shareargs {
132 struct nlm_shareres {
139 string name<MAXNAMELEN>;
144 %/* definitions for NLM version 4 */
149 nlm4_denied_nolock = 2,
151 nlm4_denied_grace_period = 4,
172 string caller_name<MAXNAMELEN>;
181 string caller_name<MAXNAMELEN>;
188 union nlm4_testrply switch (nlm4_stats stat) {
190 struct nlm4_holder holder;
195 struct nlm4_testres {
200 struct nlm4_testargs {
203 struct nlm4_lock alock;
211 struct nlm4_lockargs {
215 struct nlm4_lock alock;
216 bool reclaim; /* used for recovering locks */
217 int state; /* specify local status monitor state */
220 struct nlm4_cancargs {
224 struct nlm4_lock alock;
227 struct nlm4_unlockargs {
229 struct nlm4_lock alock;
232 struct nlm4_shareargs {
238 struct nlm4_shareres {
245 * argument for the procedure called by rpc.statd when a monitored host
247 * XXX assumes LM_MAXSTRLEN == SM_MAXSTRLEN
249 struct nlm_sm_status {
250 string mon_name<LM_MAXSTRLEN>; /* name of host */
251 int state; /* new state */
252 opaque priv[16]; /* private data */
256 * Over-the-wire protocol used between the network lock managers
261 void NLM_SM_NOTIFY(struct nlm_sm_status) = 1;
266 nlm_testres NLM_TEST(struct nlm_testargs) = 1;
268 nlm_res NLM_LOCK(struct nlm_lockargs) = 2;
270 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3;
271 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4;
274 * remote lock manager call-back to grant lock
276 nlm_res NLM_GRANTED(struct nlm_testargs)= 5;
278 * message passing style of requesting lock
280 void NLM_TEST_MSG(struct nlm_testargs) = 6;
281 void NLM_LOCK_MSG(struct nlm_lockargs) = 7;
282 void NLM_CANCEL_MSG(struct nlm_cancargs) =8;
283 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
284 void NLM_GRANTED_MSG(struct nlm_testargs) = 10;
285 void NLM_TEST_RES(nlm_testres) = 11;
286 void NLM_LOCK_RES(nlm_res) = 12;
287 void NLM_CANCEL_RES(nlm_res) = 13;
288 void NLM_UNLOCK_RES(nlm_res) = 14;
289 void NLM_GRANTED_RES(nlm_res) = 15;
293 nlm_shareres NLM_SHARE(nlm_shareargs) = 20;
294 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21;
295 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22;
296 void NLM_FREE_ALL(nlm_notify) = 23;
300 nlm4_testres NLM4_TEST(nlm4_testargs) = 1;
301 nlm4_res NLM4_LOCK(nlm4_lockargs) = 2;
302 nlm4_res NLM4_CANCEL(nlm4_cancargs) = 3;
303 nlm4_res NLM4_UNLOCK(nlm4_unlockargs) = 4;
304 nlm4_res NLM4_GRANTED(nlm4_testargs) = 5;
305 void NLM4_TEST_MSG(nlm4_testargs) = 6;
306 void NLM4_LOCK_MSG(nlm4_lockargs) = 7;
307 void NLM4_CANCEL_MSG(nlm4_cancargs) = 8;
308 void NLM4_UNLOCK_MSG(nlm4_unlockargs) = 9;
309 void NLM4_GRANTED_MSG(nlm4_testargs) = 10;
310 void NLM4_TEST_RES(nlm4_testres) = 11;
311 void NLM4_LOCK_RES(nlm4_res) = 12;
312 void NLM4_CANCEL_RES(nlm4_res) = 13;
313 void NLM4_UNLOCK_RES(nlm4_res) = 14;
314 void NLM4_GRANTED_RES(nlm4_res) = 15;
315 nlm4_shareres NLM4_SHARE(nlm4_shareargs) = 20;
316 nlm4_shareres NLM4_UNSHARE(nlm4_shareargs) = 21;
317 nlm4_res NLM4_NM_LOCK(nlm4_lockargs) = 22;
318 void NLM4_FREE_ALL(nlm_notify) = 23;