1 /* @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC */
2 /* @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro */
5 * Network lock manager protocol definition
6 * Copyright (C) 1986 Sun Microsystems, Inc.
8 * protocol used between local lock manager and remote lock manager
12 %#define LM_MAXSTRLEN 1024
13 %#define MAXNAMELEN LM_MAXSTRLEN+1
14 %#include <sys/types.h>
17 %static const char rcsid[] =
18 % "$FreeBSD: src/include/rpcsvc/nlm_prot.x,v 1.8.2.1 2001/08/01 06:39:36 alfred Exp $";
19 %#endif /* not lint */
23 * status of a call to the lock manager
28 nlm_denied_nolocks = 2,
30 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 int32_t svid; /* generated from pid for svid */
75 struct nlm_lock alock;
76 bool reclaim; /* used for recovering locks */
77 int32_t 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>;
147 nlm4_denied_nolocks = 2,
149 nlm4_denied_grace_period = 4,
169 union nlm4_testrply switch (nlm4_stats stat) {
171 struct nlm4_holder holder;
181 struct nlm4_testres {
188 string caller_name<LM_MAXSTRLEN>;
189 netobj fh; /* identify a file */
190 netobj oh; /* identify owner of a lock */
191 int32_t svid; /* generated from pid for svid */
196 struct nlm4_lockargs {
200 struct nlm4_lock alock;
201 bool reclaim; /* used for recovering locks */
202 int32_t state; /* specify local status monitor state */
206 struct nlm4_cancargs {
210 struct nlm4_lock alock;
213 struct nlm4_testargs {
216 struct nlm4_lock alock;
219 struct nlm4_unlockargs {
221 struct nlm4_lock alock;
225 string caller_name<LM_MAXSTRLEN>;
232 struct nlm4_shareargs {
238 struct nlm4_shareres {
245 string name<MAXNAMELEN>;
250 * Over-the-wire protocol used between the network lock managers
256 nlm_testres NLM_TEST(struct nlm_testargs) = 1;
258 nlm_res NLM_LOCK(struct nlm_lockargs) = 2;
260 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3;
261 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4;
264 * remote lock manager call-back to grant lock
266 nlm_res NLM_GRANTED(struct nlm_testargs)= 5;
268 * message passing style of requesting lock
270 void NLM_TEST_MSG(struct nlm_testargs) = 6;
271 void NLM_LOCK_MSG(struct nlm_lockargs) = 7;
272 void NLM_CANCEL_MSG(struct nlm_cancargs) =8;
273 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
274 void NLM_GRANTED_MSG(struct nlm_testargs) = 10;
275 void NLM_TEST_RES(nlm_testres) = 11;
276 void NLM_LOCK_RES(nlm_res) = 12;
277 void NLM_CANCEL_RES(nlm_res) = 13;
278 void NLM_UNLOCK_RES(nlm_res) = 14;
279 void NLM_GRANTED_RES(nlm_res) = 15;
283 nlm_shareres NLM_SHARE(nlm_shareargs) = 20;
284 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21;
285 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22;
286 void NLM_FREE_ALL(nlm_notify) = 23;
290 void NLMPROC4_NULL(void) = 0;
292 nlm4_testres NLMPROC4_TEST(struct nlm4_testargs) = 1;
294 nlm4_res NLMPROC4_LOCK(struct nlm4_lockargs) = 2;
296 nlm4_res NLMPROC4_CANCEL(struct nlm4_cancargs) = 3;
297 nlm4_res NLMPROC4_UNLOCK(struct nlm4_unlockargs) = 4;
300 * remote lock manager call-back to grant lock
302 nlm4_res NLMPROC4_GRANTED(struct nlm4_testargs)= 5;
304 * message passing style of requesting lock
306 void NLMPROC4_TEST_MSG(struct nlm4_testargs) = 6;
307 void NLMPROC4_LOCK_MSG(struct nlm4_lockargs) = 7;
308 void NLMPROC4_CANCEL_MSG(struct nlm4_cancargs) =8;
309 void NLMPROC4_UNLOCK_MSG(struct nlm4_unlockargs) = 9;
310 void NLMPROC4_GRANTED_MSG(struct nlm4_testargs) = 10;
311 void NLMPROC4_TEST_RES(nlm4_testres) = 11;
312 void NLMPROC4_LOCK_RES(nlm4_res) = 12;
313 void NLMPROC4_CANCEL_RES(nlm4_res) = 13;
314 void NLMPROC4_UNLOCK_RES(nlm4_res) = 14;
315 void NLMPROC4_GRANTED_RES(nlm4_res) = 15;
317 nlm4_shareres NLMPROC4_SHARE(nlm4_shareargs) = 20;
318 nlm4_shareres NLMPROC4_UNSHARE(nlm4_shareargs) = 21;
319 nlm4_res NLMPROC4_NM_LOCK(nlm4_lockargs) = 22;
320 void NLMPROC4_FREE_ALL(nlm4_notify) = 23;