2 * This is a dissector for the DirectPlay 8 protocol.
4 * Copyright 2017 - Alistair Leslie-Hughes
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
19 void proto_register_dpnet(void);
20 void proto_reg_handoff_dpnet(void);
22 static dissector_handle_t dpnet_handle
;
24 #define DPNET_PORT 6073
26 static int proto_dpnet
;
28 static int hf_dpnet_lead
;
29 static int hf_dpnet_command
;
30 static int hf_dpnet_payload
;
31 static int hf_dpnet_type
;
32 static int hf_dpnet_application
;
33 static int hf_dpnet_data
;
34 static int hf_dpnet_reply_offset
;
35 static int hf_dpnet_response_size
;
37 static int hf_dpnet_desc_size
;
38 static int hf_dpnet_desc_flags
;
39 static int hf_dpnet_max_players
;
40 static int hf_dpnet_current_players
;
41 static int hf_dpnet_session_offset
;
42 static int hf_dpnet_session_size
;
43 static int hf_dpnet_session_name
;
44 static int hf_dpnet_password_offset
;
45 static int hf_dpnet_password_size
;
46 static int hf_dpnet_reserved_offset
;
47 static int hf_dpnet_reserved_size
;
48 static int hf_dpnet_application_offset
;
49 static int hf_dpnet_application_size
;
50 static int hf_dpnet_application_data
;
51 static int hf_dpnet_instance
;
52 static int hf_dpnet_data_cframe_control
;
53 static int hf_dpnet_data_cframe_msgid
;
54 static int hf_dpnet_data_cframe_rspid
;
55 static int hf_dpnet_data_cframe_protocol
;
56 static int hf_dpnet_data_cframe_session
;
57 static int hf_dpnet_data_cframe_timestamp
;
58 static int hf_dpnet_data_cframe_padding
;
59 static int hf_dpnet_data_cframe_flags
;
60 static int hf_dpnet_data_cframe_retry
;
61 static int hf_dpnet_data_cframe_nseq
;
62 static int hf_dpnet_data_cframe_nrcv
;
63 static int hf_dpnet_data_cframe_sack_mask1
;
64 static int hf_dpnet_data_cframe_sack_mask2
;
65 static int hf_dpnet_data_cframe_send_mask1
;
66 static int hf_dpnet_data_cframe_send_mask2
;
67 static int hf_dpnet_data_cframe_signature
;
68 static int hf_dpnet_data_cframe_send_secret
;
69 static int hf_dpnet_data_cframe_recv_secret
;
70 static int hf_dpnet_data_cframe_signing_opts
;
71 static int hf_dpnet_data_cframe_echo_time
;
72 static int hf_dpnet_data_seq
;
73 static int hf_dpnet_data_nseq
;
74 static int hf_dpnet_data_command
;
75 static int hf_dpnet_command_data
;
76 static int hf_dpnet_command_reliable
;
77 static int hf_dpnet_command_seq
;
78 static int hf_dpnet_command_poll
;
79 static int hf_dpnet_command_new_msg
;
80 static int hf_dpnet_command_end_msg
;
81 static int hf_dpnet_command_user1
;
82 static int hf_dpnet_command_user2
;
83 static int hf_dpnet_desc_client_server
;
84 static int hf_dpnet_desc_migrate_host
;
85 static int hf_dpnet_desc_nodpnsvr
;
86 static int hf_dpnet_desc_req_password
;
87 static int hf_dpnet_desc_no_enums
;
88 static int hf_dpnet_desc_fast_signed
;
89 static int hf_dpnet_desc_full_signed
;
92 static int ett_dpnet_command_flags
;
93 static int ett_dpnet_desc_flags
;
95 #define DPNET_QUERY_GUID 0x01
97 #define DPNET_ENUM_QUERY 0x02
98 #define DPNET_ENUM_RESPONSE 0x03
100 #define DPNET_COMMAND_DATA 0x01
101 #define DPNET_COMMAND_RELIABLE 0x02
102 #define DPNET_COMMAND_SEQUENTIAL 0x04
103 #define DPNET_COMMAND_POLL 0x08
104 #define DPNET_COMMAND_NEW_MSG 0x10
105 #define DPNET_COMMAND_END_MSG 0x20
106 #define DPNET_COMMAND_USER_1 0x40
107 #define DPNET_COMMAND_CFRAME 0x80
109 #define DN_MSG_INTERNAL_PLAYER_CONNECT_INFO 0x000000c1
110 #define DN_MSG_INTERNAL_SEND_CONNECT_INFO 0x000000c2
111 #define DN_MSG_INTERNAL_ACK_CONNECT_INFO 0x000000c3
113 #define FRAME_EXOPCODE_CONNECT 0x01
114 #define FRAME_EXOPCODE_CONNECTED 0x02
115 #define FRAME_EXOPCODE_CONNECTED_SIGNED 0x03
116 #define FRAME_EXOPCODE_HARD_DISCONNECT 0x04
117 #define FRAME_EXOPCODE_SACK 0x06
119 #define PROTOCOL_VER_0 0x00010000
120 #define PROTOCOL_VER_1 0x00010001
121 #define PROTOCOL_VER_2 0x00010002
122 #define PROTOCOL_VER_3 0x00010003
123 #define PROTOCOL_VER_4 0x00010004
124 #define PROTOCOL_VER_5 0x00010005
125 #define PROTOCOL_VER_6 0x00010006
127 #define SACK_FLAGS_RESPONSE 0x01
128 #define SACK_FLAGS_SACK_MASK1 0x02
129 #define SACK_FLAGS_SACK_MASK2 0x04
130 #define SACK_FLAGS_SEND_MASK1 0x08
131 #define SACK_FLAGS_SEND_MASK2 0x10
133 #define PACKET_SIGNING_FAST 0x01
134 #define PACKET_SIGNING_FULL 0x02
136 #define SESSION_CLIENT_SERVER 0x0001
137 #define SESSION_MIGRATE_HOST 0x0004
138 #define SESSION_NODPNSVR 0x0040
139 #define SESSION_REQUIREPASSWORD 0x0080
140 #define SESSION_NOENUMS 0x0100
141 #define SESSION_FAST_SIGNED 0x0200
142 #define SESSION_FULL_SIGNED 0x0400
144 static const value_string packetenumttypes
[] = {
145 { 1, "Application GUID" },
146 { 2, "All Applications" },
150 static const value_string packetquerytype
[] = {
151 { 2, "Enumeration Query" },
152 { 3, "Enumeration Response" },
156 static const value_string msg_cframe_control
[] = {
157 {FRAME_EXOPCODE_CONNECT
, "FRAME_EXOPCODE_CONNECT"},
158 {FRAME_EXOPCODE_CONNECTED
, "FRAME_EXOPCODE_CONNECTED"},
159 {FRAME_EXOPCODE_CONNECTED_SIGNED
, "FRAME_EXOPCODE_CONNECTED_SIGNED"},
160 {FRAME_EXOPCODE_HARD_DISCONNECT
, "FRAME_EXOPCODE_HARD_DISCONNECT"},
161 {FRAME_EXOPCODE_SACK
, "FRAME_EXOPCODE_SACK"},
165 static const value_string protocol_versions
[] = {
166 {PROTOCOL_VER_0
, "Supports Base Features"},
167 {PROTOCOL_VER_1
, "Supports Base Features"},
168 {PROTOCOL_VER_2
, "Supports Base Features"},
169 {PROTOCOL_VER_3
, "Supports Base Features"},
170 {PROTOCOL_VER_4
, "Supports Base Features"},
171 {PROTOCOL_VER_5
, "Supports Coalescence"},
172 {PROTOCOL_VER_6
, "Supports Coalescence and Signing"},
176 static const value_string sack_flags
[] = {
177 {SACK_FLAGS_RESPONSE
, "Retry field is valid"},
178 {SACK_FLAGS_SACK_MASK1
, "Low 32 bits of the SACK mask are present in sack.mask1"},
179 {SACK_FLAGS_SACK_MASK2
, "High 32 bits of the SACK mask are present in sack.mask2"},
180 {SACK_FLAGS_SEND_MASK1
, "Low 32 bits of the Send mask are present in send.mask1"},
181 {SACK_FLAGS_SEND_MASK2
, "High 32 bits of the Send mask are present in send.mask2"},
185 static const value_string signing_opts
[] = {
186 {PACKET_SIGNING_FAST
, "Fasting signing"},
187 {PACKET_SIGNING_FULL
, "Full signing"},
191 static const true_false_string tfs_flags_game_client
= {
192 "Client/Server session",
196 static const true_false_string tfs_flags_migrate
= {
197 "Host Migrating allowed",
198 "Host Migrating NOT allowed"
201 static const true_false_string tfs_flags_dpnsvr
= {
202 "NOT using dpnsvr.exe",
206 static const true_false_string tfs_flags_password_required
= {
208 "NO password required"
211 static const true_false_string tfs_flags_enumeration
= {
212 "Enumeration NOT allowed",
213 "Enumeration allowed"
216 static const true_false_string tfs_flags_fast
= {
217 "Using Fast signing",
218 "NOT using Fast signing"
221 static const true_false_string tfs_flags_full
= {
222 "Using Full signing",
223 "NOT using Full signing"
227 static int * const desc_flags
[] = {
228 &hf_dpnet_desc_client_server
,
229 &hf_dpnet_desc_migrate_host
,
230 &hf_dpnet_desc_nodpnsvr
,
231 &hf_dpnet_desc_req_password
,
232 &hf_dpnet_desc_no_enums
,
233 &hf_dpnet_desc_fast_signed
,
234 &hf_dpnet_desc_full_signed
,
238 static int * const command_flags
[] = {
239 &hf_dpnet_command_data
,
240 &hf_dpnet_command_reliable
,
241 &hf_dpnet_command_seq
,
242 &hf_dpnet_command_poll
,
243 &hf_dpnet_command_new_msg
,
244 &hf_dpnet_command_end_msg
,
245 &hf_dpnet_command_user1
,
246 &hf_dpnet_command_user2
,
250 static void process_dpnet_query(proto_tree
*dpnet_tree
, tvbuff_t
*tvb
, packet_info
*pinfo
)
252 int offset
= 0, data_tvb_len
;
256 proto_tree_add_item(dpnet_tree
, hf_dpnet_lead
, tvb
, 0, 1, ENC_BIG_ENDIAN
); offset
+= 1;
257 is_query
= tvb_get_uint8(tvb
, offset
);
258 proto_tree_add_item(dpnet_tree
, hf_dpnet_command
, tvb
, offset
, 1, ENC_BIG_ENDIAN
); offset
+= 1;
259 proto_tree_add_item(dpnet_tree
, hf_dpnet_payload
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
); offset
+= 2;
261 if(is_query
== DPNET_ENUM_QUERY
)
263 col_set_str(pinfo
->cinfo
, COL_INFO
, "DPNET Enum Query");
265 has_guid
= tvb_get_uint8(tvb
, offset
);
266 proto_tree_add_item(dpnet_tree
, hf_dpnet_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
); offset
+= 1;
268 if (has_guid
& DPNET_QUERY_GUID
) {
269 proto_tree_add_item(dpnet_tree
, hf_dpnet_application
, tvb
, offset
, 16, ENC_BIG_ENDIAN
);
273 data_tvb_len
= tvb_reported_length_remaining(tvb
, offset
);
275 proto_tree_add_item(dpnet_tree
, hf_dpnet_data
, tvb
, offset
, data_tvb_len
, ENC_NA
);
278 else if(is_query
== DPNET_ENUM_RESPONSE
)
280 uint32_t session_offset
, session_size
;
281 uint32_t application_offset
, application_size
;
283 col_set_str(pinfo
->cinfo
, COL_INFO
, "DPNET Enum Response");
285 proto_tree_add_item(dpnet_tree
, hf_dpnet_reply_offset
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
286 proto_tree_add_item(dpnet_tree
, hf_dpnet_response_size
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
287 proto_tree_add_item(dpnet_tree
, hf_dpnet_desc_size
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
288 proto_tree_add_bitmask(dpnet_tree
, tvb
, offset
, hf_dpnet_desc_flags
, ett_dpnet_desc_flags
, desc_flags
, ENC_LITTLE_ENDIAN
);
290 proto_tree_add_item(dpnet_tree
, hf_dpnet_max_players
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
291 proto_tree_add_item(dpnet_tree
, hf_dpnet_current_players
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
292 proto_tree_add_item_ret_uint(dpnet_tree
, hf_dpnet_session_offset
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
, &session_offset
); offset
+= 4;
293 proto_tree_add_item_ret_uint(dpnet_tree
, hf_dpnet_session_size
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
, &session_size
); offset
+= 4;
294 proto_tree_add_item(dpnet_tree
, hf_dpnet_password_offset
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
295 proto_tree_add_item(dpnet_tree
, hf_dpnet_password_size
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
296 proto_tree_add_item(dpnet_tree
, hf_dpnet_reserved_offset
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
297 proto_tree_add_item(dpnet_tree
, hf_dpnet_reserved_size
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
); offset
+= 4;
298 proto_tree_add_item_ret_uint(dpnet_tree
, hf_dpnet_application_offset
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
, &application_offset
); offset
+= 4;
299 proto_tree_add_item_ret_uint(dpnet_tree
, hf_dpnet_application_size
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
, &application_size
); offset
+= 4;
300 proto_tree_add_item(dpnet_tree
, hf_dpnet_instance
, tvb
, offset
, 16, ENC_LITTLE_ENDIAN
); offset
+= 16;
301 proto_tree_add_item(dpnet_tree
, hf_dpnet_application
, tvb
, offset
, 16, ENC_LITTLE_ENDIAN
);
305 /* session_offset starts from the hf_dpnet_payload */
306 proto_tree_add_item(dpnet_tree
, hf_dpnet_session_name
, tvb
, session_offset
+ 4, session_size
, ENC_UTF_16
|ENC_LITTLE_ENDIAN
);
309 if(application_offset
)
311 /* application_offset starts from the hf_dpnet_payload */
312 proto_tree_add_item(dpnet_tree
, hf_dpnet_application_data
, tvb
, application_offset
+ 4, application_size
, ENC_NA
);
318 dpnet_process_data_frame(proto_tree
*dpnet_tree
, tvbuff_t
*tvb
, packet_info
*pinfo
)
322 col_set_str(pinfo
->cinfo
, COL_INFO
, "DPNET DFrame");
324 proto_tree_add_bitmask(dpnet_tree
, tvb
, offset
, hf_dpnet_data_command
, ett_dpnet_command_flags
, command_flags
, ENC_BIG_ENDIAN
);
330 dpnet_process_control_frame(proto_tree
*dpnet_tree
, tvbuff_t
*tvb
, packet_info
*pinfo
)
334 const char *command_str
;
336 uint32_t data_tvb_len
;
338 col_set_str(pinfo
->cinfo
, COL_INFO
, "DPNET CFrame");
340 proto_tree_add_bitmask(dpnet_tree
, tvb
, offset
, hf_dpnet_data_command
, ett_dpnet_command_flags
, command_flags
, ENC_BIG_ENDIAN
);
343 command
= tvb_get_uint8(tvb
, offset
);
344 command_str
= val_to_str_const(command
, msg_cframe_control
, "Unknown Control (obsolete or malformed?)");
345 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " - %s", command_str
);
347 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_control
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
352 case FRAME_EXOPCODE_CONNECT
:
353 case FRAME_EXOPCODE_CONNECTED
:
354 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_msgid
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
356 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_rspid
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
358 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_protocol
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
360 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_session
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
362 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_timestamp
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
364 case FRAME_EXOPCODE_CONNECTED_SIGNED
:
365 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_msgid
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
367 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_rspid
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
369 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_protocol
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
371 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_session
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
373 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_timestamp
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
375 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_signature
, tvb
, offset
, 8, ENC_NA
);
377 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_send_secret
, tvb
, offset
, 8, ENC_NA
);
379 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_recv_secret
, tvb
, offset
, 8, ENC_NA
);
381 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_signing_opts
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
383 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_echo_time
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
385 case FRAME_EXOPCODE_HARD_DISCONNECT
:
386 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_msgid
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
388 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_rspid
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
390 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_protocol
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
392 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_session
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
394 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_timestamp
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
397 data_tvb_len
= tvb_reported_length_remaining(tvb
, offset
);
399 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_signature
, tvb
, offset
, 8, ENC_NA
);
401 case FRAME_EXOPCODE_SACK
:
402 flag
= tvb_get_uint8(tvb
, offset
);
403 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_flags
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
405 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_retry
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
407 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_nseq
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
409 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_nrcv
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
411 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_padding
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
413 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_timestamp
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
416 if(flag
& SACK_FLAGS_SACK_MASK1
)
418 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_sack_mask1
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
421 if(flag
& SACK_FLAGS_SACK_MASK2
)
423 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_sack_mask2
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
426 if(flag
& SACK_FLAGS_SEND_MASK1
)
428 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_send_mask1
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
431 if(flag
& SACK_FLAGS_SEND_MASK2
)
433 proto_tree_add_item(dpnet_tree
, hf_dpnet_data_cframe_send_mask2
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
442 dissect_dpnet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
446 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "DPNET");
447 /* Clear out stuff in the info column */
448 col_clear(pinfo
->cinfo
,COL_INFO
);
450 proto_item
*ti
= proto_tree_add_item(tree
, proto_dpnet
, tvb
, 0, -1, ENC_NA
);
451 proto_tree
*dpnet_tree
= proto_item_add_subtree(ti
, ett_dpnet
);
453 lead
= tvb_get_uint8(tvb
, 0);
456 process_dpnet_query(dpnet_tree
, tvb
, pinfo
);
460 if(lead
& DPNET_COMMAND_DATA
)
461 dpnet_process_data_frame(dpnet_tree
, tvb
, pinfo
);
463 dpnet_process_control_frame(dpnet_tree
, tvb
, pinfo
);
466 return tvb_captured_length(tvb
);
470 proto_register_dpnet(void)
472 static hf_register_info hf
[] = {
474 { "Lead", "dpnet.lead",
480 { "Command", "dpnet.command",
482 VALS(packetquerytype
), 0,
486 { "Payload", "dpnet.payload",
492 { "Type", "dpnet.type",
494 VALS(packetenumttypes
), 0,
497 { &hf_dpnet_application
,
498 { "Application GUID", "dpnet.application",
504 { "Data", "dpnet.data",
509 { &hf_dpnet_reply_offset
,
510 { "Reply Offset", "dpnet.reply_offset",
515 { &hf_dpnet_response_size
,
516 { "Response Size", "dpnet.response_size",
521 { &hf_dpnet_desc_size
,
522 { "Description Size", "dpnet.desc_size",
527 { &hf_dpnet_desc_flags
,
528 { "Description Flags", "dpnet.desc_flags",
533 { &hf_dpnet_max_players
,
534 { "Max Players", "dpnet.max_players",
539 { &hf_dpnet_current_players
,
540 { "Current Players", "dpnet.current_players",
545 { &hf_dpnet_session_offset
,
546 { "Session Offset", "dpnet.session_offset",
551 { &hf_dpnet_session_size
,
552 { "Session Size", "dpnet.session_size",
557 { &hf_dpnet_session_name
,
558 { "Session name", "dpnet.session_name",
559 FT_STRING
, BASE_NONE
,
563 { &hf_dpnet_password_offset
,
564 { "Password Offset", "dpnet.password_offset",
569 { &hf_dpnet_password_size
,
570 { "Password Size", "dpnet.password_size",
575 { &hf_dpnet_reserved_offset
,
576 { "Reserved Offset", "dpnet.reserved_offset",
581 { &hf_dpnet_reserved_size
,
582 { "Reserved Size", "dpnet.reserved_size",
587 { &hf_dpnet_application_offset
,
588 { "Application Offset", "dpnet.application_offset",
593 { &hf_dpnet_application_size
,
594 { "Application Size", "dpnet.application_size",
599 { &hf_dpnet_application_data
,
600 { "Application data", "dpnet.application_data",
605 { &hf_dpnet_instance
,
606 { "Instance GUID", "dpnet.instance",
611 { &hf_dpnet_data_command
,
612 { "Command", "dpnet.command",
617 { &hf_dpnet_data_cframe_control
,
618 { "Control", "dpnet.cframe.control",
620 VALS(msg_cframe_control
), 0,
623 { &hf_dpnet_data_cframe_msgid
,
624 { "Message ID", "dpnet.cframe.msg_id",
629 { &hf_dpnet_data_cframe_rspid
,
630 { "Response ID", "dpnet.cframe.rsp_id",
635 { &hf_dpnet_data_cframe_protocol
,
636 { "Protocol", "dpnet.cframe.protocol",
638 VALS(protocol_versions
), 0,
641 { &hf_dpnet_data_cframe_session
,
642 { "Session", "dpnet.cframe.session",
647 { &hf_dpnet_data_cframe_timestamp
,
648 { "Timestamp", "dpnet.cframe.timestamp",
653 { &hf_dpnet_data_cframe_padding
,
654 { "Padding", "dpnet.cframe.padding",
659 { &hf_dpnet_data_cframe_flags
,
660 { "Flags", "dpnet.cframe.flags",
665 { &hf_dpnet_data_cframe_retry
,
666 { "Retry", "dpnet.cframe.retry",
671 { &hf_dpnet_data_cframe_nseq
,
672 { "Next Sequence", "dpnet.cframe.nseq",
677 { &hf_dpnet_data_cframe_nrcv
,
678 { "Received", "dpnet.cframe.nrcv",
683 { &hf_dpnet_data_cframe_sack_mask1
,
684 { "SACK Mask1", "dpnet.cframe.sack.mask1",
689 { &hf_dpnet_data_cframe_sack_mask2
,
690 { "SACK Mask2", "dpnet.cframe.sack.mask2",
695 { &hf_dpnet_data_cframe_send_mask1
,
696 { "Send Mask1", "dpnet.cframe.send.mask1",
701 { &hf_dpnet_data_cframe_send_mask2
,
702 { "Send Mask2", "dpnet.cframe.send.mask2",
707 { &hf_dpnet_data_cframe_signature
,
708 { "Signature", "dpnet.cframe.signature",
713 { &hf_dpnet_data_cframe_send_secret
,
714 { "Sender Secret", "dpnet.cframe.sender_secret",
719 { &hf_dpnet_data_cframe_recv_secret
,
720 { "Receiver Secret", "dpnet.cframe.receiver_secret",
725 { &hf_dpnet_data_cframe_signing_opts
,
726 { "Signing Options", "dpnet.cframe.sign_opt",
728 VALS(signing_opts
), 0,
731 { &hf_dpnet_data_cframe_echo_time
,
732 { "Signing Options", "dpnet.cframe.echo_time",
737 { &hf_dpnet_data_seq
,
738 { "Sequence", "dpnet.sequence",
743 { &hf_dpnet_data_nseq
,
744 { "Next Sequence", "dpnet.next",
749 {&hf_dpnet_command_data
,
750 {"Control Data", "dpnet.control.data",
752 NULL
, DPNET_COMMAND_DATA
,
755 {&hf_dpnet_command_reliable
,
756 {"Reliable", "dpnet.control.reliable",
758 NULL
, DPNET_COMMAND_RELIABLE
,
761 {&hf_dpnet_command_seq
,
762 {"Sequential", "dpnet.control.sequential",
764 NULL
, DPNET_COMMAND_SEQUENTIAL
,
767 {&hf_dpnet_command_poll
,
768 {"Poll", "dpnet.control.poll",
770 NULL
, DPNET_COMMAND_POLL
,
773 {&hf_dpnet_command_new_msg
,
774 {"New Message", "dpnet.control.new_msg",
776 NULL
, DPNET_COMMAND_NEW_MSG
,
779 {&hf_dpnet_command_end_msg
,
780 {"End Message", "dpnet.control.end_msg",
782 NULL
, DPNET_COMMAND_END_MSG
,
785 {&hf_dpnet_command_user1
,
786 {"User 1", "dpnet.control.user1",
788 NULL
, DPNET_COMMAND_USER_1
,
791 {&hf_dpnet_command_user2
,
792 {"CFrame", "dpnet.control.cframe",
794 NULL
, DPNET_COMMAND_CFRAME
,
797 {&hf_dpnet_desc_client_server
,
798 {"Client", "dpnet.session.client",
800 TFS(&tfs_flags_game_client
), SESSION_CLIENT_SERVER
,
803 {&hf_dpnet_desc_migrate_host
,
804 {"Migrate", "dpnet.session.migrate",
806 TFS(&tfs_flags_migrate
), SESSION_MIGRATE_HOST
,
809 {&hf_dpnet_desc_nodpnsvr
,
810 {"dpnsvr", "dpnet.session.dpnsvr",
812 TFS(&tfs_flags_dpnsvr
), SESSION_NODPNSVR
,
815 {&hf_dpnet_desc_req_password
,
816 {"Password", "dpnet.session.password",
818 TFS(&tfs_flags_password_required
), SESSION_REQUIREPASSWORD
,
821 {&hf_dpnet_desc_no_enums
,
822 {"Enumeration", "dpnet.session.enumeration",
824 TFS(&tfs_flags_enumeration
), SESSION_NOENUMS
,
827 {&hf_dpnet_desc_fast_signed
,
828 {"Fast signing", "dpnet.session.fast_sign",
830 TFS(&tfs_flags_fast
), SESSION_FAST_SIGNED
,
833 {&hf_dpnet_desc_full_signed
,
834 {"Full signing", "dpnet.session.full_sign",
836 TFS(&tfs_flags_full
), SESSION_FULL_SIGNED
,
841 /* Setup protocol subtree array */
842 static int *ett
[] = {
844 &ett_dpnet_command_flags
,
845 &ett_dpnet_desc_flags
849 proto_dpnet
= proto_register_protocol ("DirectPlay 8 protocol", "DPNET", "dpnet");
851 proto_register_field_array(proto_dpnet
, hf
, array_length(hf
));
852 proto_register_subtree_array(ett
, array_length(ett
));
854 dpnet_handle
= register_dissector("dpnet", dissect_dpnet
, proto_dpnet
);
858 proto_reg_handoff_dpnet(void)
860 dissector_add_uint("udp.port", DPNET_PORT
, dpnet_handle
);
869 * indent-tabs-mode: nil
872 * ex: set shiftwidth=4 tabstop=8 expandtab:
873 * :indentSize=4:tabSize=8:noTabs=true: