diff options
Diffstat (limited to 'epan/dissectors/packet-quake.c')
-rw-r--r-- | epan/dissectors/packet-quake.c | 289 |
1 files changed, 150 insertions, 139 deletions
diff --git a/epan/dissectors/packet-quake.c b/epan/dissectors/packet-quake.c index 545b48706b..cd0fa2e82e 100644 --- a/epan/dissectors/packet-quake.c +++ b/epan/dissectors/packet-quake.c @@ -122,9 +122,9 @@ static const value_string names_control_command[] = { #define QUAKE_MAXSTRING 0x800 static const value_string names_control_direction[] = { - { CCREQ, "Request" }, - { CCREP, "Reply" }, - { 0, NULL } + { CCREQ, "Request" }, + { CCREP, "Reply" }, + { 0, NULL } }; @@ -481,136 +481,136 @@ void proto_reg_handoff_quake(void); void proto_register_quake(void) { - static hf_register_info hf[] = { - { &hf_quake_header_flags, - { "Flags", "quake.header.flags", - FT_UINT16, BASE_HEX, NULL, 0x0, - NULL, HFILL }}, - { &hf_quake_header_flags_data, - { "Data", "quake.header.flags.data", - FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_DATA, - NULL, HFILL }}, - { &hf_quake_header_flags_ack, - { "Acknowledgment", "quake.header.flags.ack", - FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_ACK, - NULL, HFILL }}, - { &hf_quake_header_flags_no_ack, - { "No Acknowledgment", "quake.header.flags.no_ack", - FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_NAK, - NULL, HFILL }}, - { &hf_quake_header_flags_endmsg, - { "End Of Message", "quake.header.flags.endmsg", - FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_EOM, - NULL, HFILL }}, - { &hf_quake_header_flags_unreliable, - { "Unreliable", "quake.header.flags.unreliable", - FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_UNRELIABLE, - NULL, HFILL }}, - { &hf_quake_header_flags_control, - { "Control", "quake.header.flags.control", - FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_CTL, - NULL, HFILL }}, - { &hf_quake_header_length, - { "Length", "quake.header.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "full data length", HFILL }}, - { &hf_quake_header_sequence, - { "Sequence", "quake.header.sequence", - FT_UINT32, BASE_HEX, NULL, 0x0, - "Sequence Number", HFILL }}, - { &hf_quake_control_command, - { "Command", "quake.control.command", - FT_UINT8, BASE_HEX, VALS(names_control_command), 0x0, - "Control Command", HFILL }}, - { &hf_quake_CCREQ_CONNECT_game, - { "Game", "quake.control.connect.game", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Game Name", HFILL }}, - { &hf_quake_CCREQ_CONNECT_version, - { "Version", "quake.control.connect.version", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Game Protocol Version Number", HFILL }}, - { &hf_quake_CCREQ_SERVER_INFO_game, - { "Game", "quake.control.server_info.game", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Game Name", HFILL }}, - { &hf_quake_CCREQ_SERVER_INFO_version, - { "Version", "quake.control.server_info.version", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Game Protocol Version Number", HFILL }}, - { &hf_quake_CCREQ_PLAYER_INFO_player, - { "Player", "quake.control.player_info.player", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_quake_CCREQ_RULE_INFO_lastrule, - { "Last Rule", "quake.control.rule_info.lastrule", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Last Rule Name", HFILL }}, - { &hf_quake_CCREP_ACCEPT_port, - { "Port", "quake.control.accept.port", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Game Data Port", HFILL }}, - { &hf_quake_CCREP_REJECT_reason, - { "Reason", "quake.control.reject.reason", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Reject Reason", HFILL }}, - { &hf_quake_CCREP_SERVER_INFO_address, - { "Address", "quake.control.server_info.address", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Server Address", HFILL }}, - { &hf_quake_CCREP_SERVER_INFO_server, - { "Server", "quake.control.server_info.server", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Server Name", HFILL }}, - { &hf_quake_CCREP_SERVER_INFO_map, - { "Map", "quake.control.server_info.map", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Map Name", HFILL }}, - { &hf_quake_CCREP_SERVER_INFO_num_player, - { "Number of Players", "quake.control.server_info.num_player", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Current Number of Players", HFILL }}, - { &hf_quake_CCREP_SERVER_INFO_max_player, - { "Maximal Number of Players", "quake.control.server_info.max_player", - FT_UINT8, BASE_DEC, NULL, 0x0, - NULL, HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_name, - { "Name", "quake.control.player_info.name", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Player Name", HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_colors, - { "Colors", "quake.control.player_info.colors", - FT_UINT32, BASE_HEX, NULL, 0x0, - "Player Colors", HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_colors_shirt, - { "Shirt", "quake.control.player_info.colors.shirt", - FT_UINT8, BASE_DEC, VALS(names_colors), 0x0, - "Shirt Color", HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_colors_pants, - { "Pants", "quake.control.player_info.colors.pants", - FT_UINT8, BASE_DEC, VALS(names_colors), 0x0, - "Pants Color", HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_frags, - { "Frags", "quake.control.player_info.frags", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Player Frags", HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_connect_time, - { "Connect Time", "quake.control.player_info.connect_time", - FT_UINT32, BASE_DEC, NULL, 0x0, - "Player Connect Time", HFILL }}, - { &hf_quake_CCREP_PLAYER_INFO_address, - { "Address", "quake.control.player_info.address", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Player Address", HFILL }}, - { &hf_quake_CCREP_RULE_INFO_rule, - { "Rule", "quake.control.rule_info.rule", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Rule Name", HFILL }}, - { &hf_quake_CCREP_RULE_INFO_value, - { "Value", "quake.control.rule_info.value", - FT_STRINGZ, BASE_NONE, NULL, 0x0, - "Rule Value", HFILL }}, - }; + static hf_register_info hf[] = { + { &hf_quake_header_flags, + { "Flags", "quake.header.flags", + FT_UINT16, BASE_HEX, NULL, 0x0, + NULL, HFILL }}, + { &hf_quake_header_flags_data, + { "Data", "quake.header.flags.data", + FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_DATA, + NULL, HFILL }}, + { &hf_quake_header_flags_ack, + { "Acknowledgment", "quake.header.flags.ack", + FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_ACK, + NULL, HFILL }}, + { &hf_quake_header_flags_no_ack, + { "No Acknowledgment", "quake.header.flags.no_ack", + FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_NAK, + NULL, HFILL }}, + { &hf_quake_header_flags_endmsg, + { "End Of Message", "quake.header.flags.endmsg", + FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_EOM, + NULL, HFILL }}, + { &hf_quake_header_flags_unreliable, + { "Unreliable", "quake.header.flags.unreliable", + FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_UNRELIABLE, + NULL, HFILL }}, + { &hf_quake_header_flags_control, + { "Control", "quake.header.flags.control", + FT_BOOLEAN, 16, TFS(&tfs_set_notset), NETFLAG_CTL, + NULL, HFILL }}, + { &hf_quake_header_length, + { "Length", "quake.header.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "full data length", HFILL }}, + { &hf_quake_header_sequence, + { "Sequence", "quake.header.sequence", + FT_UINT32, BASE_HEX, NULL, 0x0, + "Sequence Number", HFILL }}, + { &hf_quake_control_command, + { "Command", "quake.control.command", + FT_UINT8, BASE_HEX, VALS(names_control_command), 0x0, + "Control Command", HFILL }}, + { &hf_quake_CCREQ_CONNECT_game, + { "Game", "quake.control.connect.game", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Game Name", HFILL }}, + { &hf_quake_CCREQ_CONNECT_version, + { "Version", "quake.control.connect.version", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Game Protocol Version Number", HFILL }}, + { &hf_quake_CCREQ_SERVER_INFO_game, + { "Game", "quake.control.server_info.game", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Game Name", HFILL }}, + { &hf_quake_CCREQ_SERVER_INFO_version, + { "Version", "quake.control.server_info.version", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Game Protocol Version Number", HFILL }}, + { &hf_quake_CCREQ_PLAYER_INFO_player, + { "Player", "quake.control.player_info.player", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_quake_CCREQ_RULE_INFO_lastrule, + { "Last Rule", "quake.control.rule_info.lastrule", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Last Rule Name", HFILL }}, + { &hf_quake_CCREP_ACCEPT_port, + { "Port", "quake.control.accept.port", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Game Data Port", HFILL }}, + { &hf_quake_CCREP_REJECT_reason, + { "Reason", "quake.control.reject.reason", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Reject Reason", HFILL }}, + { &hf_quake_CCREP_SERVER_INFO_address, + { "Address", "quake.control.server_info.address", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Server Address", HFILL }}, + { &hf_quake_CCREP_SERVER_INFO_server, + { "Server", "quake.control.server_info.server", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Server Name", HFILL }}, + { &hf_quake_CCREP_SERVER_INFO_map, + { "Map", "quake.control.server_info.map", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Map Name", HFILL }}, + { &hf_quake_CCREP_SERVER_INFO_num_player, + { "Number of Players", "quake.control.server_info.num_player", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Current Number of Players", HFILL }}, + { &hf_quake_CCREP_SERVER_INFO_max_player, + { "Maximal Number of Players", "quake.control.server_info.max_player", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_name, + { "Name", "quake.control.player_info.name", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Player Name", HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_colors, + { "Colors", "quake.control.player_info.colors", + FT_UINT32, BASE_HEX, NULL, 0x0, + "Player Colors", HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_colors_shirt, + { "Shirt", "quake.control.player_info.colors.shirt", + FT_UINT8, BASE_DEC, VALS(names_colors), 0x0, + "Shirt Color", HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_colors_pants, + { "Pants", "quake.control.player_info.colors.pants", + FT_UINT8, BASE_DEC, VALS(names_colors), 0x0, + "Pants Color", HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_frags, + { "Frags", "quake.control.player_info.frags", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Player Frags", HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_connect_time, + { "Connect Time", "quake.control.player_info.connect_time", + FT_UINT32, BASE_DEC, NULL, 0x0, + "Player Connect Time", HFILL }}, + { &hf_quake_CCREP_PLAYER_INFO_address, + { "Address", "quake.control.player_info.address", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Player Address", HFILL }}, + { &hf_quake_CCREP_RULE_INFO_rule, + { "Rule", "quake.control.rule_info.rule", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Rule Name", HFILL }}, + { &hf_quake_CCREP_RULE_INFO_value, + { "Value", "quake.control.rule_info.value", + FT_STRINGZ, BASE_NONE, NULL, 0x0, + "Rule Value", HFILL }}, + }; static gint *ett[] = { &ett_quake, &ett_quake_control, @@ -620,17 +620,17 @@ proto_register_quake(void) module_t *quake_module; proto_quake = proto_register_protocol("Quake Network Protocol", - "QUAKE", "quake"); + "QUAKE", "quake"); proto_register_field_array(proto_quake, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); /* Register a configuration option for port */ quake_module = prefs_register_protocol(proto_quake, - proto_reg_handoff_quake); + proto_reg_handoff_quake); prefs_register_uint_preference(quake_module, "udp.port", - "Quake Server UDP Port", - "Set the UDP port for the Quake Server", - 10, &gbl_quakeServerPort); + "Quake Server UDP Port", + "Set the UDP port for the Quake Server", + 10, &gbl_quakeServerPort); } @@ -654,4 +654,15 @@ proto_reg_handoff_quake(void) dissector_add_uint("udp.port", gbl_quakeServerPort, quake_handle); } - +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ |