summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/xdrgen/nlm3.h
blob: 897e7d91807c627f27a378798d11afb60fa50d50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/* SPDX-License-Identifier: GPL-2.0 */
/* Generated by xdrgen. Manual edits will be lost. */
/* XDR specification file: ../../Documentation/sunrpc/xdr/nlm3.x */
/* XDR specification modification time: Thu Apr 23 10:56:34 2026 */

#ifndef _LINUX_XDRGEN_NLM3_DEF_H
#define _LINUX_XDRGEN_NLM3_DEF_H

#include <linux/types.h>
#include <linux/sunrpc/xdrgen/_defs.h>

enum { LM_MAXSTRLEN = 1024 };

enum { LM_MAXNAMELEN = 1025 };

enum { MAXNETOBJ_SZ = 1024 };

typedef opaque netobj;

enum nlm_stats {
	LCK_GRANTED = 0,
	LCK_DENIED = 1,
	LCK_DENIED_NOLOCKS = 2,
	LCK_BLOCKED = 3,
	LCK_DENIED_GRACE_PERIOD = 4,
};

typedef __be32 nlm_stats;

struct nlm_stat {
	nlm_stats stat;
};

struct nlm_res {
	netobj cookie;
	struct nlm_stat stat;
};

struct nlm_holder {
	bool exclusive;
	s32 uppid;
	netobj oh;
	u32 l_offset;
	u32 l_len;
};

struct nlm_testrply {
	nlm_stats stat;
	union {
		struct nlm_holder holder;
	} u;
};

struct nlm_testres {
	netobj cookie;
	struct nlm_testrply test_stat;
};

struct nlm_lock {
	string caller_name;
	netobj fh;
	netobj oh;
	s32 uppid;
	u32 l_offset;
	u32 l_len;
};

struct nlm_lockargs {
	netobj cookie;
	bool block;
	bool exclusive;
	struct nlm_lock alock;
	bool reclaim;
	s32 state;
};

struct nlm_cancargs {
	netobj cookie;
	bool block;
	bool exclusive;
	struct nlm_lock alock;
};

struct nlm_testargs {
	netobj cookie;
	bool exclusive;
	struct nlm_lock alock;
};

struct nlm_unlockargs {
	netobj cookie;
	struct nlm_lock alock;
};

enum fsh_mode {
	fsm_DN = 0,
	fsm_DR = 1,
	fsm_DW = 2,
	fsm_DRW = 3,
};

typedef enum fsh_mode fsh_mode;

enum fsh_access {
	fsa_NONE = 0,
	fsa_R = 1,
	fsa_W = 2,
	fsa_RW = 3,
};

typedef enum fsh_access fsh_access;

struct nlm_share {
	string caller_name;
	netobj fh;
	netobj oh;
	fsh_mode mode;
	fsh_access access;
};

struct nlm_shareargs {
	netobj cookie;
	struct nlm_share share;
	bool reclaim;
};

struct nlm_shareres {
	netobj cookie;
	nlm_stats stat;
	s32 sequence;
};

struct nlm_notify {
	string name;
	s32 state;
};

enum { SM_PRIV_SIZE = 16 };

struct nlm_notifyargs {
	struct nlm_notify notify;
	u8 private[SM_PRIV_SIZE];
};

enum {
	NLM_NULL = 0,
	NLM_TEST = 1,
	NLM_LOCK = 2,
	NLM_CANCEL = 3,
	NLM_UNLOCK = 4,
	NLM_GRANTED = 5,
	NLM_TEST_MSG = 6,
	NLM_LOCK_MSG = 7,
	NLM_CANCEL_MSG = 8,
	NLM_UNLOCK_MSG = 9,
	NLM_GRANTED_MSG = 10,
	NLM_TEST_RES = 11,
	NLM_LOCK_RES = 12,
	NLM_CANCEL_RES = 13,
	NLM_UNLOCK_RES = 14,
	NLM_GRANTED_RES = 15,
	NLM_SM_NOTIFY = 16,
	NLM_SHARE = 20,
	NLM_UNSHARE = 21,
	NLM_NM_LOCK = 22,
	NLM_FREE_ALL = 23,
};

#ifndef NLM_PROG
#define NLM_PROG (100021)
#endif

#define NLM3_netobj_sz                  (XDR_unsigned_int + XDR_QUADLEN(MAXNETOBJ_SZ))
#define NLM3_nlm_stats_sz               (XDR_int)
#define NLM3_nlm_stat_sz                \
	(NLM3_nlm_stats_sz)
#define NLM3_nlm_res_sz                 \
	(NLM3_netobj_sz + NLM3_nlm_stat_sz)
#define NLM3_nlm_holder_sz              \
	(XDR_bool + XDR_int + NLM3_netobj_sz + XDR_unsigned_int + XDR_unsigned_int)
#define NLM3_nlm_testrply_sz            \
	(NLM3_nlm_stats_sz + NLM3_nlm_holder_sz)
#define NLM3_nlm_testres_sz             \
	(NLM3_netobj_sz + NLM3_nlm_testrply_sz)
#define NLM3_nlm_lock_sz                \
	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXSTRLEN) + NLM3_netobj_sz + NLM3_netobj_sz + XDR_int + XDR_unsigned_int + XDR_unsigned_int)
#define NLM3_nlm_lockargs_sz            \
	(NLM3_netobj_sz + XDR_bool + XDR_bool + NLM3_nlm_lock_sz + XDR_bool + XDR_int)
#define NLM3_nlm_cancargs_sz            \
	(NLM3_netobj_sz + XDR_bool + XDR_bool + NLM3_nlm_lock_sz)
#define NLM3_nlm_testargs_sz            \
	(NLM3_netobj_sz + XDR_bool + NLM3_nlm_lock_sz)
#define NLM3_nlm_unlockargs_sz          \
	(NLM3_netobj_sz + NLM3_nlm_lock_sz)
#define NLM3_fsh_mode_sz                (XDR_int)
#define NLM3_fsh_access_sz              (XDR_int)
#define NLM3_nlm_share_sz               \
	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXSTRLEN) + NLM3_netobj_sz + NLM3_netobj_sz + NLM3_fsh_mode_sz + NLM3_fsh_access_sz)
#define NLM3_nlm_shareargs_sz           \
	(NLM3_netobj_sz + NLM3_nlm_share_sz + XDR_bool)
#define NLM3_nlm_shareres_sz            \
	(NLM3_netobj_sz + NLM3_nlm_stats_sz + XDR_int)
#define NLM3_nlm_notify_sz              \
	(XDR_unsigned_int + XDR_QUADLEN(LM_MAXNAMELEN) + XDR_long)
#define NLM3_nlm_notifyargs_sz          \
	(NLM3_nlm_notify_sz + XDR_QUADLEN(SM_PRIV_SIZE))
#define NLM3_MAX_ARGS_SZ                \
	(NLM3_nlm_lockargs_sz)

#endif /* _LINUX_XDRGEN_NLM3_DEF_H */