xref: /linux/include/linux/sunrpc/xdrgen/nlm4.h (revision d141ec2825b4d3ec52f27c43bdd864090159273a)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Generated by xdrgen. Manual edits will be lost. */
3 /* XDR specification file: ../../Documentation/sunrpc/xdr/nlm4.x */
4 /* XDR specification modification time: Mon Jun 29 20:42:29 2026 */
5 
6 #ifndef _LINUX_XDRGEN_NLM4_DEF_H
7 #define _LINUX_XDRGEN_NLM4_DEF_H
8 
9 #include <linux/types.h>
10 #include <linux/sunrpc/xdrgen/_defs.h>
11 
12 enum { LM_MAXSTRLEN = 1024 };
13 
14 enum { LM_MAXNAMELEN = 1025 };
15 
16 enum { MAXNETOBJ_SZ = 1024 };
17 
18 typedef opaque netobj;
19 
20 enum fsh4_mode {
21 	fsm_DN = 0,
22 	fsm_DR = 1,
23 	fsm_DW = 2,
24 	fsm_DRW = 3,
25 };
26 
27 typedef enum fsh4_mode fsh4_mode;
28 
29 enum fsh4_access {
30 	fsa_NONE = 0,
31 	fsa_R = 1,
32 	fsa_W = 2,
33 	fsa_RW = 3,
34 };
35 
36 typedef enum fsh4_access fsh4_access;
37 
38 enum { SM_MAXSTRLEN = 1024 };
39 
40 typedef u64 uint64;
41 
42 typedef s64 int64;
43 
44 typedef u32 uint32;
45 
46 typedef s32 int32;
47 
48 enum nlm4_stats {
49 	NLM4_GRANTED = 0,
50 	NLM4_DENIED = 1,
51 	NLM4_DENIED_NOLOCKS = 2,
52 	NLM4_BLOCKED = 3,
53 	NLM4_DENIED_GRACE_PERIOD = 4,
54 	NLM4_DEADLCK = 5,
55 	NLM4_ROFS = 6,
56 	NLM4_STALE_FH = 7,
57 	NLM4_FBIG = 8,
58 	NLM4_FAILED = 9,
59 };
60 
61 typedef __be32 nlm4_stats;
62 
63 struct nlm4_holder {
64 	bool exclusive;
65 	int32 svid;
66 	netobj oh;
67 	uint64 l_offset;
68 	uint64 l_len;
69 };
70 
71 struct nlm4_testrply {
72 	nlm4_stats stat;
73 	union {
74 		struct nlm4_holder holder;
75 	} u;
76 };
77 
78 struct nlm4_stat {
79 	nlm4_stats stat;
80 };
81 
82 struct nlm4_res {
83 	netobj cookie;
84 	struct nlm4_stat stat;
85 };
86 
87 struct nlm4_testres {
88 	netobj cookie;
89 	struct nlm4_testrply stat;
90 };
91 
92 struct nlm4_lock {
93 	string caller_name;
94 	netobj fh;
95 	netobj oh;
96 	int32 svid;
97 	uint64 l_offset;
98 	uint64 l_len;
99 };
100 
101 struct nlm4_lockargs {
102 	netobj cookie;
103 	bool block;
104 	bool exclusive;
105 	struct nlm4_lock alock;
106 	bool reclaim;
107 	int32 state;
108 };
109 
110 struct nlm4_cancargs {
111 	netobj cookie;
112 	bool block;
113 	bool exclusive;
114 	struct nlm4_lock alock;
115 };
116 
117 struct nlm4_testargs {
118 	netobj cookie;
119 	bool exclusive;
120 	struct nlm4_lock alock;
121 };
122 
123 struct nlm4_unlockargs {
124 	netobj cookie;
125 	struct nlm4_lock alock;
126 };
127 
128 struct nlm4_share {
129 	string caller_name;
130 	netobj fh;
131 	netobj oh;
132 	fsh4_mode mode;
133 	fsh4_access access;
134 };
135 
136 struct nlm4_shareargs {
137 	netobj cookie;
138 	struct nlm4_share share;
139 	bool reclaim;
140 };
141 
142 struct nlm4_shareres {
143 	netobj cookie;
144 	nlm4_stats stat;
145 	int32 sequence;
146 };
147 
148 struct nlm4_notify {
149 	string name;
150 	int32 state;
151 };
152 
153 enum { SM_PRIV_SIZE = 16 };
154 
155 struct nlm4_notifyargs {
156 	struct nlm4_notify notify;
157 	u8 private[SM_PRIV_SIZE];
158 };
159 
160 enum {
161 	NLMPROC4_NULL = 0,
162 	NLMPROC4_TEST = 1,
163 	NLMPROC4_LOCK = 2,
164 	NLMPROC4_CANCEL = 3,
165 	NLMPROC4_UNLOCK = 4,
166 	NLMPROC4_GRANTED = 5,
167 	NLMPROC4_TEST_MSG = 6,
168 	NLMPROC4_LOCK_MSG = 7,
169 	NLMPROC4_CANCEL_MSG = 8,
170 	NLMPROC4_UNLOCK_MSG = 9,
171 	NLMPROC4_GRANTED_MSG = 10,
172 	NLMPROC4_TEST_RES = 11,
173 	NLMPROC4_LOCK_RES = 12,
174 	NLMPROC4_CANCEL_RES = 13,
175 	NLMPROC4_UNLOCK_RES = 14,
176 	NLMPROC4_GRANTED_RES = 15,
177 	NLMPROC4_SM_NOTIFY = 16,
178 	NLMPROC4_SHARE = 20,
179 	NLMPROC4_UNSHARE = 21,
180 	NLMPROC4_NM_LOCK = 22,
181 	NLMPROC4_FREE_ALL = 23,
182 };
183 
184 #ifndef NLM4_PROG
185 #define NLM4_PROG (100021)
186 #endif
187 
188 #define NLM4_netobj_sz                  (XDR_unsigned_int + XDR_QUADLEN(MAXNETOBJ_SZ))
189 #define NLM4_fsh4_mode_sz               (XDR_int)
190 #define NLM4_fsh4_access_sz             (XDR_int)
191 #define NLM4_uint64_sz                  \
192 	(XDR_unsigned_hyper)
193 #define NLM4_int64_sz                   \
194 	(XDR_hyper)
195 #define NLM4_uint32_sz                  \
196 	(XDR_unsigned_long)
197 #define NLM4_int32_sz                   \
198 	(XDR_long)
199 #define NLM4_nlm4_stats_sz              (XDR_int)
200 #define NLM4_nlm4_holder_sz             \
201 	(XDR_bool + NLM4_int32_sz + NLM4_netobj_sz + NLM4_uint64_sz + NLM4_uint64_sz)
202 #define NLM4_nlm4_testrply_sz           \
203 	(NLM4_nlm4_stats_sz + NLM4_nlm4_holder_sz)
204 #define NLM4_nlm4_stat_sz               \
205 	(NLM4_nlm4_stats_sz)
206 #define NLM4_nlm4_res_sz                \
207 	(NLM4_netobj_sz + NLM4_nlm4_stat_sz)
208 #define NLM4_nlm4_testres_sz            \
209 	(NLM4_netobj_sz + NLM4_nlm4_testrply_sz)
210 #define NLM4_nlm4_lock_sz               \
211 	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXSTRLEN) + NLM4_netobj_sz + NLM4_netobj_sz + NLM4_int32_sz + NLM4_uint64_sz + NLM4_uint64_sz)
212 #define NLM4_nlm4_lockargs_sz           \
213 	(NLM4_netobj_sz + XDR_bool + XDR_bool + NLM4_nlm4_lock_sz + XDR_bool + NLM4_int32_sz)
214 #define NLM4_nlm4_cancargs_sz           \
215 	(NLM4_netobj_sz + XDR_bool + XDR_bool + NLM4_nlm4_lock_sz)
216 #define NLM4_nlm4_testargs_sz           \
217 	(NLM4_netobj_sz + XDR_bool + NLM4_nlm4_lock_sz)
218 #define NLM4_nlm4_unlockargs_sz         \
219 	(NLM4_netobj_sz + NLM4_nlm4_lock_sz)
220 #define NLM4_nlm4_share_sz              \
221 	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXSTRLEN) + NLM4_netobj_sz + NLM4_netobj_sz + NLM4_fsh4_mode_sz + NLM4_fsh4_access_sz)
222 #define NLM4_nlm4_shareargs_sz          \
223 	(NLM4_netobj_sz + NLM4_nlm4_share_sz + XDR_bool)
224 #define NLM4_nlm4_shareres_sz           \
225 	(NLM4_netobj_sz + NLM4_nlm4_stats_sz + NLM4_int32_sz)
226 #define NLM4_nlm4_notify_sz             \
227 	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXNAMELEN) + NLM4_int32_sz)
228 #define NLM4_nlm4_notifyargs_sz         \
229 	(NLM4_nlm4_notify_sz + XDR_QUADLEN(SM_PRIV_SIZE))
230 #define NLM4_MAX_ARGS_SZ                \
231 	(NLM4_nlm4_lockargs_sz)
232 
233 #endif /* _LINUX_XDRGEN_NLM4_DEF_H */
234