MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-dplay.c
blob94cdbdbf6c94b1b5fc4378b6bf5377a236a62cb5
1 /* packet-dplay.c
2 * This is a dissector for the DirectPlay protocol.
3 * Copyright 2006 - 2008 by Kai Blin
5 * $Id$
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,
24 * USA.51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "config.h"
30 #include <epan/packet.h>
31 #include <epan/wmem/wmem.h>
32 #include <epan/aftypes.h>
33 #include <string.h>
35 /* function declarations */
36 void proto_register_dplay(void);
37 void proto_reg_handoff_dplay(void);
39 static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
40 static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset);
42 static int proto_dplay = -1;
44 /* Common data fields */
45 static int hf_dplay_size = -1; /* Size of the whole data */
46 static int hf_dplay_token = -1;
47 static int hf_dplay_saddr_af = -1; /* WINSOCK_AF_INET, as this dissector does not handle IPX yet */
48 static int hf_dplay_saddr_port = -1; /* port to use for the reply to this packet */
49 static int hf_dplay_saddr_ip = -1; /* IP to use for the reply to this packet, or 0.0.0.0,
50 then use the same IP as this packet used. */
51 static int hf_dplay_saddr_padding = -1; /* null padding used in s_addr_in structures */
52 static int hf_dplay_play_str = -1; /* always "play" without a null terminator */
53 static int hf_dplay_command = -1; /* the dplay command this message contains*/
54 static int hf_dplay_proto_dialect = -1; /* 0x0b00 for dplay7, 0x0e00 for dplay9 */
55 static int hf_dplay_play_str_2 = -1; /* packet type 0x0015 encapsulates another packet */
56 static int hf_dplay_command_2 = -1; /* that also has a "play" string, a command and a */
57 static int hf_dplay_proto_dialect_2 = -1; /* protocol dialect, same as above */
58 static const int DPLAY_HEADER_OFFSET = 28; /* The dplay header is 28 bytes in size */
59 static int hf_dplay_player_msg = -1;
61 /* The following fields are not part of the header, but hopefully have the same
62 * meaning for all packets they show up in. */
64 static int hf_dplay_sess_desc_flags = -1; /* This is a 32bit field with some sort of a flag */
65 static int hf_dplay_flags_no_create_players = -1;
66 static int hf_dplay_flags_0002 = -1;
67 static int hf_dplay_flags_migrate_host = -1;
68 static int hf_dplay_flags_short_player_msg = -1;
69 static int hf_dplay_flags_ignored = -1;
70 static int hf_dplay_flags_can_join = -1;
71 static int hf_dplay_flags_use_ping = -1;
72 static int hf_dplay_flags_no_player_updates = -1;
73 static int hf_dplay_flags_use_auth = -1;
74 static int hf_dplay_flags_private_session = -1;
75 static int hf_dplay_flags_password_req = -1;
76 static int hf_dplay_flags_route = -1;
77 static int hf_dplay_flags_server_player_only = -1;
78 static int hf_dplay_flags_reliable = -1;
79 static int hf_dplay_flags_preserve_order = -1;
80 static int hf_dplay_flags_optimize_latency = -1;
81 static int hf_dplay_flags_acqire_voice = -1;
82 static int hf_dplay_flags_no_sess_desc_changes = -1;
84 #define DPLAY_FLAG_NO_CREATE_PLAYERS 0x0001
85 #define DPLAY_FLAG_0002 0x0002
86 #define DPLAY_FLAG_MIGRATE_HOST 0x0004
87 #define DPLAY_FLAG_SHORT_PLAYER_MSG 0x0008
88 #define DPLAY_FLAG_IGNORED 0x0010
89 #define DPLAY_FLAG_CAN_JOIN 0x0020
90 #define DPLAY_FLAG_USE_PING 0x0040
91 #define DPLAY_FLAG_NO_P_UPD 0x0080
92 #define DPLAY_FLAG_USE_AUTH 0x0100
93 #define DPLAY_FLAG_PRIV_SESS 0x0200
94 #define DPLAY_FLAG_PASS_REQ 0x0400
95 #define DPLAY_FLAG_ROUTE 0x0800
96 #define DPLAY_FLAG_SRV_ONLY 0x1000
97 #define DPLAY_FLAG_RELIABLE 0x2000
98 #define DPLAY_FLAG_ORDER 0x4000
99 #define DPLAY_FLAG_OPT_LAT 0x8000
100 #define DPLAY_FLAG_ACQ_VOICE 0x10000
101 #define DPLAY_FLAG_NO_SESS_DESC_CHANGES 0x20000
103 /* Session description structure fields */
104 static int hf_dplay_sess_desc_length = -1;
105 static int hf_dplay_game_guid = -1;
106 static int hf_dplay_instance_guid = -1;
107 static int hf_dplay_max_players = -1;
108 static int hf_dplay_curr_players = -1;
109 static int hf_dplay_sess_name_ptr = -1;
110 static int hf_dplay_passwd_ptr = -1;
111 static int hf_dplay_sess_desc_reserved_1 = -1;
112 static int hf_dplay_sess_desc_reserved_2 = -1;
113 static int hf_dplay_sess_desc_user_1 = -1;
114 static int hf_dplay_sess_desc_user_2 = -1;
115 static int hf_dplay_sess_desc_user_3 = -1;
116 static int hf_dplay_sess_desc_user_4 = -1;
118 /* PackedPlayer structure fields */
119 static int hf_dplay_pp_size = -1;
120 static int hf_dplay_pp_flags = -1;
121 static int hf_dplay_pp_flag_sysplayer = -1;
122 static int hf_dplay_pp_flag_nameserver = -1;
123 static int hf_dplay_pp_flag_in_group = -1;
124 static int hf_dplay_pp_flag_sending = -1;
125 static int hf_dplay_pp_id = -1;
126 static int hf_dplay_pp_short_name_len = -1;
127 static int hf_dplay_pp_long_name_len = -1;
128 static int hf_dplay_pp_sp_data_size = -1;
129 static int hf_dplay_pp_player_data_size = -1;
130 static int hf_dplay_pp_num_players = -1;
131 static int hf_dplay_pp_system_player = -1;
132 static int hf_dplay_pp_fixed_size = -1;
133 static int hf_dplay_pp_dialect = -1;
134 static int hf_dplay_pp_unknown_1 = -1;
135 static int hf_dplay_pp_short_name = -1;
136 static int hf_dplay_pp_long_name = -1;
137 static int hf_dplay_pp_sp_data = -1;
138 static int hf_dplay_pp_player_data = -1;
139 static int hf_dplay_pp_player_id = -1;
140 static int hf_dplay_pp_parent_id = -1;
141 #define DPLAY_PP_FLAG_SYSPLAYER 0x01
142 #define DPLAY_PP_FLAG_NAMESERVER 0x02
143 #define DPLAY_PP_FLAG_IN_GROUP 0x04
144 #define DPLAY_PP_FLAG_SENDING 0x08
146 /* SuperPackedPlayer structure fields */
147 static int hf_dplay_spp_size = -1;
148 static int hf_dplay_spp_flags = -1;
149 static int hf_dplay_spp_flags_sysplayer = -1;
150 static int hf_dplay_spp_flags_nameserver = -1;
151 static int hf_dplay_spp_flags_in_group = -1;
152 static int hf_dplay_spp_flags_sending = -1;
153 static int hf_dplay_spp_id = -1;
154 static int hf_dplay_spp_player_info_mask = -1;
155 static int hf_dplay_spp_have_short_name = -1;
156 static int hf_dplay_spp_have_long_name = -1;
157 static int hf_dplay_spp_sp_length_type = -1;
158 static int hf_dplay_spp_pd_length_type = -1;
159 static int hf_dplay_spp_player_count_type = -1;
160 static int hf_dplay_spp_have_parent_id = -1;
161 static int hf_dplay_spp_shortcut_count_type = -1;
162 static int hf_dplay_spp_dialect = -1;
163 static int hf_dplay_spp_sys_player_id = -1;
164 static int hf_dplay_spp_short_name = -1;
165 static int hf_dplay_spp_long_name = -1;
166 static int hf_dplay_spp_player_data_length = -1;
167 static int hf_dplay_spp_player_data = -1;
168 static int hf_dplay_spp_sp_data_length = -1;
169 static int hf_dplay_spp_sp_data = -1;
170 static int hf_dplay_spp_player_count = -1;
171 static int hf_dplay_spp_player_id = -1;
172 static int hf_dplay_spp_parent_id = -1;
173 static int hf_dplay_spp_shortcut_count = -1;
174 static int hf_dplay_spp_shortcut_id = -1;
175 #define DPLAY_SPP_FLAG_SYSPLAYER 0x01
176 #define DPLAY_SPP_FLAG_NAMESERVER 0x02
177 #define DPLAY_SPP_FLAG_IN_GROUP 0x04
178 #define DPLAY_SPP_FLAG_SENDING 0x08
180 /* SecurityDesc structure fields */
181 static int hf_dplay_sd_size = -1;
182 static int hf_dplay_sd_flags = -1;
183 static int hf_dplay_sd_sspi = -1;
184 static int hf_dplay_sd_capi = -1;
185 static int hf_dplay_sd_capi_type = -1;
186 static int hf_dplay_sd_enc_alg = -1;
188 /* Message Type 0x0001 data fields */
189 static int hf_dplay_type_01_name_offset = -1;
190 static int hf_dplay_type_01_game_name = -1;
192 /* Message Type 0x0002 data fields */
193 static int hf_dplay_type_02_game_guid = -1;
194 static int hf_dplay_type_02_password_offset = -1;
195 static int hf_dplay_type_02_flags = -1;
196 static int hf_dplay_type_02_password = -1;
197 static int hf_enum_sess_flag_join = -1;
198 static int hf_enum_sess_flag_all = -1;
199 static int hf_enum_sess_flag_passwd = -1;
200 #define DPLAY_ENUM_SESS_FLAG_JOIN 0x0001
201 #define DPLAY_ENUM_SESS_FLAG_ALL 0x0002
202 #define DPLAY_ENUM_SESS_FLAG_PASSWD 0x0040
204 /* Message Type 0x0005 data fields */
205 static int hf_dplay_type_05_flags = -1;
206 static int hf_dplay_type_05_system_player = -1;
207 static int hf_dplay_type_05_name_server = -1;
208 static int hf_dplay_type_05_local = -1;
209 static int hf_dplay_type_05_unknown = -1; /* unknown, but always set */
210 static int hf_dplay_type_05_secure = -1;
211 #define DPLAY_TYPE05_FLAG_SYSPLAYER 0x001
212 #define DPLAY_TYPE05_FLAG_NAMESERVER 0x002
213 #define DPLAY_TYPE05_FLAG_LOCAL 0x004
214 #define DPLAY_TYPE05_FLAG_UNKNOWN 0x008
215 #define DPLAY_TYPE05_FLAG_SECURE 0x200
217 /* Message Type 0x0007 data fields */
218 static int hf_dplay_type_07_dpid = -1;
219 static int hf_dplay_type_07_sspi_offset = -1;
220 static int hf_dplay_type_07_capi_offset = -1;
221 static int hf_dplay_type_07_hresult = -1;
222 static int hf_dplay_type_07_sspi = -1;
223 static int hf_dplay_type_07_capi = -1;
225 /* Data fields for message types 0x08, 0x09, 0x0b, 0x0c, 0x0d, 0x0e */
226 static int hf_dplay_multi_id_to = -1;
227 static int hf_dplay_multi_player_id = -1;
228 static int hf_dplay_multi_group_id = -1;
229 static int hf_dplay_multi_create_offset = -1;
230 static int hf_dplay_multi_password_offset = -1;
231 static int hf_dplay_multi_password = -1;
233 /* Message Type 0x000f data fields */
234 static int hf_dplay_type_0f_id_to = -1;
235 static int hf_dplay_type_0f_id = -1;
236 static int hf_dplay_type_0f_data_size = -1;
237 static int hf_dplay_type_0f_data_offset = -1;
238 static int hf_dplay_type_0f_data = -1;
240 /* Message Type 0x0013 data fields */
241 static int hf_dplay_type_13_id_to = -1;
242 static int hf_dplay_type_13_player_id = -1;
243 static int hf_dplay_type_13_group_id = -1;
244 static int hf_dplay_type_13_create_offset = -1;
245 static int hf_dplay_type_13_password_offset = -1;
246 static int hf_dplay_type_13_password = -1;
247 static int hf_dplay_type_13_tick_count = -1;
249 /* Message Type 0x0015 data fields */
250 static int hf_dplay_message_guid = -1;
251 static int hf_dplay_type_15_packet_idx = -1;
252 static int hf_dplay_type_15_data_size = -1;
253 static int hf_dplay_type_15_offset = -1;
254 static int hf_dplay_type_15_total_packets = -1;
255 static int hf_dplay_type_15_msg_size = -1;
256 static int hf_dplay_type_15_packet_offset = -1;
258 /* Message Type 0x0016 and 0x0017 data fields */
259 static int hf_dplay_ping_id_from = -1;
260 static int hf_dplay_ping_tick_count = -1;
262 /* Message Type 0x001a data fields */
263 static int hf_dplay_type_1a_id_to = -1;
264 static int hf_dplay_type_1a_sess_name_ofs = -1;
265 static int hf_dplay_type_1a_password_ofs = -1;
266 static int hf_dplay_type_1a_session_name = -1;
267 static int hf_dplay_type_1a_password = -1;
269 /* Message Type 0x0029 data fields */
270 static int hf_dplay_type_29_player_count = -1;
271 static int hf_dplay_type_29_group_count = -1;
272 static int hf_dplay_type_29_packed_offset = -1;
273 static int hf_dplay_type_29_shortcut_count = -1;
274 static int hf_dplay_type_29_description_offset = -1;
275 static int hf_dplay_type_29_name_offset = -1;
276 static int hf_dplay_type_29_password_offset = -1;
277 static int hf_dplay_type_29_game_name = -1;
278 static int hf_dplay_type_29_password = -1;
280 /* Message Type 0x002f data fields */
281 static int hf_dplay_type_2f_dpid = -1;
283 /* various */
284 static gint ett_dplay = -1;
285 static gint ett_dplay_header = -1;
286 static gint ett_dplay_sockaddr = -1;
287 static gint ett_dplay_data = -1;
288 static gint ett_dplay_enc_packet = -1;
289 static gint ett_dplay_flags = -1;
290 static gint ett_dplay_sess_desc_flags = -1;
291 static gint ett_dplay_pp_flags = -1;
292 static gint ett_dplay_spp_flags = -1;
293 static gint ett_dplay_spp_info_mask = -1;
294 static gint ett_dplay_type02_flags = -1;
295 static gint ett_dplay_type05_flags = -1;
296 static gint ett_dplay_type29_spp = -1;
298 static const value_string dplay_command_val[] = {
299 { 0x0001, "Enum Sessions Reply" },
300 { 0x0002, "Enum Sessions" },
301 { 0x0003, "Enum Players Reply" },
302 { 0x0004, "Enum Players" },
303 { 0x0005, "Request Player ID" },
304 { 0x0006, "Request Group ID" },
305 { 0x0007, "Request Player Reply" },
306 { 0x0008, "Create Player" },
307 { 0x0009, "Create Group" },
308 { 0x000a, "Player Message" },
309 { 0x000b, "Delete Player" },
310 { 0x000c, "Delete Group" },
311 { 0x000d, "Add Player To Group" },
312 { 0x000e, "Delete Player From Group" },
313 { 0x000f, "Player Data Changed" },
314 { 0x0010, "Player Name Changed" },
315 { 0x0011, "Group Data Changed" },
316 { 0x0012, "Group Name Changed" },
317 { 0x0013, "Add Forward Request" },
318 /* There is no command 0x0014 */
319 { 0x0015, "Packet" },
320 { 0x0016, "Ping" },
321 { 0x0017, "Pong" },
322 { 0x0018, "You Are Dead" },
323 { 0x0019, "Player Wrapper" },
324 { 0x001a, "Session Desc Changed" },
325 { 0x001c, "Challenge" },
326 { 0x001d, "Access Granted" },
327 { 0x001e, "Logon Denied" },
328 { 0x001f, "Auth Error" },
329 { 0x0020, "Negotiate" },
330 { 0x0021, "Challenge Response" },
331 { 0x0022, "Signed"},
332 /* There is no command 0x0023 */
333 { 0x0024, "Add Forward Reply" },
334 { 0x0025, "Ask For Multicast" },
335 { 0x0026, "Ask For Multicast Guaranteed" },
336 { 0x0027, "Add Shortcut To Group" },
337 { 0x0028, "Delete Group From Group" },
338 { 0x0029, "Super Enum Players Reply" },
339 /* There is no command 0x002a */
340 { 0x002b, "Key Exchange" },
341 { 0x002c, "Key Exchange Reply" },
342 { 0x002d, "Chat" },
343 { 0x002e, "Add Forward" },
344 { 0x002f, "Add Forward ACK" },
345 { 0x0030, "Packet2 Data" },
346 { 0x0031, "Packet2 ACK" },
347 /* No commands 0x0032, 0x0033, 0x0034 */
348 { 0x0035, "I Am Nameserver" },
349 { 0x0036, "Voice" },
350 { 0x0037, "Multicast Delivery" },
351 { 0x0038, "Create Players Verify"},
352 { 0 , NULL },
355 static const value_string dplay_af_val[] = {
356 { WINSOCK_AF_INET, "AF_INET" },
357 { WINSOCK_AF_IPX, "AF_IPX" },
358 { 0 , NULL},
361 static const value_string dplay_proto_dialect_val[] = {
362 { 0x0009, "dplay 6" },
363 { 0x000a, "dplay 6.1" },
364 { 0x000b, "dplay 6.1a" },
365 { 0x000c, "dplay 7.1" },
366 { 0x000d, "dplay 8" },
367 { 0x000e, "dplay 9"},
368 { 0 , NULL},
371 static const value_string dplay_token_val[] = {
372 { 0xfab, "Remote Message" },
373 { 0xcab, "Forwarded Message" },
374 { 0xbab, "Server Message" },
375 { 0 , NULL },
378 static const value_string dplay_spp_length_val[] = {
379 { 0x0, "Not present" },
380 { 0x1, "One byte" },
381 { 0x2, "Two bytes" },
382 { 0x3, "Four bytes" },
383 { 0 , NULL},
386 static const value_string dplay_enc_alg_val[] = {
387 { 0x0000, "Default" },
388 { 0x6611, "AES" },
389 { 0x6603, "3DES" },
390 { 0x6601, "DES" },
391 { 0x6602, "RC2" },
392 { 0x6801, "RC4" },
393 { 0 , NULL },
396 static const value_string yes_no_val[] = {
397 { 0x0, "No" },
398 { 0x1, "Yes" },
399 { 0 , NULL },
402 static const true_false_string tfs_dplay_flag = {
403 "present",
404 "absent"
407 /* borrowed from epan/dissectors/packets-smb-common.c */
408 static gint display_unicode_string(proto_tree *tree, gint hf_index, tvbuff_t *tvb, gint offset)
410 char *str, *p;
411 gint len;
412 gint charoffset;
413 guint16 character;
415 /* display a unicode string from the tree and return new offset */
418 * Get the length of the string.
419 * XXX - is it a bug or a feature that this will throw an exception
420 * if we don't find the '\0'? I think it's a feature.
422 len = 0;
423 while (tvb_get_letohs(tvb, offset + len) != '\0')
424 len += 2;
425 len += 2; /* count the '\0' too */
428 * Allocate a buffer for the string; "len" is the length in
429 * bytes, not the length in characters.
431 str = (char *)wmem_alloc(wmem_packet_scope(), len/2);
434 * XXX - this assumes the string is just ISO 8859-1; we need
435 * to better handle multiple character sets in Wireshark,
436 * including Unicode/ISO 10646, and multiple encodings of
437 * that character set (UCS-2, UTF-8, etc.).
439 charoffset = offset;
440 p = str;
441 while ((character = tvb_get_letohs(tvb, charoffset)) != '\0') {
442 *p++ = (char) character;
443 charoffset += 2;
445 *p = '\0';
447 proto_tree_add_string(tree, hf_index, tvb, offset, len, str);
449 return offset+len;
452 static gint dissect_sockaddr_in(proto_tree *tree, tvbuff_t *tvb, gint offset)
454 proto_item *sa_item = NULL;
455 proto_tree *sa_tree = NULL;
457 sa_item = proto_tree_add_text(tree, tvb, offset, 16,
458 "DirectPlay sockaddr_in structure");
459 sa_tree = proto_item_add_subtree(sa_item, ett_dplay_sockaddr);
460 proto_tree_add_item(sa_tree, hf_dplay_saddr_af, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2;
461 proto_tree_add_item(sa_tree, hf_dplay_saddr_port, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2;
462 proto_tree_add_item(sa_tree, hf_dplay_saddr_ip, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4;
463 proto_tree_add_item(sa_tree, hf_dplay_saddr_padding, tvb, offset, 8, ENC_NA); offset += 8;
464 return offset;
467 static gint dissect_session_desc(proto_tree *tree, tvbuff_t *tvb, gint offset)
469 guint32 flags;
470 proto_item *flags_item = NULL;
471 proto_tree *flags_tree = NULL;
473 flags = tvb_get_letohl(tvb, offset+4);
475 proto_tree_add_item(tree, hf_dplay_sess_desc_length, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
476 flags_item = proto_tree_add_item(tree, hf_dplay_sess_desc_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
477 flags_tree = proto_item_add_subtree(flags_item, ett_dplay_sess_desc_flags);
478 proto_tree_add_boolean(flags_tree, hf_dplay_flags_no_sess_desc_changes, tvb, offset, 4, flags);
479 proto_tree_add_boolean(flags_tree, hf_dplay_flags_acqire_voice, tvb, offset, 4, flags);
480 proto_tree_add_boolean(flags_tree, hf_dplay_flags_optimize_latency, tvb, offset, 4, flags);
481 proto_tree_add_boolean(flags_tree, hf_dplay_flags_preserve_order, tvb, offset, 4, flags);
482 proto_tree_add_boolean(flags_tree, hf_dplay_flags_reliable, tvb, offset, 4, flags);
483 proto_tree_add_boolean(flags_tree, hf_dplay_flags_server_player_only, tvb, offset, 4, flags);
484 proto_tree_add_boolean(flags_tree, hf_dplay_flags_route, tvb, offset, 4, flags);
485 proto_tree_add_boolean(flags_tree, hf_dplay_flags_password_req, tvb, offset, 4, flags);
486 proto_tree_add_boolean(flags_tree, hf_dplay_flags_private_session, tvb, offset, 4, flags);
487 proto_tree_add_boolean(flags_tree, hf_dplay_flags_use_auth, tvb, offset, 4, flags);
488 proto_tree_add_boolean(flags_tree, hf_dplay_flags_no_player_updates, tvb, offset, 4, flags);
489 proto_tree_add_boolean(flags_tree, hf_dplay_flags_use_ping, tvb, offset, 4, flags);
490 proto_tree_add_boolean(flags_tree, hf_dplay_flags_can_join, tvb, offset, 4, flags);
491 proto_tree_add_boolean(flags_tree, hf_dplay_flags_ignored, tvb, offset, 4, flags);
492 proto_tree_add_boolean(flags_tree, hf_dplay_flags_short_player_msg, tvb, offset, 4, flags);
493 proto_tree_add_boolean(flags_tree, hf_dplay_flags_migrate_host, tvb, offset, 4, flags);
494 proto_tree_add_boolean(flags_tree, hf_dplay_flags_0002, tvb, offset, 4, flags);
495 proto_tree_add_boolean(flags_tree, hf_dplay_flags_no_create_players, tvb, offset, 4, flags);
496 offset += 4;
498 proto_tree_add_item(tree, hf_dplay_instance_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16;
499 proto_tree_add_item(tree, hf_dplay_game_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16;
500 proto_tree_add_item(tree, hf_dplay_max_players, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
501 proto_tree_add_item(tree, hf_dplay_curr_players, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
502 proto_tree_add_item(tree, hf_dplay_sess_name_ptr, tvb, offset, 4, ENC_NA); offset += 4;
503 proto_tree_add_item(tree, hf_dplay_passwd_ptr, tvb, offset, 4, ENC_NA); offset += 4;
504 proto_tree_add_item(tree, hf_dplay_sess_desc_reserved_1, tvb, offset, 4, ENC_NA); offset += 4;
505 proto_tree_add_item(tree, hf_dplay_sess_desc_reserved_2, tvb, offset, 4, ENC_NA); offset += 4;
506 proto_tree_add_item(tree, hf_dplay_sess_desc_user_1, tvb, offset, 4, ENC_NA); offset += 4;
507 proto_tree_add_item(tree, hf_dplay_sess_desc_user_2, tvb, offset, 4, ENC_NA); offset += 4;
508 proto_tree_add_item(tree, hf_dplay_sess_desc_user_3, tvb, offset, 4, ENC_NA); offset += 4;
509 proto_tree_add_item(tree, hf_dplay_sess_desc_user_4, tvb, offset, 4, ENC_NA); offset += 4;
511 return offset;
514 static gint dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset)
516 proto_tree *flags_tree;
517 proto_item *flags_item;
518 guint32 flags, sn_len, ln_len, sd_len, pd_len, num_players, i;
519 gint size;
521 size = tvb_get_letohl(tvb, offset);
522 proto_tree_add_item(tree, hf_dplay_pp_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
524 flags = tvb_get_letohl(tvb, offset);
525 flags_item = proto_tree_add_item(tree, hf_dplay_pp_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
526 flags_tree = proto_item_add_subtree(flags_item, ett_dplay_pp_flags);
527 proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_sending, tvb, offset, 4, flags);
528 proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_in_group, tvb, offset, 4, flags);
529 proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_nameserver, tvb, offset, 4, flags);
530 proto_tree_add_boolean(flags_tree, hf_dplay_pp_flag_sysplayer, tvb, offset, 4, flags);
531 offset += 4;
533 proto_tree_add_item(tree, hf_dplay_pp_id, tvb, offset, 4, ENC_NA); offset += 4;
535 sn_len = tvb_get_letohl(tvb, offset);
536 proto_tree_add_item(tree, hf_dplay_pp_short_name_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
537 ln_len = tvb_get_letohl(tvb, offset);
538 proto_tree_add_item(tree, hf_dplay_pp_long_name_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
539 sd_len = tvb_get_letohl(tvb, offset);
540 proto_tree_add_item(tree, hf_dplay_pp_sp_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
541 pd_len = tvb_get_letohl(tvb, offset);
542 proto_tree_add_item(tree, hf_dplay_pp_player_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
543 num_players = tvb_get_letohl(tvb, offset);
544 proto_tree_add_item(tree, hf_dplay_pp_num_players, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
546 proto_tree_add_item(tree, hf_dplay_pp_system_player, tvb, offset, 4, ENC_NA); offset += 4;
547 proto_tree_add_item(tree, hf_dplay_pp_fixed_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
548 proto_tree_add_item(tree, hf_dplay_pp_dialect, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
549 proto_tree_add_item(tree, hf_dplay_pp_unknown_1, tvb, offset, 4, ENC_NA); offset += 4;
551 if (sn_len)
552 offset = display_unicode_string(tree, hf_dplay_pp_short_name, tvb, offset);
554 if (ln_len)
555 offset = display_unicode_string(tree, hf_dplay_pp_long_name, tvb, offset);
557 proto_tree_add_item(tree, hf_dplay_pp_sp_data, tvb, offset, sd_len, ENC_NA);
558 offset += sd_len;
560 if (pd_len) {
561 proto_tree_add_item(tree, hf_dplay_pp_player_data, tvb, offset, pd_len, ENC_NA);
562 offset += pd_len;
565 for (i=0; i < num_players; ++i) {
566 proto_tree_add_item(tree, hf_dplay_pp_player_id, tvb, offset, 4, ENC_NA); offset += 4;
569 /* Size seems to miss the unknown empty dword */
570 if (size + 4 > offset) {
571 proto_tree_add_item(tree, hf_dplay_pp_parent_id, tvb, offset, 4, ENC_NA); offset += 4;
574 return offset;
577 static gint spp_get_value(guint32 length_type, tvbuff_t *tvb, gint offset, guint32 *value)
579 gint len = 0;
581 *value = 0;
583 switch (length_type) {
584 case 1:
585 len = 1;
586 *value = tvb_get_guint8(tvb, offset);
587 break;
588 case 2:
589 len = 2;
590 *value = tvb_get_letohs(tvb, offset);
591 break;
592 case 3:
593 len = 4;
594 *value = tvb_get_letohl(tvb, offset);
595 break;
598 return len;
601 static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset)
603 guint32 flags, is_sysplayer, info_mask;
604 guint32 have_short_name, have_long_name, sp_length_type, pd_length_type;
605 guint32 player_count_type, have_parent_id, shortcut_count_type;
606 guint32 player_data_length, sp_data_length, player_count, shortcut_count;
607 proto_item *flags_item = NULL, *im_item = NULL;
608 proto_tree *flags_tree = NULL, *im_tree = NULL;
609 gint len;
611 proto_tree_add_item(tree, hf_dplay_spp_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
613 flags = tvb_get_letohl(tvb, offset);
614 is_sysplayer = flags & 0x00000001;
615 flags_item = proto_tree_add_item(tree, hf_dplay_spp_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
616 flags_tree = proto_item_add_subtree(flags_item, ett_dplay_spp_flags);
617 proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_sending, tvb, offset, 4, flags);
618 proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_in_group, tvb, offset, 4, flags);
619 proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_nameserver, tvb, offset, 4, flags);
620 proto_tree_add_boolean(flags_tree, hf_dplay_spp_flags_sysplayer, tvb, offset, 4, flags);
621 offset += 4;
622 proto_tree_add_item(tree, hf_dplay_spp_id, tvb, offset, 4, ENC_NA); offset += 4;
624 info_mask = tvb_get_letohl(tvb, offset);
626 have_short_name = info_mask & 0x00000001;
627 have_long_name = (info_mask & 0x00000002) >> 1;
628 sp_length_type = (info_mask & 0x0000000c) >> 2;
629 pd_length_type = (info_mask & 0x00000030) >> 4;
630 player_count_type = (info_mask & 0x000000c0) >> 6;
631 have_parent_id = (info_mask & 0x00000100) >> 8;
632 shortcut_count_type = (info_mask & 0x00000600) >> 9;
634 im_item = proto_tree_add_item(tree, hf_dplay_spp_player_info_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
636 im_tree = proto_item_add_subtree(im_item, ett_dplay_spp_info_mask);
637 proto_tree_add_uint(im_tree, hf_dplay_spp_have_short_name, tvb, offset, 4, have_short_name);
638 proto_tree_add_uint(im_tree, hf_dplay_spp_have_long_name, tvb, offset, 4, have_long_name);
639 proto_tree_add_uint(im_tree, hf_dplay_spp_sp_length_type, tvb, offset, 4, sp_length_type);
640 proto_tree_add_uint(im_tree, hf_dplay_spp_pd_length_type, tvb, offset, 4, pd_length_type);
641 proto_tree_add_uint(im_tree, hf_dplay_spp_player_count_type, tvb, offset, 4, player_count_type);
642 proto_tree_add_uint(im_tree, hf_dplay_spp_have_parent_id, tvb, offset, 4, have_parent_id);
643 proto_tree_add_uint(im_tree, hf_dplay_spp_shortcut_count_type, tvb, offset, 4, shortcut_count_type);
644 offset+=4;
646 if (is_sysplayer) {
647 proto_tree_add_item(tree, hf_dplay_spp_dialect, tvb, offset, 4, ENC_LITTLE_ENDIAN);
648 } else {
649 proto_tree_add_item(tree, hf_dplay_spp_sys_player_id, tvb, offset, 4, ENC_NA);
651 offset += 4;
653 if (have_short_name) {
654 offset = display_unicode_string(tree, hf_dplay_spp_short_name, tvb, offset);
657 if (have_long_name) {
658 offset = display_unicode_string(tree, hf_dplay_spp_long_name, tvb, offset);
661 if (pd_length_type) {
662 len = spp_get_value(pd_length_type, tvb, offset, &player_data_length);
663 proto_tree_add_item(tree, hf_dplay_spp_player_data_length, tvb, offset, len, ENC_LITTLE_ENDIAN);
664 offset += len;
665 proto_tree_add_item(tree, hf_dplay_spp_player_data, tvb, offset, player_data_length, ENC_NA);
666 offset += player_data_length;
669 if (sp_length_type) {
670 len = spp_get_value(sp_length_type, tvb, offset, &sp_data_length);
671 proto_tree_add_item(tree, hf_dplay_spp_sp_data_length, tvb, offset, len, ENC_LITTLE_ENDIAN);
672 offset += len;
673 proto_tree_add_item(tree, hf_dplay_spp_sp_data, tvb, offset, sp_data_length, ENC_NA);
674 offset += sp_data_length;
677 if (player_count_type) {
678 guint32 i;
680 len = spp_get_value(player_count_type, tvb, offset, &player_count);
681 proto_tree_add_item(tree, hf_dplay_spp_player_count, tvb, offset, len, ENC_LITTLE_ENDIAN);
682 offset += len;
683 for (i=0; i < player_count; ++i) {
684 proto_tree_add_item(tree, hf_dplay_spp_player_id, tvb, offset, 4, ENC_NA); offset += 4;
688 if (have_parent_id) {
689 proto_tree_add_item(tree, hf_dplay_spp_parent_id, tvb, offset, 4, ENC_NA); offset += 4;
692 if (shortcut_count_type) {
693 guint32 i;
695 len = spp_get_value(shortcut_count_type, tvb, offset, &shortcut_count);
696 proto_tree_add_item(tree, hf_dplay_spp_shortcut_count, tvb, offset, len, ENC_LITTLE_ENDIAN);
697 offset += len;
698 for (i=0; i < shortcut_count; ++i) {
699 proto_tree_add_item(tree, hf_dplay_spp_shortcut_id, tvb, offset, 4, ENC_NA); offset += 4;
703 return offset;
706 static gint dissect_security_desc(proto_tree *tree, tvbuff_t *tvb, gint offset)
708 proto_tree_add_item(tree, hf_dplay_sd_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
709 proto_tree_add_item(tree, hf_dplay_sd_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
710 proto_tree_add_item(tree, hf_dplay_sd_sspi, tvb, offset, 4, ENC_NA); offset += 4;
711 proto_tree_add_item(tree, hf_dplay_sd_capi, tvb, offset, 4, ENC_NA); offset += 4;
712 proto_tree_add_item(tree, hf_dplay_sd_capi_type, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
713 proto_tree_add_item(tree, hf_dplay_sd_enc_alg, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
714 return offset;
717 static gint dissect_dplay_header(proto_tree *tree, tvbuff_t *tvb, gint offset)
719 guint32 mixed, size, token;
721 mixed = tvb_get_letohl(tvb, offset);
722 size = mixed & 0x000FFFFF;
723 token = (mixed & 0xFFF00000) >> 20;
725 proto_tree_add_uint(tree, hf_dplay_size, tvb, offset, 4, size);
726 proto_tree_add_uint(tree, hf_dplay_token, tvb, offset, 4, token);
727 offset += 4;
728 offset = dissect_sockaddr_in(tree, tvb, offset);
729 proto_tree_add_item(tree, hf_dplay_play_str, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4;
730 proto_tree_add_item(tree, hf_dplay_command, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2;
731 proto_tree_add_item(tree, hf_dplay_proto_dialect, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2;
732 return offset;
735 static gint dissect_type01_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
737 guint32 name_offset;
739 offset = dissect_session_desc(tree, tvb, offset);
740 name_offset = tvb_get_letohl(tvb, offset);
741 proto_tree_add_item(tree, hf_dplay_type_01_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
743 if (name_offset != 0) {
744 offset = display_unicode_string(tree, hf_dplay_type_01_game_name, tvb, offset);
746 return offset;
749 static gint dissect_type02_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
751 guint32 passwd_offset;
752 guint32 flags;
753 proto_item *flags_item = NULL;
754 proto_tree *flags_tree = NULL;
756 passwd_offset = tvb_get_letohl(tvb, offset + 16);
757 flags = tvb_get_letohl(tvb, offset + 20);
759 proto_tree_add_item(tree, hf_dplay_type_02_game_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16;
760 proto_tree_add_item(tree, hf_dplay_type_02_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
762 flags_item = proto_tree_add_item(tree, hf_dplay_type_02_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
763 flags_tree = proto_item_add_subtree(flags_item, ett_dplay_type02_flags);
764 proto_tree_add_boolean(flags_tree, hf_enum_sess_flag_passwd, tvb, offset, 4, flags);
765 proto_tree_add_boolean(flags_tree, hf_enum_sess_flag_all, tvb, offset, 4, flags);
766 proto_tree_add_boolean(flags_tree, hf_enum_sess_flag_join, tvb, offset, 4, flags);
767 offset += 4;
769 if (passwd_offset != 0) {
770 offset = display_unicode_string(tree, hf_dplay_type_02_password, tvb, offset);
772 return offset;
775 static gint dissect_type05_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
777 proto_item *flag_item;
778 proto_item *flag_tree;
779 guint32 flags;
781 flags = tvb_get_letohl(tvb, offset);
782 flag_item = proto_tree_add_item(tree, hf_dplay_type_05_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
783 flag_tree = proto_item_add_subtree(flag_item, ett_dplay_type05_flags);
784 proto_tree_add_boolean(flag_tree, hf_dplay_type_05_secure, tvb, offset, 4, flags);
785 proto_tree_add_boolean(flag_tree, hf_dplay_type_05_unknown, tvb, offset, 4, flags);
786 proto_tree_add_boolean(flag_tree, hf_dplay_type_05_local, tvb, offset, 4, flags);
787 proto_tree_add_boolean(flag_tree, hf_dplay_type_05_name_server, tvb, offset, 4, flags);
788 proto_tree_add_boolean(flag_tree, hf_dplay_type_05_system_player, tvb, offset, 4, flags);
789 offset += 4;
790 return offset;
793 static gint dissect_type07_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
795 guint32 sspi_offset, capi_offset;
797 proto_tree_add_item(tree, hf_dplay_type_07_dpid, tvb, offset, 4, ENC_NA); offset += 4;
798 offset = dissect_security_desc(tree, tvb, offset);
800 sspi_offset = tvb_get_letohl(tvb, offset);
801 proto_tree_add_item(tree, hf_dplay_type_07_sspi_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
803 capi_offset = tvb_get_letohl(tvb, offset);
804 proto_tree_add_item(tree, hf_dplay_type_07_capi_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
806 proto_tree_add_item(tree, hf_dplay_type_07_hresult, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
808 if (sspi_offset) {
809 offset = display_unicode_string(tree, hf_dplay_type_07_sspi, tvb, offset);
812 if (capi_offset) {
813 offset = display_unicode_string(tree, hf_dplay_type_07_capi, tvb, offset);
815 return offset;
818 static gint dissect_player_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
820 guint32 pp_ofs;
822 proto_tree_add_item(tree, hf_dplay_multi_id_to, tvb, offset, 4, ENC_NA); offset += 4;
823 proto_tree_add_item(tree, hf_dplay_multi_player_id, tvb, offset, 4, ENC_NA); offset += 4;
824 proto_tree_add_item(tree, hf_dplay_multi_group_id, tvb, offset, 4, ENC_NA); offset += 4;
825 pp_ofs = tvb_get_letohl(tvb, offset);
826 proto_tree_add_item(tree, hf_dplay_multi_create_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
827 proto_tree_add_item(tree, hf_dplay_multi_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
828 if (pp_ofs)
829 offset = dissect_packed_player(tree, tvb, offset);
830 if (tvb_bytes_exist(tvb, offset, 2))
831 offset = display_unicode_string(tree, hf_dplay_multi_password, tvb, offset);
832 return offset;
835 static gint dissect_type0f_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
837 guint32 data_size;
839 proto_tree_add_item(tree, hf_dplay_type_0f_id_to, tvb, offset, 4, ENC_NA); offset += 4;
840 proto_tree_add_item(tree, hf_dplay_type_0f_id, tvb, offset, 4, ENC_NA); offset += 4;
841 data_size = tvb_get_letohl(tvb, offset);
842 proto_tree_add_item(tree, hf_dplay_type_0f_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
843 proto_tree_add_item(tree, hf_dplay_type_0f_data_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
844 proto_tree_add_item(tree, hf_dplay_type_0f_data, tvb, offset, data_size, ENC_NA);
845 offset += data_size;
847 return offset;
850 static gint dissect_type13_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
852 guint32 pp_ofs, pw_ofs;
854 proto_tree_add_item(tree, hf_dplay_type_13_id_to, tvb, offset, 4, ENC_NA); offset += 4;
855 proto_tree_add_item(tree, hf_dplay_type_13_player_id, tvb, offset, 4, ENC_NA); offset += 4;
856 proto_tree_add_item(tree, hf_dplay_type_13_group_id, tvb, offset, 4, ENC_NA); offset += 4;
857 pp_ofs = tvb_get_letohl(tvb, offset);
858 proto_tree_add_item(tree, hf_dplay_type_13_create_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
859 pw_ofs = tvb_get_letohl(tvb, offset);
860 proto_tree_add_item(tree, hf_dplay_type_13_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
861 if (pp_ofs)
862 offset = dissect_packed_player(tree, tvb, offset);
863 if (pw_ofs)
864 offset = display_unicode_string(tree, hf_dplay_type_13_password, tvb, offset);
865 proto_tree_add_item(tree, hf_dplay_type_13_tick_count, tvb, offset, 4, ENC_NA); offset += 4;
867 return offset;
870 static gint dissect_type15_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
872 guint16 second_message_type;
873 proto_item *enc_item = NULL;
874 proto_tree *enc_tree = NULL;
875 second_message_type = tvb_get_letohs(tvb, 72);
877 proto_tree_add_item(tree, hf_dplay_message_guid, tvb, offset, 16, ENC_BIG_ENDIAN); offset += 16;
878 proto_tree_add_item(tree, hf_dplay_type_15_packet_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
879 proto_tree_add_item(tree, hf_dplay_type_15_data_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
880 proto_tree_add_item(tree, hf_dplay_type_15_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
881 proto_tree_add_item(tree, hf_dplay_type_15_total_packets, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
882 proto_tree_add_item(tree, hf_dplay_type_15_msg_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
883 proto_tree_add_item(tree, hf_dplay_type_15_packet_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
885 enc_item = proto_tree_add_text(tree, tvb, offset, -1, "DirectPlay encapsulated packet");
886 enc_tree = proto_item_add_subtree(enc_item, ett_dplay_enc_packet);
888 proto_tree_add_item(enc_tree, hf_dplay_play_str_2, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4;
889 proto_tree_add_item(enc_tree, hf_dplay_command_2, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2;
890 proto_tree_add_item(enc_tree, hf_dplay_proto_dialect_2, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2;
892 switch(second_message_type)
894 case 0x0005:
895 offset = dissect_type05_message(enc_tree, tvb, offset);
896 break;
897 case 0x0007:
898 offset = dissect_type05_message(enc_tree, tvb, offset);
899 break;
900 case 0x0008:
901 case 0x0009:
902 case 0x000b:
903 case 0x000c:
904 case 0x000d:
905 case 0x000e:
906 case 0x002e:
907 offset = dissect_player_message(enc_tree, tvb, offset);
908 break;
909 case 0x0013:
910 offset = dissect_type13_message(enc_tree, tvb, offset);
911 break;
912 case 0x001a:
913 offset = dissect_type1a_message(enc_tree, tvb, offset);
914 break;
917 return offset;
920 static gint dissect_ping_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
922 proto_tree_add_item(tree, hf_dplay_ping_id_from, tvb, offset, 4, ENC_NA); offset += 4;
923 proto_tree_add_item(tree, hf_dplay_ping_tick_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
925 return offset;
928 static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
930 guint32 sn_ofs, pw_ofs;
932 proto_tree_add_item(tree, hf_dplay_type_1a_id_to, tvb, offset, 4, ENC_NA); offset += 4;
933 sn_ofs = tvb_get_letohl(tvb, offset);
934 proto_tree_add_item(tree, hf_dplay_type_1a_sess_name_ofs, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
935 pw_ofs = tvb_get_letohl(tvb, offset);
936 proto_tree_add_item(tree, hf_dplay_type_1a_password_ofs, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
937 offset = dissect_session_desc(tree, tvb, offset);
939 if (sn_ofs) {
940 offset = display_unicode_string(tree, hf_dplay_type_1a_session_name, tvb, offset);
943 if (pw_ofs) {
944 offset = display_unicode_string(tree, hf_dplay_type_1a_password, tvb, offset);
947 return offset;
950 static gint dissect_type29_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
952 guint32 password_offset = tvb_get_letohl(tvb, offset + 24);
953 gint player_count, group_count, shortcut_count;
954 gint i;
956 player_count = tvb_get_letohl(tvb, offset);
957 proto_tree_add_item(tree, hf_dplay_type_29_player_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
958 group_count = tvb_get_letohl(tvb, offset);
959 proto_tree_add_item(tree, hf_dplay_type_29_group_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
960 proto_tree_add_item(tree, hf_dplay_type_29_packed_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
961 shortcut_count = tvb_get_letohl(tvb, offset);
962 proto_tree_add_item(tree, hf_dplay_type_29_shortcut_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
963 proto_tree_add_item(tree, hf_dplay_type_29_description_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
964 proto_tree_add_item(tree, hf_dplay_type_29_name_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
965 proto_tree_add_item(tree, hf_dplay_type_29_password_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
966 offset = dissect_session_desc(tree, tvb, offset);
967 offset = display_unicode_string(tree, hf_dplay_type_29_game_name, tvb, offset);
969 if (password_offset != 0) {
970 offset = display_unicode_string(tree, hf_dplay_type_29_password, tvb, offset);
973 for (i=0; i < player_count; ++i) {
974 proto_item *spp_item;
975 proto_tree *spp_tree;
977 spp_item = proto_tree_add_text(tree, tvb, offset, 0, "Player %d", i);
978 spp_tree = proto_item_add_subtree(spp_item, ett_dplay_type29_spp);
979 offset = dissect_dplay_super_packed_player(spp_tree, tvb, offset);
982 for (i=0; i < group_count; ++i) {
983 proto_item *spp_item;
984 proto_tree *spp_tree;
986 spp_item = proto_tree_add_text(tree, tvb, offset, 0, "Group %d", i);
987 spp_tree = proto_item_add_subtree(spp_item, ett_dplay_type29_spp);
988 offset = dissect_dplay_super_packed_player(spp_tree, tvb, offset);
991 for (i=0; i < shortcut_count; ++i) {
992 proto_item *spp_item;
993 proto_tree *spp_tree;
995 spp_item = proto_tree_add_text(tree, tvb, offset, 0, "Shortcut %d", i);
996 spp_tree = proto_item_add_subtree(spp_item, ett_dplay_type29_spp);
997 offset = dissect_dplay_super_packed_player(spp_tree, tvb, offset);
1000 return offset;
1003 static gint dissect_type2f_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
1005 proto_tree_add_item(tree, hf_dplay_type_2f_dpid, tvb, offset, 4, ENC_NA); offset += 4;
1006 return offset;
1009 static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1011 guint16 message_type;
1012 guint16 second_message_type = G_MAXUINT16;
1013 guint16 proto_version;
1014 guint32 dplay_id;
1015 guint8 play_id[] = {'p','l','a','y'};
1017 dplay_id = tvb_get_letohl(tvb, 20);
1018 message_type = tvb_get_letohs(tvb, 24);
1019 proto_version = tvb_get_letohs(tvb, 26);
1021 if(memcmp(play_id, (guint8 *)&dplay_id, 4) != 0)
1023 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPLAY");
1024 col_set_str(pinfo->cinfo,COL_INFO, "DPlay data packet");
1025 return;
1028 if(message_type == 0x0015)
1030 second_message_type = tvb_get_letohs(tvb, 72);
1033 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPLAY");
1035 if(message_type == 0x0015)
1036 col_add_fstr(pinfo->cinfo,COL_INFO, "%s: %s, holding a %s",
1037 val_to_str(proto_version, dplay_proto_dialect_val, "Unknown (0x%04x)"),
1038 val_to_str(message_type, dplay_command_val, "Unknown (0x%04x)"),
1039 val_to_str(second_message_type, dplay_command_val, "Unknown (0x%04x)"));
1040 else
1041 col_add_fstr(pinfo->cinfo,COL_INFO, "%s: %s",
1042 val_to_str(proto_version, dplay_proto_dialect_val, "Unknown (0x%04x)"),
1043 val_to_str(message_type, dplay_command_val, "Unknown (0x%04x)"));
1045 if(tree)
1047 proto_item *dplay_item = NULL;
1048 proto_item *header_item = NULL;
1049 proto_item *data_item = NULL;
1050 proto_tree *dplay_tree = NULL;
1051 proto_tree *dplay_header = NULL;
1052 proto_tree *dplay_data = NULL;
1053 gint offset = 0;
1055 dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, 0, -1, ENC_NA);
1056 dplay_tree = proto_item_add_subtree(dplay_item, ett_dplay);
1057 header_item = proto_tree_add_text(dplay_tree, tvb, offset, DPLAY_HEADER_OFFSET, "DirectPlay header");
1058 dplay_header = proto_item_add_subtree(header_item, ett_dplay_header);
1060 offset = dissect_dplay_header(dplay_header, tvb, offset);
1062 /* Special handling for empty type 0x0004 packets */
1063 if(message_type == 0x0004)
1064 return;
1066 data_item = proto_tree_add_text(dplay_tree, tvb, offset, -1, "DirectPlay data");
1067 dplay_data = proto_item_add_subtree(data_item, ett_dplay_data);
1069 switch(message_type)
1071 case 0x0001:
1072 dissect_type01_message(dplay_data, tvb, offset);
1073 break;
1074 case 0x0002:
1075 dissect_type02_message(dplay_data, tvb, offset);
1076 break;
1077 case 0x0005:
1078 dissect_type05_message(dplay_data, tvb, offset);
1079 break;
1080 case 0x0007:
1081 dissect_type07_message(dplay_data, tvb, offset);
1082 break;
1083 case 0x0008:
1084 case 0x0009:
1085 /* type 0a doesn't have a dplay header and is not handled here */
1086 case 0x000b:
1087 case 0x000c:
1088 case 0x000d:
1089 case 0x000e:
1090 case 0x002e:
1091 case 0x0038:
1092 dissect_player_message(dplay_data, tvb, offset);
1093 break;
1094 case 0x000f:
1095 dissect_type0f_message(dplay_data, tvb, offset);
1096 break;
1097 case 0x0013:
1098 dissect_type13_message(dplay_data, tvb, offset);
1099 break;
1100 case 0x0015:
1101 dissect_type15_message(dplay_data, tvb, offset);
1102 break;
1103 case 0x0016:
1104 case 0x0017:
1105 dissect_ping_message(dplay_data, tvb, offset);
1106 break;
1107 case 0x001a:
1108 dissect_type1a_message(dplay_data, tvb, offset);
1109 break;
1110 case 0x0029:
1111 dissect_type29_message(dplay_data, tvb, offset);
1112 break;
1113 case 0x002f:
1114 dissect_type2f_message(dplay_data, tvb, offset);
1115 break;
1121 static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1123 guint32 mixed, size, token;
1125 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPLAY");
1126 col_set_str(pinfo->cinfo,COL_INFO, "DPlay player to player message");
1128 if(tree)
1130 proto_item *dplay_item = NULL;
1131 proto_item *data_item = NULL;
1132 proto_tree *dplay_tree = NULL;
1133 proto_tree *data_tree = NULL;
1134 gint offset = 0;
1136 dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, offset, -1, ENC_NA);
1137 dplay_tree = proto_item_add_subtree(dplay_item, ett_dplay);
1138 data_item = proto_tree_add_text(dplay_tree, tvb, offset, -1, "Message content");
1139 data_tree = proto_item_add_subtree(data_item, ett_dplay_data);
1140 mixed = tvb_get_letohl(tvb, offset);
1141 size = mixed & 0x000FFFFF;
1142 token = (mixed & 0xFFF00000) >> 20;
1144 proto_tree_add_uint(data_tree, hf_dplay_size, tvb, offset, 4, size);
1145 proto_tree_add_uint(data_tree, hf_dplay_token, tvb, offset, 4, token);
1146 offset += 4;
1147 offset = dissect_sockaddr_in(data_tree, tvb, offset);
1148 /* Now there's two dplay IDs iff the session desc does not have the
1149 * "short player message" flag set */
1150 proto_tree_add_item(data_tree, hf_dplay_player_msg, tvb, offset, -1, ENC_NA);
1154 static gboolean heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1156 guint32 dplay_id, token;
1158 if(tvb_length(tvb) < 25)
1159 return FALSE;
1161 /* The string play = 0x706c6179 */
1162 dplay_id = tvb_get_letohl(tvb, 20);
1163 if( dplay_id == 0x706c6179) {
1164 dissect_dplay(tvb, pinfo, tree);
1165 return TRUE;
1169 /* There is a player to player message that does not contain "play" */
1170 token = tvb_get_letohl(tvb, 0);
1171 token = (token & 0xfff00000) >> 20;
1172 if (token == 0xfab || token == 0xbab || token == 0xcab) {
1173 /* Check the s_addr_in structure */
1174 if (tvb_get_letohs(tvb, 4) == WINSOCK_AF_INET) {
1175 int offset;
1176 for (offset = 12; offset <= 20; offset++)
1177 if (tvb_get_guint8(tvb, offset) != 0)
1178 return FALSE;
1180 dissect_dplay_player_msg(tvb, pinfo, tree);
1181 return TRUE;
1185 return FALSE;
1188 void proto_register_dplay(void)
1190 static hf_register_info hf [] = {
1191 /* Common data fields */
1192 { &hf_dplay_size,
1193 { "DirectPlay package size", "dplay.size", FT_UINT32, BASE_DEC,
1194 NULL, 0x0, NULL, HFILL}},
1195 { &hf_dplay_token,
1196 { "DirectPlay token", "dplay.token", FT_UINT32, BASE_HEX,
1197 VALS(dplay_token_val), 0x0, NULL, HFILL}},
1198 { &hf_dplay_saddr_af,
1199 { "DirectPlay s_addr_in address family", "dplay.saddr.af", FT_UINT16, BASE_HEX,
1200 VALS(dplay_af_val), 0x0, NULL, HFILL}},
1201 { &hf_dplay_saddr_port,
1202 { "DirectPlay s_addr_in port", "dplay.saddr.port", FT_UINT16, BASE_DEC,
1203 NULL, 0x0, NULL, HFILL}},
1204 { &hf_dplay_saddr_ip,
1205 { "DirectPlay s_addr_in ip address", "dplay.saddr.ip", FT_IPv4, BASE_NONE,
1206 NULL, 0x0, NULL, HFILL}},
1207 { &hf_dplay_saddr_padding,
1208 { "DirectPlay s_addr_in null padding", "dplay.saddr.padding", FT_BYTES, BASE_NONE,
1209 NULL, 0x0, NULL, HFILL}},
1210 { &hf_dplay_play_str,
1211 { "DirectPlay action string", "dplay.dplay_str", FT_STRING, BASE_NONE,
1212 NULL, 0x0, NULL, HFILL}},
1213 { &hf_dplay_command,
1214 { "DirectPlay command", "dplay.command", FT_UINT16, BASE_HEX,
1215 VALS(dplay_command_val), 0x0, NULL, HFILL}},
1216 { &hf_dplay_proto_dialect,
1217 { "DirectPlay dialect version", "dplay.dialect.version", FT_UINT16, BASE_HEX,
1218 VALS(dplay_proto_dialect_val), 0x0, NULL, HFILL}},
1219 { &hf_dplay_play_str_2,
1220 { "DirectPlay second action string", "dplay.dplay_str_2", FT_STRING, BASE_NONE,
1221 NULL, 0x0, NULL, HFILL}},
1222 { &hf_dplay_command_2,
1223 { "DirectPlay second command", "dplay.command_2", FT_UINT16, BASE_HEX,
1224 VALS(dplay_command_val), 0x0, NULL, HFILL}},
1225 { &hf_dplay_proto_dialect_2,
1226 { "DirectPlay second dialect version", "dplay.dialect.version_2", FT_UINT16, BASE_HEX,
1227 VALS(dplay_proto_dialect_val), 0x0, NULL, HFILL}},
1228 { &hf_dplay_player_msg,
1229 { "DirectPlay Player to Player message", "dplay.player_msg", FT_BYTES, BASE_NONE,
1230 NULL, 0x0, NULL, HFILL}},
1232 /* Session Desc structure fields */
1233 { &hf_dplay_sess_desc_flags,
1234 { "DirectPlay session desc flags", "dplay.flags", FT_UINT32, BASE_HEX,
1235 NULL, 0x0, NULL, HFILL}},
1236 { &hf_dplay_flags_no_create_players,
1237 { "no create players flag", "dplay.flags.no_create_players", FT_BOOLEAN, 32,
1238 TFS(&tfs_dplay_flag), DPLAY_FLAG_NO_CREATE_PLAYERS, "No Create Players", HFILL}},
1239 { &hf_dplay_flags_0002,
1240 { "unused", "dplay.flags.unused", FT_BOOLEAN, 32,
1241 TFS(&tfs_dplay_flag), DPLAY_FLAG_0002, NULL, HFILL}},
1242 { &hf_dplay_flags_migrate_host,
1243 { "migrate host flag", "dplay.flags.migrate_host", FT_BOOLEAN, 32,
1244 TFS(&tfs_dplay_flag), DPLAY_FLAG_MIGRATE_HOST, "Migrate Host", HFILL}},
1245 { &hf_dplay_flags_short_player_msg,
1246 { "short player message", "dplay.flags.short_player_msg", FT_BOOLEAN, 32,
1247 TFS(&tfs_dplay_flag), DPLAY_FLAG_SHORT_PLAYER_MSG, "Short Player Msg", HFILL}},
1248 { &hf_dplay_flags_ignored,
1249 { "ignored", "dplay.flags.ignored", FT_BOOLEAN, 32,
1250 TFS(&tfs_dplay_flag), DPLAY_FLAG_IGNORED, NULL, HFILL}},
1251 { &hf_dplay_flags_can_join,
1252 { "can join", "dplay.flags.can_join", FT_BOOLEAN, 32,
1253 TFS(&tfs_dplay_flag), DPLAY_FLAG_CAN_JOIN, NULL, HFILL}},
1254 { &hf_dplay_flags_use_ping,
1255 { "use ping", "dplay.flags.use_ping", FT_BOOLEAN, 32,
1256 TFS(&tfs_dplay_flag), DPLAY_FLAG_USE_PING, NULL, HFILL}},
1257 { &hf_dplay_flags_no_player_updates,
1258 { "no player updates", "dplay.flags.no_player_updates", FT_BOOLEAN, 32,
1259 TFS(&tfs_dplay_flag), DPLAY_FLAG_NO_P_UPD, NULL, HFILL}},
1260 { &hf_dplay_flags_use_auth,
1261 { "use authentication", "dplay.flags.use_auth", FT_BOOLEAN, 32,
1262 TFS(&tfs_dplay_flag), DPLAY_FLAG_USE_AUTH, "Use Auth", HFILL}},
1263 { &hf_dplay_flags_private_session,
1264 { "private session", "dplay.flags.priv_sess", FT_BOOLEAN, 32,
1265 TFS(&tfs_dplay_flag), DPLAY_FLAG_PRIV_SESS, "Priv Session", HFILL}},
1266 { &hf_dplay_flags_password_req,
1267 { "password required", "dplay.flags.pass_req", FT_BOOLEAN, 32,
1268 TFS(&tfs_dplay_flag), DPLAY_FLAG_PASS_REQ, "Pass Req", HFILL}},
1269 { &hf_dplay_flags_route,
1270 { "route via game host", "dplay.flags.route", FT_BOOLEAN, 32,
1271 TFS(&tfs_dplay_flag), DPLAY_FLAG_ROUTE, "Route", HFILL}},
1272 { &hf_dplay_flags_server_player_only,
1273 { "get server player only", "dplay.flags.srv_p_only", FT_BOOLEAN, 32,
1274 TFS(&tfs_dplay_flag), DPLAY_FLAG_SRV_ONLY, "Svr Player Only", HFILL}},
1275 { &hf_dplay_flags_reliable,
1276 { "use reliable protocol", "dplay.flags.reliable", FT_BOOLEAN, 32,
1277 TFS(&tfs_dplay_flag), DPLAY_FLAG_RELIABLE, "Reliable", HFILL}},
1278 { &hf_dplay_flags_preserve_order,
1279 { "preserve order", "dplay.flags.order", FT_BOOLEAN, 32,
1280 TFS(&tfs_dplay_flag), DPLAY_FLAG_ORDER, "Order", HFILL}},
1281 { &hf_dplay_flags_optimize_latency,
1282 { "optimize for latency", "dplay.flags.opt_latency", FT_BOOLEAN, 32,
1283 TFS(&tfs_dplay_flag), DPLAY_FLAG_OPT_LAT, "Opt Latency", HFILL}},
1284 { &hf_dplay_flags_acqire_voice,
1285 { "acquire voice", "dplay.flags.acq_voice", FT_BOOLEAN, 32,
1286 TFS(&tfs_dplay_flag), DPLAY_FLAG_ACQ_VOICE, "Acq Voice", HFILL}},
1287 { &hf_dplay_flags_no_sess_desc_changes,
1288 { "no session desc changes", "dplay.flags.no_sess_desc", FT_BOOLEAN, 32,
1289 TFS(&tfs_dplay_flag), DPLAY_FLAG_NO_SESS_DESC_CHANGES, "No Sess Desc Changes", HFILL}},
1290 { &hf_dplay_instance_guid,
1291 { "DirectPlay instance guid", "dplay.instance.guid", FT_GUID, BASE_NONE,
1292 NULL, 0x0, NULL, HFILL}},
1293 { &hf_dplay_game_guid,
1294 { "DirectPlay game GUID", "dplay.game.guid", FT_GUID, BASE_NONE,
1295 NULL, 0x0, NULL, HFILL}},
1296 { &hf_dplay_sess_desc_length,
1297 { "DirectPlay session desc length", "dplay.sess_desc.length", FT_UINT32, BASE_DEC,
1298 NULL, 0x0, NULL, HFILL}},
1299 { &hf_dplay_max_players,
1300 { "DirectPlay max players", "dplay.sess_desc.max_players", FT_UINT32, BASE_DEC,
1301 NULL, 0x0, NULL, HFILL}},
1302 { &hf_dplay_curr_players,
1303 { "DirectPlay current players", "dplay.sess_desc.curr_players", FT_UINT32, BASE_DEC,
1304 NULL, 0x0, NULL, HFILL}},
1305 { &hf_dplay_sess_name_ptr,
1306 { "Session description name pointer placeholder", "dplay.sess_desc.name_ptr", FT_BYTES, BASE_NONE,
1307 NULL, 0x0, NULL, HFILL}},
1308 { &hf_dplay_passwd_ptr,
1309 { "Session description password pointer placeholder", "dplay.sess_desc.pw_ptr", FT_BYTES, BASE_NONE,
1310 NULL, 0x0, NULL, HFILL}},
1311 { &hf_dplay_sess_desc_reserved_1,
1312 { "Session description reserved 1", "dplay.sess_desc.res_1", FT_BYTES, BASE_NONE,
1313 NULL, 0x0, NULL, HFILL}},
1314 { &hf_dplay_sess_desc_reserved_2,
1315 { "Session description reserved 2", "dplay.sess_desc.res_2", FT_BYTES, BASE_NONE,
1316 NULL, 0x0, NULL, HFILL}},
1317 { &hf_dplay_sess_desc_user_1,
1318 { "Session description user defined 1", "dplay.sess_desc.user_1", FT_BYTES, BASE_NONE,
1319 NULL, 0x0, NULL, HFILL}},
1320 { &hf_dplay_sess_desc_user_2,
1321 { "Session description user defined 2", "dplay.sess_desc.user_2", FT_BYTES, BASE_NONE,
1322 NULL, 0x0, NULL, HFILL}},
1323 { &hf_dplay_sess_desc_user_3,
1324 { "Session description user defined 3", "dplay.sess_desc.user_3", FT_BYTES, BASE_NONE,
1325 NULL, 0x0, NULL, HFILL}},
1326 { &hf_dplay_sess_desc_user_4,
1327 { "Session description user defined 4", "dplay.sess_desc.user_4", FT_BYTES, BASE_NONE,
1328 NULL, 0x0, NULL, HFILL}},
1330 /* PackedPlayer structure fields */
1331 { &hf_dplay_pp_size,
1332 { "PackedPlayer size", "dplay.pp.size", FT_UINT32, BASE_DEC,
1333 NULL, 0x0, NULL, HFILL}},
1334 { &hf_dplay_pp_flags,
1335 { "PackedPlayer flags", "dplay.pp.flags", FT_UINT32, BASE_HEX,
1336 NULL, 0x0, NULL, HFILL}},
1337 { &hf_dplay_pp_flag_sysplayer,
1338 { "is system player", "dplay.pp.flags.sysplayer", FT_BOOLEAN, 32,
1339 TFS(&tfs_dplay_flag), DPLAY_PP_FLAG_SYSPLAYER, NULL, HFILL}},
1340 { &hf_dplay_pp_flag_nameserver,
1341 { "is name server", "dplay.pp.flags.nameserver", FT_BOOLEAN, 32,
1342 TFS(&tfs_dplay_flag), DPLAY_PP_FLAG_NAMESERVER, NULL, HFILL}},
1343 { &hf_dplay_pp_flag_in_group,
1344 { "in group", "dplay.pp.flags.in_group", FT_BOOLEAN, 32,
1345 TFS(&tfs_dplay_flag), DPLAY_PP_FLAG_IN_GROUP, NULL, HFILL}},
1346 { &hf_dplay_pp_flag_sending,
1347 { "sending player on local machine", "dplay.pp.flags.sending", FT_BOOLEAN, 32,
1348 TFS(&tfs_dplay_flag), DPLAY_SPP_FLAG_SENDING, NULL, HFILL}},
1349 { &hf_dplay_pp_id,
1350 { "PackedPlayer ID", "dplay.pp.id", FT_BYTES, BASE_NONE,
1351 NULL, 0x0, NULL, HFILL}},
1352 { &hf_dplay_pp_short_name_len,
1353 { "PackedPlayer short name length", "dplay.pp.short_name_len", FT_UINT32, BASE_HEX,
1354 NULL, 0x0, NULL, HFILL}},
1355 { &hf_dplay_pp_long_name_len,
1356 { "PackedPlayer long name length", "dplay.pp.long_name_len", FT_UINT32, BASE_HEX,
1357 NULL, 0x0, NULL, HFILL}},
1358 { &hf_dplay_pp_sp_data_size,
1359 { "PackedPlayer service provider data size", "dplay.pp.sp_data_size", FT_UINT32, BASE_HEX,
1360 NULL, 0x0, NULL, HFILL}},
1361 { &hf_dplay_pp_player_data_size,
1362 { "PackedPlayer player data size", "dplay.pp.player_data_size", FT_UINT32, BASE_HEX,
1363 NULL, 0x0, NULL, HFILL}},
1364 { &hf_dplay_pp_num_players,
1365 { "PackedPlayer player count", "dplay.pp.player_count", FT_UINT32, BASE_HEX,
1366 NULL, 0x0, NULL, HFILL}},
1367 { &hf_dplay_pp_system_player,
1368 { "PackedPlayer system player ID", "dplay.pp.sysplayer_id", FT_BYTES, BASE_NONE,
1369 NULL, 0x0, NULL, HFILL}},
1370 { &hf_dplay_pp_fixed_size,
1371 { "PackedPlayer fixed size", "dplay.pp.fixed_size", FT_UINT32, BASE_DEC,
1372 NULL, 0x0, NULL, HFILL}},
1373 { &hf_dplay_pp_dialect,
1374 { "PackedPlayer dialect version", "dplay.pp.dialect", FT_UINT32, BASE_HEX,
1375 VALS(dplay_proto_dialect_val), 0x0, NULL, HFILL}},
1376 { &hf_dplay_pp_unknown_1,
1377 { "PackedPlayer unknown 1", "dplay.pp.unknown_1", FT_BYTES, BASE_NONE,
1378 NULL, 0x0, NULL, HFILL}},
1379 { &hf_dplay_pp_short_name,
1380 { "PackedPlayer short name", "dplay.pp.short_name", FT_STRING, BASE_NONE,
1381 NULL, 0x0, NULL, HFILL}},
1382 { &hf_dplay_pp_long_name,
1383 { "PackedPlayer long name", "dplay.pp.long_name", FT_STRING, BASE_NONE,
1384 NULL, 0x0, NULL, HFILL}},
1385 { &hf_dplay_pp_player_data,
1386 { "PackedPlayer player data", "dplay.pp.player_data", FT_BYTES, BASE_NONE,
1387 NULL, 0x0, NULL, HFILL}},
1388 { &hf_dplay_pp_sp_data,
1389 { "PackedPlayer service provider data", "dplay.pp.sp_data", FT_BYTES, BASE_NONE,
1390 NULL, 0x0, NULL, HFILL}},
1391 { &hf_dplay_pp_player_id,
1392 { "PackedPlayer player ID", "dplay.pp.player_id", FT_BYTES, BASE_NONE,
1393 NULL, 0x0, NULL, HFILL}},
1394 { &hf_dplay_pp_parent_id,
1395 { "PackedPlayer parent ID", "dplay.pp.parent_id", FT_BYTES, BASE_NONE,
1396 NULL, 0x0, NULL, HFILL}},
1398 /* SuperPackedPlayer structure fields */
1399 { &hf_dplay_spp_size,
1400 { "SuperPackedPlayer size", "dplay.spp.size", FT_UINT32, BASE_DEC,
1401 NULL, 0x0, NULL, HFILL}},
1402 { &hf_dplay_spp_flags,
1403 { "SuperPackedPlayer flags", "dplay.spp.flags", FT_UINT32, BASE_HEX,
1404 NULL, 0x0, NULL, HFILL}},
1405 { &hf_dplay_spp_flags_sysplayer,
1406 { "is system player", "dplay.spp.flags.sysplayer", FT_BOOLEAN, 32,
1407 TFS(&tfs_dplay_flag), DPLAY_SPP_FLAG_SYSPLAYER, NULL, HFILL}},
1408 { &hf_dplay_spp_flags_nameserver,
1409 { "is name server", "dplay.spp.flags.nameserver", FT_BOOLEAN, 32,
1410 TFS(&tfs_dplay_flag), DPLAY_SPP_FLAG_NAMESERVER, NULL, HFILL}},
1411 { &hf_dplay_spp_flags_in_group,
1412 { "in group", "dplay.spp.flags.in_group", FT_BOOLEAN, 32,
1413 TFS(&tfs_dplay_flag), DPLAY_SPP_FLAG_IN_GROUP, NULL, HFILL}},
1414 { &hf_dplay_spp_flags_sending,
1415 { "sending player on local machine", "dplay.spp.flags.sending", FT_BOOLEAN, 32,
1416 TFS(&tfs_dplay_flag), DPLAY_SPP_FLAG_SENDING, NULL, HFILL}},
1417 { &hf_dplay_spp_id,
1418 { "SuperPackedPlayer ID", "dplay.spp.id", FT_BYTES, BASE_NONE,
1419 NULL, 0x0, NULL, HFILL}},
1420 { &hf_dplay_spp_player_info_mask,
1421 { "SuperPackedPlayer player info mask", "dplay.spp.pim", FT_UINT32, BASE_HEX,
1422 NULL, 0x0, NULL, HFILL}},
1423 { &hf_dplay_spp_have_short_name,
1424 { "SuperPackedPlayer have short name", "dplay.spp.pim.short_name", FT_UINT32, BASE_HEX,
1425 VALS(yes_no_val), 0x0, NULL, HFILL}},
1426 { &hf_dplay_spp_have_long_name,
1427 { "SuperPackedPlayer have long name", "dplay.spp.pim.long_name", FT_UINT32, BASE_HEX,
1428 VALS(yes_no_val), 0x0, NULL, HFILL}},
1429 { &hf_dplay_spp_sp_length_type,
1430 { "SuperPackedPlayer service provider length info", "dplay.spp.pim.sp_length", FT_UINT32, BASE_HEX,
1431 VALS(dplay_spp_length_val), 0x0, NULL, HFILL}},
1432 { &hf_dplay_spp_pd_length_type,
1433 { "SuperPackedPlayer player data length info", "dplay.spp.pim.pd_length", FT_UINT32, BASE_HEX,
1434 VALS(dplay_spp_length_val), 0x0, NULL, HFILL}},
1435 { &hf_dplay_spp_player_count_type,
1436 { "SuperPackedPlayer player count info", "dplay.spp.pim.player_count", FT_UINT32, BASE_HEX,
1437 VALS(dplay_spp_length_val), 0x0, NULL, HFILL}},
1438 { &hf_dplay_spp_have_parent_id,
1439 { "SuperPackedPlayer have parent ID", "dplay.spp.pim.parent_id", FT_UINT32, BASE_HEX,
1440 VALS(yes_no_val), 0x0, NULL, HFILL}},
1441 { &hf_dplay_spp_shortcut_count_type,
1442 { "SuperPackedPlayer shortcut count info", "dplay.spp.pim.shortcut_count", FT_UINT32, BASE_HEX,
1443 VALS(dplay_spp_length_val), 0x0, NULL, HFILL}},
1444 { &hf_dplay_spp_dialect,
1445 { "SuperPackedPlayer dialect version", "dplay.spp.dialect", FT_UINT32, BASE_HEX,
1446 VALS(dplay_proto_dialect_val), 0x0, NULL, HFILL}},
1447 { &hf_dplay_spp_sys_player_id,
1448 { "SuperPackedPlayer system player ID", "dplay.spp.sysplayer_id", FT_BYTES, BASE_NONE,
1449 NULL, 0x0, NULL, HFILL}},
1450 { &hf_dplay_spp_short_name,
1451 { "SuperPackedPlayer short name", "dplay.spp.short_name", FT_STRING, BASE_NONE,
1452 NULL, 0x0, NULL, HFILL}},
1453 { &hf_dplay_spp_long_name,
1454 { "SuperPackedPlayer long name", "dplay.spp.long_name", FT_STRING, BASE_NONE,
1455 NULL, 0x0, NULL, HFILL}},
1456 { &hf_dplay_spp_player_data_length,
1457 { "SuperPackedPlayer player data length", "dplay.spp.pd_length", FT_UINT32, BASE_HEX,
1458 NULL, 0x0, NULL, HFILL}},
1459 { &hf_dplay_spp_player_data,
1460 { "SuperPackedPlayer player data", "dplay.spp.player_data", FT_BYTES, BASE_NONE,
1461 NULL, 0x0, NULL, HFILL}},
1462 { &hf_dplay_spp_sp_data_length,
1463 { "SuperPackedPlayer service provider data length", "dplay.spp.sp_data_length", FT_UINT32, BASE_HEX,
1464 NULL, 0x0, NULL, HFILL}},
1465 { &hf_dplay_spp_sp_data,
1466 { "SuperPackedPlayer service provider data", "dplay.spp.sp_data", FT_BYTES, BASE_NONE,
1467 NULL, 0x0, NULL, HFILL}},
1468 { &hf_dplay_spp_player_count,
1469 { "SuperPackedPlayer player count", "dplay.spp.player_count", FT_UINT32, BASE_HEX,
1470 NULL, 0x0, NULL, HFILL}},
1471 { &hf_dplay_spp_player_id,
1472 { "SuperPackedPlayer player ID", "dplay.spp.player_id", FT_BYTES, BASE_NONE,
1473 NULL, 0x0, NULL, HFILL}},
1474 { &hf_dplay_spp_parent_id,
1475 { "SuperPackedPlayer parent ID", "dplay.spp.parent_id", FT_BYTES, BASE_NONE,
1476 NULL, 0x0, NULL, HFILL}},
1477 { &hf_dplay_spp_shortcut_count,
1478 { "SuperPackedPlayer shortcut count", "dplay.spp.shortcut_count", FT_UINT32, BASE_HEX,
1479 NULL, 0x0, NULL, HFILL}},
1480 { &hf_dplay_spp_shortcut_id,
1481 { "SuperPackedPlayer shortcut ID", "dplay.spp.shortcut_id", FT_BYTES, BASE_NONE,
1482 NULL, 0x0, NULL, HFILL}},
1484 /* Data fields for SecDesc struct */
1485 { &hf_dplay_sd_size,
1486 { "SecDesc struct size", "dplay.sd.size", FT_UINT32, BASE_DEC,
1487 NULL, 0x0, NULL, HFILL}},
1488 { &hf_dplay_sd_flags,
1489 { "SecDesc flags", "dplay.sd.flags", FT_UINT32, BASE_HEX,
1490 NULL, 0x0, NULL, HFILL}},
1491 { &hf_dplay_sd_sspi,
1492 { "SecDesc SSPI provider ptr", "dplay.sd.sspi", FT_BYTES, BASE_NONE,
1493 NULL, 0x0, NULL, HFILL}},
1494 { &hf_dplay_sd_capi,
1495 { "SecDesc CAPI provider ptr", "dplay.sd.capi", FT_BYTES, BASE_NONE,
1496 NULL, 0x0, NULL, HFILL}},
1497 { &hf_dplay_sd_capi_type,
1498 { "SecDesc CAPI provider type", "dplay.sd.capi_type", FT_UINT32, BASE_HEX,
1499 NULL, 0x0, NULL, HFILL}},
1500 { &hf_dplay_sd_enc_alg,
1501 { "SecDesc encryption algorithm" , "dplay.sd.enc_alg", FT_UINT32, BASE_HEX,
1502 VALS(dplay_enc_alg_val), 0x0, NULL, HFILL}},
1504 /* Data fields for message type 0x0001 */
1505 { &hf_dplay_type_01_name_offset,
1506 { "Enum Session Reply name offset", "dplay.type_01.name_offs", FT_UINT32, BASE_DEC,
1507 NULL, 0x0, NULL, HFILL}},
1508 { &hf_dplay_type_01_game_name,
1509 { "Enum Session Reply game name", "dplay.type_01.game_name", FT_STRING, BASE_NONE,
1510 NULL, 0x0, NULL, HFILL}},
1512 /* Data fields for message type 0x0002 */
1513 { &hf_dplay_type_02_game_guid,
1514 { "DirectPlay game GUID", "dplay.type02.game.guid", FT_GUID, BASE_NONE,
1515 NULL, 0x0, NULL, HFILL}},
1516 { &hf_dplay_type_02_password_offset,
1517 { "Enum Sessions password offset", "dplay.type02.password_offset", FT_UINT32, BASE_DEC,
1518 NULL, 0x0, NULL, HFILL}},
1519 { &hf_dplay_type_02_flags,
1520 { "Enum Session flags", "dplay.type02.flags", FT_UINT32, BASE_HEX,
1521 NULL, 0x0, NULL, HFILL}},
1522 { &hf_dplay_type_02_password,
1523 { "Session password", "dplay.type02.password", FT_STRING, BASE_NONE,
1524 NULL, 0x0, NULL, HFILL}},
1525 { &hf_enum_sess_flag_join,
1526 { "Enumerate joinable sessions", "dplay.type02.joinable", FT_BOOLEAN, 32,
1527 TFS(&tfs_dplay_flag), DPLAY_ENUM_SESS_FLAG_JOIN, "Joinable", HFILL}},
1528 { &hf_enum_sess_flag_all,
1529 { "Enumerate all sessions", "dplay.type02.all", FT_BOOLEAN, 32,
1530 TFS(&tfs_dplay_flag), DPLAY_ENUM_SESS_FLAG_ALL, "All", HFILL}},
1531 { &hf_enum_sess_flag_passwd,
1532 { "Enumerate sessions requiring a password", "dplay.type02.pw_req", FT_BOOLEAN, 32,
1533 TFS(&tfs_dplay_flag), DPLAY_ENUM_SESS_FLAG_PASSWD, "Password", HFILL}},
1535 /* Data fields for message type 0x0005 */
1536 { &hf_dplay_type_05_flags,
1537 { "Player ID request flags", "dplay.type_05.flags", FT_UINT32, BASE_HEX,
1538 NULL, 0x0, NULL, HFILL}},
1539 { &hf_dplay_type_05_system_player,
1540 { "is system player", "dplay.type_05.flags.sys_player", FT_BOOLEAN, 32,
1541 TFS(&tfs_dplay_flag), DPLAY_TYPE05_FLAG_SYSPLAYER, NULL, HFILL}},
1542 { &hf_dplay_type_05_name_server,
1543 { "is name server", "dplay.type_05.flags.name_server", FT_BOOLEAN, 32,
1544 TFS(&tfs_dplay_flag), DPLAY_TYPE05_FLAG_NAMESERVER, NULL, HFILL}},
1545 { &hf_dplay_type_05_local,
1546 { "is local player", "dplay.type_05.flags.local", FT_BOOLEAN, 32,
1547 TFS(&tfs_dplay_flag), DPLAY_TYPE05_FLAG_LOCAL, NULL, HFILL}},
1548 { &hf_dplay_type_05_unknown,
1549 { "unknown", "dplay.type_05.flags.unknown", FT_BOOLEAN, 32,
1550 TFS(&tfs_dplay_flag), DPLAY_TYPE05_FLAG_UNKNOWN, NULL, HFILL}},
1551 { &hf_dplay_type_05_secure,
1552 { "is secure session", "dplay.type_05.flags.secure", FT_BOOLEAN, 32,
1553 TFS(&tfs_dplay_flag), DPLAY_TYPE05_FLAG_SECURE, NULL, HFILL}},
1555 /* Data fields for message type 0x0007 */
1556 { &hf_dplay_type_07_dpid,
1557 { "DirectPlay ID", "dplay.type_07.dpid", FT_BYTES, BASE_NONE,
1558 NULL, 0x0, NULL, HFILL}},
1559 { &hf_dplay_type_07_sspi_offset,
1560 { "SSPI provider offset", "dplay.type_07.sspi_offset", FT_UINT32, BASE_DEC,
1561 NULL, 0x0, NULL, HFILL}},
1562 { &hf_dplay_type_07_capi_offset,
1563 { "CAPI provider offset", "dplay.type_07.capi_offset", FT_UINT32, BASE_DEC,
1564 NULL, 0x0, NULL, HFILL}},
1565 { &hf_dplay_type_07_hresult,
1566 { "Request player HRESULT", "dplay.type_07.hresult", FT_UINT32, BASE_DEC,
1567 NULL, 0x0, NULL, HFILL}},
1568 { &hf_dplay_type_07_sspi,
1569 { "SSPI provider", "dplay.type_07.sspi", FT_STRING, BASE_NONE,
1570 NULL, 0x0, NULL, HFILL}},
1571 { &hf_dplay_type_07_capi,
1572 { "CAPI provider", "dplay.type_07.capi", FT_STRING, BASE_NONE,
1573 NULL, 0x0, NULL, HFILL}},
1575 /* Data fields for message type 0x0008, 0x0009, 0x000b, 0x000c, 0x000d,
1576 * 0x000e, 0x002e and 0x0038*/
1577 { &hf_dplay_multi_id_to,
1578 { "ID to", "dplay.multi.id_to", FT_BYTES, BASE_NONE,
1579 NULL, 0x0, NULL, HFILL}},
1580 { &hf_dplay_multi_player_id,
1581 { "Player ID", "dplay.multi.player_id", FT_BYTES, BASE_NONE,
1582 NULL, 0x0, NULL, HFILL}},
1583 { &hf_dplay_multi_group_id,
1584 { "Group ID", "dplay.multi.group_id", FT_BYTES, BASE_NONE,
1585 NULL, 0x0, NULL, HFILL}},
1586 { &hf_dplay_multi_create_offset,
1587 { "Offset to PackedPlayer struct", "dplay.multi.create_offset", FT_UINT32, BASE_DEC,
1588 NULL, 0x0, NULL, HFILL}},
1589 { &hf_dplay_multi_password_offset,
1590 { "Offset to password", "dplay.multi.password_offset", FT_UINT32, BASE_DEC,
1591 NULL, 0x0, NULL, HFILL}},
1592 { &hf_dplay_multi_password,
1593 { "Password", "dplay.multi.password", FT_STRING, BASE_NONE,
1594 NULL, 0x0, NULL, HFILL}},
1596 /* Data fields for message type 0x000f */
1597 { &hf_dplay_type_0f_id_to,
1598 { "ID to", "dplay.type_0f.id_to", FT_BYTES, BASE_NONE,
1599 NULL, 0x0, NULL, HFILL}},
1600 { &hf_dplay_type_0f_id,
1601 { "Player ID", "dplay.type_0f.player_id", FT_BYTES, BASE_NONE,
1602 NULL, 0x0, NULL, HFILL}},
1603 { &hf_dplay_type_0f_data_size,
1604 { "Data Size", "dplay.type_0f.data_size", FT_UINT32, BASE_DEC,
1605 NULL, 0x0, NULL, HFILL}},
1606 { &hf_dplay_type_0f_data_offset,
1607 { "Data Offset", "dplay.type_0f.data_offset", FT_UINT32, BASE_DEC,
1608 NULL, 0x0, NULL, HFILL}},
1609 { &hf_dplay_type_0f_data,
1610 { "Player Data", "dplay.type_0f.player_data", FT_BYTES, BASE_NONE,
1611 NULL, 0x0, NULL, HFILL}},
1613 /* Data fields for message type 0x0013 */
1614 { &hf_dplay_type_13_id_to,
1615 { "ID to", "dplay.type_13.id_to", FT_BYTES, BASE_NONE,
1616 NULL, 0x0, NULL, HFILL}},
1617 { &hf_dplay_type_13_player_id,
1618 { "Player ID", "dplay.type_13.player_id", FT_BYTES, BASE_NONE,
1619 NULL, 0x0, NULL, HFILL}},
1620 { &hf_dplay_type_13_group_id,
1621 { "Group ID", "dplay.type_13.group_id", FT_BYTES, BASE_NONE,
1622 NULL, 0x0, NULL, HFILL}},
1623 { &hf_dplay_type_13_create_offset,
1624 { "Create Offset", "dplay.type_13.create_offset", FT_UINT32, BASE_DEC,
1625 NULL, 0x0, NULL, HFILL}},
1626 { &hf_dplay_type_13_password_offset,
1627 { "Password Offset", "dplay.type_13.password_offset", FT_UINT32, BASE_DEC,
1628 NULL, 0x0, NULL, HFILL}},
1629 { &hf_dplay_type_13_password,
1630 { "Password", "dplay.type_13.password", FT_STRING, BASE_NONE,
1631 NULL, 0x0, NULL, HFILL}},
1632 { &hf_dplay_type_13_tick_count,
1633 { "Tick count? Looks like an ID", "dplay.type_13.tick_count", FT_BYTES, BASE_NONE,
1634 NULL, 0x0, NULL, HFILL}},
1636 /* Data fields for message type 0x0015 */
1637 { &hf_dplay_message_guid,
1638 { "Message GUID", "dplay.message.guid", FT_GUID, BASE_NONE,
1639 NULL, 0x0, NULL, HFILL}},
1640 { &hf_dplay_type_15_packet_idx,
1641 { "Packet Index", "dplay.type_15.packet_idx", FT_UINT32, BASE_DEC,
1642 NULL, 0x0, NULL, HFILL}},
1643 { &hf_dplay_type_15_data_size,
1644 { "Data Size", "dplay.type_15.data_size", FT_UINT32, BASE_DEC,
1645 NULL, 0x0, NULL, HFILL}},
1646 { &hf_dplay_type_15_offset,
1647 { "Offset", "dplay.type_15.offset", FT_UINT32, BASE_DEC,
1648 NULL, 0x0, NULL, HFILL}},
1649 { &hf_dplay_type_15_total_packets,
1650 { "Total Packets", "dplay.type_15.total_packets", FT_UINT32, BASE_DEC,
1651 NULL, 0x0, NULL, HFILL}},
1652 { &hf_dplay_type_15_msg_size,
1653 { "Message size", "dplay.type_15.message.size", FT_UINT32, BASE_DEC,
1654 NULL, 0x0, NULL, HFILL}},
1655 { &hf_dplay_type_15_packet_offset,
1656 { "Packet offset", "dplay.type_15.packet_offset", FT_UINT32, BASE_DEC,
1657 NULL, 0x0, NULL, HFILL}},
1659 /* Data field for message type 0x0016 and 0x0017 */
1660 { &hf_dplay_ping_id_from,
1661 { "ID From", "dplay.ping.id_from", FT_BYTES, BASE_NONE,
1662 NULL, 0x0, NULL, HFILL}},
1663 { &hf_dplay_ping_tick_count,
1664 { "Tick Count", "dplay.ping.tick_count", FT_UINT32, BASE_DEC,
1665 NULL, 0x0, NULL, HFILL}},
1667 /* Data fields for message type 0x001a */
1668 { &hf_dplay_type_1a_id_to,
1669 { "ID From", "dplay.type_1a.id_to", FT_BYTES, BASE_NONE,
1670 NULL, 0x0, NULL, HFILL}},
1671 { &hf_dplay_type_1a_sess_name_ofs,
1672 { "Session Name Offset", "dplay.type_1a.sess_name_ofs", FT_UINT32, BASE_DEC,
1673 NULL, 0x0, NULL, HFILL}},
1674 { &hf_dplay_type_1a_password_ofs,
1675 { "Password Offset", "dplay.type_1a.password_offset", FT_UINT32, BASE_DEC,
1676 NULL, 0x0, NULL, HFILL}},
1677 { &hf_dplay_type_1a_session_name,
1678 { "Session Name", "dplay.type_1a.session_name", FT_STRING, BASE_NONE,
1679 NULL, 0x0, NULL, HFILL}},
1680 { &hf_dplay_type_1a_password,
1681 { "Password", "dplay.type_1a.password", FT_STRING, BASE_NONE,
1682 NULL, 0x0, NULL, HFILL}},
1684 /* Data fields for message type 0x0029 */
1685 { &hf_dplay_type_29_player_count,
1686 { "SuperEnumPlayers Reply player count", "dplay.type_29.player_count", FT_UINT32,
1687 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1688 { &hf_dplay_type_29_group_count,
1689 { "SuperEnumPlayers Reply group count", "dplay.type_29.group_count", FT_UINT32,
1690 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1691 { &hf_dplay_type_29_packed_offset,
1692 { "SuperEnumPlayers Reply packed offset", "dplay.type_29.packed_offset", FT_UINT32,
1693 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1694 { &hf_dplay_type_29_shortcut_count,
1695 { "SuperEnumPlayers Reply shortcut count", "dplay.type_29.shortcut_count", FT_UINT32,
1696 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1697 { &hf_dplay_type_29_description_offset,
1698 { "SuperEnumPlayers Reply description offset", "dplay.type_29.desc_offset", FT_UINT32,
1699 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1700 { &hf_dplay_type_29_name_offset,
1701 { "SuperEnumPlayers Reply name offset", "dplay.type_29.name_offset", FT_UINT32,
1702 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1703 { &hf_dplay_type_29_password_offset,
1704 { "SuperEnumPlayers Reply password offset", "dplay.type_29.pass_offset", FT_UINT32,
1705 BASE_DEC, NULL, 0x0, NULL, HFILL}},
1706 { &hf_dplay_type_29_game_name,
1707 { "SuperEnumPlayers Reply game name", "dplay.type_29.game_name", FT_STRING, BASE_NONE,
1708 NULL, 0x0, NULL, HFILL}},
1709 { &hf_dplay_type_29_password,
1710 { "SuperEnumPlayers Reply Password", "dplay.type_29.password", FT_STRING, BASE_NONE,
1711 NULL, 0x0, NULL, HFILL}},
1713 /* Data fields for message type 0x002f */
1714 { &hf_dplay_type_2f_dpid,
1715 { "ID of the forwarded player", "dplay.type_29.id", FT_BYTES, BASE_NONE,
1716 NULL, 0x0, NULL, HFILL}},
1719 static gint *ett[] = {
1720 &ett_dplay,
1721 &ett_dplay_header,
1722 &ett_dplay_sockaddr,
1723 &ett_dplay_data,
1724 &ett_dplay_flags,
1725 &ett_dplay_enc_packet,
1726 &ett_dplay_sess_desc_flags,
1727 &ett_dplay_pp_flags,
1728 &ett_dplay_spp_flags,
1729 &ett_dplay_spp_info_mask,
1730 &ett_dplay_type02_flags,
1731 &ett_dplay_type05_flags,
1732 &ett_dplay_type29_spp,
1735 proto_dplay = proto_register_protocol (
1736 "DirectPlay Protocol",
1737 "DPLAY",
1738 "dplay"
1740 proto_register_field_array(proto_dplay, hf, array_length(hf));
1741 proto_register_subtree_array(ett, array_length(ett));
1744 void proto_reg_handoff_dplay(void)
1746 heur_dissector_add("udp", heur_dissect_dplay, proto_dplay);
1747 heur_dissector_add("tcp", heur_dissect_dplay, proto_dplay);