Coverage Report

Created: 2026-10-17 07:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libnfs/nlm/libnfs-raw-nlm.c
Line
Count
Source
1
/*
2
Copyright (c) 2014, Ronnie Sahlberg
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions are met:
7
8
1. Redistributions of source code must retain the above copyright notice, this
9
   list of conditions and the following disclaimer.
10
2. Redistributions in binary form must reproduce the above copyright notice,
11
   this list of conditions and the following disclaimer in the documentation
12
   and/or other materials provided with the distribution.
13
14
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25
The views and conclusions contained in the software and documentation are those
26
of the authors and should not be interpreted as representing official policies,
27
either expressed or implied, of the FreeBSD Project.
28
*/
29
30
/*
31
 * Please do not edit this file.
32
 * It was generated using rpcgen.
33
 */
34
35
#include "libnfs-zdr.h"
36
#include "libnfs-raw-nlm.h"
37
38
uint32_t
39
zdr_nlm_fh4 (ZDR *zdrs, nlm_fh4 *objp)
40
0
{
41
0
   if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, &objp->data.data_len, ~0))
42
0
     return FALSE;
43
0
  return TRUE;
44
0
}
45
46
uint32_t
47
zdr_nlm4_oh (ZDR *zdrs, nlm4_oh *objp)
48
8
{
49
8
   if (!zdr_string (zdrs, objp, ~0))
50
2
     return FALSE;
51
6
  return TRUE;
52
8
}
53
54
uint32_t
55
zdr_nlm_cookie (ZDR *zdrs, nlm_cookie *objp)
56
138
{
57
138
   if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, &objp->data.data_len, ~0))
58
74
     return FALSE;
59
64
  return TRUE;
