summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dplay.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:53 +0000
commita86c5f7cae7ec9a3398300555a0b644689d946a1 (patch)
tree39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-dplay.c
parentReleasing progress-linux version 4.2.6-1~progress7.99u1. (diff)
downloadwireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz
wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-dplay.c')
-rw-r--r--epan/dissectors/packet-dplay.c509
1 files changed, 255 insertions, 254 deletions
diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c
index 99bfe58c..6e8bc1a5 100644
--- a/epan/dissectors/packet-dplay.c
+++ b/epan/dissectors/packet-dplay.c
@@ -15,55 +15,56 @@
#include <epan/packet.h>
#include <epan/aftypes.h>
+#include <epan/tfs.h>
/* function declarations */
void proto_register_dplay(void);
void proto_reg_handoff_dplay(void);
static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset);
+static int dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, int offset);
-static int proto_dplay = -1;
+static int proto_dplay;
/* Common data fields */
-static int hf_dplay_size = -1; /* Size of the whole data */
-static int hf_dplay_token = -1;
-static int hf_dplay_saddr_af = -1; /* WINSOCK_AF_INET, as this dissector does not handle IPX yet */
-static int hf_dplay_saddr_port = -1; /* port to use for the reply to this packet */
-static int hf_dplay_saddr_ip = -1; /* IP to use for the reply to this packet, or 0.0.0.0,
+static int hf_dplay_size; /* Size of the whole data */
+static int hf_dplay_token;
+static int hf_dplay_saddr_af; /* WINSOCK_AF_INET, as this dissector does not handle IPX yet */
+static int hf_dplay_saddr_port; /* port to use for the reply to this packet */
+static int hf_dplay_saddr_ip; /* IP to use for the reply to this packet, or 0.0.0.0,
then use the same IP as this packet used. */
-static int hf_dplay_saddr_padding = -1; /* null padding used in s_addr_in structures */
-static int hf_dplay_play_str = -1; /* always "play" without a null terminator */
-static int hf_dplay_command = -1; /* the dplay command this message contains*/
-static int hf_dplay_proto_dialect = -1; /* 0x0b00 for dplay7, 0x0e00 for dplay9 */
-static int hf_dplay_play_str_2 = -1; /* packet type 0x0015 encapsulates another packet */
-static int hf_dplay_command_2 = -1; /* that also has a "play" string, a command and a */
-static int hf_dplay_proto_dialect_2 = -1; /* protocol dialect, same as above */
+static int hf_dplay_saddr_padding; /* null padding used in s_addr_in structures */
+static int hf_dplay_play_str; /* always "play" without a null terminator */
+static int hf_dplay_command; /* the dplay command this message contains*/
+static int hf_dplay_proto_dialect; /* 0x0b00 for dplay7, 0x0e00 for dplay9 */
+static int hf_dplay_play_str_2; /* packet type 0x0015 encapsulates another packet */
+static int hf_dplay_command_2; /* that also has a "play" string, a command and a */
+static int hf_dplay_proto_dialect_2; /* protocol dialect, same as above */
static const int DPLAY_HEADER_OFFSET = 28; /* The dplay header is 28 bytes in size */
-static int hf_dplay_player_msg = -1;
+static int hf_dplay_player_msg;
/* The following fields are not part of the header, but hopefully have the same
* meaning for all packets they show up in. */
-static int hf_dplay_sess_desc_flags = -1; /* This is a 32bit field with some sort of a flag */
-static int hf_dplay_flags_no_create_players = -1;
-static int hf_dplay_flags_0002 = -1;
-static int hf_dplay_flags_migrate_host = -1;
-static int hf_dplay_flags_short_player_msg = -1;
-static int hf_dplay_flags_ignored = -1;
-static int hf_dplay_flags_can_join = -1;
-static int hf_dplay_flags_use_ping = -1;
-static int hf_dplay_flags_no_player_updates = -1;
-static int hf_dplay_flags_use_auth = -1;
-static int hf_dplay_flags_private_session = -1;
-static int hf_dplay_flags_password_req = -1;
-static int hf_dplay_flags_route = -1;
-static int hf_dplay_flags_server_player_only = -1;
-static int hf_dplay_flags_reliable = -1;
-static int hf_dplay_flags_preserve_order = -1;
-static int hf_dplay_flags_optimize_latency = -1;
-static int hf_dplay_flags_acqire_voice = -1;
-static int hf_dplay_flags_no_sess_desc_changes = -1;
+static int hf_dplay_sess_desc_flags; /* This is a 32bit field with some sort of a flag */
+static int hf_dplay_flags_no_create_players;
+static int hf_dplay_flags_0002;
+static int hf_dplay_flags_migrate_host;
+static int hf_dplay_flags_short_player_msg;
+static int hf_dplay_flags_ignored;
+static int hf_dplay_flags_can_join;
+static int hf_dplay_flags_use_ping;
+static int hf_dplay_flags_no_player_updates;
+static int hf_dplay_flags_use_auth;
+static int hf_dplay_flags_private_session;
+static int hf_dplay_flags_password_req;
+static int hf_dplay_flags_route;
+static int hf_dplay_flags_server_player_only;
+static int hf_dplay_flags_reliable;
+static int hf_dplay_flags_preserve_order;
+static int hf_dplay_flags_optimize_latency;
+static int hf_dplay_flags_acqire_voice;
+static int hf_dplay_flags_no_sess_desc_changes;
#define DPLAY_FLAG_NO_CREATE_PLAYERS 0x00000001
#define DPLAY_FLAG_0002 0x00000002
@@ -85,113 +86,113 @@ static int hf_dplay_flags_no_sess_desc_changes = -1;
#define DPLAY_FLAG_NO_SESS_DESC_CHANGES 0x00020000
/* Session description structure fields */
-static int hf_dplay_sess_desc_length = -1;
-static int hf_dplay_game_guid = -1;
-static int hf_dplay_instance_guid = -1;
-static int hf_dplay_max_players = -1;
-static int hf_dplay_curr_players = -1;
-static int hf_dplay_sess_name_ptr = -1;
-static int hf_dplay_passwd_ptr = -1;
-static int hf_dplay_sess_desc_reserved_1 = -1;
-static int hf_dplay_sess_desc_reserved_2 = -1;
-static int hf_dplay_sess_desc_user_1 = -1;
-static int hf_dplay_sess_desc_user_2 = -1;
-static int hf_dplay_sess_desc_user_3 = -1;
-static int hf_dplay_sess_desc_user_4 = -1;
+static int hf_dplay_sess_desc_length;
+static int hf_dplay_game_guid;
+static int hf_dplay_instance_guid;
+static int hf_dplay_max_players;
+static int hf_dplay_curr_players;
+static int hf_dplay_sess_name_ptr;
+static int hf_dplay_passwd_ptr;
+static int hf_dplay_sess_desc_reserved_1;
+static int hf_dplay_sess_desc_reserved_2;
+static int hf_dplay_sess_desc_user_1;
+static int hf_dplay_sess_desc_user_2;
+static int hf_dplay_sess_desc_user_3;
+static int hf_dplay_sess_desc_user_4;
/* PackedPlayer structure fields */
-static int hf_dplay_pp_size = -1;
-static int hf_dplay_pp_flags = -1;
-static int hf_dplay_pp_flag_sysplayer = -1;
-static int hf_dplay_pp_flag_nameserver = -1;
-static int hf_dplay_pp_flag_in_group = -1;
-static int hf_dplay_pp_flag_sending = -1;
-static int hf_dplay_pp_id = -1;
-static int hf_dplay_pp_short_name_len = -1;
-static int hf_dplay_pp_long_name_len = -1;
-static int hf_dplay_pp_sp_data_size = -1;
-static int hf_dplay_pp_player_data_size = -1;
-static int hf_dplay_pp_num_players = -1;
-static int hf_dplay_pp_system_player = -1;
-static int hf_dplay_pp_fixed_size = -1;
-static int hf_dplay_pp_dialect = -1;
-static int hf_dplay_pp_unknown_1 = -1;
-static int hf_dplay_pp_short_name = -1;
-static int hf_dplay_pp_long_name = -1;
-static int hf_dplay_pp_sp_data = -1;
-static int hf_dplay_pp_player_data = -1;
-static int hf_dplay_pp_player_id = -1;
-static int hf_dplay_pp_parent_id = -1;
+static int hf_dplay_pp_size;
+static int hf_dplay_pp_flags;
+static int hf_dplay_pp_flag_sysplayer;
+static int hf_dplay_pp_flag_nameserver;
+static int hf_dplay_pp_flag_in_group;
+static int hf_dplay_pp_flag_sending;
+static int hf_dplay_pp_id;
+static int hf_dplay_pp_short_name_len;
+static int hf_dplay_pp_long_name_len;
+static int hf_dplay_pp_sp_data_size;
+static int hf_dplay_pp_player_data_size;
+static int hf_dplay_pp_num_players;
+static int hf_dplay_pp_system_player;
+static int hf_dplay_pp_fixed_size;
+static int hf_dplay_pp_dialect;
+static int hf_dplay_pp_unknown_1;
+static int hf_dplay_pp_short_name;
+static int hf_dplay_pp_long_name;
+static int hf_dplay_pp_sp_data;
+static int hf_dplay_pp_player_data;
+static int hf_dplay_pp_player_id;
+static int hf_dplay_pp_parent_id;
#define DPLAY_PP_FLAG_SYSPLAYER 0x00000001
#define DPLAY_PP_FLAG_NAMESERVER 0x00000002
#define DPLAY_PP_FLAG_IN_GROUP 0x00000004
#define DPLAY_PP_FLAG_SENDING 0x00000008
/* SuperPackedPlayer structure fields */
-static int hf_dplay_spp_size = -1;
-static int hf_dplay_spp_flags = -1;
-static int hf_dplay_spp_flags_sysplayer = -1;
-static int hf_dplay_spp_flags_nameserver = -1;
-static int hf_dplay_spp_flags_in_group = -1;
-static int hf_dplay_spp_flags_sending = -1;
-static int hf_dplay_spp_id = -1;
-static int hf_dplay_spp_player_info_mask = -1;
-static int hf_dplay_spp_have_short_name = -1;
-static int hf_dplay_spp_have_long_name = -1;
-static int hf_dplay_spp_sp_length_type = -1;
-static int hf_dplay_spp_pd_length_type = -1;
-static int hf_dplay_spp_player_count_type = -1;
-static int hf_dplay_spp_have_parent_id = -1;
-static int hf_dplay_spp_shortcut_count_type = -1;
-static int hf_dplay_spp_dialect = -1;
-static int hf_dplay_spp_sys_player_id = -1;
-static int hf_dplay_spp_short_name = -1;
-static int hf_dplay_spp_long_name = -1;
-static int hf_dplay_spp_player_data_length = -1;
-static int hf_dplay_spp_player_data = -1;
-static int hf_dplay_spp_sp_data_length = -1;
-static int hf_dplay_spp_sp_data = -1;
-static int hf_dplay_spp_player_count = -1;
-static int hf_dplay_spp_player_id = -1;
-static int hf_dplay_spp_parent_id = -1;
-static int hf_dplay_spp_shortcut_count = -1;
-static int hf_dplay_spp_shortcut_id = -1;
+static int hf_dplay_spp_size;
+static int hf_dplay_spp_flags;
+static int hf_dplay_spp_flags_sysplayer;
+static int hf_dplay_spp_flags_nameserver;
+static int hf_dplay_spp_flags_in_group;
+static int hf_dplay_spp_flags_sending;
+static int hf_dplay_spp_id;
+static int hf_dplay_spp_player_info_mask;
+static int hf_dplay_spp_have_short_name;
+static int hf_dplay_spp_have_long_name;
+static int hf_dplay_spp_sp_length_type;
+static int hf_dplay_spp_pd_length_type;
+static int hf_dplay_spp_player_count_type;
+static int hf_dplay_spp_have_parent_id;
+static int hf_dplay_spp_shortcut_count_type;
+static int hf_dplay_spp_dialect;
+static int hf_dplay_spp_sys_player_id;
+static int hf_dplay_spp_short_name;
+static int hf_dplay_spp_long_name;
+static int hf_dplay_spp_player_data_length;
+static int hf_dplay_spp_player_data;
+static int hf_dplay_spp_sp_data_length;
+static int hf_dplay_spp_sp_data;
+static int hf_dplay_spp_player_count;
+static int hf_dplay_spp_player_id;
+static int hf_dplay_spp_parent_id;
+static int hf_dplay_spp_shortcut_count;
+static int hf_dplay_spp_shortcut_id;
#define DPLAY_SPP_FLAG_SYSPLAYER 0x00000001
#define DPLAY_SPP_FLAG_NAMESERVER 0x00000002
#define DPLAY_SPP_FLAG_IN_GROUP 0x00000004
#define DPLAY_SPP_FLAG_SENDING 0x00000008
/* SecurityDesc structure fields */
-static int hf_dplay_sd_size = -1;
-static int hf_dplay_sd_flags = -1;
-static int hf_dplay_sd_sspi = -1;
-static int hf_dplay_sd_capi = -1;
-static int hf_dplay_sd_capi_type = -1;
-static int hf_dplay_sd_enc_alg = -1;
+static int hf_dplay_sd_size;
+static int hf_dplay_sd_flags;
+static int hf_dplay_sd_sspi;
+static int hf_dplay_sd_capi;
+static int hf_dplay_sd_capi_type;
+static int hf_dplay_sd_enc_alg;
/* Message Type 0x0001 data fields */
-static int hf_dplay_type_01_name_offset = -1;
-static int hf_dplay_type_01_game_name = -1;
+static int hf_dplay_type_01_name_offset;
+static int hf_dplay_type_01_game_name;
/* Message Type 0x0002 data fields */
-static int hf_dplay_type_02_game_guid = -1;
-static int hf_dplay_type_02_password_offset = -1;
-static int hf_dplay_type_02_flags = -1;
-static int hf_dplay_type_02_password = -1;
-static int hf_enum_sess_flag_join = -1;
-static int hf_enum_sess_flag_all = -1;
-static int hf_enum_sess_flag_passwd = -1;
+static int hf_dplay_type_02_game_guid;
+static int hf_dplay_type_02_password_offset;
+static int hf_dplay_type_02_flags;
+static int hf_dplay_type_02_password;
+static int hf_enum_sess_flag_join;
+static int hf_enum_sess_flag_all;
+static int hf_enum_sess_flag_passwd;
#define DPLAY_ENUM_SESS_FLAG_JOIN 0x00000001
#define DPLAY_ENUM_SESS_FLAG_ALL 0x00000002
#define DPLAY_ENUM_SESS_FLAG_PASSWD 0x00000040
/* Message Type 0x0005 data fields */
-static int hf_dplay_type_05_flags = -1;
-static int hf_dplay_type_05_system_player = -1;
-static int hf_dplay_type_05_name_server = -1;
-static int hf_dplay_type_05_local = -1;
-static int hf_dplay_type_05_unknown = -1; /* unknown, but always set */
-static int hf_dplay_type_05_secure = -1;
+static int hf_dplay_type_05_flags;
+static int hf_dplay_type_05_system_player;
+static int hf_dplay_type_05_name_server;
+static int hf_dplay_type_05_local;
+static int hf_dplay_type_05_unknown; /* unknown, but always set */
+static int hf_dplay_type_05_secure;
#define DPLAY_TYPE05_FLAG_SYSPLAYER 0x00000001
#define DPLAY_TYPE05_FLAG_NAMESERVER 0x00000002
#define DPLAY_TYPE05_FLAG_LOCAL 0x00000004
@@ -199,85 +200,85 @@ static int hf_dplay_type_05_secure = -1;
#define DPLAY_TYPE05_FLAG_SECURE 0x00000200
/* Message Type 0x0007 data fields */
-static int hf_dplay_type_07_dpid = -1;
-static int hf_dplay_type_07_sspi_offset = -1;
-static int hf_dplay_type_07_capi_offset = -1;
-static int hf_dplay_type_07_hresult = -1;
-static int hf_dplay_type_07_sspi = -1;
-static int hf_dplay_type_07_capi = -1;
+static int hf_dplay_type_07_dpid;
+static int hf_dplay_type_07_sspi_offset;
+static int hf_dplay_type_07_capi_offset;
+static int hf_dplay_type_07_hresult;
+static int hf_dplay_type_07_sspi;
+static int hf_dplay_type_07_capi;
/* Data fields for message types 0x08, 0x09, 0x0b, 0x0c, 0x0d, 0x0e */
-static int hf_dplay_multi_id_to = -1;
-static int hf_dplay_multi_player_id = -1;
-static int hf_dplay_multi_group_id = -1;
-static int hf_dplay_multi_create_offset = -1;
-static int hf_dplay_multi_password_offset = -1;
-static int hf_dplay_multi_password = -1;
+static int hf_dplay_multi_id_to;
+static int hf_dplay_multi_player_id;
+static int hf_dplay_multi_group_id;
+static int hf_dplay_multi_create_offset;
+static int hf_dplay_multi_password_offset;
+static int hf_dplay_multi_password;
/* Message Type 0x000f data fields */
-static int hf_dplay_type_0f_id_to = -1;
-static int hf_dplay_type_0f_id = -1;
-static int hf_dplay_type_0f_data_size = -1;
-static int hf_dplay_type_0f_data_offset = -1;
-static int hf_dplay_type_0f_data = -1;
+static int hf_dplay_type_0f_id_to;
+static int hf_dplay_type_0f_id;
+static int hf_dplay_type_0f_data_size;
+static int hf_dplay_type_0f_data_offset;
+static int hf_dplay_type_0f_data;
/* Message Type 0x0013 data fields */
-static int hf_dplay_type_13_id_to = -1;
-static int hf_dplay_type_13_player_id = -1;
-static int hf_dplay_type_13_group_id = -1;
-static int hf_dplay_type_13_create_offset = -1;
-static int hf_dplay_type_13_password_offset = -1;
-static int hf_dplay_type_13_password = -1;
-static int hf_dplay_type_13_tick_count = -1;
+static int hf_dplay_type_13_id_to;
+static int hf_dplay_type_13_player_id;
+static int hf_dplay_type_13_group_id;
+static int hf_dplay_type_13_create_offset;
+static int hf_dplay_type_13_password_offset;
+static int hf_dplay_type_13_password;
+static int hf_dplay_type_13_tick_count;
/* Message Type 0x0015 data fields */
-static int hf_dplay_message_guid = -1;
-static int hf_dplay_type_15_packet_idx = -1;
-static int hf_dplay_type_15_data_size = -1;
-static int hf_dplay_type_15_offset = -1;
-static int hf_dplay_type_15_total_packets = -1;
-static int hf_dplay_type_15_msg_size = -1;
-static int hf_dplay_type_15_packet_offset = -1;
+static int hf_dplay_message_guid;
+static int hf_dplay_type_15_packet_idx;
+static int hf_dplay_type_15_data_size;
+static int hf_dplay_type_15_offset;
+static int hf_dplay_type_15_total_packets;
+static int hf_dplay_type_15_msg_size;
+static int hf_dplay_type_15_packet_offset;
/* Message Type 0x0016 and 0x0017 data fields */
-static int hf_dplay_ping_id_from = -1;
-static int hf_dplay_ping_tick_count = -1;
+static int hf_dplay_ping_id_from;
+static int hf_dplay_ping_tick_count;
/* Message Type 0x001a data fields */
-static int hf_dplay_type_1a_id_to = -1;
-static int hf_dplay_type_1a_sess_name_ofs = -1;
-static int hf_dplay_type_1a_password_ofs = -1;
-static int hf_dplay_type_1a_session_name = -1;
-static int hf_dplay_type_1a_password = -1;
+static int hf_dplay_type_1a_id_to;
+static int hf_dplay_type_1a_sess_name_ofs;
+static int hf_dplay_type_1a_password_ofs;
+static int hf_dplay_type_1a_session_name;
+static int hf_dplay_type_1a_password;
/* Message Type 0x0029 data fields */
-static int hf_dplay_type_29_player_count = -1;
-static int hf_dplay_type_29_group_count = -1;
-static int hf_dplay_type_29_packed_offset = -1;
-static int hf_dplay_type_29_shortcut_count = -1;
-static int hf_dplay_type_29_description_offset = -1;
-static int hf_dplay_type_29_name_offset = -1;
-static int hf_dplay_type_29_password_offset = -1;
-static int hf_dplay_type_29_game_name = -1;
-static int hf_dplay_type_29_password = -1;
+static int hf_dplay_type_29_player_count;
+static int hf_dplay_type_29_group_count;
+static int hf_dplay_type_29_packed_offset;
+static int hf_dplay_type_29_shortcut_count;
+static int hf_dplay_type_29_description_offset;
+static int hf_dplay_type_29_name_offset;
+static int hf_dplay_type_29_password_offset;
+static int hf_dplay_type_29_game_name;
+static int hf_dplay_type_29_password;
/* Message Type 0x002f data fields */
-static int hf_dplay_type_2f_dpid = -1;
+static int hf_dplay_type_2f_dpid;
/* various */
-static gint ett_dplay = -1;
-static gint ett_dplay_header = -1;
-static gint ett_dplay_sockaddr = -1;
-static gint ett_dplay_data = -1;
-static gint ett_dplay_enc_packet = -1;
-static gint ett_dplay_flags = -1;
-static gint ett_dplay_sess_desc_flags = -1;
-static gint ett_dplay_pp_flags = -1;
-static gint ett_dplay_spp_flags = -1;
-static gint ett_dplay_spp_info_mask = -1;
-static gint ett_dplay_type02_flags = -1;
-static gint ett_dplay_type05_flags = -1;
-static gint ett_dplay_type29_spp = -1;
+static int ett_dplay;
+static int ett_dplay_header;
+static int ett_dplay_sockaddr;
+static int ett_dplay_data;
+static int ett_dplay_enc_packet;
+static int ett_dplay_flags;
+static int ett_dplay_sess_desc_flags;
+static int ett_dplay_pp_flags;
+static int ett_dplay_spp_flags;
+static int ett_dplay_spp_info_mask;
+static int ett_dplay_type02_flags;
+static int ett_dplay_type05_flags;
+static int ett_dplay_type29_spp;
static const value_string dplay_command_val[] = {
{ 0x0001, "Enum Sessions Reply" },
@@ -385,10 +386,10 @@ static const value_string yes_no_val[] = {
/* borrowed from epan/dissectors/packets-smb-common.c */
-static gint display_unicode_string(proto_tree *tree, gint hf_index, tvbuff_t *tvb, gint offset)
+static int display_unicode_string(proto_tree *tree, int hf_index, tvbuff_t *tvb, int offset)
{
char *str;
- gint len;
+ int len;
/* display a unicode string from the tree and return new offset */
@@ -398,7 +399,7 @@ static gint display_unicode_string(proto_tree *tree, gint hf_index, tvbuff_t *tv
return offset+len;
}
-static gint dissect_sockaddr_in(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_sockaddr_in(proto_tree *tree, tvbuff_t *tvb, int offset)
{
proto_tree *sa_tree;
@@ -411,7 +412,7 @@ static gint dissect_sockaddr_in(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_session_desc(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_session_desc(proto_tree *tree, tvbuff_t *tvb, int offset)
{
static int * const flags[] = {
&hf_dplay_flags_no_sess_desc_changes,
@@ -454,10 +455,10 @@ static gint dissect_session_desc(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 sn_len, ln_len, sd_len, pd_len, num_players, i;
- gint size;
+ uint32_t sn_len, ln_len, sd_len, pd_len, num_players, i;
+ int size;
static int * const flags[] = {
&hf_dplay_pp_flag_sending,
&hf_dplay_pp_flag_in_group,
@@ -514,16 +515,16 @@ static gint dissect_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint spp_get_value(guint32 length_type, tvbuff_t *tvb, gint offset, guint32 *value)
+static int spp_get_value(uint32_t length_type, tvbuff_t *tvb, int offset, uint32_t *value)
{
- gint len = 0;
+ int len = 0;
*value = 0;
switch (length_type) {
case 1:
len = 1;
- *value = tvb_get_guint8(tvb, offset);
+ *value = tvb_get_uint8(tvb, offset);
break;
case 2:
len = 2;
@@ -538,15 +539,15 @@ static gint spp_get_value(guint32 length_type, tvbuff_t *tvb, gint offset, guint
return len;
}
-static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 flags, is_sysplayer, info_mask;
- guint32 have_short_name, have_long_name, sp_length_type, pd_length_type;
- guint32 player_count_type, have_parent_id, shortcut_count_type;
- guint32 player_data_length, sp_data_length, player_count, shortcut_count;
+ uint32_t flags, is_sysplayer, info_mask;
+ uint32_t have_short_name, have_long_name, sp_length_type, pd_length_type;
+ uint32_t player_count_type, have_parent_id, shortcut_count_type;
+ uint32_t player_data_length, sp_data_length, player_count, shortcut_count;
proto_item *im_item = NULL;
proto_tree *im_tree = NULL;
- gint len;
+ int len;
static int * const ssp_flags[] = {
&hf_dplay_spp_flags_sending,
&hf_dplay_spp_flags_in_group,
@@ -616,7 +617,7 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g
}
if (player_count_type) {
- guint32 i;
+ uint32_t i;
len = spp_get_value(player_count_type, tvb, offset, &player_count);
proto_tree_add_item(tree, hf_dplay_spp_player_count, tvb, offset, len, ENC_LITTLE_ENDIAN);
@@ -631,7 +632,7 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g
}
if (shortcut_count_type) {
- guint32 i;
+ uint32_t i;
len = spp_get_value(shortcut_count_type, tvb, offset, &shortcut_count);
proto_tree_add_item(tree, hf_dplay_spp_shortcut_count, tvb, offset, len, ENC_LITTLE_ENDIAN);
@@ -644,7 +645,7 @@ static gint dissect_dplay_super_packed_player(proto_tree *tree, tvbuff_t *tvb, g
return offset;
}
-static gint dissect_security_desc(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_security_desc(proto_tree *tree, tvbuff_t *tvb, int offset)
{
proto_tree_add_item(tree, hf_dplay_sd_size, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
proto_tree_add_item(tree, hf_dplay_sd_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
@@ -655,9 +656,9 @@ static gint dissect_security_desc(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_dplay_header(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_dplay_header(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 mixed, size, token;
+ uint32_t mixed, size, token;
mixed = tvb_get_letohl(tvb, offset);
size = mixed & 0x000FFFFF;
@@ -673,9 +674,9 @@ static gint dissect_dplay_header(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type01_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type01_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 name_offset;
+ uint32_t name_offset;
offset = dissect_session_desc(tree, tvb, offset);
name_offset = tvb_get_letohl(tvb, offset);
@@ -687,9 +688,9 @@ static gint dissect_type01_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type02_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type02_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 passwd_offset;
+ uint32_t passwd_offset;
static int * const flags[] = {
&hf_enum_sess_flag_passwd,
&hf_enum_sess_flag_all,
@@ -709,7 +710,7 @@ static gint dissect_type02_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type05_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type05_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
static int * const flags[] = {
&hf_dplay_type_05_secure,
@@ -725,9 +726,9 @@ static gint dissect_type05_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type07_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type07_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 sspi_offset, capi_offset;
+ uint32_t sspi_offset, capi_offset;
proto_tree_add_item(tree, hf_dplay_type_07_dpid, tvb, offset, 4, ENC_NA); offset += 4;
offset = dissect_security_desc(tree, tvb, offset);
@@ -750,9 +751,9 @@ static gint dissect_type07_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_player_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_player_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 pp_ofs;
+ uint32_t pp_ofs;
proto_tree_add_item(tree, hf_dplay_multi_id_to, tvb, offset, 4, ENC_NA); offset += 4;
proto_tree_add_item(tree, hf_dplay_multi_player_id, tvb, offset, 4, ENC_NA); offset += 4;
@@ -767,9 +768,9 @@ static gint dissect_player_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type0f_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type0f_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 data_size;
+ uint32_t data_size;
proto_tree_add_item(tree, hf_dplay_type_0f_id_to, tvb, offset, 4, ENC_NA); offset += 4;
proto_tree_add_item(tree, hf_dplay_type_0f_id, tvb, offset, 4, ENC_NA); offset += 4;
@@ -782,9 +783,9 @@ static gint dissect_type0f_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type13_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type13_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 pp_ofs, pw_ofs;
+ uint32_t pp_ofs, pw_ofs;
proto_tree_add_item(tree, hf_dplay_type_13_id_to, tvb, offset, 4, ENC_NA); offset += 4;
proto_tree_add_item(tree, hf_dplay_type_13_player_id, tvb, offset, 4, ENC_NA); offset += 4;
@@ -802,9 +803,9 @@ static gint dissect_type13_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type15_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type15_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint16 second_message_type;
+ uint16_t second_message_type;
proto_tree *enc_tree;
second_message_type = tvb_get_letohs(tvb, 72);
@@ -850,7 +851,7 @@ static gint dissect_type15_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_ping_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_ping_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
proto_tree_add_item(tree, hf_dplay_ping_id_from, tvb, offset, 4, ENC_NA); offset += 4;
proto_tree_add_item(tree, hf_dplay_ping_tick_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
@@ -858,9 +859,9 @@ static gint dissect_ping_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 sn_ofs, pw_ofs;
+ uint32_t sn_ofs, pw_ofs;
proto_tree_add_item(tree, hf_dplay_type_1a_id_to, tvb, offset, 4, ENC_NA); offset += 4;
sn_ofs = tvb_get_letohl(tvb, offset);
@@ -880,11 +881,11 @@ static gint dissect_type1a_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type29_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type29_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 password_offset = tvb_get_letohl(tvb, offset + 24);
- gint player_count, group_count, shortcut_count;
- gint i;
+ uint32_t password_offset = tvb_get_letohl(tvb, offset + 24);
+ int player_count, group_count, shortcut_count;
+ int i;
player_count = tvb_get_letohl(tvb, offset);
proto_tree_add_item(tree, hf_dplay_type_29_player_count, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4;
@@ -927,7 +928,7 @@ static gint dissect_type29_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
return offset;
}
-static gint dissect_type2f_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
+static int dissect_type2f_message(proto_tree *tree, tvbuff_t *tvb, int offset)
{
proto_tree_add_item(tree, hf_dplay_type_2f_dpid, tvb, offset, 4, ENC_NA); offset += 4;
return offset;
@@ -935,17 +936,17 @@ static gint dissect_type2f_message(proto_tree *tree, tvbuff_t *tvb, gint offset)
static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- guint16 message_type;
- guint16 second_message_type = G_MAXUINT16;
- guint16 proto_version;
- guint32 dplay_id;
- guint8 play_id[] = {'p','l','a','y'};
+ uint16_t message_type;
+ uint16_t second_message_type = UINT16_MAX;
+ uint16_t proto_version;
+ uint32_t dplay_id;
+ uint8_t play_id[] = {'p','l','a','y'};
dplay_id = tvb_get_letohl(tvb, 20);
message_type = tvb_get_letohs(tvb, 24);
proto_version = tvb_get_letohs(tvb, 26);
- if(memcmp(play_id, (guint8 *)&dplay_id, 4) != 0)
+ if(memcmp(play_id, (uint8_t *)&dplay_id, 4) != 0)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPLAY");
col_set_str(pinfo->cinfo,COL_INFO, "DPlay data packet");
@@ -975,7 +976,7 @@ static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *dplay_tree;
proto_tree *dplay_header;
proto_tree *dplay_data;
- gint offset = 0;
+ int offset = 0;
dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, 0, -1, ENC_NA);
dplay_tree = proto_item_add_subtree(dplay_item, ett_dplay);
@@ -1043,7 +1044,7 @@ static void dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- guint32 mixed, size, token;
+ uint32_t mixed, size, token;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DPLAY");
col_set_str(pinfo->cinfo,COL_INFO, "DPlay player to player message");
@@ -1053,7 +1054,7 @@ static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tr
proto_item *dplay_item;
proto_tree *dplay_tree;
proto_tree *data_tree;
- gint offset = 0;
+ int offset = 0;
dplay_item = proto_tree_add_item(tree, proto_dplay, tvb, offset, -1, ENC_NA);
dplay_tree = proto_item_add_subtree(dplay_item, ett_dplay);
@@ -1072,18 +1073,18 @@ static void dissect_dplay_player_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tr
}
}
-static gboolean heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- guint32 dplay_id, token;
+ uint32_t dplay_id, token;
if(tvb_captured_length(tvb) < 25)
- return FALSE;
+ return false;
/* The string play = 0x706c6179 */
dplay_id = tvb_get_ntohl(tvb, 20);
if( dplay_id == 0x706c6179) {
dissect_dplay(tvb, pinfo, tree);
- return TRUE;
+ return true;
}
@@ -1095,15 +1096,15 @@ static gboolean heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (tvb_get_letohs(tvb, 4) == WINSOCK_AF_INET) {
int offset;
for (offset = 12; offset <= 20; offset++)
- if (tvb_get_guint8(tvb, offset) != 0)
- return FALSE;
+ if (tvb_get_uint8(tvb, offset) != 0)
+ return false;
dissect_dplay_player_msg(tvb, pinfo, tree);
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void proto_register_dplay(void)
@@ -1156,16 +1157,16 @@ void proto_register_dplay(void)
NULL, 0x0, NULL, HFILL}},
{ &hf_dplay_flags_no_create_players,
{ "no create players flag", "dplay.flags.no_create_players", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_NO_CREATE_PLAYERS, "No Create Players", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_NO_CREATE_PLAYERS, NULL, HFILL}},
{ &hf_dplay_flags_0002,
{ "unused", "dplay.flags.unused", FT_BOOLEAN, 32,
TFS(&tfs_present_absent), DPLAY_FLAG_0002, NULL, HFILL}},
{ &hf_dplay_flags_migrate_host,
{ "migrate host flag", "dplay.flags.migrate_host", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_MIGRATE_HOST, "Migrate Host", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_MIGRATE_HOST, NULL, HFILL}},
{ &hf_dplay_flags_short_player_msg,
{ "short player message", "dplay.flags.short_player_msg", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_SHORT_PLAYER_MSG, "Short Player Msg", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_SHORT_PLAYER_MSG, NULL, HFILL}},
{ &hf_dplay_flags_ignored,
{ "ignored", "dplay.ignored", FT_BOOLEAN, 32,
TFS(&tfs_present_absent), DPLAY_FLAG_IGNORED, NULL, HFILL}},
@@ -1180,25 +1181,25 @@ void proto_register_dplay(void)
TFS(&tfs_present_absent), DPLAY_FLAG_NO_P_UPD, NULL, HFILL}},
{ &hf_dplay_flags_use_auth,
{ "use authentication", "dplay.flags.use_auth", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_USE_AUTH, "Use Auth", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_USE_AUTH, NULL, HFILL}},
{ &hf_dplay_flags_private_session,
{ "private session", "dplay.flags.priv_sess", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_PRIV_SESS, "Priv Session", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_PRIV_SESS, NULL, HFILL}},
{ &hf_dplay_flags_password_req,
{ "password required", "dplay.flags.pass_req", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_PASS_REQ, "Pass Req", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_PASS_REQ, NULL, HFILL}},
{ &hf_dplay_flags_route,
{ "route via game host", "dplay.flags.route", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_ROUTE, "Route", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_ROUTE, NULL, HFILL}},
{ &hf_dplay_flags_server_player_only,
{ "get server player only", "dplay.flags.srv_p_only", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_SRV_ONLY, "Svr Player Only", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_SRV_ONLY, NULL, HFILL}},
{ &hf_dplay_flags_reliable,
{ "use reliable protocol", "dplay.flags.reliable", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_RELIABLE, "Reliable", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_RELIABLE, NULL, HFILL}},
{ &hf_dplay_flags_preserve_order,
{ "preserve order", "dplay.flags.order", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_FLAG_ORDER, "Order", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_FLAG_ORDER, NULL, HFILL}},
{ &hf_dplay_flags_optimize_latency,
{ "optimize for latency", "dplay.flags.opt_latency", FT_BOOLEAN, 32,
TFS(&tfs_present_absent), DPLAY_FLAG_OPT_LAT, "Opt Latency", HFILL}},
@@ -1445,13 +1446,13 @@ void proto_register_dplay(void)
NULL, 0x0, NULL, HFILL}},
{ &hf_enum_sess_flag_join,
{ "Enumerate joinable sessions", "dplay.type02.joinable", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_ENUM_SESS_FLAG_JOIN, "Joinable", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_ENUM_SESS_FLAG_JOIN, NULL, HFILL}},
{ &hf_enum_sess_flag_all,
{ "Enumerate all sessions", "dplay.type02.all", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_ENUM_SESS_FLAG_ALL, "All", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_ENUM_SESS_FLAG_ALL, NULL, HFILL}},
{ &hf_enum_sess_flag_passwd,
{ "Enumerate sessions requiring a password", "dplay.type02.pw_req", FT_BOOLEAN, 32,
- TFS(&tfs_present_absent), DPLAY_ENUM_SESS_FLAG_PASSWD, "Password", HFILL}},
+ TFS(&tfs_present_absent), DPLAY_ENUM_SESS_FLAG_PASSWD, NULL, HFILL}},
/* Data fields for message type 0x0005 */
{ &hf_dplay_type_05_flags,
@@ -1637,7 +1638,7 @@ void proto_register_dplay(void)
NULL, 0x0, NULL, HFILL}},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_dplay,
&ett_dplay_header,
&ett_dplay_sockaddr,