summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nfsacl.c
blob: b1d4289473194d5b245c80e89514df8f3ae2ccd9 (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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
/* packet-nfsacl.c
 * Stubs for Sun's NFS ACL RPC service (runs on port 2049, and is presumably
 * handled by the same kernel server code that handles NFS)
 *
 * Guy Harris <guy@alum.mit.edu>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "config.h"


#include "packet-nfs.h"

void proto_register_nfsacl(void);
void proto_reg_handoff_nfsacl(void);

static int proto_nfsacl;
static int hf_nfsacl_mask;
static int hf_nfsacl_mask_acl_entry;
static int hf_nfsacl_mask_acl_count;
static int hf_nfsacl_mask_default_acl_entry;
static int hf_nfsacl_mask_default_acl_count;
static int hf_nfsacl_procedure_v1;
static int hf_nfsacl_procedure_v2;
static int hf_nfsacl_procedure_v3;
static int hf_nfsacl_entry;
static int hf_nfsacl_aclcnt;
static int hf_nfsacl_dfaclcnt;
static int hf_nfsacl_aclent;
static int hf_nfsacl_aclent_type;
static int hf_nfsacl_aclent_uid;
static int hf_nfsacl_aclent_perm;
static int hf_nfsacl_aclent_perm_read;
static int hf_nfsacl_aclent_perm_write;
static int hf_nfsacl_aclent_perm_exec;
static int hf_nfsacl_create;

static int ett_nfsacl;
static int ett_nfsacl_mask;
static int ett_nfsacl_entry;
static int ett_nfsacl_aclent;
static int ett_nfsacl_aclent_perm;
static int ett_nfsacl_aclent_entries;

#define NFSACL_PROGRAM	100227

#define NFSACLPROC_NULL		0

#define NFSACLPROC2_GETACL	1
#define NFSACLPROC2_SETACL	2
#define NFSACLPROC2_GETATTR	3
#define NFSACLPROC2_ACCESS	4
#define NFSACLPROC2_GETXATTRDIR 5

#define NFSACLPROC3_GETACL	1
#define NFSACLPROC3_SETACL	2
#define NFSACLPROC3_GETXATTRDIR 3

#define ACL2_OK 0
#define ACL3_OK 0

static int
dissect_nfsacl_mask(tvbuff_t *tvb, int offset, proto_tree *tree)
{
	proto_item *mask_item;
	proto_tree *mask_tree;

	if (tree)
	{
		mask_item = proto_tree_add_item(tree, hf_nfsacl_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
		mask_tree = proto_item_add_subtree(mask_item, ett_nfsacl_mask);

		proto_tree_add_item(mask_tree, hf_nfsacl_mask_acl_entry, tvb, offset, 4, ENC_BIG_ENDIAN);
		proto_tree_add_item(mask_tree, hf_nfsacl_mask_acl_count, tvb, offset, 4, ENC_BIG_ENDIAN);
		proto_tree_add_item(mask_tree, hf_nfsacl_mask_default_acl_entry, tvb, offset, 4, ENC_BIG_ENDIAN);
		proto_tree_add_item(mask_tree, hf_nfsacl_mask_default_acl_count, tvb, offset, 4, ENC_BIG_ENDIAN);
	}

	offset += 4;
	return offset;
}

#define NA_READ 0x4
#define NA_WRITE 0x2
#define NA_EXEC 0x1

static const value_string names_nfsacl_aclent_type[] = {
#define NA_USER_OBJ 0x1
	{ NA_USER_OBJ,			 "NA_USER_OBJ" },
#define NA_USER 0x2
	{ NA_USER,			 "NA_USER" },
#define NA_GROUP_OBJ 0x4
	{ NA_GROUP_OBJ,			 "NA_GROUP_OBJ" },
#define NA_GROUP 0x8
	{ NA_GROUP,			 "NA_GROUP" },
#define NA_CLASS_OBJ 0x10
	{ NA_CLASS_OBJ,			 "NA_CLASS_OBJ" },
#define NA_OTHER_OBJ 0x20
	{ NA_OTHER_OBJ,			 "NA_OTHER_OBJ" },
#define NA_ACL_DEFAULT 0x1000
	{ NA_ACL_DEFAULT,		 "NA_ACL_DEFAULT" },
	{ NA_ACL_DEFAULT | NA_USER_OBJ,	 "Default NA_USER_OBJ" },
	{ NA_ACL_DEFAULT | NA_USER,	 "Default NA_USER" },
	{ NA_ACL_DEFAULT | NA_GROUP_OBJ, "Default NA_GROUP_OBJ" },
	{ NA_ACL_DEFAULT | NA_GROUP,	 "Default NA_GROUP" },
	{ NA_ACL_DEFAULT | NA_CLASS_OBJ, "Default NA_CLASS_OBJ" },
	{ NA_ACL_DEFAULT | NA_OTHER_OBJ, "Default NA_OTHER_OBJ" },
	{ 0, NULL },
};

static int
dissect_nfsacl_aclent(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
		      proto_tree* tree)
{
	proto_item *entry_item = NULL;
	proto_tree *entry_tree = NULL;
	proto_item *perm_item = NULL;
	proto_tree *perm_tree = NULL;

	if (tree)
	{
		entry_item = proto_tree_add_item(tree, hf_nfsacl_aclent, tvb,
						 offset + 0, -1, ENC_NA);
		entry_tree = proto_item_add_subtree(entry_item, ett_nfsacl_aclent);
	}

	offset = dissect_rpc_uint32(tvb, entry_tree, hf_nfsacl_aclent_type, offset);
	offset = dissect_rpc_uint32(tvb, entry_tree, hf_nfsacl_aclent_uid, offset);

	perm_item = proto_tree_add_item(entry_tree, hf_nfsacl_aclent_perm,
					tvb, offset, 4, ENC_BIG_ENDIAN);
	perm_tree = proto_item_add_subtree(perm_item, ett_nfsacl_aclent_perm);
	proto_tree_add_item(perm_tree, hf_nfsacl_aclent_perm_read, tvb, offset, 4, ENC_BIG_ENDIAN);
	proto_tree_add_item(perm_tree, hf_nfsacl_aclent_perm_write, tvb, offset, 4, ENC_BIG_ENDIAN);
	proto_tree_add_item(perm_tree, hf_nfsacl_aclent_perm_exec, tvb, offset, 4, ENC_BIG_ENDIAN);
	offset += 4;

	return offset;
}


static int
dissect_nfsacl_secattr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
		       proto_tree *tree)
{
	uint32_t aclcnt, dfaclcnt;
	uint32_t i;
	proto_tree *entry_tree;

	offset = dissect_nfsacl_mask(tvb, offset, tree);
	offset = dissect_rpc_uint32(tvb, tree, hf_nfsacl_aclcnt, offset);

	aclcnt = tvb_get_ntohl(tvb, offset);

	entry_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
			ett_nfsacl_aclent_entries, NULL, "Total ACL entries: %d", aclcnt);

	offset += 4;

	if (aclcnt > 0)
	{
		for (i = 0; i < aclcnt; i++)
			offset = dissect_nfsacl_aclent(tvb, offset, pinfo, entry_tree);
	}

	/* */

	offset = dissect_rpc_uint32(tvb, tree, hf_nfsacl_dfaclcnt, offset);

	dfaclcnt = tvb_get_ntohl(tvb, offset);

	entry_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
			ett_nfsacl_aclent_entries, NULL, "Total default ACL entries: %d", dfaclcnt);

	offset += 4;

	if (dfaclcnt > 0)
	{
		for (i = 0; i < dfaclcnt; i++)
			offset = dissect_nfsacl_aclent(tvb, offset, pinfo, entry_tree);
	}

	return offset;
}

