NLM: initial support for NLM
[deb_libnfs.git] / nlm / nlm.x
1 /* based on rfc1813 and wireshark */
2
3 const COOKIESIZE = 4;
4 typedef opaque nlm_cookie[COOKIESIZE];
5
6 enum nlmstat4 {
7 NLM4_GRANTED = 0,
8 NLM4_DENIED = 1,
9 NLM4_DENIED_NOLOCKS = 2,
10 NLM4_BLOCKED = 3,
11 NLM4_DENIED_GRACE_PERIOD = 4,
12 NLM4_DEADLCK = 5,
13 NLM4_ROFS = 6,
14 NLM4_STALE_FH = 7,
15 NLM4_FBIG = 8,
16 NLM4_FAILED = 9
17 };
18
19 struct nlm4_holder {
20 bool exclusive;
21 unsigned int svid;
22 netobj oh;
23 unsigned hyper l_offset;
24 unsigned hyper l_len;
25 };
26
27 const NLM_MAXNAME = 256;
28 struct nlm4_lock {
29 string caller_name<NLM_MAXNAME>;
30 netobj fh;
31 netobj oh;
32 unsigned int svid;
33 unsigned hyper l_offset;
34 unsigned hyper l_len;
35 };
36
37 struct nlm4_share {
38 string caller_name<NLM_MAXNAME>;
39 netobj fh;
40 netobj oh;
41 unsigned int mode;
42 unsigned int access;
43 };
44
45
46 struct nlm4_testres_ok {
47 nlm_cookie cookie;
48 nlm4_holder holder;
49 };
50
51 union nlm4_testres switch (nlmstat4 nlm_status) {
52 case NLM4_GRANTED:
53 nlm4_testres_ok lock;
54 default:
55 void;
56 };
57
58 struct nlm4_testargs {
59 nlm_cookie cookie;
60 bool exclusive;
61 nlm4_lock lock;
62 };
63
64 program NLM_PROGRAM {
65 version NLM_V4 {
66 void
67 NLM4_NULL(void) = 0;
68
69 nlm4_testres
70 NLM4_TEST(nlm4_testargs) = 1;
71
72 /* nlm4_res */
73 /* NLM4_LOCK(nlm4_lockargs) = 2; */
74
75 /* nlm4_res */
76 /* NLM4_CANCEL(nlm4_cancargs) = 3; */
77
78 /* nlm4_res */
79 /* NLM4_UNLOCK(nlm4_unlockargs) = 4; */
80
81 /* nlm4_res */
82 /* NLM4_GRANTED(nlm4_testargs) = 5; */
83
84 /* void */
85 /* NLM4_TEST_MSG(nlm4_testargs) = 6; */
86
87 /* void */
88 /* NLM4_LOCK_MSG(nlm4_lockargs) = 7; */
89
90 /* void */
91 /* NLM4_CANCEL_MSG(nlm4_cancargs) = 8; */
92
93 /* void */
94 /* NLM4_UNLOCK_MSG(nlm4_unlockargs) = 9; */
95
96 /* void */
97 /* NLM4_GRANTED_MSG(nlm4_testargs) = 10; */
98
99 /* void */
100 /* NLM4_TEST_RES(nlm4_testres) = 11; */
101
102 /* void */
103 /* NLM4_LOCK_RES(nlm4_res) = 12; */
104
105 /* void */
106 /* NLM4_CANCEL_RES(nlm4_res) = 13; */
107
108 /* void */
109 /* NLM4_UNLOCK_RES(nlm4_res) = 14; */
110
111 /* void */
112 /* NLM4_GRANTED_RES(nlm4_res) = 15; */
113
114 /* nlm4_shareres */
115 /* NLM4_SHARE(nlm4_shareargs) = 20; */
116
117 /* nlm4_shareres */
118 /* NLM4_UNSHARE(nlm4_shareargs) = 21; */
119
120 /* nlm4_res */
121 /* NLM4_NM_LOCK(nlm4_lockargs) = 22; */
122
123 /* void */
124 /* NLM4_FREE_ALL(nlm4_notify) = 23; */
125 } = 4;
126 } = 100021;