ab4d52ca1e8b07fc229f55a59c2a24454af5cd2b
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-smb_acl.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/smb_acl.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/smb_acl.cnf.
4         
5         Pidl is a perl based IDL compiler for DCE/RPC idl files.
6         It is maintained by the Samba team, not the Wireshark team.
7         Instructions on how to download and install Pidl can be
8         found at http://wiki.wireshark.org/Pidl
9
10         $Id$
11 */
12
13
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
21
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
25
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-smb_acl.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_smb_acl = -1;
33 static gint ett_smb_acl_smb_acl_user = -1;
34 static gint ett_smb_acl_smb_acl_group = -1;
35 static gint ett_smb_acl_smb_acl_entry_info = -1;
36 static gint ett_smb_acl_smb_acl_entry = -1;
37 static gint ett_smb_acl_smb_acl_t = -1;
38 static gint ett_smb_acl_smb_acl_wrapper = -1;
39
40
41 /* Header field declarations */
42 static gint hf_smb_acl_smb_acl_wrapper_mode = -1;
43 static gint hf_smb_acl_smb_acl_entry_info = -1;
44 static gint hf_smb_acl_smb_acl_wrapper_default_acl = -1;
45 static gint hf_smb_acl_smb_acl_entry_info_group = -1;
46 static gint hf_smb_acl_smb_acl_wrapper_access_acl = -1;
47 static gint hf_smb_acl_smb_acl_entry_info_user = -1;
48 static gint hf_smb_acl_smb_acl_t_acl = -1;
49 static gint hf_smb_acl_smb_acl_user_uid = -1;
50 static gint hf_smb_acl_smb_acl_t_next = -1;
51 static gint hf_smb_acl_smb_acl_entry_a_perm = -1;
52 static gint hf_smb_acl_smb_acl_group_gid = -1;
53 static gint hf_smb_acl_smb_acl_wrapper_group = -1;
54 static gint hf_smb_acl_smb_acl_t_count = -1;
55 static gint hf_smb_acl_smb_acl_wrapper_owner = -1;
56 static gint hf_smb_acl_smb_acl_entry_a_type = -1;
57 static gint hf_smb_acl_opnum = -1;
58
59 static gint proto_dcerpc_smb_acl = -1;
60 /* Version information */
61
62
63 static e_uuid_t uuid_dcerpc_smb_acl = {
64         0x, 0x, 0x,
65         { 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x }
66 };
67 static guint16 ver_dcerpc_smb_acl = 0;
68
69 const value_string smb_acl_smb_acl_tag_t_vals[] = {
70         { SMB_ACL_TAG_INVALID, "SMB_ACL_TAG_INVALID" },
71         { SMB_ACL_USER, "SMB_ACL_USER" },
72         { SMB_ACL_USER_OBJ, "SMB_ACL_USER_OBJ" },
73         { SMB_ACL_GROUP, "SMB_ACL_GROUP" },
74         { SMB_ACL_GROUP_OBJ, "SMB_ACL_GROUP_OBJ" },
75         { SMB_ACL_OTHER, "SMB_ACL_OTHER" },
76         { SMB_ACL_MASK, "SMB_ACL_MASK" },
77 { 0, NULL }
78 };
79 static int smb_acl_dissect_element_user_uid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
80 static int smb_acl_dissect_element_group_gid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
81 static int smb_acl_dissect_element_entry_info_user(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
82 static int smb_acl_dissect_element_entry_info_group(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
83 static int smb_acl_dissect_element_entry_a_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *a_type);
84 static int smb_acl_dissect_element_entry_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *a_type);
85 static int smb_acl_dissect_element_entry_a_perm(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
86 static int smb_acl_dissect_element_t_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
87 static int smb_acl_dissect_element_t_next(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
88 static int smb_acl_dissect_element_t_acl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
89 static int smb_acl_dissect_element_t_acl_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
90 static int smb_acl_dissect_element_wrapper_access_acl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
91 static int smb_acl_dissect_element_wrapper_access_acl_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
92 static int smb_acl_dissect_element_wrapper_default_acl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
93 static int smb_acl_dissect_element_wrapper_default_acl_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
94 static int smb_acl_dissect_element_wrapper_owner(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
95 static int smb_acl_dissect_element_wrapper_group(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
96 static int smb_acl_dissect_element_wrapper_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
97
98
99 /* IDL: enum { */
100 /* IDL:         SMB_ACL_TAG_INVALID=0, */
101 /* IDL:         SMB_ACL_USER=1, */
102 /* IDL:         SMB_ACL_USER_OBJ=2, */
103 /* IDL:         SMB_ACL_GROUP=3, */
104 /* IDL:         SMB_ACL_GROUP_OBJ=4, */
105 /* IDL:         SMB_ACL_OTHER=5, */
106 /* IDL:         SMB_ACL_MASK=6, */
107 /* IDL: } */
108
109 int
110 smb_acl_dissect_enum_tag_t(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
111 {
112         guint1632 parameter=0;
113         if(param){
114                 parameter=(guint1632)*param;
115         }
116         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
117         if(param){
118                 *param=(guint32)parameter;
119         }
120         return offset;
121 }
122
123
124 /* IDL: struct { */
125 /* IDL:         uid_t uid; */
126 /* IDL: } */
127
128 static int
129 smb_acl_dissect_element_user_uid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
130 {
131         offset = smb_acl_dissect_struct_uid_t(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_user_uid,0);
132
133         return offset;
134 }
135
136 int
137 smb_acl_dissect_struct_user(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
138 {
139         proto_item *item = NULL;
140         proto_tree *tree = NULL;
141         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
142         int old_offset;
143
144         ALIGN_TO_8_BYTES;
145
146         old_offset = offset;
147
148         if (parent_tree) {
149                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
150                 tree = proto_item_add_subtree(item, ett_smb_acl_smb_acl_user);
151         }
152         
153         offset = smb_acl_dissect_element_user_uid(tvb, offset, pinfo, tree, drep);
154
155
156         proto_item_set_len(item, offset-old_offset);
157
158
159         if (di->call_data->flags & DCERPC_IS_NDR64) {
160                 ALIGN_TO_8_BYTES;
161         }
162
163         return offset;
164 }
165
166
167 /* IDL: struct { */
168 /* IDL:         gid_t gid; */
169 /* IDL: } */
170
171 static int
172 smb_acl_dissect_element_group_gid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
173 {
174         offset = smb_acl_dissect_struct_gid_t(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_group_gid,0);
175
176         return offset;
177 }
178
179 int
180 smb_acl_dissect_struct_group(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
181 {
182         proto_item *item = NULL;
183         proto_tree *tree = NULL;
184         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
185         int old_offset;
186
187         ALIGN_TO_8_BYTES;
188
189         old_offset = offset;
190
191         if (parent_tree) {
192                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
193                 tree = proto_item_add_subtree(item, ett_smb_acl_smb_acl_group);
194         }
195         
196         offset = smb_acl_dissect_element_group_gid(tvb, offset, pinfo, tree, drep);
197
198
199         proto_item_set_len(item, offset-old_offset);
200
201
202         if (di->call_data->flags & DCERPC_IS_NDR64) {
203                 ALIGN_TO_8_BYTES;
204         }
205
206         return offset;
207 }
208
209
210 /* IDL: [switch_type(uint16)] union { */
211 /* IDL: [case(SMB_ACL_USER)] [case(SMB_ACL_USER)] smb_acl_user user; */
212 /* IDL: [case(SMB_ACL_USER_OBJ)] [case(SMB_ACL_USER_OBJ)] EMPTY ; */
213 /* IDL: [case(SMB_ACL_GROUP)] [case(SMB_ACL_GROUP)] smb_acl_group group; */
214 /* IDL: [case(SMB_ACL_GROUP_OBJ)] [case(SMB_ACL_GROUP_OBJ)] EMPTY ; */
215 /* IDL: [case(SMB_ACL_OTHER)] [case(SMB_ACL_OTHER)] EMPTY ; */
216 /* IDL: [case(SMB_ACL_MASK)] [case(SMB_ACL_MASK)] EMPTY ; */
217 /* IDL: } */
218
219 static int
220 smb_acl_dissect_element_entry_info_user(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
221 {
222         offset = smb_acl_dissect_struct_user(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_entry_info_user,0);
223
224         return offset;
225 }
226
227 static int
228 smb_acl_dissect_element_entry_info_group(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
229 {
230         offset = smb_acl_dissect_struct_group(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_entry_info_group,0);
231
232         return offset;
233 }
234
235 static int
236 smb_acl_dissect_entry_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
237 {
238         proto_item *item = NULL;
239         proto_tree *tree = NULL;
240         int old_offset;
241         guint16 level;
242
243         old_offset = offset;
244         if (parent_tree) {
245                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "smb_acl_entry_info");
246                 tree = proto_item_add_subtree(item, ett_smb_acl_smb_acl_entry_info);
247         }
248
249         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &level);
250         ALIGN_TO_8_BYTES;
251
252         switch(level) {
253                 case SMB_ACL_USER:
254                         offset = smb_acl_dissect_element_entry_info_user(tvb, offset, pinfo, tree, drep);
255                 break;
256
257                 case SMB_ACL_USER_OBJ:
258                 break;
259
260                 case SMB_ACL_GROUP:
261                         offset = smb_acl_dissect_element_entry_info_group(tvb, offset, pinfo, tree, drep);
262                 break;
263
264                 case SMB_ACL_GROUP_OBJ:
265                 break;
266
267                 case SMB_ACL_OTHER:
268                 break;
269
270                 case SMB_ACL_MASK:
271                 break;
272         }
273         proto_item_set_len(item, offset-old_offset);
274
275
276         return offset;
277 }
278
279 /* IDL: struct { */
280 /* IDL:         smb_acl_tag_t a_type; */
281 /* IDL:         [switch_is(a_type)] smb_acl_entry_info info; */
282 /* IDL:         uint32 a_perm; */
283 /* IDL: } */
284
285 static int
286 smb_acl_dissect_element_entry_a_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *a_type)
287 {
288         offset = smb_acl_dissect_enum_tag_t(tvb, offset, pinfo, tree, drep, hf_smb_acl_smb_acl_entry_a_type, a_type);
289
290         return offset;
291 }
292
293 static int
294 smb_acl_dissect_element_entry_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *a_type)
295 {
296         offset = smb_acl_dissect_entry_info(tvb, offset, pinfo, tree, drep, hf_smb_acl_smb_acl_entry_info, *a_type);
297
298         return offset;
299 }
300
301 static int
302 smb_acl_dissect_element_entry_a_perm(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
303 {
304         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_smb_acl_smb_acl_entry_a_perm, 0);
305
306         return offset;
307 }
308
309 int
310 smb_acl_dissect_struct_entry(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
311 {
312         guint1632 a_type;
313         proto_item *item = NULL;
314         proto_tree *tree = NULL;
315         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
316         int old_offset;
317
318         ALIGN_TO_8_BYTES;
319
320         old_offset = offset;
321
322         if (parent_tree) {
323                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
324                 tree = proto_item_add_subtree(item, ett_smb_acl_smb_acl_entry);
325         }
326         
327         offset = smb_acl_dissect_element_entry_a_type(tvb, offset, pinfo, tree, drep, &a_type);
328
329         offset = smb_acl_dissect_element_entry_info(tvb, offset, pinfo, tree, drep, &a_type);
330
331         offset = smb_acl_dissect_element_entry_a_perm(tvb, offset, pinfo, tree, drep);
332
333
334         proto_item_set_len(item, offset-old_offset);
335
336
337         if (di->call_data->flags & DCERPC_IS_NDR64) {
338                 ALIGN_TO_8_BYTES;
339         }
340
341         return offset;
342 }
343
344
345 /* IDL: struct { */
346 /* IDL:         int32 count; */
347 /* IDL:         [value(0)] int32 next; */
348 /* IDL:         [size_is(count)] smb_acl_entry acl[*]; */
349 /* IDL: } */
350
351 static int
352 smb_acl_dissect_element_t_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
353 {
354         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_smb_acl_smb_acl_t_count, 0);
355
356         return offset;
357 }
358
359 static int
360 smb_acl_dissect_element_t_next(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
361 {
362         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_smb_acl_smb_acl_t_next, 0);
363
364         return offset;
365 }
366
367 static int
368 smb_acl_dissect_element_t_acl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
369 {
370         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, smb_acl_dissect_element_t_acl_);
371
372         return offset;
373 }
374
375 static int
376 smb_acl_dissect_element_t_acl_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
377 {
378         offset = smb_acl_dissect_struct_entry(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_t_acl,0);
379
380         return offset;
381 }
382
383 int
384 smb_acl_dissect_struct_t(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
385 {
386         proto_item *item = NULL;
387         proto_tree *tree = NULL;
388         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
389         int old_offset;
390
391         ALIGN_TO_8_BYTES;
392
393         old_offset = offset;
394
395         if (parent_tree) {
396                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
397                 tree = proto_item_add_subtree(item, ett_smb_acl_smb_acl_t);
398         }
399         
400         offset = smb_acl_dissect_element_t_count(tvb, offset, pinfo, tree, drep);
401
402         offset = smb_acl_dissect_element_t_next(tvb, offset, pinfo, tree, drep);
403
404         offset = smb_acl_dissect_element_t_acl(tvb, offset, pinfo, tree, drep);
405
406
407         proto_item_set_len(item, offset-old_offset);
408
409
410         if (di->call_data->flags & DCERPC_IS_NDR64) {
411                 ALIGN_TO_8_BYTES;
412         }
413
414         return offset;
415 }
416
417
418 /* IDL: struct { */
419 /* IDL:         [unique(1)] smb_acl_t *access_acl; */
420 /* IDL:         [unique(1)] smb_acl_t *default_acl; */
421 /* IDL:         uid_t owner; */
422 /* IDL:         gid_t group; */
423 /* IDL:         uint32 mode; */
424 /* IDL: } */
425
426 static int
427 smb_acl_dissect_element_wrapper_access_acl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
428 {
429         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, smb_acl_dissect_element_wrapper_access_acl_, NDR_POINTER_UNIQUE, "Pointer to Access Acl (smb_acl_t)",hf_smb_acl_smb_acl_wrapper_access_acl);
430
431         return offset;
432 }
433
434 static int
435 smb_acl_dissect_element_wrapper_access_acl_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
436 {
437         offset = smb_acl_dissect_struct_t(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_wrapper_access_acl,0);
438
439         return offset;
440 }
441
442 static int
443 smb_acl_dissect_element_wrapper_default_acl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
444 {
445         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, smb_acl_dissect_element_wrapper_default_acl_, NDR_POINTER_UNIQUE, "Pointer to Default Acl (smb_acl_t)",hf_smb_acl_smb_acl_wrapper_default_acl);
446
447         return offset;
448 }
449
450 static int
451 smb_acl_dissect_element_wrapper_default_acl_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
452 {
453         offset = smb_acl_dissect_struct_t(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_wrapper_default_acl,0);
454
455         return offset;
456 }
457
458 static int
459 smb_acl_dissect_element_wrapper_owner(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
460 {
461         offset = smb_acl_dissect_struct_uid_t(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_wrapper_owner,0);
462
463         return offset;
464 }
465
466 static int
467 smb_acl_dissect_element_wrapper_group(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
468 {
469         offset = smb_acl_dissect_struct_gid_t(tvb,offset,pinfo,tree,drep,hf_smb_acl_smb_acl_wrapper_group,0);
470
471         return offset;
472 }
473
474 static int
475 smb_acl_dissect_element_wrapper_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
476 {
477         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_smb_acl_smb_acl_wrapper_mode, 0);
478
479         return offset;
480 }
481
482 int
483 smb_acl_dissect_struct_wrapper(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
484 {
485         proto_item *item = NULL;
486         proto_tree *tree = NULL;
487         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
488         int old_offset;
489
490         ALIGN_TO_8_BYTES;
491
492         old_offset = offset;
493
494         if (parent_tree) {
495                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
496                 tree = proto_item_add_subtree(item, ett_smb_acl_smb_acl_wrapper);
497         }
498         
499         offset = smb_acl_dissect_element_wrapper_access_acl(tvb, offset, pinfo, tree, drep);
500
501         offset = smb_acl_dissect_element_wrapper_default_acl(tvb, offset, pinfo, tree, drep);
502
503         offset = smb_acl_dissect_element_wrapper_owner(tvb, offset, pinfo, tree, drep);
504
505         offset = smb_acl_dissect_element_wrapper_group(tvb, offset, pinfo, tree, drep);
506
507         offset = smb_acl_dissect_element_wrapper_mode(tvb, offset, pinfo, tree, drep);
508
509
510         proto_item_set_len(item, offset-old_offset);
511
512
513         if (di->call_data->flags & DCERPC_IS_NDR64) {
514                 ALIGN_TO_8_BYTES;
515         }
516
517         return offset;
518 }
519
520
521 static dcerpc_sub_dissector smb_acl_dissectors[] = {
522         { 0, NULL, NULL, NULL }
523 };
524
525 void proto_register_dcerpc_smb_acl(void)
526 {
527         static hf_register_info hf[] = {
528         { &hf_smb_acl_smb_acl_wrapper_mode,
529           { "Mode", "smb_acl.smb_acl_wrapper.mode", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
530         { &hf_smb_acl_smb_acl_entry_info,
531           { "Info", "smb_acl.smb_acl_entry.info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
532         { &hf_smb_acl_smb_acl_wrapper_default_acl,
533           { "Default Acl", "smb_acl.smb_acl_wrapper.default_acl", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
534         { &hf_smb_acl_smb_acl_entry_info_group,
535           { "Group", "smb_acl.smb_acl_entry_info.group", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
536         { &hf_smb_acl_smb_acl_wrapper_access_acl,
537           { "Access Acl", "smb_acl.smb_acl_wrapper.access_acl", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
538         { &hf_smb_acl_smb_acl_entry_info_user,
539           { "User", "smb_acl.smb_acl_entry_info.user", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
540         { &hf_smb_acl_smb_acl_t_acl,
541           { "Acl", "smb_acl.smb_acl_t.acl", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
542         { &hf_smb_acl_smb_acl_user_uid,
543           { "Uid", "smb_acl.smb_acl_user.uid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
544         { &hf_smb_acl_smb_acl_t_next,
545           { "Next", "smb_acl.smb_acl_t.next", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }},
546         { &hf_smb_acl_smb_acl_entry_a_perm,
547           { "A Perm", "smb_acl.smb_acl_entry.a_perm", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
548         { &hf_smb_acl_smb_acl_group_gid,
549           { "Gid", "smb_acl.smb_acl_group.gid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
550         { &hf_smb_acl_smb_acl_wrapper_group,
551           { "Group", "smb_acl.smb_acl_wrapper.group", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
552         { &hf_smb_acl_smb_acl_t_count,
553           { "Count", "smb_acl.smb_acl_t.count", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }},
554         { &hf_smb_acl_smb_acl_wrapper_owner,
555           { "Owner", "smb_acl.smb_acl_wrapper.owner", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
556         { &hf_smb_acl_smb_acl_entry_a_type,
557           { "A Type", "smb_acl.smb_acl_entry.a_type", FT_UINT1632, BASE_DEC, VALS(smb_acl_smb_acl_tag_t_vals), 0, NULL, HFILL }},
558         { &hf_smb_acl_opnum,
559           { "Operation", "smb_acl.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
560         };
561
562
563         static gint *ett[] = {
564                 &ett_dcerpc_smb_acl,
565                 &ett_smb_acl_smb_acl_user,
566                 &ett_smb_acl_smb_acl_group,
567                 &ett_smb_acl_smb_acl_entry_info,
568                 &ett_smb_acl_smb_acl_entry,
569                 &ett_smb_acl_smb_acl_t,
570                 &ett_smb_acl_smb_acl_wrapper,
571         };
572
573         proto_dcerpc_smb_acl = proto_register_protocol("SMB_ACL (pidl)", "SMB_ACL", "smb_acl");
574         proto_register_field_array(proto_dcerpc_smb_acl, hf, array_length (hf));
575         proto_register_subtree_array(ett, array_length(ett));
576 }
577
578 void proto_reg_handoff_dcerpc_smb_acl(void)
579 {
580         dcerpc_init_uuid(proto_dcerpc_smb_acl, ett_dcerpc_smb_acl,
581                 &uuid_dcerpc_smb_acl, ver_dcerpc_smb_acl,
582                 smb_acl_dissectors, hf_smb_acl_opnum);
583 }