/* proc number, "proc name", dissect_request, dissect_reply */
static const vsff nfsacl1_proc[] = {
	{ NFSACLPROC_NULL,	"NULL",
	  dissect_rpc_void,	dissect_rpc_void },
	{ 0,	NULL,	NULL,	NULL }
};
static const value_string nfsacl1_proc_vals[] = {
	{ NFSACLPROC_NULL,	"NULL" },
	{ 0,	NULL }
};

static int
dissect_nfsacl2_getacl_call(tvbuff_t *tvb, packet_info *pinfo _U_,
			    proto_tree *tree, void* data)
{
	int offset = 0;
	offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
	offset = dissect_nfsacl_mask(tvb, offset, tree);
	return offset;
}

static int
dissect_nfsacl2_getacl_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
			     proto_tree *tree, void* data _U_)
{
	uint32_t status;
	int offset = 0;

	proto_tree_add_item_ret_uint(tree, hf_nfs_status, tvb, offset, 4, ENC_BIG_ENDIAN, &status);

	offset += 4;

	if (status == ACL2_OK)
	{
		offset = dissect_nfs2_fattr(tvb, offset, tree, "attr");
		offset = dissect_nfsacl_secattr(tvb, offset, pinfo, tree);
	}

	return offset;
}

static int
dissect_nfsacl2_setacl_call(tvbuff_t *tvb, packet_info *pinfo _U_,
			    proto_tree *tree, void* data)
{
	int offset = 0;
	offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
	offset = dissect_nfsacl_secattr(tvb, offset, pinfo, tree);

	return offset;
}

