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 % * $FreeBSD: src/include/rpcsvc/nlm_prot.x,v 1.8.2.1 2001/08/01 06:39:36 alfred Exp $
5 % * $DragonFly: src/include/rpcsvc/nlm_prot.x,v 1.2 2003/06/17 06:25:58 dillon Exp $
9 * Network lock manager protocol definition
10 * Copyright (C) 1986 Sun Microsystems, Inc.
12 * protocol used between local lock manager and remote lock manager
16 %#define LM_MAXSTRLEN 1024
17 %#define MAXNAMELEN LM_MAXSTRLEN+1
18 %#include <sys/types.h>
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 int32_t svid; /* generated from pid for svid */
74 struct nlm_lock alock;
75 bool reclaim; /* used for recovering locks */
76 int32_t 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>;
146 nlm4_denied_nolocks = 2,
148 nlm4_denied_grace_period = 4,
168 union nlm4_testrply switch (nlm4_stats stat) {
170 struct nlm4_holder holder;
180 struct nlm4_testres {
187 string caller_name<LM_MAXSTRLEN>;
188 netobj fh; /* identify a file */
189 netobj oh; /* identify owner of a lock */
190 int32_t svid; /* generated from pid for svid */
195 struct nlm4_lockargs {
199 struct nlm4_lock alock;
200 bool reclaim; /* used for recovering locks */
201 int32_t state; /* specify local status monitor state */
205 struct nlm4_cancargs {
209 struct nlm4_lock alock;
212 struct nlm4_testargs {
215 struct nlm4_lock alock;
218 struct nlm4_unlockargs {
220 struct nlm4_lock alock;
224 string caller_name<LM_MAXSTRLEN>;
231 struct nlm4_shareargs {
237 struct nlm4_shareres {
244 string name<MAXNAMELEN>;
249 * Over-the-wire protocol used between the network lock managers
255 nlm_testres NLM_TEST(struct nlm_testargs) = 1;
257 nlm_res NLM_LOCK(struct nlm_lockargs) = 2;
259 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3;
260 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4;
263 * remote lock manager call-back to grant lock
265 nlm_res NLM_GRANTED(struct nlm_testargs)= 5;
267 * message passing style of requesting lock
269 void NLM_TEST_MSG(struct nlm_testargs) = 6;
270 void NLM_LOCK_MSG(struct nlm_lockargs) = 7;
271 void NLM_CANCEL_MSG(struct nlm_cancargs) =8;
272 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
273 void NLM_GRANTED_MSG(struct nlm_testargs) = 10;
274 void NLM_TEST_RES(nlm_testres) = 11;
275 void NLM_LOCK_RES(nlm_res) = 12;
276 void NLM_CANCEL_RES(nlm_res) = 13;
277 void NLM_UNLOCK_RES(nlm_res) = 14;
278 void NLM_GRANTED_RES(nlm_res) = 15;
282 nlm_shareres NLM_SHARE(nlm_shareargs) = 20;
283 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21;
284 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22;
285 void NLM_FREE_ALL(nlm_notify) = 23;
289 void NLMPROC4_NULL(void) = 0;
291 nlm4_testres NLMPROC4_TEST(struct nlm4_testargs) = 1;
293 nlm4_res NLMPROC4_LOCK(struct nlm4_lockargs) = 2;
295 nlm4_res NLMPROC4_CANCEL(struct nlm4_cancargs) = 3;
296 nlm4_res NLMPROC4_UNLOCK(struct nlm4_unlockargs) = 4;
299 * remote lock manager call-back to grant lock
301 nlm4_res NLMPROC4_GRANTED(struct nlm4_testargs)= 5;
303 * message passing style of requesting lock
305 void NLMPROC4_TEST_MSG(struct nlm4_testargs) = 6;
306 void NLMPROC4_LOCK_MSG(struct nlm4_lockargs) = 7;
307 void NLMPROC4_CANCEL_MSG(struct nlm4_cancargs) =8;
308 void NLMPROC4_UNLOCK_MSG(struct nlm4_unlockargs) = 9;
309 void NLMPROC4_GRANTED_MSG(struct nlm4_testargs) = 10;
310 void NLMPROC4_TEST_RES(nlm4_testres) = 11;
311 void NLMPROC4_LOCK_RES(nlm4_res) = 12;
312 void NLMPROC4_CANCEL_RES(nlm4_res) = 13;
313 void NLMPROC4_UNLOCK_RES(nlm4_res) = 14;
314 void NLMPROC4_GRANTED_RES(nlm4_res) = 15;
316 nlm4_shareres NLMPROC4_SHARE(nlm4_shareargs) = 20;
317 nlm4_shareres NLMPROC4_UNSHARE(nlm4_shareargs) = 21;
318 nlm4_res NLMPROC4_NM_LOCK(nlm4_lockargs) = 22;
319 void NLMPROC4_FREE_ALL(nlm4_notify) = 23;