60
138
}
61
62
uint32_t
63
zdr_nlmstat4 (ZDR *zdrs, nlmstat4 *objp)
64
64
{
65
64
   if (!zdr_enum (zdrs, (enum_t *) objp))
66
11
     return FALSE;
67
53
  return TRUE;
68
64
}
69
70
uint32_t
71
zdr_nlm4_holder (ZDR *zdrs, nlm4_holder *objp)
72
13
{
73
13
   if (!zdr_bool (zdrs, &objp->exclusive))
74
2
     return FALSE;
75
11
   if (!zdr_u_int (zdrs, &objp->svid))
76
3
     return FALSE;
77
8
   if (!zdr_nlm4_oh (zdrs, &objp->oh))
78
2
     return FALSE;
79
6
   if (!zdr_uint64_t (zdrs, &objp->l_offset))
80
2
     return FALSE;
81
4
   if (!zdr_uint64_t (zdrs, &objp->l_len))
82
2
     return FALSE;
83
2
  return TRUE;
84
4
}
85
86
uint32_t
87
zdr_nlm4_lock (ZDR *zdrs, nlm4_lock *objp)
88
0
{
89
0
   if (!zdr_string (zdrs, &objp->caller_name, NLM_MAXNAME))
90
0
     return FALSE;
91
0
   if (!zdr_nlm_fh4 (zdrs, &objp->fh))
92
0
     return FALSE;
93
0
   if (!zdr_nlm4_oh (zdrs, &objp->oh))
94
0
     return FALSE;
95
0
   if (!zdr_u_int (zdrs, &objp->svid))
96
0
     return FALSE;
97
0
   if (!zdr_uint64_t (zdrs, &objp->l_offset))
98
0
     return FALSE;
99
0
   if (!zdr_uint64_t (zdrs, &objp->l_len))
100
0
     return FALSE;
101
0
  return TRUE;
102
0
}
103
104
uint32_t
105
zdr_nlm4_share (ZDR *zdrs, nlm4_share *objp)
106
0
{
107
0
   if (!zdr_string (zdrs, &objp->caller_name, NLM_MAXNAME))
108
0
     return FALSE;
109
0
   if (!zdr_nlm_fh4 (zdrs, &objp->fh))
110
0
     return FALSE;
111
0
   if (!zdr_nlm4_oh (zdrs, &objp->oh))
112
0
     return FALSE;
113
0
   if (!zdr_u_int (zdrs, &objp->mode))
114
0
     return FALSE;
115
0
   if (!zdr_u_int (zdrs, &objp->access))
116
0
     return FALSE;
117
0
  return TRUE;
118
0
}
119
120
uint32_t
121
zdr_nlm4_testres_denied (ZDR *zdrs, nlm4_testres_denied *objp)
122
13
{
123
13
   if (!zdr_nlm4_holder (zdrs, &objp->holder))
124
11
     return FALSE;
125
2
  return TRUE;
126
13
}
127
128
uint32_t
129
zdr_nlm4_testreply (ZDR *zdrs, nlm4_testreply *objp)
130
49
{
131
49
   if (!zdr_nlmstat4 (zdrs, &objp->status))
132
2
     return FALSE;
133
47
  switch (objp->status) {
134
6
  case NLM4_DENIED:
135
6
     if (!zdr_nlm4_testres_denied (zdrs, &objp->nlm4_testreply_u.lock))
136
5
       return FALSE;
137
1
    break;
138
41
  default:
139
41
    break;
140
47
  }
141
42
  return TRUE;
142
47
}
143
144
uint32_t
145
zdr_NLM4_TESTres (ZDR *zdrs, NLM4_TESTres *objp)
146
59
{
147
59
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
148
10
     return FALSE;
149
49
   if (!zdr_nlm4_testreply (zdrs, &objp->reply))
150
7
     return FALSE;
151
42
  return TRUE;
152
49
}
153
154
uint32_t
155
zdr_NLM4_TESTargs (ZDR *zdrs, NLM4_TESTargs *objp)
156
0
{
157
0
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
158
0
     return FALSE;
159
0
   if (!zdr_bool (zdrs, &objp->exclusive))
160
0
     return FALSE;
161
0
   if (!zdr_nlm4_lock (zdrs, &objp->lock))
162
0
     return FALSE;
163
0
  return TRUE;
164
0
}
165
166
uint32_t
167
zdr_NLM4_CANCres (ZDR *zdrs, NLM4_CANCres *objp)
168
18
{
169
18
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
170
14
     return FALSE;
171
4
   if (!zdr_nlmstat4 (zdrs, &objp->status))
172
3
     return FALSE;
173
1
  return TRUE;
174
4
}
175
176
uint32_t
177
zdr_NLM4_CANCargs (ZDR *zdrs, NLM4_CANCargs *objp)
178
0
{
179
0
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
180
0
     return FALSE;
181
0
   if (!zdr_bool (zdrs, &objp->block))
182
0
     return FALSE;
183
0
   if (!zdr_bool (zdrs, &objp->exclusive))
184
0
     return FALSE;
185
0
   if (!zdr_nlm4_lock (zdrs, &objp->lock))
186
0
     return FALSE;
187
0
  return TRUE;
188
0
}
189
190
uint32_t
191
zdr_NLM4_UNLOCKres (ZDR *zdrs, NLM4_UNLOCKres *objp)
192
6
{
193
6
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
194
4
     return FALSE;
195
2
   if (!zdr_nlmstat4 (zdrs, &objp->status))
196
1
     return FALSE;
197
1
  return TRUE;
198
2
}
199
200
uint32_t
201
zdr_NLM4_UNLOCKargs (ZDR *zdrs, NLM4_UNLOCKargs *objp)
202
0
{
203
0
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
204
0
     return FALSE;
205
0
   if (!zdr_nlm4_lock (zdrs, &objp->lock))
206
0
     return FALSE;
207
0
  return TRUE;
208
0
}
209
210
uint32_t
211
zdr_NLM4_LOCKres (ZDR *zdrs, NLM4_LOCKres *objp)
212
12
{
213
12
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
214
10
     return FALSE;
215
2
   if (!zdr_nlmstat4 (zdrs, &objp->status))
216
1
     return FALSE;
217
1
  return TRUE;
218
2
}
219
220
uint32_t
221
zdr_NLM4_LOCKargs (ZDR *zdrs, NLM4_LOCKargs *objp)
222
0
{
223
0
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
224
0
     return FALSE;
225
0
   if (!zdr_bool (zdrs, &objp->block))
226
0
     return FALSE;
227
0
   if (!zdr_bool (zdrs, &objp->exclusive))
228
0
     return FALSE;
229
0
   if (!zdr_nlm4_lock (zdrs, &objp->lock))
230
0
     return FALSE;
231
0
   if (!zdr_bool (zdrs, &objp->reclaim))
232
0
     return FALSE;
233
0
   if (!zdr_int (zdrs, &objp->state))
234
0
     return FALSE;
235
0
  return TRUE;
236
0
}
237
238
uint32_t
239
zdr_NLM4_GRANTEDargs (ZDR *zdrs, NLM4_GRANTEDargs *objp)
240
0
{
241
0
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
242
0
     return FALSE;
243
0
   if (!zdr_bool (zdrs, &objp->exclusive))
244
0
     return FALSE;
245
0
   if (!zdr_nlm4_lock (zdrs, &objp->lock))
246
0
     return FALSE;
247
0
  return TRUE;
248
0
}
249
250
uint32_t
251
zdr_NLM4_GRANTEDres (ZDR *zdrs, NLM4_GRANTEDres *objp)
252
8
{
253
8
   if (!zdr_nlm_cookie (zdrs, &objp->cookie))
254
6
     return FALSE;
255
2
   if (!zdr_nlmstat4 (zdrs, &objp->status))
256
1
     return FALSE;
257
1
  return TRUE;
258
2
}
259
260
uint32_t
261
zdr_NLM4_SHAREres(ZDR *zdrs, NLM4_SHAREres *objp)
262
18
{
263
18
  if (!zdr_nlm_cookie (zdrs, &objp->cookie))
264
16
    return FALSE;
265
2
  if (!zdr_nlmstat4 (zdrs, &objp->status))
266
1
    return FALSE;
267
1
  return TRUE;
268
2
}
269
270
uint32_t
271
zdr_NLM4_SHAREargs(ZDR *zdrs, NLM4_SHAREargs *objp)
272
0
{
273
0
  if (!zdr_nlm_cookie (zdrs, &objp->cookie))
274
0
    return FALSE;
275
0
  if (!zdr_nlm4_share (zdrs, &objp->share))
276
0
    return FALSE;
277
0
  if (!zdr_bool (zdrs, &objp->reclaim))
278
0
    return FALSE;
279
0
  return TRUE;
280
0
}
281
282
uint32_t
283
zdr_NLM4_UNSHAREres(ZDR *zdrs, NLM4_UNSHAREres *objp)
284
17
{
285
17
  if (!zdr_nlm_cookie (zdrs, &objp->cookie))
286
14
    return FALSE;
287
3
  if (!zdr_nlmstat4 (zdrs, &objp->status))
288
2
    return FALSE;
289
1
  return TRUE;
290
3
}
291
292
uint32_t
293
zdr_NLM4_UNSHAREargs(ZDR *zdrs, NLM4_SHAREargs *objp)
294
0
{
295
0
  if (!zdr_nlm_cookie (zdrs, &objp->cookie))
296
0
    return FALSE;
297
0
  if (!zdr_nlm4_share (zdrs, &objp->share))
298
0
    return FALSE;
299
0
  if (!zdr_bool (zdrs, &objp->reclaim))
300
0
    return FALSE;
301
0
  return TRUE;
302
0
}