static int
dissect_nfsacl2_setacl_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
			     proto_tree *tree, void* data _U_)
{
	uint32_t status;
	int offset = 0;

	proto_tree_add_item_ret_uint(tree, hf_nfs_status, tvb, offset + 0, 4, ENC_BIG_ENDIAN, &status);

	offset += 4;

	if (status == ACL2_OK)
		offset = dissect_nfs2_fattr(tvb, offset, tree, "attr");

	return offset;
}

static int
dissect_nfsacl2_getattr_call(tvbuff_t *tvb, packet_info *pinfo _U_,
			     proto_tree *tree, void* data)
{
	return dissect_fhandle(tvb, 0, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
}

static int
dissect_nfsacl2_getattr_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
			      proto_tree *tree, void* data _U_)
{
	return dissect_nfs2_fattr(tvb, 0, tree, "attr");
}

static int
dissect_nfsacl2_access_call(tvbuff_t *tvb, packet_info *pinfo _U_,
			    proto_tree *tree, void* data)
{
	uint32_t *acc_request, amask;
	rpc_call_info_value *civ = (rpc_call_info_value*)data;
	int offset = 0;

	offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, civ);

	/* Get access mask to check and save it for comparison to the access reply. */
	amask = tvb_get_ntohl(tvb, offset);
	acc_request = (uint32_t *)wmem_memdup(wmem_file_scope(), &amask, sizeof(uint32_t));
	civ->private_data = acc_request;

	display_access_items(tvb, offset, pinfo, tree, amask, 'C', 3, NULL, "Check") ;

	offset+=4;
	return offset;
}

static int
dissect_nfsacl2_access_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
			     proto_tree *tree, void* data)
{
	uint32_t status;
	int offset = 0;

	status = tvb_get_ntohl(tvb, offset + 0);

	proto_tree_add_uint(tree, hf_nfs_status, tvb, offset + 0, 4, status);

	offset += 4;

	if (status == ACL2_OK)
	{
		offset = dissect_nfs2_fattr(tvb, offset, tree, "attr");
		offset = dissect_access_reply(tvb, offset, pinfo, tree, 3, NULL, (rpc_call_info_value*)data);
	}

	return offset;
}

static int
dissect_nfsacl2_getxattrdir_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data)
{
	int offset = 0;
	offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
	offset = dissect_rpc_bool(tvb, tree, hf_nfsacl_create, offset);

	return offset;
}

static int
dissect_nfsacl2_getxattrdir_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data)
{
	uint32_t status;
	int offset = 0;

	status = tvb_get_ntohl(tvb, offset + 0);

	proto_tree_add_uint(tree, hf_nfs_status, tvb, offset + 0, 4, status);

	offset += 4;

	if (status == ACL2_OK)
	{
		offset = dissect_fhandle(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
		offset = dissect_nfs2_fattr(tvb, offset, tree, "attr");
	}

	return offset;
}

static const vsff nfsacl2_proc[] = {
	{ NFSACLPROC_NULL,	"NULL",
		dissect_rpc_void,		dissect_rpc_void },
	{ NFSACLPROC2_GETACL,	"GETACL",
		dissect_nfsacl2_getacl_call,	dissect_nfsacl2_getacl_reply },
	{ NFSACLPROC2_SETACL,	"SETACL",
		dissect_nfsacl2_setacl_call,	dissect_nfsacl2_setacl_reply },
	{ NFSACLPROC2_GETATTR,	"GETATTR",
		dissect_nfsacl2_getattr_call,	dissect_nfsacl2_getattr_reply },
	{ NFSACLPROC2_ACCESS,	"ACCESS",
		dissect_nfsacl2_access_call,	dissect_nfsacl2_access_reply },
	{ NFSACLPROC2_GETXATTRDIR,	"GETXATTRDIR",
		dissect_nfsacl2_getxattrdir_call, dissect_nfsacl2_getxattrdir_reply },
	{ 0,	NULL,	NULL,	NULL }
};
static const value_string nfsacl2_proc_vals[] = {
	{ NFSACLPROC_NULL,	"NULL" },
	{ NFSACLPROC2_GETACL,	"GETACL" },
	{ NFSACLPROC2_SETACL,	"SETACL" },
	{ NFSACLPROC2_GETATTR,	"GETATTR" },
	{ NFSACLPROC2_ACCESS,	"ACCESS" },
	{ NFSACLPROC2_GETXATTRDIR, "GETXATTRDIR" },
	{ 0,	NULL }
};

static int
dissect_nfsacl3_getacl_call(tvbuff_t *tvb, packet_info *pinfo _U_,
			    proto_tree *tree, void* data)
{
	int offset = 0;
	offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
	offset = dissect_nfsacl_mask(tvb, offset, tree);

	return offset;
}

static int
dissect_nfsacl3_getacl_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
			     proto_tree *tree, void* data _U_)
{
	uint32_t status;
	proto_item *entry_item;
	proto_tree *entry_tree;
	int offset = 0;

	proto_tree_add_item_ret_uint(tree, hf_nfs_status, tvb, offset, 4, ENC_BIG_ENDIAN, &status);

	offset += 4;

	entry_item = proto_tree_add_item(tree, hf_nfsacl_entry, tvb,
				offset + 0, -1, ENC_NA);
	entry_tree = proto_item_add_subtree(entry_item, ett_nfsacl_entry);

	offset = dissect_nfs3_post_op_attr(tvb, offset, pinfo, entry_tree, "attr");

	if (status != ACL3_OK)
		return offset;

	offset = dissect_nfsacl_secattr(tvb, offset, pinfo, entry_tree);

	return offset;
}

