2 * Network lock manager protocol definition
3 * Copyright (C) 1986 Sun Microsystems, Inc.
5 * protocol used between local lock manager and remote lock manager
9 %#define LM_MAXSTRLEN 1024
10 %#define MAXNAMELEN LM_MAXSTRLEN+1
12 %#include <sys/cdefs.h>
14 %/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
15 %/*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
16 %__RCSID("$NetBSD: nlm_prot.x,v 1.6 2000/06/07 14:30:15 bouyer Exp $");
17 %#endif /* not lint */
18 %__FBSDID("$FreeBSD$");
22 * status of a call to the lock manager
27 nlm_denied_nolocks = 2,
29 nlm_denied_grace_period = 4,
41 union nlm_testrply switch (nlm_stats stat) {
43 struct nlm_holder holder;
63 string caller_name<LM_MAXSTRLEN>;
64 netobj fh; /* identify a file */
65 netobj oh; /* identify owner of a lock */
66 int svid; /* generated from pid for svid */
75 struct nlm_lock alock;
76 bool reclaim; /* used for recovering locks */
77 int state; /* specify local status monitor state */
84 struct nlm_lock alock;
90 struct nlm_lock alock;
93 struct nlm_unlockargs {
95 struct nlm_lock alock;
101 % * The following enums are actually bit encoded for efficient
102 % * boolean algebra.... DON'T change them.....
106 fsm_DN = 0, /* deny none */
107 fsm_DR = 1, /* deny read */
108 fsm_DW = 2, /* deny write */
109 fsm_DRW = 3 /* deny read/write */
113 fsa_NONE = 0, /* for completeness */
114 fsa_R = 1, /* read only */
115 fsa_W = 2, /* write only */
116 fsa_RW = 3 /* read/write */
120 string caller_name<LM_MAXSTRLEN>;
127 struct nlm_shareargs {
133 struct nlm_shareres {
140 string name<MAXNAMELEN>;
145 %/* definitions for NLM version 4 */
150 nlm4_denied_nolocks = 2,
152 nlm4_denied_grace_period = 4,
173 string caller_name<MAXNAMELEN>;
182 string caller_name<MAXNAMELEN>;
189 union nlm4_testrply switch (nlm4_stats stat) {
191 struct nlm4_holder holder;
196 struct nlm4_testres {
201 struct nlm4_testargs {
204 struct nlm4_lock alock;
212 struct nlm4_lockargs {
216 struct nlm4_lock alock;
217 bool reclaim; /* used for recovering locks */
218 int state; /* specify local status monitor state */
221 struct nlm4_cancargs {
225 struct nlm4_lock alock;
228 struct nlm4_unlockargs {
230 struct nlm4_lock alock;
233 struct nlm4_shareargs {
239 struct nlm4_shareres {
246 * argument for the procedure called by rpc.statd when a monitored host
248 * XXX assumes LM_MAXSTRLEN == SM_MAXSTRLEN
250 struct nlm_sm_status {
251 string mon_name<LM_MAXSTRLEN>; /* name of host */
252 int state; /* new state */
253 opaque priv[16]; /* private data */
257 string name<MAXNAMELEN>;
262 * Over-the-wire protocol used between the network lock managers
268 void NLM_SM_NOTIFY(struct nlm_sm_status) = 1;
273 nlm_testres NLM_TEST(struct nlm_testargs) = 1;
275 nlm_res NLM_LOCK(struct nlm_lockargs) = 2;
277 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3;
278 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4;
281 * remote lock manager call-back to grant lock
283 nlm_res NLM_GRANTED(struct nlm_testargs)= 5;
285 * message passing style of requesting lock
287 void NLM_TEST_MSG(struct nlm_testargs) = 6;
288 void NLM_LOCK_MSG(struct nlm_lockargs) = 7;
289 void NLM_CANCEL_MSG(struct nlm_cancargs) =8;
290 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
291 void NLM_GRANTED_MSG(struct nlm_testargs) = 10;
292 void NLM_TEST_RES(nlm_testres) = 11;
293 void NLM_LOCK_RES(nlm_res) = 12;
294 void NLM_CANCEL_RES(nlm_res) = 13;
295 void NLM_UNLOCK_RES(nlm_res) = 14;
296 void NLM_GRANTED_RES(nlm_res) = 15;
300 nlm_shareres NLM_SHARE(nlm_shareargs) = 20;
301 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21;
302 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22;
303 void NLM_FREE_ALL(nlm_notify) = 23;
307 nlm4_testres NLM4_TEST(nlm4_testargs) = 1;
308 nlm4_res NLM4_LOCK(nlm4_lockargs) = 2;
309 nlm4_res NLM4_CANCEL(nlm4_cancargs) = 3;
310 nlm4_res NLM4_UNLOCK(nlm4_unlockargs) = 4;
311 nlm4_res NLM4_GRANTED(nlm4_testargs) = 5;
312 void NLM4_TEST_MSG(nlm4_testargs) = 6;
313 void NLM4_LOCK_MSG(nlm4_lockargs) = 7;
314 void NLM4_CANCEL_MSG(nlm4_cancargs) = 8;
315 void NLM4_UNLOCK_MSG(nlm4_unlockargs) = 9;
316 void NLM4_GRANTED_MSG(nlm4_testargs) = 10;
317 void NLM4_TEST_RES(nlm4_testres) = 11;
318 void NLM4_LOCK_RES(nlm4_res) = 12;
319 void NLM4_CANCEL_RES(nlm4_res) = 13;
320 void NLM4_UNLOCK_RES(nlm4_res) = 14;
321 void NLM4_GRANTED_RES(nlm4_res) = 15;
322 nlm4_shareres NLM4_SHARE(nlm4_shareargs) = 20;
323 nlm4_shareres NLM4_UNSHARE(nlm4_shareargs) = 21;
324 nlm4_res NLM4_NM_LOCK(nlm4_lockargs) = 22;
325 void NLM4_FREE_ALL(nlm4_notify) = 23;