Bump the version to 0.9.10.
[obnox/wireshark/wip.git] / packet-dcerpc-srvsvc.c
1 /* packet-dcerpc-srvsvc.c
2  * Routines for SMB \PIPE\srvsvc packet disassembly
3  * Copyright 2001-2003, Tim Potter <tpot@samba.org>
4  * Copyright 2002, Richard Sharpe <rsharpe@ns.aus.com>
5  *   decode srvsvc calls where Samba knows them ...
6  * Copyright 2002, Ronnie Sahlberg
7  *   rewrote entire dissector
8  *
9  * 2002, some share information levels implemented based on samba
10  * sources.
11  *
12  * $Id: packet-dcerpc-srvsvc.c,v 1.53 2003/02/17 01:59:39 tpot Exp $
13  *
14  * Ethereal - Network traffic analyzer
15  * By Gerald Combs <gerald@ethereal.com>
16  * Copyright 1998 Gerald Combs
17  *
18  * This program is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU General Public License
20  * as published by the Free Software Foundation; either version 2
21  * of the License, or (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31  */
32
33 /* The IDL file for this interface can be extracted by grepping for IDL */
34
35
36 #ifdef HAVE_CONFIG_H
37 #include "config.h"
38 #endif
39
40 #include <glib.h>
41 #include <epan/packet.h>
42 #include "packet-dcerpc.h"
43 #include "packet-dcerpc-srvsvc.h"
44 #include "packet-dcerpc-lsa.h"
45 #include "packet-dcerpc-nt.h"
46 #include "packet-smb-common.h"
47 #include "packet-smb-browse.h"
48 #include "smb.h"
49
50 static int proto_dcerpc_srvsvc = -1;
51 static int hf_srvsvc_opnum = -1;
52 static int hf_srvsvc_reserved = -1;
53 static int hf_srvsvc_server = -1;
54 static int hf_srvsvc_emulated_server = -1;
55 static int hf_srvsvc_alerts = -1;
56 static int hf_srvsvc_guest = -1;
57 static int hf_srvsvc_transport = -1;
58 static int hf_srvsvc_session = -1;
59 static int hf_srvsvc_session_num_opens = -1;
60 static int hf_srvsvc_session_time = -1;
61 static int hf_srvsvc_session_idle_time = -1;
62 static int hf_srvsvc_session_user_flags = -1;
63 static int hf_srvsvc_qualifier = -1;
64 static int hf_srvsvc_computer = -1;
65 static int hf_srvsvc_user = -1;
66 static int hf_srvsvc_path = -1;
67 static int hf_srvsvc_share_passwd = -1;
68 static int hf_srvsvc_share_alternate_name = -1;
69 static int hf_srvsvc_file_id = -1;
70 static int hf_srvsvc_perm = -1;
71 static int hf_srvsvc_policy = -1;
72 static int hf_srvsvc_file_num_locks = -1;
73 static int hf_srvsvc_con_id = -1;
74 static int hf_srvsvc_max_uses = -1;
75 static int hf_srvsvc_cur_uses = -1;
76 static int hf_srvsvc_con_time = -1;
77 static int hf_srvsvc_con_type = -1;
78 static int hf_srvsvc_con_num_opens = -1;
79 static int hf_srvsvc_chrqpri = -1;
80 static int hf_srvsvc_chrqnumusers = -1;
81 static int hf_srvsvc_chrqnumahead = -1;
82 static int hf_srvsvc_chrdev = -1;
83 static int hf_srvsvc_chrdevq = -1;
84 static int hf_srvsvc_chrdev_time = -1;
85 static int hf_srvsvc_chrdev_status = -1;
86 static int hf_srvsvc_chrdev_opcode = -1;
87 static int hf_srvsvc_info_level = -1;
88 static int hf_srvsvc_rc = -1;
89 static int hf_srvsvc_platform_id = -1;
90 static int hf_srvsvc_ver_major = -1;
91 static int hf_srvsvc_ver_minor = -1;
92 static int hf_srvsvc_client_type = -1;
93 static int hf_srvsvc_comment = -1;
94 static int hf_srvsvc_users = -1;
95 static int hf_srvsvc_disc = -1;
96 static int hf_srvsvc_hidden = -1;
97 static int hf_srvsvc_announce = -1;
98 static int hf_srvsvc_anndelta = -1;
99 static int hf_srvsvc_licences = -1;
100 static int hf_srvsvc_user_path = -1;
101 static int hf_srvsvc_share = -1;
102 static int hf_srvsvc_share_type = -1;
103 static int hf_srvsvc_num_entries = -1;
104 static int hf_srvsvc_preferred_len = -1;
105 static int hf_srvsvc_parm_error = -1;
106 static int hf_srvsvc_enum_handle = -1;
107 static int hf_srvsvc_ulist_mtime = -1;
108 static int hf_srvsvc_glist_mtime = -1;
109 static int hf_srvsvc_alist_mtime = -1;
110 static int hf_srvsvc_security = -1;
111 static int hf_srvsvc_dfs_root_flags = -1;
112 static int hf_srvsvc_numadmin = -1;
113 static int hf_srvsvc_lanmask = -1;
114 static int hf_srvsvc_chdevs = -1;
115 static int hf_srvsvc_chdevqs = -1;
116 static int hf_srvsvc_chdevjobs = -1;
117 static int hf_srvsvc_connections = -1;
118 static int hf_srvsvc_shares = -1;
119 static int hf_srvsvc_openfiles = -1;
120 static int hf_srvsvc_sessopens = -1;
121 static int hf_srvsvc_sessvcs = -1;
122 static int hf_srvsvc_sessreqs = -1;
123 static int hf_srvsvc_opensearch = -1;
124 static int hf_srvsvc_activelocks = -1;
125 static int hf_srvsvc_sizreqbufs = -1;
126 static int hf_srvsvc_numbigbufs = -1;
127 static int hf_srvsvc_numfiletasks = -1;
128 static int hf_srvsvc_alertsched = -1;
129 static int hf_srvsvc_erroralert = -1;
130 static int hf_srvsvc_logonalert = -1;
131 static int hf_srvsvc_accessalert = -1;
132 static int hf_srvsvc_diskalert = -1;
133 static int hf_srvsvc_netioalert = -1;
134 static int hf_srvsvc_maxauditsz = -1;
135 static int hf_srvsvc_srvheuristics = -1;
136 static int hf_srvsvc_auditedevents = -1;
137 static int hf_srvsvc_auditprofile = -1;
138 static int hf_srvsvc_autopath = -1;
139 static int hf_srvsvc_initworkitems = -1;
140 static int hf_srvsvc_maxworkitems = -1;
141 static int hf_srvsvc_rawworkitems = -1;
142 static int hf_srvsvc_irpstacksize = -1;
143 static int hf_srvsvc_maxrawbuflen = -1;
144 static int hf_srvsvc_maxpagedmemoryusage = -1;
145 static int hf_srvsvc_maxnonpagedmemoryusage = -1;
146 static int hf_srvsvc_enablesoftcompat = -1;
147 static int hf_srvsvc_enableforcedlogoff = -1;
148 static int hf_srvsvc_timesource = -1;
149 static int hf_srvsvc_acceptdownlevelapis = -1;
150 static int hf_srvsvc_lmannounce = -1;
151 static int hf_srvsvc_domain = -1;
152 static int hf_srvsvc_maxcopyreadlen = -1;
153 static int hf_srvsvc_maxcopywritelen = -1;
154 static int hf_srvsvc_minkeepsearch = -1;
155 static int hf_srvsvc_maxkeepsearch = -1;
156 static int hf_srvsvc_minkeepcomplsearch = -1;
157 static int hf_srvsvc_maxkeepcomplsearch = -1;
158 static int hf_srvsvc_threadcountadd = -1;
159 static int hf_srvsvc_numblockthreads = -1;
160 static int hf_srvsvc_scavtimeout = -1;
161 static int hf_srvsvc_minrcvqueue = -1;
162 static int hf_srvsvc_minfreeworkitems = -1;
163 static int hf_srvsvc_xactmemsize = -1;
164 static int hf_srvsvc_threadpriority = -1;
165 static int hf_srvsvc_maxmpxct = -1;
166 static int hf_srvsvc_oplockbreakwait = -1;
167 static int hf_srvsvc_oplockbreakresponsewait = -1;
168 static int hf_srvsvc_enableoplocks = -1;
169 static int hf_srvsvc_enableoplockforceclose = -1;
170 static int hf_srvsvc_enablefcbopens = -1;
171 static int hf_srvsvc_enableraw = -1;
172 static int hf_srvsvc_enablesharednetdrives = -1;
173 static int hf_srvsvc_minfreeconnections = -1;
174 static int hf_srvsvc_maxfreeconnections = -1;
175 static int hf_srvsvc_initsesstable = -1;
176 static int hf_srvsvc_initconntable = -1;
177 static int hf_srvsvc_initfiletable = -1;
178 static int hf_srvsvc_initsearchtable = -1;
179 static int hf_srvsvc_errortreshold = -1;
180 static int hf_srvsvc_networkerrortreshold = -1;
181 static int hf_srvsvc_diskspacetreshold = -1;
182 static int hf_srvsvc_maxlinkdelay = -1;
183 static int hf_srvsvc_minlinkthroughput = -1;
184 static int hf_srvsvc_linkinfovalidtime = -1;
185 static int hf_srvsvc_scavqosinfoupdatetime = -1;
186 static int hf_srvsvc_maxworkitemidletime = -1;
187 static int hf_srvsvc_disk_name = -1;
188 static int hf_srvsvc_disk_name_len = -1;
189 static int hf_srvsvc_service = -1;
190 static int hf_srvsvc_service_options = -1;
191 static int hf_srvsvc_transport_numberofvcs = -1;
192 static int hf_srvsvc_transport_name = -1;
193 static int hf_srvsvc_transport_address = -1;
194 static int hf_srvsvc_transport_address_len = -1;
195 static int hf_srvsvc_transport_networkaddress = -1;
196 static int hf_srvsvc_service_bits = -1;
197 static int hf_srvsvc_service_bits_of_interest = -1;
198 static int hf_srvsvc_update_immediately = -1;
199 static int hf_srvsvc_path_flags = -1;
200 static int hf_srvsvc_share_flags = -1;
201 static int hf_srvsvc_path_type = -1;
202 static int hf_srvsvc_outbuflen = -1;
203 static int hf_srvsvc_prefix = -1;
204 static int hf_srvsvc_hnd = -1;
205 static int hf_srvsvc_server_stat_start = -1;
206 static int hf_srvsvc_server_stat_fopens = -1;
207 static int hf_srvsvc_server_stat_devopens = -1;
208 static int hf_srvsvc_server_stat_jobsqueued = -1;
209 static int hf_srvsvc_server_stat_sopens = -1;
210 static int hf_srvsvc_server_stat_stimeouts = -1;
211 static int hf_srvsvc_server_stat_serrorout = -1;
212 static int hf_srvsvc_server_stat_pwerrors = -1;
213 static int hf_srvsvc_server_stat_permerrors = -1;
214 static int hf_srvsvc_server_stat_syserrors = -1;
215 static int hf_srvsvc_server_stat_bytessent = -1;
216 static int hf_srvsvc_server_stat_bytesrcvd = -1;
217 static int hf_srvsvc_server_stat_avresponse = -1;
218 static int hf_srvsvc_server_stat_reqbufneed = -1;
219 static int hf_srvsvc_server_stat_bigbufneed = -1;
220 static int hf_srvsvc_tod_elapsed = -1;
221 static int hf_srvsvc_tod_msecs = -1;
222 static int hf_srvsvc_tod_hours = -1;
223 static int hf_srvsvc_tod_mins = -1;
224 static int hf_srvsvc_tod_secs = -1;
225 static int hf_srvsvc_tod_hunds = -1;
226 static int hf_srvsvc_tod_timezone = -1;
227 static int hf_srvsvc_tod_tinterval = -1;
228 static int hf_srvsvc_tod_day = -1;
229 static int hf_srvsvc_tod_month = -1;
230 static int hf_srvsvc_tod_year = -1;
231 static int hf_srvsvc_tod_weekday = -1;
232 static int hf_srvsvc_path_len = -1;
233
234 static gint ett_dcerpc_srvsvc = -1;
235 static gint ett_srvsvc_share_info_1 = -1;
236 static gint ett_srvsvc_share_info_2 = -1;
237 static gint ett_srvsvc_share_info_501 = -1;
238 static gint ett_srvsvc_share_info_502 = -1;
239
240
241
242 /*
243  IDL [ uuid(4b324fc8-1670-01d3-1278-5a47bf6ee188),
244  IDL   version(3.0),
245  IDL   implicit_handle(handle_t rpc_binding)
246  IDL ] interface srvsvc
247  IDL {
248 */
249 static e_uuid_t uuid_dcerpc_srvsvc = {
250         0x4b324fc8, 0x1670, 0x01d3,
251         { 0x12, 0x78, 0x5a, 0x47, 0xbf, 0x6e, 0xe1, 0x88 }
252 };
253
254 static guint16 ver_dcerpc_srvsvc = 3;
255
256 static int
257 srvsvc_dissect_pointer_long(tvbuff_t *tvb, int offset,
258                              packet_info *pinfo, proto_tree *tree,
259                              char *drep)
260 {
261         dcerpc_info *di;
262
263         di=pinfo->private_data;
264         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
265                                      di->hf_index, NULL);
266         return offset;
267 }
268
269 static int
270 srvsvc_dissect_ENUM_HANDLE(tvbuff_t *tvb, int offset,
271                            packet_info *pinfo, proto_tree *tree,
272                            char *drep)
273 {
274
275   offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
276                               hf_srvsvc_enum_handle, 0);
277   return offset;
278
279 }
280
281 /*
282  * IDL typedef struct {
283  * IDL   [string] [unique] wchar_t *dev;
284  * IDL } CHARDEV_INFO_0;
285  */
286 static int
287 srvsvc_dissect_CHARDEV_INFO_0(tvbuff_t *tvb, int offset,
288                                      packet_info *pinfo, proto_tree *tree,
289                                      char *drep)
290 {
291         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
292                         NDR_POINTER_UNIQUE, "Char Device", 
293                         hf_srvsvc_chrdev, 0);
294
295         return offset;
296 }
297
298 static int
299 srvsvc_dissect_CHARDEV_INFO_0_array(tvbuff_t *tvb, int offset,
300                                      packet_info *pinfo, proto_tree *tree,
301                                      char *drep)
302 {
303         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
304                         srvsvc_dissect_CHARDEV_INFO_0);
305
306         return offset;
307 }
308
309 /*
310  * IDL typedef struct {
311  * IDL   long EntriesRead;
312  * IDL   [size_is(EntriesRead)] [unique] CHARDEV_INFO_0 *devs;
313  * IDL } CHARDEV_INFO_0_CONTAINER;
314  */
315 static int
316 srvsvc_dissect_CHARDEV_INFO_0_CONTAINER(tvbuff_t *tvb, int offset,
317                                      packet_info *pinfo, proto_tree *tree,
318                                      char *drep)
319 {
320         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
321                 hf_srvsvc_num_entries, NULL);
322
323         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
324                 srvsvc_dissect_CHARDEV_INFO_0_array, NDR_POINTER_UNIQUE,
325                 "CHARDEV_INFO_0 array:", -1);
326
327         return offset;
328 }
329
330 /*
331  * IDL typedef struct {
332  * IDL   [string] [unique] wchar_t *dev;
333  * IDL   long status;
334  * IDL   [string] [unique] wchar_t *user;
335  * IDL   long time;
336  * IDL } CHARDEV_INFO_1;
337  */
338 static int
339 srvsvc_dissect_CHARDEV_INFO_1(tvbuff_t *tvb, int offset,
340                                      packet_info *pinfo, proto_tree *tree,
341                                      char *drep)
342 {
343         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
344                         NDR_POINTER_UNIQUE, "Char Device", 
345                         hf_srvsvc_chrdev, 0);
346
347         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
348                 hf_srvsvc_chrdev_status, 0);
349
350         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
351                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
352
353         /* XXX dont know how to decode this time field */
354         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
355                 hf_srvsvc_chrdev_time, 0);
356
357         return offset;
358 }
359 static int
360 srvsvc_dissect_CHARDEV_INFO_1_array(tvbuff_t *tvb, int offset,
361                                      packet_info *pinfo, proto_tree *tree,
362                                      char *drep)
363 {
364         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
365                         srvsvc_dissect_CHARDEV_INFO_1);
366
367         return offset;
368 }
369
370 /*
371  * IDL typedef struct {
372  * IDL   long EntriesRead;
373  * IDL   [size_is(EntriesRead)] [unique] CHARDEV_INFO_1 *devs;
374  * IDL } CHARDEV_INFO_1_CONTAINER;
375  */
376 static int
377 srvsvc_dissect_CHARDEV_INFO_1_CONTAINER(tvbuff_t *tvb, int offset,
378                                      packet_info *pinfo, proto_tree *tree,
379                                      char *drep)
380 {
381         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
382                 hf_srvsvc_num_entries, NULL);
383
384         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
385                 srvsvc_dissect_CHARDEV_INFO_1_array, NDR_POINTER_UNIQUE,
386                 "CHARDEV_INFO_1 array:", -1);
387
388         return offset;
389 }
390
391 /*
392  * IDL typedef [switch_type(long)] union {
393  * IDL   [case(0)] [unique] CHARDEV_INFO_0_CONTAINER *dev0;
394  * IDL   [case(1)] [unique] CHARDEV_INFO_1_CONTAINER *dev1;
395  * IDL } CHARDEV_ENUM_UNION;
396  */
397 static int
398 srvsvc_dissect_CHARDEV_ENUM_UNION(tvbuff_t *tvb, int offset,
399                                      packet_info *pinfo, proto_tree *tree,
400                                      char *drep)
401 {
402         guint32 level;
403
404         ALIGN_TO_4_BYTES;
405
406         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
407
408         switch(level){
409         case 0:
410                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
411                         srvsvc_dissect_CHARDEV_INFO_0_CONTAINER,
412                         NDR_POINTER_UNIQUE, "CHARDEV_INFO_0_CONTAINER:", -1);
413                 break;
414         case 1:
415                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
416                         srvsvc_dissect_CHARDEV_INFO_1_CONTAINER,
417                         NDR_POINTER_UNIQUE, "CHARDEV_INFO_1_CONTAINER:", -1);
418                 break;
419         }
420
421         return offset;
422 }
423
424 /*
425  * IDL typedef struct {
426  * IDL   long Level;
427  * IDL   CHARDEV_ENUM_UNION devs;
428  * IDL } CHARDEV_ENUM_STRUCT;
429  */
430 static int
431 srvsvc_dissect_CHARDEV_ENUM_STRUCT(tvbuff_t *tvb, int offset,
432                                      packet_info *pinfo, proto_tree *tree,
433                                      char *drep)
434 {
435         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
436                         hf_srvsvc_info_level, 0);
437
438         offset = srvsvc_dissect_CHARDEV_ENUM_UNION(tvb, offset, pinfo, tree, drep);
439
440         return offset;
441 }
442
443 /*
444  * IDL typedef [switch_type(long)] union {
445  * IDL   [case(0)] [unique] CHARDEV_INFO_0 *dev0;
446  * IDL   [case(1)] [unique] CHARDEV_INFO_1 *dev1;
447  * IDL } CHARDEV_INFO_UNION;
448  */
449 static int
450 srvsvc_dissect_CHARDEV_INFO_UNION(tvbuff_t *tvb, int offset,
451                                      packet_info *pinfo, proto_tree *tree,
452                                      char *drep)
453 {
454         guint32 level;
455
456         ALIGN_TO_4_BYTES;
457
458         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
459
460         switch(level){
461         case 0:
462                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
463                         srvsvc_dissect_CHARDEV_INFO_0,
464                         NDR_POINTER_UNIQUE, "CHARDEV_INFO_0:", -1);
465                 break;
466         case 1:
467                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
468                         srvsvc_dissect_CHARDEV_INFO_1,
469                         NDR_POINTER_UNIQUE, "CHARDEV_INFO_1:", -1);
470                 break;
471         }
472
473         return offset;
474 }
475
476 /*
477  * IDL long NetrCharDevEnum(
478  * IDL      [in] [string] [unique] wchar_t *ServerName,
479  * IDL      [in] [out] [ref] CHARDEV_ENUM_STRUCT *devs,
480  * IDL      [in] long PreferredMaximumLength,
481  * IDL      [out] long num_entries,
482  * IDL      [in] [out] [unique] long *ResumeHandle
483  * IDL );
484 */
485 static int
486 srvsvc_dissect_netrchardevenum_rqst(tvbuff_t *tvb, int offset,
487                                      packet_info *pinfo, proto_tree *tree,
488                                      char *drep)
489 {
490         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
491                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
492
493         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
494                 srvsvc_dissect_CHARDEV_ENUM_STRUCT,
495                 NDR_POINTER_REF, "CHARDEV_ENUM_STRUCT", -1);
496
497         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
498                 hf_srvsvc_preferred_len, 0);
499
500         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
501                 srvsvc_dissect_ENUM_HANDLE,
502                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
503
504         return offset;
505 }
506 static int
507 srvsvc_dissect_netrchardevenum_reply(tvbuff_t *tvb, int offset,
508                                      packet_info *pinfo, proto_tree *tree,
509                                      char *drep)
510 {
511         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
512                         srvsvc_dissect_CHARDEV_ENUM_STRUCT,
513                         NDR_POINTER_REF, "CHARDEV_ENUM_STRUCT", -1);
514
515         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
516                         hf_srvsvc_num_entries, NULL);
517
518         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
519                         srvsvc_dissect_ENUM_HANDLE,
520                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
521
522         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
523                         hf_srvsvc_rc, NULL);
524
525         return offset;
526 }
527
528
529 /*
530  * IDL long NetrCharDevGetInfo(
531  * IDL      [in] [string] [unique] wchar_t *ServerName,
532  * IDL      [in] [string] [ref] wchar_t *DevName,
533  * IDL      [in] long Level ,
534  * IDL      [out] [ref] CHARDEV_INFO_STRUCT *dev
535  * IDL );
536 */
537 static int
538 srvsvc_dissect_netrchardevgetinfo_rqst(tvbuff_t *tvb, int offset,
539                                      packet_info *pinfo, proto_tree *tree,
540                                      char *drep)
541 {
542         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
543                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
544
545         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
546                         NDR_POINTER_REF, "Char Device", hf_srvsvc_chrdev, 0);
547
548         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
549                         hf_srvsvc_info_level, 0);
550
551         return offset;
552 }
553 static int
554 srvsvc_dissect_netrchardevgetinfo_reply(tvbuff_t *tvb, int offset,
555                                      packet_info *pinfo, proto_tree *tree,
556                                      char *drep)
557 {
558         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
559                         srvsvc_dissect_CHARDEV_INFO_UNION,
560                         NDR_POINTER_REF, "CHARDEV_INFO_UNION", -1);
561
562         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
563                         hf_srvsvc_rc, NULL);
564
565         return offset;
566 }
567
568 /*
569  * IDL long NetrCharDevControl(
570  * IDL      [in] [string] [unique] wchar_t *ServerName,
571  * IDL      [in] [string] [ref] wchar_t *DevName,
572  * IDL      [in] long Opcode
573  * IDL );
574 */
575 static int
576 srvsvc_dissect_netrchardevcontrol_rqst(tvbuff_t *tvb, int offset,
577                                      packet_info *pinfo, proto_tree *tree,
578                                      char *drep)
579 {
580         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
581                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
582
583         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
584                         NDR_POINTER_REF, "Char Device", hf_srvsvc_chrdev, 0);
585
586         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
587                         hf_srvsvc_chrdev_opcode, 0);
588
589         return offset;
590 }
591 static int
592 srvsvc_dissect_netrchardevcontrol_reply(tvbuff_t *tvb, int offset,
593                                      packet_info *pinfo, proto_tree *tree,
594                                      char *drep)
595 {
596         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
597                         hf_srvsvc_rc, NULL);
598
599         return offset;
600 }
601
602
603
604 /*
605  * IDL typedef struct {
606  * IDL   [string] [unique] wchar_t *dev;
607  * IDL } CHARDEVQ_INFO_0;
608  */
609 static int
610 srvsvc_dissect_CHARDEVQ_INFO_0(tvbuff_t *tvb, int offset,
611                                      packet_info *pinfo, proto_tree *tree,
612                                      char *drep)
613 {
614         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
615                         NDR_POINTER_UNIQUE, "Char QDevice", hf_srvsvc_chrdev, 0);
616
617         return offset;
618 }
619
620 static int
621 srvsvc_dissect_CHARDEVQ_INFO_0_array(tvbuff_t *tvb, int offset,
622                                      packet_info *pinfo, proto_tree *tree,
623                                      char *drep)
624 {
625         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
626                         srvsvc_dissect_CHARDEVQ_INFO_0);
627
628         return offset;
629 }
630
631 /*
632  * IDL typedef struct {
633  * IDL   long EntriesRead;
634  * IDL   [size_is(EntriesRead)] [unique] CHARDEVQ_INFO_0 *devs;
635  * IDL } CHARDEVQ_INFO_0_CONTAINER;
636  */
637 static int
638 srvsvc_dissect_CHARDEVQ_INFO_0_CONTAINER(tvbuff_t *tvb, int offset,
639                                      packet_info *pinfo, proto_tree *tree,
640                                      char *drep)
641 {
642         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
643                 hf_srvsvc_num_entries, NULL);
644
645         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
646                 srvsvc_dissect_CHARDEVQ_INFO_0_array, NDR_POINTER_UNIQUE,
647                 "CHARDEVQ_INFO_0 array:", -1);
648
649         return offset;
650 }
651
652 /*
653  * IDL typedef struct {
654  * IDL   [string] [unique] wchar_t *dev;
655  * IDL   long priority;
656  * IDL   [string] [unique] wchar_t *devs;
657  * IDL   long users;
658  * IDL   long num_ahead;
659  * IDL } CHARDEVQ_INFO_1;
660  */
661 static int
662 srvsvc_dissect_CHARDEVQ_INFO_1(tvbuff_t *tvb, int offset,
663                                      packet_info *pinfo, proto_tree *tree,
664                                      char *drep)
665 {
666         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
667                         NDR_POINTER_UNIQUE, "Char Device", hf_srvsvc_chrdev, 0);
668
669         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
670                 hf_srvsvc_chrqpri, 0);
671
672         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
673                         NDR_POINTER_UNIQUE, "Char Devices", hf_srvsvc_chrdevq, 0);
674
675         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
676                 hf_srvsvc_chrqnumusers, 0);
677
678         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
679                 hf_srvsvc_chrqnumahead, 0);
680
681         return offset;
682 }
683 static int
684 srvsvc_dissect_CHARDEVQ_INFO_1_array(tvbuff_t *tvb, int offset,
685                                      packet_info *pinfo, proto_tree *tree,
686                                      char *drep)
687 {
688         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
689                         srvsvc_dissect_CHARDEVQ_INFO_1);
690
691         return offset;
692 }
693
694 /*
695  * IDL typedef struct {
696  * IDL   long EntriesRead;
697  * IDL   [size_is(EntriesRead)] [unique] CHARDEVQ_INFO_1 *devs;
698  * IDL } CHARDEVQ_INFO_1_CONTAINER;
699  */
700 static int
701 srvsvc_dissect_CHARDEVQ_INFO_1_CONTAINER(tvbuff_t *tvb, int offset,
702                                      packet_info *pinfo, proto_tree *tree,
703                                      char *drep)
704 {
705         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
706                 hf_srvsvc_num_entries, NULL);
707
708         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
709                 srvsvc_dissect_CHARDEVQ_INFO_1_array, NDR_POINTER_UNIQUE,
710                 "CHARDEVQ_INFO_1 array:", -1);
711
712         return offset;
713 }
714
715 /*
716  * IDL typedef [switch_type(long)] union {
717  * IDL   [case(0)] [unique] CHARDEVQ_INFO_0_CONTAINER *dev0;
718  * IDL   [case(1)] [unique] CHARDEVQ_INFO_1_CONTAINER *dev1;
719  * IDL } CHARDEVQ_ENUM_UNION;
720  */
721 static int
722 srvsvc_dissect_CHARDEVQ_ENUM_UNION(tvbuff_t *tvb, int offset,
723                                      packet_info *pinfo, proto_tree *tree,
724                                      char *drep)
725 {
726         guint32 level;
727
728         ALIGN_TO_4_BYTES;
729
730         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
731
732         switch(level){
733         case 0:
734                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
735                         srvsvc_dissect_CHARDEVQ_INFO_0_CONTAINER,
736                         NDR_POINTER_UNIQUE, "CHARDEVQ_INFO_0_CONTAINER:", -1);
737                 break;
738         case 1:
739                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
740                         srvsvc_dissect_CHARDEVQ_INFO_1_CONTAINER,
741                         NDR_POINTER_UNIQUE, "CHARDEVQ_INFO_1_CONTAINER:", -1);
742                 break;
743         }
744
745         return offset;
746 }
747
748 /*
749  * IDL typedef struct {
750  * IDL   long Level;
751  * IDL   CHARDEVQ_ENUM_UNION devs;
752  * IDL } CHARDEVQ_ENUM_STRUCT;
753  */
754 static int
755 srvsvc_dissect_CHARDEVQ_ENUM_STRUCT(tvbuff_t *tvb, int offset,
756                                      packet_info *pinfo, proto_tree *tree,
757                                      char *drep)
758 {
759         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
760                         hf_srvsvc_info_level, 0);
761
762         offset = srvsvc_dissect_CHARDEVQ_ENUM_UNION(tvb, offset, pinfo, tree, drep);
763
764         return offset;
765 }
766
767 /*
768  * IDL typedef [switch_type(long)] union {
769  * IDL   [case(0)] [unique] CHARDEVQ_INFO_0 *dev0;
770  * IDL   [case(1)] [unique] CHARDEVQ_INFO_1 *dev1;
771  * IDL } CHARDEVQ_INFO;
772  */
773 static int
774 srvsvc_dissect_CHARDEVQ_INFO(tvbuff_t *tvb, int offset,
775                                      packet_info *pinfo, proto_tree *tree,
776                                      char *drep)
777 {
778         guint32 level;
779
780         ALIGN_TO_4_BYTES;
781
782         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
783
784         switch(level){
785         case 0:
786                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
787                         srvsvc_dissect_CHARDEVQ_INFO_0,
788                         NDR_POINTER_UNIQUE, "CHARDEVQ_INFO_0:", -1);
789                 break;
790         case 1:
791                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
792                         srvsvc_dissect_CHARDEVQ_INFO_1,
793                         NDR_POINTER_UNIQUE, "CHARDEVQ_INFO_1:", -1);
794                 break;
795         }
796
797         return offset;
798 }
799
800
801 /*
802  * IDL long NetrCharDevQEnum(
803  * IDL      [in] [string] [unique] wchar_t *ServerName,
804  * IDL      [in] [string] [unique] wchar_t *UserName,
805  * IDL      [in] [out] [ref] CHARDEVQ_ENUM_STRUCT *devs,
806  * IDL      [in] long PreferredMaximumLength,
807  * IDL      [out] long num_entries,
808  * IDL      [in] [out] [unique] long *ResumeHandle
809  * IDL );
810 */
811 static int
812 srvsvc_dissect_netrchardevqenum_rqst(tvbuff_t *tvb, int offset,
813                                      packet_info *pinfo, proto_tree *tree,
814                                      char *drep)
815 {
816         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
817                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
818
819         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
820                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
821
822         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
823                 srvsvc_dissect_CHARDEVQ_ENUM_STRUCT,
824                 NDR_POINTER_REF, "CHARDEVQ_ENUM_STRUCT", -1);
825
826         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
827                 hf_srvsvc_preferred_len, 0);
828
829         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
830                 srvsvc_dissect_ENUM_HANDLE,
831                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
832
833         return offset;
834 }
835 static int
836 srvsvc_dissect_netrchardevqenum_reply(tvbuff_t *tvb, int offset,
837                                      packet_info *pinfo, proto_tree *tree,
838                                      char *drep)
839 {
840         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
841                         srvsvc_dissect_CHARDEVQ_ENUM_STRUCT,
842                         NDR_POINTER_REF, "CHARDEVQ_ENUM_STRUCT", -1);
843
844         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
845                         hf_srvsvc_num_entries, NULL);
846
847         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
848                         srvsvc_dissect_ENUM_HANDLE,
849                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
850
851         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
852                         hf_srvsvc_rc, NULL);
853
854         return offset;
855 }
856
857 /*
858  * IDL long NetrCharDevQGetInfo(
859  * IDL      [in] [string] [unique] wchar_t *ServerName,
860  * IDL      [in] [string] [ref] wchar_t *QueueName,
861  * IDL      [in] [string] [ref] wchar_t *UserName,
862  * IDL      [in] long Level,
863  * IDL      [out] [ref] CHARDEVQ_INFO *devq
864  * IDL );
865 */
866 static int
867 srvsvc_dissect_netrchardevqgetinfo_rqst(tvbuff_t *tvb, int offset,
868                                      packet_info *pinfo, proto_tree *tree,
869                                      char *drep)
870 {
871         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
872                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
873
874         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
875                         NDR_POINTER_REF, "Device Queue", hf_srvsvc_chrdevq, 0);
876
877         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
878                         NDR_POINTER_REF, "User", hf_srvsvc_user, 0);
879
880         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
881                 hf_srvsvc_info_level, NULL);
882
883         return offset;
884 }
885 static int
886 srvsvc_dissect_netrchardevqgetinfo_reply(tvbuff_t *tvb, int offset,
887                                      packet_info *pinfo, proto_tree *tree,
888                                      char *drep)
889 {
890         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
891                         srvsvc_dissect_CHARDEVQ_INFO,
892                         NDR_POINTER_REF, "CHARDEVQ_INFO:", -1);
893
894         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
895                         hf_srvsvc_rc, NULL);
896
897         return offset;
898 }
899
900 /*
901  * IDL long NetrCharDevQSetInfo(
902  * IDL      [in] [string] [unique] wchar_t *ServerName,
903  * IDL      [in] [string] [ref] wchar_t *QueueName,
904  * IDL      [in] long Level,
905  * IDL      [in] [ref] CHARDEVQ_INFO *dev,
906  * IDL      [in] [out] [unique] long *ParmError
907  * IDL );
908 */
909 static int
910 srvsvc_dissect_netrchardevqsetinfo_rqst(tvbuff_t *tvb, int offset,
911                                      packet_info *pinfo, proto_tree *tree,
912                                      char *drep)
913 {
914         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
915                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
916
917         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
918                         NDR_POINTER_REF, "Device Queue", hf_srvsvc_chrdevq, 0);
919
920         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
921                 hf_srvsvc_info_level, NULL);
922
923         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
924                 srvsvc_dissect_CHARDEVQ_INFO,
925                 NDR_POINTER_REF, "CHARDEVQ_INFO", -1);
926
927         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
928                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
929                         "Parameter Error:", hf_srvsvc_parm_error);
930
931         return offset;
932 }
933 static int
934 srvsvc_dissect_netrchardevqsetinfo_reply(tvbuff_t *tvb, int offset,
935                                      packet_info *pinfo, proto_tree *tree,
936                                      char *drep)
937 {
938         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
939                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
940                         "Parameter Error:", hf_srvsvc_parm_error);
941
942         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
943                         hf_srvsvc_rc, NULL);
944
945         return offset;
946 }
947
948 /*
949  * IDL long NetrCharDevQPurge(
950  * IDL      [in] [string] [unique] wchar_t *ServerName,
951  * IDL      [in] [string] [ref] wchar_t *QueueName
952  * IDL );
953 */
954 static int
955 srvsvc_dissect_netrchardevqpurge_rqst(tvbuff_t *tvb, int offset,
956                                      packet_info *pinfo, proto_tree *tree,
957                                      char *drep)
958 {
959         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
960                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
961
962         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
963                         NDR_POINTER_REF, "Device Queue", hf_srvsvc_chrdevq, 0);
964
965         return offset;
966 }
967 static int
968 srvsvc_dissect_netrchardevqpurge_reply(tvbuff_t *tvb, int offset,
969                                      packet_info *pinfo, proto_tree *tree,
970                                      char *drep)
971 {
972         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
973                         hf_srvsvc_rc, NULL);
974
975         return offset;
976 }
977
978 /*
979  * IDL long NetrCharDevQPurge(
980  * IDL      [in] [string] [unique] wchar_t *ServerName,
981  * IDL      [in] [string] [ref] wchar_t *QueueName
982  * IDL      [in] [string] [ref] wchar_t *ComputerName
983  * IDL );
984 */
985 static int
986 srvsvc_dissect_netrchardevqpurgeself_rqst(tvbuff_t *tvb, int offset,
987                                      packet_info *pinfo, proto_tree *tree,
988                                      char *drep)
989 {
990         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
991                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
992
993         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
994                         NDR_POINTER_REF, "Device Queue", hf_srvsvc_chrdevq, 0);
995
996         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
997                         NDR_POINTER_REF, "Computer", hf_srvsvc_computer, 0);
998
999         return offset;
1000 }
1001 static int
1002 srvsvc_dissect_netrchardevqpurgeself_reply(tvbuff_t *tvb, int offset,
1003                                      packet_info *pinfo, proto_tree *tree,
1004                                      char *drep)
1005 {
1006         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
1007                         hf_srvsvc_rc, NULL);
1008
1009         return offset;
1010 }
1011
1012
1013
1014 /*
1015  * IDL typedef struct {
1016  * IDL   long con_id;
1017  * IDL } CONNECT_INFO_0;
1018  */
1019 static int
1020 srvsvc_dissect_CONNECT_INFO_0(tvbuff_t *tvb, int offset,
1021                                      packet_info *pinfo, proto_tree *tree,
1022                                      char *drep)
1023 {
1024         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1025                                      hf_srvsvc_con_id, NULL);
1026
1027         return offset;
1028 }
1029 static int
1030 srvsvc_dissect_CONNECT_INFO_0_array(tvbuff_t *tvb, int offset,
1031                                      packet_info *pinfo, proto_tree *tree,
1032                                      char *drep)
1033 {
1034         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1035                         srvsvc_dissect_CONNECT_INFO_0);
1036
1037         return offset;
1038 }
1039
1040 /*
1041  * IDL typedef struct {
1042  * IDL   long EntriesRead;
1043  * IDL   [size_is(EntriesRead)] [unique] CONNECT_INFO_0 *cons;
1044  * IDL } CONNECT_INFO_0_CONTAINER;
1045  */
1046 static int
1047 srvsvc_dissect_CONNECT_INFO_0_CONTAINER(tvbuff_t *tvb, int offset,
1048                                      packet_info *pinfo, proto_tree *tree,
1049                                      char *drep)
1050 {
1051         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1052                 hf_srvsvc_num_entries, NULL);
1053
1054         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1055                 srvsvc_dissect_CONNECT_INFO_0_array, NDR_POINTER_UNIQUE,
1056                 "CONNECT_INFO_0 array:", -1);
1057
1058         return offset;
1059 }
1060
1061
1062 /*
1063  * IDL typedef struct {
1064  * IDL   long conid;
1065  * IDL   long type;
1066  * IDL   long num_opens;
1067  * IDL   long users;
1068  * IDL   long time;
1069  * IDL   [string] [unique] wchar_t *username;
1070  * IDL   [string] [unique] wchar_t *share;
1071  * IDL } CONNECT_INFO_1;
1072  */
1073 static int
1074 srvsvc_dissect_CONNECT_INFO_1(tvbuff_t *tvb, int offset,
1075                                      packet_info *pinfo, proto_tree *tree,
1076                                      char *drep)
1077 {
1078         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1079                                      hf_srvsvc_con_id, NULL);
1080
1081         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1082                                      hf_srvsvc_con_type, NULL);
1083
1084         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1085                                      hf_srvsvc_con_num_opens, NULL);
1086
1087         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1088                                      hf_srvsvc_users, NULL);
1089
1090         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1091                                      hf_srvsvc_con_time, NULL);
1092
1093         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1094                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1095
1096         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1097                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
1098
1099         return offset;
1100 }
1101 static int
1102 srvsvc_dissect_CONNECT_INFO_1_array(tvbuff_t *tvb, int offset,
1103                                      packet_info *pinfo, proto_tree *tree,
1104                                      char *drep)
1105 {
1106         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1107                         srvsvc_dissect_CONNECT_INFO_1);
1108
1109         return offset;
1110 }
1111
1112 /*
1113  * IDL typedef struct {
1114  * IDL   long EntriesRead;
1115  * IDL   [size_is(EntriesRead)] [unique] CONNECT_INFO_0 *cons;
1116  * IDL } CONNECT_INFO_1_CONTAINER;
1117  */
1118 static int
1119 srvsvc_dissect_CONNECT_INFO_1_CONTAINER(tvbuff_t *tvb, int offset,
1120                                      packet_info *pinfo, proto_tree *tree,
1121                                      char *drep)
1122 {
1123         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1124                 hf_srvsvc_num_entries, NULL);
1125
1126         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1127                 srvsvc_dissect_CONNECT_INFO_1_array, NDR_POINTER_UNIQUE,
1128                 "CONNECT_INFO_1 array:", -1);
1129
1130         return offset;
1131 }
1132
1133
1134 /*
1135  * IDL typedef [switch_type(long)] union {
1136  * IDL   [case(0)] [unique] CONNECT_INFO_0_CONTAINER *con0;
1137  * IDL   [case(1)] [unique] CONNECT_INFO_1_CONTAINER *con1;
1138  * IDL } CONNECT_ENUM_UNION;
1139  */
1140 static int
1141 srvsvc_dissect_CONNECT_ENUM_UNION(tvbuff_t *tvb, int offset,
1142                                      packet_info *pinfo, proto_tree *tree,
1143                                      char *drep)
1144 {
1145         guint32 level;
1146
1147         ALIGN_TO_4_BYTES;
1148
1149         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
1150
1151         switch(level){
1152         case 0:
1153                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1154                         srvsvc_dissect_CONNECT_INFO_0_CONTAINER,
1155                         NDR_POINTER_UNIQUE, "CONNECT_INFO_0_CONTAINER:", -1);
1156                 break;
1157         case 1:
1158                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1159                         srvsvc_dissect_CONNECT_INFO_1_CONTAINER,
1160                         NDR_POINTER_UNIQUE, "CONNECT_INFO_1_CONTAINER:", -1);
1161                 break;
1162         }
1163
1164         return offset;
1165 }
1166
1167
1168 /*
1169  * IDL typedef struct {
1170  * IDL   long Level;
1171  * IDL   CONNECT_ENUM_UNION devs;
1172  * IDL } CONNECT_ENUM_STRUCT;
1173  */
1174 static int
1175 srvsvc_dissect_CONNECT_ENUM_STRUCT(tvbuff_t *tvb, int offset,
1176                                      packet_info *pinfo, proto_tree *tree,
1177                                      char *drep)
1178 {
1179         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1180                         hf_srvsvc_info_level, 0);
1181
1182         offset = srvsvc_dissect_CONNECT_ENUM_UNION(tvb, offset, pinfo, tree, drep);
1183
1184         return offset;
1185 }
1186
1187
1188 /*
1189  * IDL long NetrConnectionEnum(
1190  * IDL      [in] [string] [unique] wchar_t *ServerName,
1191  * IDL      [in] [string] [unique] wchar_t *Qualifier,
1192  * IDL      [in] [out] [ref] CONNECT_ENUM_STRUCT *con,
1193  * IDL      [in] long MaxLen,
1194  * IDL      [in] long num_connections,
1195  * IDL      [in] [out] [unique] long *ResumeHandle
1196  * IDL );
1197 */
1198 static int
1199 srvsvc_dissect_netrconnectionenum_rqst(tvbuff_t *tvb, int offset,
1200                                      packet_info *pinfo, proto_tree *tree,
1201                                      char *drep)
1202 {
1203         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1204                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
1205
1206         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1207                         NDR_POINTER_UNIQUE, "Qualifier", hf_srvsvc_qualifier, 0);
1208
1209         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1210                 srvsvc_dissect_CONNECT_ENUM_STRUCT,
1211                 NDR_POINTER_REF, "CONNECT_ENUM_STRUCT:", -1);
1212
1213         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1214                 hf_srvsvc_preferred_len, 0);
1215
1216         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1217                 srvsvc_dissect_ENUM_HANDLE,
1218                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
1219
1220         return offset;
1221 }
1222 static int
1223 srvsvc_dissect_netrconnectionenum_reply(tvbuff_t *tvb, int offset,
1224                                      packet_info *pinfo, proto_tree *tree,
1225                                      char *drep)
1226 {
1227         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1228                         srvsvc_dissect_CONNECT_ENUM_STRUCT,
1229                         NDR_POINTER_REF, "CONNECT_ENUM_STRUCT:", -1);
1230
1231         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1232                         hf_srvsvc_num_entries, NULL);
1233
1234         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1235                         srvsvc_dissect_ENUM_HANDLE,
1236                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
1237
1238         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
1239                         hf_srvsvc_rc, NULL);
1240
1241         return offset;
1242 }
1243
1244 /*
1245  * IDL typedef struct {
1246  * IDL   long fileid;
1247  * IDL } FILE_INFO_2;
1248  */
1249 static int
1250 srvsvc_dissect_FILE_INFO_2(tvbuff_t *tvb, int offset,
1251                                      packet_info *pinfo, proto_tree *tree,
1252                                      char *drep)
1253 {
1254         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1255                                      hf_srvsvc_file_id, NULL);
1256
1257         return offset;
1258 }
1259 static int
1260 srvsvc_dissect_FILE_INFO_2_array(tvbuff_t *tvb, int offset,
1261                                      packet_info *pinfo, proto_tree *tree,
1262                                      char *drep)
1263 {
1264         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1265                         srvsvc_dissect_FILE_INFO_2);
1266
1267         return offset;
1268 }
1269
1270 /*
1271  * IDL typedef struct {
1272  * IDL   long EntriesRead;
1273  * IDL   [size_is(EntriesRead)] [unique] FILE_INFO_2 *files;
1274  * IDL } FILE_INFO_2_CONTAINER;
1275  */
1276 static int
1277 srvsvc_dissect_FILE_INFO_2_CONTAINER(tvbuff_t *tvb, int offset,
1278                                      packet_info *pinfo, proto_tree *tree,
1279                                      char *drep)
1280 {
1281         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1282                 hf_srvsvc_num_entries, NULL);
1283
1284         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1285                 srvsvc_dissect_FILE_INFO_2_array, NDR_POINTER_UNIQUE,
1286                 "FILE_INFO_2 array:", -1);
1287
1288         return offset;
1289 }
1290
1291
1292 /*
1293  * IDL typedef struct {
1294  * IDL   long file_id;
1295  * IDL   long permissions;
1296  * IDL   long num_locks;
1297  * IDL   [string] [unique] wchar_t *pathname;
1298  * IDL   [string] [unique] wchar_t *username;
1299  * IDL } FILE_INFO_3;
1300  */
1301 static int
1302 srvsvc_dissect_FILE_INFO_3(tvbuff_t *tvb, int offset,
1303                                      packet_info *pinfo, proto_tree *tree,
1304                                      char *drep)
1305 {
1306         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1307                                      hf_srvsvc_file_id, NULL);
1308
1309         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1310                                      hf_srvsvc_perm, NULL);
1311
1312         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1313                                      hf_srvsvc_file_num_locks, NULL);
1314
1315         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1316                         NDR_POINTER_UNIQUE, "Path", hf_srvsvc_path, 0);
1317
1318         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1319                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1320
1321         return offset;
1322 }
1323 static int
1324 srvsvc_dissect_FILE_INFO_3_array(tvbuff_t *tvb, int offset,
1325                                      packet_info *pinfo, proto_tree *tree,
1326                                      char *drep)
1327 {
1328         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1329                         srvsvc_dissect_FILE_INFO_3);
1330
1331         return offset;
1332 }
1333
1334 /*
1335  * IDL typedef struct {
1336  * IDL   long EntriesRead;
1337  * IDL   [size_is(EntriesRead)] [unique] FILE_INFO_3 *files;
1338  * IDL } FILE_INFO_3_CONTAINER;
1339  */
1340 static int
1341 srvsvc_dissect_FILE_INFO_3_CONTAINER(tvbuff_t *tvb, int offset,
1342                                      packet_info *pinfo, proto_tree *tree,
1343                                      char *drep)
1344 {
1345         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1346                 hf_srvsvc_num_entries, NULL);
1347
1348         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1349                 srvsvc_dissect_FILE_INFO_3_array, NDR_POINTER_UNIQUE,
1350                 "CHARDEV_INFO_3 array:", -1);
1351
1352         return offset;
1353 }
1354
1355
1356 /*
1357  * IDL typedef [switch_type(long)] union {
1358  * IDL   [case(2)] [unique] FILE_INFO_2_CONTAINER *file0;
1359  * IDL   [case(3)] [unique] FILE_INFO_3_CONTAINER *file1;
1360  * IDL } FILE_ENUM_UNION;
1361  */
1362 static int
1363 srvsvc_dissect_FILE_ENUM_UNION(tvbuff_t *tvb, int offset,
1364                                      packet_info *pinfo, proto_tree *tree,
1365                                      char *drep)
1366 {
1367         guint32 level;
1368
1369         ALIGN_TO_4_BYTES;
1370
1371         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
1372
1373         switch(level){
1374         case 2:
1375                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1376                         srvsvc_dissect_FILE_INFO_2_CONTAINER,
1377                         NDR_POINTER_UNIQUE, "FILE_INFO_2_CONTAINER:", -1);
1378                 break;
1379         case 3:
1380                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1381                         srvsvc_dissect_FILE_INFO_3_CONTAINER,
1382                         NDR_POINTER_UNIQUE, "FILE_INFO_3_CONTAINER:", -1);
1383                 break;
1384         }
1385
1386         return offset;
1387 }
1388
1389 /*
1390  * IDL typedef [switch_type(long)] union {
1391  * IDL   [case(2)] [unique] FILE_INFO_2 *file0;
1392  * IDL   [case(3)] [unique] FILE_INFO_3 *file1;
1393  * IDL } FILE_INFO_UNION;
1394  */
1395 static int
1396 srvsvc_dissect_FILE_INFO_UNION(tvbuff_t *tvb, int offset,
1397                                      packet_info *pinfo, proto_tree *tree,
1398                                      char *drep)
1399 {
1400         guint32 level;
1401
1402         ALIGN_TO_4_BYTES;
1403
1404         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
1405
1406         switch(level){
1407         case 2:
1408                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1409                         srvsvc_dissect_FILE_INFO_2,
1410                         NDR_POINTER_UNIQUE, "FILE_INFO_2:", -1);
1411                 break;
1412         case 3:
1413                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1414                         srvsvc_dissect_FILE_INFO_3,
1415                         NDR_POINTER_UNIQUE, "FILE_INFO_3:", -1);
1416                 break;
1417         }
1418
1419         return offset;
1420 }
1421
1422
1423 /*
1424  * IDL typedef struct {
1425  * IDL   long Level;
1426  * IDL   FILE_ENUM_UNION files;
1427  * IDL } FILE_ENUM_STRUCT;
1428  */
1429 static int
1430 srvsvc_dissect_FILE_ENUM_STRUCT(tvbuff_t *tvb, int offset,
1431                                      packet_info *pinfo, proto_tree *tree,
1432                                      char *drep)
1433 {
1434         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1435                         hf_srvsvc_info_level, 0);
1436
1437         offset = srvsvc_dissect_FILE_ENUM_UNION(tvb, offset, pinfo, tree, drep);
1438
1439         return offset;
1440 }
1441
1442
1443 /*
1444  * IDL long NetrFileEnum(
1445  * IDL      [in] [string] [unique] wchar_t *ServerName,
1446  * IDL      [in] [string] [unique] wchar_t *Path,
1447  * IDL      [in] [string] [unique] wchar_t *UserName,
1448  * IDL      [in] [out] [ref] FILE_ENUM_STRUCT *file,
1449  * IDL      [in] long MaxLen,
1450  * IDL      [out] long num_entries,
1451  * IDL      [in] [out] [unique] long *ResumeHandle
1452  * IDL );
1453 */
1454 static int
1455 srvsvc_dissect_netrfileenum_rqst(tvbuff_t *tvb, int offset,
1456                                      packet_info *pinfo, proto_tree *tree,
1457                                      char *drep)
1458 {
1459         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1460                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
1461
1462         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1463                         NDR_POINTER_UNIQUE, "Path", hf_srvsvc_path, 0);
1464
1465         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1466                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1467
1468         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1469                 srvsvc_dissect_FILE_ENUM_STRUCT,
1470                 NDR_POINTER_REF, "FILE_ENUM_STRUCT:", -1);
1471
1472         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1473                 hf_srvsvc_preferred_len, 0);
1474
1475         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1476                 srvsvc_dissect_ENUM_HANDLE,
1477                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
1478
1479         return offset;
1480 }
1481 static int
1482 srvsvc_dissect_netrfileenum_reply(tvbuff_t *tvb, int offset,
1483                                      packet_info *pinfo, proto_tree *tree,
1484                                      char *drep)
1485 {
1486         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1487                         srvsvc_dissect_FILE_ENUM_STRUCT,
1488                         NDR_POINTER_REF, "FILE_ENUM_STRUCT:", -1);
1489
1490         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1491                         hf_srvsvc_num_entries, NULL);
1492
1493         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1494                         srvsvc_dissect_ENUM_HANDLE,
1495                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
1496
1497         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
1498                         hf_srvsvc_rc, NULL);
1499
1500         return offset;
1501 }
1502
1503
1504 /*
1505  * IDL long NetrFileGetInfo(
1506  * IDL      [in] [string] [unique] wchar_t *ServerName,
1507  * IDL      [in] long fileid,
1508  * IDL      [in] long level,
1509  * IDL      [out] [ref] FILE_INFO_UNION *file
1510  * IDL );
1511 */
1512 static int
1513 srvsvc_dissect_netrfilegetinfo_rqst(tvbuff_t *tvb, int offset,
1514                                      packet_info *pinfo, proto_tree *tree,
1515                                      char *drep)
1516 {
1517         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1518                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
1519
1520         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1521                                      hf_srvsvc_file_id, NULL);
1522
1523         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1524                         hf_srvsvc_info_level, 0);
1525
1526         return offset;
1527 }
1528 static int
1529 srvsvc_dissect_netrfilegetinfo_reply(tvbuff_t *tvb, int offset,
1530                                      packet_info *pinfo, proto_tree *tree,
1531                                      char *drep)
1532 {
1533         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1534                         srvsvc_dissect_FILE_INFO_UNION,
1535                         NDR_POINTER_REF, "FILE_INFO_UNION:", -1);
1536
1537         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
1538                         hf_srvsvc_rc, NULL);
1539
1540         return offset;
1541 }
1542
1543
1544 /*
1545  * IDL long NetrFileClose(
1546  * IDL      [in] [string] [unique] wchar_t *ServerName,
1547  * IDL      [in] long fileid,
1548  * IDL );
1549 */
1550 static int
1551 srvsvc_dissect_netrfileclose_rqst(tvbuff_t *tvb, int offset,
1552                                      packet_info *pinfo, proto_tree *tree,
1553                                      char *drep)
1554 {
1555         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1556                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
1557
1558         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1559                                      hf_srvsvc_file_id, NULL);
1560
1561         return offset;
1562 }
1563 static int
1564 srvsvc_dissect_netrfileclose_reply(tvbuff_t *tvb, int offset,
1565                                      packet_info *pinfo, proto_tree *tree,
1566                                      char *drep)
1567 {
1568         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
1569                         hf_srvsvc_rc, NULL);
1570
1571         return offset;
1572 }
1573
1574 /*
1575  * IDL typedef struct {
1576  * IDL   [string] [unique] wchar_t *ses;
1577  * IDL } SESSION_INFO_0;
1578  */
1579 static int
1580 srvsvc_dissect_SESSION_INFO_0(tvbuff_t *tvb, int offset,
1581                                      packet_info *pinfo, proto_tree *tree,
1582                                      char *drep)
1583 {
1584         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1585                         NDR_POINTER_UNIQUE, "Session", hf_srvsvc_session, 0);
1586
1587         return offset;
1588 }
1589 static int
1590 srvsvc_dissect_SESSION_INFO_0_array(tvbuff_t *tvb, int offset,
1591                                      packet_info *pinfo, proto_tree *tree,
1592                                      char *drep)
1593 {
1594         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1595                         srvsvc_dissect_SESSION_INFO_0);
1596
1597         return offset;
1598 }
1599
1600 /*
1601  * IDL typedef struct {
1602  * IDL   long EntriesRead;
1603  * IDL   [size_is(EntriesRead)] [unique] SESSION_INFO_0 *ses;
1604  * IDL } SESSION_INFO_0_CONTAINER;
1605  */
1606 static int
1607 srvsvc_dissect_SESSION_INFO_0_CONTAINER(tvbuff_t *tvb, int offset,
1608                                      packet_info *pinfo, proto_tree *tree,
1609                                      char *drep)
1610 {
1611         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1612                 hf_srvsvc_num_entries, NULL);
1613
1614         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1615                 srvsvc_dissect_SESSION_INFO_0_array, NDR_POINTER_UNIQUE,
1616                 "SESSION_INFO_0 array:", -1);
1617
1618         return offset;
1619 }
1620
1621 /*
1622  * IDL typedef struct {
1623  * IDL   [string] [unique] wchar_t *ses;
1624  * IDL   [string] [unique] wchar_t *user;
1625  * IDL   long num_open;
1626  * IDL   long time;
1627  * IDL   long idle_time;
1628  * IDL   long user_flags
1629  * IDL } SESSION_INFO_1;
1630  */
1631 static int
1632 srvsvc_dissect_SESSION_INFO_1(tvbuff_t *tvb, int offset,
1633                                      packet_info *pinfo, proto_tree *tree,
1634                                      char *drep)
1635 {
1636         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1637                         NDR_POINTER_UNIQUE, "Session", hf_srvsvc_session, 0);
1638
1639         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1640                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1641
1642         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1643                                      hf_srvsvc_session_num_opens, NULL);
1644
1645         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1646                                      hf_srvsvc_session_time, NULL);
1647
1648         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1649                                      hf_srvsvc_session_idle_time, NULL);
1650
1651         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1652                                      hf_srvsvc_session_user_flags, NULL);
1653
1654         return offset;
1655 }
1656 static int
1657 srvsvc_dissect_SESSION_INFO_1_array(tvbuff_t *tvb, int offset,
1658                                      packet_info *pinfo, proto_tree *tree,
1659                                      char *drep)
1660 {
1661         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1662                         srvsvc_dissect_SESSION_INFO_1);
1663
1664         return offset;
1665 }
1666
1667 /*
1668  * IDL typedef struct {
1669  * IDL   long EntriesRead;
1670  * IDL   [size_is(EntriesRead)] [unique] SESSION_INFO_1 *ses;
1671  * IDL } SESSION_INFO_1_CONTAINER;
1672  */
1673 static int
1674 srvsvc_dissect_SESSION_INFO_1_CONTAINER(tvbuff_t *tvb, int offset,
1675                                      packet_info *pinfo, proto_tree *tree,
1676                                      char *drep)
1677 {
1678         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1679                 hf_srvsvc_num_entries, NULL);
1680
1681         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1682                 srvsvc_dissect_SESSION_INFO_1_array, NDR_POINTER_UNIQUE,
1683                 "SESSION_INFO_1 array:", -1);
1684
1685         return offset;
1686 }
1687
1688 /*
1689  * IDL typedef struct {
1690  * IDL   [string] [unique] wchar_t *ses;
1691  * IDL   [string] [unique] wchar_t *user;
1692  * IDL   long num_open;
1693  * IDL   long time;
1694  * IDL   long idle_time;
1695  * IDL   long user_flags
1696  * IDL   [string] [unique] wchar_t *clienttype;
1697  * IDL } SESSION_INFO_2;
1698  */
1699 static int
1700 srvsvc_dissect_SESSION_INFO_2(tvbuff_t *tvb, int offset,
1701                                      packet_info *pinfo, proto_tree *tree,
1702                                      char *drep)
1703 {
1704         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1705                         NDR_POINTER_UNIQUE, "Session", hf_srvsvc_session, 0);
1706
1707         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1708                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1709
1710         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1711                                      hf_srvsvc_session_num_opens, NULL);
1712
1713         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1714                                      hf_srvsvc_session_time, NULL);
1715
1716         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1717                                      hf_srvsvc_session_idle_time, NULL);
1718
1719         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1720                                      hf_srvsvc_session_user_flags, NULL);
1721
1722         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1723                         NDR_POINTER_UNIQUE, "Client Type", 
1724                         hf_srvsvc_client_type, 0);
1725
1726         return offset;
1727 }
1728 static int
1729 srvsvc_dissect_SESSION_INFO_2_array(tvbuff_t *tvb, int offset,
1730                                      packet_info *pinfo, proto_tree *tree,
1731                                      char *drep)
1732 {
1733         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1734                         srvsvc_dissect_SESSION_INFO_2);
1735
1736         return offset;
1737 }
1738
1739 /*
1740  * IDL typedef struct {
1741  * IDL   long EntriesRead;
1742  * IDL   [size_is(EntriesRead)] [unique] SESSION_INFO_2 *ses;
1743  * IDL } SESSION_INFO_2_CONTAINER;
1744  */
1745 static int
1746 srvsvc_dissect_SESSION_INFO_2_CONTAINER(tvbuff_t *tvb, int offset,
1747                                      packet_info *pinfo, proto_tree *tree,
1748                                      char *drep)
1749 {
1750         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1751                 hf_srvsvc_num_entries, NULL);
1752
1753         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1754                 srvsvc_dissect_SESSION_INFO_2_array, NDR_POINTER_UNIQUE,
1755                 "SESSION_INFO_2 array:", -1);
1756
1757         return offset;
1758 }
1759
1760 /*
1761  * IDL typedef struct {
1762  * IDL   [string] [unique] wchar_t *ses;
1763  * IDL   [string] [unique] wchar_t *user;
1764  * IDL   long time;
1765  * IDL   long idle_time;
1766  * IDL } SESSION_INFO_10;
1767  */
1768 static int
1769 srvsvc_dissect_SESSION_INFO_10(tvbuff_t *tvb, int offset,
1770                                      packet_info *pinfo, proto_tree *tree,
1771                                      char *drep)
1772 {
1773         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1774                         NDR_POINTER_UNIQUE, "Session", hf_srvsvc_session, 0);
1775
1776         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1777                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1778
1779         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1780                                      hf_srvsvc_session_time, NULL);
1781
1782         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1783                                      hf_srvsvc_session_idle_time, NULL);
1784
1785         return offset;
1786 }
1787 static int
1788 srvsvc_dissect_SESSION_INFO_10_array(tvbuff_t *tvb, int offset,
1789                                      packet_info *pinfo, proto_tree *tree,
1790                                      char *drep)
1791 {
1792         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1793                         srvsvc_dissect_SESSION_INFO_10);
1794
1795         return offset;
1796 }
1797
1798 /*
1799  * IDL typedef struct {
1800  * IDL   long EntriesRead;
1801  * IDL   [size_is(EntriesRead)] [unique] SESSION_INFO_10 *ses;
1802  * IDL } SESSION_INFO_10_CONTAINER;
1803  */
1804 static int
1805 srvsvc_dissect_SESSION_INFO_10_CONTAINER(tvbuff_t *tvb, int offset,
1806                                      packet_info *pinfo, proto_tree *tree,
1807                                      char *drep)
1808 {
1809         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1810                 hf_srvsvc_num_entries, NULL);
1811
1812         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1813                 srvsvc_dissect_SESSION_INFO_10_array, NDR_POINTER_UNIQUE,
1814                 "SESSION_INFO_10 array:", -1);
1815
1816         return offset;
1817 }
1818
1819 /*
1820  * IDL typedef struct {
1821  * IDL   [string] [unique] wchar_t *ses;
1822  * IDL   [string] [unique] wchar_t *user;
1823  * IDL   long num_open;
1824  * IDL   long time;
1825  * IDL   long idle_time;
1826  * IDL   long user_flags
1827  * IDL   [string] [unique] wchar_t *clienttype;
1828  * IDL   [string] [unique] wchar_t *transport;
1829  * IDL } SESSION_INFO_502;
1830  */
1831 static int
1832 srvsvc_dissect_SESSION_INFO_502(tvbuff_t *tvb, int offset,
1833                                      packet_info *pinfo, proto_tree *tree,
1834                                      char *drep)
1835 {
1836         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1837                         NDR_POINTER_UNIQUE, "Session", hf_srvsvc_session, 0);
1838
1839         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1840                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1841
1842         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1843                                      hf_srvsvc_session_num_opens, NULL);
1844
1845         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1846                                      hf_srvsvc_session_time, NULL);
1847
1848         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1849                                      hf_srvsvc_session_idle_time, NULL);
1850
1851         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
1852                                      hf_srvsvc_session_user_flags, NULL);
1853
1854         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1855                         NDR_POINTER_UNIQUE, "Client Type", 
1856                         hf_srvsvc_client_type, 0);
1857
1858         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1859                         NDR_POINTER_UNIQUE, "Transport", hf_srvsvc_transport, 0);
1860
1861         return offset;
1862 }
1863 static int
1864 srvsvc_dissect_SESSION_INFO_502_array(tvbuff_t *tvb, int offset,
1865                                      packet_info *pinfo, proto_tree *tree,
1866                                      char *drep)
1867 {
1868         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
1869                         srvsvc_dissect_SESSION_INFO_502);
1870
1871         return offset;
1872 }
1873
1874 /*
1875  * IDL typedef struct {
1876  * IDL   long EntriesRead;
1877  * IDL   [size_is(EntriesRead)] [unique] SESSION_INFO_502 *ses;
1878  * IDL } SESSION_INFO_502_CONTAINER;
1879  */
1880 static int
1881 srvsvc_dissect_SESSION_INFO_502_CONTAINER(tvbuff_t *tvb, int offset,
1882                                      packet_info *pinfo, proto_tree *tree,
1883                                      char *drep)
1884 {
1885         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1886                 hf_srvsvc_num_entries, NULL);
1887
1888         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1889                 srvsvc_dissect_SESSION_INFO_502_array, NDR_POINTER_UNIQUE,
1890                 "SESSION_INFO_502 array:", -1);
1891
1892         return offset;
1893 }
1894
1895 /*
1896  * IDL typedef [switch_type(long)] union {
1897  * IDL   [case(0)] [unique] SESSION_INFO_0_CONTAINER *ses0;
1898  * IDL   [case(1)] [unique] SESSION_INFO_1_CONTAINER *ses1;
1899  * IDL   [case(2)] [unique] SESSION_INFO_2_CONTAINER *ses2;
1900  * IDL   [case(10)] [unique] SESSION_INFO_10_CONTAINER *ses10;
1901  * IDL   [case(502)] [unique] SESSION_INFO_502_CONTAINER *ses502;
1902  * IDL } SESSION_ENUM_UNION;
1903  */
1904 static int
1905 srvsvc_dissect_SESSION_ENUM_UNION(tvbuff_t *tvb, int offset,
1906                                      packet_info *pinfo, proto_tree *tree,
1907                                      char *drep)
1908 {
1909         guint32 level;
1910
1911         ALIGN_TO_4_BYTES;
1912
1913         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
1914
1915         switch(level){
1916         case 0:
1917                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1918                         srvsvc_dissect_SESSION_INFO_0_CONTAINER,
1919                         NDR_POINTER_UNIQUE, "SESSION_INFO_0_CONTAINER:", -1);
1920                 break;
1921         case 1:
1922                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1923                         srvsvc_dissect_SESSION_INFO_1_CONTAINER,
1924                         NDR_POINTER_UNIQUE, "SESSION_INFO_1_CONTAINER:", -1);
1925                 break;
1926         case 2:
1927                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1928                         srvsvc_dissect_SESSION_INFO_2_CONTAINER,
1929                         NDR_POINTER_UNIQUE, "SESSION_INFO_2_CONTAINER:", -1);
1930                 break;
1931         case 10:
1932                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1933                         srvsvc_dissect_SESSION_INFO_10_CONTAINER,
1934                         NDR_POINTER_UNIQUE, "SESSION_INFO_10_CONTAINER:", -1);
1935                 break;
1936         case 502:
1937                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1938                         srvsvc_dissect_SESSION_INFO_502_CONTAINER,
1939                         NDR_POINTER_UNIQUE, "SESSION_INFO_502_CONTAINER:", -1);
1940                 break;
1941         }
1942
1943         return offset;
1944 }
1945
1946 /*
1947  * IDL typedef struct {
1948  * IDL   long Level;
1949  * IDL   SESSION_ENUM_UNION ses;
1950  * IDL } SESSION_ENUM_STRUCT;
1951  */
1952 static int
1953 srvsvc_dissect_SESSION_ENUM_STRUCT(tvbuff_t *tvb, int offset,
1954                                      packet_info *pinfo, proto_tree *tree,
1955                                      char *drep)
1956 {
1957         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1958                         hf_srvsvc_info_level, 0);
1959
1960         offset = srvsvc_dissect_SESSION_ENUM_UNION(tvb, offset, pinfo, tree, drep);
1961
1962         return offset;
1963 }
1964
1965
1966 /*
1967  * IDL long NetrSessionEnum(
1968  * IDL      [in] [string] [unique] wchar_t *ServerName,
1969  * IDL      [in] [string] [unique] wchar_t *ClientName,
1970  * IDL      [in] [string] [unique] wchar_t *UserName,
1971  * IDL      [in] [out] [ref] SESSION_ENUM_STRUCT *ses,
1972  * IDL      [in] long maxlen,
1973  * IDL      [out] long num_sessions,
1974  * IDL      [in] [out] [unique] long *resumehandle,
1975  * IDL );
1976 */
1977 static int
1978 srvsvc_dissect_netrsessionenum_rqst(tvbuff_t *tvb, int offset,
1979                                      packet_info *pinfo, proto_tree *tree,
1980                                      char *drep)
1981 {
1982         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1983                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
1984
1985         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1986                         NDR_POINTER_UNIQUE, "Computer", hf_srvsvc_computer, 0);
1987
1988         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
1989                         NDR_POINTER_UNIQUE, "User", hf_srvsvc_user, 0);
1990
1991         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1992                 srvsvc_dissect_SESSION_ENUM_STRUCT,
1993                 NDR_POINTER_REF, "SESSION_ENUM_STRUCT", -1);
1994
1995         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
1996                 hf_srvsvc_preferred_len, 0);
1997
1998         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
1999                 srvsvc_dissect_ENUM_HANDLE,
2000                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
2001
2002         return offset;
2003 }
2004 static int
2005 srvsvc_dissect_netrsessionenum_reply(tvbuff_t *tvb, int offset,
2006                                      packet_info *pinfo, proto_tree *tree,
2007                                      char *drep)
2008 {
2009         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2010                 srvsvc_dissect_SESSION_ENUM_STRUCT,
2011                 NDR_POINTER_REF, "SESSION_ENUM_STRUCT", -1);
2012
2013         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2014                 hf_srvsvc_num_entries, NULL);
2015
2016         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2017                         srvsvc_dissect_ENUM_HANDLE,
2018                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
2019
2020         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
2021                         hf_srvsvc_rc, NULL);
2022
2023         return offset;
2024 }
2025
2026
2027 /*
2028  * IDL long NetrSessionDel(
2029  * IDL      [in] [string] [unique] wchar_t *ServerName,
2030  * IDL      [in] [string] [ref] wchar_t *ClientName,
2031  * IDL      [in] [string] [ref] wchar_t *UserName,
2032  * IDL );
2033 */
2034 static int
2035 srvsvc_dissect_netrsessiondel_rqst(tvbuff_t *tvb, int offset,
2036                                      packet_info *pinfo, proto_tree *tree,
2037                                      char *drep)
2038 {
2039         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2040                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
2041
2042         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2043                         NDR_POINTER_REF, "Computer", hf_srvsvc_computer, 0);
2044
2045         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2046                         NDR_POINTER_REF, "User", hf_srvsvc_user, 0);
2047
2048         return offset;
2049 }
2050 static int
2051 srvsvc_dissect_netrsessiondel_reply(tvbuff_t *tvb, int offset,
2052                                      packet_info *pinfo, proto_tree *tree,
2053                                      char *drep)
2054 {
2055         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
2056                         hf_srvsvc_rc, NULL);
2057
2058         return offset;
2059 }
2060
2061
2062 /*
2063  * IDL typedef struct {
2064  * IDL   [string] [unique] wchar_t *share;
2065  * IDL } SHARE_INFO_0;
2066  */
2067 static int
2068 srvsvc_dissect_SHARE_INFO_0(tvbuff_t *tvb, int offset,
2069                                      packet_info *pinfo, proto_tree *tree,
2070                                      char *drep)
2071 {
2072         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2073                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
2074
2075         return offset;
2076 }
2077 static int
2078 srvsvc_dissect_SHARE_INFO_0_array(tvbuff_t *tvb, int offset,
2079                                      packet_info *pinfo, proto_tree *tree,
2080                                      char *drep)
2081 {
2082         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2083                         srvsvc_dissect_SHARE_INFO_0);
2084
2085         return offset;
2086 }
2087
2088 /*
2089  * IDL typedef struct {
2090  * IDL   long EntriesRead;
2091  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_0 *shares;
2092  * IDL } SHARE_INFO_0_CONTAINER;
2093  */
2094 static int
2095 srvsvc_dissect_SHARE_INFO_0_CONTAINER(tvbuff_t *tvb, int offset,
2096                                      packet_info *pinfo, proto_tree *tree,
2097                                      char *drep)
2098 {
2099         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2100                 hf_srvsvc_num_entries, NULL);
2101
2102         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2103                 srvsvc_dissect_SHARE_INFO_0_array, NDR_POINTER_UNIQUE,
2104                 "SHARE_INFO_0 array:", -1);
2105
2106         return offset;
2107 }
2108
2109 /*
2110   IDL typedef struct {
2111   IDL    [unique] [string] wchar_t *share;
2112   IDL    long type;
2113   IDL    [unique] [string] wchar_t *comment;
2114   IDL } SHARE_INFO_1;
2115 */
2116 static int
2117 srvsvc_dissect_SHARE_INFO_1(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, char *drep)
2118 {
2119         proto_item *item = NULL;
2120         proto_tree *tree = NULL;
2121
2122         dcerpc_info *di;
2123
2124         di=pinfo->private_data;
2125         if (parent_tree) {
2126                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "Share");
2127                 tree = proto_item_add_subtree(item, ett_srvsvc_share_info_1);
2128         }
2129
2130         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2131                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 3);
2132
2133         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2134                 hf_srvsvc_share_type, NULL);
2135
2136         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2137                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
2138
2139         return offset;
2140 }
2141 static int
2142 srvsvc_dissect_SHARE_INFO_1_array(tvbuff_t *tvb, int offset,
2143                                      packet_info *pinfo, proto_tree *tree,
2144                                      char *drep)
2145 {
2146         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2147                         srvsvc_dissect_SHARE_INFO_1);
2148
2149         return offset;
2150 }
2151
2152 /*
2153  * IDL typedef struct {
2154  * IDL   long EntriesRead;
2155  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_1 *shares;
2156  * IDL } SHARE_INFO_1_CONTAINER;
2157  */
2158 static int
2159 srvsvc_dissect_SHARE_INFO_1_CONTAINER(tvbuff_t *tvb, int offset,
2160                                      packet_info *pinfo, proto_tree *tree,
2161                                      char *drep)
2162 {
2163         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2164                 hf_srvsvc_num_entries, NULL);
2165
2166         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2167                 srvsvc_dissect_SHARE_INFO_1_array, NDR_POINTER_UNIQUE,
2168                 "SHARE_INFO_1 array:", -1);
2169
2170         return offset;
2171 }
2172
2173 /*
2174   IDL typedef struct {
2175   IDL    [unique] [string] wchar_t *share;
2176   IDL    long type;
2177   IDL    [unique] [string] wchar_t *comment;
2178   IDL    long permissions;
2179   IDL    long max_uses;
2180   IDL    long current_uses;
2181   IDL    [unique] [string] wchar_t *path;
2182   IDL    [unique] [string] wchar_t *passwd;
2183   IDL } SHARE_INFO_2;
2184 */
2185 static int
2186 srvsvc_dissect_SHARE_INFO_2(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, char *drep)
2187 {
2188         proto_item *item = NULL;
2189         proto_tree *tree = NULL;
2190
2191         dcerpc_info *di;
2192
2193         di=pinfo->private_data;
2194         if (parent_tree) {
2195                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "Share");
2196                 tree = proto_item_add_subtree(item, ett_srvsvc_share_info_2);
2197         }
2198
2199         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2200                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
2201
2202         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2203                 hf_srvsvc_share_type, NULL);
2204
2205         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2206                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
2207
2208         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2209                                      hf_srvsvc_perm, NULL);
2210
2211         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2212                                      hf_srvsvc_max_uses, NULL);
2213
2214         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2215                                      hf_srvsvc_cur_uses, NULL);
2216
2217         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2218                         NDR_POINTER_UNIQUE, "Path", hf_srvsvc_path, 0);
2219
2220         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2221                         NDR_POINTER_UNIQUE, "Password", 
2222                         hf_srvsvc_share_passwd, 0);
2223
2224         return offset;
2225 }
2226 static int
2227 srvsvc_dissect_SHARE_INFO_2_array(tvbuff_t *tvb, int offset,
2228                                      packet_info *pinfo, proto_tree *tree,
2229                                      char *drep)
2230 {
2231         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2232                         srvsvc_dissect_SHARE_INFO_2);
2233
2234         return offset;
2235 }
2236
2237 /*
2238  * IDL typedef struct {
2239  * IDL   long EntriesRead;
2240  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_2 *shares;
2241  * IDL } SHARE_INFO_2_CONTAINER;
2242  */
2243 static int
2244 srvsvc_dissect_SHARE_INFO_2_CONTAINER(tvbuff_t *tvb, int offset,
2245                                      packet_info *pinfo, proto_tree *tree,
2246                                      char *drep)
2247 {
2248         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2249                 hf_srvsvc_num_entries, NULL);
2250
2251         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2252                 srvsvc_dissect_SHARE_INFO_2_array, NDR_POINTER_UNIQUE,
2253                 "SHARE_INFO_2 array:", -1);
2254
2255         return offset;
2256 }
2257
2258 /*
2259   IDL typedef struct {
2260   IDL    [unique] [string] wchar_t *share;
2261   IDL    long type;
2262   IDL    [unique] [string] wchar_t *comment;
2263   IDL    long policy;
2264   IDL } SHARE_INFO_501;
2265 */
2266 static int
2267 srvsvc_dissect_SHARE_INFO_501(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, char *drep)
2268 {
2269         proto_item *item = NULL;
2270         proto_tree *tree = NULL;
2271
2272         dcerpc_info *di;
2273
2274         di=pinfo->private_data;
2275         if (parent_tree) {
2276                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "Share");
2277                 tree = proto_item_add_subtree(item, ett_srvsvc_share_info_501);
2278         }
2279
2280         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2281                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
2282
2283         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2284                 hf_srvsvc_share_type, NULL);
2285
2286         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2287                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
2288
2289         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2290                 hf_srvsvc_policy, NULL);
2291
2292         return offset;
2293 }
2294 static int
2295 srvsvc_dissect_SHARE_INFO_501_array(tvbuff_t *tvb, int offset,
2296                                      packet_info *pinfo, proto_tree *tree,
2297                                      char *drep)
2298 {
2299         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2300                         srvsvc_dissect_SHARE_INFO_501);
2301
2302         return offset;
2303 }
2304
2305 /*
2306  * IDL typedef struct {
2307  * IDL   long EntriesRead;
2308  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_501 *shares;
2309  * IDL } SHARE_INFO_501_CONTAINER;
2310  */
2311 static int
2312 srvsvc_dissect_SHARE_INFO_501_CONTAINER(tvbuff_t *tvb, int offset,
2313                                      packet_info *pinfo, proto_tree *tree,
2314                                      char *drep)
2315 {
2316         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2317                 hf_srvsvc_num_entries, NULL);
2318
2319         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2320                 srvsvc_dissect_SHARE_INFO_501_array, NDR_POINTER_UNIQUE,
2321                 "SHARE_INFO_501 array:", -1);
2322
2323         return offset;
2324 }
2325
2326
2327 /*
2328   IDL typedef struct {
2329   IDL    [unique] [string] wchar_t *share;
2330   IDL    long type;
2331   IDL    [unique] [string] wchar_t *comment;
2332   IDL    long permissions;
2333   IDL    long max_uses;
2334   IDL    long current_uses;
2335   IDL    [unique] [string] wchar_t *path;
2336   IDL    [unique] [string] wchar_t *passwd;
2337   IDL    long reserved;
2338   IDL    SECDESC [unique] *securitysecriptor; 4byte-len followed by bytestring
2339   IDL } SHARE_INFO_502;
2340 */
2341 static int
2342 srvsvc_dissect_SHARE_INFO_502(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, char *drep)
2343 {
2344         proto_item *item = NULL;
2345         proto_tree *tree = NULL;
2346
2347         dcerpc_info *di;
2348
2349         di=pinfo->private_data;
2350         if (parent_tree) {
2351                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "Share");
2352                 tree = proto_item_add_subtree(item, ett_srvsvc_share_info_502);
2353         }
2354
2355         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2356                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
2357
2358         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2359                 hf_srvsvc_share_type, NULL);
2360
2361         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2362                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
2363
2364         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2365                                      hf_srvsvc_perm, NULL);
2366
2367         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2368                                      hf_srvsvc_max_uses, NULL);
2369
2370         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2371                                      hf_srvsvc_cur_uses, NULL);
2372
2373         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2374                         NDR_POINTER_UNIQUE, "Path", hf_srvsvc_path, 0);
2375
2376         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2377                         NDR_POINTER_UNIQUE, "Password", 
2378                         hf_srvsvc_share_passwd, 0);
2379
2380         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2381                                      hf_srvsvc_reserved, NULL);
2382
2383         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2384                         lsa_dissect_LSA_SECURITY_DESCRIPTOR_data, NDR_POINTER_UNIQUE,
2385                         "LSA SECURITY DESCRIPTOR data:", -1);
2386
2387         return offset;
2388 }
2389 static int
2390 srvsvc_dissect_SHARE_INFO_502_array(tvbuff_t *tvb, int offset,
2391                                      packet_info *pinfo, proto_tree *tree,
2392                                      char *drep)
2393 {
2394         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2395                         srvsvc_dissect_SHARE_INFO_502);
2396
2397         return offset;
2398 }
2399
2400 /*
2401  * IDL typedef struct {
2402  * IDL   long EntriesRead;
2403  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_502 *shares;
2404  * IDL } SHARE_INFO_502_CONTAINER;
2405  */
2406 static int
2407 srvsvc_dissect_SHARE_INFO_502_CONTAINER(tvbuff_t *tvb, int offset,
2408                                      packet_info *pinfo, proto_tree *tree,
2409                                      char *drep)
2410 {
2411         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2412                 hf_srvsvc_num_entries, NULL);
2413
2414         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2415                 srvsvc_dissect_SHARE_INFO_502_array, NDR_POINTER_UNIQUE,
2416                 "SHARE_INFO_502 array:", -1);
2417
2418         return offset;
2419 }
2420
2421 /*
2422   IDL typedef struct {
2423   IDL    [unique] [string] wchar_t *comment;
2424   IDL } SHARE_INFO_1004;
2425 */
2426 static int
2427 srvsvc_dissect_SHARE_INFO_1004(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep)
2428 {
2429         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2430                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
2431
2432         return offset;
2433 }
2434 static int
2435 srvsvc_dissect_SHARE_INFO_1004_array(tvbuff_t *tvb, int offset,
2436                                      packet_info *pinfo, proto_tree *tree,
2437                                      char *drep)
2438 {
2439         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2440                         srvsvc_dissect_SHARE_INFO_1004);
2441
2442         return offset;
2443 }
2444
2445 /*
2446  * IDL typedef struct {
2447  * IDL   long EntriesRead;
2448  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_1004 *shares;
2449  * IDL } SHARE_INFO_1004_CONTAINER;
2450  */
2451 static int
2452 srvsvc_dissect_SHARE_INFO_1004_CONTAINER(tvbuff_t *tvb, int offset,
2453                                      packet_info *pinfo, proto_tree *tree,
2454                                      char *drep)
2455 {
2456         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2457                 hf_srvsvc_num_entries, NULL);
2458
2459         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2460                 srvsvc_dissect_SHARE_INFO_1004_array, NDR_POINTER_UNIQUE,
2461                 "SHARE_INFO_1004 array:", -1);
2462
2463         return offset;
2464 }
2465
2466 /*
2467   IDL typedef struct {
2468   IDL    long dfs_root_flags;
2469   IDL } SHARE_INFO_1005;
2470 */
2471 static int
2472 srvsvc_dissect_SHARE_INFO_1005(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep)
2473 {
2474         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2475                                      hf_srvsvc_dfs_root_flags, NULL);
2476
2477         return offset;
2478 }
2479 static int
2480 srvsvc_dissect_SHARE_INFO_1005_array(tvbuff_t *tvb, int offset,
2481                                      packet_info *pinfo, proto_tree *tree,
2482                                      char *drep)
2483 {
2484         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2485                         srvsvc_dissect_SHARE_INFO_1005);
2486
2487         return offset;
2488 }
2489
2490 /*
2491  * IDL typedef struct {
2492  * IDL   long EntriesRead;
2493  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_1005 *shares;
2494  * IDL } SHARE_INFO_1005_CONTAINER;
2495  */
2496 static int
2497 srvsvc_dissect_SHARE_INFO_1005_CONTAINER(tvbuff_t *tvb, int offset,
2498                                      packet_info *pinfo, proto_tree *tree,
2499                                      char *drep)
2500 {
2501         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2502                 hf_srvsvc_num_entries, NULL);
2503
2504         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2505                 srvsvc_dissect_SHARE_INFO_1005_array, NDR_POINTER_UNIQUE,
2506                 "SHARE_INFO_1005 array:", -1);
2507
2508         return offset;
2509 }
2510
2511
2512 /*
2513   IDL typedef struct {
2514   IDL    long max_uses;
2515   IDL } SHARE_INFO_1006;
2516 */
2517 static int
2518 srvsvc_dissect_SHARE_INFO_1006(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep)
2519 {
2520         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2521                                      hf_srvsvc_max_uses, NULL);
2522
2523         return offset;
2524 }
2525 static int
2526 srvsvc_dissect_SHARE_INFO_1006_array(tvbuff_t *tvb, int offset,
2527                                      packet_info *pinfo, proto_tree *tree,
2528                                      char *drep)
2529 {
2530         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2531                         srvsvc_dissect_SHARE_INFO_1006);
2532
2533         return offset;
2534 }
2535
2536 /*
2537  * IDL typedef struct {
2538  * IDL   long EntriesRead;
2539  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_1006 *shares;
2540  * IDL } SHARE_INFO_1006_CONTAINER;
2541  */
2542 static int
2543 srvsvc_dissect_SHARE_INFO_1006_CONTAINER(tvbuff_t *tvb, int offset,
2544                                      packet_info *pinfo, proto_tree *tree,
2545                                      char *drep)
2546 {
2547         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2548                 hf_srvsvc_num_entries, NULL);
2549
2550         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2551                 srvsvc_dissect_SHARE_INFO_1006_array, NDR_POINTER_UNIQUE,
2552                 "SHARE_INFO_1006 array:", -1);
2553
2554         return offset;
2555 }
2556
2557
2558 /*
2559   IDL typedef struct {
2560   IDL    long flags;
2561   IDL    [unique] [string] wchar_t *alternate_directory_name;
2562   IDL } SHARE_INFO_1007;
2563 */
2564 static int
2565 srvsvc_dissect_SHARE_INFO_1007(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep)
2566 {
2567         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
2568                                      hf_srvsvc_share_flags, NULL);
2569
2570         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2571                         NDR_POINTER_UNIQUE, "Alternate Name", 
2572                         hf_srvsvc_share_alternate_name, 0);
2573
2574         return offset;
2575 }
2576 static int
2577 srvsvc_dissect_SHARE_INFO_1007_array(tvbuff_t *tvb, int offset,
2578                                      packet_info *pinfo, proto_tree *tree,
2579                                      char *drep)
2580 {
2581         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2582                         srvsvc_dissect_SHARE_INFO_1007);
2583
2584         return offset;
2585 }
2586
2587 /*
2588  * IDL typedef struct {
2589  * IDL   long EntriesRead;
2590  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_1007 *shares;
2591  * IDL } SHARE_INFO_1007_CONTAINER;
2592  */
2593 static int
2594 srvsvc_dissect_SHARE_INFO_1007_CONTAINER(tvbuff_t *tvb, int offset,
2595                                      packet_info *pinfo, proto_tree *tree,
2596                                      char *drep)
2597 {
2598         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2599                 hf_srvsvc_num_entries, NULL);
2600
2601         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2602                 srvsvc_dissect_SHARE_INFO_1007_array, NDR_POINTER_UNIQUE,
2603                 "SHARE_INFO_1007 array:", -1);
2604
2605         return offset;
2606 }
2607
2608 /*
2609   IDL typedef struct {
2610   IDL    SECDESC [unique] *securitysecriptor; 4byte-len followed by bytestring
2611   IDL } SHARE_INFO_1501;
2612 */
2613 static int
2614 srvsvc_dissect_SHARE_INFO_1501(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep)
2615 {
2616         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2617                         lsa_dissect_LSA_SECURITY_DESCRIPTOR_data, NDR_POINTER_UNIQUE,
2618                         "LSA SECURITY DESCRIPTOR data:", -1);
2619
2620         return offset;
2621 }
2622 static int
2623 srvsvc_dissect_SHARE_INFO_1501_array(tvbuff_t *tvb, int offset,
2624                                      packet_info *pinfo, proto_tree *tree,
2625                                      char *drep)
2626 {
2627         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
2628                         srvsvc_dissect_SHARE_INFO_1501);
2629
2630         return offset;
2631 }
2632
2633 /*
2634  * IDL typedef struct {
2635  * IDL   long EntriesRead;
2636  * IDL   [size_is(EntriesRead)] [unique] SHARE_INFO_1501 *shares;
2637  * IDL } SHARE_INFO_1501_CONTAINER;
2638  */
2639 static int
2640 srvsvc_dissect_SHARE_INFO_1501_CONTAINER(tvbuff_t *tvb, int offset,
2641                                      packet_info *pinfo, proto_tree *tree,
2642                                      char *drep)
2643 {
2644         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2645                 hf_srvsvc_num_entries, NULL);
2646
2647         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2648                 srvsvc_dissect_SHARE_INFO_1501_array, NDR_POINTER_UNIQUE,
2649                 "SHARE_INFO_1501 array:", -1);
2650
2651         return offset;
2652 }
2653
2654
2655 /*
2656  * IDL typedef [switch_type(long)] union {
2657  * IDL   [case(0)] [unique] SHARE_INFO_0 *share0;
2658  * IDL   [case(1)] [unique] SHARE_INFO_1 *share1;
2659  * IDL   [case(2)] [unique] SHARE_INFO_2 *share2;
2660  * IDL   [case(501)] [unique] SHARE_INFO_501 *share501;
2661  * IDL   [case(502)] [unique] SHARE_INFO_502 *share502;
2662  * IDL   [case(1004)] [unique] SHARE_INFO_1004 *share1004;
2663  * IDL   [case(1005)] [unique] SHARE_INFO_1005 *share1005;
2664  * IDL   [case(1006)] [unique] SHARE_INFO_1006 *share1006;
2665  * IDL   [case(1007)] [unique] SHARE_INFO_1007 *share1007;
2666  * IDL   [case(1501)] [unique] SHARE_INFO_1501 *share1501;
2667  * IDL } SHARE_INFO_UNION;
2668  */
2669 static int
2670 srvsvc_dissect_SHARE_INFO_UNION(tvbuff_t *tvb, int offset,
2671                                      packet_info *pinfo, proto_tree *tree,
2672                                      char *drep)
2673 {
2674         guint32 level;
2675
2676         ALIGN_TO_4_BYTES;
2677
2678         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
2679
2680         switch(level){
2681         case 0:
2682                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2683                         srvsvc_dissect_SHARE_INFO_0,
2684                         NDR_POINTER_UNIQUE, "SHARE_INFO_0:", -1);
2685                 break;
2686         case 1:
2687                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2688                         srvsvc_dissect_SHARE_INFO_1,
2689                         NDR_POINTER_UNIQUE, "SHARE_INFO_1:", -1);
2690                 break;
2691         case 2:
2692                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2693                         srvsvc_dissect_SHARE_INFO_2,
2694                         NDR_POINTER_UNIQUE, "SHARE_INFO_2:", -1);
2695                 break;
2696         case 501:
2697                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2698                         srvsvc_dissect_SHARE_INFO_501,
2699                         NDR_POINTER_UNIQUE, "SHARE_INFO_501:", -1);
2700                 break;
2701         case 502:
2702                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2703                         srvsvc_dissect_SHARE_INFO_502,
2704                         NDR_POINTER_UNIQUE, "SHARE_INFO_502:", -1);
2705                 break;
2706         case 1004:
2707                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2708                         srvsvc_dissect_SHARE_INFO_1004,
2709                         NDR_POINTER_UNIQUE, "SHARE_INFO_1004:", -1);
2710                 break;
2711         case 1005:
2712                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2713                         srvsvc_dissect_SHARE_INFO_1005,
2714                         NDR_POINTER_UNIQUE, "SHARE_INFO_1005:", -1);
2715                 break;
2716         case 1006:
2717                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2718                         srvsvc_dissect_SHARE_INFO_1006,
2719                         NDR_POINTER_UNIQUE, "SHARE_INFO_1006:", -1);
2720                 break;
2721         case 1007:
2722                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2723                         srvsvc_dissect_SHARE_INFO_1007,
2724                         NDR_POINTER_UNIQUE, "SHARE_INFO_1007:", -1);
2725                 break;
2726         case 1501:
2727                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2728                         srvsvc_dissect_SHARE_INFO_1501,
2729                         NDR_POINTER_UNIQUE, "SHARE_INFO_1501:", -1);
2730                 break;
2731         }
2732
2733         return offset;
2734 }
2735
2736
2737 /*
2738  * IDL long NetrShareAdd(
2739  * IDL      [in] [string] [unique] wchar_t *ServerName,
2740  * IDL      [in] long Level,
2741  * IDL      [in] [ref] SHARE_INFO_UNION *share,
2742  * IDL      [in] [out] [unique] long *ParmError
2743  * IDL );
2744 */
2745 static int
2746 srvsvc_dissect_netrshareadd_rqst(tvbuff_t *tvb, int offset,
2747                                      packet_info *pinfo, proto_tree *tree,
2748                                      char *drep)
2749 {
2750         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2751                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
2752
2753         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2754                         hf_srvsvc_info_level, 0);
2755
2756         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2757                 srvsvc_dissect_SHARE_INFO_UNION,
2758                 NDR_POINTER_REF, "SHARE_INFO_UNION:", -1);
2759
2760         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2761                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
2762                         "Parameter Error:", hf_srvsvc_parm_error);
2763
2764         return offset;
2765 }
2766 static int
2767 srvsvc_dissect_netrshareadd_reply(tvbuff_t *tvb, int offset,
2768                                      packet_info *pinfo, proto_tree *tree,
2769                                      char *drep)
2770 {
2771         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2772                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
2773                         "Parameter Error:", hf_srvsvc_parm_error);
2774
2775         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
2776                         hf_srvsvc_rc, NULL);
2777
2778         return offset;
2779 }
2780
2781
2782 /*
2783  * IDL typedef [switch_type(long)] union {
2784  * IDL   [case(0)] [unique] SHARE_INFO_0_CONTAINER *share0;
2785  * IDL   [case(1)] [unique] SHARE_INFO_1_CONTAINER *share1;
2786  * IDL   [case(2)] [unique] SHARE_INFO_2_CONTAINER *share2;
2787  * IDL   [case(501)] [unique] SHARE_INFO_501_CONTAINER *share501;
2788  * IDL   [case(502)] [unique] SHARE_INFO_502_CONTAINER *share502;
2789  * IDL   [case(1004)] [unique] SHARE_INFO_1004_CONTAINER *share1004;
2790  * IDL   [case(1005)] [unique] SHARE_INFO_1005_CONTAINER *share1005;
2791  * IDL   [case(1006)] [unique] SHARE_INFO_1006_CONTAINER *share1006;
2792  * IDL   [case(1007)] [unique] SHARE_INFO_1007_CONTAINER *share1007;
2793  * IDL   [case(1501)] [unique] SHARE_INFO_1501_CONTAINER *share1501;
2794  * IDL } SHARE_ENUM_UNION;
2795  */
2796 static int
2797 srvsvc_dissect_SHARE_ENUM_UNION(tvbuff_t *tvb, int offset,
2798                                      packet_info *pinfo, proto_tree *tree,
2799                                      char *drep)
2800 {
2801         guint32 level;
2802
2803         ALIGN_TO_4_BYTES;
2804
2805         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
2806
2807         switch(level){
2808         case 0:
2809                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2810                         srvsvc_dissect_SHARE_INFO_0_CONTAINER,
2811                         NDR_POINTER_UNIQUE, "SHARE_INFO_0_CONTAINER:", -1);
2812                 break;
2813         case 1:
2814                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2815                         srvsvc_dissect_SHARE_INFO_1_CONTAINER,
2816                         NDR_POINTER_UNIQUE, "SHARE_INFO_1_CONTAINER:", -1);
2817                 break;
2818         case 2:
2819                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2820                         srvsvc_dissect_SHARE_INFO_2_CONTAINER,
2821                         NDR_POINTER_UNIQUE, "SHARE_INFO_2_CONTAINER:", -1);
2822                 break;
2823         case 501:
2824                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2825                         srvsvc_dissect_SHARE_INFO_501_CONTAINER,
2826                         NDR_POINTER_UNIQUE, "SHARE_INFO_501_CONTAINER:", -1);
2827                 break;
2828         case 502:
2829                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2830                         srvsvc_dissect_SHARE_INFO_502_CONTAINER,
2831                         NDR_POINTER_UNIQUE, "SHARE_INFO_502_CONTAINER:", -1);
2832                 break;
2833         case 1004:
2834                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2835                         srvsvc_dissect_SHARE_INFO_1004_CONTAINER,
2836                         NDR_POINTER_UNIQUE, "SHARE_INFO_1004_CONTAINER:", -1);
2837                 break;
2838         case 1005:
2839                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2840                         srvsvc_dissect_SHARE_INFO_1005_CONTAINER,
2841                         NDR_POINTER_UNIQUE, "SHARE_INFO_1005_CONTAINER:", -1);
2842                 break;
2843         case 1006:
2844                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2845                         srvsvc_dissect_SHARE_INFO_1006_CONTAINER,
2846                         NDR_POINTER_UNIQUE, "SHARE_INFO_1006_CONTAINER:", -1);
2847                 break;
2848         case 1007:
2849                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2850                         srvsvc_dissect_SHARE_INFO_1007_CONTAINER,
2851                         NDR_POINTER_UNIQUE, "SHARE_INFO_1007_CONTAINER:", -1);
2852                 break;
2853         case 1501:
2854                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2855                         srvsvc_dissect_SHARE_INFO_1501_CONTAINER,
2856                         NDR_POINTER_UNIQUE, "SHARE_INFO_1501_CONTAINER:", -1);
2857                 break;
2858         }
2859
2860         return offset;
2861 }
2862
2863 /*
2864  * IDL typedef struct {
2865  * IDL   long Level;
2866  * IDL   SHARE_ENUM_UNION shares;
2867  * IDL } SHARE_ENUM_STRUCT;
2868  */
2869 static int
2870 srvsvc_dissect_SHARE_ENUM_STRUCT(tvbuff_t *tvb, int offset,
2871                                      packet_info *pinfo, proto_tree *tree,
2872                                      char *drep)
2873 {
2874         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2875                         hf_srvsvc_info_level, 0);
2876
2877         offset = srvsvc_dissect_SHARE_ENUM_UNION(tvb, offset, pinfo, tree, drep);
2878
2879         return offset;
2880 }
2881
2882 /*
2883  * IDL long NetrShareEnum(
2884  * IDL      [in] [string] [unique] wchar_t *ServerName,
2885  * IDL      [in] [out] [ref] SHARE_ENUM_STRUCT *share,
2886  * IDL      [in] long MaxLen,
2887  * IDL      [out] long Entries,
2888  * IDL      [in] [out] [unique] *ResumeHandle
2889  * IDL );
2890  */
2891 static int
2892 srvsvc_dissect_netrshareenum_rqst(tvbuff_t *tvb, int offset,
2893                                      packet_info *pinfo, proto_tree *tree,
2894                                      char *drep)
2895 {
2896         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2897                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
2898
2899         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2900                         srvsvc_dissect_SHARE_ENUM_STRUCT,
2901                         NDR_POINTER_REF, "Shares", -1);
2902
2903         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2904                         hf_srvsvc_preferred_len, 0);
2905
2906         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2907                         srvsvc_dissect_ENUM_HANDLE,
2908                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
2909
2910         return offset;
2911 }
2912
2913 static int
2914 srvsvc_dissect_netrshareenum_reply(tvbuff_t *tvb, int offset,
2915                                       packet_info *pinfo, proto_tree *tree,
2916                                       char *drep)
2917 {
2918         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2919                         srvsvc_dissect_SHARE_ENUM_STRUCT,
2920                         NDR_POINTER_REF, "Shares", -1);
2921
2922         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2923                         hf_srvsvc_num_entries, NULL);
2924
2925         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2926                         srvsvc_dissect_ENUM_HANDLE,
2927                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
2928
2929         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
2930                         hf_srvsvc_rc, NULL);
2931
2932         return offset;
2933 }
2934
2935 /*
2936  * IDL long NetrShareGetInfo(
2937  * IDL      [in] [string] [unique] wchar_t *ServerName,
2938  * IDL      [in] [string] [ref] wchar_t *ShareName,
2939  * IDL      [in] long Level,
2940  * IDL      [out] [ref] SHARE_INFO_UNION *share
2941  * IDL );
2942  */
2943 static int
2944 srvsvc_dissect_netrsharegetinfo_rqst(tvbuff_t *tvb, int offset,
2945                                      packet_info *pinfo, proto_tree *tree,
2946                                      char *drep)
2947 {
2948         offset = dissect_ndr_pointer_cb(
2949                 tvb, offset, pinfo, tree, drep,
2950                 dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
2951                 "Server", hf_srvsvc_server, cb_str_postprocess,
2952                 GINT_TO_POINTER(CB_STR_COL_INFO | 1));
2953
2954         offset = dissect_ndr_pointer_cb(
2955                 tvb, offset, pinfo, tree, drep,
2956                 dissect_ndr_wchar_cvstring, NDR_POINTER_REF,
2957                 "Share", hf_srvsvc_share, cb_str_postprocess,
2958                 GINT_TO_POINTER(CB_STR_COL_INFO | 1));
2959
2960         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
2961                         hf_srvsvc_info_level, 0);
2962
2963         return offset;
2964 }
2965
2966 static int
2967 srvsvc_dissect_netrsharegetinfo_reply(tvbuff_t *tvb, int offset,
2968                                       packet_info *pinfo, proto_tree *tree,
2969                                       char *drep)
2970 {
2971         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
2972                         srvsvc_dissect_SHARE_INFO_UNION,
2973                         NDR_POINTER_REF, "Share:", -1);
2974
2975         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
2976                         hf_srvsvc_rc, NULL);
2977
2978         return offset;
2979 }
2980
2981 /*
2982  * IDL long NetrShareSetInfo(
2983  * IDL      [in] [string] [unique] wchar_t *ServerName,
2984  * IDL      [in] [string] [ref] wchar_t *ShareName,
2985  * IDL      [in] long Level,
2986  * IDL      [in] [ref] SHARE_INFO_UNION *share
2987  * IDL      [in] [out] [unique] long *ParmError,
2988  * IDL );
2989  */
2990 static int
2991 srvsvc_dissect_netrsharesetinfo_rqst(tvbuff_t *tvb, int offset,
2992                                      packet_info *pinfo, proto_tree *tree,
2993                                      char *drep)
2994 {
2995         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2996                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
2997
2998         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
2999                         NDR_POINTER_REF, "Share", hf_srvsvc_share, 0);
3000
3001         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3002                         hf_srvsvc_info_level, 0);
3003
3004         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
3005                         srvsvc_dissect_SHARE_INFO_UNION,
3006                         NDR_POINTER_REF, "Share:", -1);
3007
3008         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
3009                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
3010                         "Parameter Error:", hf_srvsvc_parm_error);
3011
3012         return offset;
3013 }
3014 static int
3015 srvsvc_dissect_netrsharesetinfo_reply(tvbuff_t *tvb, int offset,
3016                                      packet_info *pinfo, proto_tree *tree,
3017                                      char *drep)
3018 {
3019         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
3020                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
3021                         "Parameter Error:", hf_srvsvc_parm_error);
3022
3023         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
3024                         hf_srvsvc_rc, NULL);
3025
3026         return offset;
3027 }
3028
3029 /*
3030  * IDL long NetrShareDel(
3031  * IDL      [in] [string] [unique] wchar_t *ServerName,
3032  * IDL      [in] [string] [ref] wchar_t *ShareName,
3033  * IDL      [in] long Reserved,
3034  * IDL );
3035  */
3036 static int
3037 srvsvc_dissect_netrsharedel_rqst(tvbuff_t *tvb, int offset,
3038                                      packet_info *pinfo, proto_tree *tree,
3039                                      char *drep)
3040 {
3041         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3042                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
3043
3044         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3045                         NDR_POINTER_REF, "Share", hf_srvsvc_share, 0);
3046
3047         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
3048                                      hf_srvsvc_reserved, NULL);
3049
3050         return offset;
3051 }
3052 static int
3053 srvsvc_dissect_netrsharedel_reply(tvbuff_t *tvb, int offset,
3054                                      packet_info *pinfo, proto_tree *tree,
3055                                      char *drep)
3056 {
3057         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
3058                         hf_srvsvc_rc, NULL);
3059
3060         return offset;
3061 }
3062
3063 /*
3064  * IDL long NetrShareDelSticky(
3065  * IDL      [in] [string] [unique] wchar_t *ServerName,
3066  * IDL      [in] [string] [ref] wchar_t *ShareName,
3067  * IDL      [in] long Reserved,
3068  * IDL );
3069  */
3070 static int
3071 srvsvc_dissect_netrsharedelsticky_rqst(tvbuff_t *tvb, int offset,
3072                                      packet_info *pinfo, proto_tree *tree,
3073                                      char *drep)
3074 {
3075         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3076                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
3077
3078         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3079                         NDR_POINTER_REF, "Share", hf_srvsvc_share, 0);
3080
3081         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
3082                                      hf_srvsvc_reserved, NULL);
3083
3084         return offset;
3085 }
3086 static int
3087 srvsvc_dissect_netrsharedelsticky_reply(tvbuff_t *tvb, int offset,
3088                                      packet_info *pinfo, proto_tree *tree,
3089                                      char *drep)
3090 {
3091         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
3092                         hf_srvsvc_rc, NULL);
3093
3094         return offset;
3095 }
3096
3097 /*
3098  * IDL long NetrShareCheck(
3099  * IDL      [in] [string] [unique] wchar_t *ServerName,
3100  * IDL      [in] [string] [ref] wchar_t *DeviceName,
3101  * IDL      [out] long type
3102  * IDL );
3103  */
3104 static int
3105 srvsvc_dissect_netrsharecheck_rqst(tvbuff_t *tvb, int offset,
3106                                      packet_info *pinfo, proto_tree *tree,
3107                                      char *drep)
3108 {
3109         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3110                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
3111
3112         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3113                         NDR_POINTER_UNIQUE, "Char Device", hf_srvsvc_chrdev, 0);
3114
3115         return offset;
3116 }
3117 static int
3118 srvsvc_dissect_netrsharecheck_reply(tvbuff_t *tvb, int offset,
3119                                      packet_info *pinfo, proto_tree *tree,
3120                                      char *drep)
3121 {
3122         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3123                         hf_srvsvc_share_type, NULL);
3124
3125         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
3126                         hf_srvsvc_rc, NULL);
3127
3128         return offset;
3129 }
3130
3131 /*
3132  * IDL typedef struct {
3133  * IDL   long platform_id;
3134  * IDL   [string] [unique] wchar_t *server;
3135  * IDL } SERVER_INFO_100;
3136  */
3137 static int
3138 srvsvc_dissect_SERVER_INFO_100(tvbuff_t *tvb, int offset,
3139                                    packet_info *pinfo, proto_tree *tree,
3140                                    char *drep)
3141 {
3142         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3143                         hf_srvsvc_platform_id, NULL);
3144
3145         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3146                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
3147
3148         return offset;
3149 }
3150
3151 /*
3152  * IDL typedef struct {
3153  * IDL   long platform_id;
3154  * IDL   [string] [unique] wchar_t *server;
3155  * IDL   long ver_major;
3156  * IDL   long ver_minor;
3157  * IDL   long type;
3158  * IDL   [string] [unique] wchar_t *comment;
3159  * IDL } SERVER_INFO_101;
3160  */
3161 static int
3162 srvsvc_dissect_SERVER_INFO_101(tvbuff_t *tvb, int offset,
3163                                    packet_info *pinfo, proto_tree *tree,
3164                                    char *drep)
3165 {
3166         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3167                         hf_srvsvc_platform_id, NULL);
3168
3169         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3170                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
3171
3172         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3173                         hf_srvsvc_ver_major, NULL);
3174
3175         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3176                         hf_srvsvc_ver_minor, NULL);
3177
3178         offset = dissect_smb_server_type_flags(
3179                 tvb, offset, pinfo, tree, drep, TRUE);
3180
3181         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3182                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
3183
3184         return offset;
3185 }
3186
3187 /*
3188  * IDL typedef struct {
3189  * IDL   long platform_id;
3190  * IDL   [string] [unique] wchar_t *server;
3191  * IDL   long ver_major;
3192  * IDL   long ver_minor;
3193  * IDL   long type;
3194  * IDL   [string] [unique] wchar_t *comment;
3195  * IDL   long users;
3196  * IDL   long disc;
3197  * IDL   long hidden;
3198  * IDL   long announce;
3199  * IDL   long anndelta;
3200  * IDL   long licences;
3201  * IDL   [string] [unique] wchar_t *userpath;
3202  * IDL } SERVER_INFO_102;
3203  */
3204 static int
3205 srvsvc_dissect_SERVER_INFO_102(tvbuff_t *tvb, int offset,
3206                                    packet_info *pinfo, proto_tree *tree,
3207                                    char *drep)
3208 {
3209         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3210                         hf_srvsvc_platform_id, NULL);
3211
3212         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3213                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
3214
3215         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3216                         hf_srvsvc_ver_major, NULL);
3217
3218         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3219                         hf_srvsvc_ver_minor, NULL);
3220
3221         offset = dissect_smb_server_type_flags(
3222                 tvb, offset, pinfo, tree, drep, TRUE);
3223
3224         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3225                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
3226
3227         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3228                         hf_srvsvc_users, NULL);
3229
3230         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3231                         hf_srvsvc_disc, NULL);
3232
3233         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3234                         hf_srvsvc_hidden, NULL);
3235
3236         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3237                         hf_srvsvc_announce, NULL);
3238
3239         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3240                         hf_srvsvc_anndelta, NULL);
3241
3242         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3243                         hf_srvsvc_licences, NULL);
3244
3245         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3246                         NDR_POINTER_UNIQUE, "User Path", hf_srvsvc_user_path, 0);
3247
3248         return offset;
3249 }
3250
3251 /*
3252  * IDL typedef struct {
3253  * IDL   long ulist_mtime;
3254  * IDL   long glist_mtime;
3255  * IDL   long alist_mtime;
3256  * IDL   [string] [unique] wchar_t *alerts;
3257  * IDL   long security;
3258  * IDL   long numadmin;
3259  * IDL   long lanmask;
3260  * IDL   [string] [unique] wchar_t *guestaccount;
3261  * IDL   long chdevs;
3262  * IDL   long chdevqs;
3263  * IDL   long chdevjobs;
3264  * IDL   long connections;
3265  * IDL   long shares;
3266  * IDL   long openfiles;
3267  * IDL   long sessopens;
3268  * IDL   long sessvcs;
3269  * IDL   long sessreqs;
3270  * IDL   long opensearch;
3271  * IDL   long activelocks;
3272  * IDL   long sizreqbufs
3273  * IDL   long numbigbufs
3274  * IDL   long numfiletasks;
3275  * IDL   long alertsched;
3276  * IDL   long erroralert;
3277  * IDL   long logonalert;
3278  * IDL   long accessalert;
3279  * IDL   long diskalert;
3280  * IDL   long netioalert;
3281  * IDL   long maxauditsz;
3282  * IDL   [string] [unique] wchar_t *srvheuristics;
3283  * IDL } SERVER_INFO_402;
3284  */
3285 static int
3286 srvsvc_dissect_SERVER_INFO_402(tvbuff_t *tvb, int offset,
3287                                    packet_info *pinfo, proto_tree *tree,
3288                                    char *drep)
3289 {
3290         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3291                         hf_srvsvc_ulist_mtime, NULL);
3292
3293         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3294                         hf_srvsvc_glist_mtime, NULL);
3295
3296         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3297                         hf_srvsvc_alist_mtime, NULL);
3298
3299         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3300                         NDR_POINTER_UNIQUE, "Alerts", hf_srvsvc_alerts, 0);
3301
3302         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3303                         hf_srvsvc_security, NULL);
3304
3305         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3306                         hf_srvsvc_numadmin, NULL);
3307
3308         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3309                         hf_srvsvc_lanmask, NULL);
3310
3311         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3312                         NDR_POINTER_UNIQUE, "Guest", hf_srvsvc_guest, 0);
3313
3314         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3315                         hf_srvsvc_chdevs, NULL);
3316
3317         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3318                         hf_srvsvc_chdevqs, NULL);
3319
3320         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3321                         hf_srvsvc_chdevjobs, NULL);
3322
3323         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3324                         hf_srvsvc_connections, NULL);
3325
3326         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3327                         hf_srvsvc_shares, NULL);
3328
3329         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3330                         hf_srvsvc_openfiles, NULL);
3331
3332         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3333                         hf_srvsvc_sessopens, NULL);
3334
3335         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3336                         hf_srvsvc_sessvcs, NULL);
3337
3338         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3339                         hf_srvsvc_sessreqs, NULL);
3340
3341         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3342                         hf_srvsvc_opensearch, NULL);
3343
3344         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3345                         hf_srvsvc_activelocks, NULL);
3346
3347         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3348                         hf_srvsvc_sizreqbufs, NULL);
3349
3350         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3351                         hf_srvsvc_numbigbufs, NULL);
3352
3353         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3354                         hf_srvsvc_numfiletasks, NULL);
3355
3356         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3357                         hf_srvsvc_alertsched, NULL);
3358
3359         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3360                         hf_srvsvc_erroralert, NULL);
3361
3362         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3363                         hf_srvsvc_logonalert, NULL);
3364
3365         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3366                         hf_srvsvc_accessalert, NULL);
3367
3368         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3369                         hf_srvsvc_diskalert, NULL);
3370
3371         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3372                         hf_srvsvc_netioalert, NULL);
3373
3374         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3375                         hf_srvsvc_maxauditsz, NULL);
3376
3377         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3378                         NDR_POINTER_UNIQUE, "Server Heuristics", 
3379                         hf_srvsvc_srvheuristics, 0);
3380
3381         return offset;
3382 }
3383
3384 /*
3385  * IDL typedef struct {
3386  * IDL   long ulist_mtime;
3387  * IDL   long glist_mtime;
3388  * IDL   long alist_mtime;
3389  * IDL   [string] [unique] wchar_t *alerts;
3390  * IDL   long security;
3391  * IDL   long numadmin;
3392  * IDL   long lanmask;
3393  * IDL   [string] [unique] wchar_t *guestaccount;
3394  * IDL   long chdevs;
3395  * IDL   long chdevqs;
3396  * IDL   long chdevjobs;
3397  * IDL   long connections;
3398  * IDL   long shares;
3399  * IDL   long openfiles;
3400  * IDL   long sessopens;
3401  * IDL   long sessvcs;
3402  * IDL   long sessreqs;
3403  * IDL   long opensearch;
3404  * IDL   long activelocks;
3405  * IDL   long sizreqbufs
3406  * IDL   long numbigbufs
3407  * IDL   long numfiletasks;
3408  * IDL   long alertsched;
3409  * IDL   long erroralert;
3410  * IDL   long logonalert;
3411  * IDL   long accessalert;
3412  * IDL   long diskalert;
3413  * IDL   long netioalert;
3414  * IDL   long maxauditsz;
3415  * IDL   [string] [unique] wchar_t *srvheuristics;
3416  * IDL   long auditedevents;
3417  * IDL   long auditprofile;
3418  * IDL   [string] [unique] wchar_t *autopath;
3419  * IDL } SERVER_INFO_403;
3420  */
3421 static int
3422 srvsvc_dissect_SERVER_INFO_403(tvbuff_t *tvb, int offset,
3423                                    packet_info *pinfo, proto_tree *tree,
3424                                    char *drep)
3425 {
3426         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3427                         hf_srvsvc_ulist_mtime, NULL);
3428
3429         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3430                         hf_srvsvc_glist_mtime, NULL);
3431
3432         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3433                         hf_srvsvc_alist_mtime, NULL);
3434
3435         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3436                         NDR_POINTER_UNIQUE, "Alerts", hf_srvsvc_alerts, 0);
3437
3438         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3439                         hf_srvsvc_security, NULL);
3440
3441         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3442                         hf_srvsvc_numadmin, NULL);
3443
3444         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3445                         hf_srvsvc_lanmask, NULL);
3446
3447         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3448                         NDR_POINTER_UNIQUE, "Guest", hf_srvsvc_guest, 0);
3449
3450         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3451                         hf_srvsvc_chdevs, NULL);
3452
3453         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3454                         hf_srvsvc_chdevqs, NULL);
3455
3456         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3457                         hf_srvsvc_chdevjobs, NULL);
3458
3459         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3460                         hf_srvsvc_connections, NULL);
3461
3462         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3463                         hf_srvsvc_shares, NULL);
3464
3465         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3466                         hf_srvsvc_openfiles, NULL);
3467
3468         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3469                         hf_srvsvc_sessopens, NULL);
3470
3471         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3472                         hf_srvsvc_sessvcs, NULL);
3473
3474         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3475                         hf_srvsvc_sessreqs, NULL);
3476
3477         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3478                         hf_srvsvc_opensearch, NULL);
3479
3480         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3481                         hf_srvsvc_activelocks, NULL);
3482
3483         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3484                         hf_srvsvc_sizreqbufs, NULL);
3485
3486         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3487                         hf_srvsvc_numbigbufs, NULL);
3488
3489         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3490                         hf_srvsvc_numfiletasks, NULL);
3491
3492         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3493                         hf_srvsvc_alertsched, NULL);
3494
3495         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3496                         hf_srvsvc_erroralert, NULL);
3497
3498         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3499                         hf_srvsvc_logonalert, NULL);
3500
3501         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3502                         hf_srvsvc_accessalert, NULL);
3503
3504         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3505                         hf_srvsvc_diskalert, NULL);
3506
3507         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3508                         hf_srvsvc_netioalert, NULL);
3509
3510         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3511                         hf_srvsvc_maxauditsz, NULL);
3512
3513         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3514                         NDR_POINTER_UNIQUE, "Server Heuristics", 
3515                         hf_srvsvc_srvheuristics, 0);
3516
3517         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3518                         hf_srvsvc_auditedevents, NULL);
3519
3520         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3521                         hf_srvsvc_auditprofile, NULL);
3522
3523         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3524                         NDR_POINTER_UNIQUE, "Autopath", hf_srvsvc_autopath, 0);
3525
3526         return offset;
3527 }
3528
3529 /*
3530  * IDL typedef struct {
3531  * IDL   long sessopens;
3532  * IDL   long sessvcs;
3533  * IDL   long opensearch;
3534  * IDL   long sizreqbufs
3535  * IDL   long initworkitems;
3536  * IDL   long maxworkitems;
3537  * IDL   long rawworkitems;
3538  * IDL   long irpstacksize;
3539  * IDL   long maxrawbuflen;
3540  * IDL   long sessusers;
3541  * IDL   long sessconns;
3542  * IDL   long maxpagedmemoryusage;
3543  * IDL   long maxnonpagedmemoryusage;
3544  * IDL   long enablesoftcompat;
3545  * IDL   long enableforcedlogoff;
3546  * IDL   long timesource
3547  * IDL   long acceptdownlevelapis;
3548  * IDL   long lmannounce;
3549  * IDL } SERVER_INFO_502;
3550  */
3551 static int
3552 srvsvc_dissect_SERVER_INFO_502(tvbuff_t *tvb, int offset,
3553                                    packet_info *pinfo, proto_tree *tree,
3554                                    char *drep)
3555 {
3556         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3557                         hf_srvsvc_sessopens, NULL);
3558
3559         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3560                         hf_srvsvc_sessvcs, NULL);
3561
3562         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3563                         hf_srvsvc_opensearch, NULL);
3564
3565         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3566                         hf_srvsvc_sizreqbufs, NULL);
3567
3568         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3569                         hf_srvsvc_initworkitems, NULL);
3570
3571         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3572                         hf_srvsvc_maxworkitems, NULL);
3573
3574         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3575                         hf_srvsvc_rawworkitems, NULL);
3576
3577         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3578                         hf_srvsvc_irpstacksize, NULL);
3579
3580         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3581                         hf_srvsvc_maxrawbuflen, NULL);
3582
3583         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
3584                         hf_srvsvc_users, NULL);
3585
3586         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3587                         hf_srvsvc_connections, NULL);
3588
3589         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3590                         hf_srvsvc_maxpagedmemoryusage, NULL);
3591
3592         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3593                         hf_srvsvc_maxnonpagedmemoryusage, NULL);
3594
3595         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3596                         hf_srvsvc_enablesoftcompat, NULL);
3597
3598         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3599                         hf_srvsvc_enableforcedlogoff, NULL);
3600
3601         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3602                         hf_srvsvc_timesource, NULL);
3603
3604         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3605                         hf_srvsvc_acceptdownlevelapis, NULL);
3606
3607         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3608                         hf_srvsvc_lmannounce, NULL);
3609
3610         return offset;
3611 }
3612
3613 /*
3614  * IDL typedef struct {
3615  * IDL   long sessopens;
3616  * IDL   long sessvcs;
3617  * IDL   long opensearch;
3618  * IDL   long sizreqbufs
3619  * IDL   long initworkitems;
3620  * IDL   long maxworkitems;
3621  * IDL   long rawworkitems;
3622  * IDL   long irpstacksize;
3623  * IDL   long maxrawbuflen;
3624  * IDL   long sessusers;
3625  * IDL   long sessconns;
3626  * IDL   long maxpagedmemoryusage;
3627  * IDL   long maxnonpagedmemoryusage;
3628  * IDL   long enablesoftcompat;
3629  * IDL   long enableforcedlogoff;
3630  * IDL   long timesource
3631  * IDL   long acceptdownlevelapis;
3632  * IDL   long lmannounce;
3633  * IDL   [string] [unique] wchar_t *domain;
3634  * IDL   long maxcopyreadlen;
3635  * IDL   long maxcopywritelen;
3636  * IDL   long minkeepsearch;
3637  * IDL   long mankeepsearch;
3638  * IDL   long minkeepcomplsearch;
3639  * IDL   long mankeepcomplsearch;
3640  * IDL   long threadcountadd;
3641  * IDL   long numblockthreads;
3642  * IDL   long scavtimeout;
3643  * IDL   long minrcvqueue;
3644  * IDL   long minfreeworkitems;
3645  * IDL   long xactmemsize;
3646  * IDL   long threadpriority;
3647  * IDL   long maxmpxct;
3648  * IDL   long oplockbreakwait;
3649  * IDL   long oplockbreakresponsewait;
3650  * IDL   long enableoplocks;
3651  * IDL   long enableoplockforceclose
3652  * IDL   long enablefcbopens;
3653  * IDL   long enableraw;
3654  * IDL   long enablesharednetdrives;
3655  * IDL   long minfreeconnections;
3656  * IDL   long maxfreeconnections;
3657  * IDL } SERVER_INFO_503;
3658  */
3659 static int
3660 srvsvc_dissect_SERVER_INFO_503(tvbuff_t *tvb, int offset,
3661                                    packet_info *pinfo, proto_tree *tree,
3662                                    char *drep)
3663 {
3664         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3665                         hf_srvsvc_sessopens, NULL);
3666
3667         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3668                         hf_srvsvc_sessvcs, NULL);
3669
3670         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3671                         hf_srvsvc_opensearch, NULL);
3672
3673         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3674                         hf_srvsvc_sizreqbufs, NULL);
3675
3676         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3677                         hf_srvsvc_initworkitems, NULL);
3678
3679         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3680                         hf_srvsvc_maxworkitems, NULL);
3681
3682         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3683                         hf_srvsvc_rawworkitems, NULL);
3684
3685         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3686                         hf_srvsvc_irpstacksize, NULL);
3687
3688         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3689                         hf_srvsvc_maxrawbuflen, NULL);
3690
3691         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
3692                         hf_srvsvc_users, NULL);
3693
3694         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3695                         hf_srvsvc_connections, NULL);
3696
3697         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3698                         hf_srvsvc_maxpagedmemoryusage, NULL);
3699
3700         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3701                         hf_srvsvc_maxnonpagedmemoryusage, NULL);
3702
3703         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3704                         hf_srvsvc_enablesoftcompat, NULL);
3705
3706         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3707                         hf_srvsvc_enableforcedlogoff, NULL);
3708
3709         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3710                         hf_srvsvc_timesource, NULL);
3711
3712         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3713                         hf_srvsvc_acceptdownlevelapis, NULL);
3714
3715         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3716                         hf_srvsvc_lmannounce, NULL);
3717
3718         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3719                         NDR_POINTER_UNIQUE, "Domain", hf_srvsvc_domain, 0);
3720
3721         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3722                         hf_srvsvc_maxcopyreadlen, NULL);
3723
3724         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3725                         hf_srvsvc_maxcopywritelen, NULL);
3726
3727         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3728                         hf_srvsvc_minkeepsearch, NULL);
3729
3730         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3731                         hf_srvsvc_maxkeepsearch, NULL);
3732
3733         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3734                         hf_srvsvc_minkeepcomplsearch, NULL);
3735
3736         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3737                         hf_srvsvc_maxkeepcomplsearch, NULL);
3738
3739         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3740                         hf_srvsvc_threadcountadd, NULL);
3741
3742         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3743                         hf_srvsvc_numblockthreads, NULL);
3744
3745         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3746                         hf_srvsvc_scavtimeout, NULL);
3747
3748         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3749                         hf_srvsvc_minrcvqueue, NULL);
3750
3751         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3752                         hf_srvsvc_minfreeworkitems, NULL);
3753
3754         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3755                         hf_srvsvc_xactmemsize, NULL);
3756
3757         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3758                         hf_srvsvc_threadpriority, NULL);
3759
3760         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3761                         hf_srvsvc_maxmpxct, NULL);
3762
3763         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3764                         hf_srvsvc_oplockbreakwait, NULL);
3765
3766         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3767                         hf_srvsvc_oplockbreakresponsewait, NULL);
3768
3769         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3770                         hf_srvsvc_enableoplocks, NULL);
3771
3772         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3773                         hf_srvsvc_enableoplockforceclose, NULL);
3774
3775         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3776                         hf_srvsvc_enablefcbopens, NULL);
3777
3778         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3779                         hf_srvsvc_enableraw, NULL);
3780
3781         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3782                         hf_srvsvc_enablesharednetdrives, NULL);
3783
3784         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3785                         hf_srvsvc_minfreeconnections, NULL);
3786
3787         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3788                         hf_srvsvc_maxfreeconnections, NULL);
3789
3790         return offset;
3791 }
3792
3793
3794 /*
3795  * IDL typedef struct {
3796  * IDL   long sessopens;
3797  * IDL   long sessvcs;
3798  * IDL   long opensearch;
3799  * IDL   long sizreqbufs
3800  * IDL   long initworkitems;
3801  * IDL   long maxworkitems;
3802  * IDL   long rawworkitems;
3803  * IDL   long irpstacksize;
3804  * IDL   long maxrawbuflen;
3805  * IDL   long sessusers;
3806  * IDL   long sessconns;
3807  * IDL   long maxpagedmemoryusage;
3808  * IDL   long maxnonpagedmemoryusage;
3809  * IDL   long enablesoftcompat;
3810  * IDL   long enableforcedlogoff;
3811  * IDL   long timesource
3812  * IDL   long acceptdownlevelapis;
3813  * IDL   long lmannounce;
3814  * IDL   [string] [unique] wchar_t *domain;
3815  * IDL   long maxcopyreadlen;
3816  * IDL   long maxcopywritelen;
3817  * IDL   long minkeepsearch;
3818  * IDL   long mankeepsearch;
3819  * IDL   long minkeepcomplsearch;
3820  * IDL   long mankeepcomplsearch;
3821  * IDL   long threadcountadd;
3822  * IDL   long numblockthreads;
3823  * IDL   long scavtimeout;
3824  * IDL   long minrcvqueue;
3825  * IDL   long minfreeworkitems;
3826  * IDL   long xactmemsize;
3827  * IDL   long threadpriority;
3828  * IDL   long maxmpxct;
3829  * IDL   long oplockbreakwait;
3830  * IDL   long oplockbreakresponsewait;
3831  * IDL   long enableoplocks;
3832  * IDL   long enableoplockforceclose
3833  * IDL   long enablefcbopens;
3834  * IDL   long enableraw;
3835  * IDL   long enablesharednetdrives;
3836  * IDL   long minfreeconnections;
3837  * IDL   long maxfreeconnections;
3838  * IDL   long initsesstable;
3839  * IDL   long initconntable;
3840  * IDL   long initfiletable;
3841  * IDL   long initsearchtable;
3842  * IDL   long alertsched;
3843  * IDL   long errortreshold;
3844  * IDL   long networkerrortreshold;
3845  * IDL   long diskspacetreshold;
3846  * IDL   long reserved;
3847  * IDL   long maxlinkdelay;
3848  * IDL   long minlinkthroughput;
3849  * IDL   long linkinfovalidtime;
3850  * IDL   long scavqosinfoupdatetime;
3851  * IDL   long maxworkitemidletime;
3852  * IDL } SERVER_INFO_599;
3853  */
3854 static int
3855 srvsvc_dissect_SERVER_INFO_599(tvbuff_t *tvb, int offset,
3856                                    packet_info *pinfo, proto_tree *tree,
3857                                    char *drep)
3858 {
3859         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3860                         hf_srvsvc_sessopens, NULL);
3861
3862         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3863                         hf_srvsvc_sessvcs, NULL);
3864
3865         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3866                         hf_srvsvc_opensearch, NULL);
3867
3868         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3869                         hf_srvsvc_sizreqbufs, NULL);
3870
3871         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3872                         hf_srvsvc_initworkitems, NULL);
3873
3874         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3875                         hf_srvsvc_maxworkitems, NULL);
3876
3877         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3878                         hf_srvsvc_rawworkitems, NULL);
3879
3880         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3881                         hf_srvsvc_irpstacksize, NULL);
3882
3883         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3884                         hf_srvsvc_maxrawbuflen, NULL);
3885
3886         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
3887                         hf_srvsvc_users, NULL);
3888
3889         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3890                         hf_srvsvc_connections, NULL);
3891
3892         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3893                         hf_srvsvc_maxpagedmemoryusage, NULL);
3894
3895         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3896                         hf_srvsvc_maxnonpagedmemoryusage, NULL);
3897
3898         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3899                         hf_srvsvc_enablesoftcompat, NULL);
3900
3901         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3902                         hf_srvsvc_enableforcedlogoff, NULL);
3903
3904         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3905                         hf_srvsvc_timesource, NULL);
3906
3907         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3908                         hf_srvsvc_acceptdownlevelapis, NULL);
3909
3910         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3911                         hf_srvsvc_lmannounce, NULL);
3912
3913         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
3914                         NDR_POINTER_UNIQUE, "Domain", hf_srvsvc_domain, 0);
3915
3916         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3917                         hf_srvsvc_maxcopyreadlen, NULL);
3918
3919         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3920                         hf_srvsvc_maxcopywritelen, NULL);
3921
3922         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3923                         hf_srvsvc_minkeepsearch, NULL);
3924
3925         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3926                         hf_srvsvc_maxkeepsearch, NULL);
3927
3928         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3929                         hf_srvsvc_minkeepcomplsearch, NULL);
3930
3931         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3932                         hf_srvsvc_maxkeepcomplsearch, NULL);
3933
3934         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3935                         hf_srvsvc_threadcountadd, NULL);
3936
3937         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3938                         hf_srvsvc_numblockthreads, NULL);
3939
3940         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3941                         hf_srvsvc_scavtimeout, NULL);
3942
3943         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3944                         hf_srvsvc_minrcvqueue, NULL);
3945
3946         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3947                         hf_srvsvc_minfreeworkitems, NULL);
3948
3949         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3950                         hf_srvsvc_xactmemsize, NULL);
3951
3952         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3953                         hf_srvsvc_threadpriority, NULL);
3954
3955         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3956                         hf_srvsvc_maxmpxct, NULL);
3957
3958         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3959                         hf_srvsvc_oplockbreakwait, NULL);
3960
3961         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3962                         hf_srvsvc_oplockbreakresponsewait, NULL);
3963
3964         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3965                         hf_srvsvc_enableoplocks, NULL);
3966
3967         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3968                         hf_srvsvc_enableoplockforceclose, NULL);
3969
3970         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3971                         hf_srvsvc_enablefcbopens, NULL);
3972
3973         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3974                         hf_srvsvc_enableraw, NULL);
3975
3976         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3977                         hf_srvsvc_enablesharednetdrives, NULL);
3978
3979         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3980                         hf_srvsvc_minfreeconnections, NULL);
3981
3982         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3983                         hf_srvsvc_maxfreeconnections, NULL);
3984
3985         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3986                         hf_srvsvc_initsesstable, NULL);
3987
3988         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3989                         hf_srvsvc_initconntable, NULL);
3990
3991         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3992                         hf_srvsvc_initfiletable, NULL);
3993
3994         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3995                         hf_srvsvc_initsearchtable, NULL);
3996
3997         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
3998                         hf_srvsvc_alertsched, NULL);
3999
4000         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4001                         hf_srvsvc_errortreshold, NULL);
4002
4003         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4004                         hf_srvsvc_networkerrortreshold, NULL);
4005
4006         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4007                         hf_srvsvc_diskspacetreshold, NULL);
4008
4009         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4010                         hf_srvsvc_reserved, NULL);
4011
4012         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4013                         hf_srvsvc_reserved, NULL);
4014
4015         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4016                         hf_srvsvc_maxlinkdelay, NULL);
4017
4018         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4019                         hf_srvsvc_minlinkthroughput, NULL);
4020
4021         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4022                         hf_srvsvc_linkinfovalidtime, NULL);
4023
4024         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4025                         hf_srvsvc_scavqosinfoupdatetime, NULL);
4026
4027         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4028                         hf_srvsvc_maxworkitemidletime, NULL);
4029
4030         return offset;
4031 }
4032
4033 /*
4034  * IDL typedef struct {
4035  * IDL   [string] [unique] wchar_t *comment;
4036  * IDL } SERVER_INFO_1005;
4037  */
4038 static int
4039 srvsvc_dissect_SERVER_INFO_1005(tvbuff_t *tvb, int offset,
4040                                    packet_info *pinfo, proto_tree *tree,
4041                                    char *drep)
4042 {
4043         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
4044                         NDR_POINTER_UNIQUE, "Comment", hf_srvsvc_comment, 0);
4045
4046         return offset;
4047 }
4048
4049 /*
4050  * IDL typedef struct {
4051  * IDL   long disc;
4052  * IDL } SERVER_INFO_1010;
4053  */
4054 static int
4055 srvsvc_dissect_SERVER_INFO_1010(tvbuff_t *tvb, int offset,
4056                                    packet_info *pinfo, proto_tree *tree,
4057                                    char *drep)
4058 {
4059         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4060                         hf_srvsvc_disc, NULL);
4061
4062         return offset;
4063 }
4064
4065 /*
4066  * IDL typedef struct {
4067  * IDL   long hidden;
4068  * IDL } SERVER_INFO_1016;
4069  */
4070 static int
4071 srvsvc_dissect_SERVER_INFO_1016(tvbuff_t *tvb, int offset,
4072                                    packet_info *pinfo, proto_tree *tree,
4073                                    char *drep)
4074 {
4075         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4076                         hf_srvsvc_hidden, NULL);
4077
4078         return offset;
4079 }
4080
4081 /*
4082  * IDL typedef struct {
4083  * IDL   long announce;
4084  * IDL } SERVER_INFO_1017;
4085  */
4086 static int
4087 srvsvc_dissect_SERVER_INFO_1017(tvbuff_t *tvb, int offset,
4088                                    packet_info *pinfo, proto_tree *tree,
4089                                    char *drep)
4090 {
4091         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4092                         hf_srvsvc_announce, NULL);
4093
4094         return offset;
4095 }
4096
4097 /*
4098  * IDL typedef struct {
4099  * IDL   long anndelta;
4100  * IDL } SERVER_INFO_1018;
4101  */
4102 static int
4103 srvsvc_dissect_SERVER_INFO_1018(tvbuff_t *tvb, int offset,
4104                                    packet_info *pinfo, proto_tree *tree,
4105                                    char *drep)
4106 {
4107         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4108                         hf_srvsvc_anndelta, NULL);
4109
4110         return offset;
4111 }
4112
4113 /*
4114  * IDL typedef struct {
4115  * IDL   long users;
4116  * IDL } SERVER_INFO_1107;
4117  */
4118 static int
4119 srvsvc_dissect_SERVER_INFO_1107(tvbuff_t *tvb, int offset,
4120                                    packet_info *pinfo, proto_tree *tree,
4121                                    char *drep)
4122 {
4123         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4124                         hf_srvsvc_users, NULL);
4125
4126         return offset;
4127 }
4128
4129 /*
4130  * IDL typedef struct {
4131  * IDL   long sessopens;
4132  * IDL } SERVER_INFO_1501;
4133  */
4134 static int
4135 srvsvc_dissect_SERVER_INFO_1501(tvbuff_t *tvb, int offset,
4136                                    packet_info *pinfo, proto_tree *tree,
4137                                    char *drep)
4138 {
4139         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4140                         hf_srvsvc_sessopens, NULL);
4141
4142         return offset;
4143 }
4144
4145 /*
4146  * IDL typedef struct {
4147  * IDL   long sessvcs;
4148  * IDL } SERVER_INFO_1502;
4149  */
4150 static int
4151 srvsvc_dissect_SERVER_INFO_1502(tvbuff_t *tvb, int offset,
4152                                    packet_info *pinfo, proto_tree *tree,
4153                                    char *drep)
4154 {
4155         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4156                         hf_srvsvc_sessvcs, NULL);
4157
4158         return offset;
4159 }
4160
4161 /*
4162  * IDL typedef struct {
4163  * IDL   long opensearch;
4164  * IDL } SERVER_INFO_1503;
4165  */
4166 static int
4167 srvsvc_dissect_SERVER_INFO_1503(tvbuff_t *tvb, int offset,
4168                                    packet_info *pinfo, proto_tree *tree,
4169                                    char *drep)
4170 {
4171         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4172                         hf_srvsvc_opensearch, NULL);
4173
4174         return offset;
4175 }
4176
4177 /*
4178  * IDL typedef struct {
4179  * IDL   long maxworkitems;
4180  * IDL } SERVER_INFO_1506;
4181  */
4182 static int
4183 srvsvc_dissect_SERVER_INFO_1506(tvbuff_t *tvb, int offset,
4184                                    packet_info *pinfo, proto_tree *tree,
4185                                    char *drep)
4186 {
4187         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4188                         hf_srvsvc_maxworkitems, NULL);
4189
4190         return offset;
4191 }
4192
4193 /*
4194  * IDL typedef struct {
4195  * IDL   long maxrawbuflen;
4196  * IDL } SERVER_INFO_1509;
4197  */
4198 static int
4199 srvsvc_dissect_SERVER_INFO_1509(tvbuff_t *tvb, int offset,
4200                                    packet_info *pinfo, proto_tree *tree,
4201                                    char *drep)
4202 {
4203         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4204                         hf_srvsvc_maxrawbuflen, NULL);
4205
4206         return offset;
4207 }
4208
4209 /*
4210  * IDL typedef struct {
4211  * IDL   long sessusers;
4212  * IDL } SERVER_INFO_1510;
4213  */
4214 static int
4215 srvsvc_dissect_SERVER_INFO_1510(tvbuff_t *tvb, int offset,
4216                                    packet_info *pinfo, proto_tree *tree,
4217                                    char *drep)
4218 {
4219         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
4220                         hf_srvsvc_users, NULL);
4221
4222         return offset;
4223 }
4224
4225 /*
4226  * IDL typedef struct {
4227  * IDL   long sessconns;
4228  * IDL } SERVER_INFO_1511;
4229  */
4230 static int
4231 srvsvc_dissect_SERVER_INFO_1511(tvbuff_t *tvb, int offset,
4232                                    packet_info *pinfo, proto_tree *tree,
4233                                    char *drep)
4234 {
4235         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4236                         hf_srvsvc_connections, NULL);
4237
4238         return offset;
4239 }
4240
4241 /*
4242  * IDL typedef struct {
4243  * IDL   long maxnonpagedmemoryusage;
4244  * IDL } SERVER_INFO_1512;
4245  */
4246 static int
4247 srvsvc_dissect_SERVER_INFO_1512(tvbuff_t *tvb, int offset,
4248                                    packet_info *pinfo, proto_tree *tree,
4249                                    char *drep)
4250 {
4251         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4252                         hf_srvsvc_maxnonpagedmemoryusage, NULL);
4253
4254         return offset;
4255 }
4256
4257 /*
4258  * IDL typedef struct {
4259  * IDL   long maxpagedmemoryusage;
4260  * IDL } SERVER_INFO_1513;
4261  */
4262 static int
4263 srvsvc_dissect_SERVER_INFO_1513(tvbuff_t *tvb, int offset,
4264                                    packet_info *pinfo, proto_tree *tree,
4265                                    char *drep)
4266 {
4267         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4268                         hf_srvsvc_maxpagedmemoryusage, NULL);
4269
4270         return offset;
4271 }
4272
4273 /*
4274  * IDL typedef struct {
4275  * IDL   long enablesoftcompat;
4276  * IDL } SERVER_INFO_1514;
4277  */
4278 static int
4279 srvsvc_dissect_SERVER_INFO_1514(tvbuff_t *tvb, int offset,
4280                                    packet_info *pinfo, proto_tree *tree,
4281                                    char *drep)
4282 {
4283         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4284                         hf_srvsvc_enablesoftcompat, NULL);
4285
4286         return offset;
4287 }
4288
4289 /*
4290  * IDL typedef struct {
4291  * IDL   long enableforcedlogoff;
4292  * IDL } SERVER_INFO_1515;
4293  */
4294 static int
4295 srvsvc_dissect_SERVER_INFO_1515(tvbuff_t *tvb, int offset,
4296                                    packet_info *pinfo, proto_tree *tree,
4297                                    char *drep)
4298 {
4299         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4300                         hf_srvsvc_enableforcedlogoff, NULL);
4301
4302         return offset;
4303 }
4304
4305 /*
4306  * IDL typedef struct {
4307  * IDL   long timesource;
4308  * IDL } SERVER_INFO_1516;
4309  */
4310 static int
4311 srvsvc_dissect_SERVER_INFO_1516(tvbuff_t *tvb, int offset,
4312                                    packet_info *pinfo, proto_tree *tree,
4313                                    char *drep)
4314 {
4315         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4316                         hf_srvsvc_timesource, NULL);
4317
4318         return offset;
4319 }
4320
4321 /*
4322  * IDL typedef struct {
4323  * IDL   long lmannounce;
4324  * IDL } SERVER_INFO_1518;
4325  */
4326 static int
4327 srvsvc_dissect_SERVER_INFO_1518(tvbuff_t *tvb, int offset,
4328                                    packet_info *pinfo, proto_tree *tree,
4329                                    char *drep)
4330 {
4331         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4332                         hf_srvsvc_lmannounce, NULL);
4333
4334         return offset;
4335 }
4336
4337 /*
4338  * IDL typedef struct {
4339  * IDL   long maxcopyreadlen;
4340  * IDL } SERVER_INFO_1520;
4341  */
4342 static int
4343 srvsvc_dissect_SERVER_INFO_1520(tvbuff_t *tvb, int offset,
4344                                    packet_info *pinfo, proto_tree *tree,
4345                                    char *drep)
4346 {
4347         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4348                         hf_srvsvc_maxcopyreadlen, NULL);
4349
4350         return offset;
4351 }
4352
4353 /*
4354  * IDL typedef struct {
4355  * IDL   long maxcopywritelen;
4356  * IDL } SERVER_INFO_1521;
4357  */
4358 static int
4359 srvsvc_dissect_SERVER_INFO_1521(tvbuff_t *tvb, int offset,
4360                                    packet_info *pinfo, proto_tree *tree,
4361                                    char *drep)
4362 {
4363         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4364                         hf_srvsvc_maxcopywritelen, NULL);
4365
4366         return offset;
4367 }
4368
4369 /*
4370  * IDL typedef struct {
4371  * IDL   long minkeepsearch;
4372  * IDL } SERVER_INFO_1522;
4373  */
4374 static int
4375 srvsvc_dissect_SERVER_INFO_1522(tvbuff_t *tvb, int offset,
4376                                    packet_info *pinfo, proto_tree *tree,
4377                                    char *drep)
4378 {
4379         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4380                         hf_srvsvc_minkeepsearch, NULL);
4381
4382         return offset;
4383 }
4384
4385 /*
4386  * IDL typedef struct {
4387  * IDL   long maxkeepsearch;
4388  * IDL } SERVER_INFO_1523;
4389  */
4390 static int
4391 srvsvc_dissect_SERVER_INFO_1523(tvbuff_t *tvb, int offset,
4392                                    packet_info *pinfo, proto_tree *tree,
4393                                    char *drep)
4394 {
4395         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4396                         hf_srvsvc_maxkeepsearch, NULL);
4397
4398         return offset;
4399 }
4400
4401 /*
4402  * IDL typedef struct {
4403  * IDL   long minkeepcomplsearch;
4404  * IDL } SERVER_INFO_1524;
4405  */
4406 static int
4407 srvsvc_dissect_SERVER_INFO_1524(tvbuff_t *tvb, int offset,
4408                                    packet_info *pinfo, proto_tree *tree,
4409                                    char *drep)
4410 {
4411         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4412                         hf_srvsvc_minkeepcomplsearch, NULL);
4413
4414         return offset;
4415 }
4416
4417 /*
4418  * IDL typedef struct {
4419  * IDL   long maxkeepcomplsearch;
4420  * IDL } SERVER_INFO_1525;
4421  */
4422 static int
4423 srvsvc_dissect_SERVER_INFO_1525(tvbuff_t *tvb, int offset,
4424                                    packet_info *pinfo, proto_tree *tree,
4425                                    char *drep)
4426 {
4427         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4428                         hf_srvsvc_maxkeepcomplsearch, NULL);
4429
4430         return offset;
4431 }
4432
4433 /*
4434  * IDL typedef struct {
4435  * IDL   long scavtimeout;
4436  * IDL } SERVER_INFO_1528;
4437  */
4438 static int
4439 srvsvc_dissect_SERVER_INFO_1528(tvbuff_t *tvb, int offset,
4440                                    packet_info *pinfo, proto_tree *tree,
4441                                    char *drep)
4442 {
4443         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4444                         hf_srvsvc_scavtimeout, NULL);
4445
4446         return offset;
4447 }
4448
4449 /*
4450  * IDL typedef struct {
4451  * IDL   long minrcvqueue;
4452  * IDL } SERVER_INFO_1529;
4453  */
4454 static int
4455 srvsvc_dissect_SERVER_INFO_1529(tvbuff_t *tvb, int offset,
4456                                    packet_info *pinfo, proto_tree *tree,
4457                                    char *drep)
4458 {
4459         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4460                         hf_srvsvc_minrcvqueue, NULL);
4461
4462         return offset;
4463 }
4464
4465 /*
4466  * IDL typedef struct {
4467  * IDL   long minfreeworkitems;
4468  * IDL } SERVER_INFO_1530;
4469  */
4470 static int
4471 srvsvc_dissect_SERVER_INFO_1530(tvbuff_t *tvb, int offset,
4472                                    packet_info *pinfo, proto_tree *tree,
4473                                    char *drep)
4474 {
4475         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4476                         hf_srvsvc_minfreeworkitems, NULL);
4477
4478         return offset;
4479 }
4480
4481 /*
4482  * IDL typedef struct {
4483  * IDL   long maxmpxct;
4484  * IDL } SERVER_INFO_1533;
4485  */
4486 static int
4487 srvsvc_dissect_SERVER_INFO_1533(tvbuff_t *tvb, int offset,
4488                                    packet_info *pinfo, proto_tree *tree,
4489                                    char *drep)
4490 {
4491         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4492                         hf_srvsvc_maxmpxct, NULL);
4493
4494         return offset;
4495 }
4496
4497 /*
4498  * IDL typedef struct {
4499  * IDL   long oplockbreakwait;
4500  * IDL } SERVER_INFO_1534;
4501  */
4502 static int
4503 srvsvc_dissect_SERVER_INFO_1534(tvbuff_t *tvb, int offset,
4504                                    packet_info *pinfo, proto_tree *tree,
4505                                    char *drep)
4506 {
4507         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4508                         hf_srvsvc_oplockbreakwait, NULL);
4509
4510         return offset;
4511 }
4512
4513 /*
4514  * IDL typedef struct {
4515  * IDL   long oplockbreakresponsewait;
4516  * IDL } SERVER_INFO_1535;
4517  */
4518 static int
4519 srvsvc_dissect_SERVER_INFO_1535(tvbuff_t *tvb, int offset,
4520                                    packet_info *pinfo, proto_tree *tree,
4521                                    char *drep)
4522 {
4523         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4524                         hf_srvsvc_oplockbreakresponsewait, NULL);
4525
4526         return offset;
4527 }
4528
4529 /*
4530  * IDL typedef struct {
4531  * IDL   long enableoplocks;
4532  * IDL } SERVER_INFO_1536;
4533  */
4534 static int
4535 srvsvc_dissect_SERVER_INFO_1536(tvbuff_t *tvb, int offset,
4536                                    packet_info *pinfo, proto_tree *tree,
4537                                    char *drep)
4538 {
4539         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4540                         hf_srvsvc_enableoplocks, NULL);
4541
4542         return offset;
4543 }
4544
4545 /*
4546  * IDL typedef struct {
4547  * IDL   long enableoplockforceclose;
4548  * IDL } SERVER_INFO_1537;
4549  */
4550 static int
4551 srvsvc_dissect_SERVER_INFO_1537(tvbuff_t *tvb, int offset,
4552                                    packet_info *pinfo, proto_tree *tree,
4553                                    char *drep)
4554 {
4555         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4556                         hf_srvsvc_enableoplockforceclose, NULL);
4557
4558         return offset;
4559 }
4560
4561 /*
4562  * IDL typedef struct {
4563  * IDL   long enablefcbopens;
4564  * IDL } SERVER_INFO_1538;
4565  */
4566 static int
4567 srvsvc_dissect_SERVER_INFO_1538(tvbuff_t *tvb, int offset,
4568                                    packet_info *pinfo, proto_tree *tree,
4569                                    char *drep)
4570 {
4571         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4572                         hf_srvsvc_enablefcbopens, NULL);
4573
4574         return offset;
4575 }
4576
4577 /*
4578  * IDL typedef struct {
4579  * IDL   long enableraw;
4580  * IDL } SERVER_INFO_1539;
4581  */
4582 static int
4583 srvsvc_dissect_SERVER_INFO_1539(tvbuff_t *tvb, int offset,
4584                                    packet_info *pinfo, proto_tree *tree,
4585                                    char *drep)
4586 {
4587         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4588                         hf_srvsvc_enableraw, NULL);
4589
4590         return offset;
4591 }
4592
4593 /*
4594  * IDL typedef struct {
4595  * IDL   long enablesharednetdrives;
4596  * IDL } SERVER_INFO_1540;
4597  */
4598 static int
4599 srvsvc_dissect_SERVER_INFO_1540(tvbuff_t *tvb, int offset,
4600                                    packet_info *pinfo, proto_tree *tree,
4601                                    char *drep)
4602 {
4603         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4604                         hf_srvsvc_enablesharednetdrives, NULL);
4605
4606         return offset;
4607 }
4608
4609 /*
4610  * IDL typedef struct {
4611  * IDL   long minfreeconnections;
4612  * IDL } SERVER_INFO_1541;
4613  */
4614 static int
4615 srvsvc_dissect_SERVER_INFO_1541(tvbuff_t *tvb, int offset,
4616                                    packet_info *pinfo, proto_tree *tree,
4617                                    char *drep)
4618 {
4619         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4620                         hf_srvsvc_minfreeconnections, NULL);
4621
4622         return offset;
4623 }
4624
4625 /*
4626  * IDL typedef struct {
4627  * IDL   long maxfreeconnections;
4628  * IDL } SERVER_INFO_1542;
4629  */
4630 static int
4631 srvsvc_dissect_SERVER_INFO_1542(tvbuff_t *tvb, int offset,
4632                                    packet_info *pinfo, proto_tree *tree,
4633                                    char *drep)
4634 {
4635         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4636                         hf_srvsvc_maxfreeconnections, NULL);
4637
4638         return offset;
4639 }
4640
4641 /*
4642  * IDL typedef struct {
4643  * IDL   long initsesstable;
4644  * IDL } SERVER_INFO_1543;
4645  */
4646 static int
4647 srvsvc_dissect_SERVER_INFO_1543(tvbuff_t *tvb, int offset,
4648                                    packet_info *pinfo, proto_tree *tree,
4649                                    char *drep)
4650 {
4651         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4652                         hf_srvsvc_initsesstable, NULL);
4653
4654         return offset;
4655 }
4656
4657 /*
4658  * IDL typedef struct {
4659  * IDL   long initconntable;
4660  * IDL } SERVER_INFO_1544;
4661  */
4662 static int
4663 srvsvc_dissect_SERVER_INFO_1544(tvbuff_t *tvb, int offset,
4664                                    packet_info *pinfo, proto_tree *tree,
4665                                    char *drep)
4666 {
4667         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4668                         hf_srvsvc_initconntable, NULL);
4669
4670         return offset;
4671 }
4672
4673 /*
4674  * IDL typedef struct {
4675  * IDL   long initfiletable;
4676  * IDL } SERVER_INFO_1545;
4677  */
4678 static int
4679 srvsvc_dissect_SERVER_INFO_1545(tvbuff_t *tvb, int offset,
4680                                    packet_info *pinfo, proto_tree *tree,
4681                                    char *drep)
4682 {
4683         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4684                         hf_srvsvc_initfiletable, NULL);
4685
4686         return offset;
4687 }
4688
4689 /*
4690  * IDL typedef struct {
4691  * IDL   long initsearchtable;
4692  * IDL } SERVER_INFO_1546;
4693  */
4694 static int
4695 srvsvc_dissect_SERVER_INFO_1546(tvbuff_t *tvb, int offset,
4696                                    packet_info *pinfo, proto_tree *tree,
4697                                    char *drep)
4698 {
4699         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4700                         hf_srvsvc_initsearchtable, NULL);
4701
4702         return offset;
4703 }
4704
4705 /*
4706  * IDL typedef struct {
4707  * IDL   long alertsched;
4708  * IDL } SERVER_INFO_1547;
4709  */
4710 static int
4711 srvsvc_dissect_SERVER_INFO_1547(tvbuff_t *tvb, int offset,
4712                                    packet_info *pinfo, proto_tree *tree,
4713                                    char *drep)
4714 {
4715         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4716                         hf_srvsvc_alertsched, NULL);
4717
4718         return offset;
4719 }
4720
4721 /*
4722  * IDL typedef struct {
4723  * IDL   long errortreshold;
4724  * IDL } SERVER_INFO_1548;
4725  */
4726 static int
4727 srvsvc_dissect_SERVER_INFO_1548(tvbuff_t *tvb, int offset,
4728                                    packet_info *pinfo, proto_tree *tree,
4729                                    char *drep)
4730 {
4731         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4732                         hf_srvsvc_errortreshold, NULL);
4733
4734         return offset;
4735 }
4736
4737 /*
4738  * IDL typedef struct {
4739  * IDL   long networkerrortreshold;
4740  * IDL } SERVER_INFO_1549;
4741  */
4742 static int
4743 srvsvc_dissect_SERVER_INFO_1549(tvbuff_t *tvb, int offset,
4744                                    packet_info *pinfo, proto_tree *tree,
4745                                    char *drep)
4746 {
4747         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4748                         hf_srvsvc_networkerrortreshold, NULL);
4749
4750         return offset;
4751 }
4752
4753 /*
4754  * IDL typedef struct {
4755  * IDL   long diskspacetreshold;
4756  * IDL } SERVER_INFO_1550;
4757  */
4758 static int
4759 srvsvc_dissect_SERVER_INFO_1550(tvbuff_t *tvb, int offset,
4760                                    packet_info *pinfo, proto_tree *tree,
4761                                    char *drep)
4762 {
4763         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4764                         hf_srvsvc_diskspacetreshold, NULL);
4765
4766         return offset;
4767 }
4768
4769 /*
4770  * IDL typedef struct {
4771  * IDL   long maxlinkdelay;
4772  * IDL } SERVER_INFO_1552;
4773  */
4774 static int
4775 srvsvc_dissect_SERVER_INFO_1552(tvbuff_t *tvb, int offset,
4776                                    packet_info *pinfo, proto_tree *tree,
4777                                    char *drep)
4778 {
4779         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4780                         hf_srvsvc_maxlinkdelay, NULL);
4781
4782         return offset;
4783 }
4784
4785 /*
4786  * IDL typedef struct {
4787  * IDL   long minlinkthroughput;
4788  * IDL } SERVER_INFO_1553;
4789  */
4790 static int
4791 srvsvc_dissect_SERVER_INFO_1553(tvbuff_t *tvb, int offset,
4792                                    packet_info *pinfo, proto_tree *tree,
4793                                    char *drep)
4794 {
4795         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4796                         hf_srvsvc_minlinkthroughput, NULL);
4797
4798         return offset;
4799 }
4800
4801 /*
4802  * IDL typedef struct {
4803  * IDL   long linkinfovalidtime;
4804  * IDL } SERVER_INFO_1554;
4805  */
4806 static int
4807 srvsvc_dissect_SERVER_INFO_1554(tvbuff_t *tvb, int offset,
4808                                    packet_info *pinfo, proto_tree *tree,
4809                                    char *drep)
4810 {
4811         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4812                         hf_srvsvc_linkinfovalidtime, NULL);
4813
4814         return offset;
4815 }
4816
4817 /*
4818  * IDL typedef struct {
4819  * IDL   long scavqosinfoupdatetime;
4820  * IDL } SERVER_INFO_1555;
4821  */
4822 static int
4823 srvsvc_dissect_SERVER_INFO_1555(tvbuff_t *tvb, int offset,
4824                                    packet_info *pinfo, proto_tree *tree,
4825                                    char *drep)
4826 {
4827         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4828                         hf_srvsvc_scavqosinfoupdatetime, NULL);
4829
4830         return offset;
4831 }
4832
4833 /*
4834  * IDL typedef struct {
4835  * IDL   long maxworkitemidletime;
4836  * IDL } SERVER_INFO_1556;
4837  */
4838 static int
4839 srvsvc_dissect_SERVER_INFO_1556(tvbuff_t *tvb, int offset,
4840                                    packet_info *pinfo, proto_tree *tree,
4841                                    char *drep)
4842 {
4843         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
4844                         hf_srvsvc_maxworkitemidletime, NULL);
4845
4846         return offset;
4847 }
4848
4849 /*
4850  * IDL typedef [switch_type(long)] union {
4851  * IDL   [case(100)] [unique] SERVER_INFO_100 *srv100;
4852  * IDL   [case(101)] [unique] SERVER_INFO_101 *srv101;
4853  * IDL   [case(102)] [unique] SERVER_INFO_102 *srv102;
4854  * IDL   [case(402)] [unique] SERVER_INFO_402 *srv402;
4855  * IDL   [case(403)] [unique] SERVER_INFO_403 *srv403;
4856  * IDL   [case(502)] [unique] SERVER_INFO_502 *srv502;
4857  * IDL   [case(503)] [unique] SERVER_INFO_503 *srv503;
4858  * IDL   [case(599)] [unique] SERVER_INFO_599 *srv599;
4859  * IDL   [case(1005)] [unique] SERVER_INFO_1005 *srv1005;
4860  * IDL   [case(1010)] [unique] SERVER_INFO_1010 *srv1010;
4861  * IDL   [case(1016)] [unique] SERVER_INFO_1016 *srv1016;
4862  * IDL   [case(1017)] [unique] SERVER_INFO_1017 *srv1017;
4863  * IDL   [case(1018)] [unique] SERVER_INFO_1018 *srv1018;
4864  * IDL   [case(1107)] [unique] SERVER_INFO_1107 *srv1107;
4865  * IDL   [case(1501)] [unique] SERVER_INFO_1501 *srv1501;
4866  * IDL   [case(1502)] [unique] SERVER_INFO_1502 *srv1502;
4867  * IDL   [case(1503)] [unique] SERVER_INFO_1503 *srv1503;
4868  * IDL   [case(1506)] [unique] SERVER_INFO_1506 *srv1506;
4869  * IDL   [case(1509)] [unique] SERVER_INFO_1509 *srv1509;
4870  * IDL   [case(1510)] [unique] SERVER_INFO_1510 *srv1510;
4871  * IDL   [case(1511)] [unique] SERVER_INFO_1511 *srv1511;
4872  * IDL   [case(1512)] [unique] SERVER_INFO_1512 *srv1512;
4873  * IDL   [case(1513)] [unique] SERVER_INFO_1513 *srv1513;
4874  * IDL   [case(1514)] [unique] SERVER_INFO_1514 *srv1514;
4875  * IDL   [case(1515)] [unique] SERVER_INFO_1515 *srv1515;
4876  * IDL   [case(1516)] [unique] SERVER_INFO_1516 *srv1516;
4877  * IDL   [case(1518)] [unique] SERVER_INFO_1518 *srv1518;
4878  * IDL   [case(1520)] [unique] SERVER_INFO_1520 *srv1520;
4879  * IDL   [case(1521)] [unique] SERVER_INFO_1521 *srv1521;
4880  * IDL   [case(1522)] [unique] SERVER_INFO_1522 *srv1522;
4881  * IDL   [case(1523)] [unique] SERVER_INFO_1523 *srv1523;
4882  * IDL   [case(1524)] [unique] SERVER_INFO_1524 *srv1524;
4883  * IDL   [case(1525)] [unique] SERVER_INFO_1525 *srv1525;
4884  * IDL   [case(1528)] [unique] SERVER_INFO_1528 *srv1528;
4885  * IDL   [case(1529)] [unique] SERVER_INFO_1529 *srv1529;
4886  * IDL   [case(1530)] [unique] SERVER_INFO_1530 *srv1530;
4887  * IDL   [case(1533)] [unique] SERVER_INFO_1533 *srv1533;
4888  * IDL   [case(1534)] [unique] SERVER_INFO_1534 *srv1534;
4889  * IDL   [case(1535)] [unique] SERVER_INFO_1535 *srv1535;
4890  * IDL   [case(1536)] [unique] SERVER_INFO_1536 *srv1536;
4891  * IDL   [case(1537)] [unique] SERVER_INFO_1537 *srv1537;
4892  * IDL   [case(1538)] [unique] SERVER_INFO_1538 *srv1538;
4893  * IDL   [case(1539)] [unique] SERVER_INFO_1539 *srv1539;
4894  * IDL   [case(1540)] [unique] SERVER_INFO_1540 *srv1540;
4895  * IDL   [case(1541)] [unique] SERVER_INFO_1541 *srv1541;
4896  * IDL   [case(1542)] [unique] SERVER_INFO_1542 *srv1542;
4897  * IDL   [case(1543)] [unique] SERVER_INFO_1543 *srv1543;
4898  * IDL   [case(1544)] [unique] SERVER_INFO_1544 *srv1544;
4899  * IDL   [case(1545)] [unique] SERVER_INFO_1545 *srv1545;
4900  * IDL   [case(1546)] [unique] SERVER_INFO_1546 *srv1546;
4901  * IDL   [case(1547)] [unique] SERVER_INFO_1547 *srv1547;
4902  * IDL   [case(1548)] [unique] SERVER_INFO_1548 *srv1548;
4903  * IDL   [case(1549)] [unique] SERVER_INFO_1549 *srv1549;
4904  * IDL   [case(1550)] [unique] SERVER_INFO_1550 *srv1550;
4905  * IDL   [case(1552)] [unique] SERVER_INFO_1552 *srv1552;
4906  * IDL   [case(1553)] [unique] SERVER_INFO_1553 *srv1553;
4907  * IDL   [case(1554)] [unique] SERVER_INFO_1554 *srv1554;
4908  * IDL   [case(1555)] [unique] SERVER_INFO_1555 *srv1555;
4909  * IDL   [case(1556)] [unique] SERVER_INFO_1556 *srv1556;
4910  * IDL } SERVER_INFO_UNION;
4911  */
4912 static int
4913 srvsvc_dissect_SERVER_INFO_UNION(tvbuff_t *tvb, int offset,
4914                                      packet_info *pinfo, proto_tree *tree,
4915                                      char *drep)
4916 {
4917         guint32 level;
4918
4919         ALIGN_TO_4_BYTES;
4920
4921         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
4922
4923         switch(level){
4924         case 100:
4925                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4926                         srvsvc_dissect_SERVER_INFO_100,
4927                         NDR_POINTER_UNIQUE, "SERVER_INFO_100:", -1);
4928                 break;
4929
4930         case 101:
4931                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4932                         srvsvc_dissect_SERVER_INFO_101,
4933                         NDR_POINTER_UNIQUE, "SERVER_INFO_101:", -1);
4934                 break;
4935
4936         case 102:
4937                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4938                         srvsvc_dissect_SERVER_INFO_102,
4939                         NDR_POINTER_UNIQUE, "SERVER_INFO_102:", -1);
4940                 break;
4941
4942         case 402:
4943                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4944                         srvsvc_dissect_SERVER_INFO_402,
4945                         NDR_POINTER_UNIQUE, "SERVER_INFO_402:", -1);
4946                 break;
4947
4948         case 403:
4949                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4950                         srvsvc_dissect_SERVER_INFO_403,
4951                         NDR_POINTER_UNIQUE, "SERVER_INFO_403:", -1);
4952                 break;
4953
4954         case 502:
4955                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4956                         srvsvc_dissect_SERVER_INFO_502,
4957                         NDR_POINTER_UNIQUE, "SERVER_INFO_502:", -1);
4958                 break;
4959
4960         case 503:
4961                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4962                         srvsvc_dissect_SERVER_INFO_503,
4963                         NDR_POINTER_UNIQUE, "SERVER_INFO_503:", -1);
4964                 break;
4965
4966         case 599:
4967                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4968                         srvsvc_dissect_SERVER_INFO_599,
4969                         NDR_POINTER_UNIQUE, "SERVER_INFO_599:", -1);
4970                 break;
4971
4972         case 1005:
4973                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4974                         srvsvc_dissect_SERVER_INFO_1005,
4975                         NDR_POINTER_UNIQUE, "SERVER_INFO_1005:", -1);
4976                 break;
4977
4978         case 1010:
4979                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4980                         srvsvc_dissect_SERVER_INFO_1010,
4981                         NDR_POINTER_UNIQUE, "SERVER_INFO_1010:", -1);
4982                 break;
4983
4984         case 1016:
4985                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4986                         srvsvc_dissect_SERVER_INFO_1016,
4987                         NDR_POINTER_UNIQUE, "SERVER_INFO_1016:", -1);
4988                 break;
4989
4990         case 1017:
4991                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4992                         srvsvc_dissect_SERVER_INFO_1017,
4993                         NDR_POINTER_UNIQUE, "SERVER_INFO_1017:", -1);
4994                 break;
4995
4996         case 1018:
4997                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
4998                         srvsvc_dissect_SERVER_INFO_1018,
4999                         NDR_POINTER_UNIQUE, "SERVER_INFO_1018:", -1);
5000                 break;
5001
5002         case 1107:
5003                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5004                         srvsvc_dissect_SERVER_INFO_1107,
5005                         NDR_POINTER_UNIQUE, "SERVER_INFO_1107:", -1);
5006                 break;
5007
5008         case 1501:
5009                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5010                         srvsvc_dissect_SERVER_INFO_1501,
5011                         NDR_POINTER_UNIQUE, "SERVER_INFO_1501:", -1);
5012                 break;
5013
5014         case 1502:
5015                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5016                         srvsvc_dissect_SERVER_INFO_1502,
5017                         NDR_POINTER_UNIQUE, "SERVER_INFO_1502:", -1);
5018                 break;
5019
5020         case 1503:
5021                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5022                         srvsvc_dissect_SERVER_INFO_1503,
5023                         NDR_POINTER_UNIQUE, "SERVER_INFO_1503:", -1);
5024                 break;
5025
5026         case 1506:
5027                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5028                         srvsvc_dissect_SERVER_INFO_1506,
5029                         NDR_POINTER_UNIQUE, "SERVER_INFO_1506:", -1);
5030                 break;
5031
5032         case 1509:
5033                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5034                         srvsvc_dissect_SERVER_INFO_1509,
5035                         NDR_POINTER_UNIQUE, "SERVER_INFO_1509:", -1);
5036                 break;
5037
5038         case 1510:
5039                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5040                         srvsvc_dissect_SERVER_INFO_1510,
5041                         NDR_POINTER_UNIQUE, "SERVER_INFO_1510:", -1);
5042                 break;
5043
5044         case 1511:
5045                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5046                         srvsvc_dissect_SERVER_INFO_1511,
5047                         NDR_POINTER_UNIQUE, "SERVER_INFO_1511:", -1);
5048                 break;
5049
5050         case 1512:
5051                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5052                         srvsvc_dissect_SERVER_INFO_1512,
5053                         NDR_POINTER_UNIQUE, "SERVER_INFO_1512:", -1);
5054                 break;
5055
5056         case 1513:
5057                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5058                         srvsvc_dissect_SERVER_INFO_1513,
5059                         NDR_POINTER_UNIQUE, "SERVER_INFO_1513:", -1);
5060                 break;
5061
5062         case 1514:
5063                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5064                         srvsvc_dissect_SERVER_INFO_1514,
5065                         NDR_POINTER_UNIQUE, "SERVER_INFO_1514:", -1);
5066                 break;
5067
5068         case 1515:
5069                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5070                         srvsvc_dissect_SERVER_INFO_1515,
5071                         NDR_POINTER_UNIQUE, "SERVER_INFO_1515:", -1);
5072                 break;
5073
5074         case 1516:
5075                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5076                         srvsvc_dissect_SERVER_INFO_1516,
5077                         NDR_POINTER_UNIQUE, "SERVER_INFO_1516:", -1);
5078                 break;
5079
5080         case 1518:
5081                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5082                         srvsvc_dissect_SERVER_INFO_1518,
5083                         NDR_POINTER_UNIQUE, "SERVER_INFO_1518:", -1);
5084                 break;
5085
5086         case 1520:
5087                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5088                         srvsvc_dissect_SERVER_INFO_1520,
5089                         NDR_POINTER_UNIQUE, "SERVER_INFO_1520:", -1);
5090                 break;
5091
5092         case 1521:
5093                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5094                         srvsvc_dissect_SERVER_INFO_1521,
5095                         NDR_POINTER_UNIQUE, "SERVER_INFO_1521:", -1);
5096                 break;
5097
5098         case 1522:
5099                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5100                         srvsvc_dissect_SERVER_INFO_1522,
5101                         NDR_POINTER_UNIQUE, "SERVER_INFO_1522:", -1);
5102                 break;
5103
5104         case 1523:
5105                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5106                         srvsvc_dissect_SERVER_INFO_1523,
5107                         NDR_POINTER_UNIQUE, "SERVER_INFO_1523:", -1);
5108                 break;
5109
5110         case 1524:
5111                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5112                         srvsvc_dissect_SERVER_INFO_1524,
5113                         NDR_POINTER_UNIQUE, "SERVER_INFO_1524:", -1);
5114                 break;
5115
5116         case 1525:
5117                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5118                         srvsvc_dissect_SERVER_INFO_1525,
5119                         NDR_POINTER_UNIQUE, "SERVER_INFO_1525:", -1);
5120                 break;
5121
5122         case 1528:
5123                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5124                         srvsvc_dissect_SERVER_INFO_1528,
5125                         NDR_POINTER_UNIQUE, "SERVER_INFO_1528:", -1);
5126                 break;
5127
5128         case 1529:
5129                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5130                         srvsvc_dissect_SERVER_INFO_1529,
5131                         NDR_POINTER_UNIQUE, "SERVER_INFO_1529:", -1);
5132                 break;
5133
5134         case 1530:
5135                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5136                         srvsvc_dissect_SERVER_INFO_1530,
5137                         NDR_POINTER_UNIQUE, "SERVER_INFO_1530:", -1);
5138                 break;
5139
5140         case 1533:
5141                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5142                         srvsvc_dissect_SERVER_INFO_1533,
5143                         NDR_POINTER_UNIQUE, "SERVER_INFO_1533:", -1);
5144                 break;
5145
5146         case 1534:
5147                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5148                         srvsvc_dissect_SERVER_INFO_1534,
5149                         NDR_POINTER_UNIQUE, "SERVER_INFO_1534:", -1);
5150                 break;
5151
5152         case 1535:
5153                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5154                         srvsvc_dissect_SERVER_INFO_1535,
5155                         NDR_POINTER_UNIQUE, "SERVER_INFO_1535:", -1);
5156                 break;
5157
5158         case 1536:
5159                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5160                         srvsvc_dissect_SERVER_INFO_1536,
5161                         NDR_POINTER_UNIQUE, "SERVER_INFO_1536:", -1);
5162                 break;
5163
5164         case 1537:
5165                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5166                         srvsvc_dissect_SERVER_INFO_1537,
5167                         NDR_POINTER_UNIQUE, "SERVER_INFO_1537:", -1);
5168                 break;
5169
5170         case 1538:
5171                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5172                         srvsvc_dissect_SERVER_INFO_1538,
5173                         NDR_POINTER_UNIQUE, "SERVER_INFO_1538:", -1);
5174                 break;
5175
5176         case 1539:
5177                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5178                         srvsvc_dissect_SERVER_INFO_1539,
5179                         NDR_POINTER_UNIQUE, "SERVER_INFO_1539:", -1);
5180                 break;
5181
5182         case 1540:
5183                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5184                         srvsvc_dissect_SERVER_INFO_1540,
5185                         NDR_POINTER_UNIQUE, "SERVER_INFO_1540:", -1);
5186                 break;
5187
5188         case 1541:
5189                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5190                         srvsvc_dissect_SERVER_INFO_1541,
5191                         NDR_POINTER_UNIQUE, "SERVER_INFO_1541:", -1);
5192                 break;
5193
5194         case 1542:
5195                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5196                         srvsvc_dissect_SERVER_INFO_1542,
5197                         NDR_POINTER_UNIQUE, "SERVER_INFO_1542:", -1);
5198                 break;
5199
5200         case 1543:
5201                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5202                         srvsvc_dissect_SERVER_INFO_1543,
5203                         NDR_POINTER_UNIQUE, "SERVER_INFO_1543:", -1);
5204                 break;
5205
5206         case 1544:
5207                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5208                         srvsvc_dissect_SERVER_INFO_1544,
5209                         NDR_POINTER_UNIQUE, "SERVER_INFO_1544:", -1);
5210                 break;
5211
5212         case 1545:
5213                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5214                         srvsvc_dissect_SERVER_INFO_1545,
5215                         NDR_POINTER_UNIQUE, "SERVER_INFO_1545:", -1);
5216                 break;
5217
5218         case 1546:
5219                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5220                         srvsvc_dissect_SERVER_INFO_1546,
5221                         NDR_POINTER_UNIQUE, "SERVER_INFO_1546:", -1);
5222                 break;
5223
5224         case 1547:
5225                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5226                         srvsvc_dissect_SERVER_INFO_1547,
5227                         NDR_POINTER_UNIQUE, "SERVER_INFO_1547:", -1);
5228                 break;
5229
5230         case 1548:
5231                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5232                         srvsvc_dissect_SERVER_INFO_1548,
5233                         NDR_POINTER_UNIQUE, "SERVER_INFO_1548:", -1);
5234                 break;
5235
5236         case 1549:
5237                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5238                         srvsvc_dissect_SERVER_INFO_1549,
5239                         NDR_POINTER_UNIQUE, "SERVER_INFO_1549:", -1);
5240                 break;
5241
5242         case 1550:
5243                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5244                         srvsvc_dissect_SERVER_INFO_1550,
5245                         NDR_POINTER_UNIQUE, "SERVER_INFO_1550:", -1);
5246                 break;
5247
5248         case 1552:
5249                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5250                         srvsvc_dissect_SERVER_INFO_1552,
5251                         NDR_POINTER_UNIQUE, "SERVER_INFO_1552:", -1);
5252                 break;
5253
5254         case 1553:
5255                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5256                         srvsvc_dissect_SERVER_INFO_1553,
5257                         NDR_POINTER_UNIQUE, "SERVER_INFO_1553:", -1);
5258                 break;
5259
5260         case 1554:
5261                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5262                         srvsvc_dissect_SERVER_INFO_1554,
5263                         NDR_POINTER_UNIQUE, "SERVER_INFO_1554:", -1);
5264                 break;
5265
5266         case 1555:
5267                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5268                         srvsvc_dissect_SERVER_INFO_1555,
5269                         NDR_POINTER_UNIQUE, "SERVER_INFO_1555:", -1);
5270                 break;
5271
5272         case 1556:
5273                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5274                         srvsvc_dissect_SERVER_INFO_1556,
5275                         NDR_POINTER_UNIQUE, "SERVER_INFO_1556:", -1);
5276                 break;
5277
5278         }
5279
5280         return offset;
5281 }
5282
5283 /*
5284  * IDL long NetrServerGetInfo(
5285  * IDL      [in] [string] [unique] wchar_t *ServerName,
5286  * IDL      [in] long Level,
5287  * IDL      [out] [ref] SERVER_INFO_UNION *srv;
5288  * IDL );
5289  */
5290 static int
5291 srvsvc_dissect_netrservergetinfo_rqst(tvbuff_t *tvb, int offset,
5292                                      packet_info *pinfo, proto_tree *tree,
5293                                      char *drep)
5294 {
5295         offset = dissect_ndr_pointer_cb(
5296                 tvb, offset, pinfo, tree, drep,
5297                 dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
5298                 "Server", hf_srvsvc_server, cb_str_postprocess,
5299                 GINT_TO_POINTER(CB_STR_COL_INFO | 1));
5300
5301         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5302                         hf_srvsvc_info_level, 0);
5303
5304         return offset;
5305 }
5306 static int
5307 srvsvc_dissect_netrservergetinfo_reply(tvbuff_t *tvb, int offset,
5308                                      packet_info *pinfo, proto_tree *tree,
5309                                      char *drep)
5310 {
5311         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5312                         srvsvc_dissect_SERVER_INFO_UNION,
5313                         NDR_POINTER_REF, "Server Info", -1);
5314
5315         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
5316                         hf_srvsvc_rc, NULL);
5317
5318         return offset;
5319 }
5320
5321 /*
5322  * IDL long NetrServerSetInfo(
5323  * IDL      [in] [string] [unique] wchar_t *ServerName,
5324  * IDL      [in] long Level,
5325  * IDL      [in] [ref] SERVER_INFO_UNION *srv;
5326  * IDL      [in] [out] [unique] long *ParamError;
5327  * IDL );
5328  */
5329 static int
5330 srvsvc_dissect_netrserversetinfo_rqst(tvbuff_t *tvb, int offset,
5331                                      packet_info *pinfo, proto_tree *tree,
5332                                      char *drep)
5333 {
5334         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5335                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
5336
5337         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5338                         hf_srvsvc_info_level, 0);
5339
5340         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5341                         srvsvc_dissect_SERVER_INFO_UNION,
5342                         NDR_POINTER_REF, "Server Info", -1);
5343
5344         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5345                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
5346                         "Parameter Error:", hf_srvsvc_parm_error);
5347
5348         return offset;
5349 }
5350 static int
5351 srvsvc_dissect_netrserversetinfo_reply(tvbuff_t *tvb, int offset,
5352                                      packet_info *pinfo, proto_tree *tree,
5353                                      char *drep)
5354 {
5355         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5356                         srvsvc_dissect_pointer_long, NDR_POINTER_UNIQUE,
5357                         "Parameter Error:", hf_srvsvc_parm_error);
5358
5359         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
5360                         hf_srvsvc_rc, NULL);
5361
5362         return offset;
5363 }
5364
5365
5366 /*
5367  * IDL typedef struct {
5368  * IDL   [size_is()] [unique] wchar_t *disk;
5369  * IDL } DISK_INFO_0;
5370  */
5371 static int
5372 srvsvc_dissect_DISK_INFO_0(tvbuff_t *tvb, int offset,
5373                                      packet_info *pinfo, proto_tree *tree,
5374                                      char *drep)
5375 {
5376         guint32 len;
5377         dcerpc_info *di;
5378
5379         di=pinfo->private_data;
5380         if(di->conformant_run){
5381                 /* this call is to make ethereal eat the array header for the conformant run */
5382                 offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
5383
5384                 return offset;
5385         }
5386         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5387                 hf_srvsvc_disk_name_len, &len);
5388
5389         offset = dissect_ndr_uint16s(
5390                 tvb, offset, pinfo, tree, drep, hf_srvsvc_disk_name, len);
5391
5392         return offset;
5393 }
5394 static int
5395 srvsvc_dissect_DISK_INFO_0_array(tvbuff_t *tvb, int offset,
5396                                      packet_info *pinfo, proto_tree *tree,
5397                                      char *drep)
5398 {
5399         offset = dissect_ndr_ucvarray(tvb, offset, pinfo, tree, drep,
5400                         srvsvc_dissect_DISK_INFO_0);
5401
5402         return offset;
5403 }
5404
5405 /*
5406  * IDL typedef struct {
5407  * IDL   long EntriesRead;
5408  * IDL   [length_is(EntriesRead)] [size_is(EntriesRead)] [unique] DISK_INFO_0 *disk;
5409  * IDL } DISK_ENUM_CONTAINER;
5410  */
5411 static int
5412 srvsvc_dissect_DISK_ENUM_CONTAINER(tvbuff_t *tvb, int offset,
5413                                      packet_info *pinfo, proto_tree *tree,
5414                                      char *drep)
5415 {
5416         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5417                 hf_srvsvc_num_entries, NULL);
5418
5419         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5420                 srvsvc_dissect_DISK_INFO_0_array, NDR_POINTER_UNIQUE,
5421                 "DISK_INFO_0 array:", -1);
5422
5423         return offset;
5424 }
5425
5426
5427 /*
5428  * IDL long NetrServerDiskEnum(
5429  * IDL      [in] [string] [unique] wchar_t *ServerName,
5430  * IDL      [in] long Level,
5431  * IDL      [in] [out] [ref] DISK_ENUM_CONTAINER *disk;
5432  * IDL      [in] long maxlen,
5433  * IDL      [out] long entries,
5434  * IDL      [in] [out] [unique] long *resumehandle,
5435  * IDL );
5436  */
5437 static int
5438 srvsvc_dissect_netrserverdiskenum_rqst(tvbuff_t *tvb, int offset,
5439                                      packet_info *pinfo, proto_tree *tree,
5440                                      char *drep)
5441 {
5442         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5443                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
5444
5445         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5446                         hf_srvsvc_info_level, 0);
5447
5448         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5449                         srvsvc_dissect_DISK_ENUM_CONTAINER,
5450                         NDR_POINTER_REF, "Disks", -1);
5451
5452         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5453                 hf_srvsvc_preferred_len, 0);
5454
5455         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5456                 srvsvc_dissect_ENUM_HANDLE,
5457                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
5458
5459         return offset;
5460 }
5461 static int
5462 srvsvc_dissect_netrserverdiskenum_reply(tvbuff_t *tvb, int offset,
5463                                      packet_info *pinfo, proto_tree *tree,
5464                                      char *drep)
5465 {
5466         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5467                         srvsvc_dissect_DISK_ENUM_CONTAINER,
5468                         NDR_POINTER_REF, "Disks", -1);
5469
5470         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5471                 hf_srvsvc_num_entries, NULL);
5472
5473         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5474                 srvsvc_dissect_ENUM_HANDLE,
5475                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
5476
5477         return offset;
5478 }
5479
5480 /*
5481  * IDL typedef struct {
5482  * IDL   long start;
5483  * IDL   long fopens;
5484  * IDL   long devopens;
5485  * IDL   long jobsqueued;
5486  * IDL   long sopens;
5487  * IDL   long stimeouts;
5488  * IDL   long serrorout;
5489  * IDL   long pwerrors;
5490  * IDL   long permerrors;
5491  * IDL   long syserrors;
5492  * IDL   long bytessent_low;
5493  * IDL   long bytessent_high;
5494  * IDL   long bytesrcvd_low;
5495  * IDL   long bytesrcvd_high;
5496  * IDL   long avresponse;
5497  * IDL   long reqbufneed;
5498  * IDL   long bigbufneed;
5499  * IDL } SERVER_STAT;
5500  */
5501
5502 static int
5503 srvsvc_dissect_SERVER_STAT(tvbuff_t *tvb, int offset,
5504                                      packet_info *pinfo, proto_tree *tree,
5505                                      char *drep)
5506 {
5507         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5508                 hf_srvsvc_server_stat_start, NULL);
5509
5510         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5511                 hf_srvsvc_server_stat_fopens, NULL);
5512
5513         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5514                 hf_srvsvc_server_stat_devopens, NULL);
5515
5516         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5517                 hf_srvsvc_server_stat_jobsqueued, NULL);
5518
5519         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5520                 hf_srvsvc_server_stat_sopens, NULL);
5521
5522         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5523                 hf_srvsvc_server_stat_stimeouts, NULL);
5524
5525         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5526                 hf_srvsvc_server_stat_serrorout, NULL);
5527
5528         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5529                 hf_srvsvc_server_stat_pwerrors, NULL);
5530
5531         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5532                 hf_srvsvc_server_stat_permerrors, NULL);
5533
5534         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5535                 hf_srvsvc_server_stat_syserrors, NULL);
5536
5537         offset = dissect_ndr_uint64(tvb, offset, pinfo, tree, drep,
5538                 hf_srvsvc_server_stat_bytessent, NULL);
5539
5540         offset = dissect_ndr_uint64(tvb, offset, pinfo, tree, drep,
5541                 hf_srvsvc_server_stat_bytesrcvd, NULL);
5542
5543         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5544                 hf_srvsvc_server_stat_avresponse, NULL);
5545
5546         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5547                 hf_srvsvc_server_stat_reqbufneed, NULL);
5548
5549         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5550                 hf_srvsvc_server_stat_bigbufneed, NULL);
5551
5552         return offset;
5553 }
5554
5555 /*
5556  * IDL long NetrServerStatisticsGet(
5557  * IDL      [in] [string] [unique] wchar_t *ServerName,
5558  * IDL      [in] [string] [unique] wchar_t *Service,
5559  * IDL      [in] long Level,
5560  * IDL      [in] long Options,
5561  * IDL      [out] [ref] SERVER_STAT *stat
5562  * IDL );
5563  */
5564 static int
5565 srvsvc_dissect_netrserverstatisticsget_rqst(tvbuff_t *tvb, int offset,
5566                                      packet_info *pinfo, proto_tree *tree,
5567                                      char *drep)
5568 {
5569         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5570                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
5571
5572         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5573                         NDR_POINTER_UNIQUE, "Service", hf_srvsvc_service, 0);
5574
5575         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5576                 hf_srvsvc_info_level, 0);
5577
5578         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5579                 hf_srvsvc_service_options, 0);
5580
5581         return offset;
5582 }
5583 static int
5584 srvsvc_dissect_netrserverstatisticsget_reply(tvbuff_t *tvb, int offset,
5585                                      packet_info *pinfo, proto_tree *tree,
5586                                      char *drep)
5587 {
5588         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5589                         srvsvc_dissect_SERVER_STAT,
5590                         NDR_POINTER_REF, "Stat", -1);
5591
5592         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
5593                         hf_srvsvc_rc, NULL);
5594
5595         return offset;
5596 }
5597
5598 /*
5599  * IDL typedef struct {
5600  * IDL   [size_is(transportaddresslen)] char transportaddress;
5601  * IDL } TRANSPORT_ADDRESS;
5602  */
5603 static int
5604 srvsvc_dissect_TRANSPORT_ADDRESS(tvbuff_t *tvb, int offset,
5605                                      packet_info *pinfo, proto_tree *tree,
5606                                      char *drep)
5607 {
5608         dcerpc_info *di;
5609         guint32 len;
5610
5611         di=pinfo->private_data;
5612         if(di->conformant_run){
5613                 /*just a run to handle conformant arrays, nothing to dissect */
5614                 return offset;
5615         }
5616
5617         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5618                 hf_srvsvc_transport_address_len, &len);
5619
5620         proto_tree_add_item(tree, hf_srvsvc_transport_address, tvb, offset,
5621                 len, FALSE);
5622         offset += len;
5623
5624         return offset;
5625 }
5626
5627 /*
5628  * IDL typedef struct {
5629  * IDL   long numberofvcs;
5630  * IDL   [string] [unique] transportname;
5631  * IDL   [unique] TRANSPORT_ADDRESS *transportaddress;
5632  * IDL   long transportaddresslen;
5633  * IDL   [string] [unique] wchar_t *networkaddress;
5634  * IDL } TRANSPORT_INFO_0;
5635  */
5636 static int
5637 srvsvc_dissect_TRANSPORT_INFO_0(tvbuff_t *tvb, int offset,
5638                                      packet_info *pinfo, proto_tree *tree,
5639                                      char *drep)
5640 {
5641         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5642                         hf_srvsvc_transport_numberofvcs, 0);
5643
5644         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5645                         NDR_POINTER_UNIQUE, "Name", 
5646                         hf_srvsvc_transport_name, 0);
5647
5648         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5649                         srvsvc_dissect_TRANSPORT_ADDRESS,
5650                         NDR_POINTER_UNIQUE, "Transport Address", -1);
5651
5652         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5653                         hf_srvsvc_transport_address_len, 0);
5654
5655         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5656                         NDR_POINTER_UNIQUE, "Network Address", 
5657                         hf_srvsvc_transport_networkaddress, 0);
5658
5659         return offset;
5660 }
5661 static int
5662 srvsvc_dissect_TRANSPORT_INFO_0_array(tvbuff_t *tvb, int offset,
5663                                      packet_info *pinfo, proto_tree *tree,
5664                                      char *drep)
5665 {
5666         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
5667                         srvsvc_dissect_TRANSPORT_INFO_0);
5668
5669         return offset;
5670 }
5671
5672 /*
5673  * IDL typedef struct {
5674  * IDL   long EntriesRead;
5675  * IDL   [size_is(EntriesRead)] [unique] TRANSPORT_INFO_0 *trans;
5676  * IDL } SERVER_XPORT_INFO_0_CONTAINER;
5677  */
5678 static int
5679 srvsvc_dissect_SERVER_XPORT_INFO_0_CONTAINER(tvbuff_t *tvb, int offset,
5680                                      packet_info *pinfo, proto_tree *tree,
5681                                      char *drep)
5682 {
5683         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5684                 hf_srvsvc_num_entries, NULL);
5685
5686         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5687                 srvsvc_dissect_TRANSPORT_INFO_0_array, NDR_POINTER_UNIQUE,
5688                 "TRANSPORT_INFO_0 array:", -1);
5689
5690         return offset;
5691 }
5692
5693 /*
5694  * IDL typedef struct {
5695  * IDL   long numberofvcs;
5696  * IDL   [string] [unique] transportname;
5697  * IDL   [unique] TRANSPORT_ADDRESS *transportaddress;
5698  * IDL   long transportaddresslen;
5699  * IDL   [string] [unique] wchar_t *networkaddress;
5700  * IDL } TRANSPORT_INFO_1;
5701  */
5702 static int
5703 srvsvc_dissect_TRANSPORT_INFO_1(tvbuff_t *tvb, int offset,
5704                                      packet_info *pinfo, proto_tree *tree,
5705                                      char *drep)
5706 {
5707         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5708                 hf_srvsvc_transport_numberofvcs, 0);
5709
5710         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5711                         NDR_POINTER_UNIQUE, "Name", 
5712                         hf_srvsvc_transport_name, 0);
5713
5714         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5715                         srvsvc_dissect_TRANSPORT_ADDRESS,
5716                         NDR_POINTER_UNIQUE, "Transport Address", -1);
5717
5718         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5719                 hf_srvsvc_transport_address_len, 0);
5720
5721         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5722                         NDR_POINTER_UNIQUE, "Network Address", 
5723                         hf_srvsvc_transport_networkaddress, 0);
5724
5725         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5726                         NDR_POINTER_UNIQUE, "Domain", hf_srvsvc_domain, 0);
5727
5728         return offset;
5729 }
5730 static int
5731 srvsvc_dissect_TRANSPORT_INFO_1_array(tvbuff_t *tvb, int offset,
5732                                      packet_info *pinfo, proto_tree *tree,
5733                                      char *drep)
5734 {
5735         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep,
5736                         srvsvc_dissect_TRANSPORT_INFO_1);
5737
5738         return offset;
5739 }
5740
5741 /*
5742  * IDL typedef struct {
5743  * IDL   long EntriesRead;
5744  * IDL   [size_is(EntriesRead)] [unique] TRANSPORT_INFO_1 *trans;
5745  * IDL } SERVER_XPORT_INFO_1_CONTAINER;
5746  */
5747 static int
5748 srvsvc_dissect_SERVER_XPORT_INFO_1_CONTAINER(tvbuff_t *tvb, int offset,
5749                                      packet_info *pinfo, proto_tree *tree,
5750                                      char *drep)
5751 {
5752         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5753                 hf_srvsvc_num_entries, NULL);
5754
5755         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5756                 srvsvc_dissect_TRANSPORT_INFO_1_array, NDR_POINTER_UNIQUE,
5757                 "TRANSPORT_INFO_1 array:", -1);
5758
5759         return offset;
5760 }
5761
5762
5763 /*
5764  * IDL typedef [switch_type(long)] union {
5765  * IDL   [case(0)] [unique] SERVER_XPORT_INFO_0_CONTAINER *xp0;
5766  * IDL   [case(1)] [unique] SERVER_XPORT_INFO_1_CONTAINER *xp1;
5767  * IDL } SERVER_XPORT_ENUM_UNION;
5768  */
5769 static int
5770 srvsvc_dissect_SERVER_XPORT_ENUM_UNION(tvbuff_t *tvb, int offset,
5771                                      packet_info *pinfo, proto_tree *tree,
5772                                      char *drep)
5773 {
5774         guint32 level;
5775
5776         ALIGN_TO_4_BYTES;
5777
5778         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_srvsvc_info_level, &level);
5779
5780         switch(level){
5781         case 0:
5782                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5783                         srvsvc_dissect_SERVER_XPORT_INFO_0_CONTAINER,
5784                         NDR_POINTER_UNIQUE, "SERVER_XPORT_INFO_0_CONTAINER:",
5785                         -1);
5786                 break;
5787         case 1:
5788                 offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5789                         srvsvc_dissect_SERVER_XPORT_INFO_1_CONTAINER,
5790                         NDR_POINTER_UNIQUE, "SERVER_XPORT_INFO_1_CONTAINER:",
5791                         -1);
5792                 break;
5793         }
5794
5795         return offset;
5796 }
5797
5798 /*
5799  * IDL typedef struct {
5800  * IDL   long Level;
5801  * IDL   SERVER_XPORT_ENUM_UNION xport;
5802  * IDL } SERVER_XPORT_ENUM_STRUCT;
5803  */
5804 static int
5805 srvsvc_dissect_SERVER_XPORT_ENUM_STRUCT(tvbuff_t *tvb, int offset,
5806                                      packet_info *pinfo, proto_tree *tree,
5807                                      char *drep)
5808 {
5809         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5810                         hf_srvsvc_info_level, 0);
5811
5812         offset = srvsvc_dissect_SERVER_XPORT_ENUM_UNION(tvb, offset,
5813                         pinfo, tree, drep);
5814
5815         return offset;
5816 }
5817
5818
5819 /*
5820  * IDL long NetrServerTransportAdd(
5821  * IDL      [in] [string] [unique] wchar_t *ServerName,
5822  * IDL      [in] long Level,
5823  * IDL      [in] [ref] TRANSPORT_INFO_0 *trans;
5824  * IDL );
5825  */
5826 static int
5827 srvsvc_dissect_netrservertransportadd_rqst(tvbuff_t *tvb, int offset,
5828                                      packet_info *pinfo, proto_tree *tree,
5829                                      char *drep)
5830 {
5831         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5832                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
5833
5834         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5835                 hf_srvsvc_info_level, 0);
5836
5837         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5838                         srvsvc_dissect_TRANSPORT_INFO_0,
5839                         NDR_POINTER_REF, "Transports", -1);
5840
5841         return offset;
5842 }
5843 static int
5844 srvsvc_dissect_netrservertransportadd_reply(tvbuff_t *tvb, int offset,
5845                                      packet_info *pinfo, proto_tree *tree,
5846                                      char *drep)
5847 {
5848         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
5849                         hf_srvsvc_rc, NULL);
5850
5851         return offset;
5852 }
5853
5854 /*
5855  * IDL long NetrServerTransportEnum(
5856  * IDL      [in] [string] [unique] wchar_t *ServerName,
5857  * IDL      [in] [out] [ref] SERVER_XPORT_ENUM_STRUCT *xport;
5858  * IDL      [in] long MaxLen,
5859  * IDL      [out] long entries,
5860  * IDL      [in] [out] [unique] long *resumehandle;
5861  * IDL );
5862  */
5863 static int
5864 srvsvc_dissect_netrservertransportenum_rqst(tvbuff_t *tvb, int offset,
5865                                      packet_info *pinfo, proto_tree *tree,
5866                                      char *drep)
5867 {
5868         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5869                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
5870
5871         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5872                         srvsvc_dissect_SERVER_XPORT_ENUM_STRUCT,
5873                         NDR_POINTER_REF, "Transports", -1);
5874
5875         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5876                 hf_srvsvc_preferred_len, 0);
5877
5878         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5879                 srvsvc_dissect_ENUM_HANDLE,
5880                 NDR_POINTER_UNIQUE, "Enum Handle", -1);
5881
5882         return offset;
5883 }
5884 static int
5885 srvsvc_dissect_netrservertransportenum_reply(tvbuff_t *tvb, int offset,
5886                                      packet_info *pinfo, proto_tree *tree,
5887                                      char *drep)
5888 {
5889         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5890                         srvsvc_dissect_SERVER_XPORT_ENUM_STRUCT,
5891                         NDR_POINTER_REF, "Transports", -1);
5892
5893         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5894                 hf_srvsvc_num_entries, NULL);
5895
5896         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5897                         srvsvc_dissect_ENUM_HANDLE,
5898                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
5899
5900         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
5901                         hf_srvsvc_rc, NULL);
5902
5903         return offset;
5904 }
5905
5906
5907 /*
5908  * IDL long NetrServerTransportDel(
5909  * IDL      [in] [string] [unique] wchar_t *ServerName,
5910  * IDL      [in] long Level,
5911  * IDL      [in] [ref] TRANSPORT_INFO_0 *trans;
5912  * IDL );
5913  */
5914 static int
5915 srvsvc_dissect_netrservertransportdel_rqst(tvbuff_t *tvb, int offset,
5916                                      packet_info *pinfo, proto_tree *tree,
5917                                      char *drep)
5918 {
5919         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
5920                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
5921
5922         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5923                 hf_srvsvc_info_level, 0);
5924
5925         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
5926                         srvsvc_dissect_TRANSPORT_INFO_0,
5927                         NDR_POINTER_REF, "Transports", -1);
5928
5929         return offset;
5930 }
5931 static int
5932 srvsvc_dissect_netrservertransportdel_reply(tvbuff_t *tvb, int offset,
5933                                      packet_info *pinfo, proto_tree *tree,
5934                                      char *drep)
5935 {
5936         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
5937                         hf_srvsvc_rc, NULL);
5938
5939         return offset;
5940 }
5941
5942 /*
5943  * IDL typedef struct {
5944  * IDL   long elapsed;
5945  * IDL   long msecs;
5946  * IDL   long hours;
5947  * IDL   long mins;
5948  * IDL   long secs;
5949  * IDL   long hunds;
5950  * IDL   long timezone;
5951  * IDL   long tinterval;
5952  * IDL   long day;
5953  * IDL   long month;
5954  * IDL   long year;
5955  * IDL   long weekday;
5956  * IDL } TIMEOFDAY;
5957  */
5958 static int
5959 srvsvc_dissect_TIMEOFDAY(tvbuff_t *tvb, int offset,
5960                                      packet_info *pinfo, proto_tree *tree,
5961                                      char *drep)
5962 {
5963         /*
5964          * XXX - is "hf_srvsvc_tod_elapsed" something that should be
5965          * processed by "add_abstime_absent_unknown()" from
5966          * "packet-smb-pipe.c"?  This structure looks similar
5967          * to the result of a NetRemoteTOD RAP call, and that has
5968          * a "current time" field that's processed by
5969          * "add_abstime_absent_unknown()".
5970          *
5971          * Should other fields, such as the time zone offset and
5972          * the time interval, be processed as they are for
5973          * "lm_data_resp_netremotetod_nolevel" as well?
5974          */
5975         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5976                 hf_srvsvc_tod_elapsed, NULL);
5977         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5978                 hf_srvsvc_tod_msecs, NULL);
5979         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5980                 hf_srvsvc_tod_hours, NULL);
5981         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5982                 hf_srvsvc_tod_mins, NULL);
5983         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5984                 hf_srvsvc_tod_secs, NULL);
5985         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5986                 hf_srvsvc_tod_hunds, NULL);
5987         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5988                 hf_srvsvc_tod_timezone, NULL);
5989         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5990                 hf_srvsvc_tod_tinterval, NULL);
5991         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5992                 hf_srvsvc_tod_day, NULL);
5993         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5994                 hf_srvsvc_tod_month, NULL);
5995         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5996                 hf_srvsvc_tod_year, NULL);
5997         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
5998                 hf_srvsvc_tod_weekday, NULL);
5999
6000         return offset;
6001 }
6002
6003 /*
6004  * IDL long NetrRemoteTOD(
6005  * IDL      [in] [string] [unique] wchar_t *ServerName,
6006  * IDL      [out] [unique] TIMEOFDAY *t
6007  * IDL );
6008  */
6009 static int
6010 srvsvc_dissect_netrremotetod_rqst(tvbuff_t *tvb, int offset,
6011                                      packet_info *pinfo, proto_tree *tree,
6012                                      char *drep)
6013 {
6014         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6015                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6016
6017         return offset;
6018 }
6019 static int
6020 srvsvc_dissect_netrremotetod_reply(tvbuff_t *tvb, int offset,
6021                                      packet_info *pinfo, proto_tree *tree,
6022                                      char *drep)
6023 {
6024         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6025                         srvsvc_dissect_TIMEOFDAY,
6026                         NDR_POINTER_UNIQUE, "Time of day", -1);
6027
6028         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6029                         hf_srvsvc_rc, NULL);
6030
6031         return offset;
6032 }
6033
6034 /*
6035  * IDL long NetrSetServerServiceBits(
6036  * IDL      [in] [string] [unique] wchar_t *ServerName,
6037  * IDL      [in] [string] [unique] wchar_t *Transport,
6038  * IDL      [in] long ServiceBits;
6039  * IDL      [in] long UpdateImmediately;
6040  * IDL );
6041  */
6042 static int
6043 srvsvc_dissect_netrsetserverservicebits_rqst(tvbuff_t *tvb, int offset,
6044                                      packet_info *pinfo, proto_tree *tree,
6045                                      char *drep)
6046 {
6047         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6048                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6049
6050         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6051                         NDR_POINTER_UNIQUE, "Transport", hf_srvsvc_transport, 0);
6052
6053         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6054                 hf_srvsvc_service_bits, NULL);
6055
6056         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6057                 hf_srvsvc_update_immediately, NULL);
6058
6059         return offset;
6060 }
6061 static int
6062 srvsvc_dissect_netrsetserverservicebits_reply(tvbuff_t *tvb, int offset,
6063                                      packet_info *pinfo, proto_tree *tree,
6064                                      char *drep)
6065 {
6066         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6067                         hf_srvsvc_rc, NULL);
6068
6069         return offset;
6070 }
6071
6072 /*
6073  * IDL long NetrPathType(
6074  * IDL      [in] [string] [unique] wchar_t *ServerName,
6075  * IDL      [in] [string] [ref] wchar_t *PathName,
6076  * IDL      [in] long PathFlags;
6077  * IDL      [out] long PathType;
6078  * IDL );
6079  */
6080 static int
6081 srvsvc_dissect_netrpathtype_rqst(tvbuff_t *tvb, int offset,
6082                                      packet_info *pinfo, proto_tree *tree,
6083                                      char *drep)
6084 {
6085         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6086                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6087
6088         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6089                         NDR_POINTER_REF, "Path", hf_srvsvc_path, 0);
6090
6091         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6092                         hf_srvsvc_path_flags, NULL);
6093
6094         return offset;
6095 }
6096 static int
6097 srvsvc_dissect_netrpathtype_reply(tvbuff_t *tvb, int offset,
6098                                      packet_info *pinfo, proto_tree *tree,
6099                                      char *drep)
6100 {
6101         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6102                         hf_srvsvc_path_type, NULL);
6103
6104         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6105                         hf_srvsvc_rc, NULL);
6106
6107         return offset;
6108 }
6109
6110 /*
6111  * IDL long NetrPathCanonicalize(
6112  * IDL      [in] [string] [unique] wchar_t *ServerName,
6113  * IDL      [in] [string] [ref] wchar_t *PathName,
6114  * IDL      [in] long OutBufLen;
6115  * IDL      [in] [string] [ref] wchar_t *Prefix,
6116  * IDL      [in] [out] [ref] long *PathType;
6117  * IDL      [in] long PathFlags;
6118  * IDL );
6119  */
6120 static int
6121 srvsvc_dissect_netrpathcanonicalize_rqst(tvbuff_t *tvb, int offset,
6122                                      packet_info *pinfo, proto_tree *tree,
6123                                      char *drep)
6124 {
6125         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6126                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6127
6128         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6129                         NDR_POINTER_REF, "Path", hf_srvsvc_path, 0);
6130
6131         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6132                         hf_srvsvc_outbuflen, NULL);
6133
6134         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6135                         NDR_POINTER_REF, "Prefix", hf_srvsvc_prefix, 0);
6136
6137         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6138                         hf_srvsvc_path_type, NULL);
6139
6140         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6141                         hf_srvsvc_path_flags, NULL);
6142
6143         return offset;
6144 }
6145 static int
6146 srvsvc_dissect_netrpathcanonicalize_reply(tvbuff_t *tvb, int offset,
6147                                      packet_info *pinfo, proto_tree *tree,
6148                                      char *drep)
6149 {
6150         guint32 len;
6151         dcerpc_info *di;
6152
6153         di=pinfo->private_data;
6154         if(di->conformant_run){
6155                 /* this call is to make ethereal eat the array header for the conformant run */
6156                 offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
6157
6158                 return offset;
6159         }
6160         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6161                 hf_srvsvc_path_len, &len);
6162
6163         offset = dissect_ndr_uint16s(
6164                 tvb, offset, pinfo, tree, drep, hf_srvsvc_path, len);
6165
6166         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6167                         hf_srvsvc_path_type, NULL);
6168
6169         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6170                         hf_srvsvc_rc, NULL);
6171
6172         return offset;
6173 }
6174
6175
6176 /*
6177  * IDL long NetrPathCompare(
6178  * IDL      [in] [string] [unique] wchar_t *ServerName,
6179  * IDL      [in] [string] [ref] wchar_t *PathName1,
6180  * IDL      [in] [string] [ref] wchar_t *PathName2,
6181  * IDL      [in] long PathType;
6182  * IDL      [in] long PathFlags;
6183  * IDL );
6184  */
6185 static int
6186 srvsvc_dissect_netrpathcompare_rqst(tvbuff_t *tvb, int offset,
6187                                      packet_info *pinfo, proto_tree *tree,
6188                                      char *drep)
6189 {
6190         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6191                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6192
6193         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6194                         NDR_POINTER_REF, "Path 1", hf_srvsvc_path, 0);
6195
6196         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6197                         NDR_POINTER_REF, "Path 2", hf_srvsvc_path, 0);
6198
6199         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6200                         hf_srvsvc_path_type, NULL);
6201
6202         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6203                         hf_srvsvc_path_flags, NULL);
6204
6205         return offset;
6206 }
6207 static int
6208 srvsvc_dissect_netrpathcompare_reply(tvbuff_t *tvb, int offset,
6209                                      packet_info *pinfo, proto_tree *tree,
6210                                      char *drep)
6211 {
6212         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6213                         hf_srvsvc_rc, NULL);
6214
6215         return offset;
6216 }
6217
6218
6219 /*
6220  * IDL long NetrNameValidate(
6221  * IDL      [in] [string] [unique] wchar_t *ServerName,
6222  * IDL      [in] [string] [ref] wchar_t *PathName,
6223  * IDL      [in] long PathType;
6224  * IDL      [in] long PathFlags;
6225  * IDL );
6226  */
6227 static int
6228 srvsvc_dissect_netrnamevalidate_rqst(tvbuff_t *tvb, int offset,
6229                                      packet_info *pinfo, proto_tree *tree,
6230                                      char *drep)
6231 {
6232         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6233                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6234
6235         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6236                         NDR_POINTER_REF, "Path", hf_srvsvc_path, 0);
6237
6238         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6239                         hf_srvsvc_path_type, NULL);
6240
6241         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6242                         hf_srvsvc_path_flags, NULL);
6243
6244         return offset;
6245 }
6246 static int
6247 srvsvc_dissect_netrnamevalidate_reply(tvbuff_t *tvb, int offset,
6248                                      packet_info *pinfo, proto_tree *tree,
6249                                      char *drep)
6250 {
6251         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6252                         hf_srvsvc_rc, NULL);
6253
6254         return offset;
6255 }
6256
6257 /*
6258  * IDL long NetrNameCanonicalize(
6259  * IDL      [in] [string] [unique] wchar_t *ServerName,
6260  * IDL      [in] [string] [ref] wchar_t *PathName,
6261  * IDL      [in] long OutBufLen,
6262  * IDL      [in] long PathType,
6263  * IDL      [in] long PathFlags,
6264  * IDL      [out] [ref] *PathName
6265  * IDL );
6266  */
6267 static int
6268 srvsvc_dissect_netrnamecanonicalize_rqst(tvbuff_t *tvb, int offset,
6269                                      packet_info *pinfo, proto_tree *tree,
6270                                      char *drep)
6271 {
6272         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6273                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6274
6275         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6276                         NDR_POINTER_REF, "Path", hf_srvsvc_path, 0);
6277
6278         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6279                         hf_srvsvc_outbuflen, NULL);
6280
6281         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6282                         hf_srvsvc_path_type, NULL);
6283
6284         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6285                         hf_srvsvc_path_flags, NULL);
6286
6287         return offset;
6288 }
6289 static int
6290 srvsvc_dissect_netrnamecanonicalize_reply(tvbuff_t *tvb, int offset,
6291                                      packet_info *pinfo, proto_tree *tree,
6292                                      char *drep)
6293 {
6294         guint32 len;
6295         dcerpc_info *di;
6296
6297         di=pinfo->private_data;
6298         if(di->conformant_run){
6299                 /* this call is to make ethereal eat the array header for the conformant run */
6300                 offset =dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, NULL);
6301
6302                 return offset;
6303         }
6304         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6305                 hf_srvsvc_path_len, &len);
6306
6307         offset = dissect_ndr_uint16s(
6308                 tvb, offset, pinfo, tree, drep, hf_srvsvc_path, len);
6309
6310         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6311                         hf_srvsvc_rc, NULL);
6312
6313         return offset;
6314 }
6315
6316
6317 /*
6318  * IDL long NetrNameCompare(
6319  * IDL      [in] [string] [unique] wchar_t *ServerName,
6320  * IDL      [in] [string] [ref] wchar_t *PathName1,
6321  * IDL      [in] [string] [ref] wchar_t *PathName2,
6322  * IDL      [in] long PathType;
6323  * IDL      [in] long PathFlags;
6324  * IDL );
6325  */
6326 static int
6327 srvsvc_dissect_netrnamecompare_rqst(tvbuff_t *tvb, int offset,
6328                                      packet_info *pinfo, proto_tree *tree,
6329                                      char *drep)
6330 {
6331         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6332                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6333
6334         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6335                         NDR_POINTER_REF, "Path 1", hf_srvsvc_path, 0);
6336
6337         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6338                         NDR_POINTER_REF, "Path 2", hf_srvsvc_path, 0);
6339
6340         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6341                         hf_srvsvc_path_type, NULL);
6342
6343         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6344                         hf_srvsvc_path_flags, NULL);
6345
6346         return offset;
6347 }
6348 static int
6349 srvsvc_dissect_netrnamecompare_reply(tvbuff_t *tvb, int offset,
6350                                      packet_info *pinfo, proto_tree *tree,
6351                                      char *drep)
6352 {
6353         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6354                         hf_srvsvc_rc, NULL);
6355
6356         return offset;
6357 }
6358
6359
6360 /*
6361  * IDL long NetrShareEnumSticky(
6362  * IDL      [in] [string] [unique] wchar_t *ServerName,
6363  * IDL      [in] [out] [ref] SHARE_ENUM_STRUCT *share,
6364  * IDL      [in] long MaxLen,
6365  * IDL      [out] long Entries,
6366  * IDL      [in] [out] [unique] *ResumeHandle
6367  * IDL );
6368  */
6369 static int
6370 srvsvc_dissect_netrshareenumsticky_rqst(tvbuff_t *tvb, int offset,
6371                                      packet_info *pinfo, proto_tree *tree,
6372                                      char *drep)
6373 {
6374         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6375                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6376
6377         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6378                         srvsvc_dissect_SHARE_ENUM_STRUCT,
6379                         NDR_POINTER_REF, "Shares", -1);
6380
6381         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6382                         hf_srvsvc_preferred_len, 0);
6383
6384         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6385                         srvsvc_dissect_ENUM_HANDLE,
6386                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
6387
6388         return offset;
6389 }
6390 static int
6391 srvsvc_dissect_netrshareenumsticky_reply(tvbuff_t *tvb, int offset,
6392                                      packet_info *pinfo, proto_tree *tree,
6393                                      char *drep)
6394 {
6395         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6396                         srvsvc_dissect_SHARE_ENUM_STRUCT,
6397                         NDR_POINTER_REF, "Shares", -1);
6398
6399         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6400                 hf_srvsvc_num_entries, NULL);
6401
6402         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6403                         srvsvc_dissect_ENUM_HANDLE,
6404                         NDR_POINTER_UNIQUE, "Enum Handle", -1);
6405
6406         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6407                         hf_srvsvc_rc, NULL);
6408
6409         return offset;
6410 }
6411
6412
6413 /*
6414  * IDL long NetrShareDelStart(
6415  * IDL      [in] [string] [unique] wchar_t *ServerName,
6416  * IDL      [in] [string] [ref] wchar_t *Share,
6417  * IDL      [in] long reserved,
6418  * IDL      [out] [context_handle] hnd
6419  * IDL );
6420  */
6421 static int
6422 srvsvc_dissect_netrsharedelstart_rqst(tvbuff_t *tvb, int offset,
6423                                      packet_info *pinfo, proto_tree *tree,
6424                                      char *drep)
6425 {
6426         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6427                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6428
6429         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6430                         NDR_POINTER_REF, "Share", hf_srvsvc_share, 0);
6431
6432         offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
6433                                      hf_srvsvc_reserved, NULL);
6434
6435         return offset;
6436 }
6437 static int
6438 srvsvc_dissect_netrsharedelstart_reply(tvbuff_t *tvb, int offset,
6439                                      packet_info *pinfo, proto_tree *tree,
6440                                      char *drep)
6441 {
6442         offset = dissect_nt_policy_hnd(tvb, offset, pinfo, tree, drep,
6443                                        hf_srvsvc_hnd, NULL, TRUE, FALSE);
6444
6445         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6446                         hf_srvsvc_rc, NULL);
6447
6448         return offset;
6449 }
6450
6451 /*
6452  * IDL long NetrShareDelCommit(
6453  * IDL     [in] [out] [contect_handle] h
6454  * IDL );
6455  */
6456 static int
6457 srvsvc_dissect_netrsharedelcommit_rqst(tvbuff_t *tvb, int offset,
6458                                      packet_info *pinfo, proto_tree *tree,
6459                                      char *drep)
6460 {
6461         offset = dissect_nt_policy_hnd(tvb, offset, pinfo, tree, drep,
6462                                        hf_srvsvc_hnd, NULL, TRUE, FALSE);
6463
6464         return offset;
6465 }
6466 static int
6467 srvsvc_dissect_netrsharedelcommit_reply(tvbuff_t *tvb, int offset,
6468                                      packet_info *pinfo, proto_tree *tree,
6469                                      char *drep)
6470 {
6471         offset = dissect_nt_policy_hnd(tvb, offset, pinfo, tree, drep,
6472                                        hf_srvsvc_hnd, NULL, TRUE, FALSE);
6473
6474         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6475                         hf_srvsvc_rc, NULL);
6476
6477         return offset;
6478 }
6479
6480
6481 /* XXX dont know the out parameters. only the in parameters.
6482  *
6483  * IDL long NetrGetFileSecurity(
6484  * IDL      [in] [string] [unique] wchar_t *ServerName,
6485  * IDL      [in] [string] [unique] wchar_t *Share,
6486  * IDL      [in] [string] [ref] wchar_t *File,
6487  * IDL      [in] long requetedinformation
6488  * IDL      [out] [ref] SECDESC *securitysecriptor; 4byte-len followed by bytestring
6489  * IDL );
6490  */
6491 static int
6492 srvsvc_dissect_netrgetfilesecurity_rqst(tvbuff_t *tvb, int offset,
6493                                      packet_info *pinfo, proto_tree *tree,
6494                                      char *drep)
6495 {
6496         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6497                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6498
6499         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6500                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
6501
6502         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6503                         NDR_POINTER_REF, "Path", hf_srvsvc_path, 0);
6504
6505         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6506                         hf_srvsvc_info_level, 0);
6507
6508         return offset;
6509 }
6510 static int
6511 srvsvc_dissect_netrgetfilesecurity_reply(tvbuff_t *tvb, int offset,
6512                                      packet_info *pinfo, proto_tree *tree,
6513                                      char *drep)
6514 {
6515         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6516                         lsa_dissect_LSA_SECURITY_DESCRIPTOR_data, NDR_POINTER_REF,
6517                         "LSA SECURITY DESCRIPTOR data:", -1);
6518
6519         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6520                         hf_srvsvc_rc, NULL);
6521
6522         return offset;
6523 }
6524
6525
6526 /*
6527  * IDL long NetrSetFileSecurity(
6528  * IDL      [in] [string] [unique] wchar_t *ServerName,
6529  * IDL      [in] [string] [unique] wchar_t *Share,
6530  * IDL      [in] [string] [ref] wchar_t *File,
6531  * IDL      [in] long sequrityinformation
6532  * IDL      SECDESC [ref] *securitysecriptor; 4byte-len followed by bytestring
6533  * IDL );
6534  */
6535 static int
6536 srvsvc_dissect_netrsetfilesecurity_rqst(tvbuff_t *tvb, int offset,
6537                                      packet_info *pinfo, proto_tree *tree,
6538                                      char *drep)
6539 {
6540         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6541                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6542
6543         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6544                         NDR_POINTER_UNIQUE, "Share", hf_srvsvc_share, 0);
6545
6546         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6547                         NDR_POINTER_REF, "Path", hf_srvsvc_path, 0);
6548
6549         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6550                         hf_srvsvc_info_level, 0);
6551
6552         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6553                         lsa_dissect_LSA_SECURITY_DESCRIPTOR_data, NDR_POINTER_REF,
6554                         "LSA SECURITY DESCRIPTOR data:", -1);
6555
6556         return offset;
6557 }
6558 static int
6559 srvsvc_dissect_netrsetfilesecurity_reply(tvbuff_t *tvb, int offset,
6560                                      packet_info *pinfo, proto_tree *tree,
6561                                      char *drep)
6562 {
6563         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6564                         hf_srvsvc_rc, NULL);
6565
6566         return offset;
6567 }
6568
6569
6570 /*
6571  * IDL long NetrServerTransportAddEx(
6572  * IDL      [in] [string] [unique] wchar_t *ServerName,
6573  * IDL      [in] long Level
6574  * IDL      [in] [ref] SERVER_XPORT_ENUM_STRUCT *sxes;
6575  * IDL );
6576  */
6577 static int
6578 srvsvc_dissect_netrservertransportaddex_rqst(tvbuff_t *tvb, int offset,
6579                                      packet_info *pinfo, proto_tree *tree,
6580                                      char *drep)
6581 {
6582         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6583                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6584
6585         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6586                         hf_srvsvc_info_level, 0);
6587
6588         offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
6589                         srvsvc_dissect_SERVER_XPORT_ENUM_STRUCT,
6590                         NDR_POINTER_REF, "Transports", -1);
6591
6592         return offset;
6593 }
6594 static int
6595 srvsvc_dissect_netrservertransportaddex_reply(tvbuff_t *tvb, int offset,
6596                                      packet_info *pinfo, proto_tree *tree,
6597                                      char *drep)
6598 {
6599         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6600                         hf_srvsvc_rc, NULL);
6601
6602         return offset;
6603 }
6604
6605
6606 /*
6607  * IDL long NetrServerSetServiceBits2(
6608  * IDL      [in] [string] [unique] wchar_t *ServerName,
6609  * IDL      [in] [string] [unique] wchar_t *EmulatedServerName,
6610  * IDL      [in] [string] [unique] wchar_t *Transport,
6611  * IDL      [in] long servicebitsofinterest
6612  * IDL      [in] long servicebits
6613  * IDL      [in] long updateimmediately
6614  * IDL );
6615  */
6616 static int
6617 srvsvc_dissect_netrserversetservicebits2_rqst(tvbuff_t *tvb, int offset,
6618                                      packet_info *pinfo, proto_tree *tree,
6619                                      char *drep)
6620 {
6621         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6622                         NDR_POINTER_UNIQUE, "Server", hf_srvsvc_server, 0);
6623
6624         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6625                         NDR_POINTER_UNIQUE, "Emulated Server", 
6626                         hf_srvsvc_emulated_server, 0);
6627
6628         offset = dissect_ndr_str_pointer_item(tvb, offset, pinfo, tree, drep,
6629                         NDR_POINTER_UNIQUE, "Transport", hf_srvsvc_transport, 0);
6630
6631         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6632                         hf_srvsvc_service_bits_of_interest, NULL);
6633
6634         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6635                         hf_srvsvc_service_bits, NULL);
6636
6637         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep,
6638                         hf_srvsvc_update_immediately, NULL);
6639
6640         return offset;
6641 }
6642 static int
6643 srvsvc_dissect_netrserversetservicebits2_reply(tvbuff_t *tvb, int offset,
6644                                      packet_info *pinfo, proto_tree *tree,
6645                                      char *drep)
6646 {
6647         offset = dissect_doserror(tvb, offset, pinfo, tree, drep,
6648                         hf_srvsvc_rc, NULL);
6649
6650         return offset;
6651 }
6652
6653
6654
6655
6656 /*
6657   IDL }
6658 */
6659 static dcerpc_sub_dissector dcerpc_srvsvc_dissectors[] = {
6660         {SRV_NETRCHARDEVENUM,           "NetrCharDevEnum",
6661                 srvsvc_dissect_netrchardevenum_rqst,
6662                 srvsvc_dissect_netrchardevenum_reply},
6663         {SRV_NETRCHARDEVGETINFO,        "NetrCharDevGetInfo",
6664                 srvsvc_dissect_netrchardevgetinfo_rqst,
6665                 srvsvc_dissect_netrchardevgetinfo_reply},
6666         {SRV_NETRCHARDEVCONTROL,        "NetrCharDevControl",
6667                 srvsvc_dissect_netrchardevcontrol_rqst,
6668                 srvsvc_dissect_netrchardevcontrol_reply},
6669         {SRV_NETRCHARDEVQENUM,          "NetrCharDevQEnum",
6670                 srvsvc_dissect_netrchardevqenum_rqst,
6671                 srvsvc_dissect_netrchardevqenum_reply},
6672         {SRV_NETRCHARDEVQGETINFO,       "NetrCharDevQGetInfo",
6673                 srvsvc_dissect_netrchardevqgetinfo_rqst,
6674                 srvsvc_dissect_netrchardevqgetinfo_reply},
6675         {SRV_NETRCHARDEVQSETINFO,       "NetrCharDevQSetInfo",
6676                 srvsvc_dissect_netrchardevqsetinfo_rqst,
6677                 srvsvc_dissect_netrchardevqsetinfo_reply},
6678         {SRV_NETRCHARDEVQPURGE,         "NetrCharDevQPurge",
6679                 srvsvc_dissect_netrchardevqpurge_rqst,
6680                 srvsvc_dissect_netrchardevqpurge_reply},
6681         {SRV_NETRCHARDEVQPURGESELF,     "NetrCharDevQPurgeSelf",
6682                 srvsvc_dissect_netrchardevqpurgeself_rqst,
6683                 srvsvc_dissect_netrchardevqpurgeself_reply},
6684         {SRV_NETRCONNECTIONENUM,        "NetrConnectionEnum",
6685                 srvsvc_dissect_netrconnectionenum_rqst,
6686                 srvsvc_dissect_netrconnectionenum_reply},
6687         {SRV_NETRFILEENUM,              "NetrFileEnum",
6688                 srvsvc_dissect_netrfileenum_rqst,
6689                 srvsvc_dissect_netrfileenum_reply},
6690         {SRV_NETRFILEGETINFO,           "NetrFileGetInfo",
6691                 srvsvc_dissect_netrfilegetinfo_rqst,
6692                 srvsvc_dissect_netrfilegetinfo_reply},
6693         {SRV_NETRFILECLOSE,             "NetrFileClose",
6694                 srvsvc_dissect_netrfileclose_rqst,
6695                 srvsvc_dissect_netrfileclose_reply},
6696         {SRV_NETRSESSIONENUM,           "NetrSessionEnum",
6697                 srvsvc_dissect_netrsessionenum_rqst,
6698                 srvsvc_dissect_netrsessionenum_reply},
6699         {SRV_NETRSESSIONDEL,            "NetrSessionDel",
6700                 srvsvc_dissect_netrsessiondel_rqst,
6701                 srvsvc_dissect_netrsessiondel_reply},
6702         {SRV_NETRSHAREADD,              "NetrShareAdd",
6703                 srvsvc_dissect_netrshareadd_rqst,
6704                 srvsvc_dissect_netrshareadd_reply},
6705         {SRV_NETRSHAREENUM,             "NetrShareEnum",
6706                 srvsvc_dissect_netrshareenum_rqst,
6707                 srvsvc_dissect_netrshareenum_reply},
6708         {SRV_NETRSHAREGETINFO,          "NetrShareGetInfo",
6709                 srvsvc_dissect_netrsharegetinfo_rqst,
6710                 srvsvc_dissect_netrsharegetinfo_reply},
6711         {SRV_NETRSHARESETINFO,          "NetrShareSetInfo",
6712                 srvsvc_dissect_netrsharesetinfo_rqst,
6713                 srvsvc_dissect_netrsharesetinfo_reply},
6714         {SRV_NETRSHAREDEL,              "NetrShareDel",
6715                 srvsvc_dissect_netrsharedel_rqst,
6716                 srvsvc_dissect_netrsharedel_reply},
6717         {SRV_NETRSHAREDELSTICKY,        "NetrShareDelSticky",
6718                 srvsvc_dissect_netrsharedelsticky_rqst,
6719                 srvsvc_dissect_netrsharedelsticky_reply},
6720         {SRV_NETRSHARECHECK,            "NetrShareCheck",
6721                 srvsvc_dissect_netrsharecheck_rqst,
6722                 srvsvc_dissect_netrsharecheck_reply},
6723         {SRV_NETRSERVERGETINFO,         "NetrServerGetInfo",
6724                 srvsvc_dissect_netrservergetinfo_rqst,
6725                 srvsvc_dissect_netrservergetinfo_reply},
6726         {SRV_NETRSERVERSETINFO,         "NetrServerSetInfo",
6727                 srvsvc_dissect_netrserversetinfo_rqst,
6728                 srvsvc_dissect_netrserversetinfo_reply},
6729         {SRV_NETRSERVERDISKENUM,        "NetrServerDiskEnum",
6730                 srvsvc_dissect_netrserverdiskenum_rqst,
6731                 srvsvc_dissect_netrserverdiskenum_reply},
6732         {SRV_NETRSERVERSTATISTICSGET,   "NetrServerStatisticsGet",
6733                 srvsvc_dissect_netrserverstatisticsget_rqst,
6734                 srvsvc_dissect_netrserverstatisticsget_reply},
6735         {SRV_NETRSERVERTRANSPORTADD,    "NetrServerTransportAdd",
6736                 srvsvc_dissect_netrservertransportadd_rqst,
6737                 srvsvc_dissect_netrservertransportadd_reply},
6738         {SRV_NETRSERVERTRANSPORTENUM,   "NetrServerTransportEnum",
6739                 srvsvc_dissect_netrservertransportenum_rqst,
6740                 srvsvc_dissect_netrservertransportenum_reply},
6741         {SRV_NETRSERVERTRANSPORTDEL,    "NetrServerTransportDel",
6742                 srvsvc_dissect_netrservertransportdel_rqst,
6743                 srvsvc_dissect_netrservertransportdel_reply},
6744         {SRV_NETRREMOTETOD,             "NetrRemoteTOD",
6745                 srvsvc_dissect_netrremotetod_rqst,
6746                 srvsvc_dissect_netrremotetod_reply},
6747         {SRV_NETRSERVERSETSERVICEBITS,  "NetrServerSetServiceBits",
6748                 srvsvc_dissect_netrsetserverservicebits_rqst,
6749                 srvsvc_dissect_netrsetserverservicebits_reply},
6750         {SRV_NETRPRPATHTYPE,            "NetrPathType",
6751                 srvsvc_dissect_netrpathtype_rqst,
6752                 srvsvc_dissect_netrpathtype_reply},
6753         {SRV_NETRPRPATHCANONICALIZE,    "NetrpPathCanonicalize",
6754                 srvsvc_dissect_netrpathcanonicalize_rqst,
6755                 srvsvc_dissect_netrpathcanonicalize_reply},
6756         {SRV_NETRPRPATHCOMPARE,         "NetrpPathCompare",
6757                 srvsvc_dissect_netrpathcompare_rqst,
6758                 srvsvc_dissect_netrpathcompare_reply},
6759         {SRV_NETRPRNAMEVALIDATE,        "NetrpNameValidate",
6760                 srvsvc_dissect_netrnamevalidate_rqst,
6761                 srvsvc_dissect_netrnamevalidate_reply},
6762         {SRV_NETRPRNAMECANONICALIZE,    "NetrpNameCanonicalize",
6763                 srvsvc_dissect_netrnamecanonicalize_rqst,
6764                 srvsvc_dissect_netrnamecanonicalize_reply},
6765         {SRV_NETRPRNAMECOMPARE,         "NetrpNameCompare",
6766                 srvsvc_dissect_netrnamecompare_rqst,
6767                 srvsvc_dissect_netrnamecompare_reply},
6768         {SRV_NETRSHAREENUMSTICKY,       "NetrShareEnumSticky",
6769                 srvsvc_dissect_netrshareenumsticky_rqst,
6770                 srvsvc_dissect_netrshareenumsticky_reply},
6771         {SRV_NETRSHAREDELSTART,         "NetrShareDelStart",
6772                 srvsvc_dissect_netrsharedelstart_rqst,
6773                 srvsvc_dissect_netrsharedelstart_reply},
6774         {SRV_NETRSHAREDELCOMMIT,        "NetrShareDelCommit",
6775                 srvsvc_dissect_netrsharedelcommit_rqst,
6776                 srvsvc_dissect_netrsharedelcommit_reply},
6777         {SRV_NETRPGETFILESECURITY,      "NetrpGetFileSecurity",
6778                 srvsvc_dissect_netrgetfilesecurity_rqst,
6779                 srvsvc_dissect_netrgetfilesecurity_reply},
6780         {SRV_NETRPSETFILESECURITY,      "NetrpSetFileSecurity",
6781                 srvsvc_dissect_netrsetfilesecurity_rqst,
6782                 srvsvc_dissect_netrsetfilesecurity_reply},
6783         {SRV_NETRSERVERTRANSPORTADDEX,  "NetrServerTransportAddEx",
6784                 srvsvc_dissect_netrservertransportaddex_rqst,
6785                 srvsvc_dissect_netrservertransportaddex_reply},
6786         {SRV_NETRSERVERSETSERVICEBITS2, "NetrServerSetServiceBits2",
6787                 srvsvc_dissect_netrserversetservicebits2_rqst,
6788                 srvsvc_dissect_netrserversetservicebits2_reply},
6789         {0, NULL, NULL, NULL}
6790 };
6791
6792 static const value_string platform_id_vals[] = {
6793         { 300, "DOS" },
6794         { 400, "OS/2" },
6795         { 500, "Windows NT" },
6796         { 600, "OSF" },
6797         { 700, "VMS" },
6798         { 0,   NULL }
6799 };
6800
6801 static const value_string srvsvc_opnum_vals[] = {
6802         {SRV_NETRCHARDEVENUM,           "NetrCharDevEnum" },
6803         {SRV_NETRCHARDEVGETINFO,        "NetrCharDevGetInfo" },
6804         {SRV_NETRCHARDEVCONTROL,        "NetrCharDevControl" },
6805         {SRV_NETRCHARDEVQENUM,          "NetrCharDevQEnum" },
6806         {SRV_NETRCHARDEVQGETINFO,       "NetrCharDevQGetInfo" },
6807         {SRV_NETRCHARDEVQSETINFO,       "NetrCharDevQSetInfo" },
6808         {SRV_NETRCHARDEVQPURGE,         "NetrCharDevQPurge" },
6809         {SRV_NETRCHARDEVQPURGESELF,     "NetrCharDevQPurgeSelf" },
6810         {SRV_NETRCONNECTIONENUM,        "NetrConnectionEnum" },
6811         {SRV_NETRFILEENUM,              "NetrFileEnum" },
6812         {SRV_NETRFILEGETINFO,           "NetrFileGetInfo" },
6813         {SRV_NETRFILECLOSE,             "NetrFileClose" },
6814         {SRV_NETRSESSIONENUM,           "NetrSessionEnum" },
6815         {SRV_NETRSESSIONDEL,            "NetrSessionDel" },
6816         {SRV_NETRSHAREADD,              "NetrShareAdd" },
6817         {SRV_NETRSHAREENUM,             "NetrShareEnum" },
6818         {SRV_NETRSHAREGETINFO,          "NetrShareGetInfo" },
6819         {SRV_NETRSHARESETINFO,          "NetrShareSetInfo" },
6820         {SRV_NETRSHAREDEL,              "NetrShareDel" },
6821         {SRV_NETRSHAREDELSTICKY,        "NetrShareDelSticky" },
6822         {SRV_NETRSHARECHECK,            "NetrShareCheck" },
6823         {SRV_NETRSERVERGETINFO,         "NetrServerGetInfo" },
6824         {SRV_NETRSERVERSETINFO,         "NetrServerSetInfo" },
6825         {SRV_NETRSERVERDISKENUM,        "NetrServerDiskEnum" },
6826         {SRV_NETRSERVERSTATISTICSGET,   "NetrServerStatisticsGet" },
6827         {SRV_NETRSERVERTRANSPORTADD,    "NetrServerTransportAdd" },
6828         {SRV_NETRSERVERTRANSPORTENUM,   "NetrServerTransportEnum" },
6829         {SRV_NETRSERVERTRANSPORTDEL,    "NetrServerTransportDel" },
6830         {SRV_NETRREMOTETOD,             "NetrRemoteTOD" },
6831         {SRV_NETRSERVERSETSERVICEBITS,  "NetrServerSetServiceBits" },
6832         {SRV_NETRPRPATHTYPE,            "NetrPathType" },
6833         {SRV_NETRPRPATHCANONICALIZE,    "NetrpPathCanonicalize" },
6834         {SRV_NETRPRPATHCOMPARE,         "NetrpPathCompare" },
6835         {SRV_NETRPRNAMEVALIDATE,        "NetrpNameValidate" },
6836         {SRV_NETRPRNAMECANONICALIZE,    "NetrpNameCanonicalize" },
6837         {SRV_NETRPRNAMECOMPARE,         "NetrpNameCompare" },
6838         {SRV_NETRSHAREENUMSTICKY,       "NetrShareEnumSticky" },
6839         {SRV_NETRSHAREDELSTART,         "NetrShareDelStart" },
6840         {SRV_NETRSHAREDELCOMMIT,        "NetrShareDelCommit" },
6841         {SRV_NETRPGETFILESECURITY,      "NetrpGetFileSecurity" },
6842         {SRV_NETRPSETFILESECURITY,      "NetrpSetFileSecurity" },
6843         {SRV_NETRSERVERTRANSPORTADDEX,  "NetrServerTransportAddEx" },
6844         {SRV_NETRSERVERSETSERVICEBITS2, "NetrServerSetServiceBits2" },
6845         {0, NULL }
6846 };
6847
6848 void
6849 proto_register_dcerpc_srvsvc(void)
6850 {
6851         static hf_register_info hf[] = {
6852           { &hf_srvsvc_opnum,
6853             { "Operation", "srvsvc.opnum", FT_UINT16, BASE_DEC,
6854               VALS(srvsvc_opnum_vals), 0x0, "Operation", HFILL }},
6855           { &hf_srvsvc_server,
6856             { "Server", "srvsvc.server", FT_STRING, BASE_NONE,
6857             NULL, 0x0, "Server Name", HFILL}},
6858           { &hf_srvsvc_emulated_server,
6859             { "Emulated Server", "srvsvc.emulated_server", FT_STRING, BASE_NONE,
6860             NULL, 0x0, "Emulated Server Name", HFILL}},
6861           { &hf_srvsvc_alerts,
6862             { "Alerts", "srvsvc.alerts", FT_STRING, BASE_NONE,
6863             NULL, 0x0, "Alerts", HFILL}},
6864           { &hf_srvsvc_guest,
6865             { "Guest Account", "srvsvc.guest", FT_STRING, BASE_NONE,
6866             NULL, 0x0, "Guest Account", HFILL}},
6867           { &hf_srvsvc_transport,
6868             { "Transport", "srvsvc.transport", FT_STRING, BASE_NONE,
6869             NULL, 0x0, "Transport Name", HFILL}},
6870           { &hf_srvsvc_session,
6871             { "Session", "srvsvc.session", FT_STRING, BASE_NONE,
6872             NULL, 0x0, "Session Name", HFILL}},
6873           { &hf_srvsvc_qualifier,
6874             { "Qualifier", "srvsvc.qualifier", FT_STRING, BASE_NONE,
6875             NULL, 0x0, "Connection Qualifier", HFILL}},
6876           { &hf_srvsvc_computer,
6877             { "Computer", "srvsvc.computer", FT_STRING, BASE_NONE,
6878             NULL, 0x0, "Computer Name", HFILL}},
6879           { &hf_srvsvc_chrdev,
6880             { "Char Device", "srvsvc.chrdev", FT_STRING, BASE_NONE,
6881             NULL, 0x0, "Char Device Name", HFILL}},
6882           { &hf_srvsvc_chrdevq,
6883             { "Device Queue", "srvsvc.chrdevq", FT_STRING, BASE_NONE,
6884             NULL, 0x0, "Char Device Queue Name", HFILL}},
6885           { &hf_srvsvc_user,
6886             { "User", "srvsvc.user", FT_STRING, BASE_NONE,
6887             NULL, 0x0, "User Name", HFILL}},
6888           { &hf_srvsvc_path,
6889             { "Path", "srvsvc.path", FT_STRING, BASE_NONE,
6890             NULL, 0x0, "Path", HFILL}},
6891           { &hf_srvsvc_share_passwd,
6892             { "Share Passwd", "srvsvc.share_passwd", FT_STRING, BASE_NONE,
6893             NULL, 0x0, "Password for this share", HFILL}},
6894           { &hf_srvsvc_share_alternate_name,
6895             { "Alternate Name", "srvsvc.share_alternate_name", FT_STRING, BASE_NONE,
6896             NULL, 0x0, "Alternate name for this share", HFILL}},
6897           { &hf_srvsvc_chrdev_status,
6898             { "Status", "srvsvc.chrdev_status", FT_UINT32, BASE_HEX,
6899             NULL, 0x0, "Char Device Status", HFILL}},
6900           { &hf_srvsvc_chrqpri,
6901             { "Priority", "srvsvc.chrqdev_pri", FT_UINT32, BASE_HEX,
6902             NULL, 0x0, "Char QDevice Priority", HFILL}},
6903           { &hf_srvsvc_chrqnumusers,
6904             { "Num Users", "srvsvc.chrqdev_numusers", FT_UINT32, BASE_DEC,
6905             NULL, 0x0, "Char QDevice Number Of Users", HFILL}},
6906           { &hf_srvsvc_chrqnumahead,
6907             { "Num Ahead", "srvsvc.chrqdev_numahead", FT_UINT32, BASE_DEC,
6908             NULL, 0x0, "", HFILL}},
6909           { &hf_srvsvc_chrdev_opcode,
6910             { "Opcode", "srvsvc.chrdev_opcode", FT_UINT32, BASE_HEX,
6911             NULL, 0x0, "Opcode to apply to the Char Device", HFILL}},
6912           { &hf_srvsvc_chrdev_time,
6913             { "Time", "srvsvc.chrdev_time", FT_UINT32, BASE_DEC,
6914             NULL, 0x0, "Char Device Time?", HFILL}},
6915           { &hf_srvsvc_info_level,
6916             { "Info Level", "svrsvc.info_level", FT_UINT32,
6917             BASE_DEC, NULL, 0x0, "Info Level", HFILL}},
6918           { &hf_srvsvc_rc,
6919             { "Return code", "srvsvc.rc", FT_UINT32,
6920               BASE_HEX, VALS(DOS_errors), 0x0, "Return Code", HFILL}},
6921
6922           { &hf_srvsvc_platform_id,
6923             { "Platform ID", "srvsvc.info.platform_id", FT_UINT32,
6924               BASE_DEC, VALS(platform_id_vals), 0x0, "Platform ID", HFILL}},
6925           { &hf_srvsvc_ver_major,
6926             { "Major Version", "srvsvc.version.major", FT_UINT32,
6927               BASE_DEC, NULL, 0x0, "Major Version", HFILL}},
6928           { &hf_srvsvc_ver_minor,
6929             { "Minor Version", "srvsvc.version.minor", FT_UINT32,
6930               BASE_DEC, NULL, 0x0, "Minor Version", HFILL}},
6931           { &hf_srvsvc_client_type,
6932             { "Client Type", "srvsvc.client.type", FT_STRING,
6933               BASE_NONE, NULL, 0x0, "Client Type", HFILL}},
6934           { &hf_srvsvc_comment,
6935             { "Comment", "srvsvc.comment", FT_STRING,
6936               BASE_NONE, NULL, 0x0, "Comment", HFILL}},
6937           { &hf_srvsvc_users,
6938             { "Users", "srvsvc.users", FT_UINT32,
6939               BASE_DEC, NULL, 0x0 , "User Count", HFILL}},
6940           { &hf_srvsvc_disc,
6941             { "Disc", "srvsvc.disc", FT_UINT32,
6942               BASE_DEC, NULL, 0x0 , "", HFILL}},
6943           { &hf_srvsvc_hidden,
6944             { "Hidden", "srvsvc.hidden", FT_UINT32,
6945               BASE_DEC, NULL, 0x0, "Hidden", HFILL}},
6946           { &hf_srvsvc_reserved,
6947             { "Reserved", "srvsvc.reserved", FT_UINT32,
6948               BASE_DEC, NULL, 0x0, "Announce", HFILL }},
6949           { &hf_srvsvc_announce,
6950             { "Announce", "srvsvc.announce", FT_UINT32,
6951               BASE_DEC, NULL, 0x0, "Announce", HFILL }},
6952           { &hf_srvsvc_anndelta,
6953             { "Announce Delta", "srvsvc.ann_delta", FT_UINT32,
6954               BASE_DEC, NULL, 0x0, "Announce Delta", HFILL}},
6955           { &hf_srvsvc_licences,
6956             { "Licences", "srvsvc.licences", FT_UINT32,
6957               BASE_DEC, NULL, 0x0, "Licences", HFILL}},
6958           { &hf_srvsvc_user_path,
6959             { "User Path", "srvsvc.user_path", FT_STRING,
6960               BASE_NONE, NULL, 0x0, "User Path", HFILL}},
6961           { &hf_srvsvc_share,
6962             { "Share", "srvsvc.share", FT_STRING,
6963               BASE_NONE, NULL, 0x0, "Share", HFILL}},
6964           { &hf_srvsvc_share_type,
6965             { "Share Type", "srvsvc.share_type", FT_UINT32,
6966               BASE_HEX, VALS(share_type_vals), 0x0, "Share Type", HFILL}},
6967           { &hf_srvsvc_file_id,
6968             { "File ID", "srvsvc.file_id", FT_UINT32,
6969               BASE_DEC, NULL, 0x0, "File ID", HFILL}},
6970           { &hf_srvsvc_perm,
6971             { "Permissions", "srvsvc.perm", FT_UINT32,
6972               BASE_HEX, NULL, 0x0, "Permissions", HFILL}},
6973           { &hf_srvsvc_dfs_root_flags,
6974             { "DFS Root Flags", "srvsvc.dfs_root_flags", FT_UINT32,
6975               BASE_HEX, NULL, 0x0, "DFS Root Flags. Contact ethereal developers if you know what the bits are", HFILL}},
6976           { &hf_srvsvc_policy,
6977             { "Policy", "srvsvc.policy", FT_UINT32,
6978               BASE_HEX, NULL, 0x0, "Policy", HFILL}},
6979           { &hf_srvsvc_file_num_locks,
6980             { "Num Locks", "srvsvc.file_num_locks", FT_UINT32,
6981               BASE_DEC, NULL, 0x0, "Number of locks for file", HFILL}},
6982           { &hf_srvsvc_con_id,
6983             { "Connection ID", "srvsvc.con_id", FT_UINT32,
6984               BASE_DEC, NULL, 0x0, "Connection ID", HFILL}},
6985           { &hf_srvsvc_max_uses,
6986             { "Max Uses", "srvsvc.max_uses", FT_UINT32,
6987               BASE_DEC, NULL, 0x0, "Max Uses", HFILL}},
6988           { &hf_srvsvc_cur_uses,
6989             { "Current Uses", "srvsvc.cur_uses", FT_UINT32,
6990               BASE_DEC, NULL, 0x0, "Current Uses", HFILL}},
6991           { &hf_srvsvc_con_num_opens,
6992             { "Num Opens", "srvsvc.con_num_opens", FT_UINT32,
6993               BASE_DEC, NULL, 0x0, "Num Opens", HFILL}},
6994           { &hf_srvsvc_session_num_opens,
6995             { "Num Opens", "srvsvc.session.num_opens", FT_UINT32,
6996               BASE_DEC, NULL, 0x0, "Num Opens", HFILL}},
6997           { &hf_srvsvc_session_time,
6998             { "Time", "srvsvc.session.time", FT_UINT32,
6999               BASE_DEC, NULL, 0x0, "Time", HFILL}},
7000           { &hf_srvsvc_session_idle_time,
7001             { "Idle Time", "srvsvc.session.idle_time", FT_UINT32,
7002               BASE_DEC, NULL, 0x0, "Idle Time", HFILL}},
7003           { &hf_srvsvc_session_user_flags,
7004             { "User Flags", "srvsvc.session.user_flags", FT_UINT32,
7005               BASE_HEX, NULL, 0x0, "User Flags", HFILL}},
7006           { &hf_srvsvc_con_type,
7007             { "Connection Type", "srvsvc.con_type", FT_UINT32,
7008               BASE_DEC, NULL, 0x0, "Connection Type", HFILL}},
7009           { &hf_srvsvc_con_time,
7010             { "Connection Time", "srvsvc.con_time", FT_UINT32,
7011               BASE_DEC, NULL, 0x0, "Connection Time", HFILL}},
7012           { &hf_srvsvc_ulist_mtime,
7013             { "Ulist mtime", "srvsvc.ulist_mtime", FT_UINT32,
7014               BASE_DEC, NULL, 0x0, "Ulist mtime", HFILL}},
7015           { &hf_srvsvc_glist_mtime,
7016             { "Glist mtime", "srvsvc.glist_mtime", FT_UINT32,
7017               BASE_DEC, NULL, 0x0, "Glist mtime", HFILL}},
7018           { &hf_srvsvc_alist_mtime,
7019             { "Alist mtime", "srvsvc.alist_mtime", FT_UINT32,
7020               BASE_DEC, NULL, 0x0, "Alist mtime", HFILL}},
7021           { &hf_srvsvc_connections,
7022             { "Connections", "srvsvc.connections", FT_UINT32,
7023               BASE_DEC, NULL, 0x0, "Number of Connections", HFILL}},
7024           { &hf_srvsvc_shares,
7025             { "Shares", "srvsvc.shares", FT_UINT32,
7026               BASE_DEC, NULL, 0x0, "Number of Shares", HFILL}},
7027           { &hf_srvsvc_diskalert,
7028             { "Disk Alerts", "srvsvc.diskalert", FT_UINT32,
7029               BASE_DEC, NULL, 0x0, "Number of disk alerts", HFILL}},
7030           { &hf_srvsvc_netioalert,
7031             { "Net I/O Alerts", "srvsvc.netioalert", FT_UINT32,
7032               BASE_DEC, NULL, 0x0, "Number of Net I/O Alerts", HFILL}},
7033           { &hf_srvsvc_maxauditsz,
7034             { "Max Audits", "srvsvc.maxaudits", FT_UINT32,
7035               BASE_DEC, NULL, 0x0, "Maximum number of audits", HFILL}},
7036           { &hf_srvsvc_srvheuristics,
7037             { "Server Heuristics", "srvsvc.srvheuristics", FT_STRING,
7038               BASE_DEC, NULL, 0x0, "Server Heuristics", HFILL}},
7039           { &hf_srvsvc_openfiles,
7040             { "Open Files", "srvsvc.openfiles", FT_UINT32,
7041               BASE_DEC, NULL, 0x0, "Open Files", HFILL}},
7042           { &hf_srvsvc_opensearch,
7043             { "Open Search", "srvsvc.opensearch", FT_UINT32,
7044               BASE_DEC, NULL, 0x0, "Open Search", HFILL}},
7045           { &hf_srvsvc_activelocks,
7046             { "Active Locks", "srvsvc.activelocks", FT_UINT32,
7047               BASE_DEC, NULL, 0x0, "Active Locks", HFILL}},
7048           { &hf_srvsvc_numfiletasks,
7049             { "Num Filetasks", "srvsvc.numfiletasks", FT_UINT32,
7050               BASE_DEC, NULL, 0x0, "Number of filetasks", HFILL}},
7051           { &hf_srvsvc_alertsched,
7052             { "Alert Sched", "srvsvc.alertsched", FT_UINT32,
7053               BASE_DEC, NULL, 0x0, "Alert Schedule", HFILL}},
7054           { &hf_srvsvc_erroralert,
7055             { "Error Alerts", "srvsvc.erroralert", FT_UINT32,
7056               BASE_DEC, NULL, 0x0, "Number of error alerts", HFILL}},
7057           { &hf_srvsvc_logonalert,
7058             { "Logon Alerts", "srvsvc.logonalert", FT_UINT32,
7059               BASE_DEC, NULL, 0x0, "Number of logon alerts", HFILL}},
7060           { &hf_srvsvc_accessalert,
7061             { "Access Alerts", "srvsvc.accessalert", FT_UINT32,
7062               BASE_DEC, NULL, 0x0, "Number of access alerts", HFILL}},
7063           { &hf_srvsvc_sizreqbufs,
7064             { "Siz Req Bufs", "srvsvc.sizreqbufs", FT_UINT32,
7065               BASE_DEC, NULL, 0x0, "", HFILL}},
7066           { &hf_srvsvc_numbigbufs,
7067             { "Num Big Bufs", "srvsvc.numbigbufs", FT_UINT32,
7068               BASE_DEC, NULL, 0x0, "Number of big buffers", HFILL}},
7069           { &hf_srvsvc_sessopens,
7070             { "Sessions Open", "srvsvc.sessopens", FT_UINT32,
7071               BASE_DEC, NULL, 0x0, "Sessions Open", HFILL}},
7072           { &hf_srvsvc_sessvcs,
7073             { "Sessions VCs", "srvsvc.sessvcs", FT_UINT32,
7074               BASE_DEC, NULL, 0x0, "Sessions VCs", HFILL}},
7075           { &hf_srvsvc_sessreqs,
7076             { "Sessions Reqs", "srvsvc.sessreqs", FT_UINT32,
7077               BASE_DEC, NULL, 0x0, "Sessions Requests", HFILL}},
7078           { &hf_srvsvc_auditedevents,
7079             { "Audited Events", "srvsvc.auditedevents", FT_UINT32,
7080               BASE_DEC, NULL, 0x0, "Number of audited events", HFILL}},
7081           { &hf_srvsvc_auditprofile,
7082             { "Audit Profile", "srvsvc.auditprofile", FT_UINT32,
7083               BASE_HEX, NULL, 0x0, "Audit Profile", HFILL}},
7084           { &hf_srvsvc_autopath,
7085             { "Autopath", "srvsvc.autopath", FT_STRING,
7086               BASE_DEC, NULL, 0x0, "Autopath", HFILL}},
7087           { &hf_srvsvc_security,
7088             { "Security", "srvsvc.security", FT_UINT32,
7089               BASE_HEX, NULL, 0x0, "Security", HFILL}},
7090           { &hf_srvsvc_numadmin,
7091             { "Num Admins", "srvsvc.num_admins", FT_UINT32,
7092               BASE_DEC, NULL, 0x0, "Number of Administrators", HFILL}},
7093           { &hf_srvsvc_lanmask,
7094             { "LANMask", "srvsvc.lanmask", FT_UINT32,
7095               BASE_HEX, NULL, 0x0, "LANMask", HFILL}},
7096           { &hf_srvsvc_chdevs,
7097             { "Char Devs", "srvsvc.chdevs", FT_UINT32,
7098               BASE_DEC, NULL, 0x0, "Number of Char Devices", HFILL}},
7099           { &hf_srvsvc_chdevqs,
7100             { "Char Devqs", "srvsvc.chdevqs", FT_UINT32,
7101               BASE_DEC, NULL, 0x0, "Number of Char Device Queues", HFILL}},
7102           { &hf_srvsvc_chdevjobs,
7103             { "Char Dev Jobs", "srvsvc.chdevjobs", FT_UINT32,
7104               BASE_DEC, NULL, 0x0, "Number of Char Device Jobs", HFILL}},
7105           { &hf_srvsvc_num_entries,
7106             { "Number of entries", "srvsvc.share.num_entries", FT_UINT32,
7107               BASE_DEC, NULL, 0x0, "Number of Entries", HFILL}},
7108           { &hf_srvsvc_initworkitems,
7109             { "Init Workitems", "srvsvc.initworkitems", FT_UINT32,
7110               BASE_DEC, NULL, 0x0, "Workitems", HFILL}},
7111           { &hf_srvsvc_maxworkitems,
7112             { "Max Workitems", "srvsvc.maxworkitems", FT_UINT32,
7113               BASE_DEC, NULL, 0x0, "Workitems", HFILL}},
7114           { &hf_srvsvc_rawworkitems,
7115             { "Raw Workitems", "srvsvc.rawworkitems", FT_UINT32,
7116               BASE_DEC, NULL, 0x0, "Workitems", HFILL}},
7117           { &hf_srvsvc_preferred_len,
7118             { "Preferred length", "srvsvc.preferred_len", FT_UINT32,
7119               BASE_DEC, NULL, 0x0, "Preferred Length", HFILL}},
7120           { &hf_srvsvc_parm_error,
7121             { "Parameter Error", "srvsvc.parm_error", FT_UINT32,
7122               BASE_DEC, NULL, 0x0, "Parameter Error", HFILL}},
7123           { &hf_srvsvc_enum_handle,
7124             { "Enumeration handle", "srvsvc.enum_hnd", FT_BYTES,
7125               BASE_HEX, NULL, 0x0, "Enumeration Handle", HFILL}},
7126           { &hf_srvsvc_irpstacksize,
7127             { "Irp Stack Size", "srvsvc.irpstacksize", FT_UINT32,
7128               BASE_HEX, NULL, 0x0, "Irp Stack Size", HFILL}},
7129           { &hf_srvsvc_maxrawbuflen,
7130             { "Max Raw Buf Len", "srvsvc.", FT_UINT32,
7131               BASE_HEX, NULL, 0x0, "Max Raw Buf Len", HFILL}},
7132           { &hf_srvsvc_maxpagedmemoryusage,
7133             { "Max Paged Memory Usage", "srvsvc.maxpagedmemoryusage", FT_UINT32,
7134               BASE_HEX, NULL, 0x0, "Max Paged Memory Usage", HFILL}},
7135           { &hf_srvsvc_maxnonpagedmemoryusage,
7136             { "Max Non-Paged Memory Usage", "srvsvc.maxnonpagedmemoryusage", FT_UINT32,
7137               BASE_HEX, NULL, 0x0, "Max Non-Paged Memory Usage", HFILL}},
7138           { &hf_srvsvc_enablesoftcompat,
7139             { "Enable Soft Compat", "srvsvc.enablesoftcompat", FT_UINT32,
7140               BASE_HEX, NULL, 0x0, "Enable Soft Compat", HFILL}},
7141           { &hf_srvsvc_enableforcedlogoff,
7142             { "Enable Forced Logoff", "srvsvc.enableforcedlogoff", FT_UINT32,
7143               BASE_HEX, NULL, 0x0, "Enable Forced Logoff", HFILL}},
7144           { &hf_srvsvc_timesource,
7145             { "Timesource", "srvsvc.timesource", FT_UINT32,
7146               BASE_HEX, NULL, 0x0, "Timesource", HFILL}},
7147           { &hf_srvsvc_acceptdownlevelapis,
7148             { "Accept Downlevel APIs", "srvsvc.acceptdownlevelapis", FT_UINT32,
7149               BASE_HEX, NULL, 0x0, "Accept Downlevel APIs", HFILL}},
7150           { &hf_srvsvc_lmannounce,
7151             { "LM Announce", "srvsvc.lmannounce", FT_UINT32,
7152               BASE_HEX, NULL, 0x0, "LM Announce", HFILL}},
7153           { &hf_srvsvc_domain,
7154             { "Domain", "srvsvc.domain", FT_STRING,
7155               BASE_HEX, NULL, 0x0, "Domain", HFILL}},
7156           { &hf_srvsvc_maxcopyreadlen,
7157             { "Max Copy Read Len", "srvsvc.maxcopyreadlen", FT_UINT32,
7158               BASE_DEC, NULL, 0x0, "Max Copy Read Len", HFILL}},
7159           { &hf_srvsvc_maxcopywritelen,
7160             { "Max Copy Write Len", "srvsvc.maxcopywritelen", FT_UINT32,
7161               BASE_DEC, NULL, 0x0, "Max Copy Write Len", HFILL}},
7162           { &hf_srvsvc_minkeepsearch,
7163             { "Min Keep Search", "srvsvc.minkeepsearch", FT_UINT32,
7164               BASE_DEC, NULL, 0x0, "Min Keep Search", HFILL}},
7165           { &hf_srvsvc_maxkeepsearch,
7166             { "Max Keep Search", "srvsvc.maxkeepsearch", FT_UINT32,
7167               BASE_DEC, NULL, 0x0, "Max Keep Search", HFILL}},
7168           { &hf_srvsvc_minkeepcomplsearch,
7169             { "Min Keep Compl Search", "srvsvc.minkeepcomplsearch", FT_UINT32,
7170               BASE_DEC, NULL, 0x0, "Min Keep Compl Search", HFILL}},
7171           { &hf_srvsvc_maxkeepcomplsearch,
7172             { "Max Keep Compl Search", "srvsvc.maxkeepcomplsearch", FT_UINT32,
7173               BASE_DEC, NULL, 0x0, "Max Keep Compl Search", HFILL}},
7174           { &hf_srvsvc_threadcountadd,
7175             { "Thread Count Add", "srvsvc.threadcountadd", FT_UINT32,
7176               BASE_DEC, NULL, 0x0, "Thread Count Add", HFILL}},
7177           { &hf_srvsvc_numblockthreads,
7178             { "Num Block Threads", "srvsvc.numblockthreads", FT_UINT32,
7179               BASE_DEC, NULL, 0x0, "Num Block Threads", HFILL}},
7180           { &hf_srvsvc_scavtimeout,
7181             { "Scav Timeout", "srvsvc.scavtimeout", FT_UINT32,
7182               BASE_DEC, NULL, 0x0, "Scav Timeout", HFILL}},
7183           { &hf_srvsvc_minrcvqueue,
7184             { "Min Rcv Queue", "srvsvc.minrcvqueue", FT_UINT32,
7185               BASE_DEC, NULL, 0x0, "Min Rcv Queue", HFILL}},
7186           { &hf_srvsvc_minfreeworkitems,
7187             { "Min Free Workitems", "srvsvc.minfreeworkitems", FT_UINT32,
7188               BASE_DEC, NULL, 0x0, "Min Free Workitems", HFILL}},
7189           { &hf_srvsvc_xactmemsize,
7190             { "Xact Mem Size", "srvsvc.xactmemsize", FT_UINT32,
7191               BASE_DEC, NULL, 0x0, "Xact Mem Size", HFILL}},
7192           { &hf_srvsvc_threadpriority,
7193             { "Thread Priority", "srvsvc.threadpriority", FT_UINT32,
7194               BASE_DEC, NULL, 0x0, "Thread Priority", HFILL}},
7195           { &hf_srvsvc_maxmpxct,
7196             { "MaxMpxCt", "srvsvc.maxmpxct", FT_UINT32,
7197               BASE_DEC, NULL, 0x0, "MaxMpxCt", HFILL}},
7198           { &hf_srvsvc_oplockbreakwait,
7199             { "Oplock Break Wait", "srvsvc.oplockbreakwait", FT_UINT32,
7200               BASE_DEC, NULL, 0x0, "Oplock Break Wait", HFILL}},
7201           { &hf_srvsvc_oplockbreakresponsewait,
7202             { "Oplock Break Response wait", "srvsvc.oplockbreakresponsewait", FT_UINT32,
7203               BASE_DEC, NULL, 0x0, "Oplock Break response Wait", HFILL}},
7204           { &hf_srvsvc_enableoplocks,
7205             { "Enable Oplocks", "srvsvc.enableoplocks", FT_UINT32,
7206               BASE_DEC, NULL, 0x0, "Enable Oplocks", HFILL}},
7207           { &hf_srvsvc_enableoplockforceclose,
7208             { "Enable Oplock Force Close", "srvsvc.enableoplockforceclose", FT_UINT32,
7209               BASE_DEC, NULL, 0x0, "Enable Oplock Force Close", HFILL}},
7210           { &hf_srvsvc_enablefcbopens,
7211             { "Enable FCB Opens", "srvsvc.enablefcbopens", FT_UINT32,
7212               BASE_DEC, NULL, 0x0, "Enable FCB Opens", HFILL}},
7213           { &hf_srvsvc_enableraw,
7214             { "Enable RAW", "srvsvc.enableraw", FT_UINT32,
7215               BASE_DEC, NULL, 0x0, "Enable RAW", HFILL}},
7216           { &hf_srvsvc_enablesharednetdrives,
7217             { "Enable Shared Net Drives", "srvsvc.enablesharednetdrives", FT_UINT32,
7218               BASE_DEC, NULL, 0x0, "Enable Shared Net Drives", HFILL}},
7219           { &hf_srvsvc_minfreeconnections,
7220             { "Min Free Conenctions", "srvsvc.minfreeconnections", FT_UINT32,
7221               BASE_DEC, NULL, 0x0, "Min Free Connections", HFILL}},
7222           { &hf_srvsvc_maxfreeconnections,
7223             { "Max Free Conenctions", "srvsvc.maxfreeconnections", FT_UINT32,
7224               BASE_DEC, NULL, 0x0, "Max Free Connections", HFILL}},
7225           { &hf_srvsvc_initsesstable,
7226             { "Init Session Table", "srvsvc.initsesstable", FT_UINT32,
7227               BASE_DEC, NULL, 0x0, "Init Session Table", HFILL}},
7228           { &hf_srvsvc_initconntable,
7229             { "Init Connection Table", "srvsvc.initconntable", FT_UINT32,
7230               BASE_DEC, NULL, 0x0, "Init Connection Table", HFILL}},
7231           { &hf_srvsvc_initfiletable,
7232             { "Init File Table", "srvsvc.initfiletable", FT_UINT32,
7233               BASE_DEC, NULL, 0x0, "Init File Table", HFILL}},
7234           { &hf_srvsvc_initsearchtable,
7235             { "Init Search Table", "srvsvc.initsearchtable", FT_UINT32,
7236               BASE_DEC, NULL, 0x0, "Init Search Table", HFILL}},
7237           { &hf_srvsvc_errortreshold,
7238             { "Error Treshold", "srvsvc.errortreshold", FT_UINT32,
7239               BASE_DEC, NULL, 0x0, "Error Treshold", HFILL}},
7240           { &hf_srvsvc_networkerrortreshold,
7241             { "Network Error Treshold", "srvsvc.networkerrortreshold", FT_UINT32,
7242               BASE_DEC, NULL, 0x0, "Network Error Treshold", HFILL}},
7243           { &hf_srvsvc_diskspacetreshold,
7244             { "Diskspace Treshold", "srvsvc.diskspacetreshold", FT_UINT32,
7245               BASE_DEC, NULL, 0x0, "Diskspace Treshold", HFILL}},
7246           { &hf_srvsvc_maxlinkdelay,
7247             { "Max Link Delay", "srvsvc.maxlinkdelay", FT_UINT32,
7248               BASE_DEC, NULL, 0x0, "Max Link Delay", HFILL}},
7249           { &hf_srvsvc_minlinkthroughput,
7250             { "Min Link Throughput", "srvsvc.minlinkthroughput", FT_UINT32,
7251               BASE_DEC, NULL, 0x0, "Min Link Throughput", HFILL}},
7252           { &hf_srvsvc_linkinfovalidtime,
7253             { "Link Info Valid Time", "srvsvc.linkinfovalidtime", FT_UINT32,
7254               BASE_DEC, NULL, 0x0, "Link Info Valid Time", HFILL}},
7255           { &hf_srvsvc_scavqosinfoupdatetime,
7256             { "Scav QoS Info Update Time", "srvsvc.scavqosinfoupdatetime", FT_UINT32,
7257               BASE_DEC, NULL, 0x0, "Scav QoS Info Update Time", HFILL}},
7258           { &hf_srvsvc_maxworkitemidletime,
7259             { "Max Workitem Idle Time", "srvsvc.maxworkitemidletime", FT_UINT32,
7260               BASE_DEC, NULL, 0x0, "Max Workitem Idle Time", HFILL}},
7261           { &hf_srvsvc_disk_name,
7262             { "Disk Name", "srvsvc.disk_name", FT_STRING,
7263               BASE_DEC, NULL, 0x0, "Disk Name", HFILL}},
7264           { &hf_srvsvc_disk_name_len,
7265             { "Disk Name Length", "srvsvc.disk_name_len", FT_UINT32,
7266               BASE_DEC, NULL, 0x0, "Length of Disk Name", HFILL}},
7267           { &hf_srvsvc_service,
7268             { "Service", "srvsvc.service", FT_STRING,
7269               BASE_DEC, NULL, 0x0, "Service", HFILL}},
7270           { &hf_srvsvc_service_options,
7271             { "Options", "srvsvc.service_options", FT_UINT32,
7272               BASE_HEX, NULL, 0x0, "Service Options", HFILL}},
7273           { &hf_srvsvc_transport_numberofvcs,
7274             { "VCs", "srvsvc.transport.num_vcs", FT_UINT32,
7275               BASE_DEC, NULL, 0x0, "Number of VCs for this transport", HFILL}},
7276           { &hf_srvsvc_transport_name,
7277             { "Name", "srvsvc.transport.name", FT_STRING,
7278               BASE_HEX, NULL, 0x0, "Name of transport", HFILL}},
7279           { &hf_srvsvc_transport_address,
7280             { "Address", "srvsvc.transport.address", FT_BYTES,
7281               BASE_HEX, NULL, 0x0, "Address of transport", HFILL}},
7282           { &hf_srvsvc_transport_address_len,
7283             { "Address Len", "srvsvc.transport.addresslen", FT_UINT32,
7284               BASE_DEC, NULL, 0x0, "Length of transport address", HFILL}},
7285           { &hf_srvsvc_transport_networkaddress,
7286             { "Network Address", "srvsvc.transport.networkaddress", FT_STRING,
7287               BASE_HEX, NULL, 0x0, "Network address for transport", HFILL}},
7288           { &hf_srvsvc_service_bits,
7289             { "Service Bits", "srvsvc.service_bits", FT_UINT32,
7290               BASE_HEX, NULL, 0x0, "Service Bits", HFILL}},
7291           { &hf_srvsvc_service_bits_of_interest,
7292             { "Service Bits Of Interest", "srvsvc.service_bits_of_interest", FT_UINT32,
7293               BASE_HEX, NULL, 0x0, "Service Bits Of Interest", HFILL}},
7294           { &hf_srvsvc_update_immediately,
7295             { "Update Immediately", "srvsvc.update_immediately", FT_UINT32,
7296               BASE_DEC, NULL, 0x0, "Update Immediately", HFILL}},
7297           { &hf_srvsvc_path_flags,
7298             { "Flags", "srvsvc.path_flags", FT_UINT32,
7299               BASE_HEX, NULL, 0x0, "Path flags", HFILL}},
7300           { &hf_srvsvc_share_flags,
7301             { "Flags", "srvsvc.share_flags", FT_UINT32,
7302               BASE_HEX, NULL, 0x0, "Share flags", HFILL}},
7303           { &hf_srvsvc_path_type,
7304             { "Type", "srvsvc.path_type", FT_UINT32,
7305               BASE_DEC, NULL, 0x0, "Path type", HFILL}},
7306           { &hf_srvsvc_path_len,
7307             { "Len", "srvsvc.path_len", FT_UINT32,
7308               BASE_DEC, NULL, 0x0, "Path len", HFILL}},
7309           { &hf_srvsvc_outbuflen,
7310             { "OutBufLen", "srvsvc.outbuflen", FT_UINT32,
7311               BASE_DEC, NULL, 0x0, "Output Buffer Length", HFILL}},
7312           { &hf_srvsvc_prefix,
7313             { "Prefix", "srvsvc.prefix", FT_STRING,
7314               BASE_HEX, NULL, 0x0, "Path Prefix", HFILL}},
7315           { &hf_srvsvc_hnd,
7316             { "Context Handle", "srvsvc.hnd", FT_BYTES,
7317               BASE_NONE, NULL, 0x0, "Context Handle", HFILL}},
7318           { &hf_srvsvc_server_stat_start,
7319             { "Start", "srvsvc.server_stat.start", FT_UINT32,
7320               BASE_DEC, NULL, 0x0, "", HFILL}},
7321           { &hf_srvsvc_server_stat_fopens,
7322             { "Fopens", "srvsvc.server_stat.fopens", FT_UINT32,
7323               BASE_DEC, NULL, 0x0, "Number of fopens", HFILL}},
7324           { &hf_srvsvc_server_stat_devopens,
7325             { "Devopens", "srvsvc.server_stat.devopens", FT_UINT32,
7326               BASE_DEC, NULL, 0x0, "Number of devopens", HFILL}},
7327           { &hf_srvsvc_server_stat_jobsqueued,
7328             { "Jobs Queued", "srvsvc.server_stat.jobsqueued", FT_UINT32,
7329               BASE_DEC, NULL, 0x0, "Number of jobs queued", HFILL}},
7330           { &hf_srvsvc_server_stat_sopens,
7331             { "Sopens", "srvsvc.server_stat.sopens", FT_UINT32,
7332               BASE_DEC, NULL, 0x0, "Number of sopens", HFILL}},
7333           { &hf_srvsvc_server_stat_stimeouts,
7334             { "stimeouts", "srvsvc.server_stat.stimeouts", FT_UINT32,
7335               BASE_DEC, NULL, 0x0, "Number of stimeouts", HFILL}},
7336           { &hf_srvsvc_server_stat_serrorout,
7337             { "Serrorout", "srvsvc.server_stat.serrorout", FT_UINT32,
7338               BASE_DEC, NULL, 0x0, "Number of serrorout", HFILL}},
7339           { &hf_srvsvc_server_stat_pwerrors,
7340             { "Pwerrors", "srvsvc.server_stat.pwerrors", FT_UINT32,
7341               BASE_DEC, NULL, 0x0, "Number of password errors", HFILL}},
7342           { &hf_srvsvc_server_stat_permerrors,
7343             { "Permerrors", "srvsvc.server_stat.permerrors", FT_UINT32,
7344               BASE_DEC, NULL, 0x0, "Number of permission errors", HFILL}},
7345           { &hf_srvsvc_server_stat_syserrors,
7346             { "Syserrors", "srvsvc.server_stat.syserrors", FT_UINT32,
7347               BASE_DEC, NULL, 0x0, "Number of system errors", HFILL}},
7348           { &hf_srvsvc_server_stat_bytessent,
7349             { "Bytes Sent", "srvsvc.server_stat.bytessent", FT_UINT64,
7350               BASE_DEC, NULL, 0x0, "Number of bytes sent", HFILL}},
7351           { &hf_srvsvc_server_stat_bytesrcvd,
7352             { "Bytes Rcvd", "srvsvc.server_stat.bytesrcvd", FT_UINT64,
7353               BASE_DEC, NULL, 0x0, "Number of bytes received", HFILL}},
7354           { &hf_srvsvc_server_stat_avresponse,
7355             { "Avresponse", "srvsvc.server_stat.avresponse", FT_UINT32,
7356               BASE_DEC, NULL, 0x0, "", HFILL}},
7357           { &hf_srvsvc_server_stat_reqbufneed,
7358             { "Req Buf Need", "srvsvc.server_stat.reqbufneed", FT_UINT32,
7359               BASE_DEC, NULL, 0x0, "Number of request buffers needed?", HFILL}},
7360           { &hf_srvsvc_server_stat_bigbufneed,
7361             { "Big Buf Need", "srvsvc.server_stat.bigbufneed", FT_UINT32,
7362               BASE_DEC, NULL, 0x0, "Number of big buffers needed?", HFILL}},
7363           { &hf_srvsvc_tod_elapsed,
7364             { "Elapsed", "srvsvc.tod.elapsed", FT_UINT32,
7365               BASE_DEC, NULL, 0x0, "", HFILL}},
7366           { &hf_srvsvc_tod_msecs,
7367             { "msecs", "srvsvc.tod.msecs", FT_UINT32,
7368               BASE_DEC, NULL, 0x0, "", HFILL}},
7369           { &hf_srvsvc_tod_hours,
7370             { "Hours", "srvsvc.tod.hours", FT_UINT32,
7371               BASE_DEC, NULL, 0x0, "", HFILL}},
7372           { &hf_srvsvc_tod_mins,
7373             { "Mins", "srvsvc.tod.mins", FT_UINT32,
7374               BASE_DEC, NULL, 0x0, "", HFILL}},
7375           { &hf_srvsvc_tod_secs,
7376             { "Secs", "srvsvc.tod.secs", FT_UINT32,
7377               BASE_DEC, NULL, 0x0, "", HFILL}},
7378           { &hf_srvsvc_tod_hunds,
7379             { "Hunds", "srvsvc.tod.hunds", FT_UINT32,
7380               BASE_DEC, NULL, 0x0, "", HFILL}},
7381           { &hf_srvsvc_tod_timezone,
7382             { "Timezone", "srvsvc.tod.timezone", FT_UINT32,
7383               BASE_DEC, NULL, 0x0, "", HFILL}},
7384           { &hf_srvsvc_tod_tinterval,
7385             { "Tinterval", "srvsvc.tod.tinterval", FT_UINT32,
7386               BASE_DEC, NULL, 0x0, "", HFILL}},
7387           { &hf_srvsvc_tod_day,
7388             { "Day", "srvsvc.tod.day", FT_UINT32,
7389               BASE_DEC, NULL, 0x0, "", HFILL}},
7390           { &hf_srvsvc_tod_month,
7391             { "Month", "srvsvc.tod.month", FT_UINT32,
7392               BASE_DEC, NULL, 0x0, "", HFILL}},
7393           { &hf_srvsvc_tod_year,
7394             { "Year", "srvsvc.tod.year", FT_UINT32,
7395               BASE_DEC, NULL, 0x0, "", HFILL}},
7396           { &hf_srvsvc_tod_weekday,
7397             { "Weekday", "srvsvc.tod.weekday", FT_UINT32,
7398               BASE_DEC, NULL, 0x0, "", HFILL}},
7399         };
7400
7401         static gint *ett[] = {
7402                 &ett_dcerpc_srvsvc,
7403                 &ett_srvsvc_share_info_1,
7404                 &ett_srvsvc_share_info_2,
7405                 &ett_srvsvc_share_info_501,
7406                 &ett_srvsvc_share_info_502
7407         };
7408
7409         proto_dcerpc_srvsvc = proto_register_protocol(
7410                 "Microsoft Server Service", "SRVSVC", "srvsvc");
7411
7412         proto_register_field_array(proto_dcerpc_srvsvc, hf, array_length(hf));
7413         proto_register_subtree_array(ett, array_length(ett));
7414 }
7415
7416 void
7417 proto_reg_handoff_dcerpc_srvsvc(void)
7418 {
7419         /* Register protocol as dcerpc */
7420
7421         dcerpc_init_uuid(proto_dcerpc_srvsvc, ett_dcerpc_srvsvc,
7422                          &uuid_dcerpc_srvsvc, ver_dcerpc_srvsvc,
7423                          dcerpc_srvsvc_dissectors, hf_srvsvc_opnum);
7424 }