static int
dissect_nfsacl3_setacl_call(tvbuff_t *tvb, packet_info *pinfo _U_,
			    proto_tree *tree, void* data)

{
	proto_item *acl_item;
	proto_tree *acl_tree;
	int offset = 0;

	offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);

	acl_item = proto_tree_add_item(tree, hf_nfsacl_entry, tvb, offset + 0,
				-1, ENC_NA);
	acl_tree = proto_item_add_subtree(acl_item, ett_nfsacl_entry);

	offset = dissect_nfsacl_secattr(tvb, offset, pinfo, acl_tree);

	return offset;
}

static int
dissect_nfsacl3_setacl_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
			     proto_tree *tree, void* data _U_)
{
	uint32_t status;
	int offset = 0;

	proto_tree_add_item_ret_uint(tree, hf_nfs_status, tvb, offset, 4, ENC_BIG_ENDIAN, &status);
	offset += 4;

	offset = dissect_nfs3_post_op_attr(tvb, offset, pinfo, tree, "attr");

	return offset;
}

static int
dissect_nfsacl3_getxattrdir_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data)

{
	int offset = 0;

	offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
	offset = dissect_rpc_bool(tvb, tree, hf_nfsacl_create, offset);

	return offset;
}

static int
dissect_nfsacl3_getxattrdir_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data)
{
	uint32_t status;
	int offset = 0;

	proto_tree_add_item_ret_uint(tree, hf_nfs_status, tvb, offset, 4, ENC_BIG_ENDIAN, &status);
	offset += 4;

	if (status == ACL3_OK)
	{
		offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "fhandle", NULL, (rpc_call_info_value*)data);
		offset = dissect_nfs3_post_op_attr(tvb, offset, pinfo, tree, "attr");
	}

	return offset;
}

static const vsff nfsacl3_proc[] = {
	{ NFSACLPROC_NULL,	"NULL",
		dissect_rpc_void,		dissect_rpc_void },
	{ NFSACLPROC3_GETACL,	"GETACL",
		dissect_nfsacl3_getacl_call,	dissect_nfsacl3_getacl_reply },
	{ NFSACLPROC3_SETACL,	"SETACL",
		dissect_nfsacl3_setacl_call,	dissect_nfsacl3_setacl_reply },
	{ NFSACLPROC3_GETXATTRDIR,	"GETXATTRDIR",
		dissect_nfsacl3_getxattrdir_call, dissect_nfsacl3_getxattrdir_reply },
	{ 0,	NULL,	NULL,	NULL }
};
static const value_string nfsacl3_proc_vals[] = {
	{ NFSACLPROC_NULL,		 "NULL" },
	{ NFSACLPROC3_GETACL,		 "GETACL" },
	{ NFSACLPROC3_SETACL,		 "SETACL" },
	{ NFSACLPROC3_GETXATTRDIR,	 "GETXATTRDIR" },
	{ 0,	NULL }
};

static const rpc_prog_vers_info nfsacl_vers_info[] = {
	{ 1, nfsacl1_proc, &hf_nfsacl_procedure_v1 },
	{ 2, nfsacl2_proc, &hf_nfsacl_procedure_v2 },
	{ 3, nfsacl3_proc, &hf_nfsacl_procedure_v3 },
};

