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