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