void
proto_register_nfsacl(void)
{
	static hf_register_info hf[] = {
		{ &hf_nfsacl_mask, {
			"Mask", "nfsacl.mask", FT_UINT32, BASE_HEX,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_mask_acl_entry, {
			"ACL entry", "nfsacl.mask.acl_entry", FT_BOOLEAN, 32,
            TFS(&tfs_yes_no), 0x00000001, NULL, HFILL }},
		{ &hf_nfsacl_mask_acl_count, {
			"ACL count", "nfsacl.mask.acl_count", FT_BOOLEAN, 32,
            TFS(&tfs_yes_no), 0x00000002, NULL, HFILL }},
		{ &hf_nfsacl_mask_default_acl_entry, {
			"Default ACL entry", "nfsacl.mask.default_acl_entry", FT_BOOLEAN, 32,
            TFS(&tfs_yes_no), 0x00000004, NULL, HFILL }},
		{ &hf_nfsacl_mask_default_acl_count, {
			"Default ACL count", "nfsacl.mask.default_acl_count", FT_BOOLEAN, 32,
            TFS(&tfs_yes_no), 0x00000008, NULL, HFILL }},
		{ &hf_nfsacl_procedure_v1, {
			"V1 Procedure", "nfsacl.procedure_v1", FT_UINT32, BASE_DEC,
			VALS(nfsacl1_proc_vals), 0, NULL, HFILL }},
		{ &hf_nfsacl_procedure_v2, {
			"V2 Procedure", "nfsacl.procedure_v2", FT_UINT32, BASE_DEC,
			VALS(nfsacl2_proc_vals), 0, NULL, HFILL }},
		{ &hf_nfsacl_procedure_v3, {
			"V3 Procedure", "nfsacl.procedure_v3", FT_UINT32, BASE_DEC,
			VALS(nfsacl3_proc_vals), 0, NULL, HFILL }},
			/* generic */
		{ &hf_nfsacl_entry, {
			"ACL", "nfsacl.acl", FT_NONE, BASE_NONE,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_aclcnt, {
			"ACL count", "nfsacl.aclcnt", FT_UINT32, BASE_DEC,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_dfaclcnt, {
			"Default ACL count", "nfsacl.dfaclcnt", FT_UINT32, BASE_DEC,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_aclent, {
			"ACL Entry", "nfsacl.aclent", FT_NONE, BASE_NONE,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_aclent_type, {
			"Type", "nfsacl.aclent.type", FT_UINT32, BASE_DEC,
			VALS(names_nfsacl_aclent_type), 0, NULL, HFILL }},
		{ &hf_nfsacl_aclent_uid, {
			"UID", "nfsacl.aclent.uid", FT_UINT32, BASE_DEC,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_aclent_perm, {
			"Permissions", "nfsacl.aclent.perm", FT_UINT32, BASE_DEC,
			NULL, 0, NULL, HFILL }},
		{ &hf_nfsacl_aclent_perm_read, {
			"READ", "nfsacl.aclent.perm.read", FT_BOOLEAN, 32,
			TFS(&tfs_yes_no), NA_READ, NULL, HFILL }},
		{ &hf_nfsacl_aclent_perm_write, {
			"WRITE", "nfsacl.aclent.perm.write", FT_BOOLEAN, 32,
			TFS(&tfs_yes_no), NA_WRITE, NULL, HFILL }},
		{ &hf_nfsacl_aclent_perm_exec, {
			"EXEC", "nfsacl.aclent.perm.exec", FT_BOOLEAN, 32,
			TFS(&tfs_yes_no), NA_EXEC, NULL, HFILL }},
			/* V2 */
		{ &hf_nfsacl_create, {
			"create", "nfsacl.create", FT_BOOLEAN, BASE_NONE,
			TFS(&tfs_yes_no), 0x0, "Create?", HFILL }},
	};

	static int *ett[] = {
		&ett_nfsacl,
		&ett_nfsacl_mask,
		&ett_nfsacl_entry,
		&ett_nfsacl_aclent,
		&ett_nfsacl_aclent_perm,
		&ett_nfsacl_aclent_entries
	};

	proto_nfsacl = proto_register_protocol("NFSACL", "NFSACL", "nfsacl");
	proto_register_field_array(proto_nfsacl, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
}

void
proto_reg_handoff_nfsacl(void)
{
	/* Register the protocol as RPC */
	rpc_init_prog(proto_nfsacl, NFSACL_PROGRAM, ett_nfsacl,
	    G_N_ELEMENTS(nfsacl_vers_info), nfsacl_vers_info);
}

/*
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 8
 * tab-width: 8
 * indent-tabs-mode: t
 * End:
 *
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
 * :indentSize=8:tabSize=8:noTabs=false:
 */