2 * Routines for dcerpc endpoint mapper dissection
3 * Copyright 2001, Todd Sabin <tas@webspan.net>
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.
29 #include <epan/packet.h>
30 #include <epan/to_str.h>
31 #include <epan/expert.h>
32 #include "packet-dcerpc.h"
33 #include "packet-dcerpc-nt.h"
36 static int proto_epm3
= -1;
37 static int proto_epm4
= -1;
39 static int hf_epm_opnum
= -1;
40 static int hf_epm_inquiry_type
= -1;
41 static int hf_epm_object
= -1;
42 static int hf_epm_if_id
= -1;
43 static int hf_epm_ver_maj
= -1;
44 static int hf_epm_ver_min
= -1;
45 static int hf_epm_ver_opt
= -1;
46 static int hf_epm_hnd
= -1;
47 static int hf_epm_max_ents
= -1;
48 static int hf_epm_num_ents
= -1;
49 static int hf_epm_uuid
= -1;
50 static int hf_epm_tower_length
= -1;
51 /* static int hf_epm_tower_data = -1; */
52 static int hf_epm_max_towers
= -1;
53 static int hf_epm_num_towers
= -1;
54 static int hf_epm_rc
= -1;
55 static int hf_epm_replace
= -1;
56 static int hf_epm_tower_num_floors
= -1;
57 static int hf_epm_tower_rhs_len
= -1;
58 static int hf_epm_tower_lhs_len
= -1;
59 static int hf_epm_tower_proto_id
= -1;
60 static int hf_epm_annotation
= -1;
61 static int hf_epm_ann_offset
= -1;
62 static int hf_epm_ann_len
= -1;
63 static int hf_epm_proto_named_pipes
= -1;
64 static int hf_epm_proto_netbios_name
= -1;
65 static int hf_epm_proto_ip
= -1;
66 static int hf_epm_proto_udp_port
= -1;
67 static int hf_epm_proto_tcp_port
= -1;
68 static int hf_epm_proto_http_port
= -1;
70 static gint ett_epm
= -1;
71 static gint ett_epm_tower_floor
= -1;
72 static gint ett_epm_entry
= -1;
74 static expert_field ei_epm_proto_undecoded
= EI_INIT
;
77 /* the UUID is identical for interface versions 3 and 4 */
78 static e_uuid_t uuid_epm
= { 0xe1af8308, 0x5d1f, 0x11c9, { 0x91, 0xa4, 0x08, 0x00, 0x2b, 0x14, 0xa0, 0xfa } };
79 static guint16 ver_epm3
= 3;
80 static guint16 ver_epm4
= 4;
84 static const value_string ep_service
[] = {
85 { 0, "rpc_c_ep_all_elts" },
86 { 1, "rpc_c_ep_match_by_if" },
87 { 2, "rpc_c_ep_match_by_obj" },
88 { 3, "rpc_c_ep_match_by_both" },
93 unsigned int tower_len,
94 [size_is(tower_len)] char tower[];
97 static int epm_dissect_tower (tvbuff_t
*tvb
, int offset
, packet_info
*pinfo
, proto_tree
*tree
, dcerpc_info
*di
, guint8
*drep
);
101 epm_dissect_pointer_IF_ID(tvbuff_t
*tvb
, int offset
,
102 packet_info
*pinfo
, proto_tree
*tree
,
103 dcerpc_info
*di
, guint8
*drep
)
105 offset
= dissect_ndr_uuid_t (tvb
, offset
, pinfo
, tree
, di
, drep
,
107 offset
= dissect_ndr_uint16 (tvb
, offset
, pinfo
, tree
, di
, drep
,
108 hf_epm_ver_maj
, NULL
);
109 offset
= dissect_ndr_uint16 (tvb
, offset
, pinfo
, tree
, di
, drep
,
110 hf_epm_ver_min
, NULL
);
115 epm_dissect_pointer_UUID(tvbuff_t
*tvb
, int offset
,
116 packet_info
*pinfo
, proto_tree
*tree
,
117 dcerpc_info
*di
, guint8
*drep
)
119 offset
= dissect_ndr_uuid_t (tvb
, offset
, pinfo
, tree
, di
, drep
,
125 epm_dissect_ept_lookup_rqst (tvbuff_t
*tvb
, int offset
,
126 packet_info
*pinfo
, proto_tree
*tree
,
127 dcerpc_info
*di
, guint8
*drep
)
129 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
130 hf_epm_inquiry_type
, NULL
);
132 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
133 epm_dissect_pointer_UUID
, NDR_POINTER_PTR
,
134 "Object:", hf_epm_object
);
136 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
137 epm_dissect_pointer_IF_ID
, NDR_POINTER_PTR
,
138 "Interface:", hf_epm_if_id
);
140 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
141 hf_epm_ver_opt
, NULL
);
143 offset
= dissect_ndr_ctx_hnd (tvb
, offset
, pinfo
, tree
, di
, drep
,
146 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
147 hf_epm_max_ents
, NULL
);
153 epm_dissect_ept_entry_t(tvbuff_t
*tvb
, int offset
,
154 packet_info
*pinfo
, proto_tree
*parent_tree
,
155 dcerpc_info
*di
, guint8
*drep
)
157 proto_item
*item
=NULL
;
158 proto_tree
*tree
=NULL
;
159 int old_offset
=offset
;
163 if(di
->conformant_run
){
168 item
= proto_tree_add_text(parent_tree
, tvb
, offset
, -1, "Entry:");
169 tree
= proto_item_add_subtree(item
, ett_epm_entry
);
172 offset
= dissect_ndr_uuid_t (tvb
, offset
, pinfo
, tree
, di
, drep
,
173 hf_epm_object
, NULL
);
175 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
176 epm_dissect_tower
, NDR_POINTER_PTR
,
177 "Tower pointer:", -1);
179 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
180 hf_epm_ann_offset
, NULL
);
181 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
182 hf_epm_ann_len
, &len
);
183 str
=tvb_get_string(wmem_packet_scope(), tvb
, offset
, len
);
184 proto_tree_add_item(tree
, hf_epm_annotation
, tvb
, offset
, len
, ENC_ASCII
|ENC_NA
);
189 proto_item_append_text(item
, " Service:%s ", str
);
190 proto_item_append_text(tree
->parent
, " Service:%s ", str
);
192 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Service:%s", str
);
195 proto_item_set_len(item
, offset
-old_offset
);
200 epm_dissect_ept_entry_t_array(tvbuff_t
*tvb
, int offset
,
201 packet_info
*pinfo
, proto_tree
*tree
,
202 dcerpc_info
*di
, guint8
*drep
)
204 offset
= dissect_ndr_ucvarray(tvb
, offset
, pinfo
, tree
, di
, drep
,
205 epm_dissect_ept_entry_t
);
211 epm_dissect_ept_lookup_resp (tvbuff_t
*tvb
, int offset
,
212 packet_info
*pinfo
, proto_tree
*tree
,
213 dcerpc_info
*di
, guint8
*drep
)
215 offset
= dissect_ndr_ctx_hnd (tvb
, offset
, pinfo
, tree
, di
, drep
,
218 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
219 hf_epm_num_ents
, NULL
);
221 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
222 epm_dissect_ept_entry_t_array
, NDR_POINTER_REF
,
225 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
232 epm_dissect_uuid (tvbuff_t
*tvb
, int offset
,
233 packet_info
*pinfo
, proto_tree
*tree
,
234 dcerpc_info
*di
, guint8
*drep
)
236 offset
= dissect_ndr_uuid_t (tvb
, offset
, pinfo
, tree
, di
, drep
,
241 #define PROTO_ID_OSI_OID 0x00
242 #define PROTO_ID_DNA_SESSCTL 0x02
243 #define PROTO_ID_DNA_SESSCTL_V3 0x03
244 #define PROTO_ID_DNA_NSP 0x04
245 #define PROTO_ID_OSI_TP4 0x05
246 #define PROTO_ID_OSI_CLNS 0x06
247 #define PROTO_ID_TCP 0x07
248 #define PROTO_ID_UDP 0x08
249 #define PROTO_ID_IP 0x09
250 #define PROTO_ID_RPC_CL 0x0a
251 #define PROTO_ID_RPC_CO 0x0b
252 #define PROTO_ID_SPX 0x0c /* from DCOM spec (is this correct?) */
253 #define PROTO_ID_UUID 0x0d
254 #define PROTO_ID_IPX 0x0e /* from DCOM spec (is this correct?) */
255 #define PROTO_ID_NAMED_PIPES 0x0f
256 #define PROTO_ID_NAMED_PIPES_2 0x10
257 #define PROTO_ID_NETBIOS 0x11
258 #define PROTO_ID_NETBEUI 0x12
259 #define PROTO_ID_NETWARE_SPX 0x13
260 #define PROTO_ID_NETWARE_IPX 0x14
261 #define PROTO_ID_ATALK_STREAM 0x16
262 #define PROTO_ID_ATALK_DATAGRAM 0x17
263 #define PROTO_ID_ATALK 0x18
264 #define PROTO_ID_NETBIOS_2 0x19
265 #define PROTO_ID_VINES_SPP 0x1a
266 #define PROTO_ID_VINES_IPC 0x1b
267 #define PROTO_ID_STREETTALK 0x1c
268 #define PROTO_ID_HTTP 0x1f
269 #define PROTO_ID_UNIX_DOMAIN 0x20
270 #define PROTO_ID_NULL 0x21
271 #define PROTO_ID_NETBIOS_3 0x22
273 static const value_string proto_id_vals
[] = {
274 { PROTO_ID_OSI_OID
, "OSI OID"},
275 { PROTO_ID_DNA_SESSCTL
, "DNA Session Control"},
276 { PROTO_ID_DNA_SESSCTL_V3
, "DNA Session Control V3"},
277 { PROTO_ID_DNA_NSP
, "DNA NSP Transport"},
278 { PROTO_ID_OSI_TP4
, "OSI TP4"},
279 { PROTO_ID_OSI_CLNS
, "OSI CLNS or DNA Routing"},
280 { PROTO_ID_TCP
, "DOD TCP"},
281 { PROTO_ID_UDP
, "DOD UDP"},
282 { PROTO_ID_IP
, "DOD IP"},
283 { PROTO_ID_RPC_CL
, "RPC connectionless protocol"},
284 { PROTO_ID_RPC_CO
, "RPC connection-oriented protocol"},
285 { PROTO_ID_SPX
, "SPX?"},
286 { PROTO_ID_UUID
, "UUID"},
287 { PROTO_ID_IPX
, "IPX?"},
288 { PROTO_ID_NAMED_PIPES
, "Named Pipes"},
289 { PROTO_ID_NAMED_PIPES_2
, "Named Pipes"},
290 { PROTO_ID_NETBIOS
, "NetBIOS"},
291 { PROTO_ID_NETBEUI
, "NetBEUI"},
292 { PROTO_ID_NETWARE_SPX
, "Netware SPX"},
293 { PROTO_ID_NETWARE_IPX
, "Netware IPX"},
294 { PROTO_ID_ATALK_STREAM
, "Appletalk Stream"},
295 { PROTO_ID_ATALK_DATAGRAM
, "Appletalk Datagram"},
296 { PROTO_ID_ATALK
, "Appletalk"},
297 { PROTO_ID_NETBIOS_2
, "NetBIOS"},
298 { PROTO_ID_VINES_SPP
, "Vines SPP"},
299 { PROTO_ID_VINES_IPC
, "Vines IPC"},
300 { PROTO_ID_STREETTALK
, "StreetTalk"},
301 { PROTO_ID_HTTP
, "RPC over HTTP"},
302 { PROTO_ID_UNIX_DOMAIN
, "Unix Domain Socket"},
303 { PROTO_ID_NULL
, "null"},
304 { PROTO_ID_NETBIOS_3
, "NetBIOS"},
309 /* XXX this function assumes LE encoding. can not use the NDR routines
310 since they assume padding.
313 epm_dissect_tower_data (tvbuff_t
*tvb
, int offset
,
314 packet_info
*pinfo
, proto_tree
*tree
,
315 dcerpc_info
*di
, guint8
*drep _U_
)
317 guint16 num_floors
, ii
;
318 const char *uuid_name
;
319 guint8 u8little_endian
= DREP_LITTLE_ENDIAN
;
321 if(di
->conformant_run
){
325 num_floors
= tvb_get_letohs(tvb
, offset
);
326 proto_tree_add_uint(tree
, hf_epm_tower_num_floors
, tvb
, offset
, 2, num_floors
);
329 for(ii
=0;ii
<num_floors
;ii
++){
330 proto_item
*it
= NULL
;
331 proto_tree
*tr
= NULL
;
332 int old_offset
= offset
;
338 it
= proto_tree_add_text(tree
, tvb
, offset
, 0, "Floor %d ", ii
+1);
339 tr
= proto_item_add_subtree(it
, ett_epm_tower_floor
);
341 len
= tvb_get_letohs(tvb
, offset
);
342 proto_tree_add_uint(tr
, hf_epm_tower_lhs_len
, tvb
, offset
, 2, len
);
345 proto_id
= tvb_get_guint8(tvb
, offset
);
346 proto_tree_add_uint(tr
, hf_epm_tower_proto_id
, tvb
, offset
, 1, proto_id
);
350 dcerpc_tvb_get_uuid (tvb
, offset
+1, &u8little_endian
, &uuid
);
352 uuid_name
= guids_get_uuid_name(&uuid
);
354 if(uuid_name
!= NULL
) {
355 proto_tree_add_guid_format (tr
, hf_epm_uuid
, tvb
, offset
+1, 16, (e_guid_t
*) &uuid
,
356 "UUID: %s (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
358 uuid
.Data1
, uuid
.Data2
, uuid
.Data3
,
359 uuid
.Data4
[0], uuid
.Data4
[1],
360 uuid
.Data4
[2], uuid
.Data4
[3],
361 uuid
.Data4
[4], uuid
.Data4
[5],
362 uuid
.Data4
[6], uuid
.Data4
[7]);
364 proto_tree_add_guid_format (tr
, hf_epm_uuid
, tvb
, offset
+1, 16, (e_guid_t
*) &uuid
,
365 "UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
366 uuid
.Data1
, uuid
.Data2
, uuid
.Data3
,
367 uuid
.Data4
[0], uuid
.Data4
[1],
368 uuid
.Data4
[2], uuid
.Data4
[3],
369 uuid
.Data4
[4], uuid
.Data4
[5],
370 uuid
.Data4
[6], uuid
.Data4
[7]);
372 proto_tree_add_text(tr
, tvb
, offset
+17, 2, "Version %d.%d", tvb_get_guint8(tvb
, offset
+17), tvb_get_guint8(tvb
, offset
+18));
375 guint16 version
= tvb_get_ntohs(tvb
, offset
+17);
376 const char *service
= dcerpc_get_proto_name(&uuid
, version
);
377 if (service
|| uuid_name
) {
378 const char *s
= service
? service
: uuid_name
;
379 proto_item_append_text(tr
, "UUID: %s", s
);
380 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", %s", s
);
382 proto_item_append_text(tr
, "UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x Version %d.%d", uuid
.Data1
, uuid
.Data2
, uuid
.Data3
,
383 uuid
.Data4
[0], uuid
.Data4
[1],
384 uuid
.Data4
[2], uuid
.Data4
[3],
385 uuid
.Data4
[4], uuid
.Data4
[5],
386 uuid
.Data4
[6], uuid
.Data4
[7],
387 tvb_get_guint8(tvb
, offset
+17),
388 tvb_get_guint8(tvb
, offset
+18));
395 len
= tvb_get_letohs(tvb
, offset
);
396 pi
= proto_tree_add_uint(tr
, hf_epm_tower_rhs_len
, tvb
, offset
, 2, len
);
402 /* XXX - is this big or little endian? */
403 proto_tree_add_item(tr
, hf_epm_ver_min
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
405 case PROTO_ID_TCP
: /* this one is always big endian */
406 proto_tree_add_item(tr
, hf_epm_proto_tcp_port
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
407 proto_item_append_text(tr
, "TCP Port:%d", tvb_get_ntohs(tvb
, offset
));
410 case PROTO_ID_UDP
: /* this one is always big endian */
411 proto_tree_add_item(tr
, hf_epm_proto_udp_port
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
412 proto_item_append_text(tr
, "UDP Port:%d", tvb_get_ntohs(tvb
, offset
));
415 case PROTO_ID_IP
: /* this one is always big endian */
416 proto_tree_add_item(tr
, hf_epm_proto_ip
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
417 proto_item_append_text(tr
, "IP:%s", tvb_ip_to_str(tvb
, offset
));
420 case PROTO_ID_RPC_CO
:
421 proto_item_append_text(tr
, "RPC connection-oriented protocol");
424 case PROTO_ID_RPC_CL
:
425 proto_item_append_text(tr
, "RPC connectionless protocol");
426 /* XXX - is this big or little endian? */
427 proto_tree_add_item(tr
, hf_epm_ver_min
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
430 case PROTO_ID_NAMED_PIPES
: /* \\PIPE\xxx named pipe */
431 proto_tree_add_item(tr
, hf_epm_proto_named_pipes
, tvb
, offset
, len
, ENC_ASCII
|ENC_NA
);
432 proto_item_append_text(tr
, "NamedPipe:%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, len
));
435 case PROTO_ID_NAMED_PIPES_2
: /* PIPENAME named pipe */
436 proto_tree_add_item(tr
, hf_epm_proto_named_pipes
, tvb
, offset
, len
, ENC_ASCII
|ENC_NA
);
437 proto_item_append_text(tr
, "PIPE:%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, len
));
440 case PROTO_ID_NETBIOS
: /* \\NETBIOS netbios name */
441 proto_tree_add_item(tr
, hf_epm_proto_netbios_name
, tvb
, offset
, len
, ENC_ASCII
|ENC_NA
);
442 proto_item_append_text(tr
, "NetBIOS:%s", tvb_get_string(wmem_packet_scope(), tvb
, offset
, len
));
444 case PROTO_ID_HTTP
: /* RPC over HTTP */
445 proto_tree_add_item(tr
, hf_epm_proto_http_port
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
446 proto_item_append_text(tr
, "RPC over HTTP Port:%d", tvb_get_ntohs(tvb
, offset
));
451 expert_add_info_format(pinfo
, pi
, &ei_epm_proto_undecoded
, "RightHandSide not decoded yet for proto_id 0x%x",
457 proto_item_set_len(it
, offset
-old_offset
);
463 unsigned int tower_len,
464 [size_is(tower_len)] char tower[];
468 epm_dissect_tower (tvbuff_t
*tvb
, int offset
,
469 packet_info
*pinfo
, proto_tree
*tree
,
470 dcerpc_info
*di
, guint8
*drep
)
474 if(di
->conformant_run
){
478 /* first one is the header of the conformant array, second one is the
480 offset
= dissect_ndr_uint3264 (tvb
, offset
, pinfo
, tree
, di
, drep
,
481 hf_epm_tower_length
, &len
);
482 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
483 hf_epm_tower_length
, NULL
);
484 offset
= epm_dissect_tower_data(tvb
, offset
, pinfo
, tree
, di
, drep
);
489 epm_dissect_tower_pointer (tvbuff_t
*tvb
, int offset
,
490 packet_info
*pinfo
, proto_tree
*tree
,
491 dcerpc_info
*di
, guint8
*drep
)
493 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
494 epm_dissect_tower
, NDR_POINTER_PTR
,
495 "Tower pointer:", -1);
499 epm_dissect_tower_array (tvbuff_t
*tvb
, int offset
,
500 packet_info
*pinfo
, proto_tree
*tree
,
501 dcerpc_info
*di
, guint8
*drep
)
503 offset
= dissect_ndr_ucvarray(tvb
, offset
, pinfo
, tree
, di
, drep
,
504 epm_dissect_tower_pointer
);
510 epm_dissect_ept_map_rqst (tvbuff_t
*tvb
, int offset
,
511 packet_info
*pinfo
, proto_tree
*tree
,
512 dcerpc_info
*di
, guint8
*drep
)
514 /* [in, ptr] uuid_p_t object */
515 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
516 epm_dissect_uuid
, NDR_POINTER_PTR
,
517 "UUID pointer:", -1);
519 /* [in, ptr] twr_p_t map_tower */
520 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
521 epm_dissect_tower
, NDR_POINTER_PTR
,
522 "Tower pointer:", -1);
524 /* [in, out] ept_lookup_handle_t *entry_handle */
525 offset
= dissect_ndr_ctx_hnd (tvb
, offset
, pinfo
, tree
, di
, drep
,
528 /* [in] unsigned32 max_towers */
529 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
530 hf_epm_max_towers
, NULL
);
536 epm_dissect_ept_map_resp (tvbuff_t
*tvb
, int offset
,
537 packet_info
*pinfo
, proto_tree
*tree
,
538 dcerpc_info
*di
, guint8
*drep
)
540 /* [in, out] ept_lookup_handle_t *entry_handle */
541 offset
= dissect_ndr_ctx_hnd (tvb
, offset
, pinfo
, tree
, di
, drep
,
544 /* [out, ptr] unsigned32 *num_towers */
545 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
546 hf_epm_num_towers
, NULL
);
548 /* [out, length_is(*num_towers), size_is(max_towers), ptr] twr_p_t towers[] */
549 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
550 epm_dissect_tower_array
, NDR_POINTER_REF
,
553 /* [out] error_status_t *status */
554 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
561 epm_dissect_ept_entry_t_ucarray(tvbuff_t
*tvb
, int offset
,
562 packet_info
*pinfo
, proto_tree
*tree
,
563 dcerpc_info
*di
, guint8
*drep
)
565 offset
= dissect_ndr_ucarray(tvb
, offset
, pinfo
, tree
, di
, drep
,
566 epm_dissect_ept_entry_t
);
572 epm_dissect_ept_insert_rqst (tvbuff_t
*tvb
, int offset
,
573 packet_info
*pinfo
, proto_tree
*tree
,
574 dcerpc_info
*di
, guint8
*drep
)
576 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
577 hf_epm_num_ents
, NULL
);
579 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
580 epm_dissect_ept_entry_t_ucarray
, NDR_POINTER_REF
,
583 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
584 hf_epm_replace
, NULL
);
592 epm_dissect_ept_insert_resp (tvbuff_t
*tvb
, int offset
,
593 packet_info
*pinfo
, proto_tree
*tree
,
594 dcerpc_info
*di _U_
, guint8
*drep
)
596 /* [out] error_status_t *status */
597 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
605 epm_dissect_ept_delete_rqst (tvbuff_t
*tvb
, int offset
,
606 packet_info
*pinfo
, proto_tree
*tree
,
607 dcerpc_info
*di
, guint8
*drep
)
609 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
610 hf_epm_num_ents
, NULL
);
612 offset
= dissect_ndr_pointer(tvb
, offset
, pinfo
, tree
, di
, drep
,
613 epm_dissect_ept_entry_t_ucarray
, NDR_POINTER_REF
,
622 epm_dissect_ept_delete_resp (tvbuff_t
*tvb
, int offset
,
623 packet_info
*pinfo
, proto_tree
*tree
,
624 dcerpc_info
*di _U_
, guint8
*drep
)
626 /* [out] error_status_t *status */
627 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
636 epm_dissect_ept_lookup_handle_free_rqst (tvbuff_t
*tvb
, int offset
,
637 packet_info
*pinfo
, proto_tree
*tree
,
638 dcerpc_info
*di
, guint8
*drep
)
640 /* [in, out] ept_lookup_handle_t *entry_handle */
641 offset
= dissect_ndr_ctx_hnd (tvb
, offset
, pinfo
, tree
, di
, drep
,
648 epm_dissect_ept_lookup_handle_free_resp (tvbuff_t
*tvb
, int offset
,
649 packet_info
*pinfo
, proto_tree
*tree
,
650 dcerpc_info
*di
, guint8
*drep
)
652 /* [in, out] ept_lookup_handle_t *entry_handle */
653 offset
= dissect_ndr_ctx_hnd (tvb
, offset
, pinfo
, tree
, di
, drep
,
656 offset
= dissect_ndr_uint32(tvb
, offset
, pinfo
, tree
, di
, drep
,
663 static dcerpc_sub_dissector epm_dissectors
[] = {
665 epm_dissect_ept_insert_rqst
,
666 epm_dissect_ept_insert_resp
},
668 epm_dissect_ept_delete_rqst
,
669 epm_dissect_ept_delete_resp
},
671 epm_dissect_ept_lookup_rqst
,
672 epm_dissect_ept_lookup_resp
},
674 epm_dissect_ept_map_rqst
,
675 epm_dissect_ept_map_resp
},
676 { 4, "LookupHandleFree",
677 epm_dissect_ept_lookup_handle_free_rqst
,
678 epm_dissect_ept_lookup_handle_free_resp
},
679 { 5, "InqObject", NULL
, NULL
},
680 { 6, "MgmtDelete", NULL
, NULL
},
681 { 0, NULL
, NULL
, NULL
}
685 proto_register_epm (void)
687 static hf_register_info hf
[] = {
689 { "Operation", "epm.opnum", FT_UINT16
, BASE_DEC
,
690 NULL
, 0x0, NULL
, HFILL
}},
691 { &hf_epm_inquiry_type
,
692 { "Inquiry type", "epm.inq_type", FT_UINT32
, BASE_DEC
, VALS(ep_service
), 0x0, NULL
, HFILL
}},
694 { "Object", "epm.object", FT_GUID
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
696 { "Interface", "epm.if_id", FT_GUID
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
698 { "Version Major", "epm.ver_maj", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
700 { "Version Minor", "epm.ver_min", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
702 { "Version Option", "epm.ver_opt", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
704 { "Handle", "epm.hnd", FT_BYTES
, BASE_NONE
, NULL
, 0x0, "Context handle", HFILL
}},
706 { "Max entries", "epm.max_ents", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
708 { "Num entries", "epm.num_ents", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
710 { "UUID", "epm.uuid", FT_GUID
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
711 { &hf_epm_annotation
,
712 { "Annotation", "epm.annotation", FT_STRING
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
713 { &hf_epm_proto_named_pipes
,
714 { "Named Pipe", "epm.proto.named_pipe", FT_STRING
, BASE_NONE
, NULL
, 0x0, "Name of the named pipe for this service", HFILL
}},
715 { &hf_epm_proto_netbios_name
,
716 { "NetBIOS Name", "epm.proto.netbios_name", FT_STRING
, BASE_NONE
, NULL
, 0x0, "NetBIOS name where this service can be found", HFILL
}},
717 { &hf_epm_tower_length
,
718 { "Length", "epm.tower.len", FT_UINT32
, BASE_DEC
, NULL
, 0x0, "Length of tower data", HFILL
}},
720 { &hf_epm_tower_data
,
721 { "Tower", "epm.tower", FT_BYTES
, BASE_NONE
, NULL
, 0x0, "Tower data", HFILL
}},
723 { &hf_epm_max_towers
,
724 { "Max Towers", "epm.max_towers", FT_UINT32
, BASE_DEC
, NULL
, 0x0, "Maximum number of towers to return", HFILL
}},
725 { &hf_epm_num_towers
,
726 { "Num Towers", "epm.num_towers", FT_UINT32
, BASE_DEC
, NULL
, 0x0, "Number number of towers to return", HFILL
}},
727 { &hf_epm_ann_offset
,
728 { "Annotation offset", "epm.ann_offset", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
730 { "Annotation length", "epm.ann_len", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
732 { "Return code", "epm.rc", FT_UINT32
, BASE_HEX
, NULL
, 0x0, "EPM return value", HFILL
}},
734 { "Replace", "epm.replace", FT_UINT8
, BASE_DEC
, NULL
, 0x0, "Replace existing objects?", HFILL
}},
735 { &hf_epm_tower_num_floors
,
736 { "Number of floors", "epm.tower.num_floors", FT_UINT16
, BASE_DEC
, NULL
, 0x0, "Number of floors in tower", HFILL
}},
737 { &hf_epm_proto_udp_port
,
738 { "UDP Port", "epm.proto.udp_port", FT_UINT16
, BASE_DEC
, NULL
, 0x0, "UDP Port where this service can be found", HFILL
}},
739 { &hf_epm_proto_tcp_port
,
740 { "TCP Port", "epm.proto.tcp_port", FT_UINT16
, BASE_DEC
, NULL
, 0x0, "TCP Port where this service can be found", HFILL
}},
741 { &hf_epm_proto_http_port
,
742 { "TCP Port", "epm.proto.http_port", FT_UINT16
, BASE_DEC
, NULL
, 0x0, "TCP Port where this service can be found", HFILL
}},
743 { &hf_epm_tower_rhs_len
,
744 { "RHS Length", "epm.tower.rhs.len", FT_UINT16
, BASE_DEC
, NULL
, 0x0, "Length of RHS data", HFILL
}},
745 { &hf_epm_tower_lhs_len
,
746 { "LHS Length", "epm.tower.lhs.len", FT_UINT16
, BASE_DEC
, NULL
, 0x0, "Length of LHS data", HFILL
}},
748 { "IP", "epm.proto.ip", FT_IPv4
, BASE_NONE
, NULL
, 0x0, "IP address where service is located", HFILL
}},
749 { &hf_epm_tower_proto_id
,
750 { "Protocol", "epm.tower.proto_id", FT_UINT8
, BASE_HEX
, VALS(proto_id_vals
), 0x0, "Protocol identifier", HFILL
}}
752 static gint
*ett
[] = {
754 &ett_epm_tower_floor
,
758 static ei_register_info ei
[] = {
759 { &ei_epm_proto_undecoded
, { "epm.proto_id.undecoded", PI_UNDECODED
, PI_WARN
, "RightHandSide not decoded yet for proto_id", EXPFILL
}},
762 expert_module_t
* expert_epm3
;
764 /* interface version 3 */
765 proto_epm3
= proto_register_protocol ("DCE/RPC Endpoint Mapper", "EPM", "epm");
766 proto_register_field_array (proto_epm3
, hf
, array_length (hf
));
767 proto_register_subtree_array (ett
, array_length (ett
));
768 expert_epm3
= expert_register_protocol(proto_epm3
);
769 expert_register_field_array(expert_epm3
, ei
, array_length(ei
));
771 /* interface version 4 */
772 proto_epm4
= proto_register_protocol ("DCE/RPC Endpoint Mapper v4", "EPMv4", "epm4");
776 proto_reg_handoff_epm (void)
778 /* Register the protocol as dcerpc */
779 dcerpc_init_uuid (proto_epm3
, ett_epm
, &uuid_epm
, ver_epm3
, epm_dissectors
, hf_epm_opnum
);
780 dcerpc_init_uuid (proto_epm4
, ett_epm
, &uuid_epm
, ver_epm4
, epm_dissectors
, hf_epm_opnum
);
784 * Editor modelines - http://www.wireshark.org/tools/modelines.html
789 * indent-tabs-mode: nil
792 * vi: set shiftwidth=4 tabstop=8 expandtab:
793 * :indentSize=4:tabSize=8:noTabs=true: