NLM: add UNLOCK call
[deb_libnfs.git] / nlm / nlm.x
CommitLineData
6916a665
RS
1/* based on rfc1813 and wireshark */
2
e01ed6a2
RS
3
4struct nlm_fh4 {
5 opaque data<>;
6};
7
8typedef string nlm4_oh<>;
9
10struct nlm_cookie {
11 opaque data<>;
12};
6916a665
RS
13
14enum nlmstat4 {
15 NLM4_GRANTED = 0,
16 NLM4_DENIED = 1,
17 NLM4_DENIED_NOLOCKS = 2,
18 NLM4_BLOCKED = 3,
19 NLM4_DENIED_GRACE_PERIOD = 4,
20 NLM4_DEADLCK = 5,
21 NLM4_ROFS = 6,
22 NLM4_STALE_FH = 7,
23 NLM4_FBIG = 8,
24 NLM4_FAILED = 9
25};
26
27struct nlm4_holder {
e01ed6a2
RS
28 bool exclusive;
29 unsigned int svid;
30 nlm4_oh oh;
6916a665
RS
31 unsigned hyper l_offset;
32 unsigned hyper l_len;
33};
34
35const NLM_MAXNAME = 256;
36struct nlm4_lock {
e01ed6a2
RS
37 string caller_name<NLM_MAXNAME>;
38 struct nlm_fh4 fh;
39 nlm4_oh oh;
40 unsigned int svid;
6916a665
RS
41 unsigned hyper l_offset;
42 unsigned hyper l_len;
43};
44
45struct nlm4_share {
e01ed6a2
RS
46 string caller_name<NLM_MAXNAME>;
47 struct nlm_fh4 fh;
48 nlm4_oh oh;
49 unsigned int mode;
50 unsigned int access;
6916a665
RS
51};
52
2faefcac 53struct nlm4_testres_denied {
6916a665
RS
54 nlm4_holder holder;
55};
56
2faefcac
RS
57union nlm4_testreply switch (nlmstat4 status) {
58 case NLM4_DENIED:
59 nlm4_testres_denied lock;
6916a665
RS
60 default:
61 void;
62};
63
2faefcac
RS
64struct NLM4_TESTres {
65 nlm_cookie cookie;
66 nlm4_testreply reply;
67};
68
e01ed6a2 69struct NLM4_TESTargs {
6916a665
RS
70 nlm_cookie cookie;
71 bool exclusive;
72 nlm4_lock lock;
73};
74
c880fdac
RS
75struct NLM4_CANCres {
76 nlm_cookie cookie;
77 nlmstat4 status;
78};
79
80struct NLM4_CANCargs {
81 nlm_cookie cookie;
82 bool block;
83 bool exclusive;
84 nlm4_lock lock;
85};
86
8d3c1af0
RS
87struct NLM4_UNLOCKres {
88 nlm_cookie cookie;
89 nlmstat4 status;
90};
91
92struct NLM4_UNLOCKargs {
93 nlm_cookie cookie;
94 nlm4_lock lock;
95};
96
6916a665
RS
97program NLM_PROGRAM {
98 version NLM_V4 {
99 void
100 NLM4_NULL(void) = 0;
101
e01ed6a2
RS
102 NLM4_TESTres
103 NLM4_TEST(NLM4_TESTargs) = 1;
6916a665
RS
104
105/* nlm4_res */
106/* NLM4_LOCK(nlm4_lockargs) = 2; */
107
c880fdac
RS
108 NLM4_CANCres
109 NLM4_CANCEL(NLM4_CANCargs) = 3;
6916a665 110
8d3c1af0
RS
111 NLM4_UNLOCKres
112 NLM4_UNLOCK(NLM4_UNLOCKargs) = 4;
6916a665
RS
113
114/* nlm4_res */
115/* NLM4_GRANTED(nlm4_testargs) = 5; */
116
e01ed6a2
RS
117 void
118 NLM4_TEST_MSG(NLM4_TESTargs) = 6;
6916a665
RS
119
120/* void */
121/* NLM4_LOCK_MSG(nlm4_lockargs) = 7; */
122
c880fdac
RS
123 void
124 NLM4_CANCEL_MSG(NLM4_CANCargs) = 8;
6916a665 125
8d3c1af0
RS
126 void
127 NLM4_UNLOCK_MSG(NLM4_UNLOCKargs) = 9;
6916a665
RS
128
129/* void */
130/* NLM4_GRANTED_MSG(nlm4_testargs) = 10; */
131
e01ed6a2
RS
132 void
133 NLM4_TEST_RES(NLM4_TESTres) = 11;
6916a665
RS
134
135/* void */
136/* NLM4_LOCK_RES(nlm4_res) = 12; */
137
c880fdac
RS
138 void
139 NLM4_CANCEL_RES(NLM4_CANCres) = 13;
6916a665 140
8d3c1af0
RS
141 void
142 NLM4_UNLOCK_RES(NLM4_UNLOCKres) = 14;
6916a665
RS
143
144/* void */
145/* NLM4_GRANTED_RES(nlm4_res) = 15; */
146
147/* nlm4_shareres */
148/* NLM4_SHARE(nlm4_shareargs) = 20; */
149
150/* nlm4_shareres */
151/* NLM4_UNSHARE(nlm4_shareargs) = 21; */
152
153/* nlm4_res */
154/* NLM4_NM_LOCK(nlm4_lockargs) = 22; */
155
156/* void */
157/* NLM4_FREE_ALL(nlm4_notify) = 23; */
158 } = 4;
159} = 100021;