1 /* packet-dcerpc-browser.c
2 * Routines for DCERPC Browser packet disassembly
3 * Copyright 2001, Ronnie Sahlberg
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 /* The IDL file for this interface can be extracted by grepping for idl
34 #include <epan/packet.h>
35 #include <epan/exceptions.h>
37 #include "packet-dcerpc.h"
38 #include "packet-dcerpc-browser.h"
39 #include "packet-dcerpc-nt.h"
40 #include "packet-windows-common.h"
42 static int proto_dcerpc_browser
= -1;
43 static int hf_browser_opnum
= -1;
44 static int hf_browser_rc
= -1;
45 static int hf_browser_unknown_long
= -1;
46 static int hf_browser_unknown_hyper
= -1;
47 static int hf_browser_unknown_bytes
= -1;
48 static int hf_browser_unknown_string
= -1;
51 static gint ett_dcerpc_browser
= -1;
55 dissect_browser_long_pointer(tvbuff_t
*tvb
, int offset
,
56 packet_info
*pinfo
, proto_tree
*tree
,
57 dcerpc_info
*di
, guint8
*drep
)
59 offset
= dissect_ndr_uint32 (tvb
, offset
, pinfo
, tree
, di
, drep
,
67 IDL [ uuid(6bffd098-a112-3610-9833-012892020162),
69 IDL implicit_handle(handle_t rpc_binding)
70 IDL ] interface browser
74 static e_uuid_t uuid_dcerpc_browser
= {
75 0x6bffd098, 0xa112, 0x3610,
76 { 0x98, 0x33, 0x01, 0x28, 0x92, 0x02, 0x01, 0x62 }
79 static guint16 ver_dcerpc_browser
= 0;
85 IDL [size_is(element_7)] [unique] byte *element_8;
89 dissect_browser_TYPE_4_data(tvbuff_t
*tvb
, int offset
,
90 packet_info
*pinfo
, proto_tree
*tree
,
91 dcerpc_info
*di
, guint8
*drep
)
94 int old_offset
= offset
;
96 if(di
->conformant_run
){
97 /* this call is to make wireshark eat the array header for the conformant run */
98 offset
=dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
102 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
103 hf_browser_unknown_long
, &len
);
105 proto_tree_add_item(tree
, hf_browser_unknown_bytes
, tvb
, offset
, len
,
108 if (offset
< old_offset
)
109 THROW(ReportedBoundsError
);
114 dissect_browser_TYPE_4(tvbuff_t
*tvb
, int offset
,
115 packet_info
*pinfo
, proto_tree
*tree
,
116 dcerpc_info
*di
, guint8
*drep
)
118 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
119 hf_browser_unknown_long
, NULL
);
121 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
122 dissect_browser_TYPE_4_data
, NDR_POINTER_UNIQUE
,
123 "unknown TYPE_4", -1);
132 IDL [size_is(element_5)] [unique] byte *element_6;
136 dissect_browser_TYPE_3_data(tvbuff_t
*tvb
, int offset
,
137 packet_info
*pinfo
, proto_tree
*tree
,
138 dcerpc_info
*di
, guint8
*drep
)
141 int old_offset
= offset
;
143 if(di
->conformant_run
){
144 /* this call is to make wireshark eat the array header for the conformant run */
145 offset
=dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
150 /* this is really the length of the encoded data */
151 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
152 hf_browser_unknown_long
, &len
);
153 proto_tree_add_item(tree
, hf_browser_unknown_bytes
, tvb
, offset
, len
,
156 if (offset
< old_offset
)
157 THROW(ReportedBoundsError
);
162 dissect_browser_TYPE_3(tvbuff_t
*tvb
, int offset
,
163 packet_info
*pinfo
, proto_tree
*tree
,
164 dcerpc_info
*di
, guint8
*drep
)
166 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
167 hf_browser_unknown_long
, NULL
);
169 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
170 dissect_browser_TYPE_3_data
, NDR_POINTER_UNIQUE
,
171 "unknown TYPE_3", -1);
179 IDL typedef [switch_type(long)] union {
180 IDL [case(100)] [unique] TYPE_3 *element_3;
181 IDL [case(101)] [unique] TYPE_4 *element_4;
185 dissect_browser_TYPE_2(tvbuff_t
*tvb
, int offset
,
186 packet_info
*pinfo
, proto_tree
*tree
,
187 dcerpc_info
*di
, guint8
*drep
)
191 /* this is really the union switch arm */
192 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
193 hf_browser_unknown_long
, &level
);
199 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
200 dissect_browser_TYPE_3
, NDR_POINTER_UNIQUE
,
201 "unknown TYPE_3", -1);
204 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
205 dissect_browser_TYPE_4
, NDR_POINTER_UNIQUE
,
206 "unknown TYPE_4", -1);
217 IDL TYPE_2 element_2;
221 dissect_browser_TYPE_1(tvbuff_t
*tvb
, int offset
,
222 packet_info
*pinfo
, proto_tree
*tree
,
223 dcerpc_info
*di
, guint8
*drep
)
225 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
226 hf_browser_unknown_long
, NULL
);
228 offset
= dissect_browser_TYPE_2(tvb
, offset
, pinfo
, tree
, di
, drep
);
236 IDL long BrowserrServerEnum(
237 IDL [in] [unique] [string] wchar_t *element_9,
238 IDL [in] [unique] [string] wchar_t *element_10,
239 IDL [in] [unique] [string] wchar_t *element_11,
240 IDL [in,out] [ref] TYPE_1 *element_12,
241 IDL [in] long element_13,
242 IDL [out] long element_14,
243 IDL [in] long element_15,
244 IDL [in] [unique] [string] wchar_t *element_16,
245 IDL [in,out] [unique] long *element_17
249 dissect_browser_browserr_server_enum_rqst(tvbuff_t
*tvb
, int offset
,
250 packet_info
*pinfo
, proto_tree
*tree
,
251 dcerpc_info
*di
, guint8
*drep
)
253 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
254 NDR_POINTER_UNIQUE
, "unknown string",
255 hf_browser_unknown_string
, 0);
257 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
258 NDR_POINTER_UNIQUE
, "unknown string",
259 hf_browser_unknown_string
, 0);
261 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
262 NDR_POINTER_UNIQUE
, "unknown string",
263 hf_browser_unknown_string
, 0);
265 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
266 dissect_browser_TYPE_1
, NDR_POINTER_REF
,
267 "unknown TYPE_1", -1);
269 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
270 hf_browser_unknown_long
, NULL
);
272 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
273 hf_browser_unknown_long
, NULL
);
275 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
276 NDR_POINTER_UNIQUE
, "unknown string",
277 hf_browser_unknown_string
, 0);
279 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
280 dissect_browser_long_pointer
, NDR_POINTER_UNIQUE
,
281 "unknown long", hf_browser_unknown_long
);
286 dissect_browser_browserr_server_enum_reply(tvbuff_t
*tvb
, int offset
,
287 packet_info
*pinfo
, proto_tree
*tree
,
288 dcerpc_info
*di
, guint8
*drep
)
290 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
291 dissect_browser_TYPE_1
, NDR_POINTER_REF
,
292 "unknown TYPE_1", -1);
294 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
295 hf_browser_unknown_long
, NULL
);
297 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
298 dissect_browser_long_pointer
, NDR_POINTER_UNIQUE
,
299 "unknown long", hf_browser_unknown_long
);
301 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
302 hf_browser_rc
, NULL
);
308 IDL long BrowserrDebugCall(
309 IDL [in] [unique] [string] wchar_t *element_18,
310 IDL [in] long element_19,
311 IDL [in] long element_20
315 dissect_browser_browserr_debug_call_rqst(tvbuff_t
*tvb
, int offset
,
316 packet_info
*pinfo
, proto_tree
*tree
,
317 dcerpc_info
*di
, guint8
*drep
)
319 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
320 NDR_POINTER_UNIQUE
, "unknown string",
321 hf_browser_unknown_string
, 0);
323 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
324 hf_browser_unknown_long
, NULL
);
326 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
327 hf_browser_unknown_long
, NULL
);
332 dissect_browser_browserr_debug_call_reply(tvbuff_t
*tvb
, int offset
,
333 packet_info
*pinfo
, proto_tree
*tree
,
334 dcerpc_info
*di _U_
, guint8
*drep
)
336 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
337 hf_browser_rc
, NULL
);
344 IDL long BrowserrQueryOtherDomains(
345 IDL [in] [unique] [string] wchar_t *element_21,
346 IDL [in,out] [ref] TYPE_1 *element_22,
347 IDL [out] long element_23
351 dissect_browser_browserr_query_other_domains_rqst(tvbuff_t
*tvb
, int offset
,
352 packet_info
*pinfo
, proto_tree
*tree
,
353 dcerpc_info
*di
, guint8
*drep
)
355 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
356 NDR_POINTER_UNIQUE
, "unknown string",
357 hf_browser_unknown_string
, 0);
359 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
360 dissect_browser_TYPE_1
, NDR_POINTER_REF
,
361 "unknown TYPE_1", -1);
366 dissect_browser_browserr_query_other_domains_reply(tvbuff_t
*tvb
, int offset
,
367 packet_info
*pinfo
, proto_tree
*tree
,
368 dcerpc_info
*di _U_
, guint8
*drep
)
370 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
371 hf_browser_unknown_long
, NULL
);
373 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
374 hf_browser_rc
, NULL
);
381 IDL long BrowserrResetNetlogonState(
382 IDL [in] [unique] [string] wchar_t *element_24
386 dissect_browser_browserr_reset_netlogon_state_rqst(tvbuff_t
*tvb
, int offset
,
387 packet_info
*pinfo
, proto_tree
*tree
,
388 dcerpc_info
*di
, guint8
*drep
)
390 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
391 NDR_POINTER_UNIQUE
, "unknown string",
392 hf_browser_unknown_string
, 0);
397 dissect_browser_browserr_reset_netlogon_state_reply(tvbuff_t
*tvb
, int offset
,
398 packet_info
*pinfo
, proto_tree
*tree
,
399 dcerpc_info
*di _U_
, guint8
*drep
)
401 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
402 hf_browser_rc
, NULL
);
409 IDL long BrowserrDebugTrace(
410 IDL [in] [unique] [string] wchar_t *element_25,
411 IDL [in] [string] char element_26
415 dissect_browser_browserr_debug_trace_rqst(tvbuff_t
*tvb
, int offset
,
416 packet_info
*pinfo
, proto_tree
*tree
,
417 dcerpc_info
*di
, guint8
*drep
)
419 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
420 NDR_POINTER_UNIQUE
, "unknown string",
421 hf_browser_unknown_string
, 0);
423 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
424 NDR_POINTER_REF
, "unknown string",
425 hf_browser_unknown_string
, 0);
430 dissect_browser_browserr_debug_trace_reply(tvbuff_t
*tvb
, int offset
,
431 packet_info
*pinfo
, proto_tree
*tree
,
432 dcerpc_info
*di _U_
, guint8
*drep
)
434 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
435 hf_browser_rc
, NULL
);
444 IDL TYPE_6 element_27;
445 IDL TYPE_6 element_28;
446 IDL TYPE_6 element_29;
462 IDL TYPE_6 element_45;
466 IDL hyper element_46;
470 dissect_browser_TYPE_5(tvbuff_t
*tvb
, int offset
,
471 packet_info
*pinfo
, proto_tree
*tree
,
472 dcerpc_info
*di
, guint8
*drep
)
474 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
475 hf_browser_unknown_hyper
, NULL
);
477 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
478 hf_browser_unknown_hyper
, NULL
);
480 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
481 hf_browser_unknown_hyper
, NULL
);
483 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
484 hf_browser_unknown_long
, NULL
);
486 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
487 hf_browser_unknown_long
, NULL
);
489 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
490 hf_browser_unknown_long
, NULL
);
492 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
493 hf_browser_unknown_long
, NULL
);
495 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
496 hf_browser_unknown_long
, NULL
);
498 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
499 hf_browser_unknown_long
, NULL
);
501 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
502 hf_browser_unknown_long
, NULL
);
504 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
505 hf_browser_unknown_long
, NULL
);
507 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
508 hf_browser_unknown_long
, NULL
);
510 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
511 hf_browser_unknown_long
, NULL
);
513 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
514 hf_browser_unknown_long
, NULL
);
516 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
517 hf_browser_unknown_long
, NULL
);
519 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
520 hf_browser_unknown_long
, NULL
);
522 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
523 hf_browser_unknown_long
, NULL
);
525 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
526 hf_browser_unknown_long
, NULL
);
528 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
529 hf_browser_unknown_hyper
, NULL
);
536 IDL long BrowserrQueryStatistics(
537 IDL [in] [unique] [string] wchar_t *element_47,
538 IDL [out] [ref] TYPE_5 **element_48
542 dissect_browser_browserr_query_statistics_rqst(tvbuff_t
*tvb
, int offset
,
543 packet_info
*pinfo
, proto_tree
*tree
,
544 dcerpc_info
*di
, guint8
*drep
)
546 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
547 NDR_POINTER_UNIQUE
, "unknown string",
548 hf_browser_unknown_string
, 0);
553 dissect_browser_browserr_query_statistics_reply(tvbuff_t
*tvb
, int offset
,
554 packet_info
*pinfo
, proto_tree
*tree
,
555 dcerpc_info
*di
, guint8
*drep
)
557 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
558 dissect_browser_TYPE_5
, NDR_POINTER_UNIQUE
,
559 "unknown TYPE_5", -1);
561 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
562 hf_browser_rc
, NULL
);
569 IDL long BrowserrResetStatistics(
570 IDL [in] [unique] [string] wchar_t *element_49
574 dissect_browser_browserr_reset_statistics_rqst(tvbuff_t
*tvb
, int offset
,
575 packet_info
*pinfo
, proto_tree
*tree
,
576 dcerpc_info
*di
, guint8
*drep
)
578 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
579 NDR_POINTER_UNIQUE
, "unknown string",
580 hf_browser_unknown_string
, 0);
585 dissect_browser_browserr_reset_statistics_reply(tvbuff_t
*tvb
, int offset
,
586 packet_info
*pinfo
, proto_tree
*tree
,
587 dcerpc_info
*di _U_
, guint8
*drep
)
589 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
590 hf_browser_rc
, NULL
);
597 IDL long NetrBrowserStatisticsClear(
598 IDL [in] [unique] [string] wchar_t *element_49
602 dissect_browser_netr_browser_statistics_clear_rqst(tvbuff_t
*tvb
, int offset
,
603 packet_info
*pinfo
, proto_tree
*tree
,
604 dcerpc_info
*di
, guint8
*drep
)
606 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
607 NDR_POINTER_UNIQUE
, "unknown string",
608 hf_browser_unknown_string
, 0);
613 dissect_browser_netr_browser_statistics_clear_reply(tvbuff_t
*tvb
, int offset
,
614 packet_info
*pinfo
, proto_tree
*tree
,
615 dcerpc_info
*di _U_
, guint8
*drep
)
617 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
618 hf_browser_rc
, NULL
);
626 IDL TYPE_6 element_59;
627 IDL TYPE_6 element_60;
628 IDL TYPE_6 element_61;
632 IDL TYPE_6 element_65;
645 dissect_browser_TYPE_11(tvbuff_t
*tvb
, int offset
,
646 packet_info
*pinfo
, proto_tree
*tree
,
647 dcerpc_info
*di _U_
, guint8
*drep
)
649 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
650 hf_browser_unknown_hyper
, NULL
);
652 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
653 hf_browser_unknown_hyper
, NULL
);
655 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
656 hf_browser_unknown_hyper
, NULL
);
658 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
659 hf_browser_unknown_long
, NULL
);
661 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
662 hf_browser_unknown_long
, NULL
);
664 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
665 hf_browser_unknown_long
, NULL
);
667 offset
= dissect_ndr_duint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
668 hf_browser_unknown_hyper
, NULL
);
670 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
671 hf_browser_unknown_long
, NULL
);
673 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
674 hf_browser_unknown_long
, NULL
);
676 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
677 hf_browser_unknown_long
, NULL
);
679 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
680 hf_browser_unknown_long
, NULL
);
682 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
683 hf_browser_unknown_long
, NULL
);
685 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
686 hf_browser_unknown_long
, NULL
);
688 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
689 hf_browser_unknown_long
, NULL
);
691 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
692 hf_browser_unknown_long
, NULL
);
694 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
695 hf_browser_unknown_long
, NULL
);
703 IDL [size_is(element_57)] [unique] TYPE_11 *element_58;
707 dissect_browser_TYPE_11_array(tvbuff_t
*tvb
, int offset
,
708 packet_info
*pinfo
, proto_tree
*tree
,
709 dcerpc_info
*di
, guint8
*drep
)
711 offset
= dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
,
712 dissect_browser_TYPE_11
);
718 dissect_browser_TYPE_10(tvbuff_t
*tvb
, int offset
,
719 packet_info
*pinfo
, proto_tree
*tree
,
720 dcerpc_info
*di
, guint8
*drep
)
722 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
723 hf_browser_unknown_long
, NULL
);
725 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
726 dissect_browser_TYPE_11_array
, NDR_POINTER_UNIQUE
,
727 "unknown TYPE_11_ARRAY", -1);
736 IDL [size_is(element_55)] [unique] byte *element_56;
740 dissect_browser_TYPE_9_data(tvbuff_t
*tvb
, int offset
,
741 packet_info
*pinfo
, proto_tree
*tree
,
742 dcerpc_info
*di
, guint8
*drep
)
745 int old_offset
= offset
;
747 if(di
->conformant_run
){
748 /* this call is to make wireshark eat the array header for the conformant run */
749 offset
=dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
754 /* this is really the length of the encoded data */
755 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
756 hf_browser_unknown_long
, &len
);
758 proto_tree_add_item(tree
, hf_browser_unknown_bytes
, tvb
, offset
, len
,
761 if (offset
< old_offset
)
762 THROW(ReportedBoundsError
);
767 dissect_browser_TYPE_9(tvbuff_t
*tvb
, int offset
,
768 packet_info
*pinfo
, proto_tree
*tree
,
769 dcerpc_info
*di
, guint8
*drep
)
771 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
772 hf_browser_unknown_long
, NULL
);
774 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
775 dissect_browser_TYPE_9_data
, NDR_POINTER_UNIQUE
,
776 "unknown TYPE_9", -1);
783 IDL typedef [switch_type(long)] union {
784 IDL [case(100)] [unique] TYPE_9 *element_53;
785 IDL [case(101)] [unique] TYPE_10 *element_54;
789 dissect_browser_TYPE_8(tvbuff_t
*tvb
, int offset
,
790 packet_info
*pinfo
, proto_tree
*tree
,
791 dcerpc_info
*di
, guint8
*drep
)
795 /* this is really the union switch arm */
796 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
797 hf_browser_unknown_long
, &level
);
803 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
804 dissect_browser_TYPE_9
, NDR_POINTER_UNIQUE
,
805 "unknown TYPE_9", -1);
808 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
809 dissect_browser_TYPE_10
, NDR_POINTER_UNIQUE
,
810 "unknown TYPE_10", -1);
821 IDL TYPE_8 element_52;
825 dissect_browser_TYPE_7(tvbuff_t
*tvb
, int offset
,
826 packet_info
*pinfo
, proto_tree
*tree
,
827 dcerpc_info
*di
, guint8
*drep
)
829 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
830 hf_browser_unknown_long
, NULL
);
832 offset
= dissect_browser_TYPE_8(tvb
, offset
, pinfo
, tree
, di
, drep
);
839 IDL long NetrBrowserStatisticsGet(
840 IDL [in] [unique] [string] wchar_t *element_75,
841 IDL [in] long element_76,
842 IDL [in,out] [ref] TYPE_7 *element_77
846 dissect_browser_netr_browser_statistics_get_rqst(tvbuff_t
*tvb
, int offset
,
847 packet_info
*pinfo
, proto_tree
*tree
,
848 dcerpc_info
*di
, guint8
*drep
)
850 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
851 NDR_POINTER_UNIQUE
, "unknown string",
852 hf_browser_unknown_string
, 0);
854 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
855 hf_browser_unknown_long
, NULL
);
857 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
858 dissect_browser_TYPE_7
, NDR_POINTER_REF
,
859 "unknown TYPE_7", -1);
864 dissect_browser_netr_browser_statistics_get_reply(tvbuff_t
*tvb
, int offset
,
865 packet_info
*pinfo
, proto_tree
*tree
,
866 dcerpc_info
*di
, guint8
*drep
)
868 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
869 dissect_browser_TYPE_7
, NDR_POINTER_REF
,
870 "unknown TYPE_7", -1);
872 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
873 hf_browser_rc
, NULL
);
880 IDL long BrowserrSetNetlogonState(
881 IDL [in] [unique] [string] wchar_t *element_78,
882 IDL [in] [ref] [string] wchar_t *element_79,
883 IDL [in] [unique] [string] wchar_t *element_80,
884 IDL [in] long element_81
888 dissect_browser_browserr_set_netlogon_state_rqst(tvbuff_t
*tvb
, int offset
,
889 packet_info
*pinfo
, proto_tree
*tree
,
890 dcerpc_info
*di
, guint8
*drep
)
892 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
893 NDR_POINTER_UNIQUE
, "unknown string",
894 hf_browser_unknown_string
, 0);
896 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
897 NDR_POINTER_REF
, "unknown string",
898 hf_browser_unknown_string
, 0);
900 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
901 NDR_POINTER_UNIQUE
, "unknown string",
902 hf_browser_unknown_string
, 0);
904 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
905 hf_browser_unknown_long
, NULL
);
910 dissect_browser_browserr_set_netlogon_state_reply(tvbuff_t
*tvb
, int offset
,
911 packet_info
*pinfo
, proto_tree
*tree
,
912 dcerpc_info
*di _U_
, guint8
*drep
)
914 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
915 hf_browser_rc
, NULL
);
926 IDL [size_is(element_82)] [unique] byte *element_83;
930 dissect_browser_TYPE_12_data(tvbuff_t
*tvb
, int offset
,
931 packet_info
*pinfo
, proto_tree
*tree
,
932 dcerpc_info
*di
, guint8
*drep
)
935 int old_offset
= offset
;
937 if(di
->conformant_run
){
938 /* this call is to make wireshark eat the array header for the conformant run */
939 offset
=dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
, NULL
);
944 /* this is really the length of the encoded data */
945 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
946 hf_browser_unknown_long
, &len
);
948 proto_tree_add_item(tree
, hf_browser_unknown_bytes
, tvb
, offset
, len
,
951 if (offset
< old_offset
)
952 THROW(ReportedBoundsError
);
957 dissect_browser_TYPE_12(tvbuff_t
*tvb
, int offset
,
958 packet_info
*pinfo
, proto_tree
*tree
,
959 dcerpc_info
*di
, guint8
*drep
)
961 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
962 hf_browser_unknown_long
, NULL
);
964 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
965 dissect_browser_TYPE_12_data
, NDR_POINTER_UNIQUE
,
966 "unknown TYPE_12", -1);
973 IDL long BrowserrQueryEmulatedDomains(
974 IDL [in] [unique] [string] wchar_t *element_84,
975 IDL [in,out] [ref] TYPE_12 *element_85
979 dissect_browser_browserr_query_emulated_domains_rqst(tvbuff_t
*tvb
, int offset
,
980 packet_info
*pinfo
, proto_tree
*tree
,
981 dcerpc_info
*di
, guint8
*drep
)
983 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
984 NDR_POINTER_UNIQUE
, "unknown string",
985 hf_browser_unknown_string
, 0);
987 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
988 dissect_browser_TYPE_12
, NDR_POINTER_REF
,
989 "unknown TYPE_12", -1);
994 dissect_browser_browserr_query_emulated_domains_reply(tvbuff_t
*tvb
, int offset
,
995 packet_info
*pinfo
, proto_tree
*tree
,
996 dcerpc_info
*di
, guint8
*drep
)
998 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
999 dissect_browser_TYPE_12
, NDR_POINTER_REF
,
1000 "unknown TYPE_12", -1);
1002 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
1003 hf_browser_rc
, NULL
);
1010 IDL long BrowserrServerEnumEx(
1011 IDL [in] [unique] [string] wchar_t *element_86,
1012 IDL [in] [unique] [string] wchar_t *element_87,
1013 IDL [in] [unique] [string] wchar_t *element_88,
1014 IDL [in,out] [ref] TYPE_1 *element_89,
1015 IDL [in] long element_90,
1016 IDL [out] long element_91,
1017 IDL [in] long element_92,
1018 IDL [in] [unique] [string] wchar_t *element_93,
1019 IDL [in] [unique] [string] wchar_t *element_94
1023 dissect_browser_browserr_server_enum_ex_rqst(tvbuff_t
*tvb
, int offset
,
1024 packet_info
*pinfo
, proto_tree
*tree
,
1025 dcerpc_info
*di
, guint8
*drep
)
1027 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
1028 NDR_POINTER_UNIQUE
, "unknown string",
1029 hf_browser_unknown_string
, 0);
1031 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
1032 NDR_POINTER_UNIQUE
, "unknown string",
1033 hf_browser_unknown_string
, 0);
1035 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
1036 NDR_POINTER_UNIQUE
, "unknown string",
1037 hf_browser_unknown_string
, 0);
1039 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
1040 dissect_browser_TYPE_1
, NDR_POINTER_REF
,
1041 "unknown TYPE_1", -1);
1043 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
1044 hf_browser_unknown_long
, NULL
);
1046 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
1047 hf_browser_unknown_long
, NULL
);
1049 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
1050 NDR_POINTER_UNIQUE
, "unknown string",
1051 hf_browser_unknown_string
, 0);
1053 offset
= dissect_ndr_str_pointer_item(tvb
, offset
, pinfo
, tree
, di
, drep
,
1054 NDR_POINTER_UNIQUE
, "unknown string",
1055 hf_browser_unknown_string
, 0);
1060 dissect_browser_browserr_server_enum_ex_reply(tvbuff_t
*tvb
, int offset
,
1061 packet_info
*pinfo
, proto_tree
*tree
,
1062 dcerpc_info
*di
, guint8
*drep
)
1064 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
1065 dissect_browser_TYPE_1
, NDR_POINTER_REF
,
1066 "unknown TYPE_1", -1);
1068 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
1069 hf_browser_unknown_long
, NULL
);
1071 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
1072 hf_browser_rc
, NULL
);
1082 static dcerpc_sub_dissector dcerpc_browser_dissectors
[] = {
1083 { BROWSER_BROWSERR_SERVER_ENUM
, "BrowserrServerEnum",
1084 dissect_browser_browserr_server_enum_rqst
,
1085 dissect_browser_browserr_server_enum_reply
},
1086 { BROWSER_BROWSERR_DEBUG_CALL
, "BrowserrDebugCall",
1087 dissect_browser_browserr_debug_call_rqst
,
1088 dissect_browser_browserr_debug_call_reply
},
1089 { BROWSER_BROWSERR_QUERY_OTHER_DOMAINS
,
1090 "BrowserrQueryOtherDomains",
1091 dissect_browser_browserr_query_other_domains_rqst
,
1092 dissect_browser_browserr_query_other_domains_reply
},
1093 { BROWSER_BROWSERR_RESET_NETLOGON_STATE
,
1094 "BrowserrResetNetlogonState",
1095 dissect_browser_browserr_reset_netlogon_state_rqst
,
1096 dissect_browser_browserr_reset_netlogon_state_reply
},
1097 { BROWSER_BROWSERR_DEBUG_TRACE
,
1098 "BrowserrDebugTrace",
1099 dissect_browser_browserr_debug_trace_rqst
,
1100 dissect_browser_browserr_debug_trace_reply
},
1101 { BROWSER_BROWSERR_QUERY_STATISTICS
,
1102 "BrowserrQueryStatistics",
1103 dissect_browser_browserr_query_statistics_rqst
,
1104 dissect_browser_browserr_query_statistics_reply
},
1105 { BROWSER_BROWSERR_RESET_STATISTICS
,
1106 "BrowserrResetStatistics",
1107 dissect_browser_browserr_reset_statistics_rqst
,
1108 dissect_browser_browserr_reset_statistics_reply
},
1109 { BROWSER_NETR_BROWSER_STATISTICS_CLEAR
,
1110 "NetrBrowserStatisticsClear",
1111 dissect_browser_netr_browser_statistics_clear_rqst
,
1112 dissect_browser_netr_browser_statistics_clear_reply
},
1113 { BROWSER_NETR_BROWSER_STATISTICS_GET
,
1114 "NetrBrowserStatisticsGet",
1115 dissect_browser_netr_browser_statistics_get_rqst
,
1116 dissect_browser_netr_browser_statistics_get_reply
},
1117 { BROWSER_BROWSERR_SET_NETLOGON_STATE
,
1118 "BrowserrSetNetlogonState",
1119 dissect_browser_browserr_set_netlogon_state_rqst
,
1120 dissect_browser_browserr_set_netlogon_state_reply
},
1121 { BROWSER_BROWSERR_QUERY_EMULATED_DOMAINS
,
1122 "BrowserrQueryEmulatedDomains",
1123 dissect_browser_browserr_query_emulated_domains_rqst
,
1124 dissect_browser_browserr_query_emulated_domains_reply
},
1125 { BROWSER_BROWSERR_SERVER_ENUM_EX
,
1126 "BrowserrServerEnumEx",
1127 dissect_browser_browserr_server_enum_ex_rqst
,
1128 dissect_browser_browserr_server_enum_ex_reply
},
1130 {0, NULL
, NULL
, NULL
}
1134 proto_register_dcerpc_browser(void)
1136 static hf_register_info hf
[] = {
1138 { &hf_browser_opnum
, {
1139 "Operation", "rpc_browser.opnum", FT_UINT16
, BASE_DEC
,
1140 NULL
, 0x0, NULL
, HFILL
}},
1143 "Return code", "rpc_browser.rc", FT_UINT32
, BASE_HEX
,
1144 VALS(NT_errors
), 0x0, "Browser return code", HFILL
}},
1146 { &hf_browser_unknown_long
, {
1147 "Unknown long", "rpc_browser.unknown.long", FT_UINT32
, BASE_HEX
,
1148 NULL
, 0x0, "Unknown long. If you know what this is, contact wireshark developers.", HFILL
}},
1150 { &hf_browser_unknown_hyper
, {
1151 "Unknown hyper", "rpc_browser.unknown.hyper", FT_UINT64
, BASE_HEX
,
1152 NULL
, 0x0, "Unknown hyper. If you know what this is, contact wireshark developers.", HFILL
}},
1154 { &hf_browser_unknown_bytes
, {
1155 "Unknown bytes", "rpc_browser.unknown.bytes", FT_BYTES
, BASE_NONE
,
1156 NULL
, 0x0, "Unknown bytes. If you know what this is, contact wireshark developers.", HFILL
}},
1158 { &hf_browser_unknown_string
, {
1159 "Unknown string", "rpc_browser.unknown.string", FT_STRING
, BASE_NONE
,
1160 NULL
, 0x0, "Unknown string. If you know what this is, contact wireshark developers.", HFILL
}}
1163 static gint
*ett
[] = {
1167 proto_dcerpc_browser
= proto_register_protocol(
1168 "RPC Browser", "RPC_BROWSER", "rpc_browser");
1170 proto_register_field_array(proto_dcerpc_browser
, hf
,
1172 proto_register_subtree_array(ett
, array_length(ett
));
1176 proto_reg_handoff_dcerpc_browser(void)
1178 /* Register protocol as dcerpc */
1180 dcerpc_init_uuid(proto_dcerpc_browser
, ett_dcerpc_browser
,
1181 &uuid_dcerpc_browser
, ver_dcerpc_browser
,
1182 dcerpc_browser_dissectors
, hf_browser_opnum
);