summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ui/CMakeLists.txt1
-rw-r--r--ui/alert_box.c46
-rw-r--r--ui/alert_box.h18
-rw-r--r--ui/capture.c264
-rw-r--r--ui/capture.h23
-rw-r--r--ui/capture_info.h4
-rw-r--r--ui/capture_ui_utils.c140
-rw-r--r--ui/capture_ui_utils.h35
-rw-r--r--ui/cli/simple_dialog.c8
-rw-r--r--ui/cli/tap-camelsrt.c12
-rw-r--r--ui/cli/tap-credentials.c4
-rw-r--r--ui/cli/tap-diameter-avp.c60
-rw-r--r--ui/cli/tap-endpoints.c16
-rw-r--r--ui/cli/tap-expert.c20
-rw-r--r--ui/cli/tap-exportobject.c24
-rw-r--r--ui/cli/tap-exportobject.h2
-rw-r--r--ui/cli/tap-flow.c10
-rw-r--r--ui/cli/tap-follow.c50
-rw-r--r--ui/cli/tap-funnel.c24
-rw-r--r--ui/cli/tap-gsm_astat.c2
-rw-r--r--ui/cli/tap-hosts.c24
-rw-r--r--ui/cli/tap-httpstat.c26
-rw-r--r--ui/cli/tap-icmpstat.c16
-rw-r--r--ui/cli/tap-icmpv6stat.c16
-rw-r--r--ui/cli/tap-iostat.c310
-rw-r--r--ui/cli/tap-iousers.c18
-rw-r--r--ui/cli/tap-macltestat.c187
-rw-r--r--ui/cli/tap-protocolinfo.c2
-rw-r--r--ui/cli/tap-protohierstat.h4
-rw-r--r--ui/cli/tap-rlcltestat.c84
-rw-r--r--ui/cli/tap-rpcprogs.c12
-rw-r--r--ui/cli/tap-rtd.c8
-rw-r--r--ui/cli/tap-rtp.c2
-rw-r--r--ui/cli/tap-rtspstat.c26
-rw-r--r--ui/cli/tap-sctpchunkstat.c18
-rw-r--r--ui/cli/tap-simple_stattable.c6
-rw-r--r--ui/cli/tap-sipstat.c44
-rw-r--r--ui/cli/tap-smbsids.c4
-rw-r--r--ui/cli/tap-srt.c28
-rw-r--r--ui/cli/tap-stats_tree.c6
-rw-r--r--ui/cli/tap-voip.h2
-rw-r--r--ui/cli/tap-wspstat.c40
-rw-r--r--ui/commandline.c111
-rw-r--r--ui/commandline.h28
-rw-r--r--ui/decode_as_utils.c131
-rw-r--r--ui/decode_as_utils.h2
-rw-r--r--ui/dissect_opts.c46
-rw-r--r--ui/dissect_opts.h12
-rw-r--r--ui/export_pdu_ui_utils.c10
-rw-r--r--ui/export_pdu_ui_utils.h2
-rw-r--r--ui/failure_message.c24
-rw-r--r--ui/failure_message.h18
-rw-r--r--ui/file_dialog.c20
-rw-r--r--ui/file_dialog.h8
-rw-r--r--ui/firewall_rules.c115
-rw-r--r--ui/firewall_rules.h6
-rw-r--r--ui/help_url.c20
-rw-r--r--ui/help_url.h25
-rw-r--r--ui/iface_lists.c396
-rw-r--r--ui/iface_lists.h2
-rw-r--r--ui/iface_toolbar.c6
-rw-r--r--ui/iface_toolbar.h33
-rw-r--r--ui/io_graph_item.c72
-rw-r--r--ui/io_graph_item.h287
-rw-r--r--ui/language.c18
-rw-r--r--ui/language.h6
-rw-r--r--ui/logray/CMakeLists.txt934
-rw-r--r--ui/logray/logray_application.cpp13
-rw-r--r--ui/logray/logray_en.ts62
-rw-r--r--ui/logray/logray_main.cpp167
-rw-r--r--ui/logray/logray_main_window.cpp738
-rw-r--r--ui/logray/logray_main_window.h34
-rw-r--r--ui/logray/logray_main_window.ui246
-rw-r--r--ui/logray/logray_main_window_slots.cpp493
-rw-r--r--ui/macosx/cocoa_bridge.h4
-rw-r--r--ui/macosx/cocoa_bridge.mm13
-rw-r--r--ui/main_statusbar.h6
-rw-r--r--ui/mcast_stream.c38
-rw-r--r--ui/mcast_stream.h50
-rw-r--r--ui/packet_list_utils.c56
-rw-r--r--ui/packet_list_utils.h15
-rw-r--r--ui/packet_range.c154
-rw-r--r--ui/packet_range.h75
-rw-r--r--ui/persfilepath_opt.c14
-rw-r--r--ui/persfilepath_opt.h2
-rw-r--r--ui/preference_utils.c60
-rw-r--r--ui/preference_utils.h30
-rw-r--r--ui/profile.c167
-rw-r--r--ui/profile.h27
-rw-r--r--ui/progress_dlg.h22
-rw-r--r--ui/proto_hier_stats.c34
-rw-r--r--ui/proto_hier_stats.h18
-rw-r--r--ui/qt/CMakeLists.txt26
-rw-r--r--ui/qt/about_dialog.cpp102
-rw-r--r--ui/qt/about_dialog.ui2
-rw-r--r--ui/qt/accordion_frame.cpp3
-rw-r--r--ui/qt/address_editor_frame.cpp30
-rw-r--r--ui/qt/bluetooth_att_server_attributes_dialog.cpp81
-rw-r--r--ui/qt/bluetooth_att_server_attributes_dialog.h2
-rw-r--r--ui/qt/bluetooth_att_server_attributes_dialog.ui2
-rw-r--r--ui/qt/bluetooth_device_dialog.cpp10
-rw-r--r--ui/qt/bluetooth_device_dialog.h24
-rw-r--r--ui/qt/bluetooth_devices_dialog.cpp15
-rw-r--r--ui/qt/bluetooth_devices_dialog.h2
-rw-r--r--ui/qt/bluetooth_hci_summary_dialog.cpp13
-rw-r--r--ui/qt/bluetooth_hci_summary_dialog.h2
-rw-r--r--ui/qt/byte_view_tab.cpp2
-rw-r--r--ui/qt/capture_comment_dialog.cpp252
-rw-r--r--ui/qt/capture_comment_dialog.h42
-rw-r--r--ui/qt/capture_comment_dialog.ui33
-rw-r--r--ui/qt/capture_event.h1
-rw-r--r--ui/qt/capture_file.cpp12
-rw-r--r--ui/qt/capture_file.h10
-rw-r--r--ui/qt/capture_file_dialog.cpp209
-rw-r--r--ui/qt/capture_file_dialog.h42
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp241
-rw-r--r--ui/qt/capture_file_properties_dialog.h4
-rw-r--r--ui/qt/capture_file_properties_dialog.ui73
-rw-r--r--ui/qt/capture_filter_syntax_worker.cpp14
-rw-r--r--ui/qt/capture_info_dialog.cpp4
-rw-r--r--ui/qt/capture_options_dialog.cpp194
-rw-r--r--ui/qt/capture_options_dialog.h3
-rw-r--r--ui/qt/capture_options_dialog.ui71
-rw-r--r--ui/qt/capture_preferences_frame.cpp11
-rw-r--r--ui/qt/capture_preferences_frame.h2
-rw-r--r--ui/qt/capture_preferences_frame.ui10
-rw-r--r--ui/qt/coloring_rules_dialog.cpp6
-rw-r--r--ui/qt/column_editor_frame.cpp57
-rw-r--r--ui/qt/column_editor_frame.h1
-rw-r--r--ui/qt/column_editor_frame.ui10
-rw-r--r--ui/qt/column_preferences_frame.cpp2
-rw-r--r--ui/qt/compiled_filter_output.cpp31
-rw-r--r--ui/qt/compiled_filter_output.h14
-rw-r--r--ui/qt/conversation_colorize_action.cpp2
-rw-r--r--ui/qt/conversation_dialog.cpp18
-rw-r--r--ui/qt/conversation_dialog.h2
-rw-r--r--ui/qt/conversation_hash_tables_dialog.cpp18
-rw-r--r--ui/qt/decode_as_dialog.cpp6
-rw-r--r--ui/qt/decode_as_dialog.h2
-rw-r--r--ui/qt/display_filter_expression_dialog.cpp4
-rw-r--r--ui/qt/endpoint_dialog.cpp25
-rw-r--r--ui/qt/expert_info_dialog.h2
-rw-r--r--ui/qt/export_dissection_dialog.cpp131
-rw-r--r--ui/qt/export_dissection_dialog.h15
-rw-r--r--ui/qt/export_object_action.cpp1
-rw-r--r--ui/qt/export_object_action.h1
-rw-r--r--ui/qt/export_pdu_dialog.cpp11
-rw-r--r--ui/qt/export_pdu_dialog.h1
-rw-r--r--ui/qt/export_pdu_dialog.ui22
-rw-r--r--ui/qt/extcap_argument.cpp49
-rw-r--r--ui/qt/extcap_argument.h1
-rw-r--r--ui/qt/extcap_argument_multiselect.cpp2
-rw-r--r--ui/qt/extcap_options_dialog.cpp91
-rw-r--r--ui/qt/extcap_options_dialog.h5
-rw-r--r--ui/qt/extcap_options_dialog.ui2
-rw-r--r--ui/qt/file_set_dialog.cpp2
-rw-r--r--ui/qt/file_set_dialog.h2
-rw-r--r--ui/qt/filter_action.cpp24
-rw-r--r--ui/qt/filter_dialog.cpp144
-rw-r--r--ui/qt/filter_dialog.h8
-rw-r--r--ui/qt/filter_expression_frame.cpp2
-rw-r--r--ui/qt/firewall_rules_dialog.cpp6
-rw-r--r--ui/qt/firewall_rules_dialog.h8
-rw-r--r--ui/qt/follow_stream_action.cpp1
-rw-r--r--ui/qt/follow_stream_action.h1
-rw-r--r--ui/qt/follow_stream_dialog.cpp620
-rw-r--r--ui/qt/follow_stream_dialog.h48
-rw-r--r--ui/qt/follow_stream_dialog.ui47
-rw-r--r--ui/qt/font_color_preferences_frame.cpp5
-rw-r--r--ui/qt/funnel_statistics.cpp72
-rw-r--r--ui/qt/funnel_statistics.h14
-rw-r--r--ui/qt/funnel_string_dialog.cpp2
-rw-r--r--ui/qt/funnel_string_dialog.h2
-rw-r--r--ui/qt/funnel_text_dialog.cpp22
-rw-r--r--ui/qt/funnel_text_dialog.h6
-rw-r--r--ui/qt/geometry_state_dialog.cpp85
-rw-r--r--ui/qt/geometry_state_dialog.h34
-rw-r--r--ui/qt/glib_mainloop_on_qeventloop.cpp4
-rw-r--r--ui/qt/glib_mainloop_on_qeventloop.h5
-rw-r--r--ui/qt/gsm_map_summary_dialog.cpp2
-rw-r--r--ui/qt/iax2_analysis_dialog.cpp66
-rw-r--r--ui/qt/iax2_analysis_dialog.h7
-rw-r--r--ui/qt/import_text_dialog.cpp59
-rw-r--r--ui/qt/import_text_dialog.h4
-rw-r--r--ui/qt/interface_frame.cpp32
-rw-r--r--ui/qt/interface_frame.h5
-rw-r--r--ui/qt/interface_toolbar.cpp16
-rw-r--r--ui/qt/interface_toolbar.h2
-rw-r--r--ui/qt/interface_toolbar_reader.cpp4
-rw-r--r--ui/qt/io_console_dialog.cpp1
-rw-r--r--ui/qt/io_graph_action.cpp134
-rw-r--r--ui/qt/io_graph_action.h47
-rw-r--r--ui/qt/io_graph_dialog.cpp1454
-rw-r--r--ui/qt/io_graph_dialog.h102
-rw-r--r--ui/qt/io_graph_dialog.ui54
-rw-r--r--ui/qt/layout_preferences_frame.cpp12
-rw-r--r--ui/qt/lbm_lbtrm_transport_dialog.cpp116
-rw-r--r--ui/qt/lbm_lbtrm_transport_dialog.h2
-rw-r--r--ui/qt/lbm_lbtru_transport_dialog.cpp173
-rw-r--r--ui/qt/lbm_lbtru_transport_dialog.h2
-rw-r--r--ui/qt/lbm_stream_dialog.cpp62
-rw-r--r--ui/qt/lbm_stream_dialog.h2
-rw-r--r--ui/qt/lte_mac_statistics_dialog.cpp140
-rw-r--r--ui/qt/lte_mac_statistics_dialog.h34
-rw-r--r--ui/qt/lte_rlc_graph_dialog.cpp101
-rw-r--r--ui/qt/lte_rlc_graph_dialog.h13
-rw-r--r--ui/qt/lte_rlc_statistics_dialog.cpp292
-rw-r--r--ui/qt/lte_rlc_statistics_dialog.h12
-rw-r--r--ui/qt/main.cpp178
-rw-r--r--ui/qt/main_application.cpp152
-rw-r--r--ui/qt/main_application.h32
-rw-r--r--ui/qt/main_status_bar.cpp131
-rw-r--r--ui/qt/main_status_bar.h2
-rw-r--r--ui/qt/main_window.cpp88
-rw-r--r--ui/qt/main_window.h24
-rw-r--r--ui/qt/main_window_layout.cpp116
-rw-r--r--ui/qt/main_window_preferences_frame.cpp22
-rw-r--r--ui/qt/main_window_preferences_frame.h1
-rw-r--r--ui/qt/main_window_preferences_frame.ui10
-rw-r--r--ui/qt/manage_interfaces_dialog.cpp180
-rw-r--r--ui/qt/manage_interfaces_dialog.h5
-rw-r--r--ui/qt/manager/wireshark_preference.cpp2
-rw-r--r--ui/qt/manuf_dialog.cpp4
-rw-r--r--ui/qt/models/astringlist_list_model.cpp1
-rw-r--r--ui/qt/models/astringlist_list_model.h1
-rw-r--r--ui/qt/models/atap_data_model.cpp49
-rw-r--r--ui/qt/models/atap_data_model.h8
-rw-r--r--ui/qt/models/coloring_rules_delegate.cpp2
-rw-r--r--ui/qt/models/coloring_rules_model.cpp10
-rw-r--r--ui/qt/models/coloring_rules_model.h1
-rw-r--r--ui/qt/models/column_list_model.cpp103
-rw-r--r--ui/qt/models/column_list_model.h6
-rw-r--r--ui/qt/models/decode_as_delegate.cpp16
-rw-r--r--ui/qt/models/decode_as_delegate.h9
-rw-r--r--ui/qt/models/decode_as_model.cpp71
-rw-r--r--ui/qt/models/decode_as_model.h44
-rw-r--r--ui/qt/models/dissector_tables_model.cpp15
-rw-r--r--ui/qt/models/enabled_protocols_model.cpp7
-rw-r--r--ui/qt/models/enabled_protocols_model.h2
-rw-r--r--ui/qt/models/expert_info_model.cpp6
-rw-r--r--ui/qt/models/export_objects_model.cpp2
-rw-r--r--ui/qt/models/fileset_entry_model.cpp7
-rw-r--r--ui/qt/models/fileset_entry_model.h2
-rw-r--r--ui/qt/models/filter_list_model.cpp49
-rw-r--r--ui/qt/models/filter_list_model.h3
-rw-r--r--ui/qt/models/info_proxy_model.cpp1
-rw-r--r--ui/qt/models/interface_sort_filter_model.cpp39
-rw-r--r--ui/qt/models/interface_sort_filter_model.h2
-rw-r--r--ui/qt/models/interface_tree_cache_model.cpp45
-rw-r--r--ui/qt/models/interface_tree_cache_model.h8
-rw-r--r--ui/qt/models/interface_tree_model.cpp22
-rw-r--r--ui/qt/models/interface_tree_model.h26
-rw-r--r--ui/qt/models/packet_list_model.cpp87
-rw-r--r--ui/qt/models/packet_list_model.h19
-rw-r--r--ui/qt/models/packet_list_record.cpp17
-rw-r--r--ui/qt/models/packet_list_record.h4
-rw-r--r--ui/qt/models/pref_delegate.cpp4
-rw-r--r--ui/qt/models/pref_models.cpp103
-rw-r--r--ui/qt/models/pref_models.h60
-rw-r--r--ui/qt/models/profile_model.cpp99
-rw-r--r--ui/qt/models/profile_model.h10
-rw-r--r--ui/qt/models/proto_tree_model.cpp8
-rw-r--r--ui/qt/models/proto_tree_model.h4
-rw-r--r--ui/qt/models/related_packet_delegate.cpp4
-rw-r--r--ui/qt/models/related_packet_delegate.h4
-rw-r--r--ui/qt/models/resolved_addresses_models.cpp66
-rw-r--r--ui/qt/models/resolved_addresses_models.h7
-rw-r--r--ui/qt/models/sparkline_delegate.cpp2
-rw-r--r--ui/qt/models/uat_delegate.h1
-rw-r--r--ui/qt/models/uat_model.cpp175
-rw-r--r--ui/qt/models/uat_model.h14
-rw-r--r--ui/qt/models/voip_calls_info_model.cpp8
-rw-r--r--ui/qt/models/voip_calls_info_model.h1
-rw-r--r--ui/qt/module_preferences_scroll_area.cpp69
-rw-r--r--ui/qt/module_preferences_scroll_area.h2
-rw-r--r--ui/qt/mtp3_summary_dialog.cpp2
-rw-r--r--ui/qt/multicast_statistics_dialog.cpp8
-rw-r--r--ui/qt/packet_comment_dialog.h2
-rw-r--r--ui/qt/packet_diagram.cpp19
-rw-r--r--ui/qt/packet_dialog.cpp74
-rw-r--r--ui/qt/packet_dialog.h2
-rw-r--r--ui/qt/packet_dialog.ui31
-rw-r--r--ui/qt/packet_list.cpp213
-rw-r--r--ui/qt/packet_list.h13
-rw-r--r--ui/qt/packet_range_group_box.cpp8
-rw-r--r--ui/qt/packet_range_group_box.h2
-rw-r--r--ui/qt/preference_editor_frame.cpp38
-rw-r--r--ui/qt/preference_editor_frame.ui8
-rw-r--r--ui/qt/preferences_dialog.cpp77
-rw-r--r--ui/qt/preferences_dialog.h6
-rw-r--r--ui/qt/preferences_dialog.ui36
-rw-r--r--ui/qt/print_dialog.cpp48
-rw-r--r--ui/qt/print_dialog.h6
-rw-r--r--ui/qt/profile_dialog.cpp82
-rw-r--r--ui/qt/profile_dialog.h20
-rw-r--r--ui/qt/profile_dialog.ui40
-rw-r--r--ui/qt/progress_frame.cpp36
-rw-r--r--ui/qt/progress_frame.h12
-rw-r--r--ui/qt/proto_tree.cpp38
-rw-r--r--ui/qt/proto_tree.h2
-rw-r--r--ui/qt/protocol_hierarchy_dialog.cpp2
-rw-r--r--ui/qt/protocol_hierarchy_dialog.h2
-rw-r--r--ui/qt/protocol_preferences_menu.cpp10
-rw-r--r--ui/qt/remote_capture_dialog.cpp64
-rw-r--r--ui/qt/remote_capture_dialog.h2
-rw-r--r--ui/qt/resolved_addresses_dialog.cpp62
-rw-r--r--ui/qt/resolved_addresses_dialog.h8
-rw-r--r--ui/qt/resolved_addresses_dialog.ui29
-rw-r--r--ui/qt/response_time_delay_dialog.cpp2
-rw-r--r--ui/qt/rpc_service_response_time_dialog.cpp26
-rw-r--r--ui/qt/rpc_service_response_time_dialog.h8
-rw-r--r--ui/qt/rsa_keys_frame.cpp8
-rw-r--r--ui/qt/rsa_keys_frame.h2
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp24
-rw-r--r--ui/qt/rtp_analysis_dialog.h4
-rw-r--r--ui/qt/rtp_audio_stream.cpp32
-rw-r--r--ui/qt/rtp_audio_stream.h8
-rw-r--r--ui/qt/rtp_player_dialog.cpp69
-rw-r--r--ui/qt/rtp_player_dialog.h7
-rw-r--r--ui/qt/rtp_stream_dialog.cpp15
-rw-r--r--ui/qt/sctp_all_assocs_dialog.cpp42
-rw-r--r--ui/qt/sctp_all_assocs_dialog.h4
-rw-r--r--ui/qt/sctp_assoc_analyse_dialog.cpp8
-rw-r--r--ui/qt/sctp_assoc_analyse_dialog.h6
-rw-r--r--ui/qt/sctp_chunk_statistics_dialog.cpp12
-rw-r--r--ui/qt/sctp_chunk_statistics_dialog.h3
-rw-r--r--ui/qt/sctp_graph_arwnd_dialog.cpp6
-rw-r--r--ui/qt/sctp_graph_arwnd_dialog.h7
-rw-r--r--ui/qt/sctp_graph_byte_dialog.cpp10
-rw-r--r--ui/qt/sctp_graph_byte_dialog.h5
-rw-r--r--ui/qt/sctp_graph_dialog.cpp26
-rw-r--r--ui/qt/sctp_graph_dialog.h61
-rw-r--r--ui/qt/search_frame.cpp88
-rw-r--r--ui/qt/search_frame.h2
-rw-r--r--ui/qt/search_frame.ui156
-rw-r--r--ui/qt/sequence_diagram.cpp43
-rw-r--r--ui/qt/sequence_diagram.h6
-rw-r--r--ui/qt/sequence_dialog.cpp228
-rw-r--r--ui/qt/sequence_dialog.h14
-rw-r--r--ui/qt/sequence_dialog.ui10
-rw-r--r--ui/qt/service_response_time_dialog.cpp10
-rw-r--r--ui/qt/show_packet_bytes_dialog.cpp94
-rw-r--r--ui/qt/show_packet_bytes_dialog.h9
-rw-r--r--ui/qt/show_packet_bytes_dialog.ui7
-rw-r--r--ui/qt/simple_dialog.cpp12
-rw-r--r--ui/qt/simple_dialog.h2
-rw-r--r--ui/qt/simple_statistics_dialog.cpp6
-rw-r--r--ui/qt/stats_tree_dialog.cpp16
-rw-r--r--ui/qt/stats_tree_dialog.h2
-rw-r--r--ui/qt/strip_headers_dialog.cpp11
-rw-r--r--ui/qt/strip_headers_dialog.h1
-rw-r--r--ui/qt/strip_headers_dialog.ui22
-rw-r--r--ui/qt/supported_protocols_dialog.cpp2
-rw-r--r--ui/qt/tap_parameter_dialog.cpp15
-rw-r--r--ui/qt/tap_parameter_dialog.h2
-rw-r--r--ui/qt/tcp_stream_dialog.cpp154
-rw-r--r--ui/qt/tcp_stream_dialog.h7
-rw-r--r--ui/qt/time_shift_dialog.cpp10
-rw-r--r--ui/qt/time_shift_dialog.h2
-rw-r--r--ui/qt/uat_dialog.cpp126
-rw-r--r--ui/qt/uat_dialog.h4
-rw-r--r--ui/qt/uat_dialog.ui14
-rw-r--r--ui/qt/uat_frame.cpp127
-rw-r--r--ui/qt/uat_frame.h3
-rw-r--r--ui/qt/uat_frame.ui14
-rw-r--r--ui/qt/utils/color_utils.cpp19
-rw-r--r--ui/qt/utils/color_utils.h10
-rw-r--r--ui/qt/utils/data_printer.cpp54
-rw-r--r--ui/qt/utils/data_printer.h5
-rw-r--r--ui/qt/utils/frame_information.cpp4
-rw-r--r--ui/qt/utils/profile_switcher.cpp140
-rw-r--r--ui/qt/utils/profile_switcher.h48
-rw-r--r--ui/qt/utils/proto_node.cpp4
-rw-r--r--ui/qt/utils/qt_ui_utils.cpp116
-rw-r--r--ui/qt/utils/qt_ui_utils.h12
-rw-r--r--ui/qt/utils/rtp_audio_file.cpp16
-rw-r--r--ui/qt/utils/rtp_audio_file.h10
-rw-r--r--ui/qt/utils/rtp_audio_routing_filter.cpp2
-rw-r--r--ui/qt/utils/wireshark_zip_helper.cpp9
-rw-r--r--ui/qt/utils/wireshark_zip_helper.h6
-rw-r--r--ui/qt/voip_calls_dialog.cpp20
-rw-r--r--ui/qt/voip_calls_dialog.h3
-rw-r--r--ui/qt/welcome_page.cpp125
-rw-r--r--ui/qt/welcome_page.h2
-rw-r--r--ui/qt/welcome_page.ui3
-rw-r--r--ui/qt/widgets/additional_toolbar.cpp24
-rw-r--r--ui/qt/widgets/byte_view_text.cpp5
-rw-r--r--ui/qt/widgets/capture_filter_combo.cpp2
-rw-r--r--ui/qt/widgets/capture_filter_edit.cpp4
-rw-r--r--ui/qt/widgets/compression_group_box.cpp69
-rw-r--r--ui/qt/widgets/compression_group_box.h41
-rw-r--r--ui/qt/widgets/copy_from_profile_button.h1
-rw-r--r--ui/qt/widgets/display_filter_combo.cpp89
-rw-r--r--ui/qt/widgets/display_filter_combo.h7
-rw-r--r--ui/qt/widgets/display_filter_edit.cpp73
-rw-r--r--ui/qt/widgets/dissector_syntax_line_edit.cpp15
-rw-r--r--ui/qt/widgets/dissector_syntax_line_edit.h7
-rw-r--r--ui/qt/widgets/field_filter_edit.cpp6
-rw-r--r--ui/qt/widgets/filter_expression_toolbar.cpp34
-rw-r--r--ui/qt/widgets/filter_expression_toolbar.h2
-rw-r--r--ui/qt/widgets/follow_stream_text.cpp118
-rw-r--r--ui/qt/widgets/follow_stream_text.h18
-rw-r--r--ui/qt/widgets/label_stack.cpp4
-rw-r--r--ui/qt/widgets/label_stack.h3
-rw-r--r--ui/qt/widgets/path_selection_edit.cpp12
-rw-r--r--ui/qt/widgets/profile_tree_view.cpp63
-rw-r--r--ui/qt/widgets/profile_tree_view.h13
-rw-r--r--ui/qt/widgets/qcp_axis_ticker_elided.cpp74
-rw-r--r--ui/qt/widgets/qcp_axis_ticker_elided.h38
-rw-r--r--ui/qt/widgets/qcp_axis_ticker_si.cpp74
-rw-r--r--ui/qt/widgets/qcp_axis_ticker_si.h42
-rw-r--r--ui/qt/widgets/qcp_string_legend_item.cpp46
-rw-r--r--ui/qt/widgets/qcp_string_legend_item.h35
-rw-r--r--ui/qt/widgets/resize_header_view.cpp45
-rw-r--r--ui/qt/widgets/resize_header_view.h31
-rw-r--r--ui/qt/widgets/resolved_addresses_view.cpp261
-rw-r--r--ui/qt/widgets/resolved_addresses_view.h50
-rw-r--r--ui/qt/widgets/rowmove_tree_view.cpp98
-rw-r--r--ui/qt/widgets/rowmove_tree_view.h35
-rw-r--r--ui/qt/widgets/rtp_audio_graph.cpp2
-rw-r--r--ui/qt/widgets/splash_overlay.h2
-rw-r--r--ui/qt/widgets/syntax_line_edit.cpp30
-rw-r--r--ui/qt/widgets/traffic_tab.cpp77
-rw-r--r--ui/qt/widgets/traffic_tab.h14
-rw-r--r--ui/qt/widgets/traffic_tree.cpp56
-rw-r--r--ui/qt/widgets/traffic_tree.h2
-rw-r--r--ui/qt/widgets/traffic_types_list.cpp42
-rw-r--r--ui/qt/widgets/traffic_types_list.h4
-rw-r--r--ui/qt/widgets/wireless_timeline.cpp78
-rw-r--r--ui/qt/widgets/wireless_timeline.h14
-rw-r--r--ui/qt/widgets/wireshark_file_dialog.cpp15
-rw-r--r--ui/qt/widgets/wireshark_file_dialog.h9
-rw-r--r--ui/qt/wireless_frame.cpp23
-rw-r--r--ui/qt/wireshark_application.cpp2
-rw-r--r--ui/qt/wireshark_de.ts927
-rw-r--r--ui/qt/wireshark_dialog.cpp4
-rw-r--r--ui/qt/wireshark_dialog.h21
-rw-r--r--ui/qt/wireshark_en.ts817
-rw-r--r--ui/qt/wireshark_es.ts955
-rw-r--r--ui/qt/wireshark_fr.ts969
-rw-r--r--ui/qt/wireshark_it.ts943
-rw-r--r--ui/qt/wireshark_ja_JP.ts903
-rw-r--r--ui/qt/wireshark_ko.ts915
-rw-r--r--ui/qt/wireshark_main_window.cpp664
-rw-r--r--ui/qt/wireshark_main_window.h28
-rw-r--r--ui/qt/wireshark_main_window.ui55
-rw-r--r--ui/qt/wireshark_main_window_slots.cpp478
-rw-r--r--ui/qt/wireshark_pl.ts1303
-rw-r--r--ui/qt/wireshark_ru.ts1340
-rw-r--r--ui/qt/wireshark_sv.ts997
-rw-r--r--ui/qt/wireshark_tr_TR.ts925
-rw-r--r--ui/qt/wireshark_uk.ts969
-rw-r--r--ui/qt/wireshark_zh_CN.ts893
-rw-r--r--ui/qt/wlan_statistics_dialog.cpp6
-rw-r--r--ui/recent.c773
-rw-r--r--ui/recent.h146
-rw-r--r--ui/recent_utils.h15
-rw-r--r--ui/rtp_media.c10
-rw-r--r--ui/rtp_media.h14
-rw-r--r--ui/rtp_stream.c22
-rw-r--r--ui/rtp_stream.h34
-rw-r--r--ui/rtp_stream_id.c34
-rw-r--r--ui/rtp_stream_id.h20
-rw-r--r--ui/simple_dialog.h14
-rw-r--r--ui/software_update.c2
-rw-r--r--ui/ssl_key_export.c38
-rw-r--r--ui/ssl_key_export.h2
-rw-r--r--ui/summary.c14
-rw-r--r--ui/summary.h38
-rw-r--r--ui/tap-credentials.h12
-rw-r--r--ui/tap-iax2-analysis.c2
-rw-r--r--ui/tap-iax2-analysis.h34
-rw-r--r--ui/tap-rlc-graph.c92
-rw-r--r--ui/tap-rlc-graph.h65
-rw-r--r--ui/tap-rtp-analysis.c120
-rw-r--r--ui/tap-rtp-analysis.h41
-rw-r--r--ui/tap-rtp-common.c69
-rw-r--r--ui/tap-rtp-common.h46
-rw-r--r--ui/tap-sctp-analysis.c344
-rw-r--r--ui/tap-sctp-analysis.h172
-rw-r--r--ui/tap-tcp-stream.c71
-rw-r--r--ui/tap-tcp-stream.h52
-rw-r--r--ui/tap_export_pdu.c34
-rw-r--r--ui/tap_export_pdu.h10
-rw-r--r--ui/taps.h4
-rw-r--r--ui/text_import.c410
-rw-r--r--ui/text_import.h34
-rw-r--r--ui/text_import_regex.c10
-rw-r--r--ui/text_import_regex.h8
-rw-r--r--ui/time_shift.c52
-rw-r--r--ui/time_shift.h10
-rw-r--r--ui/urls.h2
-rw-r--r--ui/util.c68
-rw-r--r--ui/util.h10
-rw-r--r--ui/voip_calls.c262
-rw-r--r--ui/voip_calls.h100
-rw-r--r--ui/win32/file_dlg_win32.cpp1835
-rw-r--r--ui/win32/file_dlg_win32.h145
-rw-r--r--ui/ws_ui_util.h21
499 files changed, 25432 insertions, 14002 deletions
diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt
index c1f7e56c..ac2f35bd 100644
--- a/ui/CMakeLists.txt
+++ b/ui/CMakeLists.txt
@@ -78,6 +78,7 @@ target_link_libraries(ui
PRIVATE
wsutil
wiretap
+ ${M_LIBRARIES}
)
target_include_directories(ui
diff --git a/ui/alert_box.c b/ui/alert_box.c
index b96f5a12..c62ae978 100644
--- a/ui/alert_box.c
+++ b/ui/alert_box.c
@@ -58,9 +58,9 @@ vwarning_alert_box(const char *msg_format, va_list ap)
* typical Wireshark user is, but....
*/
void
-cfile_open_failure_alert_box(const char *filename, int err, gchar *err_info)
+cfile_open_failure_alert_box(const char *filename, int err, char *err_info)
{
- gchar *display_basename;
+ char *display_basename;
if (err < 0) {
/* Wiretap error. */
@@ -157,7 +157,7 @@ cfile_open_failure_alert_box(const char *filename, int err, gchar *err_info)
g_free(display_basename);
} else {
/* OS error. */
- open_failure_alert_box(filename, err, FALSE);
+ open_failure_alert_box(filename, err, false);
}
}
@@ -177,9 +177,9 @@ cfile_open_failure_alert_box(const char *filename, int err, gchar *err_info)
*/
void
cfile_dump_open_failure_alert_box(const char *filename, int err,
- gchar *err_info, int file_type_subtype)
+ char *err_info, int file_type_subtype)
{
- gchar *display_basename;
+ char *display_basename;
if (err < 0) {
/* Wiretap error. */
@@ -249,7 +249,7 @@ cfile_dump_open_failure_alert_box(const char *filename, int err,
g_free(display_basename);
} else {
/* OS error. */
- open_failure_alert_box(filename, err, TRUE);
+ open_failure_alert_box(filename, err, true);
}
}
@@ -260,14 +260,14 @@ cfile_dump_open_failure_alert_box(const char *filename, int err,
* some WTAP_ERR_ values.
*/
void
-cfile_read_failure_alert_box(const char *filename, int err, gchar *err_info)
+cfile_read_failure_alert_box(const char *filename, int err, char *err_info)
{
- gchar *display_name;
+ char *display_name;
if (filename == NULL)
display_name = g_strdup("capture file");
else {
- gchar *display_basename;
+ char *display_basename;
display_basename = g_filename_display_basename(filename);
display_name = ws_strdup_printf("capture file \"%s\"", display_basename);
@@ -349,7 +349,7 @@ cfile_read_failure_alert_box(const char *filename, int err, gchar *err_info)
*/
void
cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
- int err, gchar *err_info, guint32 framenum,
+ int err, char *err_info, uint64_t framenum,
int file_type_subtype)
{
char *in_file_string;
@@ -371,7 +371,7 @@ cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
* the frame number and file type/subtype.
*/
simple_error_message_box(
- "Frame %u%s has a network type that can't be saved in a \"%s\" file.",
+ "Frame %" PRIu64 "%s has a network type that can't be saved in a \"%s\" file.",
framenum, in_file_string,
wtap_file_type_subtype_description(file_type_subtype));
break;
@@ -383,7 +383,7 @@ cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
* the frame number and file type/subtype.
*/
simple_error_message_box(
- "Frame %u%s has a network type that differs from the network type of earlier packets, which isn't supported in a \"%s\" file.",
+ "Frame %" PRIu64 "%s has a network type that differs from the network type of earlier packets, which isn't supported in a \"%s\" file.",
framenum, in_file_string,
wtap_file_type_subtype_description(file_type_subtype));
break;
@@ -405,7 +405,7 @@ cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
* the frame number and file type/subtype.
*/
simple_error_message_box(
- "Frame %u%s is larger than Wireshark supports in a \"%s\" file.",
+ "Frame %" PRIu64 "%s is larger than Wireshark supports in a \"%s\" file.",
framenum, in_file_string,
wtap_file_type_subtype_description(file_type_subtype));
break;
@@ -417,7 +417,7 @@ cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
* the record number and file type/subtype.
*/
simple_error_message_box(
- "Record %u%s has a record type that can't be saved in a \"%s\" file.",
+ "Record %" PRIu64 "%s has a record type that can't be saved in a \"%s\" file.",
framenum, in_file_string,
wtap_file_type_subtype_description(file_type_subtype));
break;
@@ -429,7 +429,7 @@ cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
* the record number and file type/subtype.
*/
simple_error_message_box(
- "Record %u%s has data that can't be saved in a \"%s\" file.\n"
+ "Record %" PRIu64 "%s has data that can't be saved in a \"%s\" file.\n"
"(%s)",
framenum, in_file_string,
wtap_file_type_subtype_description(file_type_subtype),
@@ -491,9 +491,9 @@ cfile_write_failure_alert_box(const char *in_filename, const char *out_filename,
* typical Wireshark user is, but....
*/
void
-cfile_close_failure_alert_box(const char *filename, int err, gchar *err_info)
+cfile_close_failure_alert_box(const char *filename, int err, char *err_info)
{
- gchar *display_basename;
+ char *display_basename;
if (err < 0) {
/* Wiretap error. */
@@ -537,8 +537,8 @@ cfile_close_failure_alert_box(const char *filename, int err, gchar *err_info)
/*
* Alert box for a failed attempt to open or create a file.
- * "err" is assumed to be a UNIX-style errno; "for_writing" is TRUE if
- * the file is being opened for writing and FALSE if it's being opened
+ * "err" is assumed to be a UNIX-style errno; "for_writing" is true if
+ * the file is being opened for writing and false if it's being opened
* for reading.
*
* XXX - add explanatory secondary text for at least some of the errors;
@@ -548,9 +548,9 @@ cfile_close_failure_alert_box(const char *filename, int err, gchar *err_info)
* typical Wireshark user is, but....
*/
void
-open_failure_alert_box(const char *filename, int err, gboolean for_writing)
+open_failure_alert_box(const char *filename, int err, bool for_writing)
{
- gchar *display_basename;
+ char *display_basename;
display_basename = g_filename_display_basename(filename);
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
@@ -566,7 +566,7 @@ open_failure_alert_box(const char *filename, int err, gboolean for_writing)
void
read_failure_alert_box(const char *filename, int err)
{
- gchar *display_basename;
+ char *display_basename;
display_basename = g_filename_display_basename(filename);
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
@@ -588,7 +588,7 @@ read_failure_alert_box(const char *filename, int err)
void
write_failure_alert_box(const char *filename, int err)
{
- gchar *display_basename;
+ char *display_basename;
display_basename = g_filename_display_basename(filename);
simple_message_box(ESD_TYPE_ERROR, NULL, NULL,
diff --git a/ui/alert_box.h b/ui/alert_box.h
index c1660ed0..ad61effc 100644
--- a/ui/alert_box.h
+++ b/ui/alert_box.h
@@ -35,7 +35,7 @@ extern void vwarning_alert_box(const char *msg_format, va_list ap);
* to be a string giving further information for some WTAP_ERR_ values..
*/
extern void cfile_open_failure_alert_box(const char *filename, int err,
- gchar *err_info);
+ char *err_info);
/*
* Alert box for a failed attempt to open a capture file for writing.
@@ -46,7 +46,7 @@ extern void cfile_open_failure_alert_box(const char *filename, int err,
* and subtype of file being opened.
*/
extern void cfile_dump_open_failure_alert_box(const char *filename, int err,
- gchar *err_info,
+ char *err_info,
int file_type_subtype);
/*
@@ -56,7 +56,7 @@ extern void cfile_dump_open_failure_alert_box(const char *filename, int err,
* some WTAP_ERR_ values.
*/
extern void cfile_read_failure_alert_box(const char *filename, int err,
- gchar *err_info);
+ char *err_info);
/*
* Alert box for a failed attempt to write to a capture file.
@@ -71,8 +71,8 @@ extern void cfile_read_failure_alert_box(const char *filename, int err,
*/
extern void cfile_write_failure_alert_box(const char *in_filename,
const char *out_filename,
- int err, gchar *err_info,
- guint32 framenum,
+ int err, char *err_info,
+ uint64_t framenum,
int file_type_subtype);
/*
@@ -100,16 +100,16 @@ extern void cfile_write_failure_alert_box(const char *in_filename,
* so we have to check for write errors here.
*/
extern void cfile_close_failure_alert_box(const char *filename, int err,
- gchar *err_info);
+ char *err_info);
/*
* Alert box for a failed attempt to open or create a file.
- * "err" is assumed to be a UNIX-style errno; "for_writing" is TRUE if
- * the file is being opened for writing and FALSE if it's being opened
+ * "err" is assumed to be a UNIX-style errno; "for_writing" is true if
+ * the file is being opened for writing and false if it's being opened
* for reading.
*/
extern void open_failure_alert_box(const char *filename, int err,
- gboolean for_writing);
+ bool for_writing);
/*
* Alert box for a failed attempt to read a file.
diff --git a/ui/capture.c b/ui/capture.c
index 62c8df7e..3f81da2b 100644
--- a/ui/capture.c
+++ b/ui/capture.c
@@ -19,6 +19,8 @@
#include <glib.h>
+#include <ws_exit_codes.h>
+
#include <epan/packet.h>
#include <epan/dfilter/dfilter.h>
#include "extcap.h"
@@ -28,6 +30,7 @@
#include <capture/capture_sync.h>
#include "ui/capture_info.h"
#include "ui/capture_ui_utils.h"
+#include "ui/iface_lists.h"
#include "ui/util.h"
#include "ui/urls.h"
#include "capture/capture-pcap-util.h"
@@ -59,10 +62,10 @@ struct if_stat_cache_s {
/* this callback mechanism should possibly be replaced by the g_signal_...() stuff (if I only would know how :-) */
typedef struct {
capture_callback_t cb_fct;
- gpointer user_data;
+ void *user_data;
} capture_callback_data_t;
-static GList *capture_callbacks = NULL;
+static GList *capture_callbacks;
static void
capture_callback_invoke(int event, capture_session *cap_session)
@@ -82,7 +85,7 @@ capture_callback_invoke(int event, capture_session *cap_session)
void
-capture_callback_add(capture_callback_t func, gpointer user_data)
+capture_callback_add(capture_callback_t func, void *user_data)
{
capture_callback_data_t *cb;
@@ -94,7 +97,7 @@ capture_callback_add(capture_callback_t func, gpointer user_data)
}
void
-capture_callback_remove(capture_callback_t func, gpointer user_data)
+capture_callback_remove(capture_callback_t func, void *user_data)
{
capture_callback_data_t *cb;
GList *cb_item = capture_callbacks;
@@ -115,9 +118,9 @@ capture_callback_remove(capture_callback_t func, gpointer user_data)
/**
* Start a capture.
*
- * @return TRUE if the capture starts successfully, FALSE otherwise.
+ * @return true if the capture starts successfully, false otherwise.
*/
-gboolean
+bool
capture_start(capture_options *capture_opts, GPtrArray *capture_comments,
capture_session *cap_session, info_data_t* cap_data,
void(*update_cb)(void))
@@ -141,7 +144,7 @@ capture_start(capture_options *capture_opts, GPtrArray *capture_comments,
ws_message("Capture Start failed.");
cap_session->state = CAPTURE_STOPPED;
- return FALSE;
+ return false;
}
// Do we need data structures for ignoring duplicate frames?
@@ -179,7 +182,7 @@ capture_start(capture_options *capture_opts, GPtrArray *capture_comments,
capture_info_ui_create(&cap_data->ui, cap_session);
}
- return TRUE;
+ return true;
}
@@ -192,7 +195,7 @@ capture_stop(capture_session *cap_session)
if (!extcap_session_stop(cap_session)) {
extcap_request_stop(cap_session);
- cap_session->capture_opts->stop_after_extcaps = TRUE;
+ cap_session->capture_opts->stop_after_extcaps = true;
} else {
/* stop the capture child gracefully */
sync_pipe_stop(cap_session);
@@ -210,9 +213,9 @@ capture_kill_child(capture_session *cap_session)
}
/* We've succeeded in doing a (non real-time) capture; try to read it into a new capture file */
-static gboolean
-capture_input_read_all(capture_session *cap_session, gboolean is_tempfile,
- gboolean drops_known, guint32 drops)
+static bool
+capture_input_read_all(capture_session *cap_session, bool is_tempfile,
+ bool drops_known, uint32_t drops)
{
capture_options *capture_opts = cap_session->capture_opts;
int err;
@@ -220,7 +223,7 @@ capture_input_read_all(capture_session *cap_session, gboolean is_tempfile,
/* Capture succeeded; attempt to open the capture file. */
if (cf_open((capture_file *)cap_session->cf, capture_opts->save_file, WTAP_TYPE_AUTO, is_tempfile, &err) != CF_OK) {
/* We're not doing a capture any more, so we don't have a save file. */
- return FALSE;
+ return false;
}
/* Set the read filter to NULL. */
@@ -246,7 +249,7 @@ capture_input_read_all(capture_session *cap_session, gboolean is_tempfile,
thus not have to set them here - "cf_read()" will get them from
the file and use them. */
if (drops_known) {
- cf_set_drops_known((capture_file *)cap_session->cf, TRUE);
+ cf_set_drops_known((capture_file *)cap_session->cf, true);
/* XXX - on some systems, libpcap doesn't bother filling in
"ps_ifdrop" - it doesn't even set it to zero - so we don't
@@ -260,7 +263,7 @@ capture_input_read_all(capture_session *cap_session, gboolean is_tempfile,
}
/* read in the packet data */
- switch (cf_read((capture_file *)cap_session->cf, /*reloading=*/FALSE)) {
+ switch (cf_read((capture_file *)cap_session->cf, /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
@@ -273,7 +276,7 @@ capture_input_read_all(capture_session *cap_session, gboolean is_tempfile,
/* User wants to quit program. Exit by leaving the main loop,
so that any quit functions we registered get called. */
exit_application(0);
- return FALSE;
+ return false;
}
/* if we didn't capture even a single packet, close the file again */
@@ -297,11 +300,11 @@ capture_input_read_all(capture_session *cap_session, gboolean is_tempfile,
(cf_is_tempfile((capture_file *)cap_session->cf)) ? "temporary " : "");
cf_close((capture_file *)cap_session->cf);
}
- return TRUE;
+ return true;
}
static const char *
-cf_open_error_message(int err, gchar *err_info)
+cf_open_error_message(int err, char *err_info)
{
const char *errmsg;
static char errmsg_errno[1024 + 1];
@@ -381,19 +384,19 @@ cf_open_error_message(int err, gchar *err_info)
}
}
else
- errmsg = file_open_error_message(err, FALSE);
+ errmsg = file_open_error_message(err, false);
return errmsg;
}
/* capture child tells us we have a new (or the first) capture file */
static bool
-capture_input_new_file(capture_session *cap_session, gchar *new_file)
+capture_input_new_file(capture_session *cap_session, char *new_file)
{
capture_options *capture_opts = cap_session->capture_opts;
- gboolean is_tempfile;
+ bool is_tempfile;
int err;
- gchar *err_info;
- gchar *err_msg;
+ char *err_info;
+ char *err_msg;
if(cap_session->state == CAPTURE_PREPARING) {
ws_message("Capture started");
@@ -409,7 +412,7 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
if (((capture_file*)cap_session->cf)->state == FILE_READ_PENDING) {
capture_callback_invoke(capture_cb_capture_fixed_finished, cap_session);
} else if (((capture_file*)cap_session->cf)->state != FILE_CLOSED) {
- cap_session->session_will_restart = TRUE;
+ cap_session->session_will_restart = true;
capture_callback_invoke(capture_cb_capture_update_finished, cap_session);
cf_finish_tail((capture_file *)cap_session->cf,
&cap_session->rec, &cap_session->buf, &err,
@@ -417,12 +420,12 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
cf_close((capture_file *)cap_session->cf);
}
g_free(capture_opts->save_file);
- is_tempfile = FALSE;
- cf_set_tempfile((capture_file *)cap_session->cf, FALSE);
+ is_tempfile = false;
+ cf_set_tempfile((capture_file *)cap_session->cf, false);
} else {
/* we didn't have a save_file before; must be a tempfile */
- is_tempfile = TRUE;
- cf_set_tempfile((capture_file *)cap_session->cf, TRUE);
+ is_tempfile = true;
+ cf_set_tempfile((capture_file *)cap_session->cf, true);
}
/* save the new filename */
@@ -439,7 +442,7 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
for debugging purposes. */
g_free(capture_opts->save_file);
capture_opts->save_file = NULL;
- return FALSE;
+ return false;
}
} else {
capture_callback_invoke(capture_cb_capture_prepared, cap_session);
@@ -450,13 +453,13 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
wtap_close(cap_session->wtap);
}
- cap_session->wtap = wtap_open_offline(new_file, WTAP_TYPE_AUTO, &err, &err_info, FALSE);
+ cap_session->wtap = wtap_open_offline(new_file, WTAP_TYPE_AUTO, &err, &err_info, false);
if (!cap_session->wtap) {
err_msg = ws_strdup_printf(cf_open_error_message(err, err_info),
new_file);
ws_warning("capture_input_new_file: %d (%s)", err, err_msg);
g_free(err_msg);
- return FALSE;
+ return false;
}
}
@@ -467,11 +470,11 @@ capture_input_new_file(capture_session *cap_session, gchar *new_file)
}
cap_session->state = CAPTURE_RUNNING;
- return TRUE;
+ return true;
}
static void
-capture_info_packet(info_data_t* cap_info, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header)
+capture_info_packet(info_data_t* cap_info, int wtap_linktype, const unsigned char *pd, uint32_t caplen, union wtap_pseudo_header *pseudo_header)
{
capture_packet_info_t cpinfo;
@@ -488,8 +491,8 @@ static void
capture_info_new_packets(int to_read, wtap *wth, info_data_t* cap_info)
{
int err;
- gchar *err_info;
- gint64 data_offset;
+ char *err_info;
+ int64_t data_offset;
wtap_rec rec;
Buffer buf;
union wtap_pseudo_header *pseudo_header;
@@ -587,7 +590,7 @@ capture_input_new_packets(capture_session *cap_session, int to_read)
/* Capture child told us how many dropped packets it counted.
*/
static void
-capture_input_drops(capture_session *cap_session, guint32 dropped, const char* interface_name)
+capture_input_drops(capture_session *cap_session, uint32_t dropped, const char* interface_name)
{
if (interface_name != NULL) {
ws_info("%u packet%s dropped from %s", dropped, plurality(dropped, "", "s"), interface_name);
@@ -597,7 +600,7 @@ capture_input_drops(capture_session *cap_session, guint32 dropped, const char* i
ws_assert(cap_session->state == CAPTURE_RUNNING);
- cf_set_drops_known((capture_file *)cap_session->cf, TRUE);
+ cf_set_drops_known((capture_file *)cap_session->cf, true);
cf_set_drops((capture_file *)cap_session->cf, dropped);
}
@@ -612,10 +615,15 @@ static void
capture_input_error(capture_session *cap_session _U_, char *error_msg,
char *secondary_error_msg)
{
- gchar *safe_error_msg;
- gchar *safe_secondary_error_msg;
-
- ws_message("Error message from child: \"%s\", \"%s\"", error_msg, secondary_error_msg);
+ char *safe_error_msg;
+ char *safe_secondary_error_msg;
+
+ /* The primary message might be an empty string, e.g. when the error was
+ * from extcap. (The extcap stderr is gathered when the session closes
+ * and printed in capture_input_closed below.) */
+ if (*error_msg != '\0') {
+ ws_message("Error message from child: \"%s\", \"%s\"", error_msg, secondary_error_msg);
+ }
ws_assert(cap_session->state == CAPTURE_PREPARING || cap_session->state == CAPTURE_RUNNING);
@@ -642,14 +650,14 @@ capture_input_error(capture_session *cap_session _U_, char *error_msg,
capture filter when starting/running the capture.
*/
static void
-capture_input_cfilter_error(capture_session *cap_session, guint i,
+capture_input_cfilter_error(capture_session *cap_session, unsigned i,
const char *error_message)
{
capture_options *capture_opts = cap_session->capture_opts;
dfilter_t *rfcode = NULL;
- gchar *safe_cfilter;
- gchar *safe_descr;
- gchar *safe_cfilter_error_msg;
+ char *safe_cfilter;
+ char *safe_descr;
+ char *safe_cfilter_error_msg;
interface_options *interface_opts;
ws_message("Capture filter error message from child: \"%s\"", error_message);
@@ -694,7 +702,7 @@ capture_input_cfilter_error(capture_session *cap_session, guint i,
/* capture child closed its side of the pipe, do the required cleanup */
static void
-capture_input_closed(capture_session *cap_session, gchar *msg)
+capture_input_closed(capture_session *cap_session, char *msg)
{
capture_options *capture_opts = cap_session->capture_opts;
int err;
@@ -702,7 +710,7 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
ws_message("Capture stopped.");
ws_assert(cap_session->state == CAPTURE_PREPARING || cap_session->state == CAPTURE_RUNNING);
- if (msg != NULL) {
+ if (msg != NULL && msg[0] != '\0') {
ESD_TYPE_E dlg_type = ESD_TYPE_ERROR;
if (strstr(msg, " WARNING] ")) {
dlg_type = ESD_TYPE_WARN;
@@ -711,16 +719,27 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
* ws_log prefixes log messages with a timestamp delimited by " -- " and possibly
* a function name delimited by "(): ". Log it to sterr, but omit it in the UI.
*/
- char *plain_msg = strstr(msg, "(): ");
- if (plain_msg != NULL) {
- plain_msg += strlen("(): ");
- } else if ((plain_msg = strstr(msg, " -- ")) != NULL) {
- plain_msg += strlen(" -- ");
- } else {
- plain_msg = msg;
+ char **msg_lines = g_strsplit(msg, "\n", 0);
+ GString* gui_msg = g_string_new(NULL);
+
+ for (char **line = msg_lines; *line != NULL; line++) {
+ if (gui_msg->len > 0) {
+ g_string_append(gui_msg, "\n");
+ }
+ char *plain_msg = strstr(*line, "(): ");
+ if (plain_msg != NULL) {
+ plain_msg += strlen("(): ");
+ } else if ((plain_msg = strstr(*line, " -- ")) != NULL) {
+ plain_msg += strlen(" -- ");
+ } else {
+ plain_msg = *line;
+ }
+ g_string_append(gui_msg, plain_msg);
}
ws_warning("%s", msg);
- simple_dialog(dlg_type, ESD_BTN_OK, "%s", plain_msg);
+ simple_dialog(dlg_type, ESD_BTN_OK, "%s", gui_msg->str);
+ g_string_free(gui_msg, TRUE);
+ g_strfreev(msg_lines);
}
wtap_rec_cleanup(&cap_session->rec);
@@ -755,7 +774,7 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
/* Tell the GUI we are not doing a capture any more.
Must be done after the cf_finish_tail(), so file lengths are
correctly displayed */
- cap_session->session_will_restart = FALSE;
+ cap_session->session_will_restart = false;
capture_callback_invoke(capture_cb_capture_update_finished, cap_session);
/* Finish the capture. */
@@ -823,7 +842,7 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
/* does the user wants to restart the current capture? */
if(capture_opts->restart) {
- capture_opts->restart = FALSE;
+ capture_opts->restart = false;
/* If we have a ring buffer, the original save file has been overwritten
with the "ring filename". Restore it before starting again */
@@ -838,9 +857,26 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
capture_opts->save_file = NULL;
}
} else {
- /* We're not doing a capture any more, so we don't have a save file. */
- g_free(capture_opts->save_file);
- capture_opts->save_file = NULL;
+
+ /* If we're in multiple file mode, restore the original save file
+ name (template), so that it will be used if a new capture is started
+ without opening the Capture Options dialog. Any files we just wrote
+ won't get overwritten. If we set it to NULL, a tempfile name would
+ be used, but that doesn't work in multiple file mode - we could turn
+ off multiple file mode instead, but that would change the behavior
+ if the Capture Options dialog is re-opened. */
+ if ((capture_opts->multi_files_on) && (capture_opts->orig_save_file != NULL)) {
+ g_free(capture_opts->save_file);
+ capture_opts->save_file = g_strdup(capture_opts->orig_save_file);
+ } else {
+ /* We're not doing a capture any more, so we don't have a save file.
+ If a new capture is started without opening the Capture Options
+ dialog (Start button or double-clicking on an interface from
+ the welcome screen), we'll use a tempfile. Thus if our current
+ capture is to a permanent file, we won't overwrite it. */
+ g_free(capture_opts->save_file);
+ capture_opts->save_file = NULL;
+ }
}
}
@@ -849,10 +885,10 @@ capture_stat_start(capture_options *capture_opts)
{
int stat_fd;
ws_process_id fork_child;
- gchar *msg;
+ char *msg;
if_stat_cache_t *sc = g_new0(if_stat_cache_t, 1);
if_stat_cache_item_t *sc_item;
- guint i;
+ unsigned i;
interface_t *device;
sc->stat_fd = -1;
@@ -877,14 +913,14 @@ capture_stat_start(capture_options *capture_opts)
* mechanism, so opening all the devices and presenting packet
* counts might not always be a good idea.
*/
- if (sync_interface_stats_open(&stat_fd, &fork_child, &msg, NULL) == 0) {
+ if (sync_interface_stats_open(&stat_fd, &fork_child, NULL, &msg, NULL) == 0) {
sc->stat_fd = stat_fd;
sc->fork_child = fork_child;
/* Initialize the cache */
for (i = 0; i < capture_opts->all_ifaces->len; i++) {
device = &g_array_index(capture_opts->all_ifaces, interface_t, i);
- if (device->type != IF_PIPE && device->type != IF_EXTCAP) {
+ if (device->if_info.type != IF_PIPE && device->if_info.type != IF_EXTCAP) {
sc_item = g_new0(if_stat_cache_item_t, 1);
ws_assert(device->if_info.name);
sc_item->name = g_strdup(device->if_info.name);
@@ -898,13 +934,99 @@ capture_stat_start(capture_options *capture_opts)
return sc;
}
+if_stat_cache_t *
+capture_interface_stat_start(capture_options *capture_opts _U_, GList **if_list)
+{
+ int stat_fd;
+ ws_process_id fork_child;
+ char *msg;
+ if_stat_cache_t *sc = g_new0(if_stat_cache_t, 1);
+ if_stat_cache_item_t *sc_item;
+ char *data = NULL;
+
+ sc->stat_fd = -1;
+ sc->fork_child = WS_INVALID_PID;
+
+ /* Fire up dumpcap. */
+ /*
+ * XXX - on systems with BPF, the number of BPF devices limits the
+ * number of devices on which you can capture simultaneously.
+ *
+ * This means that
+ *
+ * 1) this might fail if you run out of BPF devices
+ *
+ * and
+ *
+ * 2) opening every interface could leave too few BPF devices
+ * for *other* programs.
+ *
+ * It also means the system could end up getting a lot of traffic
+ * that it has to pass through the networking stack and capture
+ * mechanism, so opening all the devices and presenting packet
+ * counts might not always be a good idea.
+ */
+ int status;
+ status = sync_interface_stats_open(&stat_fd, &fork_child, &data, &msg, NULL);
+ /* In order to initialize the stat cache (below), we need to have
+ * filled in capture_opts->all_ifaces
+ *
+ * Note that the operation above can return a failed status but
+ * valid data, e.g. if dumpcap returns an interface list but none
+ * of them have permission to do a capture.
+ */
+ int err = 0;
+ char *err_msg = NULL;
+ *if_list = deserialize_interface_list(data, &err, &err_msg);
+ if (err != 0) {
+ ws_info("%s", err_msg);
+ g_free(err_msg);
+ }
+ if (status == 0) {
+ sc->stat_fd = stat_fd;
+ sc->fork_child = fork_child;
+
+ /* Initialize the cache */
+ for (GList *if_entry = *if_list; if_entry != NULL; if_entry = g_list_next(if_entry)) {
+ if_info_t *if_info = (if_info_t*)if_entry->data;
+ /* We just got this list from dumpcap so it shouldn't
+ * contain stdin, pipes, extcaps, or remote interfaces
+ * list. We could test if_info->type and the name to
+ * exclude those types from the cache anyway, though.
+ */
+ sc_item = g_new0(if_stat_cache_item_t, 1);
+ ws_assert(if_info->name);
+ sc_item->name = g_strdup(if_info->name);
+ sc->cache_list = g_list_prepend(sc->cache_list, sc_item);
+ }
+ } else if (status == WS_EXIT_NO_INTERFACES) {
+ /*
+ * No interfaces were found. If that's not the
+ * result of an error when fetching the local
+ * interfaces, let the user know.
+ */
+ ws_info("%s", msg);
+ g_free(msg); /* XXX: should we display this to the user via the GUI? */
+ } else {
+ ws_warning("%s", msg);
+ g_free(msg); /* XXX: should we display this to the user via the GUI? */
+ }
+
+#ifdef HAVE_PCAP_REMOTE
+ *if_list = append_remote_list(*if_list);
+#endif
+
+ *if_list = append_extcap_interface_list(*if_list);
+ return sc;
+}
+
#define MAX_STAT_LINE_LEN 500
static void
capture_stat_cache_update(if_stat_cache_t *sc)
{
- gchar stat_line[MAX_STAT_LINE_LEN] = "";
- gchar **stat_parts;
+ char stat_line[MAX_STAT_LINE_LEN] = "";
+ char **stat_parts;
GList *sc_entry;
if_stat_cache_item_t *sc_item;
@@ -931,14 +1053,14 @@ capture_stat_cache_update(if_stat_cache_t *sc)
}
}
-gboolean
+bool
capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_stat *ps)
{
GList *sc_entry;
if_stat_cache_item_t *sc_item;
if (!sc || sc->fork_child == WS_INVALID_PID || !ifname || !ps) {
- return FALSE;
+ return false;
}
capture_stat_cache_update(sc);
@@ -946,10 +1068,10 @@ capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_stat *ps)
sc_item = (if_stat_cache_item_t *)sc_entry->data;
if (strcmp(sc_item->name, ifname) == 0) {
memcpy(ps, &sc_item->ps, sizeof(struct pcap_stat));
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void
@@ -958,7 +1080,7 @@ capture_stat_stop(if_stat_cache_t *sc)
GList *sc_entry;
if_stat_cache_item_t *sc_item;
int ret;
- gchar *msg;
+ char *msg;
if (!sc) {
return;
diff --git a/ui/capture.h b/ui/capture.h
index d1ec3aee..dbeefc68 100644
--- a/ui/capture.h
+++ b/ui/capture.h
@@ -39,14 +39,14 @@ typedef enum {
capture_cb_capture_failed
} capture_cbs;
-typedef void (*capture_callback_t) (gint event, capture_session *cap_session,
- gpointer user_data);
+typedef void (*capture_callback_t) (int event, capture_session *cap_session,
+ void *user_data);
extern void
-capture_callback_add(capture_callback_t func, gpointer user_data);
+capture_callback_add(capture_callback_t func, void *user_data);
extern void
-capture_callback_remove(capture_callback_t func, gpointer user_data);
+capture_callback_remove(capture_callback_t func, void *user_data);
/**
* Initialize a capture session.
@@ -66,9 +66,9 @@ capture_input_init(capture_session *cap_session, capture_file *cf);
* @param cap_session the handle for the capture session
* @param cap_data a struct with capture info data
* @param update_cb update screen
- * @return TRUE if the capture starts successfully, FALSE otherwise.
+ * @return true if the capture starts successfully, false otherwise.
*/
-extern gboolean
+extern bool
capture_start(capture_options *capture_opts, GPtrArray *capture_comments,
capture_session *cap_session, info_data_t* cap_data,
void(*update_cb)(void));
@@ -92,10 +92,19 @@ typedef struct if_stat_cache_s if_stat_cache_t;
extern WS_RETNONNULL if_stat_cache_t * capture_stat_start(capture_options *capture_opts);
/**
+ * Retrieve the list of interfaces and their capabilities, and start
+ * gathering capture statistics for the interfaces.
+ * @param capture_opts A structure containing options for the capture.
+ * @param[out] if_list A pointer that will store a GList of if_info_t.
+ * @return A pointer to the statistics state data.
+ */
+extern WS_RETNONNULL if_stat_cache_t * capture_interface_stat_start(capture_options *capture_opts, GList **if_list);
+
+/**
* Fetch capture statistics, similar to pcap_stats().
*/
struct pcap_stat; /* Stub in case we don't or haven't yet included pcap.h */
-extern gboolean capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_stat *ps);
+extern bool capture_stats(if_stat_cache_t *sc, char *ifname, struct pcap_stat *ps);
/**
* Stop gathering capture statistics.
diff --git a/ui/capture_info.h b/ui/capture_info.h
index d94819af..24e8cdfc 100644
--- a/ui/capture_info.h
+++ b/ui/capture_info.h
@@ -30,11 +30,11 @@ extern "C" {
/** Current Capture info. */
typedef struct _capture_info {
/* handle */
- gpointer ui; /**< user interface handle */
+ void * ui; /**< user interface handle */
/* capture info */
packet_counts *counts; /**< protocol specific counters */
- gint new_packets; /**< packets since last update */
+ int new_packets; /**< packets since last update */
} capture_info;
typedef struct _info_data {
diff --git a/ui/capture_ui_utils.c b/ui/capture_ui_utils.c
index 358fc891..d530ee1e 100644
--- a/ui/capture_ui_utils.c
+++ b/ui/capture_ui_utils.c
@@ -33,10 +33,10 @@
* the property.
*/
static char *
-capture_dev_get_if_property(const gchar *pref, const gchar *if_name)
+capture_dev_get_if_property(const char *pref, const char *if_name)
{
- gchar **if_tokens;
- gchar *property = NULL;
+ char **if_tokens;
+ char *property = NULL;
int i;
if (if_name == NULL || strlen(if_name) < 1) {
@@ -55,7 +55,7 @@ capture_dev_get_if_property(const gchar *pref, const gchar *if_name)
*/
if_tokens = g_strsplit(pref, ",", -1);
for (i = 0; if_tokens[i] != NULL; i++) {
- gchar *opening_parenp, *closing_parenp;
+ char *opening_parenp, *closing_parenp;
/*
* Separate this item into name and property.
@@ -91,11 +91,11 @@ capture_dev_get_if_property(const gchar *pref, const gchar *if_name)
* Find a property that should be an integral value, and return the
* value or, if it's not found or not a valid integral value, -1.
*/
-static gint
-capture_dev_get_if_int_property(const gchar *pref, const gchar *if_name)
+static int
+capture_dev_get_if_int_property(const char *pref, const char *if_name)
{
- gchar *property_string;
- gint property;
+ char *property_string;
+ int property;
property_string = capture_dev_get_if_property(pref, if_name);
if (property_string == NULL) {
@@ -117,40 +117,50 @@ capture_dev_get_if_int_property(const gchar *pref, const gchar *if_name)
* name, if any.
*/
char *
-capture_dev_user_descr_find(const gchar *if_name)
+capture_dev_user_descr_find(const char *if_name)
{
- return capture_dev_get_if_property(prefs.capture_devices_descr, if_name);
+ char *descr = capture_dev_get_if_property(prefs.capture_devices_descr, if_name);
+ if (descr == NULL && g_strcmp0(if_name, "-") == 0) {
+ /*
+ * Strictly speaking, -X (extension) options are for modules, e.g. Lua
+ * and using one here stretches that definition. However, this doesn't
+ * waste a single-letter option on something that might be rarely used
+ * and is backward-compatible to 1.0.
+ */
+ descr = g_strdup(ex_opt_get_nth("stdin_descr", 0));
+ }
+ return descr;
}
-gint
-capture_dev_user_linktype_find(const gchar *if_name)
+int
+capture_dev_user_linktype_find(const char *if_name)
{
return capture_dev_get_if_int_property(prefs.capture_devices_linktypes, if_name);
}
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
-gint
-capture_dev_user_buffersize_find(const gchar *if_name)
+int
+capture_dev_user_buffersize_find(const char *if_name)
{
return capture_dev_get_if_int_property(prefs.capture_devices_buffersize, if_name);
}
#endif
-gboolean
-capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snaplen)
+bool
+capture_dev_user_snaplen_find(const char *if_name, bool *hassnap, int *snaplen)
{
- gboolean found = FALSE;
- gchar **if_tokens;
+ bool found = false;
+ char **if_tokens;
int i;
if (if_name == NULL || strlen(if_name) < 1) {
- return FALSE;
+ return false;
}
if ((prefs.capture_devices_snaplen == NULL) ||
(*prefs.capture_devices_snaplen == '\0')) {
/* There are no snap lengths defined */
- return FALSE;
+ return false;
}
/*
@@ -160,9 +170,9 @@ capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snap
*/
if_tokens = g_strsplit(prefs.capture_devices_snaplen, ",", -1);
for (i = 0; if_tokens[i] != NULL; i++) {
- gchar *colonp;
- const gchar *next;
- gint value;
+ char *colonp;
+ const char *next;
+ int value;
/*
* This one's a bit ugly.
@@ -187,8 +197,8 @@ capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snap
/* OK, this matches. */
if (*(colonp + 1) == '0') {
/* {hassnap} is false, so just set the snaplen to WTAP_MAX_PACKET_SIZE_STANDARD. */
- found = TRUE;
- *hassnap = FALSE;
+ found = true;
+ *hassnap = false;
*snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
} else if (*(colonp + 1) == '1') {
/* {hassnap} is true, so extract {snaplen} */
@@ -201,8 +211,8 @@ capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snap
/* Syntax error or range error. Give up. */
break;
}
- found = TRUE;
- *hassnap = TRUE;
+ found = true;
+ *hassnap = true;
*snaplen = value;
} else {
/* Bad {hassnap}. Give up. */
@@ -216,22 +226,22 @@ capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snap
return found;
}
-gboolean
-capture_dev_user_pmode_find(const gchar *if_name, gboolean *pmode)
+bool
+capture_dev_user_pmode_find(const char *if_name, bool *pmode)
{
int value;
value = capture_dev_get_if_int_property(prefs.capture_devices_pmode, if_name);
if (value == -1) {
/* Not found or bad. */
- return FALSE;
+ return false;
}
*pmode = (value != 0);
- return TRUE;
+ return true;
}
-gchar*
-capture_dev_user_cfilter_find(const gchar *if_name)
+char*
+capture_dev_user_cfilter_find(const char *if_name)
{
return capture_dev_get_if_property(prefs.capture_devices_filter, if_name);
}
@@ -239,18 +249,18 @@ capture_dev_user_cfilter_find(const gchar *if_name)
/*
* Return as descriptive a name for an interface as we can get.
* If the user has specified a comment, use that. Otherwise,
- * if capture_interface_list() supplies a description, use that,
- * otherwise use the interface name.
+ * if the get_iface_list() method of capture_opts supplies a
+ * description, use that, otherwise use the interface name.
*
* The result must be g_free()'d when you're done with it.
*
- * Note: given that this calls capture_interface_list(), which attempts to
- * open all adapters it finds in order to check whether they can be
- * captured on, this is an expensive routine to call, so don't call it
- * frequently.
+ * Note: given that this likely calls capture_interface_list(), which
+ * attempts to open all adapters it finds in order to check whether
+ * they can be captured on, this is an expensive routine to call, so
+ * don't call it frequently.
*/
char *
-get_interface_descriptive_name(const char *if_name)
+get_interface_descriptive_name(const capture_options *capture_opts, const char *if_name)
{
char *descr;
GList *if_list;
@@ -263,20 +273,12 @@ get_interface_descriptive_name(const char *if_name)
if (descr == NULL) {
/* No; try to construct a descriptive name. */
if (strcmp(if_name, "-") == 0) {
- /*
- * Strictly speaking, -X (extension) options are for modules, e.g. Lua
- * and using one here stretches that definition. However, this doesn't
- * waste a single-letter option on something that might be rarely used
- * and is backward-compatible to 1.0.
- */
- descr = g_strdup(ex_opt_get_nth("stdin_descr", 0));
- if (!descr) {
- descr = g_strdup("Standard input");
- }
+ descr = g_strdup("Standard input");
} else {
/* No, we don't have a user-supplied description; did we get
one from the OS or libpcap? */
- if_list = capture_interface_list(&err, NULL, NULL);
+ /* XXX: Search in capture_opts->ifaces (or all_ifaces) first? */
+ if_list = capture_opts->get_iface_list(&err, NULL);
if (if_list != NULL) {
if_entry = if_list;
do {
@@ -312,13 +314,13 @@ get_interface_descriptive_name(const char *if_name)
}
GList *
-build_capture_combo_list(GList *if_list, gboolean do_hide)
+build_capture_combo_list(GList *if_list, bool do_hide)
{
GList *combo_list;
GList *if_entry;
if_info_t *if_info;
char *if_string;
- gchar *descr;
+ char *descr;
combo_list = NULL;
if (if_list != NULL) {
@@ -362,7 +364,7 @@ build_capture_combo_list(GList *if_list, gboolean do_hide)
}
static void
-free_if_string(gpointer data, gpointer user_data _U_)
+free_if_string(void *data, void *user_data _U_)
{
g_free(data);
}
@@ -469,7 +471,7 @@ void
set_active_dlt(interface_t *device, int global_default_dlt)
{
GList *list;
- gboolean found_active_dlt;
+ bool found_active_dlt;
link_row *link;
/*
@@ -489,11 +491,11 @@ set_active_dlt(interface_t *device, int global_default_dlt)
* If not, set it to -1, so we'll fall back on the first supported
* link-layer header type.
*/
- found_active_dlt = FALSE;
+ found_active_dlt = false;
for (list = device->links; list != NULL; list = g_list_next(list)) {
link = (link_row *)(list->data);
if (link->dlt != -1 && link->dlt == device->active_dlt) {
- found_active_dlt = TRUE;
+ found_active_dlt = true;
break;
}
}
@@ -513,10 +515,10 @@ set_active_dlt(interface_t *device, int global_default_dlt)
}
GString *
-get_iface_list_string(capture_options *capture_opts, guint32 style)
+get_iface_list_string(capture_options *capture_opts, uint32_t style)
{
GString *iface_list_string = g_string_new("");
- guint i;
+ unsigned i;
/*
* If we have a descriptive name for the interface, show that,
@@ -546,13 +548,31 @@ get_iface_list_string(capture_options *capture_opts, guint32 style)
if (style & IFLIST_QUOTE_IF_DESCRIPTION)
g_string_append_printf(iface_list_string, "'");
+ /* If we have a special user-supplied description (via the prefs
+ * or the documented "-X stdin_descr" option for stdin), make sure
+ * we're using it.
+ */
+ char *user_descr = capture_dev_user_descr_find(interface_opts->name);
+ if (user_descr != NULL) {
+ if (g_strcmp0(interface_opts->descr, user_descr) != 0) {
+ g_free(interface_opts->descr);
+ interface_opts->descr = user_descr;
+ g_free(interface_opts->display_name);
+ interface_opts->display_name = g_strdup(interface_opts->descr);
+ } else {
+ g_free(user_descr);
+ }
+ }
if (interface_opts->display_name == NULL) {
/*
* We don't have a display name; generate one.
+ * fill_in_interface_opts_from_finfo and
+ * capture_opts_add_iface_opt always fill in
+ * the display name, so this shouldn't be necessary.
*/
if (interface_opts->descr == NULL) {
if (interface_opts->name != NULL)
- interface_opts->descr = get_interface_descriptive_name(interface_opts->name);
+ interface_opts->descr = get_interface_descriptive_name(capture_opts, interface_opts->name);
else
interface_opts->descr = g_strdup("(Unknown)");
}
diff --git a/ui/capture_ui_utils.h b/ui/capture_ui_utils.h
index 27c5c026..c6f32f12 100644
--- a/ui/capture_ui_utils.h
+++ b/ui/capture_ui_utils.h
@@ -31,7 +31,7 @@ extern "C" {
* @return The device description (must be g_free'd later) or NULL
* if not found.
*/
-char *capture_dev_user_descr_find(const gchar *if_name);
+char *capture_dev_user_descr_find(const char *if_name);
/**
* Find user-specified link-layer header type that matches interface
@@ -41,7 +41,7 @@ char *capture_dev_user_descr_find(const gchar *if_name);
*
* @return The link-layer header type (a DLT_) or -1 if not found.
*/
-gint capture_dev_user_linktype_find(const gchar *if_name);
+int capture_dev_user_linktype_find(const char *if_name);
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
/**
@@ -52,7 +52,7 @@ gint capture_dev_user_linktype_find(const gchar *if_name);
*
* @return The buffer size or -1 if not found.
*/
-gint capture_dev_user_buffersize_find(const gchar *if_name);
+int capture_dev_user_buffersize_find(const char *if_name);
#endif
/**
@@ -60,28 +60,28 @@ gint capture_dev_user_buffersize_find(const gchar *if_name);
* name, if any.
*
* @param if_name The name of the interface.
- * @param hassnap Pointer to a variable to be set to TRUE if the
- * interface should be given a snap length or FALSE if it shouldn't
+ * @param hassnap Pointer to a variable to be set to true if the
+ * interface should be given a snap length or false if it shouldn't
* be given a snap length.
* @param snaplen Pointer to a variable to be set to the snap length
* if the interface should be given a snap length or the maximum
* snap length if it shouldn't be given a snap length.
*
- * @return TRUE if found or FALSE if not found.
+ * @return true if found or false if not found.
*/
-gboolean capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snaplen);
+bool capture_dev_user_snaplen_find(const char *if_name, bool *hassnap, int *snaplen);
/**
* Find user-specified promiscuous mode that matches interface
* name, if any.
*
* @param if_name The name of the interface.
- * @param pmode Pointer to a variable to be set to TRUE if promiscuous
- * mode should be used and FALSE if it shouldn't be used.
+ * @param pmode Pointer to a variable to be set to true if promiscuous
+ * mode should be used and false if it shouldn't be used.
*
- * @return TRUE if found or FALSE if not found.
+ * @return true if found or false if not found.
*/
-gboolean capture_dev_user_pmode_find(const gchar *if_name, gboolean *pmode);
+bool capture_dev_user_pmode_find(const char *if_name, bool *pmode);
/**
* Find user-specified capture filter that matches interface
@@ -93,18 +93,19 @@ gboolean capture_dev_user_pmode_find(const gchar *if_name, gboolean *pmode);
*
* @return The capture filter (must be g_free'd later) or NULL if not found.
*/
-gchar* capture_dev_user_cfilter_find(const gchar *if_name);
+char* capture_dev_user_cfilter_find(const char *if_name);
/** Return as descriptive a name for an interface as we can get.
* If the user has specified a comment, use that. Otherwise,
- * if capture_interface_list() supplies a description, use that,
- * otherwise use the interface name.
+ * if the get_iface_list() method of capture_opts supplies a
+ * description, use that, otherwise use the interface name.
*
+ * @param capture_opts The capture options to use to find the interface
* @param if_name The name of the interface.
*
* @return The descriptive name (must be g_free'd later)
*/
-char *get_interface_descriptive_name(const char *if_name);
+char *get_interface_descriptive_name(const capture_options *capture_opts, const char *if_name);
/** Build the GList of available capture interfaces.
*
@@ -113,7 +114,7 @@ char *get_interface_descriptive_name(const char *if_name);
*
* @return A list of if_info_t structs (use free_capture_combo_list() later).
*/
-GList *build_capture_combo_list(GList *if_list, gboolean do_hide);
+GList *build_capture_combo_list(GList *if_list, bool do_hide);
/** Free the GList from build_capture_combo_list().
*
@@ -155,7 +156,7 @@ extern void set_active_dlt(interface_t *device, int global_default_dlt);
#define IFLIST_QUOTE_IF_DESCRIPTION 0x00000001
#define IFLIST_SHOW_FILTER 0x00000002
-extern GString *get_iface_list_string(capture_options *capture_opts, guint32 style);
+extern GString *get_iface_list_string(capture_options *capture_opts, uint32_t style);
#ifdef __cplusplus
}
diff --git a/ui/cli/simple_dialog.c b/ui/cli/simple_dialog.c
index 5807c8b3..1916a43b 100644
--- a/ui/cli/simple_dialog.c
+++ b/ui/cli/simple_dialog.c
@@ -21,11 +21,11 @@
#include <ui/simple_dialog.h>
#include "ws_attributes.h"
-gpointer
+void *
simple_dialog(
ESD_TYPE_E type _U_,
- gint btn_mask _U_,
- const gchar * msg_format,
+ int btn_mask _U_,
+ const char * msg_format,
...
)
{
@@ -39,7 +39,7 @@ simple_dialog(
}
void
-simple_message_box(ESD_TYPE_E type _U_, gboolean *notagain _U_,
+simple_message_box(ESD_TYPE_E type _U_, bool *notagain _U_,
const char *secondary_msg, const char *msg_format, ...)
{
va_list ap;
diff --git a/ui/cli/tap-camelsrt.c b/ui/cli/tap-camelsrt.c
index 935731ac..0f98b996 100644
--- a/ui/cli/tap-camelsrt.c
+++ b/ui/cli/tap-camelsrt.c
@@ -37,7 +37,7 @@ void register_tap_listener_camelsrt(void);
/* used to keep track of the statistics for an entire program interface */
struct camelsrt_t {
char *filter;
- guint32 count[NB_CAMELSRT_CATEGORY];
+ uint32_t count[NB_CAMELSRT_CATEGORY];
timestat_t stats[NB_CAMELSRT_CATEGORY];
nstime_t delta_time[NB_CAMELSRT_CATEGORY][NUM_RAS_STATS];
};
@@ -82,14 +82,14 @@ static tap_packet_status camelsrt_packet(void *phs,
static void camelsrt_draw(void *phs)
{
struct camelsrt_t *hs = (struct camelsrt_t *)phs;
- guint j, z;
- guint32 li;
+ unsigned j, z;
+ uint32_t li;
int somme, iteration = 0;
timestat_t *rtd_temp;
double x, delay, delay_max, delay_min, delta;
double criteria[NB_CRITERIA] = { 5.0, 10.0, 75.0, 90.0, 95.0, 99.0, 99.90 };
double delay_criteria[NB_CRITERIA];
- gchar* tmp_str;
+ char* tmp_str;
printf("\n");
printf("Camel Service Response Time (SRT) Statistics:\n");
@@ -235,8 +235,8 @@ static void camelsrt_init(const char *opt_arg, void *userdata _U_)
* Whereas, with wireshark, it is not possible to have the correct display, if the stats are
* not saved along the analyze
*/
- gtcap_StatSRT = TRUE;
- gcamel_StatSRT = TRUE;
+ gtcap_StatSRT = true;
+ gcamel_StatSRT = true;
}
static stat_tap_ui camelsrt_ui = {
diff --git a/ui/cli/tap-credentials.c b/ui/cli/tap-credentials.c
index 9a54a7eb..c5e9e6c9 100644
--- a/ui/cli/tap-credentials.c
+++ b/ui/cli/tap-credentials.c
@@ -26,7 +26,7 @@
void register_tap_listener_credentials(void);
-wmem_array_t* credentials = NULL;
+wmem_array_t* credentials;
static tap_credential_t* tap_credential_clone(tap_credential_t* auth)
{
@@ -64,7 +64,7 @@ static void credentials_draw(void *p _U_)
printf("===================================================================\n");
printf("%-10s %-16s %-16s %-16s\n", "Packet", "Protocol", "Username", "Info");
printf("------ -------- -------- --------\n");
- for (guint i = 0; i < wmem_array_get_count(credentials); i++) {
+ for (unsigned i = 0; i < wmem_array_get_count(credentials); i++) {
tap_credential_t* auth = (tap_credential_t*)wmem_array_index(credentials, i);
printf("%-10u %-16s %-16s %-16s\n", auth->num, auth->proto, auth->username, auth->info ? auth->info : "");
}
diff --git a/ui/cli/tap-diameter-avp.c b/ui/cli/tap-diameter-avp.c
index eb990fa9..bc1b273d 100644
--- a/ui/cli/tap-diameter-avp.c
+++ b/ui/cli/tap-diameter-avp.c
@@ -45,54 +45,54 @@ void register_tap_listener_diameteravp(void);
/* used to keep track of the statistics for an entire program interface */
typedef struct _diameteravp_t {
- guint32 frame;
- guint32 diammsg_toprocess;
- guint32 cmd_code;
- guint32 req_count;
- guint32 ans_count;
- guint32 paired_ans_count;
- gchar *filter;
+ uint32_t frame;
+ uint32_t diammsg_toprocess;
+ uint32_t cmd_code;
+ uint32_t req_count;
+ uint32_t ans_count;
+ uint32_t paired_ans_count;
+ char *filter;
} diameteravp_t;
/* Copied from proto.c */
-static gboolean
-tree_traverse_pre_order(proto_tree *tree, proto_tree_traverse_func func, gpointer data)
+static bool
+tree_traverse_pre_order(proto_tree *tree, proto_tree_traverse_func func, void *data)
{
proto_node *pnode = tree;
proto_node *child;
proto_node *current;
if (func(pnode, data))
- return TRUE;
+ return true;
child = pnode->first_child;
while (child != NULL) {
current = child;
child = current->next;
if (tree_traverse_pre_order((proto_tree *)current, func, data))
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-static gboolean
-diam_tree_to_csv(proto_node *node, gpointer data)
+static bool
+diam_tree_to_csv(proto_node *node, void * data)
{
char *val_str = NULL;
char *val_tmp = NULL;
ftenum_t ftype;
field_info *fi;
- header_field_info *hfi;
+ const header_field_info *hfi;
if (!node) {
fprintf(stderr, "traverse end: empty node. node='%p' data='%p'\n", (void *)node, (void *)data);
- return FALSE;
+ return false;
}
fi = node->finfo;
hfi = fi ? fi->hfinfo : NULL;
if (!hfi) {
fprintf(stderr, "traverse end: hfi not found. node='%p'\n", (void *)node);
- return FALSE;
+ return false;
}
ftype = fvalue_type_ftenum(fi->value);
if (ftype != FT_NONE && ftype != FT_PROTOCOL) {
@@ -109,7 +109,7 @@ diam_tree_to_csv(proto_node *node, gpointer data)
printf("%s='%s' ", hfi->name, val_str);
g_free(val_str);
}
- return FALSE;
+ return false;
}
static tap_packet_status
@@ -117,19 +117,19 @@ diameteravp_packet(void *pds, packet_info *pinfo, epan_dissect_t *edt _U_, const
{
tap_packet_status ret = TAP_PACKET_DONT_REDRAW;
double resp_time = 0.;
- gboolean is_request = TRUE;
- guint32 cmd_code = 0;
- guint32 req_frame = 0;
- guint32 ans_frame = 0;
- guint32 diam_child_node = 0;
+ bool is_request = true;
+ uint32_t cmd_code = 0;
+ uint32_t req_frame = 0;
+ uint32_t ans_frame = 0;
+ uint32_t diam_child_node = 0;
proto_node *current = NULL;
proto_node *node = NULL;
- header_field_info *hfi = NULL;
+ const header_field_info *hfi = NULL;
field_info *finfo = NULL;
const diameter_req_ans_pair_t *dp = (const diameter_req_ans_pair_t *)pdi;
diameteravp_t *ds = NULL;
- /* Validate paramerers. */
+ /* Validate parameters */
if (!dp || !edt || !edt->tree)
return ret;
@@ -206,10 +206,10 @@ static void
diameteravp_init(const char *opt_arg, void *userdata _U_)
{
diameteravp_t *ds;
- gchar *field = NULL;
- gchar **tokens;
- guint opt_count = 0;
- guint opt_idx = 0;
+ char *field = NULL;
+ char **tokens;
+ unsigned opt_count = 0;
+ unsigned opt_idx = 0;
GString *filter = NULL;
GString *error_string = NULL;
@@ -230,7 +230,7 @@ diameteravp_init(const char *opt_arg, void *userdata _U_)
while (tokens[opt_count])
opt_count++;
if (opt_count > 2) {
- /* if the token is a not-null string and it's not *, the conversion must succeeed */
+ /* if the token is a not-null string and it's not *, the conversion must succeed */
if (strlen(tokens[2]) > 0 && tokens[2][0] != '*') {
if (!ws_strtou32(tokens[2], NULL, &ds->cmd_code)) {
fprintf(stderr, "Invalid integer token: %s\n", tokens[2]);
diff --git a/ui/cli/tap-endpoints.c b/ui/cli/tap-endpoints.c
index e97dcf85..b71f39f7 100644
--- a/ui/cli/tap-endpoints.c
+++ b/ui/cli/tap-endpoints.c
@@ -33,9 +33,9 @@ endpoints_draw(void *arg)
conv_hash_t *hash = (conv_hash_t*)arg;
endpoints_t *iu = (endpoints_t *)hash->user_data;
endpoint_item_t *endpoint;
- guint64 last_frames, max_frames;
- guint i;
- gboolean display_port = (!strncmp(iu->type, "TCP", 3) || !strncmp(iu->type, "UDP", 3) || !strncmp(iu->type, "SCTP", 4)) ? TRUE : FALSE;
+ uint64_t last_frames, max_frames;
+ unsigned i;
+ bool display_port = (!strncmp(iu->type, "TCP", 3) || !strncmp(iu->type, "UDP", 3) || !strncmp(iu->type, "SCTP", 4)) ? true : false;
printf("================================================================================\n");
printf("%s Endpoints\n", iu->type);
@@ -48,7 +48,7 @@ endpoints_draw(void *arg)
do {
last_frames = 0;
for (i=0; (iu->hash.conv_array && i < iu->hash.conv_array->len); i++) {
- guint64 tot_frames;
+ uint64_t tot_frames;
endpoint = &g_array_index(iu->hash.conv_array, endpoint_item_t, i);
tot_frames = endpoint->rx_frames + endpoint->tx_frames;
@@ -59,18 +59,18 @@ endpoints_draw(void *arg)
}
for (i=0; (iu->hash.conv_array && i < iu->hash.conv_array->len); i++) {
- guint64 tot_frames;
- gchar *conversation_str, *port_str;
+ uint64_t tot_frames;
+ char *conversation_str, *port_str;
endpoint = &g_array_index(iu->hash.conv_array, endpoint_item_t, i);
tot_frames = endpoint->rx_frames + endpoint->tx_frames;
if (tot_frames == last_frames) {
/* XXX - TODO: make name resolution configurable (through gbl_resolv_flags?) */
- conversation_str = get_conversation_address(NULL, &endpoint->myaddress, TRUE);
+ conversation_str = get_conversation_address(NULL, &endpoint->myaddress, true);
if (display_port) {
/* XXX - TODO: make port resolution configurable (through gbl_resolv_flags?) */
- port_str = get_endpoint_port(NULL, endpoint, TRUE);
+ port_str = get_endpoint_port(NULL, endpoint, true);
printf("%-20s %5s %6" PRIu64 " %9" PRIu64
" %6" PRIu64 " %9" PRIu64 " %6"
PRIu64 " %9" PRIu64 " \n",
diff --git a/ui/cli/tap-expert.c b/ui/cli/tap-expert.c
index 3fcf0e7f..8fa812cc 100644
--- a/ui/cli/tap-expert.c
+++ b/ui/cli/tap-expert.c
@@ -39,10 +39,10 @@ static severity_level_t lowest_report_level = comment_level;
typedef struct expert_entry
{
- guint32 group;
+ uint32_t group;
int frequency;
- const gchar *protocol;
- gchar *summary;
+ const char *protocol;
+ char *summary;
} expert_entry;
@@ -57,7 +57,7 @@ typedef struct expert_tapdata_t {
static void
expert_stat_reset(void *tapdata)
{
- gint n;
+ int n;
expert_tapdata_t *etd = (expert_tapdata_t *)tapdata;
/* Free & reallocate chunk of strings */
@@ -80,7 +80,7 @@ expert_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U
severity_level_t severity_level;
expert_entry tmp_entry;
expert_entry *entry;
- guint n;
+ unsigned n;
switch (ei->severity) {
case PI_COMMENT:
@@ -133,12 +133,12 @@ expert_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U
}
/* Output for all of the items of one severity */
-static void draw_items_for_severity(GArray *items, const gchar *label)
+static void draw_items_for_severity(GArray *items, const char *label)
{
- guint n;
+ unsigned n;
expert_entry *ei;
int total = 0;
- gchar *tmp_str;
+ char *tmp_str;
/* Don't print title if no items */
if (items->len == 0) {
@@ -188,7 +188,7 @@ static void
expert_tapdata_free(expert_tapdata_t* hs)
{
for (int n = 0; n < max_level; n++) {
- g_array_free(hs->ei_array[n], TRUE);
+ g_array_free(hs->ei_array[n], true);
}
g_string_chunk_free(hs->text);
g_free(hs);
@@ -249,7 +249,7 @@ static void expert_stat_init(const char *opt_arg, void *userdata _U_)
/* Allocate GArray for each severity level */
for (n=0; n < max_level; n++) {
- hs->ei_array[n] = g_array_sized_new(FALSE, FALSE, sizeof(expert_entry), 1000);
+ hs->ei_array[n] = g_array_sized_new(false, false, sizeof(expert_entry), 1000);
}
/**********************************************/
diff --git a/ui/cli/tap-exportobject.c b/ui/cli/tap-exportobject.c
index 4a02155c..013e7a9e 100644
--- a/ui/cli/tap-exportobject.c
+++ b/ui/cli/tap-exportobject.c
@@ -31,13 +31,13 @@ typedef struct _export_object_list_gui_t {
register_eo_t* eo;
} export_object_list_gui_t;
-static GHashTable* eo_opts = NULL;
+static GHashTable* eo_opts;
static bool
list_exportobject_protocol(const void *key, void *value _U_, void *userdata _U_)
{
- fprintf(stderr, " %s\n", (const gchar*)key);
- return FALSE;
+ fprintf(stderr, " %s\n", (const char*)key);
+ return false;
}
void eo_list_object_types(void)
@@ -45,9 +45,9 @@ void eo_list_object_types(void)
eo_iterate_tables(list_exportobject_protocol, NULL);
}
-gboolean eo_tap_opt_add(const char *option_string)
+bool eo_tap_opt_add(const char *option_string)
{
- gchar** splitted;
+ char** splitted;
if (!eo_opts)
eo_opts = g_hash_table_new(g_str_hash,g_str_equal);
@@ -62,7 +62,7 @@ gboolean eo_tap_opt_add(const char *option_string)
}
else
{
- gchar* dir = (gchar*)g_hash_table_lookup(eo_opts, splitted[0]);
+ char* dir = (char*)g_hash_table_lookup(eo_opts, splitted[0]);
/* Since we're saving all objects from a protocol,
it can only be listed once */
@@ -70,7 +70,7 @@ gboolean eo_tap_opt_add(const char *option_string)
g_hash_table_insert(eo_opts, splitted[0], splitted[1]);
g_free(splitted);
- return TRUE;
+ return true;
}
else
{
@@ -79,7 +79,7 @@ gboolean eo_tap_opt_add(const char *option_string)
}
g_strfreev(splitted);
- return FALSE;
+ return false;
}
static void
@@ -105,10 +105,10 @@ eo_draw(void *tapdata)
export_object_list_gui_t *object_list = (export_object_list_gui_t*)tap_object->gui_data;
GSList *slist = object_list->entries;
export_object_entry_t *entry;
- gchar* save_in_path = (gchar*)g_hash_table_lookup(eo_opts, proto_get_protocol_filter_name(get_eo_proto_id(object_list->eo)));
+ char* save_in_path = (char*)g_hash_table_lookup(eo_opts, proto_get_protocol_filter_name(get_eo_proto_id(object_list->eo)));
GString *safe_filename = NULL;
- gchar *save_as_fullpath = NULL;
- guint count = 0;
+ char *save_as_fullpath = NULL;
+ unsigned count = 0;
if (!g_file_test(save_in_path, G_FILE_TEST_IS_DIR)) {
/* If the destination directory (or its parents) do not exist, create them. */
@@ -147,7 +147,7 @@ eo_draw(void *tapdata)
}
static void
-exportobject_handler(gpointer key, gpointer value _U_, gpointer user_data _U_)
+exportobject_handler(void *key, void *value _U_, void *user_data _U_)
{
GString *error_msg;
export_object_list_t *tap_data;
diff --git a/ui/cli/tap-exportobject.h b/ui/cli/tap-exportobject.h
index 49ebc265..9c279d00 100644
--- a/ui/cli/tap-exportobject.h
+++ b/ui/cli/tap-exportobject.h
@@ -17,7 +17,7 @@ extern "C" {
void eo_list_object_types(void);
/* will be called by main each time a --export-objects option is found */
-gboolean eo_tap_opt_add(const char *ws_optarg);
+bool eo_tap_opt_add(const char *ws_optarg);
void start_exportobjects(void);
diff --git a/ui/cli/tap-flow.c b/ui/cli/tap-flow.c
index 32e0a94f..04111e25 100644
--- a/ui/cli/tap-flow.c
+++ b/ui/cli/tap-flow.c
@@ -46,16 +46,16 @@ flow_draw(void *arg)
sequence_analysis_info_free(flow_info);
}
-static gboolean flow_arg_strncmp(const char **opt_argp, const char *strp)
+static bool flow_arg_strncmp(const char **opt_argp, const char *strp)
{
size_t len = strlen(strp);
if (strncmp(*opt_argp, strp, len) == 0)
{
*opt_argp += len;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
static void
@@ -111,7 +111,7 @@ flow_register(const void *key _U_, void *value, void *userdata _U_)
register_analysis_t* analysis = (register_analysis_t*)value;
stat_tap_ui flow_ui;
GString *cmd_str = g_string_new(STR_FLOW);
- gchar *cli_string;
+ char *cli_string;
g_string_append(cmd_str, sequence_analysis_get_name(analysis));
cli_string = g_string_free(cmd_str, FALSE);
@@ -124,7 +124,7 @@ flow_register(const void *key _U_, void *value, void *userdata _U_)
flow_ui.params = NULL;
register_stat_tap_ui(&flow_ui, analysis);
g_free(cli_string);
- return FALSE;
+ return false;
}
void
diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c
index 51f8f0f7..97983dee 100644
--- a/ui/cli/tap-follow.c
+++ b/ui/cli/tap-follow.c
@@ -45,8 +45,8 @@ typedef struct _cli_follow_info {
register_follow_t* follower;
/* range */
- guint32 chunkMin;
- guint32 chunkMax;
+ uint32_t chunkMin;
+ uint32_t chunkMax;
/* filter */
int stream_index;
@@ -54,7 +54,7 @@ typedef struct _cli_follow_info {
int port[2];
address addr[2];
union {
- guint32 addrBuf_v4;
+ uint32_t addrBuf_v4;
ws_in6_addr addrBuf_v6;
} addrBuf[2];
} cli_follow_info_t;
@@ -117,12 +117,12 @@ follow_free(follow_info_t *follow_info)
static const char bin2hex[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-static void follow_print_hex(const char *prefixp, guint32 offset, void *datap, int len)
+static void follow_print_hex(const char *prefixp, uint32_t offset, void *datap, int len)
{
int ii;
int jj;
int kk;
- guint8 val;
+ uint8_t val;
char line[LINE_LEN + 1];
for (ii = 0, jj = 0, kk = 0; ii < len; )
@@ -141,7 +141,7 @@ static void follow_print_hex(const char *prefixp, guint32 offset, void *datap, i
kk = ASCII_START;
}
- val = ((guint8 *)datap)[ii];
+ val = ((uint8_t *)datap)[ii];
line[jj++] = bin2hex[val >> 4];
line[jj++] = bin2hex[val & 0xf];
@@ -177,17 +177,17 @@ static void follow_draw(void *contextp)
follow_info_t *follow_info = (follow_info_t*)contextp;
cli_follow_info_t* cli_follow_info = (cli_follow_info_t*)follow_info->gui_data;
- gchar buf[WS_INET6_ADDRSTRLEN];
- guint32 global_client_pos = 0, global_server_pos = 0;
- guint32 *global_pos;
- guint32 ii, jj;
+ char buf[WS_INET6_ADDRSTRLEN];
+ uint32_t global_client_pos = 0, global_server_pos = 0;
+ uint32_t *global_pos;
+ uint32_t ii, jj;
char *buffer;
wmem_strbuf_t *strbuf;
GList *cur;
follow_record_t *follow_record;
- guint chunk;
- gchar *b64encoded;
- const guint32 base64_raw_len = 57; /* Encodes to 76 bytes, common in RFCs */
+ unsigned chunk;
+ char *b64encoded;
+ const uint32_t base64_raw_len = 57; /* Encodes to 76 bytes, common in RFCs */
/* Print header */
switch (cli_follow_info->show_type)
@@ -342,7 +342,7 @@ static void follow_draw(void *contextp)
printf(" data: !!binary |\n");
ii = 0;
while (ii < follow_record->data->len) {
- guint32 len = ii + base64_raw_len < follow_record->data->len
+ uint32_t len = ii + base64_raw_len < follow_record->data->len
? base64_raw_len
: follow_record->data->len - ii;
b64encoded = g_base64_encode(&follow_record->data->data[ii], len);
@@ -369,16 +369,16 @@ static void follow_draw(void *contextp)
}
}
-static gboolean follow_arg_strncmp(const char **opt_argp, const char *strp)
+static bool follow_arg_strncmp(const char **opt_argp, const char *strp)
{
size_t len = strlen(strp);
if (strncmp(*opt_argp, strp, len) == 0)
{
*opt_argp += len;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
static void
@@ -431,7 +431,7 @@ follow_arg_filter(const char **opt_argp, follow_info_t *follow_info)
unsigned int ii;
char addr[ADDR_LEN];
cli_follow_info_t* cli_follow_info = (cli_follow_info_t*)follow_info->gui_data;
- gboolean is_ipv6;
+ bool is_ipv6;
if (sscanf(*opt_argp, ",%d%n", &cli_follow_info->stream_index, &len) == 1 &&
((*opt_argp)[len] == 0 || (*opt_argp)[len] == ','))
@@ -448,22 +448,22 @@ follow_arg_filter(const char **opt_argp, follow_info_t *follow_info)
}
else
{
- for (ii = 0; ii < sizeof cli_follow_info->addr/sizeof *cli_follow_info->addr; ii++)
+ for (ii = 0; ii < array_length(cli_follow_info->addr); ii++)
{
if (sscanf(*opt_argp, ADDRv6_FMT, addr, &cli_follow_info->port[ii], &len) == 2)
{
- is_ipv6 = TRUE;
+ is_ipv6 = true;
}
else if (sscanf(*opt_argp, ADDRv4_FMT, addr, &cli_follow_info->port[ii], &len) == 2)
{
- is_ipv6 = FALSE;
+ is_ipv6 = false;
}
else
{
follow_exit("Invalid address.");
}
- if (cli_follow_info->port[ii] <= 0 || cli_follow_info->port[ii] > G_MAXUINT16)
+ if (cli_follow_info->port[ii] <= 0 || cli_follow_info->port[ii] > UINT16_MAX)
{
follow_exit("Invalid port.");
}
@@ -503,7 +503,7 @@ static void follow_arg_range(const char **opt_argp, cli_follow_info_t* cli_follo
if (**opt_argp == 0)
{
cli_follow_info->chunkMin = 1;
- cli_follow_info->chunkMax = G_MAXUINT32;
+ cli_follow_info->chunkMax = UINT32_MAX;
}
else
{
@@ -605,7 +605,7 @@ follow_register(const void *key _U_, void *value, void *userdata _U_)
{
register_follow_t *follower = (register_follow_t*)value;
stat_tap_ui follow_ui;
- gchar *cli_string;
+ char *cli_string;
cli_string = follow_get_stat_tap_string(follower);
follow_ui.group = REGISTER_STAT_GROUP_GENERIC;
@@ -616,7 +616,7 @@ follow_register(const void *key _U_, void *value, void *userdata _U_)
follow_ui.params = NULL;
register_stat_tap_ui(&follow_ui, follower);
g_free(cli_string);
- return FALSE;
+ return false;
}
void
diff --git a/ui/cli/tap-funnel.c b/ui/cli/tap-funnel.c
index 9adfc296..fa30a363 100644
--- a/ui/cli/tap-funnel.c
+++ b/ui/cli/tap-funnel.c
@@ -25,13 +25,13 @@
void register_tap_listener_funnel(void);
struct _funnel_text_window_t {
- gchar *title;
+ char *title;
GString *text;
};
-static GPtrArray *text_windows = NULL;
+static GPtrArray *text_windows;
-static funnel_text_window_t *new_text_window(funnel_ops_id_t *ops_id _U_, const gchar *title) {
+static funnel_text_window_t *new_text_window(funnel_ops_id_t *ops_id _U_, const char *title) {
funnel_text_window_t *tw = g_new(funnel_text_window_t, 1);
tw->title = g_strdup(title);
tw->text = g_string_new("");
@@ -62,7 +62,7 @@ static void text_window_prepend(funnel_text_window_t *tw, const char *text) {
g_string_prepend(tw->text, text);
}
-static const gchar *text_window_get_text(funnel_text_window_t *tw) {
+static const char *text_window_get_text(funnel_text_window_t *tw) {
return tw->text->str;
}
@@ -107,7 +107,7 @@ void initialize_funnel_ops(void) {
void funnel_dump_all_text_windows(void) {
- guint i;
+ unsigned i;
if (!text_windows) return;
@@ -125,16 +125,16 @@ void funnel_dump_all_text_windows(void) {
#if 0
-GHashTable *menus = NULL;
+GHashTable *menus;
typedef struct _menu_cb_t {
- void (*callback)(gpointer);
+ void (*callback)(void *);
void *callback_data;
} menu_cb_t;
static void init_funnel_cmd(const char *opt_arg, void *data ) {
- gchar **args = g_strsplit(opt_arg, ",", 0);
- gchar **arg;
+ char **args = g_strsplit(opt_arg, ",", 0);
+ char **arg;
menu_cb_t *mcb = data;
for (arg = args; *arg ; arg++) {
@@ -149,9 +149,9 @@ static void init_funnel_cmd(const char *opt_arg, void *data ) {
static void register_menu_cb(const char *name,
register_stat_group_t group _U_,
- void (*callback)(gpointer),
- gpointer callback_data,
- gboolean retap _U_) {
+ void (*callback)(void *),
+ void *callback_data,
+ bool retap _U_) {
menu_cb_t* mcb = g_new(menu_cb_t, 1);
stat_tap_ui ui_info;
diff --git a/ui/cli/tap-gsm_astat.c b/ui/cli/tap-gsm_astat.c
index 1f0a7924..8ecf9384 100644
--- a/ui/cli/tap-gsm_astat.c
+++ b/ui/cli/tap-gsm_astat.c
@@ -125,7 +125,7 @@ gsm_a_stat_draw(
void *tapdata)
{
gsm_a_stat_t *stat_p = (gsm_a_stat_t *)tapdata;
- guint8 i;
+ uint8_t i;
printf("\n");
diff --git a/ui/cli/tap-hosts.c b/ui/cli/tap-hosts.c
index c854e9e9..60a1c2b9 100644
--- a/ui/cli/tap-hosts.c
+++ b/ui/cli/tap-hosts.c
@@ -25,13 +25,13 @@
void register_tap_listener_hosts(void);
-static gboolean dump_v4 = FALSE;
-static gboolean dump_v6 = FALSE;
+static bool dump_v4;
+static bool dump_v6;
#define TAP_NAME "hosts"
static void
-ipv4_hash_table_print_resolved(gpointer key _U_, gpointer value, gpointer user_data _U_)
+ipv4_hash_table_print_resolved(void *key _U_, void *value, void *user_data _U_)
{
hashipv4_t *ipv4_hash_table_entry = (hashipv4_t *)value;
@@ -43,7 +43,7 @@ ipv4_hash_table_print_resolved(gpointer key _U_, gpointer value, gpointer user_d
}
static void
-ipv6_hash_table_print_resolved(gpointer key _U_, gpointer value, gpointer user_data _U_)
+ipv6_hash_table_print_resolved(void *key _U_, void *value, void *user_data _U_)
{
hashipv6_t *ipv6_hash_table_entry = (hashipv6_t *)value;
@@ -88,25 +88,25 @@ static void
hosts_init(const char *opt_arg, void *userdata _U_)
{
GString *error_string;
- gchar **tokens;
- gint opt_count;
+ char **tokens;
+ int opt_count;
- dump_v4 = FALSE;
- dump_v6 = FALSE;
+ dump_v4 = false;
+ dump_v6 = false;
if (strcmp(TAP_NAME, opt_arg) == 0) {
/* No arguments; dump everything */
- dump_v4 = TRUE;
- dump_v6 = TRUE;
+ dump_v4 = true;
+ dump_v6 = true;
} else {
tokens = g_strsplit(opt_arg, ",", 0);
opt_count = 0;
while (tokens[opt_count]) {
if ((strcmp("ipv4", tokens[opt_count]) == 0) ||
(strcmp("ip", tokens[opt_count]) == 0)) {
- dump_v4 = TRUE;
+ dump_v4 = true;
} else if (strcmp("ipv6", tokens[opt_count]) == 0) {
- dump_v6 = TRUE;
+ dump_v6 = true;
} else if (opt_count > 0) {
cmdarg_err("invalid \"-z " TAP_NAME "[,ip|ipv4|ipv6]\" argument");
exit(1);
diff --git a/ui/cli/tap-httpstat.c b/ui/cli/tap-httpstat.c
index 7a5e593e..4fe43575 100644
--- a/ui/cli/tap-httpstat.c
+++ b/ui/cli/tap-httpstat.c
@@ -39,16 +39,16 @@ typedef struct _http_stats_t {
* for example it can be { 3, 404, "Not Found" ,...}
* which means we captured 3 reply http/1.1 404 Not Found */
typedef struct _http_response_code_t {
- guint32 packets; /* 3 */
- guint response_code; /* 404 */
- const gchar *name; /* Not Found */
+ uint32_t packets; /* 3 */
+ unsigned response_code; /* 404 */
+ const char *name; /* Not Found */
httpstat_t *sp;
} http_response_code_t;
/* used to keep track of the stats for a specific request string */
typedef struct _http_request_methode_t {
- gchar *response; /* eg. : GET */
- guint32 packets;
+ char *response; /* eg. : GET */
+ uint32_t packets;
httpstat_t *sp;
} http_request_methode_t;
@@ -74,7 +74,7 @@ http_init_hash(httpstat_t *sp)
}
static void
-http_draw_hash_requests(gchar *key _U_, http_request_methode_t *data, gchar *format)
+http_draw_hash_requests(char *key _U_, http_request_methode_t *data, char *format)
{
if (data->packets == 0)
return;
@@ -82,7 +82,7 @@ http_draw_hash_requests(gchar *key _U_, http_request_methode_t *data, gchar *for
}
static void
-http_draw_hash_responses(gint * key _U_, http_response_code_t *data, char *format)
+http_draw_hash_responses(int * key _U_, http_response_code_t *data, char *format)
{
if (data == NULL) {
ws_warning("No data available, key=%d\n", *key);
@@ -98,19 +98,19 @@ http_draw_hash_responses(gint * key _U_, http_response_code_t *data, char *forma
/* NOT USED at this moment */
/*
static void
-http_free_hash(gpointer key, gpointer value, gpointer user_data _U_)
+http_free_hash(void *key, void *value, void *user_data _U_)
{
g_free(key);
g_free(value);
}
*/
static void
-http_reset_hash_responses(gchar *key _U_, http_response_code_t *data, gpointer ptr _U_)
+http_reset_hash_responses(char *key _U_, http_response_code_t *data, void *ptr _U_)
{
data->packets = 0;
}
static void
-http_reset_hash_requests(gchar *key _U_, http_request_methode_t *data, gpointer ptr _U_)
+http_reset_hash_requests(char *key _U_, http_request_methode_t *data, void *ptr _U_)
{
data->packets = 0;
}
@@ -146,7 +146,7 @@ httpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons
/* Request or reply packets ? */
if (value->response_code != 0) {
http_response_code_t *sc;
- guint key = value->response_code;
+ unsigned key = value->response_code;
sc = (http_response_code_t *)g_hash_table_lookup(
sp->hash_responses,
@@ -217,10 +217,10 @@ httpstat_draw(void *psp)
printf("* HTTP Response Status Codes Packets\n");
g_hash_table_foreach(sp->hash_responses, (GHFunc)http_draw_hash_responses,
- (gpointer)" %3d %-35s %9d\n");
+ (void *)" %3d %-35s %9d\n");
printf("* HTTP Request Methods Packets\n");
g_hash_table_foreach(sp->hash_requests, (GHFunc)http_draw_hash_requests,
- (gpointer)" %-39s %9d \n");
+ (void *)" %-39s %9d \n");
printf("===================================================================\n");
}
diff --git a/ui/cli/tap-icmpstat.c b/ui/cli/tap-icmpstat.c
index ac0f6423..673b20d7 100644
--- a/ui/cli/tap-icmpstat.c
+++ b/ui/cli/tap-icmpstat.c
@@ -36,10 +36,10 @@ void register_tap_listener_icmpstat(void);
typedef struct _icmpstat_t {
char *filter;
GSList *rt_list;
- guint num_rqsts;
- guint num_resps;
- guint min_frame;
- guint max_frame;
+ unsigned num_rqsts;
+ unsigned num_resps;
+ unsigned min_frame;
+ unsigned max_frame;
double min_msecs;
double max_msecs;
double tot_msecs;
@@ -64,11 +64,11 @@ icmpstat_reset(void *tapdata)
g_slist_free(icmpstat->rt_list);
memset(icmpstat, 0, sizeof(icmpstat_t));
- icmpstat->min_msecs = 1.0 * G_MAXUINT;
+ icmpstat->min_msecs = 1.0 * UINT_MAX;
}
-static gint compare_doubles(gconstpointer a, gconstpointer b)
+static int compare_doubles(const void *a, const void *b)
{
double ad, bd;
@@ -237,7 +237,7 @@ icmpstat_draw(void *tapdata)
100.0 * lost / icmpstat->num_rqsts);
printf("Minimum Maximum Mean Median SDeviation Min Frame Max Frame\n");
printf("%-10.3f%-10.3f%-10.3f%-10.3f%-10.3f %-10u%-10u\n",
- icmpstat->min_msecs >= G_MAXUINT ? 0.0 : icmpstat->min_msecs,
+ icmpstat->min_msecs >= UINT_MAX ? 0.0 : icmpstat->min_msecs,
icmpstat->max_msecs, mean, med, sdev,
icmpstat->min_frame, icmpstat->max_frame);
} else {
@@ -271,7 +271,7 @@ icmpstat_init(const char *opt_arg, void *userdata _U_)
exit(1);
}
memset(icmpstat, 0, sizeof(icmpstat_t));
- icmpstat->min_msecs = 1.0 * G_MAXUINT;
+ icmpstat->min_msecs = 1.0 * UINT_MAX;
icmpstat->filter = g_strdup(filter);
diff --git a/ui/cli/tap-icmpv6stat.c b/ui/cli/tap-icmpv6stat.c
index 94f8692a..627c9de2 100644
--- a/ui/cli/tap-icmpv6stat.c
+++ b/ui/cli/tap-icmpv6stat.c
@@ -37,10 +37,10 @@ void register_tap_listener_icmpv6stat(void);
typedef struct _icmpv6stat_t {
char *filter;
GSList *rt_list;
- guint num_rqsts;
- guint num_resps;
- guint min_frame;
- guint max_frame;
+ unsigned num_rqsts;
+ unsigned num_resps;
+ unsigned min_frame;
+ unsigned max_frame;
double min_msecs;
double max_msecs;
double tot_msecs;
@@ -65,11 +65,11 @@ icmpv6stat_reset(void *tapdata)
g_slist_free(icmpv6stat->rt_list);
memset(icmpv6stat, 0, sizeof(icmpv6stat_t));
- icmpv6stat->min_msecs = 1.0 * G_MAXUINT;
+ icmpv6stat->min_msecs = 1.0 * UINT_MAX;
}
-static gint compare_doubles(gconstpointer a, gconstpointer b)
+static int compare_doubles(const void *a, const void *b)
{
double ad, bd;
@@ -238,7 +238,7 @@ icmpv6stat_draw(void *tapdata)
100.0 * lost / icmpv6stat->num_rqsts);
printf("Minimum Maximum Mean Median SDeviation Min Frame Max Frame\n");
printf("%-10.3f%-10.3f%-10.3f%-10.3f%-10.3f %-10u%-10u\n",
- icmpv6stat->min_msecs >= G_MAXUINT ? 0.0 : icmpv6stat->min_msecs,
+ icmpv6stat->min_msecs >= UINT_MAX ? 0.0 : icmpv6stat->min_msecs,
icmpv6stat->max_msecs, mean, med, sdev,
icmpv6stat->min_frame, icmpv6stat->max_frame);
} else {
@@ -272,7 +272,7 @@ icmpv6stat_init(const char *opt_arg, void *userdata _U_)
exit(1);
}
memset(icmpv6stat, 0, sizeof(icmpv6stat_t));
- icmpv6stat->min_msecs = 1.0 * G_MAXUINT;
+ icmpv6stat->min_msecs = 1.0 * UINT_MAX;
icmpv6stat->filter = g_strdup(filter);
diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c
index 83810b23..2ba79a2c 100644
--- a/ui/cli/tap-iostat.c
+++ b/ui/cli/tap-iostat.c
@@ -50,34 +50,37 @@ static calc_type_ent_t calc_type_table[] = {
};
typedef struct _io_stat_t {
- guint64 interval; /* The user-specified time interval (us) */
- guint invl_prec; /* Decimal precision of the time interval (1=10s, 2=100s etc) */
+ uint64_t interval; /* The user-specified time interval (us) */
+ unsigned invl_prec; /* Decimal precision of the time interval (1=10s, 2=100s etc) */
unsigned int num_cols; /* The number of columns of stats in the table */
struct _io_stat_item_t *items; /* Each item is a single cell in the table */
time_t start_time; /* Time of first frame matching the filter */
+ /* The following are all per-column fixed information arrays */
const char **filters; /* 'io,stat' cmd strings (e.g., "AVG(smb.time)smb.time") */
- guint64 *max_vals; /* The max value sans the decimal or nsecs portion in each stat column */
- guint32 *max_frame; /* The max frame number displayed in each stat column */
+ uint64_t *max_vals; /* The max value sans the decimal or nsecs portion in each stat column */
+ uint32_t *max_frame; /* The max frame number displayed in each stat column */
+ int *hf_indexes;
+ int *calc_type; /* The statistic type */
} io_stat_t;
typedef struct _io_stat_item_t {
io_stat_t *parent;
struct _io_stat_item_t *next;
struct _io_stat_item_t *prev;
- guint64 start_time; /* Time since start of capture (us)*/
- int calc_type; /* The statistic type */
+ uint64_t start_time; /* Time since start of capture (us)*/
int colnum; /* Column number of this stat (0 to n) */
- int hf_index;
- guint32 frames;
- guint32 num; /* The sample size of a given statistic (only needed for AVG) */
- guint64 counter; /* The accumulated data for the calculation of that statistic */
- gfloat float_counter;
- gdouble double_counter;
+ uint32_t frames;
+ uint32_t num; /* The sample size of a given statistic (only needed for AVG) */
+ union { /* The accumulated data for the calculation of that statistic */
+ uint64_t counter;
+ float float_counter;
+ double double_counter;
+ };
} io_stat_item_t;
-#define NANOSECS_PER_SEC G_GUINT64_CONSTANT(1000000000)
+#define NANOSECS_PER_SEC UINT64_C(1000000000)
-static guint64 last_relative_time;
+static uint64_t last_relative_time;
static tap_packet_status
iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_, tap_flags_t flags _U_)
@@ -85,10 +88,10 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
io_stat_t *parent;
io_stat_item_t *mit;
io_stat_item_t *it;
- guint64 relative_time, rt;
+ uint64_t relative_time, rt;
const nstime_t *new_time;
GPtrArray *gp;
- guint i;
+ unsigned i;
int ftype;
mit = (io_stat_item_t *) arg;
@@ -97,8 +100,8 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
/* If this frame's relative time is negative, set its relative time to last_relative_time
rather than disincluding it from the calculations. */
if ((pinfo->rel_ts.secs >= 0) && (pinfo->rel_ts.nsecs >= 0)) {
- relative_time = ((guint64)pinfo->rel_ts.secs * G_GUINT64_CONSTANT(1000000)) +
- ((guint64)((pinfo->rel_ts.nsecs+500)/1000));
+ relative_time = ((uint64_t)pinfo->rel_ts.secs * UINT64_C(1000000)) +
+ ((uint64_t)((pinfo->rel_ts.nsecs+500)/1000));
last_relative_time = relative_time;
} else {
relative_time = last_relative_time;
@@ -124,37 +127,33 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
it->start_time = it->prev->start_time + parent->interval;
it->frames = 0;
- it->counter = 0;
- it->float_counter = 0;
- it->double_counter = 0;
+ it->counter = 0; /* 64-bit, type-punning with double is fine */
it->num = 0;
- it->calc_type = it->prev->calc_type;
- it->hf_index = it->prev->hf_index;
it->colnum = it->prev->colnum;
}
/* Store info in the current structure */
it->frames++;
- switch (it->calc_type) {
+ switch (parent->calc_type[it->colnum]) {
case CALC_TYPE_FRAMES:
case CALC_TYPE_BYTES:
case CALC_TYPE_FRAMES_AND_BYTES:
it->counter += pinfo->fd->pkt_len;
break;
case CALC_TYPE_COUNT:
- gp = proto_get_finfo_ptr_array(edt->tree, it->hf_index);
+ gp = proto_get_finfo_ptr_array(edt->tree, parent->hf_indexes[it->colnum]);
if (gp) {
it->counter += gp->len;
}
break;
case CALC_TYPE_SUM:
- gp = proto_get_finfo_ptr_array(edt->tree, it->hf_index);
+ gp = proto_get_finfo_ptr_array(edt->tree, parent->hf_indexes[it->colnum]);
if (gp) {
- guint64 val;
+ uint64_t val;
for (i=0; i<gp->len; i++) {
- switch (proto_registrar_get_ftype(it->hf_index)) {
+ switch (proto_registrar_get_ftype(parent->hf_indexes[it->colnum])) {
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
@@ -177,18 +176,18 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case FT_INT48:
case FT_INT56:
case FT_INT64:
- it->counter += (gint64)fvalue_get_sinteger64(((field_info *)gp->pdata[i])->value);
+ it->counter += (int64_t)fvalue_get_sinteger64(((field_info *)gp->pdata[i])->value);
break;
case FT_FLOAT:
it->float_counter +=
- (gfloat)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
+ (float)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
break;
case FT_DOUBLE:
it->double_counter += fvalue_get_floating(((field_info *)gp->pdata[i])->value);
break;
case FT_RELATIVE_TIME:
new_time = fvalue_get_time(((field_info *)gp->pdata[i])->value);
- val = ((guint64)new_time->secs * NANOSECS_PER_SEC) + (guint64)new_time->nsecs;
+ val = ((uint64_t)new_time->secs * NANOSECS_PER_SEC) + (uint64_t)new_time->nsecs;
it->counter += val;
break;
default:
@@ -203,13 +202,13 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
}
break;
case CALC_TYPE_MIN:
- gp = proto_get_finfo_ptr_array(edt->tree, it->hf_index);
+ gp = proto_get_finfo_ptr_array(edt->tree, parent->hf_indexes[it->colnum]);
if (gp) {
- guint64 val;
- gfloat float_val;
- gdouble double_val;
+ uint64_t val;
+ float float_val;
+ double double_val;
- ftype = proto_registrar_get_ftype(it->hf_index);
+ ftype = proto_registrar_get_ftype(parent->hf_indexes[it->colnum]);
for (i=0; i<gp->len; i++) {
switch (ftype) {
case FT_UINT8:
@@ -235,7 +234,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case FT_INT24:
case FT_INT32:
val = fvalue_get_sinteger(((field_info *)gp->pdata[i])->value);
- if ((it->frames == 1 && i == 0) || ((gint32)val < (gint32)it->counter)) {
+ if ((it->frames == 1 && i == 0) || ((int32_t)val < (int32_t)it->counter)) {
it->counter = val;
}
break;
@@ -244,12 +243,12 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case FT_INT56:
case FT_INT64:
val = fvalue_get_sinteger64(((field_info *)gp->pdata[i])->value);
- if ((it->frames == 1 && i == 0) || ((gint64)val < (gint64)it->counter)) {
+ if ((it->frames == 1 && i == 0) || ((int64_t)val < (int64_t)it->counter)) {
it->counter = val;
}
break;
case FT_FLOAT:
- float_val = (gfloat)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
+ float_val = (float)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
if ((it->frames == 1 && i == 0) || (float_val < it->float_counter)) {
it->float_counter = float_val;
}
@@ -262,7 +261,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
break;
case FT_RELATIVE_TIME:
new_time = fvalue_get_time(((field_info *)gp->pdata[i])->value);
- val = ((guint64)new_time->secs * NANOSECS_PER_SEC) + (guint64)new_time->nsecs;
+ val = ((uint64_t)new_time->secs * NANOSECS_PER_SEC) + (uint64_t)new_time->nsecs;
if ((it->frames == 1 && i == 0) || (val < it->counter)) {
it->counter = val;
}
@@ -279,13 +278,13 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
}
break;
case CALC_TYPE_MAX:
- gp = proto_get_finfo_ptr_array(edt->tree, it->hf_index);
+ gp = proto_get_finfo_ptr_array(edt->tree, parent->hf_indexes[it->colnum]);
if (gp) {
- guint64 val;
- gfloat float_val;
- gdouble double_val;
+ uint64_t val;
+ float float_val;
+ double double_val;
- ftype = proto_registrar_get_ftype(it->hf_index);
+ ftype = proto_registrar_get_ftype(parent->hf_indexes[it->colnum]);
for (i=0; i<gp->len; i++) {
switch (ftype) {
case FT_UINT8:
@@ -309,7 +308,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case FT_INT24:
case FT_INT32:
val = fvalue_get_sinteger(((field_info *)gp->pdata[i])->value);
- if ((gint32)val > (gint32)it->counter)
+ if ((int32_t)val > (int32_t)it->counter)
it->counter = val;
break;
case FT_INT40:
@@ -317,11 +316,11 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case FT_INT56:
case FT_INT64:
val = fvalue_get_sinteger64(((field_info *)gp->pdata[i])->value);
- if ((gint64)val > (gint64)it->counter)
+ if ((int64_t)val > (int64_t)it->counter)
it->counter = val;
break;
case FT_FLOAT:
- float_val = (gfloat)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
+ float_val = (float)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
if (float_val > it->float_counter)
it->float_counter = float_val;
break;
@@ -332,7 +331,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
break;
case FT_RELATIVE_TIME:
new_time = fvalue_get_time(((field_info *)gp->pdata[i])->value);
- val = ((guint64)new_time->secs * NANOSECS_PER_SEC) + (guint64)new_time->nsecs;
+ val = ((uint64_t)new_time->secs * NANOSECS_PER_SEC) + (uint64_t)new_time->nsecs;
if (val > it->counter)
it->counter = val;
break;
@@ -348,11 +347,11 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
}
break;
case CALC_TYPE_AVG:
- gp = proto_get_finfo_ptr_array(edt->tree, it->hf_index);
+ gp = proto_get_finfo_ptr_array(edt->tree, parent->hf_indexes[it->colnum]);
if (gp) {
- guint64 val;
+ uint64_t val;
- ftype = proto_registrar_get_ftype(it->hf_index);
+ ftype = proto_registrar_get_ftype(parent->hf_indexes[it->colnum]);
for (i=0; i<gp->len; i++) {
it->num++;
switch (ftype) {
@@ -385,14 +384,14 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
it->counter += val;
break;
case FT_FLOAT:
- it->float_counter += (gfloat)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
+ it->float_counter += (float)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
break;
case FT_DOUBLE:
it->double_counter += fvalue_get_floating(((field_info *)gp->pdata[i])->value);
break;
case FT_RELATIVE_TIME:
new_time = fvalue_get_time(((field_info *)gp->pdata[i])->value);
- val = ((guint64)new_time->secs * NANOSECS_PER_SEC) + (guint64)new_time->nsecs;
+ val = ((uint64_t)new_time->secs * NANOSECS_PER_SEC) + (uint64_t)new_time->nsecs;
it->counter += val;
break;
default:
@@ -407,27 +406,27 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
}
break;
case CALC_TYPE_LOAD:
- gp = proto_get_finfo_ptr_array(edt->tree, it->hf_index);
+ gp = proto_get_finfo_ptr_array(edt->tree, parent->hf_indexes[it->colnum]);
if (gp) {
- ftype = proto_registrar_get_ftype(it->hf_index);
+ ftype = proto_registrar_get_ftype(parent->hf_indexes[it->colnum]);
if (ftype != FT_RELATIVE_TIME) {
fprintf(stderr,
"\ntshark: LOAD() is only supported for relative-time fields such as smb.time\n");
exit(10);
}
for (i=0; i<gp->len; i++) {
- guint64 val;
+ uint64_t val;
int tival;
io_stat_item_t *pit;
new_time = fvalue_get_time(((field_info *)gp->pdata[i])->value);
- val = ((guint64)new_time->secs*G_GUINT64_CONSTANT(1000000)) + (guint64)(new_time->nsecs/1000);
+ val = ((uint64_t)new_time->secs*UINT64_C(1000000)) + (uint64_t)(new_time->nsecs/1000);
tival = (int)(val % parent->interval);
it->counter += tival;
val -= tival;
pit = it->prev;
while (val > 0) {
- if (val < (guint64)parent->interval) {
+ if (val < (uint64_t)parent->interval) {
pit->counter += val;
break;
}
@@ -445,12 +444,12 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
* calc the average, round it to the next second and store the seconds. For all other calc types
* of RELATIVE_TIME fields, store the counters without modification.
* fields. */
- switch (it->calc_type) {
+ switch (parent->calc_type[it->colnum]) {
case CALC_TYPE_FRAMES:
case CALC_TYPE_FRAMES_AND_BYTES:
parent->max_frame[it->colnum] =
MAX(parent->max_frame[it->colnum], it->frames);
- if (it->calc_type == CALC_TYPE_FRAMES_AND_BYTES)
+ if (parent->calc_type[it->colnum] == CALC_TYPE_FRAMES_AND_BYTES)
parent->max_vals[it->colnum] =
MAX(parent->max_vals[it->colnum], it->counter);
break;
@@ -462,15 +461,15 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case CALC_TYPE_SUM:
case CALC_TYPE_MIN:
case CALC_TYPE_MAX:
- ftype = proto_registrar_get_ftype(it->hf_index);
+ ftype = proto_registrar_get_ftype(parent->hf_indexes[it->colnum]);
switch (ftype) {
case FT_FLOAT:
parent->max_vals[it->colnum] =
- MAX(parent->max_vals[it->colnum], (guint64)(it->float_counter+0.5));
+ MAX(parent->max_vals[it->colnum], (uint64_t)(it->float_counter+0.5));
break;
case FT_DOUBLE:
parent->max_vals[it->colnum] =
- MAX(parent->max_vals[it->colnum], (guint64)(it->double_counter+0.5));
+ MAX(parent->max_vals[it->colnum], (uint64_t)(it->double_counter+0.5));
break;
case FT_RELATIVE_TIME:
parent->max_vals[it->colnum] =
@@ -486,19 +485,19 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
case CALC_TYPE_AVG:
if (it->num == 0) /* avoid division by zero */
break;
- ftype = proto_registrar_get_ftype(it->hf_index);
+ ftype = proto_registrar_get_ftype(parent->hf_indexes[it->colnum]);
switch (ftype) {
case FT_FLOAT:
parent->max_vals[it->colnum] =
- MAX(parent->max_vals[it->colnum], (guint64)it->float_counter/it->num);
+ MAX(parent->max_vals[it->colnum], (uint64_t)it->float_counter/it->num);
break;
case FT_DOUBLE:
parent->max_vals[it->colnum] =
- MAX(parent->max_vals[it->colnum], (guint64)it->double_counter/it->num);
+ MAX(parent->max_vals[it->colnum], (uint64_t)it->double_counter/it->num);
break;
case FT_RELATIVE_TIME:
parent->max_vals[it->colnum] =
- MAX(parent->max_vals[it->colnum], ((it->counter/(guint64)it->num) + G_GUINT64_CONSTANT(500000000)) / NANOSECS_PER_SEC);
+ MAX(parent->max_vals[it->colnum], ((it->counter/(uint64_t)it->num) + UINT64_C(500000000)) / NANOSECS_PER_SEC);
break;
default:
/* UINT16-64 and INT8-64 */
@@ -511,7 +510,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du
}
static unsigned int
-magnitude (guint64 val, unsigned int max_w)
+magnitude (uint64_t val, unsigned int max_w)
{
unsigned int i, mag = 0;
@@ -553,8 +552,8 @@ typedef struct {
static void
iostat_draw(void *arg)
{
- guint32 num;
- guint64 interval, duration, t, invl_end, dv;
+ uint32_t num;
+ uint64_t interval, duration, t, invl_end, dv;
unsigned int i, j, k, num_cols, num_rows, dur_secs_orig, dur_nsecs_orig, dur_secs, dur_nsecs, dur_mag,
invl_mag, invl_prec, tabrow_w, borderlen, invl_col_w, numpad = 1, namelen, len_filt, type,
maxfltr_w, ftype;
@@ -562,9 +561,9 @@ iostat_draw(void *arg)
unsigned int val_mag; /* The magnitude of the max value in this column */
char *spaces, *spaces_s, *filler_s = NULL, **fmts, *fmt = NULL;
const char *filter;
- static gchar dur_mag_s[3], invl_prec_s[3], fr_mag_s[3], val_mag_s[3], *invl_fmt, *full_fmt;
+ static char dur_mag_s[3], invl_prec_s[3], fr_mag_s[3], val_mag_s[3], *invl_fmt, *full_fmt;
io_stat_item_t *mit, **stat_cols, *item, **item_in_column;
- gboolean last_row = FALSE;
+ bool last_row = false;
io_stat_t *iot;
column_width *col_w;
struct tm *tm_time;
@@ -575,8 +574,8 @@ iostat_draw(void *arg)
num_cols = iot->num_cols;
col_w = g_new(column_width, num_cols);
fmts = (char **)g_malloc(sizeof(char *) * num_cols);
- duration = ((guint64)cfile.elapsed_time.secs * G_GUINT64_CONSTANT(1000000)) +
- (guint64)((cfile.elapsed_time.nsecs + 500) / 1000);
+ duration = ((uint64_t)cfile.elapsed_time.secs * UINT64_C(1000000)) +
+ (uint64_t)((cfile.elapsed_time.nsecs + 500) / 1000);
/* Store the pointer to each stat column */
stat_cols = (io_stat_item_t **)g_malloc(sizeof(io_stat_item_t *) * num_cols);
@@ -585,23 +584,23 @@ iostat_draw(void *arg)
/* The following prevents gross inaccuracies when the user specifies an interval that is greater
* than the capture duration. */
- if (iot->interval > duration || iot->interval == G_MAXUINT64) {
+ if (iot->interval > duration || iot->interval == UINT64_MAX) {
interval = duration;
- iot->interval = G_MAXUINT64;
+ iot->interval = UINT64_MAX;
} else {
interval = iot->interval;
}
/* Calc the capture duration's magnitude (dur_mag) */
- dur_secs = (unsigned int)(duration/G_GUINT64_CONSTANT(1000000));
+ dur_secs = (unsigned int)(duration/UINT64_C(1000000));
dur_secs_orig = dur_secs;
- dur_nsecs = (unsigned int)(duration%G_GUINT64_CONSTANT(1000000));
+ dur_nsecs = (unsigned int)(duration%UINT64_C(1000000));
dur_nsecs_orig = dur_nsecs;
- dur_mag = magnitude((guint64)dur_secs, 5);
+ dur_mag = magnitude((uint64_t)dur_secs, 5);
snprintf(dur_mag_s, 3, "%u", dur_mag);
/* Calc the interval's magnitude */
- invl_mag = magnitude(interval/G_GUINT64_CONSTANT(1000000), 5);
+ invl_mag = magnitude(interval/UINT64_C(1000000), 5);
/* Set or get the interval precision */
if (interval == duration) {
@@ -628,13 +627,13 @@ iostat_draw(void *arg)
if ((duration%dv) > 5*(dv/10)) {
duration += 5*(dv/10);
duration = (duration/dv) * dv;
- dur_secs = (unsigned int)(duration/G_GUINT64_CONSTANT(1000000));
- dur_nsecs = (unsigned int)(duration%G_GUINT64_CONSTANT(1000000));
+ dur_secs = (unsigned int)(duration/UINT64_C(1000000));
+ dur_nsecs = (unsigned int)(duration%UINT64_C(1000000));
/*
* Recalc dur_mag in case rounding has increased its magnitude */
- dur_mag = magnitude((guint64)dur_secs, 5);
+ dur_mag = magnitude((uint64_t)dur_secs, 5);
}
- if (iot->interval == G_MAXUINT64)
+ if (iot->interval == UINT64_MAX)
interval = duration;
/* Calc the width of the time interval column (incl borders and padding). */
@@ -665,7 +664,7 @@ iostat_draw(void *arg)
* is an *integer*. */
tabrow_w = invl_col_w;
for (j=0; j<num_cols; j++) {
- type = iot->items[j].calc_type;
+ type = iot->calc_type[j];
if (type == CALC_TYPE_FRAMES_AND_BYTES) {
namelen = 5;
} else {
@@ -708,7 +707,7 @@ iostat_draw(void *arg)
break;
default:
- ftype = proto_registrar_get_ftype(stat_cols[j]->hf_index);
+ ftype = proto_registrar_get_ftype(iot->hf_indexes[j]);
switch (ftype) {
case FT_FLOAT:
case FT_DOUBLE:
@@ -723,7 +722,7 @@ iostat_draw(void *arg)
if (type == CALC_TYPE_LOAD) {
iot->max_vals[j] /= interval;
} else if (type != CALC_TYPE_AVG) {
- iot->max_vals[j] = (iot->max_vals[j] + G_GUINT64_CONSTANT(500000000)) / NANOSECS_PER_SEC;
+ iot->max_vals[j] = (iot->max_vals[j] + UINT64_C(500000000)) / NANOSECS_PER_SEC;
}
val_mag = magnitude(iot->max_vals[j], 15);
snprintf(val_mag_s, 3, "%u", val_mag);
@@ -808,7 +807,7 @@ iostat_draw(void *arg)
g_free(full_fmt);
full_fmt = g_strconcat("| Interval: ", invl_fmt, " secs%s|\n", NULL);
spaces_s = &spaces[18 + dur_mag];
- printf(full_fmt, (guint32)(interval/G_GUINT64_CONSTANT(1000000)), spaces_s);
+ printf(full_fmt, (uint32_t)(interval/UINT64_C(1000000)), spaces_s);
} else {
snprintf(invl_prec_s, 3, "%u", invl_prec);
invl_fmt = g_strconcat("%", dur_mag_s, "u.%0", invl_prec_s, "u", NULL);
@@ -819,8 +818,8 @@ iostat_draw(void *arg)
full_fmt = g_strconcat("| Interval: ", invl_fmt, " secs%s|\n", NULL);
spaces_s = &spaces[19 + dur_mag + invl_prec];
- printf(full_fmt, (guint32)(interval/G_GUINT64_CONSTANT(1000000)),
- (guint32)((interval%G_GUINT64_CONSTANT(1000000))/dv), spaces_s);
+ printf(full_fmt, (uint32_t)(interval/UINT64_C(1000000)),
+ (uint32_t)((interval%UINT64_C(1000000))/dv), spaces_s);
}
g_free(full_fmt);
@@ -850,24 +849,24 @@ iostat_draw(void *arg)
}
printf("|\n");
} else {
- gchar *sfilter1, *sfilter2;
- const gchar *pos;
- gsize len;
+ char *sfilter1, *sfilter2;
+ const char *pos;
+ size_t len;
unsigned int next_start, max_w = borderlen-11;
do {
if (len_filt > max_w) {
- sfilter1 = g_strndup(filter, (gsize) max_w);
+ sfilter1 = g_strndup(filter, (size_t) max_w);
/*
* Find the pos of the last space in sfilter1. If a space is found, set
* sfilter2 to the string prior to that space and print it; otherwise, wrap
* the filter at max_w. */
pos = g_strrstr(sfilter1, " ");
if (pos) {
- len = (gsize)(pos-sfilter1);
+ len = (size_t)(pos-sfilter1);
next_start = (unsigned int) len+1;
} else {
- len = (gsize) strlen(sfilter1);
+ len = (size_t) strlen(sfilter1);
next_start = (unsigned int)len;
}
sfilter2 = g_strndup(sfilter1, len);
@@ -899,10 +898,9 @@ iostat_draw(void *arg)
/* Display column number headers */
for (j=0; j<num_cols; j++) {
- item = stat_cols[j];
- if (item->calc_type == CALC_TYPE_FRAMES_AND_BYTES)
+ if (iot->calc_type[j] == CALC_TYPE_FRAMES_AND_BYTES)
spaces_s = &spaces[borderlen - (col_w[j].fr + col_w[j].val)] - 3;
- else if (item->calc_type == CALC_TYPE_FRAMES)
+ else if (iot->calc_type[j] == CALC_TYPE_FRAMES)
spaces_s = &spaces[borderlen - col_w[j].fr];
else
spaces_s = &spaces[borderlen - col_w[j].val];
@@ -939,7 +937,7 @@ iostat_draw(void *arg)
/* Display the stat label in each column */
for (j=0; j<num_cols; j++) {
- type = stat_cols[j]->calc_type;
+ type = iot->calc_type[j];
if (type == CALC_TYPE_FRAMES) {
printcenter (calc_type_table[type].func_name, col_w[j].fr, numpad);
} else if (type == CALC_TYPE_FRAMES_AND_BYTES) {
@@ -985,7 +983,7 @@ iostat_draw(void *arg)
for (i=0; i<num_rows; i++) {
if (i == num_rows-1)
- last_row = TRUE;
+ last_row = true;
/* Compute the interval for this row */
if (!last_row) {
@@ -996,7 +994,7 @@ iostat_draw(void *arg)
/* Patch for Absolute Time */
/* XXX - has a Y2.038K problem with 32-bit time_t */
- the_time = (time_t)(iot->start_time + (t/G_GUINT64_CONSTANT(1000000)));
+ the_time = (time_t)(iot->start_time + (t/UINT64_C(1000000)));
/* Display the interval for this row */
switch (timestamp_get_type()) {
@@ -1087,16 +1085,16 @@ iostat_draw(void *arg)
full_fmt = g_strconcat( dur_mag == 1 ? "| " : "| ",
invl_fmt, " <> ", "%-",
dur_mag_s, "s|", NULL);
- printf(full_fmt, (guint32)(t/G_GUINT64_CONSTANT(1000000)), "Dur");
+ printf(full_fmt, (uint32_t)(t/UINT64_C(1000000)), "Dur");
} else {
- printf(full_fmt, (guint32)(t/G_GUINT64_CONSTANT(1000000)),
- (guint32)(invl_end/G_GUINT64_CONSTANT(1000000)));
+ printf(full_fmt, (uint32_t)(t/UINT64_C(1000000)),
+ (uint32_t)(invl_end/UINT64_C(1000000)));
}
} else {
- printf(full_fmt, (guint32)(t/G_GUINT64_CONSTANT(1000000)),
- (guint32)(t%G_GUINT64_CONSTANT(1000000) / dv),
- (guint32)(invl_end/G_GUINT64_CONSTANT(1000000)),
- (guint32)(invl_end%G_GUINT64_CONSTANT(1000000) / dv));
+ printf(full_fmt, (uint32_t)(t/UINT64_C(1000000)),
+ (uint32_t)(t%UINT64_C(1000000) / dv),
+ (uint32_t)(invl_end/UINT64_C(1000000)),
+ (uint32_t)(invl_end%UINT64_C(1000000) / dv));
}
break;
/* case TS_DELTA:
@@ -1111,9 +1109,10 @@ iostat_draw(void *arg)
for (j=0; j<num_cols; j++) {
fmt = fmts[j];
item = item_in_column[j];
+ type = iot->calc_type[j];
if (item) {
- switch (item->calc_type) {
+ switch (type) {
case CALC_TYPE_FRAMES:
printf(fmt, item->frames);
break;
@@ -1128,7 +1127,7 @@ iostat_draw(void *arg)
case CALC_TYPE_SUM:
case CALC_TYPE_MIN:
case CALC_TYPE_MAX:
- ftype = proto_registrar_get_ftype(stat_cols[j]->hf_index);
+ ftype = proto_registrar_get_ftype(iot->hf_indexes[j]);
switch (ftype) {
case FT_FLOAT:
printf(fmt, item->float_counter);
@@ -1137,10 +1136,10 @@ iostat_draw(void *arg)
printf(fmt, item->double_counter);
break;
case FT_RELATIVE_TIME:
- item->counter = (item->counter + G_GUINT64_CONSTANT(500)) / G_GUINT64_CONSTANT(1000);
+ item->counter = (item->counter + UINT64_C(500)) / UINT64_C(1000);
printf(fmt,
- (int)(item->counter/G_GUINT64_CONSTANT(1000000)),
- (int)(item->counter%G_GUINT64_CONSTANT(1000000)));
+ (int)(item->counter/UINT64_C(1000000)),
+ (int)(item->counter%UINT64_C(1000000)));
break;
default:
printf(fmt, item->counter);
@@ -1152,7 +1151,7 @@ iostat_draw(void *arg)
num = item->num;
if (num == 0)
num = 1;
- ftype = proto_registrar_get_ftype(stat_cols[j]->hf_index);
+ ftype = proto_registrar_get_ftype(iot->hf_indexes[j]);
switch (ftype) {
case FT_FLOAT:
printf(fmt, item->float_counter/num);
@@ -1161,29 +1160,29 @@ iostat_draw(void *arg)
printf(fmt, item->double_counter/num);
break;
case FT_RELATIVE_TIME:
- item->counter = ((item->counter / (guint64)num) + G_GUINT64_CONSTANT(500)) / G_GUINT64_CONSTANT(1000);
+ item->counter = ((item->counter / (uint64_t)num) + UINT64_C(500)) / UINT64_C(1000);
printf(fmt,
- (int)(item->counter/G_GUINT64_CONSTANT(1000000)),
- (int)(item->counter%G_GUINT64_CONSTANT(1000000)));
+ (int)(item->counter/UINT64_C(1000000)),
+ (int)(item->counter%UINT64_C(1000000)));
break;
default:
- printf(fmt, item->counter / (guint64)num);
+ printf(fmt, item->counter / (uint64_t)num);
break;
}
break;
case CALC_TYPE_LOAD:
- ftype = proto_registrar_get_ftype(stat_cols[j]->hf_index);
+ ftype = proto_registrar_get_ftype(iot->hf_indexes[j]);
switch (ftype) {
case FT_RELATIVE_TIME:
if (!last_row) {
printf(fmt,
(int) (item->counter/interval),
- (int)((item->counter%interval)*G_GUINT64_CONSTANT(1000000) / interval));
+ (int)((item->counter%interval)*UINT64_C(1000000) / interval));
} else {
printf(fmt,
(int) (item->counter/(invl_end-t)),
- (int)((item->counter%(invl_end-t))*G_GUINT64_CONSTANT(1000000) / (invl_end-t)));
+ (int)((item->counter%(invl_end-t))*UINT64_C(1000000) / (invl_end-t)));
}
break;
}
@@ -1196,7 +1195,7 @@ iostat_draw(void *arg)
item_in_column[j] = item_in_column[j]->next;
}
} else {
- printf(fmt, (guint64)0, (guint64)0);
+ printf(fmt, (uint64_t)0, (uint64_t)0);
}
}
if (filler_s)
@@ -1210,8 +1209,11 @@ iostat_draw(void *arg)
}
printf("\n");
g_free(iot->items);
+ g_free((gpointer)iot->filters);
g_free(iot->max_vals);
g_free(iot->max_frame);
+ g_free(iot->hf_indexes);
+ g_free(iot->calc_type);
g_free(iot);
g_free(col_w);
g_free(invl_fmt);
@@ -1238,7 +1240,6 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
io->items[i].next = NULL;
io->items[i].parent = io;
io->items[i].start_time = 0;
- io->items[i].calc_type = CALC_TYPE_FRAMES_AND_BYTES;
io->items[i].frames = 0;
io->items[i].counter = 0;
io->items[i].num = 0;
@@ -1246,12 +1247,13 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
io->filters[i] = filter;
flt = filter;
+ io->calc_type[i] = CALC_TYPE_FRAMES_AND_BYTES;
field = NULL;
hfi = NULL;
for (j=0; calc_type_table[j].func_name; j++) {
namelen = strlen(calc_type_table[j].func_name);
if (filter && strncmp(filter, calc_type_table[j].func_name, namelen) == 0) {
- io->items[i].calc_type = calc_type_table[j].calc_type;
+ io->calc_type[i] = calc_type_table[j].calc_type;
io->items[i].colnum = i;
if (*(filter+namelen) == '(') {
p = filter+namelen+1;
@@ -1262,7 +1264,7 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
exit(10);
}
- if (io->items[i].calc_type == CALC_TYPE_FRAMES || io->items[i].calc_type == CALC_TYPE_BYTES) {
+ if (io->calc_type[i] == CALC_TYPE_FRAMES || io->calc_type[i] == CALC_TYPE_BYTES) {
if (parenp != p) {
fprintf(stderr,
"\ntshark: %s does not require or allow a field name within the parens.\n",
@@ -1282,7 +1284,7 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
memcpy(field, p, parenp-p);
field[parenp-p] = '\0';
flt = parenp + 1;
- if (io->items[i].calc_type == CALC_TYPE_FRAMES || io->items[i].calc_type == CALC_TYPE_BYTES)
+ if (io->calc_type[i] == CALC_TYPE_FRAMES || io->calc_type[i] == CALC_TYPE_BYTES)
break;
hfi = proto_registrar_get_byname(field);
if (!hfi) {
@@ -1292,18 +1294,18 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
exit(10);
}
- io->items[i].hf_index = hfi->id;
+ io->hf_indexes[i] = hfi->id;
break;
}
} else {
- if (io->items[i].calc_type == CALC_TYPE_FRAMES || io->items[i].calc_type == CALC_TYPE_BYTES)
+ if (io->calc_type[i] == CALC_TYPE_FRAMES || io->calc_type[i] == CALC_TYPE_BYTES)
flt = "";
io->items[i].colnum = i;
}
}
- if (hfi && !(io->items[i].calc_type == CALC_TYPE_BYTES ||
- io->items[i].calc_type == CALC_TYPE_FRAMES ||
- io->items[i].calc_type == CALC_TYPE_FRAMES_AND_BYTES)) {
+ if (hfi && !(io->calc_type[i] == CALC_TYPE_BYTES ||
+ io->calc_type[i] == CALC_TYPE_FRAMES ||
+ io->calc_type[i] == CALC_TYPE_FRAMES_AND_BYTES)) {
/* check that the type is compatible */
switch (hfi->type) {
case FT_UINT8:
@@ -1321,7 +1323,7 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
case FT_FLOAT:
case FT_DOUBLE:
/* these types only support SUM, COUNT, MAX, MIN, AVG */
- switch (io->items[i].calc_type) {
+ switch (io->calc_type[i]) {
case CALC_TYPE_SUM:
case CALC_TYPE_COUNT:
case CALC_TYPE_MAX:
@@ -1338,7 +1340,7 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
break;
case FT_RELATIVE_TIME:
/* this type only supports SUM, COUNT, MAX, MIN, AVG, LOAD */
- switch (io->items[i].calc_type) {
+ switch (io->calc_type[i]) {
case CALC_TYPE_SUM:
case CALC_TYPE_COUNT:
case CALC_TYPE_MAX:
@@ -1359,7 +1361,7 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
* XXX - support all operations on floating-point
* numbers?
*/
- if (io->items[i].calc_type != CALC_TYPE_COUNT) {
+ if (io->calc_type[i] != CALC_TYPE_COUNT) {
fprintf(stderr,
"\ntshark: %s doesn't have integral values, so %s(*) "
"calculations are not supported on it.\n",
@@ -1387,11 +1389,11 @@ register_io_tap(io_stat_t *io, unsigned int i, const char *filter)
static void
iostat_init(const char *opt_arg, void *userdata _U_)
{
- gdouble interval_float;
- guint32 idx = 0;
+ double interval_float;
+ uint32_t idx = 0;
unsigned int i;
io_stat_t *io;
- const gchar *filters, *str, *pos;
+ const char *filters, *str, *pos;
if ((*(opt_arg+(strlen(opt_arg)-1)) == ',') ||
(sscanf(opt_arg, "io,stat,%lf%n", &interval_float, (int *)&idx) != 1) ||
@@ -1427,13 +1429,13 @@ iostat_init(const char *opt_arg, void *userdata _U_)
io = g_new(io_stat_t, 1);
/* If interval is 0, calculate statistics over the whole file by setting the interval to
- * G_MAXUINT64 */
+ * UINT64_MAX */
if (interval_float == 0) {
- io->interval = G_MAXUINT64;
+ io->interval = UINT64_MAX;
io->invl_prec = 0;
} else {
/* Set interval to the number of us rounded to the nearest integer */
- io->interval = (guint64)(interval_float * 1000000.0 + 0.5);
+ io->interval = (uint64_t)(interval_float * 1000000.0 + 0.5);
/*
* Determine what interval precision the user has specified */
io->invl_prec = 6;
@@ -1450,8 +1452,8 @@ iostat_init(const char *opt_arg, void *userdata _U_)
interval of 1 and the last interval becomes "9 <> 9". If the interval is instead set to
1.1, the last interval becomes
last interval is rounded up to value that is greater than the duration. */
- const gchar *invl_start = opt_arg+8;
- gchar *intv_end;
+ const char *invl_start = opt_arg+8;
+ char *intv_end;
int invl_len;
intv_end = g_strstr_len(invl_start, -1, ",");
@@ -1485,10 +1487,12 @@ iostat_init(const char *opt_arg, void *userdata _U_)
}
}
- io->items = g_new(io_stat_item_t, io->num_cols);
- io->filters = (const char **)g_malloc(sizeof(char *) * io->num_cols);
- io->max_vals = g_new(guint64, io->num_cols);
- io->max_frame = g_new(guint32, io->num_cols);
+ io->items = g_new(io_stat_item_t, io->num_cols);
+ io->filters = (const char **)g_malloc(sizeof(char *) * io->num_cols);
+ io->max_vals = g_new(uint64_t, io->num_cols);
+ io->max_frame = g_new(uint32_t, io->num_cols);
+ io->hf_indexes = g_new(int, io->num_cols);
+ io->calc_type = g_new(int, io->num_cols);
for (i=0; i<io->num_cols; i++) {
io->max_vals[i] = 0;
@@ -1499,23 +1503,23 @@ iostat_init(const char *opt_arg, void *userdata _U_)
if ((!filters) || (filters[0] == 0)) {
register_io_tap(io, 0, NULL);
} else {
- gchar *filter;
+ char *filter;
i = 0;
str = filters;
do {
- pos = (gchar*) strchr(str, ',');
+ pos = (char*) strchr(str, ',');
if (pos == str) {
register_io_tap(io, i, NULL);
} else if (pos == NULL) {
- str = (const char*) g_strstrip((gchar*)str);
+ str = (const char*) g_strstrip((char*)str);
filter = g_strdup(str);
if (*filter)
register_io_tap(io, i, filter);
else
register_io_tap(io, i, NULL);
} else {
- filter = (gchar *)g_malloc((pos-str)+1);
- (void) g_strlcpy( filter, str, (gsize) ((pos-str)+1));
+ filter = (char *)g_malloc((pos-str)+1);
+ (void) g_strlcpy( filter, str, (size_t) ((pos-str)+1));
filter = g_strstrip(filter);
register_io_tap(io, i, (char *) filter);
}
diff --git a/ui/cli/tap-iousers.c b/ui/cli/tap-iousers.c
index 742f984c..922f0bf8 100644
--- a/ui/cli/tap-iousers.c
+++ b/ui/cli/tap-iousers.c
@@ -32,10 +32,10 @@ iousers_draw(void *arg)
conv_hash_t *hash = (conv_hash_t*)arg;
io_users_t *iu = (io_users_t *)hash->user_data;
conv_item_t *iui;
- guint64 last_frames, max_frames;
+ uint64_t last_frames, max_frames;
struct tm * tm_time;
- guint i;
- gboolean display_ports = (!strncmp(iu->type, "TCP", 3) || !strncmp(iu->type, "UDP", 3) || !strncmp(iu->type, "SCTP", 4)) ? TRUE : FALSE;
+ unsigned i;
+ bool display_ports = (!strncmp(iu->type, "TCP", 3) || !strncmp(iu->type, "UDP", 3) || !strncmp(iu->type, "SCTP", 4)) ? true : false;
printf("================================================================================\n");
printf("%s Conversations\n", iu->type);
@@ -78,7 +78,7 @@ iousers_draw(void *arg)
do {
last_frames = 0;
for (i=0; (iu->hash.conv_array && i < iu->hash.conv_array->len); i++) {
- guint64 tot_frames;
+ uint64_t tot_frames;
iui = &g_array_index(iu->hash.conv_array, conv_item_t, i);
tot_frames = iui->rx_frames + iui->tx_frames;
@@ -89,7 +89,7 @@ iousers_draw(void *arg)
}
for (i=0; (iu->hash.conv_array && i < iu->hash.conv_array->len); i++) {
- guint64 tot_frames;
+ uint64_t tot_frames;
char *src_addr, *dst_addr;
iui = &g_array_index(iu->hash.conv_array, conv_item_t, i);
@@ -103,12 +103,12 @@ iousers_draw(void *arg)
total_bytes = format_size(iui->tx_bytes + iui->rx_bytes, FORMAT_SIZE_UNIT_BYTES, 0);
/* XXX - TODO: make name / port resolution configurable (through gbl_resolv_flags?) */
- src_addr = get_conversation_address(NULL, &iui->src_address, TRUE);
- dst_addr = get_conversation_address(NULL, &iui->dst_address, TRUE);
+ src_addr = get_conversation_address(NULL, &iui->src_address, true);
+ dst_addr = get_conversation_address(NULL, &iui->dst_address, true);
if (display_ports) {
char *src, *dst, *src_port, *dst_port;
- src_port = get_conversation_port(NULL, iui->src_port, iui->ctype, TRUE);
- dst_port = get_conversation_port(NULL, iui->dst_port, iui->ctype, TRUE);
+ src_port = get_conversation_port(NULL, iui->src_port, iui->ctype, true);
+ dst_port = get_conversation_port(NULL, iui->dst_port, iui->ctype, true);
src = wmem_strconcat(NULL, src_addr, ":", src_port, NULL);
dst = wmem_strconcat(NULL, dst_addr, ":", dst_port, NULL);
printf("%-26s <-> %-26s %6" PRIu64 " %-9s"
diff --git a/ui/cli/tap-macltestat.c b/ui/cli/tap-macltestat.c
index ffe78ad7..88785b70 100644
--- a/ui/cli/tap-macltestat.c
+++ b/ui/cli/tap-macltestat.c
@@ -26,6 +26,7 @@ void register_tap_listener_mac_lte_stat(void);
/* Table column identifiers and title strings */
enum {
+ RAT_COLUMN,
RNTI_COLUMN,
RNTI_TYPE_COLUMN,
UEID_COLUMN,
@@ -39,97 +40,93 @@ enum {
DL_BW_COLUMN,
DL_PADDING_PERCENT_COLUMN,
DL_CRC_FAILED_COLUMN,
- DL_CRC_HIGH_CODE_RATE_COLUMN,
- DL_CRC_PDSCH_LOST_COLUMN,
- DL_CRC_DUPLICATE_NONZERO_RV_COLUMN,
DL_RETX_FRAMES_COLUMN,
NUM_UE_COLUMNS
};
-static const gchar *ue_titles[] = { " RNTI", " Type", "UEId",
+static const char *ue_titles[] = { "RAT", " RNTI", " Type", "UEId",
"UL Frames", "UL Bytes", "UL Mb/sec", " UL Pad %", "UL ReTX",
- "DL Frames", "DL Bytes", "DL Mb/sec", " DL Pad %", "DL CRC Fail", "DL CRC HCR", "DL CRC PDSCH Lost", "DL CRC DupNonZeroRV", "DL ReTX"};
+ "DL Frames", "DL Bytes", "DL Mb/sec", " DL Pad %", "DL CRC Fail", "DL ReTX"};
/* Stats for one UE */
-typedef struct mac_lte_row_data {
+typedef struct mac_lte_nr_row_data {
/* Key for matching this row */
- guint16 rnti;
- guint8 rnti_type;
- guint16 ueid;
+ uint8_t rat;
+ uint16_t rnti;
+ uint8_t rnti_type;
+ uint16_t ueid;
- gboolean is_predefined_data;
+ bool is_predefined_data;
- guint32 UL_frames;
- guint32 UL_raw_bytes; /* all bytes */
- guint32 UL_total_bytes; /* payload */
+ uint32_t UL_frames;
+ uint32_t UL_raw_bytes; /* all bytes */
+ uint32_t UL_total_bytes; /* payload */
nstime_t UL_time_start;
nstime_t UL_time_stop;
- guint32 UL_padding_bytes;
- guint32 UL_CRC_errors;
- guint32 UL_retx_frames;
+ uint32_t UL_padding_bytes;
+ uint32_t UL_CRC_errors;
+ uint32_t UL_retx_frames;
- guint32 DL_frames;
- guint32 DL_raw_bytes; /* all bytes */
- guint32 DL_total_bytes;
+ uint32_t DL_frames;
+ uint32_t DL_raw_bytes; /* all bytes */
+ uint32_t DL_total_bytes;
nstime_t DL_time_start;
nstime_t DL_time_stop;
- guint32 DL_padding_bytes;
+ uint32_t DL_padding_bytes;
- guint32 DL_CRC_failures;
- guint32 DL_CRC_high_code_rate;
- guint32 DL_CRC_PDSCH_lost;
- guint32 DL_CRC_Duplicate_NonZero_RV;
- guint32 DL_retx_frames;
+ uint32_t DL_CRC_failures;
+ uint32_t DL_retx_frames;
-} mac_lte_row_data;
+} mac_lte_nr_row_data;
-/* One row/UE in the UE table */
+/* One row/UE list item in the UE table */
typedef struct mac_lte_ep {
struct mac_lte_ep *next;
- struct mac_lte_row_data stats;
+ struct mac_lte_nr_row_data stats;
} mac_lte_ep_t;
-/* Common channel stats */
+/* Common channel stats (i.e. independent of UEs) */
typedef struct mac_lte_common_stats {
- guint32 all_frames;
- guint32 mib_frames;
- guint32 sib_frames;
- guint32 sib_bytes;
- guint32 pch_frames;
- guint32 pch_bytes;
- guint32 pch_paging_ids;
- guint32 rar_frames;
- guint32 rar_entries;
-
- guint16 max_ul_ues_in_tti;
- guint16 max_dl_ues_in_tti;
+ uint32_t all_frames;
+ uint32_t mib_frames;
+ uint32_t sib_frames;
+ uint32_t sib_bytes;
+ uint32_t pch_frames;
+ uint32_t pch_bytes;
+ uint32_t pch_paging_ids;
+ uint32_t rar_frames;
+ uint32_t rar_entries;
+
+ uint16_t max_ul_ues_in_tti;
+ uint16_t max_dl_ues_in_tti;
} mac_lte_common_stats;
/* Top-level struct for MAC LTE statistics */
-typedef struct mac_lte_stat_t {
+typedef struct mac_lte_nr_stat_t {
/* Common stats */
mac_lte_common_stats common_stats;
- /* Keep track of unique rntis & ueids */
- guint8 used_ueids[65535];
- guint8 used_rntis[65535];
- guint16 number_of_ueids;
- guint16 number_of_rntis;
+ /* Keep track of unique rntis & ueids. N.B. only used for counting number of UEs - not for lookup */
+ uint8_t used_ueids[65535];
+ uint8_t used_rntis[65535];
+ uint16_t number_of_ueids;
+ uint16_t number_of_rntis;
+ /* List of UE entries */
mac_lte_ep_t *ep_list;
-} mac_lte_stat_t;
+} mac_lte_nr_stat_t;
/* Reset the statistics window */
static void
mac_lte_stat_reset(void *phs)
{
- mac_lte_stat_t *mac_lte_stat = (mac_lte_stat_t *)phs;
+ mac_lte_nr_stat_t *mac_lte_stat = (mac_lte_nr_stat_t *)phs;
mac_lte_ep_t *list = mac_lte_stat->ep_list;
/* Reset counts of unique ueids & rntis */
@@ -150,7 +147,7 @@ mac_lte_stat_reset(void *phs)
/* Allocate a mac_lte_ep_t struct to store info for new UE */
-static mac_lte_ep_t *alloc_mac_lte_ep(const struct mac_lte_tap_info *si, packet_info *pinfo _U_)
+static mac_lte_ep_t *alloc_mac_lte_ep(const struct mac_3gpp_tap_info *si, packet_info *pinfo _U_)
{
mac_lte_ep_t *ep;
@@ -180,9 +177,6 @@ static mac_lte_ep_t *alloc_mac_lte_ep(const struct mac_lte_tap_info *si, packet_
ep->stats.UL_CRC_errors = 0;
ep->stats.DL_CRC_failures = 0;
- ep->stats.DL_CRC_high_code_rate = 0;
- ep->stats.DL_CRC_PDSCH_lost = 0;
- ep->stats.DL_CRC_Duplicate_NonZero_RV = 0;
ep->stats.UL_retx_frames = 0;
ep->stats.DL_retx_frames = 0;
@@ -193,14 +187,19 @@ static mac_lte_ep_t *alloc_mac_lte_ep(const struct mac_lte_tap_info *si, packet_
/* Update counts of unique rntis & ueids */
-static void update_ueid_rnti_counts(guint16 rnti, guint16 ueid, mac_lte_stat_t *hs)
+static void update_ueid_rnti_counts(uint16_t rnti, uint16_t ueid, mac_lte_nr_stat_t *hs)
{
+ if (hs->number_of_ueids == 65535 || hs->number_of_rntis == 65535) {
+ /* Arrays are already full! */
+ return;
+ }
+
if (!hs->used_ueids[ueid]) {
- hs->used_ueids[ueid] = TRUE;
+ hs->used_ueids[ueid] = true;
hs->number_of_ueids++;
}
if (!hs->used_rntis[rnti]) {
- hs->used_rntis[rnti] = TRUE;
+ hs->used_rntis[rnti] = true;
hs->number_of_rntis++;
}
}
@@ -212,12 +211,12 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
const void *phi, tap_flags_t flags _U_)
{
/* Get reference to stat window instance */
- mac_lte_stat_t *hs = (mac_lte_stat_t *)phs;
+ mac_lte_nr_stat_t *hs = (mac_lte_nr_stat_t*)phs;
mac_lte_ep_t *tmp = NULL, *te = NULL;
int i;
/* Cast tap info struct */
- const struct mac_lte_tap_info *si = (const struct mac_lte_tap_info *)phi;
+ const struct mac_3gpp_tap_info *si = (const struct mac_3gpp_tap_info *)phi;
if (!hs) {
return TAP_PACKET_DONT_REDRAW;
@@ -253,7 +252,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
return TAP_PACKET_DONT_REDRAW;
}
- /* Check max UEs/tti counter */
+ /* Check/update max UEs/tti counter */
switch (si->direction) {
case DIRECTION_UPLINK:
hs->common_stats.max_ul_ues_in_tti =
@@ -276,16 +275,18 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
update_ueid_rnti_counts(si->rnti, si->ueid, hs);
} else {
/* Look among existing rows for this RNTI */
- for (tmp = hs->ep_list;(tmp != NULL); tmp = tmp->next) {
- /* Match only by RNTI and UEId together */
- if ((tmp->stats.rnti == si->rnti) &&
+ /* TODO: with different data structures, could avoid this linear search */
+ for (tmp = hs->ep_list; tmp != NULL; tmp = tmp->next) {
+ /* Match only by RAT, RNTI and UEId together */
+ if ((tmp->stats.rat == si->rat) &&
+ (tmp->stats.rnti == si->rnti) &&
(tmp->stats.ueid == si->ueid)) {
te = tmp;
break;
}
}
- /* Not found among existing, so create a new one anyway */
+ /* Not found among existing, so create a new one now */
if (te == NULL) {
if ((te = alloc_mac_lte_ep(si, pinfo))) {
/* Add new item to end of list */
@@ -308,6 +309,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
}
/* Update entry with details from si */
+ te->stats.rat = si->rat;
te->stats.rnti = si->rnti;
te->stats.is_predefined_data = si->isPredefinedData;
@@ -325,9 +327,9 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
/* Update time range */
if (te->stats.UL_frames == 0) {
- te->stats.UL_time_start = si->mac_lte_time;
+ te->stats.UL_time_start = si->mac_time;
}
- te->stats.UL_time_stop = si->mac_lte_time;
+ te->stats.UL_time_stop = si->mac_time;
te->stats.UL_frames++;
@@ -338,7 +340,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
te->stats.UL_total_bytes += si->single_number_of_bytes;
}
else {
- for (i = 0; i < MAC_LTE_DATA_LCID_COUNT_MAX; i++) {
+ for (i = 0; i < MAC_3GPP_DATA_LCID_COUNT_MAX; i++) {
te->stats.UL_total_bytes += si->bytes_for_lcid[i];
}
}
@@ -352,32 +354,15 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
}
if (si->crcStatusValid && (si->crcStatus != crc_success)) {
- switch (si->crcStatus) {
- case crc_fail:
- te->stats.DL_CRC_failures++;
- break;
- case crc_high_code_rate:
- te->stats.DL_CRC_high_code_rate++;
- break;
- case crc_pdsch_lost:
- te->stats.DL_CRC_PDSCH_lost++;
- break;
- case crc_duplicate_nonzero_rv:
- te->stats.DL_CRC_Duplicate_NonZero_RV++;
- break;
-
- default:
- /* Something went wrong! */
- break;
- }
+ te->stats.DL_CRC_failures++;
return TAP_PACKET_REDRAW;
}
/* Update time range */
if (te->stats.DL_frames == 0) {
- te->stats.DL_time_start = si->mac_lte_time;
+ te->stats.DL_time_start = si->mac_time;
}
- te->stats.DL_time_stop = si->mac_lte_time;
+ te->stats.DL_time_stop = si->mac_time;
te->stats.DL_frames++;
@@ -388,7 +373,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
te->stats.DL_total_bytes += si->single_number_of_bytes;
}
else {
- for (i = 0; i < MAC_LTE_DATA_LCID_COUNT_MAX; i++) {
+ for (i = 0; i < MAC_3GPP_DATA_LCID_COUNT_MAX; i++) {
te->stats.DL_total_bytes += si->bytes_for_lcid[i];
}
}
@@ -400,11 +385,11 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
/* Calculate and return a bandwidth figure, in Mbs */
-static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, guint32 bytes)
+static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, uint32_t bytes)
{
/* Can only calculate bandwidth if have time delta */
if (memcmp(start_time, stop_time, sizeof(nstime_t)) != 0) {
- float elapsed_ms = (((float)stop_time->secs - (float)start_time->secs) * 1000) +
+ float elapsed_ms = (((float)stop_time->secs - (float)start_time->secs) * 1000) +
(((float)stop_time->nsecs - (float)start_time->nsecs) / 1000000);
/* Only really meaningful if have a few frames spread over time...
@@ -425,11 +410,11 @@ static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, guint32 byt
static void
mac_lte_stat_draw(void *phs)
{
- gint i;
- guint16 number_of_ues = 0;
+ int i;
+ uint16_t number_of_ues = 0;
/* Deref the struct */
- mac_lte_stat_t *hs = (mac_lte_stat_t *)phs;
+ mac_lte_nr_stat_t *hs = (mac_lte_nr_stat_t*)phs;
mac_lte_ep_t *list = hs->ep_list, *tmp = 0;
/* System data */
@@ -475,7 +460,8 @@ mac_lte_stat_draw(void *phs)
&tmp->stats.DL_time_stop,
tmp->stats.DL_total_bytes);
- printf("%5u %7s %5u %10u %9u %10f %10f %8u %10u %9u %10f %10f %12u %11u %18u %20u %8u\n",
+ printf("%s %5u %7s %5u %10u %9u %10f %10f %8u %10u %9u %10f %10f %12u %8u\n",
+ (tmp->stats.rat == MAC_RAT_LTE) ? "LTE " : "NR ",
tmp->stats.rnti,
(tmp->stats.rnti_type == C_RNTI) ? "C-RNTI" : "SPS-RNTI",
tmp->stats.ueid,
@@ -493,9 +479,6 @@ mac_lte_stat_draw(void *phs)
(((float)tmp->stats.DL_padding_bytes / (float)tmp->stats.DL_raw_bytes) * 100.0) :
0.0,
tmp->stats.DL_CRC_failures,
- tmp->stats.DL_CRC_high_code_rate,
- tmp->stats.DL_CRC_PDSCH_lost,
- tmp->stats.DL_CRC_Duplicate_NonZero_RV,
tmp->stats.DL_retx_frames);
}
}
@@ -503,14 +486,14 @@ mac_lte_stat_draw(void *phs)
/* Create a new MAC LTE stats struct */
static void mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
{
- mac_lte_stat_t *hs;
+ mac_lte_nr_stat_t *hs;
const char *filter = NULL;
GString *error_string;
/* Check for a filter string */
- if (strncmp(opt_arg, "mac-lte,stat,", 13) == 0) {
+ if (strncmp(opt_arg, "mac-3gpp,stat,", 14) == 0) {
/* Skip those characters from filter to display */
- filter = opt_arg + 13;
+ filter = opt_arg + 14;
}
else {
/* No filter */
@@ -518,10 +501,10 @@ static void mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
}
/* Create struct */
- hs = g_new0(mac_lte_stat_t, 1);
+ hs = g_new0(mac_lte_nr_stat_t, 1);
hs->ep_list = NULL;
- error_string = register_tap_listener("mac-lte", hs,
+ error_string = register_tap_listener("mac-3gpp", hs,
filter, 0,
mac_lte_stat_reset,
mac_lte_stat_packet,
@@ -537,7 +520,7 @@ static void mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
static stat_tap_ui mac_lte_stat_ui = {
REGISTER_STAT_GROUP_GENERIC,
NULL,
- "mac-lte,stat",
+ "mac-3gpp,stat",
mac_lte_stat_init,
0,
NULL
diff --git a/ui/cli/tap-protocolinfo.c b/ui/cli/tap-protocolinfo.c
index ea47ae52..14b57a29 100644
--- a/ui/cli/tap-protocolinfo.c
+++ b/ui/cli/tap-protocolinfo.c
@@ -36,7 +36,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo
{
pci_t *rs = (pci_t *)prs;
GPtrArray *gp;
- guint i;
+ unsigned i;
char *str;
/*
diff --git a/ui/cli/tap-protohierstat.h b/ui/cli/tap-protohierstat.h
index 3a68ff18..da2a9ca3 100644
--- a/ui/cli/tap-protohierstat.h
+++ b/ui/cli/tap-protohierstat.h
@@ -23,8 +23,8 @@ typedef struct _phs_t {
char *filter;
int protocol;
const char *proto_name;
- guint32 frames;
- guint64 bytes;
+ uint32_t frames;
+ uint64_t bytes;
} phs_t;
extern phs_t * new_phs_t(phs_t *parent, const char *filter);
diff --git a/ui/cli/tap-rlcltestat.c b/ui/cli/tap-rlcltestat.c
index 9f4a2cc9..9ebf051b 100644
--- a/ui/cli/tap-rlcltestat.c
+++ b/ui/cli/tap-rlcltestat.c
@@ -18,11 +18,15 @@
#include <epan/packet.h>
#include <epan/tap.h>
#include <epan/stat_tap_ui.h>
+
#include <epan/dissectors/packet-rlc-lte.h>
+#include <epan/dissectors/packet-rlc-3gpp-common.h>
+
void register_tap_listener_rlc_lte_stat(void);
enum {
+ RAT_COLUMN,
UEID_COLUMN,
UL_FRAMES_COLUMN,
UL_BYTES_COLUMN,
@@ -39,42 +43,43 @@ enum {
NUM_UE_COLUMNS
};
-static const gchar *ue_titles[] = { " UEId",
+static const char *ue_titles[] = { "RAT", " UEId",
"UL Frames", "UL Bytes", " UL Mbs", "UL ACKs", "UL NACKs", "UL Missed",
"DL Frames", "DL Bytes", " DL Mbs", "DL ACKs", "DL NACKs", "DL Missed"};
/* Stats for one UE */
typedef struct rlc_lte_row_data {
/* Key for matching this row */
- guint16 ueid;
+ uint8_t rat;
+ uint16_t ueid;
- gboolean is_predefined_data;
+ bool is_predefined_data;
- guint32 UL_frames;
- guint32 UL_total_bytes;
+ uint32_t UL_frames;
+ uint32_t UL_total_bytes;
nstime_t UL_time_start;
nstime_t UL_time_stop;
- guint32 UL_total_acks;
- guint32 UL_total_nacks;
- guint32 UL_total_missing;
+ uint32_t UL_total_acks;
+ uint32_t UL_total_nacks;
+ uint32_t UL_total_missing;
- guint32 DL_frames;
- guint32 DL_total_bytes;
+ uint32_t DL_frames;
+ uint32_t DL_total_bytes;
nstime_t DL_time_start;
nstime_t DL_time_stop;
- guint32 DL_total_acks;
- guint32 DL_total_nacks;
- guint32 DL_total_missing;
+ uint32_t DL_total_acks;
+ uint32_t DL_total_nacks;
+ uint32_t DL_total_missing;
} rlc_lte_row_data;
-/* Common channel stats */
+/* Common channel stats (i.e. independent of UEs) */
typedef struct rlc_lte_common_stats {
- guint32 bcch_frames;
- guint32 bcch_bytes;
- guint32 pcch_frames;
- guint32 pcch_bytes;
+ uint32_t bcch_frames;
+ uint32_t bcch_bytes;
+ uint32_t pcch_frames;
+ uint32_t pcch_bytes;
} rlc_lte_common_stats;
@@ -85,10 +90,10 @@ typedef struct rlc_lte_ep {
} rlc_lte_ep_t;
-/* Used to keep track of all RLC LTE statistics */
+/* Top-level struct for RLC LTE statistics */
typedef struct rlc_lte_stat_t {
rlc_lte_ep_t *ep_list;
- guint32 total_frames;
+ uint32_t total_frames;
/* Common stats */
rlc_lte_common_stats common_stats;
@@ -115,7 +120,7 @@ rlc_lte_stat_reset(void *phs)
/* Allocate a rlc_lte_ep_t struct to store info for new UE */
-static rlc_lte_ep_t *alloc_rlc_lte_ep(const struct rlc_lte_tap_info *si, packet_info *pinfo _U_)
+static rlc_lte_ep_t *alloc_rlc_lte_ep(const struct rlc_3gpp_tap_info *si, packet_info *pinfo _U_)
{
rlc_lte_ep_t *ep;
@@ -128,6 +133,7 @@ static rlc_lte_ep_t *alloc_rlc_lte_ep(const struct rlc_lte_tap_info *si, packet_
}
/* Copy SI data into ep->stats */
+ ep->stats.rat = si->rat;
ep->stats.ueid = si->ueid;
/* Counts for new UE are all 0 */
@@ -160,7 +166,7 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
rlc_lte_ep_t *tmp = NULL, *te = NULL;
/* Cast tap info struct */
- const struct rlc_lte_tap_info *si = (const struct rlc_lte_tap_info *)phi;
+ const struct rlc_3gpp_tap_info *si = (const struct rlc_3gpp_tap_info *)phi;
/* Need this */
if (!hs) {
@@ -194,15 +200,18 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
/* Make it the first/only entry */
te = hs->ep_list;
} else {
- /* Look among existing rows for this UEId */
+ /* Look among existing rows for this rat/UEId */
+ /* TODO: with different data structures, could avoid this linear search */
for (tmp = hs->ep_list; (tmp != NULL); tmp = tmp->next) {
- if (tmp->stats.ueid == si->ueid) {
+ if ((tmp->stats.rat == si->rat) &&
+ (tmp->stats.ueid == si->ueid))
+ {
te = tmp;
break;
}
}
- /* Not found among existing, so create a new one anyway */
+ /* Not found among existing, so create a new one now */
if (te == NULL) {
if ((te = alloc_rlc_lte_ep(si, pinfo))) {
/* Add new item to end of list */
@@ -228,9 +237,9 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
if (si->direction == DIRECTION_UPLINK) {
/* Update time range */
if (te->stats.UL_frames == 0) {
- te->stats.UL_time_start = si->rlc_lte_time;
+ te->stats.UL_time_start = si->rlc_time;
}
- te->stats.UL_time_stop = si->rlc_lte_time;
+ te->stats.UL_time_stop = si->rlc_time;
te->stats.UL_frames++;
te->stats.UL_total_bytes += si->pduLength;
@@ -238,9 +247,9 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
else {
/* Update time range */
if (te->stats.DL_frames == 0) {
- te->stats.DL_time_start = si->rlc_lte_time;
+ te->stats.DL_time_start = si->rlc_time;
}
- te->stats.DL_time_stop = si->rlc_lte_time;
+ te->stats.DL_time_stop = si->rlc_time;
te->stats.DL_frames++;
te->stats.DL_total_bytes += si->pduLength;
@@ -267,7 +276,7 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_,
/* Calculate and return a bandwidth figure, in Mbs */
-static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, guint32 bytes)
+static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, uint32_t bytes)
{
/* Can only calculate bandwidth if have time delta */
if (memcmp(start_time, stop_time, sizeof(nstime_t)) != 0) {
@@ -292,8 +301,8 @@ static float calculate_bw(nstime_t *start_time, nstime_t *stop_time, guint32 byt
static void
rlc_lte_stat_draw(void *phs)
{
- guint16 number_of_ues = 0;
- gint i;
+ uint16_t number_of_ues = 0;
+ int i;
/* Look up the statistics struct */
rlc_lte_stat_t *hs = (rlc_lte_stat_t *)phs;
@@ -330,7 +339,8 @@ rlc_lte_stat_draw(void *phs)
&tmp->stats.DL_time_stop,
tmp->stats.DL_total_bytes);
- printf("%5u %10u %9u %10f %8u %9u %10u %10u %9u %10f %8u %9u %10u\n",
+ printf("%s %5u %10u %9u %10f %8u %9u %10u %10u %9u %10f %8u %9u %10u\n",
+ (tmp->stats.rat == RLC_RAT_LTE) ? "LTE" : "NR ",
tmp->stats.ueid,
tmp->stats.UL_frames,
tmp->stats.UL_total_bytes, UL_bw,
@@ -356,9 +366,9 @@ static void rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
GString *error_string;
/* Check for a filter string */
- if (strncmp(opt_arg, "rlc-lte,stat,", 13) == 0) {
+ if (strncmp(opt_arg, "rlc-3gpp,stat,", 14) == 0) {
/* Skip those characters from filter to display */
- filter = opt_arg + 13;
+ filter = opt_arg + 14;
}
else {
/* No filter */
@@ -374,7 +384,7 @@ static void rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
/* Register the tap listener */
/**********************************************/
- error_string = register_tap_listener("rlc-lte", hs,
+ error_string = register_tap_listener("rlc-3gpp", hs,
filter, 0,
rlc_lte_stat_reset,
rlc_lte_stat_packet,
@@ -393,7 +403,7 @@ static void rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
static stat_tap_ui rlc_lte_stat_ui = {
REGISTER_STAT_GROUP_GENERIC,
NULL,
- "rlc-lte,stat",
+ "rlc-3gpp,stat",
rlc_lte_stat_init,
0,
NULL
diff --git a/ui/cli/tap-rpcprogs.c b/ui/cli/tap-rpcprogs.c
index e64c93bc..28ad353c 100644
--- a/ui/cli/tap-rpcprogs.c
+++ b/ui/cli/tap-rpcprogs.c
@@ -35,16 +35,16 @@ void register_tap_listener_rpcprogs(void);
/* used to keep track of statistics for a specific program/version */
typedef struct _rpc_program_t {
struct _rpc_program_t *next;
- guint32 program;
- guint32 version;
+ uint32_t program;
+ uint32_t version;
int num;
nstime_t min;
nstime_t max;
nstime_t tot;
} rpc_program_t;
-static rpc_program_t *prog_list = NULL;
-static int already_enabled = 0;
+static rpc_program_t *prog_list;
+static int already_enabled;
static tap_packet_status
rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri, tap_flags_t flags _U_)
@@ -167,7 +167,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
static void
rpcprogs_draw(void *dummy _U_)
{
- guint64 td;
+ uint64_t td;
rpc_program_t *rp;
char str[64];
@@ -181,7 +181,7 @@ rpcprogs_draw(void *dummy _U_)
continue;
}
/* Scale the average SRT in units of 1us and round to the nearest us. */
- td = ((guint64)(rp->tot.secs)) * NANOSECS_PER_SEC + rp->tot.nsecs;
+ td = ((uint64_t)(rp->tot.secs)) * NANOSECS_PER_SEC + rp->tot.nsecs;
td = ((td / rp->num) + 500) / 1000;
snprintf(str, sizeof(str), "%s(%d)", rpc_prog_name(rp->program), rp->program);
diff --git a/ui/cli/tap-rtd.c b/ui/cli/tap-rtd.c
index ad56c4c5..93a1bd33 100644
--- a/ui/cli/tap-rtd.c
+++ b/ui/cli/tap-rtd.c
@@ -34,8 +34,8 @@ rtd_draw(void *arg)
{
rtd_data_t* rtd_data = (rtd_data_t*)arg;
rtd_t* rtd = (rtd_t*)rtd_data->user_data;
- gchar* tmp_str;
- guint i, j;
+ char* tmp_str;
+ unsigned i, j;
/* printing results */
printf("\n");
@@ -135,7 +135,7 @@ register_rtd_tables(const void *key _U_, void *value, void *userdata _U_)
{
register_rtd_t *rtd = (register_rtd_t*)value;
stat_tap_ui ui_info;
- gchar *cli_string;
+ char *cli_string;
cli_string = rtd_table_get_tap_string(rtd);
ui_info.group = REGISTER_STAT_GROUP_RESPONSE_TIME;
@@ -146,7 +146,7 @@ register_rtd_tables(const void *key _U_, void *value, void *userdata _U_)
ui_info.params = NULL;
register_stat_tap_ui(&ui_info, rtd);
g_free(cli_string);
- return FALSE;
+ return false;
}
/*
diff --git a/ui/cli/tap-rtp.c b/ui/cli/tap-rtp.c
index b7937cd0..ab68ed7f 100644
--- a/ui/cli/tap-rtp.c
+++ b/ui/cli/tap-rtp.c
@@ -44,7 +44,7 @@ static void rtpstreams_stat_draw_cb(rtpstream_tapinfo_t *tapinfo);
*/
static rtpstream_tapinfo_t the_tapinfo_struct =
{ NULL, rtpstreams_stat_draw_cb, NULL,
- NULL, 0, NULL, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, FALSE, FALSE
+ NULL, 0, NULL, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, false, false
};
static void
diff --git a/ui/cli/tap-rtspstat.c b/ui/cli/tap-rtspstat.c
index a42be606..accc0f85 100644
--- a/ui/cli/tap-rtspstat.c
+++ b/ui/cli/tap-rtspstat.c
@@ -42,16 +42,16 @@ typedef struct _rtsp_stats_t {
* for example it can be { 3, 404, "Not Found" ,...}
* which means we captured 3 reply rtsp/1.1 404 Not Found */
typedef struct _rtsp_response_code_t {
- guint32 packets; /* 3 */
- guint response_code; /* 404 */
- const gchar *name; /* Not Found */
+ uint32_t packets; /* 3 */
+ unsigned response_code; /* 404 */
+ const char *name; /* Not Found */
rtspstat_t *sp;
} rtsp_response_code_t;
/* used to keep track of the stats for a specific request string */
typedef struct _rtsp_request_methode_t {
- gchar *response; /* eg. : SETUP */
- guint32 packets;
+ char *response; /* eg. : SETUP */
+ uint32_t packets;
rtspstat_t *sp;
} rtsp_request_methode_t;
@@ -76,7 +76,7 @@ rtsp_init_hash( rtspstat_t *sp)
sp->hash_requests = g_hash_table_new( g_str_hash, g_str_equal);
}
static void
-rtsp_draw_hash_requests( gchar *key _U_ , rtsp_request_methode_t *data, gchar * format)
+rtsp_draw_hash_requests( char *key _U_ , rtsp_request_methode_t *data, char * format)
{
if (data->packets == 0)
return;
@@ -84,7 +84,7 @@ rtsp_draw_hash_requests( gchar *key _U_ , rtsp_request_methode_t *data, gchar *
}
static void
-rtsp_draw_hash_responses( gpointer* key _U_ , rtsp_response_code_t *data, char * format)
+rtsp_draw_hash_responses( void ** key _U_ , rtsp_response_code_t *data, char * format)
{
if (data == NULL) {
ws_warning("No data available, key=%d\n", GPOINTER_TO_INT(key));
@@ -101,19 +101,19 @@ rtsp_draw_hash_responses( gpointer* key _U_ , rtsp_response_code_t *data, char *
/* NOT USED at this moment */
/*
static void
-rtsp_free_hash( gpointer key, gpointer value, gpointer user_data _U_ )
+rtsp_free_hash( void *key, void *value, void *user_data _U_ )
{
g_free(key);
g_free(value);
}
*/
static void
-rtsp_reset_hash_responses(gchar *key _U_ , rtsp_response_code_t *data, gpointer ptr _U_ )
+rtsp_reset_hash_responses(char *key _U_ , rtsp_response_code_t *data, void *ptr _U_ )
{
data->packets = 0;
}
static void
-rtsp_reset_hash_requests(gchar *key _U_ , rtsp_request_methode_t *data, gpointer ptr _U_ )
+rtsp_reset_hash_requests(char *key _U_ , rtsp_request_methode_t *data, void *ptr _U_ )
{
data->packets = 0;
}
@@ -143,7 +143,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
sp->hash_responses,
GINT_TO_POINTER(value->response_code));
if (sc == NULL) {
- gint key;
+ int key;
/* non standard status code ; we classify it as others
* in the relevant category (Informational,Success,Redirection,Client Error,Server Error)
*/
@@ -209,10 +209,10 @@ rtspstat_draw(void *psp )
printf("* RTSP Response Status Codes Packets\n");
g_hash_table_foreach( sp->hash_responses, (GHFunc)rtsp_draw_hash_responses,
- (gpointer)" %3d %-35s %9d\n");
+ (void *)" %3d %-35s %9d\n");
printf("* RTSP Request Methods Packets\n");
g_hash_table_foreach( sp->hash_requests, (GHFunc)rtsp_draw_hash_requests,
- (gpointer)" %-39s %9d\n");
+ (void *)" %-39s %9d\n");
printf("===================================================================\n");
}
diff --git a/ui/cli/tap-sctpchunkstat.c b/ui/cli/tap-sctpchunkstat.c
index 21e081eb..4d51f8bf 100644
--- a/ui/cli/tap-sctpchunkstat.c
+++ b/ui/cli/tap-sctpchunkstat.c
@@ -32,21 +32,21 @@ typedef struct sctp_ep {
struct sctp_ep *next;
address src;
address dst;
- guint16 sport;
- guint16 dport;
- guint32 chunk_count[256];
+ uint16_t sport;
+ uint16_t dport;
+ uint32_t chunk_count[256];
} sctp_ep_t;
/* used to keep track of the statistics for an entire program interface */
typedef struct _sctpstat_t {
char *filter;
- guint32 number_of_packets;
+ uint32_t number_of_packets;
sctp_ep_t *ep_list;
} sctpstat_t;
#define CHUNK_TYPE_OFFSET 0
-#define CHUNK_TYPE(x)(tvb_get_guint8((x), CHUNK_TYPE_OFFSET))
+#define CHUNK_TYPE(x)(tvb_get_uint8((x), CHUNK_TYPE_OFFSET))
static void
sctpstat_reset(void *phs)
@@ -54,7 +54,7 @@ sctpstat_reset(void *phs)
sctpstat_t *sctp_stat = (sctpstat_t *)phs;
sctp_ep_t *list = (sctp_ep_t *)sctp_stat->ep_list;
sctp_ep_t *tmp = NULL;
- guint16 chunk_type;
+ uint16_t chunk_type;
if (!list)
return;
@@ -71,7 +71,7 @@ static sctp_ep_t *
alloc_sctp_ep(const struct _sctp_info *si)
{
sctp_ep_t *ep;
- guint16 chunk_type;
+ uint16_t chunk_type;
if (!si)
return NULL;
@@ -99,8 +99,8 @@ sctpstat_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons
sctpstat_t *hs = (sctpstat_t *)phs;
sctp_ep_t *tmp = NULL, *te = NULL;
const struct _sctp_info *si = (const struct _sctp_info *)phi;
- guint32 tvb_number;
- guint8 chunk_type;
+ uint32_t tvb_number;
+ uint8_t chunk_type;
if (!hs)
return (TAP_PACKET_DONT_REDRAW);
diff --git a/ui/cli/tap-simple_stattable.c b/ui/cli/tap-simple_stattable.c
index cca34320..0dc9230c 100644
--- a/ui/cli/tap-simple_stattable.c
+++ b/ui/cli/tap-simple_stattable.c
@@ -30,11 +30,11 @@ simple_draw(void *arg)
stat_data_t* stat_data = (stat_data_t*)arg;
table_stat_t* stats = (table_stat_t*)stat_data->user_data;
size_t i;
- guint table_index, element, field_index;
+ unsigned table_index, element, field_index;
stat_tap_table_item* field;
stat_tap_table* table;
stat_tap_table_item_type* field_data;
- gchar fmt_string[250];
+ char fmt_string[250];
/* printing results */
printf("\n");
@@ -152,7 +152,7 @@ register_simple_stat_tables(const void *key, void *value, void *userdata _U_)
ui_info.params = stat_tap->params;
register_stat_tap_ui(&ui_info, stat_tap);
- return FALSE;
+ return false;
}
/*
diff --git a/ui/cli/tap-sipstat.c b/ui/cli/tap-sipstat.c
index 92d1463d..87717eb3 100644
--- a/ui/cli/tap-sipstat.c
+++ b/ui/cli/tap-sipstat.c
@@ -33,13 +33,13 @@ void register_tap_listener_sipstat(void);
/* used to keep track of the statictics for an entire program interface */
typedef struct _sip_stats_t {
char *filter;
- guint32 packets; /* number of sip packets, including continuations */
- guint32 resent_packets;
- guint32 average_setup_time;
- guint32 max_setup_time;
- guint32 min_setup_time;
- guint32 no_of_completed_calls;
- guint64 total_setup_time;
+ uint32_t packets; /* number of sip packets, including continuations */
+ uint32_t resent_packets;
+ uint32_t average_setup_time;
+ uint32_t max_setup_time;
+ uint32_t min_setup_time;
+ uint32_t no_of_completed_calls;
+ uint64_t total_setup_time;
GHashTable *hash_responses;
GHashTable *hash_requests;
} sipstat_t;
@@ -48,16 +48,16 @@ typedef struct _sip_stats_t {
* for example it can be { 3, 404, "Not Found" ,...}
* which means we captured 3 reply sip/1.1 404 Not Found */
typedef struct _sip_response_code_t {
- guint32 packets; /* 3 */
- guint response_code; /* 404 */
- const gchar *name; /* Not Found */
+ uint32_t packets; /* 3 */
+ unsigned response_code; /* 404 */
+ const char *name; /* Not Found */
sipstat_t *sp;
} sip_response_code_t;
/* used to keep track of the stats for a specific request string */
typedef struct _sip_request_method_t {
- gchar *response; /* eg. : INVITE */
- guint32 packets;
+ char *response; /* eg. : INVITE */
+ uint32_t packets;
sipstat_t *sp;
} sip_request_method_t;
@@ -74,7 +74,7 @@ sip_init_hash(sipstat_t *sp)
/* Add all response codes */
for (i=0; sip_response_code_vals[i].strptr; i++)
{
- gint *key = g_new (gint, 1);
+ int *key = g_new (int, 1);
sip_response_code_t *sc = g_new (sip_response_code_t, 1);
*key = sip_response_code_vals[i].value;
sc->packets = 0;
@@ -89,7 +89,7 @@ sip_init_hash(sipstat_t *sp)
}
static void
-sip_draw_hash_requests( gchar *key _U_, sip_request_method_t *data, gchar *format)
+sip_draw_hash_requests( char *key _U_, sip_request_method_t *data, char *format)
{
if (data->packets == 0)
return;
@@ -97,7 +97,7 @@ sip_draw_hash_requests( gchar *key _U_, sip_request_method_t *data, gchar *forma
}
static void
-sip_draw_hash_responses( gint *key _U_ , sip_response_code_t *data, char *format)
+sip_draw_hash_responses( int *key _U_ , sip_response_code_t *data, char *format)
{
if (data == NULL) {
ws_warning("C'est quoi ce borderl key=%d\n", *key);
@@ -111,7 +111,7 @@ sip_draw_hash_responses( gint *key _U_ , sip_response_code_t *data, char *format
/* NOT USED at this moment */
/*
static void
-sip_free_hash( gpointer key, gpointer value, gpointer user_data _U_ )
+sip_free_hash( void *key, void *value, void *user_data _U_ )
{
g_free(key);
g_free(value);
@@ -119,12 +119,12 @@ sip_free_hash( gpointer key, gpointer value, gpointer user_data _U_ )
*/
static void
-sip_reset_hash_responses(gchar *key _U_ , sip_response_code_t *data, gpointer ptr _U_ )
+sip_reset_hash_responses(char *key _U_ , sip_response_code_t *data, void *ptr _U_ )
{
data->packets = 0;
}
static void
-sip_reset_hash_requests(gchar *key _U_ , sip_request_method_t *data, gpointer ptr _U_ )
+sip_reset_hash_requests(char *key _U_ , sip_request_method_t *data, void *ptr _U_ )
{
data->packets = 0;
}
@@ -176,7 +176,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
sp->min_setup_time = value->setup_time;
}
/* Calculate average */
- sp->average_setup_time = (guint32)(sp->total_setup_time / sp->no_of_completed_calls);
+ sp->average_setup_time = (uint32_t)(sp->total_setup_time / sp->no_of_completed_calls);
}
}
@@ -191,7 +191,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
if (value->response_code != 0)
{
/* Responses */
- guint key;
+ unsigned key;
sip_response_code_t *sc;
/* Look up response code in hash table */
@@ -291,10 +291,10 @@ sipstat_draw(void *psp )
printf("\nNumber of resent SIP messages: %u\n", sp->resent_packets);
printf( "\n* SIP Status Codes in reply packets\n");
g_hash_table_foreach(sp->hash_responses, (GHFunc)sip_draw_hash_responses,
- (gpointer)" SIP %3d %-15s : %5d Packets\n");
+ (void *)" SIP %3d %-15s : %5d Packets\n");
printf("\n* List of SIP Request methods\n");
g_hash_table_foreach(sp->hash_requests, (GHFunc)sip_draw_hash_requests,
- (gpointer)" %-15s : %5d Packets\n");
+ (void *)" %-15s : %5d Packets\n");
printf( "\n* Average setup time %u ms\n Min %u ms\n Max %u ms\n", sp->average_setup_time, sp->min_setup_time, sp->max_setup_time);
printf("===================================================================\n");
}
diff --git a/ui/cli/tap-smbsids.c b/ui/cli/tap-smbsids.c
index f92037c9..a0ac4d40 100644
--- a/ui/cli/tap-smbsids.c
+++ b/ui/cli/tap-smbsids.c
@@ -34,7 +34,7 @@ smbsids_packet(void *pss _U_, packet_info *pinfo _U_, epan_dissect_t *edt _U_, c
}
static void
-enum_sids(gpointer key, gpointer value, gpointer userdata _U_)
+enum_sids(void *key, void *value, void *userdata _U_)
{
const char *sid = (const char *)key;
const char *name = (const char *)value;
@@ -62,7 +62,7 @@ smbsids_init(const char *opt_arg _U_, void *userdata _U_)
fprintf(stderr, "The -z smb,sids function needs SMB/SID-Snooping to be enabled.\n");
fprintf(stderr, "Either enable Edit/Preferences/Protocols/SMB/Snoop SID name mappings in wireshark\n");
fprintf(stderr, "or override the preference file by specifying\n");
- fprintf(stderr, " -o \"smb.sid_name_snooping=TRUE\"\n");
+ fprintf(stderr, " -o \"smb.sid_name_snooping=true\"\n");
fprintf(stderr, "on the tshark command line.\n");
exit(1);
}
diff --git a/ui/cli/tap-srt.c b/ui/cli/tap-srt.c
index 62cef3af..3b7c08c4 100644
--- a/ui/cli/tap-srt.c
+++ b/ui/cli/tap-srt.c
@@ -29,11 +29,11 @@ typedef struct _srt_t {
} srt_t;
static void
-draw_srt_table_data(srt_stat_table *rst, gboolean draw_footer, const char *subfilter)
+draw_srt_table_data(srt_stat_table *rst, bool draw_footer, const char *subfilter)
{
int i;
- guint64 td;
- guint64 sum;
+ uint64_t td;
+ uint64_t sum;
if (rst->num_procs > 0) {
if (rst->filter_string != NULL && subfilter != NULL) {
@@ -56,7 +56,7 @@ draw_srt_table_data(srt_stat_table *rst, gboolean draw_footer, const char *subfi
depending uon the platform. After casting tot.secs to 64 bits, it
would take a capture with a duration of over 136 *years* to
overflow the secs portion of td. */
- td = ((guint64)(rst->procedures[i].stats.tot.secs))*NANOSECS_PER_SEC + rst->procedures[i].stats.tot.nsecs;
+ td = ((uint64_t)(rst->procedures[i].stats.tot.secs))*NANOSECS_PER_SEC + rst->procedures[i].stats.tot.nsecs;
sum = (td + 500) / 1000;
td = ((td / rst->procedures[i].stats.num) + 500) / 1000;
@@ -77,11 +77,11 @@ draw_srt_table_data(srt_stat_table *rst, gboolean draw_footer, const char *subfi
static void
srt_draw(void *arg)
{
- guint i = 0;
+ unsigned i = 0;
srt_data_t* data = (srt_data_t*)arg;
srt_t *ui = (srt_t *)data->user_data;
srt_stat_table *srt_table;
- gboolean need_newline = FALSE;
+ bool need_newline = false;
printf("\n");
printf("===================================================================\n");
@@ -90,7 +90,7 @@ srt_draw(void *arg)
srt_table = g_array_index(data->srt_array, srt_stat_table*, i);
draw_srt_table_data(srt_table, data->srt_array->len == 1, ui->filter);
if (srt_table->num_procs > 0) {
- need_newline = TRUE;
+ need_newline = true;
}
for (i = 1; i < data->srt_array->len; i++)
@@ -98,12 +98,12 @@ srt_draw(void *arg)
if (need_newline)
{
printf("\n");
- need_newline = FALSE;
+ need_newline = false;
}
srt_table = g_array_index(data->srt_array, srt_stat_table*, i);
draw_srt_table_data(srt_table, i == data->srt_array->len-1, ui->filter);
if (srt_table->num_procs > 0) {
- need_newline = TRUE;
+ need_newline = true;
}
}
}
@@ -142,7 +142,7 @@ dissector_srt_init(const char *opt_arg, void* userdata)
srt_table_get_filter(srt, opt_arg, &filter, &err);
if (err != NULL)
{
- gchar* cmd_str = srt_table_get_tap_string(srt);
+ char* cmd_str = srt_table_get_tap_string(srt);
cmdarg_err("invalid \"-z %s,%s\" argument", cmd_str, err);
g_free(cmd_str);
g_free(err);
@@ -150,7 +150,7 @@ dissector_srt_init(const char *opt_arg, void* userdata)
}
/* Need to create the SRT array now */
- global_srt_array = g_array_new(FALSE, TRUE, sizeof(srt_stat_table*));
+ global_srt_array = g_array_new(false, true, sizeof(srt_stat_table*));
srt_table_dissector_init(srt, global_srt_array);
init_srt_tables(srt, filter);
@@ -163,12 +163,12 @@ register_srt_tables(const void *key _U_, void *value, void *userdata _U_)
register_srt_t *srt = (register_srt_t*)value;
const char* short_name = proto_get_protocol_short_name(find_protocol_by_id(get_srt_proto_id(srt)));
stat_tap_ui ui_info;
- gchar *cli_string;
+ char *cli_string;
/* XXX - CAMEL dissector hasn't been converted over due seemingly different tap packet
handling functions. So let the existing TShark CAMEL tap keep its registration */
if (strcmp(short_name, "CAMEL") == 0)
- return FALSE;
+ return false;
cli_string = srt_table_get_tap_string(srt);
ui_info.group = REGISTER_STAT_GROUP_RESPONSE_TIME;
@@ -179,7 +179,7 @@ register_srt_tables(const void *key _U_, void *value, void *userdata _U_)
ui_info.params = NULL;
register_stat_tap_ui(&ui_info, srt);
g_free(cli_string);
- return FALSE;
+ return false;
}
/*
diff --git a/ui/cli/tap-stats_tree.c b/ui/cli/tap-stats_tree.c
index 64557e40..5e2bc895 100644
--- a/ui/cli/tap-stats_tree.c
+++ b/ui/cli/tap-stats_tree.c
@@ -32,7 +32,7 @@ struct _tree_pres {
};
struct _tree_cfg_pres {
- gchar *init_string;
+ char *init_string;
};
static void
@@ -94,7 +94,7 @@ init_stats_tree(const char *opt_arg, void *userdata _U_)
NULL);
if (error_string) {
- report_failure("stats_tree for: %s failed to attach to the tap: %s", cfg->name, error_string->str);
+ report_failure("stats_tree for: %s failed to attach to the tap: %s", cfg->path, error_string->str);
return;
}
@@ -103,7 +103,7 @@ init_stats_tree(const char *opt_arg, void *userdata _U_)
}
static void
-register_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p _U_)
+register_stats_tree_tap (void *k _U_, void *v, void *p _U_)
{
stats_tree_cfg *cfg = (stats_tree_cfg *)v;
stat_tap_ui ui_info;
diff --git a/ui/cli/tap-voip.h b/ui/cli/tap-voip.h
index 45c436f5..6d02c260 100644
--- a/ui/cli/tap-voip.h
+++ b/ui/cli/tap-voip.h
@@ -18,7 +18,7 @@ extern "C" {
/* store the chosen calls in a bit-array */
#define VOIP_CONV_BITS (sizeof(int) * 8)
-#define VOIP_CONV_NUM ((1<<(sizeof(guint16) * 8))/VOIP_CONV_BITS)
+#define VOIP_CONV_NUM ((1<<(sizeof(uint16_t) * 8))/VOIP_CONV_BITS)
#define VOIP_CONV_MAX (VOIP_CONV_BITS * VOIP_CONV_NUM)
extern voip_calls_tapinfo_t tapinfo_;
diff --git a/ui/cli/tap-wspstat.c b/ui/cli/tap-wspstat.c
index 89daed31..d4fb6f13 100644
--- a/ui/cli/tap-wspstat.c
+++ b/ui/cli/tap-wspstat.c
@@ -33,35 +33,35 @@ void register_tap_listener_wspstat(void);
/* used to keep track of the stats for a specific PDU type*/
typedef struct _wsp_pdu_t {
- const gchar *type;
- guint32 packets;
+ const char *type;
+ uint32_t packets;
} wsp_pdu_t;
/* used to keep track of SRT statistics */
typedef struct _wsp_status_code_t {
- const gchar *name;
- guint32 packets;
+ const char *name;
+ uint32_t packets;
} wsp_status_code_t;
/* used to keep track of the statictics for an entire program interface */
typedef struct _wsp_stats_t {
char *filter;
wsp_pdu_t *pdu_stats;
- guint32 num_pdus;
+ uint32_t num_pdus;
GHashTable *hash;
} wspstat_t;
static void
-wsp_reset_hash(gchar *key _U_ , wsp_status_code_t *data, gpointer ptr _U_)
+wsp_reset_hash(char *key _U_ , wsp_status_code_t *data, void *ptr _U_)
{
data->packets = 0;
}
static void
-wsp_print_statuscode(gpointer key, wsp_status_code_t *data, char *format)
+wsp_print_statuscode(void *key, wsp_status_code_t *data, char *format)
{
if (data && (data->packets != 0))
printf(format, GPOINTER_TO_INT(key), data->packets , data->name);
}
static void
-wsp_free_hash_table( gpointer key, gpointer value, gpointer user_data _U_ )
+wsp_free_hash_table( void *key, void *value, void *user_data _U_ )
{
g_free(key);
g_free(value);
@@ -70,7 +70,7 @@ static void
wspstat_reset(void *psp)
{
wspstat_t *sp = (wspstat_t *)psp;
- guint32 i;
+ uint32_t i;
for (i=1; i<=sp->num_pdus; i++)
{
@@ -91,8 +91,8 @@ wspstat_reset(void *psp)
* ALL packets and not just the ones we are collecting stats for.
*
*/
-static gint
-pdut2index(gint pdut)
+static int
+pdut2index(int pdut)
{
if (pdut <= 0x09)
return pdut;
@@ -105,8 +105,8 @@ pdut2index(gint pdut)
}
return 0;
}
-static gint
-index2pdut(gint pdut)
+static int
+index2pdut(int pdut)
{
if (pdut <= 0x09)
return pdut;
@@ -121,7 +121,7 @@ wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const
{
wspstat_t *sp = (wspstat_t *)psp;
const wsp_info_value_t *value = (const wsp_info_value_t *)pri;
- gint idx = pdut2index(value->pdut);
+ int idx = pdut2index(value->pdut);
tap_packet_status retour = TAP_PACKET_DONT_REDRAW;
if (value->status_code != 0) {
@@ -168,7 +168,7 @@ static void
wspstat_draw(void *psp)
{
wspstat_t *sp = (wspstat_t *)psp;
- guint32 i;
+ uint32_t i;
printf("\n");
printf("===================================================================\n");
@@ -176,7 +176,7 @@ wspstat_draw(void *psp)
printf("%-23s %9s || %-23s %9s\n", "PDU Type", "Packets", "PDU Type", "Packets");
for (i=1; i <= ((sp->num_pdus+1)/2); i++)
{
- guint32 ii = i+sp->num_pdus/2;
+ uint32_t ii = i+sp->num_pdus/2;
printf("%-23s %9u", sp->pdu_stats[i ].type, sp->pdu_stats[i ].packets);
printf(" || ");
if (ii< (sp->num_pdus) )
@@ -187,7 +187,7 @@ wspstat_draw(void *psp)
printf("\nStatus code in reply packets\n");
printf( "Status Code Packets Description\n");
g_hash_table_foreach( sp->hash, (GHFunc) wsp_print_statuscode,
- (gpointer)" 0x%02X %9d %s\n" ) ;
+ (void *)" 0x%02X %9d %s\n" ) ;
printf("===================================================================\n");
}
@@ -203,7 +203,7 @@ wspstat_init(const char *opt_arg, void *userdata _U_)
{
wspstat_t *sp;
const char *filter = NULL;
- guint32 i;
+ uint32_t i;
GString *error_string;
wsp_status_code_t *sc;
const value_string *wsp_vals_status_p;
@@ -220,9 +220,9 @@ wspstat_init(const char *opt_arg, void *userdata _U_)
wsp_vals_status_p = VALUE_STRING_EXT_VS_P(&wsp_vals_status_ext);
for (i=0; wsp_vals_status_p[i].strptr; i++ )
{
- gint *key;
+ int *key;
sc = g_new(wsp_status_code_t, 1);
- key = g_new(gint, 1);
+ key = g_new(int, 1);
sc->packets = 0;
sc->name = wsp_vals_status_p[i].strptr;
*key = wsp_vals_status_p[i].value;
diff --git a/ui/commandline.c b/ui/commandline.c
index 43c2fdc1..a65f48d5 100644
--- a/ui/commandline.c
+++ b/ui/commandline.c
@@ -54,7 +54,7 @@ commandline_param_info_t global_commandline_info;
capture_options global_capture_opts;
void
-commandline_print_usage(gboolean for_help_option) {
+commandline_print_usage(bool for_help_option) {
FILE *output;
#ifdef _WIN32
@@ -135,7 +135,8 @@ commandline_print_usage(gboolean for_help_option) {
fprintf(output, " -R <read filter>, --read-filter <read filter>\n");
fprintf(output, " packet filter in Wireshark display filter syntax\n");
fprintf(output, " -n disable all name resolutions (def: all enabled)\n");
- fprintf(output, " -N <name resolve flags> enable specific name resolution(s): \"mnNtdv\"\n");
+ // Note: the order of the flags here matches the options in the settings dialog e.g. "dsN" only have an effect if "n" is set
+ fprintf(output, " -N <name resolve flags> enable specific name resolution(s): \"mtndsNvg\"\n");
fprintf(output, " -d %s ...\n", DECODE_AS_ARG_TEMPLATE);
fprintf(output, " \"Decode As\", see the man page for details\n");
fprintf(output, " Example: tcp.port==8888,http\n");
@@ -173,6 +174,8 @@ commandline_print_usage(gboolean for_help_option) {
fprintf(output, "Output:\n");
fprintf(output, " -w <outfile|-> set the output filename (or '-' for stdout)\n");
#ifdef HAVE_LIBPCAP
+ fprintf(output, " -F <capture type> set the output file type; default is pcapng.\n");
+ fprintf(output, " an empty \"-F\" option will list the file types.\n");
fprintf(output, " --capture-comment <comment>\n");
fprintf(output, " add a capture file comment, if supported\n");
#endif
@@ -203,17 +206,15 @@ commandline_print_usage(gboolean for_help_option) {
#define LONGOPT_FULL_SCREEN LONGOPT_BASE_GUI+1
#define LONGOPT_CAPTURE_COMMENT LONGOPT_BASE_GUI+2
-#define OPTSTRING OPTSTRING_CAPTURE_COMMON OPTSTRING_DISSECT_COMMON "C:g:HhjJ:klm:o:P:r:R:Svw:X:Y:z:"
+#define OPTSTRING OPTSTRING_CAPTURE_COMMON OPTSTRING_DISSECT_COMMON OPTSTRING_READ_CAPTURE_COMMON "C:g:HhjJ:klm:o:P:Svw:X:z:"
static const struct ws_option long_options[] = {
{"help", ws_no_argument, NULL, 'h'},
- {"read-file", ws_required_argument, NULL, 'r' },
- {"read-filter", ws_required_argument, NULL, 'R' },
- {"display-filter", ws_required_argument, NULL, 'Y' },
{"version", ws_no_argument, NULL, 'v'},
{"fullscreen", ws_no_argument, NULL, LONGOPT_FULL_SCREEN },
{"capture-comment", ws_required_argument, NULL, LONGOPT_CAPTURE_COMMENT},
LONGOPT_CAPTURE_COMMON
LONGOPT_DISSECT_COMMON
+ LONGOPT_READ_CAPTURE_COMMON
{0, 0, 0, 0 }
};
static const char optstring[] = OPTSTRING;
@@ -231,10 +232,10 @@ void commandline_early_options(int argc, char *argv[])
#ifdef HAVE_LIBPCAP
int err;
GList *if_list;
- gchar *err_str;
+ char *err_str;
int exit_status;
#else
- gboolean capture_option_specified;
+ bool capture_option_specified;
#endif
/*
@@ -269,14 +270,14 @@ void commandline_early_options(int argc, char *argv[])
ws_opterr = 0;
#ifndef HAVE_LIBPCAP
- capture_option_specified = FALSE;
+ capture_option_specified = false;
#endif
while ((opt = ws_getopt_long(argc, argv, optstring, long_options, NULL)) != -1) {
switch (opt) {
case 'C': /* Configuration Profile */
- if (profile_exists (ws_optarg, FALSE)) {
+ if (profile_exists (ws_optarg, false)) {
set_profile_name (ws_optarg);
- } else if (profile_exists (ws_optarg, TRUE)) {
+ } else if (profile_exists (ws_optarg, true)) {
char *pf_dir_path, *pf_dir_path2, *pf_filename;
/* Copy from global profile */
if (create_persconffile_profile(ws_optarg, &pf_dir_path) == -1) {
@@ -286,7 +287,7 @@ void commandline_early_options(int argc, char *argv[])
g_free(pf_dir_path);
exit(WS_EXIT_INVALID_FILE);
}
- if (copy_persconffile_profile(ws_optarg, ws_optarg, TRUE, &pf_filename,
+ if (copy_persconffile_profile(ws_optarg, ws_optarg, true, &pf_filename,
&pf_dir_path, &pf_dir_path2) == -1) {
cmdarg_err("Can't copy file \"%s\" in directory\n\"%s\" to\n\"%s\":\n%s.",
pf_filename, pf_dir_path2, pf_dir_path, g_strerror(errno));
@@ -340,17 +341,17 @@ void commandline_early_options(int argc, char *argv[])
#endif /* _WIN32 */
exit(exit_status);
#else /* HAVE_LIBPCAP */
- capture_option_specified = TRUE;
+ capture_option_specified = true;
#endif /* HAVE_LIBPCAP */
break;
case 'h': /* Print help and exit */
- commandline_print_usage(TRUE);
+ commandline_print_usage(true);
exit(EXIT_SUCCESS);
break;
#ifdef _WIN32
case 'i':
if (strcmp(ws_optarg, "-") == 0)
- set_stdin_capture(TRUE);
+ set_stdin_capture(true);
break;
#endif
case 'P': /* Personal file directory path settings - change these before the Preferences and alike are processed */
@@ -392,13 +393,13 @@ void commandline_early_options(int argc, char *argv[])
#ifndef HAVE_LIBPCAP
if (capture_option_specified) {
print_no_capture_support_error();
- commandline_print_usage(FALSE);
+ commandline_print_usage(false);
exit(EXIT_SUCCESS);
}
#endif
}
-void commandline_override_prefs(int argc, char *argv[], gboolean opt_reset)
+void commandline_override_prefs(int argc, char *argv[], bool opt_reset)
{
int opt;
@@ -481,15 +482,15 @@ void commandline_override_prefs(int argc, char *argv[], gboolean opt_reset)
}
-void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
+void commandline_other_options(int argc, char *argv[], bool opt_reset)
{
int opt;
- gboolean arg_error = FALSE;
+ bool arg_error = false;
#ifdef HAVE_LIBPCAP
const char *list_option_supplied = NULL;
int status;
#else
- gboolean capture_option_specified;
+ bool capture_option_specified;
#endif
/*
@@ -524,13 +525,13 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
global_commandline_info.rfilter = NULL;
global_commandline_info.dfilter = NULL;
#ifdef HAVE_LIBPCAP
- global_commandline_info.start_capture = FALSE;
- global_commandline_info.list_link_layer_types = FALSE;
- global_commandline_info.list_timestamp_types = FALSE;
- global_commandline_info.quit_after_cap = getenv("WIRESHARK_QUIT_AFTER_CAPTURE") ? TRUE : FALSE;
+ global_commandline_info.start_capture = false;
+ global_commandline_info.list_link_layer_types = false;
+ global_commandline_info.list_timestamp_types = false;
+ global_commandline_info.quit_after_cap = getenv("WIRESHARK_QUIT_AFTER_CAPTURE") ? true : false;
global_commandline_info.capture_comments = NULL;
#endif
- global_commandline_info.full_screen = FALSE;
+ global_commandline_info.full_screen = false;
while ((opt = ws_getopt_long(argc, argv, optstring, long_options, NULL)) != -1) {
switch (opt) {
@@ -539,6 +540,7 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
case 'b': /* Ringbuffer option */
case 'c': /* Capture xxx packets */
case 'f': /* capture filter */
+ case 'F': /* capture file type */
case 'H': /* Hide capture info dialog box */
case 'p': /* Don't capture in promiscuous mode */
case 'i': /* Use interface x */
@@ -564,8 +566,8 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
exit_application(status);
}
#else
- capture_option_specified = TRUE;
- arg_error = TRUE;
+ capture_option_specified = true;
+ arg_error = true;
#endif
break;
@@ -577,43 +579,43 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
global_commandline_info.jump_backwards = SD_BACKWARD;
break;
case 'g': /* Go to packet with the given packet number */
- global_commandline_info.go_to_packet = get_nonzero_guint32(ws_optarg, "go to packet");
+ global_commandline_info.go_to_packet = get_nonzero_uint32(ws_optarg, "go to packet");
break;
case 'J': /* Jump to the first packet which matches the filter criteria */
global_commandline_info.jfilter = ws_optarg;
break;
case 'k': /* Start capture immediately */
#ifdef HAVE_LIBPCAP
- global_commandline_info.start_capture = TRUE;
+ global_commandline_info.start_capture = true;
#else
- capture_option_specified = TRUE;
- arg_error = TRUE;
+ capture_option_specified = true;
+ arg_error = true;
#endif
break;
case 'l': /* Automatic scrolling in live capture mode */
#ifdef HAVE_LIBPCAP
- recent.capture_auto_scroll = TRUE;
+ recent.capture_auto_scroll = true;
#else
- capture_option_specified = TRUE;
- arg_error = TRUE;
+ capture_option_specified = true;
+ arg_error = true;
#endif
break;
case 'L': /* Print list of link-layer types and exit */
#ifdef HAVE_LIBPCAP
- global_commandline_info.list_link_layer_types = TRUE;
+ global_commandline_info.list_link_layer_types = true;
list_option_supplied = "-L";
#else
- capture_option_specified = TRUE;
- arg_error = TRUE;
+ capture_option_specified = true;
+ arg_error = true;
#endif
break;
case LONGOPT_LIST_TSTAMP_TYPES:
#ifdef HAVE_LIBPCAP
- global_commandline_info.list_timestamp_types = TRUE;
+ global_commandline_info.list_timestamp_types = true;
list_option_supplied = "--list-time-stamp-types";
#else
- capture_option_specified = TRUE;
- arg_error = TRUE;
+ capture_option_specified = true;
+ arg_error = true;
#endif
break;
case 'o': /* Override preference from command line */
@@ -671,7 +673,7 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
exit_application(1);
break;
case LONGOPT_FULL_SCREEN:
- global_commandline_info.full_screen = TRUE;
+ global_commandline_info.full_screen = true;
break;
#ifdef HAVE_LIBPCAP
case LONGOPT_CAPTURE_COMMENT: /* capture comment */
@@ -680,13 +682,13 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
}
g_ptr_array_add(global_commandline_info.capture_comments, g_strdup(ws_optarg));
#else
- capture_option_specified = TRUE;
- arg_error = TRUE;
+ capture_option_specified = true;
+ arg_error = true;
#endif
break;
default:
case '?': /* Bad flag - print usage message */
- arg_error = TRUE;
+ arg_error = true;
break;
}
}
@@ -701,7 +703,7 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
* command-line argument.
*/
cmdarg_err("File name specified both with -r and regular argument");
- arg_error = TRUE;
+ arg_error = true;
} else {
/*
* Input file name not specified with "-r", and a command-line argument
@@ -724,17 +726,22 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
* Extra command line arguments were specified; complain.
*/
cmdarg_err("Invalid argument: %s", argv[0]);
- arg_error = TRUE;
+ arg_error = true;
}
}
if (arg_error) {
-#ifndef HAVE_LIBPCAP
+#ifdef HAVE_LIBPCAP
+ if (ws_optopt == 'F') {
+ capture_opts_list_file_types();
+ exit_application(1);
+ }
+#else
if (capture_option_specified) {
print_no_capture_support_error();
}
#endif
- commandline_print_usage(FALSE);
+ commandline_print_usage(false);
exit_application(1);
}
@@ -778,7 +785,7 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
file size is set to "infinite". */
if (global_capture_opts.save_file == NULL) {
cmdarg_err("Ring buffer requested, but capture isn't being saved to a permanent file.");
- global_capture_opts.multi_files_on = FALSE;
+ global_capture_opts.multi_files_on = false;
}
if (!global_capture_opts.has_autostop_filesize &&
!global_capture_opts.has_file_duration &&
@@ -793,7 +800,7 @@ void commandline_other_options(int argc, char *argv[], gboolean opt_reset)
}
/* Local function used by commandline_options_drop */
-static int cl_find_custom(gconstpointer elem_data, gconstpointer search_data) {
+static int cl_find_custom(const void *elem_data, const void *search_data) {
return memcmp(elem_data, search_data, strlen((char *)search_data));
}
@@ -809,7 +816,7 @@ void commandline_options_drop(const char *module_name, const char *pref_name) {
opt_prefix = ws_strdup_printf("%s.%s:", module_name, pref_name);
while (NULL != (elem = g_slist_find_custom(global_commandline_info.user_opts,
- (gconstpointer)opt_prefix, cl_find_custom))) {
+ (const void *)opt_prefix, cl_find_custom))) {
global_commandline_info.user_opts =
g_slist_remove_link(global_commandline_info.user_opts, elem);
g_free(elem->data);
@@ -844,5 +851,5 @@ void commandline_options_reapply(void) {
/* Free memory used to hold user-specified command line options */
void commandline_options_free(void) {
- g_slist_free_full(global_commandline_info.user_opts, g_free);
+ g_slist_free_full(g_steal_pointer(&global_commandline_info.user_opts), g_free);
}
diff --git a/ui/commandline.h b/ui/commandline.h
index 47bcbff8..0488729f 100644
--- a/ui/commandline.h
+++ b/ui/commandline.h
@@ -12,11 +12,13 @@
#ifndef __COMMANDLINE_H__
#define __COMMANDLINE_H__
+#include "cfile.h" /* For search_direction */
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-extern void commandline_print_usage(gboolean for_help_option);
+extern void commandline_print_usage(bool for_help_option);
extern void commandline_early_options(int argc, char *argv[]);
@@ -24,10 +26,10 @@ extern void commandline_early_options(int argc, char *argv[]);
typedef struct commandline_param_info
{
#ifdef HAVE_LIBPCAP
- gboolean list_link_layer_types;
- gboolean list_timestamp_types;
- gboolean start_capture;
- gboolean quit_after_cap;
+ bool list_link_layer_types;
+ bool list_timestamp_types;
+ bool start_capture;
+ bool quit_after_cap;
/*
* We currently don't support this as a way to add file comments
@@ -38,19 +40,19 @@ typedef struct commandline_param_info
#endif
e_prefs *prefs_p;
search_direction jump_backwards;
- guint32 go_to_packet;
- gchar* jfilter;
- gchar* cf_name;
- gchar* rfilter;
- gchar* dfilter;
- gboolean full_screen;
+ uint32_t go_to_packet;
+ char* jfilter;
+ char* cf_name;
+ char* rfilter;
+ char* dfilter;
+ bool full_screen;
GSList *user_opts;
} commandline_param_info_t;
-extern void commandline_override_prefs(int argc, char *argv[], gboolean opt_reset);
+extern void commandline_override_prefs(int argc, char *argv[], bool opt_reset);
-extern void commandline_other_options(int argc, char *argv[], gboolean opt_reset);
+extern void commandline_other_options(int argc, char *argv[], bool opt_reset);
extern void commandline_options_drop(const char *module_name, const char *pref_name);
diff --git a/ui/decode_as_utils.c b/ui/decode_as_utils.c
index 3b9bf56e..dec0868f 100644
--- a/ui/decode_as_utils.c
+++ b/ui/decode_as_utils.c
@@ -26,7 +26,7 @@
/* XXX - We might want to switch this to a UAT */
-static const char* prev_display_dissector_name = NULL;
+static const char* prev_display_dissector_name;
/*
* For a dissector table, print on the stream described by output,
@@ -35,12 +35,33 @@ static const char* prev_display_dissector_name = NULL;
*/
static void
display_dissector_table_names(const char *table_name, const char *ui_name,
-gpointer output)
+void *output)
{
- if ((prev_display_dissector_name == NULL) ||
- (strcmp(prev_display_dissector_name, table_name) != 0)) {
- fprintf((FILE *)output, "\t%s (%s)\n", table_name, ui_name);
- prev_display_dissector_name = table_name;
+ ftenum_t selector_type = get_dissector_table_selector_type(table_name);
+
+ switch (selector_type) {
+
+ case FT_UINT8:
+ case FT_UINT16:
+ case FT_UINT24:
+ case FT_UINT32:
+ case FT_STRING:
+ case FT_STRINGZ:
+ case FT_UINT_STRING:
+ case FT_STRINGZPAD:
+ case FT_STRINGZTRUNC:
+ case FT_NONE:
+ /* This option supports these types. */
+ if ((prev_display_dissector_name == NULL) ||
+ (strcmp(prev_display_dissector_name, table_name) != 0)) {
+ fprintf((FILE *)output, "\t%s (%s)\n", table_name, ui_name);
+ prev_display_dissector_name = table_name;
+ }
+ break;
+
+ default:
+ /* Other types (FT_GUID, FT_BYTES) are not supported. */
+ break;
}
}
@@ -50,11 +71,11 @@ gpointer output)
* name for the protocol that corresponds to this handle.
*/
static void
-display_dissector_names(const gchar *table _U_, gpointer handle, gpointer output)
+display_dissector_names(const char *table _U_, void *handle, void *output)
{
int proto_id;
- const gchar *proto_filter_name;
- const gchar *proto_ui_name;
+ const char *proto_filter_name;
+ const char *proto_ui_name;
proto_id = dissector_handle_get_protocol_index((dissector_handle_t)handle);
@@ -78,8 +99,8 @@ display_dissector_names(const gchar *table _U_, gpointer handle, gpointer output
* Allow dissector key names to be sorted alphabetically
*/
-static gint
-compare_dissector_key_name(gconstpointer dissector_a, gconstpointer dissector_b)
+static int
+compare_dissector_key_name(const void *dissector_a, const void *dissector_b)
{
return strcmp((const char*)dissector_a, (const char*)dissector_b);
}
@@ -93,7 +114,7 @@ fprint_all_layer_types(FILE *output)
{
prev_display_dissector_name = NULL;
- dissector_all_tables_foreach_table(display_dissector_table_names, (gpointer)output, (GCompareFunc)compare_dissector_key_name);
+ dissector_all_tables_foreach_table(display_dissector_table_names, (void *)output, (GCompareFunc)compare_dissector_key_name);
}
/*
@@ -102,13 +123,13 @@ fprint_all_layer_types(FILE *output)
* We send the output to the stream described by the handle output.
*/
static void
-fprint_all_protocols_for_layer_types(FILE *output, gchar *table_name)
+fprint_all_protocols_for_layer_types(FILE *output, char *table_name)
{
prev_display_dissector_name = NULL;
dissector_table_foreach_handle(table_name,
display_dissector_names,
- (gpointer)output);
+ (void *)output);
}
/*
@@ -118,7 +139,7 @@ fprint_all_protocols_for_layer_types(FILE *output, gchar *table_name)
struct protocol_name_search{
const char *searched_name; /* Protocol filter name we are looking for */
dissector_handle_t matched_handle; /* Handle for a dissector whose protocol has the specified filter name */
- guint nb_match; /* How many dissectors matched searched_name */
+ unsigned nb_match; /* How many dissectors matched searched_name */
};
typedef struct protocol_name_search *protocol_name_search_t;
@@ -132,11 +153,11 @@ typedef struct protocol_name_search *protocol_name_search_t;
* whole list of dissectors.
*/
static void
-find_protocol_name_func(const gchar *table _U_, gpointer handle, gpointer user_data)
+find_protocol_name_func(const char *table _U_, void *handle, void *user_data)
{
int proto_id;
- const gchar *protocol_filter_name;
+ const char *protocol_filter_name;
protocol_name_search_t search_info;
ws_assert(handle);
@@ -163,23 +184,23 @@ find_protocol_name_func(const gchar *table _U_, gpointer handle, gpointer user_d
* feature (a string pointer by cl_param).
* It checks the format of the command-line, searches for a matching table
* and dissector. If a table/dissector match is not found, we display a
-* summary of the available tables/dissectors (on stderr) and return FALSE.
+* summary of the available tables/dissectors (on stderr) and return false.
* If everything is fine, we get the "Decode as" preference activated,
-* then we return TRUE.
+* then we return true.
*/
-gboolean decode_as_command_option(const gchar *cl_param)
+bool decode_as_command_option(const char *cl_param)
{
- gchar *table_name;
- guint32 selector = 0, selector2 = 0;
- gchar *decoded_param;
- gchar *remaining_param;
- gchar *selector_str = NULL;
- gchar *dissector_str;
+ char *table_name;
+ uint32_t selector = 0, selector2 = 0;
+ char *decoded_param;
+ char *remaining_param;
+ char *selector_str = NULL;
+ char *dissector_str;
dissector_handle_t dissector_matching;
dissector_table_t table_matching;
ftenum_t dissector_table_selector_type;
struct protocol_name_search user_protocol_name;
- guint64 i;
+ uint64_t i;
char op = '\0';
/* The following code will allocate and copy the command-line options in a string pointed by decoded_param */
@@ -244,7 +265,7 @@ gboolean decode_as_command_option(const gchar *cl_param)
/* Exit if the layer type was not found, or if no '=' separator was found
(see above) */
g_free(decoded_param);
- return FALSE;
+ return false;
}
dissector_table_selector_type = get_dissector_table_selector_type(table_name);
@@ -285,21 +306,21 @@ gboolean decode_as_command_option(const gchar *cl_param)
{
/* The selector for this table is an unsigned number. Parse it as such.
Skip leading spaces for backwards compatibility (previously sscanf was used). */
- gchar *str = selector_str;
- gchar *end;
- guint64 val;
+ char *str = selector_str;
+ char *end;
+ uint64_t val;
while (g_ascii_isspace(*str)) {
str++;
}
val = g_ascii_strtoull(str, &end, 0);
- if (str == end || val > G_MAXUINT32) {
+ if (str == end || val > UINT32_MAX) {
cmdarg_err("Invalid selector number \"%s\"", selector_str);
g_free(decoded_param);
- return FALSE;
+ return false;
}
- selector = (guint32) val;
+ selector = (uint32_t) val;
if (*end == '\0') {
/* not a range, but a single (valid) value */
@@ -311,18 +332,18 @@ gboolean decode_as_command_option(const gchar *cl_param)
str = end + 1;
val = g_ascii_strtoull(str, &end, 0);
- if (str == end || val > G_MAXUINT32 || *end != '\0') {
+ if (str == end || val > UINT32_MAX || *end != '\0') {
cmdarg_err("Invalid selector numeric range \"%s\"", selector_str);
g_free(decoded_param);
- return FALSE;
+ return false;
}
- selector2 = (guint32) val;
+ selector2 = (uint32_t) val;
if (op == ':') {
- if ((selector2 == 0) || ((guint64)selector + selector2 - 1) > G_MAXUINT32) {
+ if ((selector2 == 0) || ((uint64_t)selector + selector2 - 1) > UINT32_MAX) {
cmdarg_err("Invalid selector numeric range \"%s\"", selector_str);
g_free(decoded_param);
- return FALSE;
+ return false;
}
}
else if (selector2 < selector) {
@@ -330,13 +351,13 @@ gboolean decode_as_command_option(const gchar *cl_param)
* this out as an error in case it's not what was intended? */
cmdarg_err("Invalid selector numeric range \"%s\"", selector_str);
g_free(decoded_param);
- return FALSE;
+ return false;
}
} else {
/* neither a valid single value, nor a range. */
cmdarg_err("Invalid selector number \"%s\"", selector_str);
g_free(decoded_param);
- return FALSE;
+ return false;
}
break;
}
@@ -353,6 +374,19 @@ gboolean decode_as_command_option(const gchar *cl_param)
/* There is no selector for this table */
break;
+ case FT_BYTES:
+ /* Custom table. Parsing a selector is not really possible. */
+ cmdarg_err("\"%s\" is a custom table; specifying selectors on the command line is not supported.", table_name);
+ g_free(decoded_param);
+ return false;
+
+ case FT_GUID:
+ /* GUID table. It might be possible to parse a selector (guid_key)
+ * in the future, but not now. */
+ cmdarg_err("\"%s\" is a GUID table; specifying selectors on the command line is not supported.", table_name);
+ g_free(decoded_param);
+ return false;
+
default:
/* There are currently no dissector tables with any types other
than the ones listed above. */
@@ -364,7 +398,7 @@ gboolean decode_as_command_option(const gchar *cl_param)
cmdarg_err("Valid protocols for layer type \"%s\" are:", table_name);
fprint_all_protocols_for_layer_types(stderr, table_name);
g_free(decoded_param);
- return FALSE;
+ return false;
}
remaining_param++; /* Position after the selector number string */
@@ -425,7 +459,7 @@ gboolean decode_as_command_option(const gchar *cl_param)
cmdarg_err("Valid protocols for layer type \"%s\" are:", table_name);
fprint_all_protocols_for_layer_types(stderr, table_name);
g_free(decoded_param);
- return FALSE;
+ return false;
}
/* This is the end of the code that parses the command-line options.
@@ -452,13 +486,13 @@ gboolean decode_as_command_option(const gchar *cl_param)
dissector_change_uint(table_name, selector, dissector_matching);
}
else if (op == ':') {
- for (i = selector; i < (guint64)selector + selector2; i++) {
- dissector_change_uint(table_name, (guint32)i, dissector_matching);
+ for (i = selector; i < (uint64_t)selector + selector2; i++) {
+ dissector_change_uint(table_name, (uint32_t)i, dissector_matching);
}
}
else { /* op == '-' */
for (i = selector; i <= selector2; i++) {
- dissector_change_uint(table_name, (guint32)i, dissector_matching);
+ dissector_change_uint(table_name, (uint32_t)i, dissector_matching);
}
}
break;
@@ -479,9 +513,10 @@ gboolean decode_as_command_option(const gchar *cl_param)
default:
/* There are currently no dissector tables with any types other
- than the ones listed above. */
+ than the ones listed above. (We already exited for FT_GUID and
+ FT_BYTES tables.) */
ws_assert_not_reached();
}
g_free(decoded_param); /* "Decode As" rule has been successfully added */
- return TRUE;
+ return true;
}
diff --git a/ui/decode_as_utils.h b/ui/decode_as_utils.h
index 1dc30b83..5699534d 100644
--- a/ui/decode_as_utils.h
+++ b/ui/decode_as_utils.h
@@ -28,7 +28,7 @@ extern "C" {
*/
#define DECODE_AS_ARG_TEMPLATE "<layer_type>==<selector>,<decode_as_protocol>"
-gboolean decode_as_command_option(const gchar *cl_param);
+bool decode_as_command_option(const char *cl_param);
#ifdef __cplusplus
}
diff --git a/ui/dissect_opts.c b/ui/dissect_opts.c
index 4369bd26..5f812faa 100644
--- a/ui/dissect_opts.c
+++ b/ui/dissect_opts.c
@@ -41,7 +41,7 @@ dissect_options global_dissect_options = {
.time_precision = TS_PREC_NOT_SET
};
-gboolean
+bool
dissect_opts_handle_opt(int opt, char *optarg_str_p)
{
char badopt;
@@ -51,14 +51,14 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
switch(opt) {
case 'd': /* Decode as rule */
if (!decode_as_command_option(optarg_str_p))
- return FALSE;
+ return false;
break;
case 'K': /* Kerberos keytab file */
#if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
read_keytab_file(optarg_str_p);
#else
cmdarg_err("-K specified, but Kerberos keytab file support isn't present");
- return FALSE;
+ return false;
#endif
break;
case 'n': /* No name resolution */
@@ -75,9 +75,11 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
"\t'n' to enable network address resolution\n"
"\t'N' to enable using external resolvers (e.g., DNS)\n"
"\t for network address resolution\n"
+ "\t's' to enable address resolution using SNI information found in captured\n"
+ "\t handshake packets\n"
"\t't' to enable transport-layer port number resolution\n"
"\t'v' to enable VLAN IDs to names resolution");
- return FALSE;
+ return false;
}
break;
case 't': /* Time stamp type */
@@ -92,12 +94,12 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
* Precision must be a number giving the number of
* digits of precision.
*/
- guint32 val;
+ uint32_t val;
if (!ws_strtou32(dotp + 1, NULL, &val) || val > WS_TSPREC_MAX) {
cmdarg_err("Invalid .N time stamp precision \"%s\"; N must be a value between 0 and %u or absent",
dotp + 1, WS_TSPREC_MAX);
- return FALSE;
+ return false;
}
tsp = val;
}
@@ -139,7 +141,7 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
"\t\"udoy\" for absolute UTC with YYYY/DOY date");
if (dotp)
*dotp = '.';
- return FALSE;
+ return false;
}
if (dotp) {
*dotp = '.';
@@ -155,7 +157,7 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
cmdarg_err("Invalid seconds type \"%s\"; it must be one of:", optarg_str_p);
cmdarg_err_cont("\t\"s\" for seconds\n"
"\t\"hms\" for hours, minutes and seconds");
- return FALSE;
+ return false;
}
break;
case LONGOPT_DISABLE_PROTOCOL: /* disable dissection of protocol */
@@ -167,7 +169,7 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
case LONGOPT_DISABLE_HEURISTIC: /* disable heuristic dissection of protocol */
global_dissect_options.disable_heur_slist = g_slist_append(global_dissect_options.disable_heur_slist, optarg_str_p);
break;
- case LONGOPT_ENABLE_PROTOCOL: /* enable dissection of protocol (that is disableed by default) */
+ case LONGOPT_ENABLE_PROTOCOL: /* enable dissection of protocol (that is disabled by default) */
global_dissect_options.enable_protocol_slist = g_slist_append(global_dissect_options.enable_protocol_slist, optarg_str_p);
break;
case LONGOPT_ONLY_PROTOCOLS: /* enable dissection of these comma separated protocols only */
@@ -183,16 +185,16 @@ dissect_opts_handle_opt(int opt, char *optarg_str_p)
/* the caller is responsible to send us only the right opt's */
ws_assert_not_reached();
}
- return TRUE;
+ return true;
}
-typedef gboolean (proto_set_func)(const char *);
+typedef bool (proto_set_func)(const char *);
-static gboolean
+static bool
process_enable_disable_list(GSList *list, proto_set_func callback)
{
- gboolean success = TRUE;
- gboolean rv;
+ bool success = true;
+ bool rv;
GSList *iter;
char *c;
char *proto_name;
@@ -204,7 +206,7 @@ process_enable_disable_list(GSList *list, proto_set_func callback)
rv = callback(proto_name);
if (!rv) {
cmdarg_err("No such protocol %s", proto_name);
- success = FALSE;
+ success = false;
}
}
else {
@@ -220,7 +222,7 @@ process_enable_disable_list(GSList *list, proto_set_func callback)
rv = callback(start);
if (!rv) {
cmdarg_err("No such protocol %s", start);
- success = FALSE;
+ success = false;
}
if (c != NULL) {
*c = save;
@@ -237,18 +239,18 @@ process_enable_disable_list(GSList *list, proto_set_func callback)
return success;
}
-gboolean
+bool
setup_enabled_and_disabled_protocols(void)
{
- gboolean success = TRUE;
+ bool success = true;
- success &= process_enable_disable_list(global_dissect_options.disable_protocol_slist,
+ success = success && process_enable_disable_list(global_dissect_options.disable_protocol_slist,
proto_disable_proto_by_name);
- success &= process_enable_disable_list(global_dissect_options.enable_protocol_slist,
+ success = success && process_enable_disable_list(global_dissect_options.enable_protocol_slist,
proto_enable_proto_by_name);
- success &= process_enable_disable_list(global_dissect_options.enable_heur_slist,
+ success = success && process_enable_disable_list(global_dissect_options.enable_heur_slist,
proto_enable_heuristic_by_name);
- success &= process_enable_disable_list(global_dissect_options.disable_heur_slist,
+ success = success && process_enable_disable_list(global_dissect_options.disable_heur_slist,
proto_disable_heuristic_by_name);
return success;
}
diff --git a/ui/dissect_opts.h b/ui/dissect_opts.h
index 6c2c4446..d86aa0d2 100644
--- a/ui/dissect_opts.h
+++ b/ui/dissect_opts.h
@@ -46,9 +46,11 @@ extern "C" {
{"enable-protocol", ws_required_argument, NULL, LONGOPT_ENABLE_PROTOCOL }, \
{"only-protocols", ws_required_argument, NULL, LONGOPT_ONLY_PROTOCOLS }, \
{"disable-all-protocols", ws_no_argument, NULL, LONGOPT_DISABLE_ALL_PROTOCOLS }, \
+ {"read-filter", ws_required_argument, NULL, 'R' }, \
+ {"display-filter", ws_required_argument, NULL, 'Y' }, \
#define OPTSTRING_DISSECT_COMMON \
- "d:K:nN:t:u:"
+ "d:K:nN:R:t:u:Y:"
/** Capture options coming from user interface */
typedef struct dissect_options_tag {
@@ -64,20 +66,20 @@ extern dissect_options global_dissect_options;
/*
* Handle a command line option.
- * Returns TRUE if the option is valid, FALSE if not; an error message
+ * Returns true if the option is valid, false if not; an error message
* is reported with cmdarg_err() if it's not valid.
*/
-extern gboolean
+extern bool
dissect_opts_handle_opt(int opt, char *optarg_str_p);
/*
* Set up disabled protocols and enabled/disabled heuristic protocols
* as per specified command-line options.
*
- * Returns TRUE if all specified heuristic protocols exist, FALSE
+ * Returns true if all specified heuristic protocols exist, false
* otherwise.
*/
-extern gboolean
+extern bool
setup_enabled_and_disabled_protocols(void);
#ifdef __cplusplus
diff --git a/ui/export_pdu_ui_utils.c b/ui/export_pdu_ui_utils.c
index 51780dd8..32b91ad8 100644
--- a/ui/export_pdu_ui_utils.c
+++ b/ui/export_pdu_ui_utils.c
@@ -30,16 +30,16 @@
#include "export_pdu_ui_utils.h"
void
-do_export_pdu(const char *filter, const gchar *temp_dir, const gchar *tap_name)
+do_export_pdu(const char *filter, const char *temp_dir, const char *tap_name)
{
exp_pdu_t exp_pdu_tap_data;
char *error;
int import_file_fd;
int file_type_subtype;
char *capfile_name = NULL, *comment;
- gboolean status;
+ bool status;
int err;
- gchar *err_info;
+ char *err_info;
error = exp_pdu_pre_open(tap_name, filter, &exp_pdu_tap_data);
if (error) {
@@ -85,13 +85,13 @@ do_export_pdu(const char *filter, const gchar *temp_dir, const gchar *tap_name)
}
/* XXX: should this use the open_routine type in the cfile instead of WTAP_TYPE_AUTO? */
- if (cf_open(&cfile, capfile_name, WTAP_TYPE_AUTO, TRUE /* temporary file */, &err) != CF_OK) {
+ if (cf_open(&cfile, capfile_name, WTAP_TYPE_AUTO, true /* temporary file */, &err) != CF_OK) {
/* cf_open() has put up a dialog box for the error */
g_free(capfile_name);
return;
}
- switch (cf_read(&cfile, /*reloading=*/FALSE)) {
+ switch (cf_read(&cfile, /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
/* Just because we got an error, that doesn't mean we were unable
diff --git a/ui/export_pdu_ui_utils.h b/ui/export_pdu_ui_utils.h
index 9187527f..a13eef8b 100644
--- a/ui/export_pdu_ui_utils.h
+++ b/ui/export_pdu_ui_utils.h
@@ -21,7 +21,7 @@ extern "C" {
* Filters the current opened capture file into a temporary file. On success,
* the filtered file is opened into the UI.
*/
-void do_export_pdu(const char *filter, const gchar *temp_dir, const gchar *tap_name);
+void do_export_pdu(const char *filter, const char *temp_dir, const char *tap_name);
#ifdef __cplusplus
diff --git a/ui/failure_message.c b/ui/failure_message.c
index 84a19e1c..3f2f5c6d 100644
--- a/ui/failure_message.c
+++ b/ui/failure_message.c
@@ -34,11 +34,11 @@ failure_message(const char *msg_format, va_list ap)
* Error message for a failed attempt to open or create a file
* other than a capture file.
* "filename" is the name of the file being opened; "err" is assumed
- * to be a UNIX-style errno; "for_writing" is TRUE if we're opening
- * the file for writing and FALSE if we're opening it for reading.
+ * to be a UNIX-style errno; "for_writing" is true if we're opening
+ * the file for writing and false if we're opening it for reading.
*/
void
-open_failure_message(const char *filename, int err, gboolean for_writing)
+open_failure_message(const char *filename, int err, bool for_writing)
{
cmdarg_err(file_open_error_message(err, for_writing), filename);
}
@@ -106,7 +106,7 @@ output_file_description(const char *fname)
* to be a string giving further information for some WTAP_ERR_ values.
*/
void
-cfile_open_failure_message(const char *filename, int err, gchar *err_info)
+cfile_open_failure_message(const char *filename, int err, char *err_info)
{
if (err < 0) {
/*
@@ -195,7 +195,7 @@ cfile_open_failure_message(const char *filename, int err, gchar *err_info)
}
g_free(file_description);
} else
- cmdarg_err(file_open_error_message(err, FALSE), filename);
+ cmdarg_err(file_open_error_message(err, false), filename);
}
/*
@@ -207,7 +207,7 @@ cfile_open_failure_message(const char *filename, int err, gchar *err_info)
* and subtype of file being opened.
*/
void
-cfile_dump_open_failure_message(const char *filename, int err, gchar *err_info,
+cfile_dump_open_failure_message(const char *filename, int err, char *err_info,
int file_type_subtype)
{
if (err < 0) {
@@ -275,7 +275,7 @@ cfile_dump_open_failure_message(const char *filename, int err, gchar *err_info,
}
g_free(file_description);
} else
- cmdarg_err(file_open_error_message(err, TRUE), filename);
+ cmdarg_err(file_open_error_message(err, true), filename);
}
/*
@@ -285,7 +285,7 @@ cfile_dump_open_failure_message(const char *filename, int err, gchar *err_info,
* to be a string giving further information for some WTAP_ERR_ values.
*/
void
-cfile_read_failure_message(const char *filename, int err, gchar *err_info)
+cfile_read_failure_message(const char *filename, int err, char *err_info)
{
char *file_string;
@@ -359,8 +359,8 @@ cfile_read_failure_message(const char *filename, int err, gchar *err_info)
*/
void
cfile_write_failure_message(const char *in_filename, const char *out_filename,
- int err, gchar *err_info,
- guint32 framenum, int file_type_subtype)
+ int err, char *err_info,
+ uint64_t framenum, int file_type_subtype)
{
char *in_file_string;
char *in_frame_string;
@@ -371,7 +371,7 @@ cfile_write_failure_message(const char *in_filename, const char *out_filename,
in_frame_string = g_strdup("");
} else {
in_file_string = input_file_description(in_filename);
- in_frame_string = ws_strdup_printf(" %u of %s", framenum,
+ in_frame_string = ws_strdup_printf(" %" PRIu64 " of %s", framenum,
in_file_string);
g_free(in_file_string);
}
@@ -499,7 +499,7 @@ cfile_write_failure_message(const char *in_filename, const char *out_filename,
* so we have to check for write errors here.
*/
void
-cfile_close_failure_message(const char *filename, int err, gchar *err_info)
+cfile_close_failure_message(const char *filename, int err, char *err_info)
{
char *file_string;
diff --git a/ui/failure_message.h b/ui/failure_message.h
index 4f65f98f..bd8ecd54 100644
--- a/ui/failure_message.h
+++ b/ui/failure_message.h
@@ -26,11 +26,11 @@ extern void failure_message(const char *msg_format, va_list ap);
* Error message for a failed attempt to open or create a file
* other than a capture file.
* "filename" is the name of the file being opened; "err" is assumed
- * to be a UNIX-style errno; "for_writing" is TRUE if we're opening
- * the file for writing and FALSE if we're opening it for reading.
+ * to be a UNIX-style errno; "for_writing" is true if we're opening
+ * the file for writing and false if we're opening it for reading.
*/
extern void open_failure_message(const char *filename, int err,
- gboolean for_writing);
+ bool for_writing);
/*
* Error message for a failed attempt to read from a file other than
@@ -55,7 +55,7 @@ extern void write_failure_message(const char *filename, int err);
* to be a string giving further information for some WTAP_ERR_ values.
*/
extern void cfile_open_failure_message(const char *filename, int err,
- gchar *err_info);
+ char *err_info);
/*
* Error message for a failed attempt to open a capture file for output.
@@ -66,7 +66,7 @@ extern void cfile_open_failure_message(const char *filename, int err,
* and subtype of file being opened.
*/
extern void cfile_dump_open_failure_message(const char *filename, int err,
- gchar *err_info,
+ char *err_info,
int file_type_subtype);
/*
@@ -76,7 +76,7 @@ extern void cfile_dump_open_failure_message(const char *filename, int err,
* to be a string giving further information for some WTAP_ERR_ values.
*/
extern void cfile_read_failure_message(const char *filename, int err,
- gchar *err_info);
+ char *err_info);
/*
* Error message for a failed attempt to write to a capture file.
@@ -91,8 +91,8 @@ extern void cfile_read_failure_message(const char *filename, int err,
*/
extern void cfile_write_failure_message(const char *in_filename,
const char *out_filename,
- int err, gchar *err_info,
- guint32 framenum,
+ int err, char *err_info,
+ uint64_t framenum,
int file_type_subtype);
/*
@@ -120,7 +120,7 @@ extern void cfile_write_failure_message(const char *in_filename,
* so we have to check for write errors here.
*/
extern void cfile_close_failure_message(const char *filename, int err,
- gchar *err_info);
+ char *err_info);
#ifdef __cplusplus
}
diff --git a/ui/file_dialog.c b/ui/file_dialog.c
index 91eea5ad..7d35f589 100644
--- a/ui/file_dialog.c
+++ b/ui/file_dialog.c
@@ -24,26 +24,26 @@
ws_file_preview_stats_status
get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats,
- int *err, gchar **err_info)
+ int *err, char **err_info)
{
- gint64 data_offset;
+ int64_t data_offset;
wtap_rec rec;
Buffer buf;
- guint32 records;
- guint32 data_records;
+ uint32_t records;
+ uint32_t data_records;
double start_time;
double stop_time;
- gboolean have_times;
- gboolean timed_out;
+ bool have_times;
+ bool timed_out;
time_t time_preview, time_current;
double cur_time;
- have_times = FALSE;
+ have_times = false;
start_time = 0;
stop_time = 0;
records = 0;
data_records = 0;
- timed_out = FALSE;
+ timed_out = false;
time(&time_preview);
wtap_rec_init(&rec);
ws_buffer_init(&buf, 1514);
@@ -53,7 +53,7 @@ get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats,
if (!have_times) {
start_time = cur_time;
stop_time = cur_time;
- have_times = TRUE;
+ have_times = true;
}
if (cur_time < start_time) {
start_time = cur_time;
@@ -79,7 +79,7 @@ get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats,
/* do we have a timeout? */
time(&time_current);
if (time_current-time_preview >= (time_t) prefs.gui_fileopen_preview) {
- timed_out = TRUE;
+ timed_out = true;
break;
}
}
diff --git a/ui/file_dialog.h b/ui/file_dialog.h
index e8507126..cd85693c 100644
--- a/ui/file_dialog.h
+++ b/ui/file_dialog.h
@@ -34,11 +34,11 @@ typedef enum {
} export_type_e;
typedef struct {
- gboolean have_times; /* TRUE if we have start and stop times */
+ bool have_times; /* true if we have start and stop times */
double start_time; /* seconds, with nsec resolution */
double stop_time; /* seconds, with nsec resolution */
- guint32 records; /* total number of records */
- guint32 data_records; /* number of data records */
+ uint32_t records; /* total number of records */
+ uint32_t data_records; /* number of data records */
} ws_file_preview_stats;
typedef enum {
@@ -49,7 +49,7 @@ typedef enum {
extern ws_file_preview_stats_status
get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats,
- int *err, gchar **err_info);
+ int *err, char **err_info);
#ifdef __cplusplus
}
diff --git a/ui/firewall_rules.c b/ui/firewall_rules.c
index 3ddc31b5..7d127c58 100644
--- a/ui/firewall_rules.c
+++ b/ui/firewall_rules.c
@@ -24,36 +24,37 @@
#include <glib.h>
+#include <wsutil/array.h>
#include "epan/address.h"
#include "firewall_rules.h"
-static void sf_ipfw_mac(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netfilter_mac(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
+static void sf_ipfw_mac(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netfilter_mac(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
-static void sf_ios_std_ipv4(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ios_ext_ipv4(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ipfilter_ipv4(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ipfw_ipv4(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netfilter_ipv4(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_pf_ipv4(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
+static void sf_ios_std_ipv4(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ios_ext_ipv4(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ipfilter_ipv4(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ipfw_ipv4(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netfilter_ipv4(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_pf_ipv4(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
/* XXX - Can you addresses-only filters using WFW/netsh? */
-static void sf_ios_ext_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ipfilter_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ipfw_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netfilter_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_pf_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netsh_port_old(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netsh_port_new(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-
-static void sf_ios_ext_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ipfilter_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_ipfw_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netfilter_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_pf_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netsh_ipv4_port_old(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
-static void sf_netsh_ipv4_port_new(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
+static void sf_ios_ext_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ipfilter_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ipfw_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netfilter_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_pf_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netsh_port_old(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netsh_port_new(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+
+static void sf_ios_ext_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ipfilter_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_ipfw_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netfilter_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_pf_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netsh_ipv4_port_old(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
+static void sf_netsh_ipv4_port_new(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
typedef struct _fw_product_t {
const char *name;
@@ -63,29 +64,29 @@ typedef struct _fw_product_t {
syntax_func ipv4_func;
syntax_func port_func;
syntax_func ipv4_port_func;
- gboolean does_inbound;
+ bool does_inbound;
} fw_product;
static fw_product products[] = {
{ "Cisco IOS (standard)", "Change NUMBER to a valid ACL number.", "!",
- NULL, sf_ios_std_ipv4, NULL, NULL, FALSE },
+ NULL, sf_ios_std_ipv4, NULL, NULL, false },
{ "Cisco IOS (extended)", "Change NUMBER to a valid ACL number.", "!",
- NULL, sf_ios_ext_ipv4, sf_ios_ext_port, sf_ios_ext_ipv4_port, TRUE },
+ NULL, sf_ios_ext_ipv4, sf_ios_ext_port, sf_ios_ext_ipv4_port, true },
{ "IP Filter (ipfilter)", "Change le0 to a valid interface if needed.", "#",
- NULL, sf_ipfilter_ipv4, sf_ipfilter_port, sf_ipfilter_ipv4_port, TRUE },
+ NULL, sf_ipfilter_ipv4, sf_ipfilter_port, sf_ipfilter_ipv4_port, true },
{ "IPFirewall (ipfw)", "", "#",
- sf_ipfw_mac, sf_ipfw_ipv4, sf_ipfw_port, sf_ipfw_ipv4_port, TRUE },
+ sf_ipfw_mac, sf_ipfw_ipv4, sf_ipfw_port, sf_ipfw_ipv4_port, true },
{ "Netfilter (iptables)", "Change eth0 to a valid interface if needed.", "#",
sf_netfilter_mac, sf_netfilter_ipv4, sf_netfilter_port,
- sf_netfilter_ipv4_port, TRUE },
+ sf_netfilter_ipv4_port, true },
{ "Packet Filter (pf)", "$ext_if should be set to a valid interface.", "#",
- NULL, sf_pf_ipv4, sf_pf_port, sf_pf_ipv4_port, TRUE },
+ NULL, sf_pf_ipv4, sf_pf_port, sf_pf_ipv4_port, true },
{ "Windows Firewall (netsh old syntax)", "", "#",
- NULL, NULL, sf_netsh_port_old, sf_netsh_ipv4_port_old, FALSE },
+ NULL, NULL, sf_netsh_port_old, sf_netsh_ipv4_port_old, false },
{ "Windows Firewall (netsh new syntax)", "", "#",
- NULL, NULL, sf_netsh_port_new, sf_netsh_ipv4_port_new, FALSE }
+ NULL, NULL, sf_netsh_port_new, sf_netsh_ipv4_port_new, false }
};
-#define NUM_PRODS (sizeof(products) / sizeof(fw_product))
+#define NUM_PRODS array_length(products)
size_t firewall_product_count(void)
@@ -138,9 +139,9 @@ syntax_func firewall_product_ipv4_port_func(size_t product_idx)
return products[product_idx].ipv4_port_func;
}
-gboolean firewall_product_does_inbound(size_t product_idx)
+bool firewall_product_does_inbound(size_t product_idx)
{
- if (product_idx >= NUM_PRODS) return FALSE;
+ if (product_idx >= NUM_PRODS) return false;
return products[product_idx].does_inbound;
}
@@ -148,25 +149,25 @@ gboolean firewall_product_does_inbound(size_t product_idx)
/* MAC */
#define IPFW_RULE(deny) ((deny) ? "deny" : "allow")
#define IPFW_DIR(inbound) ((inbound) ? "in" : "out")
-static void sf_ipfw_mac(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_ipfw_mac(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
g_string_append_printf(rtxt, "add %s MAC %s any %s",
IPFW_RULE(deny), addr, IPFW_DIR(inbound));
}
#define NF_RULE(deny) ((deny) ? "DROP" : "ACCEPT")
#define NF_DIR(inbound) ((inbound) ? "INPUT" : "OUTPUT")
-static void sf_netfilter_mac(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_netfilter_mac(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
g_string_append_printf(rtxt, "iptables --append %s --in-interface eth0 --mac-source %s --jump %s",
NF_DIR(inbound), addr, NF_RULE(deny));
}
/* IPv4 */
#define IOS_RULE(deny) ((deny) ? "deny" : "permit")
-static void sf_ios_std_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound _U_, gboolean deny) {
+static void sf_ios_std_ipv4(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound _U_, bool deny) {
g_string_append_printf(rtxt, "access-list NUMBER %s host %s", IOS_RULE(deny), addr);
}
-static void sf_ios_ext_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_ios_ext_ipv4(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
if (inbound)
g_string_append_printf(rtxt, "access-list NUMBER %s ip host %s any", IOS_RULE(deny), addr);
else
@@ -176,78 +177,78 @@ static void sf_ios_ext_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_t
#define IPFILTER_RULE(deny) ((deny) ? "block" : "pass")
#define IPFILTER_DIR(inbound) ((inbound) ? "in" : "out")
-static void sf_ipfilter_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_ipfilter_ipv4(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
g_string_append_printf(rtxt, "%s %s on le0 from %s to any",
IPFILTER_RULE(deny), IPFILTER_DIR(inbound), addr);
}
-static void sf_ipfw_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_ipfw_ipv4(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
g_string_append_printf(rtxt, "add %s ip from %s to any %s",
IPFW_RULE(deny), addr, IPFW_DIR(inbound));
}
#define NF_ADDR_DIR(inbound) ((inbound) ? "--source" : "--destination")
-static void sf_netfilter_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_netfilter_ipv4(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
g_string_append_printf(rtxt, "iptables --append %s --in-interface eth0 %s %s/32 --jump %s",
NF_DIR(inbound), NF_ADDR_DIR(inbound), addr, NF_RULE(deny));
}
#define PF_RULE(deny) ((deny) ? "block" : "pass")
#define PF_DIR(inbound) ((inbound) ? "in" : "out")
-static void sf_pf_ipv4(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype _U_, gboolean inbound, gboolean deny) {
+static void sf_pf_ipv4(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype _U_, bool inbound, bool deny) {
g_string_append_printf(rtxt, "%s %s quick on $ext_if from %s to any",
PF_RULE(deny), PF_DIR(inbound), addr);
}
/* Port */
#define RT_TCP_UDP(ptype) ((ptype) == PT_TCP ? "tcp" : "udp")
-static void sf_ios_ext_port(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound _U_, gboolean deny) {
+static void sf_ios_ext_port(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound _U_, bool deny) {
g_string_append_printf(rtxt, "access-list NUMBER %s %s any any eq %u",
IOS_RULE(deny), RT_TCP_UDP(ptype), port);
}
-static void sf_ipfilter_port(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_ipfilter_port(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "%s %s on le0 proto %s from any to any port = %u",
IPFILTER_RULE(deny), IPFILTER_DIR(inbound), RT_TCP_UDP(ptype), port);
}
-static void sf_ipfw_port(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_ipfw_port(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "add %s %s from any to any %u %s",
IPFW_RULE(deny), RT_TCP_UDP(ptype), port, IPFW_DIR(inbound));
}
#define NF_PORT_DIR(inbound) ((inbound) ? "--source-port" : "--destination-port")
-static void sf_netfilter_port(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_netfilter_port(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "iptables --append %s --in-interface eth0 --protocol %s %s %u --jump %s",
NF_DIR(inbound), RT_TCP_UDP(ptype), NF_PORT_DIR(inbound), port, NF_RULE(deny));
}
-static void sf_pf_port(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_pf_port(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "%s %s quick on $ext_if proto %s from any to any port %u",
PF_RULE(deny), PF_DIR(inbound), RT_TCP_UDP(ptype), port);
}
#define NETSH_RULE_OLD(deny) ((deny) ? "DISABLE" : "ENABLE")
-static void sf_netsh_port_old(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound _U_, gboolean deny) {
+static void sf_netsh_port_old(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound _U_, bool deny) {
g_string_append_printf(rtxt, "add portopening %s %u Wireshark %s",
RT_TCP_UDP(ptype), port, NETSH_RULE_OLD(deny));
}
#define NETSH_RULE_NEW(deny) ((deny) ? "block" : "allow")
-static void sf_netsh_port_new(GString *rtxt, gchar *addr _U_, guint32 port, port_type ptype, gboolean inbound _U_, gboolean deny) {
+static void sf_netsh_port_new(GString *rtxt, char *addr _U_, uint32_t port, port_type ptype, bool inbound _U_, bool deny) {
g_string_append_printf(rtxt, "add rule name=\"Wireshark\" dir=in action=%s protocol=%s localport=%u",
NETSH_RULE_NEW(deny), RT_TCP_UDP(ptype), port);
}
/* IPv4 + port */
-static void sf_ios_ext_ipv4_port(GString *rtxt, gchar *addr, guint32 port _U_, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_ios_ext_ipv4_port(GString *rtxt, char *addr, uint32_t port _U_, port_type ptype, bool inbound, bool deny) {
if (inbound)
g_string_append_printf(rtxt, "access-list NUMBER %s %s host %s eq %u any", IOS_RULE(deny), RT_TCP_UDP(ptype), addr, port);
else
g_string_append_printf(rtxt, "access-list NUMBER %s %s any host %s eq %u", IOS_RULE(deny), RT_TCP_UDP(ptype), addr, port);
}
-static void sf_ipfilter_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_ipfilter_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny) {
if (inbound)
g_string_append_printf(rtxt, "%s %s on le0 proto %s from %s port = %u to any",
IPFILTER_RULE(deny), IPFILTER_DIR(inbound), RT_TCP_UDP(ptype), addr, port);
@@ -256,27 +257,27 @@ static void sf_ipfilter_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port
IPFILTER_RULE(deny), IPFILTER_DIR(inbound), RT_TCP_UDP(ptype), addr, port);
}
-static void sf_ipfw_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_ipfw_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "add %s %s from %s %u to any %s",
IPFW_RULE(deny), RT_TCP_UDP(ptype), addr, port, IPFW_DIR(inbound));
}
-static void sf_pf_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_pf_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "%s %s quick on $ext_if proto %s from %s to any port %u",
PF_RULE(deny), PF_DIR(inbound), RT_TCP_UDP(ptype), addr, port);
}
-static void sf_netfilter_ipv4_port(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny) {
+static void sf_netfilter_ipv4_port(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny) {
g_string_append_printf(rtxt, "iptables --append %s --in-interface eth0 --protocol %s %s %s/32 %s %u --jump %s",
NF_DIR(inbound), RT_TCP_UDP(ptype), NF_ADDR_DIR(inbound), addr, NF_PORT_DIR(inbound), port, NF_RULE(deny));
}
-static void sf_netsh_ipv4_port_old(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound _U_, gboolean deny) {
+static void sf_netsh_ipv4_port_old(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound _U_, bool deny) {
g_string_append_printf(rtxt, "add portopening %s %u Wireshark %s %s",
RT_TCP_UDP(ptype), port, NETSH_RULE_OLD(deny), addr);
}
-static void sf_netsh_ipv4_port_new(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound _U_, gboolean deny) {
+static void sf_netsh_ipv4_port_new(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound _U_, bool deny) {
g_string_append_printf(rtxt, "add rule name=\"Wireshark\" dir=in action=%s protocol=%s localport=%u remoteip=%s",
NETSH_RULE_NEW(deny), RT_TCP_UDP(ptype), port, addr);
}
diff --git a/ui/firewall_rules.h b/ui/firewall_rules.h
index cfe2e4f2..456cf61f 100644
--- a/ui/firewall_rules.h
+++ b/ui/firewall_rules.h
@@ -57,7 +57,7 @@ const char *firewall_product_rule_hint(size_t product_idx);
const char *firewall_product_comment_prefix(size_t product_idx);
/* Syntax function prototypes */
-typedef void (*syntax_func)(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
+typedef void (*syntax_func)(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
/** MAC filter function
* @param product_idx Product index.
@@ -86,9 +86,9 @@ syntax_func firewall_product_ipv4_port_func(size_t product_idx);
/** Product inbound support
* Given an index, return the product's ability to support inbound rules.
* @param product_idx Product index.
- * @return TRUE or FALSE.
+ * @return true or false.
*/
-gboolean firewall_product_does_inbound(size_t product_idx);
+bool firewall_product_does_inbound(size_t product_idx);
#ifdef __cplusplus
}
diff --git a/ui/help_url.c b/ui/help_url.c
index ec016ddb..a0afcbfa 100644
--- a/ui/help_url.c
+++ b/ui/help_url.c
@@ -27,8 +27,8 @@
/*
* Open the help dialog and show a specific HTML help page.
*/
-gchar *
-user_guide_url(const gchar *page) {
+char *
+user_guide_url(const char *page) {
GString *url = g_string_new("");
#if defined(_WIN32)
@@ -61,10 +61,10 @@ user_guide_url(const gchar *page) {
return g_string_free(url, FALSE);
}
-gchar *
+char *
topic_action_url(topic_action_e action)
{
- gchar *url;
+ char *url;
switch(action) {
/* pages online at www.wireshark.org */
@@ -104,9 +104,6 @@ topic_action_url(topic_action_e action)
case(ONLINEPAGE_SECURITY):
url = g_strdup(WS_WIKI_URL("Security"));
break;
- case(ONLINEPAGE_CHIMNEY):
- url = g_strdup(WS_WIKI_URL("CaptureSetup/Offloading#chimney"));
- break;
/* local manual pages */
case(LOCALPAGE_MAN_WIRESHARK):
@@ -158,6 +155,9 @@ topic_action_url(topic_action_e action)
case(HELP_DISPLAY_FILTERS_DIALOG):
url = user_guide_url("ChWorkDefineFilterSection.html");
break;
+ case(HELP_DISPLAY_MACRO_DIALOG):
+ url = user_guide_url("ChWorkDefineFilterMacrosSection.html");
+ break;
case(HELP_FILTER_EXPRESSION_DIALOG):
url = user_guide_url("ChWorkFilterAddExpressionSection.html");
break;
@@ -255,6 +255,12 @@ topic_action_url(topic_action_e action)
case(HELP_EXPORT_BYTES_DIALOG):
url = user_guide_url("ChIOExportSection.html#ChIOExportSelectedDialog");
break;
+ case(HELP_EXPORT_PDUS_DIALOG):
+ url = user_guide_url("ChIOExportSection.html#ChIOExportPDUSDialog");
+ break;
+ case(HELP_STRIP_HEADERS_DIALOG):
+ url = user_guide_url("ChIOExportSection.html#ChIOStripHeadersDialog");
+ break;
case(HELP_EXPORT_OBJECT_LIST):
url = user_guide_url("ChIOExportSection.html#ChIOExportObjectsDialog");
break;
diff --git a/ui/help_url.h b/ui/help_url.h
index c48b9f9a..b927c278 100644
--- a/ui/help_url.h
+++ b/ui/help_url.h
@@ -12,6 +12,8 @@
#ifndef __HELP_URL_H__
#define __HELP_URL_H__
+#include <ws_attributes.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -35,7 +37,6 @@ typedef enum {
ONLINEPAGE_NETWORK_MEDIA,
ONLINEPAGE_SAMPLE_CAPTURES,
ONLINEPAGE_SECURITY,
- ONLINEPAGE_CHIMNEY,
ONLINEPAGE_ASK,
/* local manual pages */
@@ -53,13 +54,14 @@ typedef enum {
/* Release Notes */
LOCALPAGE_RELEASE_NOTES,
- /* help pages (textfiles or local HTML User's Guide) */
+ /* help pages (textfiles or HTML User's Guide) */
HELP_CONTENT = 200,
HELP_GETTING_STARTED, /* currently unused */
HELP_CAPTURE_OPTIONS, /* currently unused */
HELP_CAPTURE_FILTERS_DIALOG,
HELP_DISPLAY_FILTERS_DIALOG,
HELP_FILTER_EXPRESSION_DIALOG,
+ HELP_DISPLAY_MACRO_DIALOG,
HELP_COLORING_RULES_DIALOG,
HELP_CONFIG_PROFILES_DIALOG,
HELP_PRINT_DIALOG,
@@ -91,6 +93,8 @@ typedef enum {
HELP_CAPTURE_INFO_DIALOG,
HELP_EXPORT_FILE_DIALOG,
HELP_EXPORT_BYTES_DIALOG,
+ HELP_EXPORT_PDUS_DIALOG,
+ HELP_STRIP_HEADERS_DIALOG,
HELP_EXPORT_OBJECT_LIST,
HELP_OPEN_DIALOG,
HELP_MERGE_DIALOG,
@@ -110,23 +114,22 @@ typedef enum {
HELP_STAT_FLOW_GRAPH
} topic_action_e;
-/** Given a page in the Wireshark User's Guide return its URL. If the
- * attempt succeeds NULL will be returned.
+/** Given a page in the Wireshark User's Guide return its URL. Returns a
+ * URL to a local file if present, or to the online guide if the local
+ * file is unavailable.
*
* @param page A page in the User's Guide.
- * @return A static URL or NULL. A non-NULL return value must be freed
- * with g_free().
+ * @return A static URL. The return value must be freed with g_free().
*/
-gchar *user_guide_url(const gchar *page);
+WS_RETNONNULL char *user_guide_url(const char *page);
-/** Given a topic action return its URL. If the attempt succeeds NULL
+/** Given a topic action return its URL. If the attempt fails NULL
* will be returned.
*
* @param action Topic action.
- * @return A static URL or NULL. A non-NULL return value must be freed
- * with g_free().
+ * @return A static URL. The return value must be freed with g_free().
*/
-gchar *topic_action_url(topic_action_e action);
+WS_RETNONNULL char *topic_action_url(topic_action_e action);
/** Open a specific topic (create a "Help" dialog box or open a webpage).
*
diff --git a/ui/iface_lists.c b/ui/iface_lists.c
index dfeb0f7f..4b21d13a 100644
--- a/ui/iface_lists.c
+++ b/ui/iface_lists.c
@@ -28,13 +28,13 @@
/*
* Try to populate the given device with options (like capture filter) from
* the capture options that are in use for an existing capture interface.
- * Returns TRUE if the interface is selected for capture and FALSE otherwise.
+ * Returns true if the interface is selected for capture and false otherwise.
*/
-static gboolean
+static bool
fill_from_ifaces (interface_t *device)
{
interface_options *interface_opts;
- guint i;
+ unsigned i;
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
@@ -55,13 +55,13 @@ fill_from_ifaces (interface_t *device)
if (interface_opts->linktype != -1) {
device->active_dlt = interface_opts->linktype;
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-static gchar *
-get_iface_display_name(const gchar *description, const if_info_t *if_info)
+static char *
+get_iface_display_name(const char *description, const if_info_t *if_info)
{
/* Do we have a user-supplied description? */
if (description && description[0]) {
@@ -75,7 +75,7 @@ get_iface_display_name(const gchar *description, const if_info_t *if_info)
* rather than the name, as the name is a string made out
* of the device GUID, and not at all friendly.
*/
- gchar *if_string = if_info->friendly_name ? if_info->friendly_name : if_info->name;
+ char *if_string = if_info->friendly_name ? if_info->friendly_name : if_info->name;
return ws_strdup_printf("%s: %s", description, if_string);
#else
/*
@@ -136,22 +136,21 @@ void
scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
{
GList *if_entry, *lt_entry, *if_list;
- if_info_t *if_info, temp;
- gchar *descr;
+ if_info_t *if_info;
+ char *descr;
if_capabilities_t *caps=NULL;
- gboolean monitor_mode;
+ bool monitor_mode;
GSList *curr_addr;
int ips = 0, i;
- guint count = 0, j;
- if_addr_t *addr, *temp_addr;
+ unsigned count = 0, j;
+ if_addr_t *addr;
link_row *link = NULL;
data_link_info_t *data_link_info;
interface_t device;
GString *ip_str = NULL;
interface_options *interface_opts;
- gboolean found = FALSE;
- static gboolean running = FALSE;
- GHashTable *selected_devices;
+ bool found = false;
+ static bool running = false;
if (running) {
/* scan_local_interfaces internally calls update_cb to process UI events
@@ -161,91 +160,207 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
This return avoids recursive scan_local_interfaces operation. */
return;
}
- running = TRUE;
+ running = true;
+
+ /* Retrieve list of interface information (if_info_t) into if_list. */
+ g_free(global_capture_opts.ifaces_err_info);
+ if_list = global_capture_opts.get_iface_list(&global_capture_opts.ifaces_err,
+ &global_capture_opts.ifaces_err_info);
/*
- * Clear list of known interfaces (all_ifaces) that will be re-discovered on
- * scanning, but remember their selection state.
- *
- * XXX shouldn't this copy settings (like capture filter) from the "old"
- * device to the "new" device? Refreshing the interfaces list should
- * probably just remove disappeared devices and add discovered devices.
+ * For each discovered interface name, look up its list of capabilities.
+ * (if it supports monitor mode, supported DLTs, assigned IP addresses).
+ * Do this all at once to reduce the number of spawned privileged dumpcap
+ * processes.
+ * It might be even better to get this information when getting the list,
+ * but some devices can support different DLTs depending on whether
+ * monitor mode is enabled, and we have to look up the monitor mode pref.
+ */
+ GList *if_cap_queries = NULL;
+ if_cap_query_t *if_cap_query;
+ GHashTable *capability_hash;
+ for (if_entry = if_list; if_entry != NULL; if_entry = g_list_next(if_entry)) {
+ if_info = (if_info_t *)if_entry->data;
+ if (strstr(if_info->name, "rpcap:")) {
+ continue;
+ }
+ /* Filter out all interfaces which are not allowed to be scanned */
+ if (allowed_types != NULL)
+ {
+ if(g_list_find(allowed_types, GUINT_TO_POINTER((unsigned) if_info->type)) == NULL) {
+ continue;
+ }
+ }
+ if (if_info->caps != NULL) {
+ continue;
+ }
+ if_cap_query = g_new(if_cap_query_t, 1);
+ if_cap_query->name = if_info->name;
+ if_cap_query->monitor_mode = prefs_capture_device_monitor_mode(if_info->name);
+ if_cap_query->auth_username = NULL;
+ if_cap_query->auth_password = NULL;
+ if_cap_queries = g_list_prepend(if_cap_queries, if_cap_query);
+ }
+ if_cap_queries = g_list_reverse(if_cap_queries);
+ capability_hash = capture_get_if_list_capabilities(if_cap_queries, NULL, NULL, update_cb);
+ /* The if_info->name are not copied, so we can just free the
+ * if_cap_query_t's and not their members. */
+ g_list_free_full(if_cap_queries, g_free);
+
+ /*
+ * From the existing list of known interfaces, remove devices that we
+ * expected to re-discover on scanning but did not (i.e., local devices,
+ * but not pipes, stdin, and remote devices.)
*/
- selected_devices = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
if (global_capture_opts.all_ifaces->len > 0) {
for (i = (int)global_capture_opts.all_ifaces->len-1; i >= 0; i--) {
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
- if (device.local && device.type != IF_PIPE && device.type != IF_STDIN) {
+ if (device.local && device.if_info.type != IF_PIPE && device.if_info.type != IF_STDIN) {
+
+ found = false;
+ for (if_entry = if_list; if_entry != NULL; if_entry = g_list_next(if_entry)) {
+ if_info = (if_info_t *)if_entry->data;
+
+ if (strcmp(device.name, if_info->name) == 0) {
+ found = true;
+ break;
+ }
+ }
+
+ if (found) {
+ continue;
+ }
+
global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, i);
- /*
- * Device is about to be destroyed, unmark as selected. It will
- * be reselected on rediscovery.
- */
if (device.selected) {
- gchar *device_name = g_strdup(device.name);
- /* g_hash_table_add() only exists since 2.32. */
- g_hash_table_replace(selected_devices, device_name, device_name);
global_capture_opts.num_selected--;
}
-
capture_opts_free_interface_t(&device);
}
}
}
- /* Retrieve list of interface information (if_info_t) into if_list. */
- g_free(global_capture_opts.ifaces_err_info);
- if_list = capture_interface_list(&global_capture_opts.ifaces_err,
- &global_capture_opts.ifaces_err_info,
- update_cb);
- count = 0;
-
/*
- * For each discovered interface name, create a new device and add extra
- * information (like supported DLTs, assigned IP addresses).
+ * For each discovered interface name, look for it in the list of
+ * devices. If not found, create a new device and add extra
+ * information (including the capabilities we retrieved above).
+ * If found, make sure that the information copied from if_info
+ * is still valid.
*/
+ count = 0;
for (if_entry = if_list; if_entry != NULL; if_entry = g_list_next(if_entry)) {
- memset(&device, 0, sizeof(device));
if_info = (if_info_t *)if_entry->data;
ips = 0;
if (strstr(if_info->name, "rpcap:")) {
continue;
}
- /* Filter out all interfaces, which are not allowed to be scanned */
+ /* Filter out all interfaces which are not allowed to be scanned */
if (allowed_types != NULL)
{
- if(g_list_find(allowed_types, GUINT_TO_POINTER((guint) if_info->type)) == NULL) {
+ if(g_list_find(allowed_types, GUINT_TO_POINTER((unsigned) if_info->type)) == NULL) {
continue;
}
}
- device.name = g_strdup(if_info->name);
- device.friendly_name = g_strdup(if_info->friendly_name);
- device.vendor_description = g_strdup(if_info->vendor_description);
- device.hidden = FALSE;
- memset(&temp, 0, sizeof(temp));
- temp.name = g_strdup(if_info->name);
- temp.friendly_name = g_strdup(if_info->friendly_name);
- temp.vendor_description = g_strdup(if_info->vendor_description);
- temp.loopback = if_info->loopback;
- temp.type = if_info->type;
- temp.extcap = g_strdup(if_info->extcap);
+ found = false;
+ for (i = 0; i < (int)global_capture_opts.all_ifaces->len; i++) {
+ device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
+ if (strcmp(device.name, if_info->name) == 0) {
+ found = true;
+ /* Remove it because we'll reinsert it below (in the proper
+ * index order, if that matters. Does it?)
+ */
+ global_capture_opts.all_ifaces = g_array_remove_index(global_capture_opts.all_ifaces, i);
+ break;
+ }
+ }
- /* Is this interface hidden and, if so, should we include it anyway? */
+ if (!found) {
+ /* New device. Create a new one and set all the defaults. */
+ memset(&device, 0, sizeof(device));
+ device.name = g_strdup(if_info->name);
+ device.hidden = false;
+ if (prefs_is_capture_device_hidden(if_info->name)) {
+ device.hidden = true;
+ }
+ device.selected = false;
+
+#ifdef HAVE_PCAP_REMOTE
+ device.remote_opts.src_type = CAPTURE_IFLOCAL;
+ device.remote_opts.remote_host_opts.remote_host = g_strdup(global_capture_opts.default_options.remote_host);
+ device.remote_opts.remote_host_opts.remote_port = g_strdup(global_capture_opts.default_options.remote_port);
+ device.remote_opts.remote_host_opts.auth_type = global_capture_opts.default_options.auth_type;
+ device.remote_opts.remote_host_opts.auth_username = g_strdup(global_capture_opts.default_options.auth_username);
+ device.remote_opts.remote_host_opts.auth_password = g_strdup(global_capture_opts.default_options.auth_password);
+ device.remote_opts.remote_host_opts.datatx_udp = global_capture_opts.default_options.datatx_udp;
+ device.remote_opts.remote_host_opts.nocap_rpcap = global_capture_opts.default_options.nocap_rpcap;
+ device.remote_opts.remote_host_opts.nocap_local = global_capture_opts.default_options.nocap_local;
+#endif
+#ifdef HAVE_PCAP_SETSAMPLING
+ device.remote_opts.sampling_method = global_capture_opts.default_options.sampling_method;
+ device.remote_opts.sampling_param = global_capture_opts.default_options.sampling_param;
+#endif
+
+ device.local = true;
+ device.last_packets = 0;
+ if (!capture_dev_user_pmode_find(if_info->name, &device.pmode)) {
+ device.pmode = global_capture_opts.default_options.promisc_mode;
+ }
+ if (!capture_dev_user_snaplen_find(if_info->name, &device.has_snaplen,
+ &device.snaplen)) {
+ device.has_snaplen = global_capture_opts.default_options.has_snaplen;
+ device.snaplen = global_capture_opts.default_options.snaplen;
+ }
+ device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
+ device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
+#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
+ if ((device.buffer = capture_dev_user_buffersize_find(if_info->name)) == -1) {
+ device.buffer = global_capture_opts.default_options.buffer_size;
+ }
+#endif
+
+ /* Extcap devices start with no cached args */
+ device.external_cap_args_settings = NULL;
+
+ monitor_mode = prefs_capture_device_monitor_mode(if_info->name);
+ device.active_dlt = -1;
+ } else {
+ /* We can divide device_t members into three categories:
+ * 1. Those that don't depend on if_info and the capabilities.
+ * Keep those the same.
+ * 2. Those that need to match the retrieved information.
+ * Free those and set them below.
+ * 3. Those that an option chosen from a set of options determined
+ * from the capabilities. We have to check if the chosen values of
+ * monitor mode enabled and active dlt are still supported.
+ * There could be a knock on effect on the capture filter, as if
+ * your previously chosen link-layer type isn't supported then
+ * your capture filter might not be either, which will result in
+ * it being marked invalid instead of being cleared. */
+ /* XXX: We have duplicate copies of the name and we have
+ * the addresses and links from the if_info transformed into new
+ * types, but perhaps that transformation should be done when
+ * creating the if_info and if_capabilities.
+ */
+ g_free(device.display_name);
+ g_free(device.addresses);
+ g_list_free_full(device.links, capture_opts_free_link_row);
+ g_free(device.if_info.name);
+ g_free(device.if_info.friendly_name);
+ g_free(device.if_info.vendor_description);
+ g_slist_free_full(device.if_info.addrs, g_free);
+ g_free(device.if_info.extcap);
+ if (device.if_info.caps) {
+ free_if_capabilities(device.if_info.caps);
+ }
+ monitor_mode = device.monitor_mode_enabled;
+ }
descr = capture_dev_user_descr_find(if_info->name);
device.display_name = get_iface_display_name(descr, if_info);
g_free(descr);
- device.selected = FALSE;
- if (prefs_is_capture_device_hidden(if_info->name)) {
- device.hidden = TRUE;
- }
- device.type = if_info->type;
- monitor_mode = prefs_capture_device_monitor_mode(if_info->name);
- caps = capture_get_if_capabilities(if_info->name, monitor_mode, NULL, NULL, NULL, update_cb);
ip_str = g_string_new("");
for (; (curr_addr = g_slist_nth(if_info->addrs, ips)) != NULL; ips++) {
- temp_addr = g_new0(if_addr_t, 1);
if (ips != 0) {
g_string_append(ip_str, "\n");
}
@@ -253,16 +368,13 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
if (addr) {
address addr_str;
char* temp_addr_str = NULL;
- temp_addr->ifat_type = addr->ifat_type;
switch (addr->ifat_type) {
case IF_AT_IPv4:
- temp_addr->addr.ip4_addr = addr->addr.ip4_addr;
set_address(&addr_str, AT_IPv4, 4, &addr->addr.ip4_addr);
temp_addr_str = address_to_str(NULL, &addr_str);
g_string_append(ip_str, temp_addr_str);
break;
case IF_AT_IPv6:
- memcpy(temp_addr->addr.ip6_addr, addr->addr.ip6_addr, sizeof(addr->addr));
set_address(&addr_str, AT_IPv6, 16, addr->addr.ip6_addr);
temp_addr_str = address_to_str(NULL, &addr_str);
g_string_append(ip_str, temp_addr_str);
@@ -272,43 +384,30 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
break;
}
wmem_free(NULL, temp_addr_str);
- } else {
- g_free(temp_addr);
- temp_addr = NULL;
- }
- if (temp_addr) {
- temp.addrs = g_slist_append(temp.addrs, temp_addr);
}
}
device.addresses = g_strdup(ip_str->str);
g_string_free(ip_str, TRUE);
-#ifdef HAVE_PCAP_REMOTE
- device.local = TRUE;
- device.remote_opts.src_type = CAPTURE_IFLOCAL;
- device.remote_opts.remote_host_opts.remote_host = g_strdup(global_capture_opts.default_options.remote_host);
- device.remote_opts.remote_host_opts.remote_port = g_strdup(global_capture_opts.default_options.remote_port);
- device.remote_opts.remote_host_opts.auth_type = global_capture_opts.default_options.auth_type;
- device.remote_opts.remote_host_opts.auth_username = g_strdup(global_capture_opts.default_options.auth_username);
- device.remote_opts.remote_host_opts.auth_password = g_strdup(global_capture_opts.default_options.auth_password);
- device.remote_opts.remote_host_opts.datatx_udp = global_capture_opts.default_options.datatx_udp;
- device.remote_opts.remote_host_opts.nocap_rpcap = global_capture_opts.default_options.nocap_rpcap;
- device.remote_opts.remote_host_opts.nocap_local = global_capture_opts.default_options.nocap_local;
-#endif
-#ifdef HAVE_PCAP_SETSAMPLING
- device.remote_opts.sampling_method = global_capture_opts.default_options.sampling_method;
- device.remote_opts.sampling_param = global_capture_opts.default_options.sampling_param;
-#endif
device.links = NULL;
- if (caps != NULL) {
+ caps = if_info->caps;
+ if (caps == NULL) {
+ caps = g_hash_table_lookup(capability_hash, if_info->name);
+ }
+ if (caps != NULL && !caps->primary_msg) {
+ GList *lt_list = caps->data_link_types;
#if defined(HAVE_PCAP_CREATE)
- device.monitor_mode_enabled = monitor_mode;
+ device.monitor_mode_enabled = monitor_mode && caps->can_set_rfmon;
device.monitor_mode_supported = caps->can_set_rfmon;
+ if (device.monitor_mode_enabled) {
+ lt_list = caps->data_link_types_rfmon;
+ }
#endif
/*
* Process the list of link-layer header types.
*/
- for (lt_entry = caps->data_link_types; lt_entry != NULL; lt_entry = g_list_next(lt_entry)) {
+ bool found_active_dlt = false;
+ for (lt_entry = lt_list; lt_entry != NULL; lt_entry = g_list_next(lt_entry)) {
data_link_info = (data_link_info_t *)lt_entry->data;
link = g_new(link_row, 1);
if (data_link_info->description != NULL) {
@@ -318,64 +417,56 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
link->dlt = -1;
link->name = ws_strdup_printf("%s (not supported)", data_link_info->name);
}
+ if (link->dlt != -1 && link->dlt == device.active_dlt) {
+ found_active_dlt = true;
+ }
device.links = g_list_append(device.links, link);
}
/*
* Set the active DLT for the device appropriately.
*/
- set_active_dlt(&device, global_capture_opts.default_options.linktype);
+ if (!found_active_dlt) {
+ set_active_dlt(&device, global_capture_opts.default_options.linktype);
+ }
} else {
#if defined(HAVE_PCAP_CREATE)
- device.monitor_mode_enabled = FALSE;
- device.monitor_mode_supported = FALSE;
+ device.monitor_mode_enabled = false;
+ device.monitor_mode_supported = false;
#endif
device.active_dlt = -1;
}
device.no_addresses = ips;
- device.local = TRUE;
- device.if_info = temp;
- device.last_packets = 0;
- if (!capture_dev_user_pmode_find(if_info->name, &device.pmode)) {
- device.pmode = global_capture_opts.default_options.promisc_mode;
- }
- if (!capture_dev_user_snaplen_find(if_info->name, &device.has_snaplen,
- &device.snaplen)) {
- device.has_snaplen = global_capture_opts.default_options.has_snaplen;
- device.snaplen = global_capture_opts.default_options.snaplen;
- }
- device.cfilter = g_strdup(global_capture_opts.default_options.cfilter);
- device.timestamp_type = g_strdup(global_capture_opts.default_options.timestamp_type);
-#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
- if ((device.buffer = capture_dev_user_buffersize_find(if_info->name)) == -1) {
- device.buffer = global_capture_opts.default_options.buffer_size;
- }
-#endif
- /* Copy interface options for active capture devices. */
- gboolean selected = fill_from_ifaces(&device);
+ /* Copy interface options for active capture devices.
+ * XXX: Not clear if we still need to do this, since we're not
+ * destroying the old devices. */
+ bool selected = fill_from_ifaces(&device);
/* Restore device selection (for next capture). */
- if (!device.selected && (selected || g_hash_table_lookup(selected_devices, device.name))) {
- device.selected = TRUE;
+ if (!device.selected && selected) {
+ device.selected = true;
global_capture_opts.num_selected++;
}
- /* Extcap devices start with no cached args */
- device.external_cap_args_settings = NULL;
-
+ /* We shallow copy if_info and then adding to the GArray shallow
+ * copies it again, so free the if_info_t itself but not its members.
+ * Then set the GList element data to NULL so that we don't free
+ * it or its members when freeing the interface list. (This seems a
+ * little easier than removing the link from the list while iterating.)
+ */
+ device.if_info = *if_info;
+ if_entry->data = NULL;
+ g_free(if_info);
if (global_capture_opts.all_ifaces->len <= count) {
g_array_append_val(global_capture_opts.all_ifaces, device);
count = global_capture_opts.all_ifaces->len;
} else {
g_array_insert_val(global_capture_opts.all_ifaces, count, device);
}
- if (caps != NULL) {
- free_if_capabilities(caps);
- }
-
count++;
}
+ g_hash_table_destroy(capability_hash);
free_interface_list(if_list);
/*
@@ -385,7 +476,7 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
for (j = 0; j < global_capture_opts.ifaces->len; j++) {
interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, j);
- found = FALSE;
+ found = false;
for (i = 0; i < (int)global_capture_opts.all_ifaces->len; i++) {
device = g_array_index(global_capture_opts.all_ifaces, interface_t, i);
@@ -395,26 +486,24 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
}
if (strcmp(device.name, interface_opts->name) == 0) {
- found = TRUE;
+ found = true;
break;
}
}
if (!found) { /* new interface, maybe a pipe */
memset(&device, 0, sizeof(device));
device.name = g_strdup(interface_opts->name);
- device.vendor_description = g_strdup(interface_opts->hardware);
device.display_name = interface_opts->descr ?
ws_strdup_printf("%s: %s", device.name, interface_opts->descr) :
g_strdup(device.name);
- device.hidden = FALSE;
- device.selected = TRUE;
- device.type = interface_opts->if_type;
+ device.hidden = false;
+ device.selected = true;
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
device.buffer = interface_opts->buffer_size;
#endif
#if defined(HAVE_PCAP_CREATE)
device.monitor_mode_enabled = interface_opts->monitor_mode;
- device.monitor_mode_supported = FALSE;
+ device.monitor_mode_supported = false;
#endif
device.pmode = interface_opts->promisc_mode;
device.has_snaplen = interface_opts->has_snaplen;
@@ -426,12 +515,13 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
device.no_addresses = 0;
device.last_packets = 0;
device.links = NULL;
- device.local = TRUE;
+ device.local = true;
device.if_info.name = g_strdup(interface_opts->name);
+ device.if_info.type = interface_opts->if_type;
device.if_info.friendly_name = NULL;
- device.if_info.vendor_description = g_strdup(interface_opts->descr);
+ device.if_info.vendor_description = g_strdup(interface_opts->hardware);
device.if_info.addrs = NULL;
- device.if_info.loopback = FALSE;
+ device.if_info.loopback = false;
device.if_info.extcap = g_strdup(interface_opts->extcap);
g_array_append_val(global_capture_opts.all_ifaces, device);
@@ -439,8 +529,7 @@ scan_local_interfaces_filtered(GList * allowed_types, void (*update_cb)(void))
}
}
- g_hash_table_destroy(selected_devices);
- running = FALSE;
+ running = false;
}
/*
@@ -462,32 +551,31 @@ fill_in_local_interfaces(void(*update_cb)(void))
void
fill_in_local_interfaces_filtered(GList * filter_list, void(*update_cb)(void))
{
- gint64 start_time;
+ int64_t start_time;
double elapsed;
- static gboolean initialized = FALSE;
+ static bool initialized = false;
/* record the time we started, so we can log total time later */
start_time = g_get_monotonic_time();
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "fill_in_local_interfaces() starts");
if (!initialized) {
/* do the actual work */
scan_local_interfaces_filtered(filter_list, update_cb);
- initialized = TRUE;
+ initialized = true;
}
/* log how long it took */
elapsed = (g_get_monotonic_time() - start_time) / 1e6;
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "fill_in_local_interfaces() ends, taking %.3fs", elapsed);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Finished getting the global interface list, taking %.3fs", elapsed);
}
void
-hide_interface(gchar* new_hide)
+hide_interface(char* new_hide)
{
- gchar *tok;
- guint i;
+ char *tok;
+ unsigned i;
interface_t *device;
- gboolean found = FALSE;
+ bool found = false;
GList *hidden_devices = NULL, *entry;
if (new_hide != NULL) {
for (tok = strtok (new_hide, ","); tok; tok = strtok(NULL, ",")) {
@@ -496,20 +584,20 @@ hide_interface(gchar* new_hide)
}
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
- found = FALSE;
+ found = false;
for (entry = hidden_devices; entry != NULL; entry = g_list_next(entry)) {
if (strcmp((char *)entry->data, device->name)==0) {
- device->hidden = TRUE;
+ device->hidden = true;
if (device->selected) {
- device->selected = FALSE;
+ device->selected = false;
global_capture_opts.num_selected--;
}
- found = TRUE;
+ found = true;
break;
}
}
if (!found) {
- device->hidden = FALSE;
+ device->hidden = false;
}
}
g_list_free(hidden_devices);
@@ -520,12 +608,12 @@ void
update_local_interfaces(void)
{
interface_t *device;
- gchar *descr;
- guint i;
+ char *descr;
+ unsigned i;
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
- device->type = capture_dev_user_linktype_find(device->name);
+ device->if_info.type = capture_dev_user_linktype_find(device->name);
g_free(device->display_name);
descr = capture_dev_user_descr_find(device->name);
device->display_name = get_iface_display_name(descr, &device->if_info);
diff --git a/ui/iface_lists.h b/ui/iface_lists.h
index 5bfca2e5..b0124521 100644
--- a/ui/iface_lists.h
+++ b/ui/iface_lists.h
@@ -45,7 +45,7 @@ extern void scan_local_interfaces_filtered(GList * allowed_types, void (*update_
/*
* Hide the interfaces
*/
-extern void hide_interface(gchar* new_hide);
+extern void hide_interface(char* new_hide);
/*
* Update the global interface list from preferences.
diff --git a/ui/iface_toolbar.c b/ui/iface_toolbar.c
index 95424da9..0e8d0768 100644
--- a/ui/iface_toolbar.c
+++ b/ui/iface_toolbar.c
@@ -24,16 +24,16 @@ void iface_toolbar_add(const iface_toolbar *toolbar)
}
}
-void iface_toolbar_remove(const gchar *menu_title)
+void iface_toolbar_remove(const char *menu_title)
{
if (iface_toolbar_remove_cb) {
iface_toolbar_remove_cb(menu_title);
}
}
-gboolean iface_toolbar_use(void)
+bool iface_toolbar_use(void)
{
- return iface_toolbar_add_cb ? TRUE : FALSE;
+ return iface_toolbar_add_cb ? true : false;
}
void iface_toolbar_register_cb(iface_toolbar_add_cb_t add_cb, iface_toolbar_remove_cb_t remove_cb)
diff --git a/ui/iface_toolbar.h b/ui/iface_toolbar.h
index 9a23914c..ed3f695a 100644
--- a/ui/iface_toolbar.h
+++ b/ui/iface_toolbar.h
@@ -10,6 +10,9 @@
#ifndef __IFACE_TOOLBAR_H__
#define __IFACE_TOOLBAR_H__
+#include <stdbool.h>
+
+#include <glib.h>
#ifdef __cplusplus
extern "C" {
@@ -33,42 +36,42 @@ typedef enum {
typedef struct _iface_toolbar_value {
int num;
- gchar *value;
- gchar *display;
- gboolean is_default;
+ char *value;
+ char *display;
+ bool is_default;
} iface_toolbar_value;
typedef struct _iface_toolbar_control {
int num;
iface_toolbar_ctrl_type ctrl_type;
iface_toolbar_ctrl_role ctrl_role;
- gchar *display;
- gchar *validation;
- gboolean is_required;
- gchar *tooltip;
- gchar *placeholder;
+ char *display;
+ char *validation;
+ bool is_required;
+ char *tooltip;
+ char *placeholder;
union {
- gboolean boolean;
- gchar *string;
+ bool boolean;
+ char *string;
} default_value;
GList *values;
} iface_toolbar_control;
typedef struct _iface_toolbar {
- gchar *menu_title;
- gchar *help;
+ char *menu_title;
+ char *help;
GList *ifnames;
GList *controls;
} iface_toolbar;
typedef void (*iface_toolbar_add_cb_t)(const iface_toolbar *);
-typedef void (*iface_toolbar_remove_cb_t)(const gchar *);
+typedef void (*iface_toolbar_remove_cb_t)(const char *);
void iface_toolbar_add(const iface_toolbar *toolbar);
-void iface_toolbar_remove(const gchar *menu_title);
+void iface_toolbar_remove(const char *menu_title);
-gboolean iface_toolbar_use(void);
+bool iface_toolbar_use(void);
void iface_toolbar_register_cb(iface_toolbar_add_cb_t, iface_toolbar_remove_cb_t);
diff --git a/ui/io_graph_item.c b/ui/io_graph_item.c
index b4047a98..1ea24cd4 100644
--- a/ui/io_graph_item.c
+++ b/ui/io_graph_item.c
@@ -15,11 +15,15 @@
#include <epan/epan_dissect.h>
+#include <wsutil/filesystem.h>
+
#include "ui/io_graph_item.h"
-int get_io_graph_index(packet_info *pinfo, int interval) {
+int64_t get_io_graph_index(packet_info *pinfo, int interval) {
nstime_t time_delta;
+ ws_return_val_if(interval <= 0, -1);
+
/*
* Find in which interval this is supposed to go and store the interval index as idx
*/
@@ -31,7 +35,7 @@ int get_io_graph_index(packet_info *pinfo, int interval) {
if (time_delta.secs<0) {
return -1;
}
- return (int) ((time_delta.secs*1000 + time_delta.nsecs/1000000) / interval);
+ return ((time_delta.secs*INT64_C(1000000) + time_delta.nsecs/1000) / interval);
}
GString *check_field_unit(const char *field_name, int *hf_index, io_graph_item_unit_t item_unit)
@@ -50,10 +54,15 @@ GString *check_field_unit(const char *field_name, int *hf_index, io_graph_item_u
"MAX",
"MIN",
"AVG",
+ "THROUGHPUT",
"LOAD",
NULL
};
+ if (!is_packet_configuration_namespace()) {
+ item_unit_names[0] = "Events";
+ }
+
/* There was no field specified */
if ((field_name == NULL) || (field_name[0] == 0)) {
err_str = g_string_new("You didn't specify a field name.");
@@ -102,6 +111,7 @@ GString *check_field_unit(const char *field_name, int *hf_index, io_graph_item_u
case IOG_ITEM_UNIT_CALC_MAX:
case IOG_ITEM_UNIT_CALC_MIN:
case IOG_ITEM_UNIT_CALC_AVERAGE:
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
case IOG_ITEM_UNIT_CALC_LOAD:
break;
default:
@@ -132,11 +142,14 @@ double get_io_graph_item(const io_graph_item_t *items_, io_graph_item_unit_t val
double value = 0; /* FIXME: loss of precision, visible on the graph for small values */
int adv_type;
const io_graph_item_t *item;
- guint32 interval;
+ uint32_t interval;
item = &items_[idx];
// Basic units
+ // XXX - Should we divide these counted values by the interval
+ // so that they measure rates (as done with LOAD)? That might be
+ // more meaningful and consistent.
switch (val_units_) {
case IOG_ITEM_UNIT_PACKETS:
return item->frames;
@@ -170,6 +183,31 @@ double get_io_graph_item(const io_graph_item_t *items_, io_graph_item_unit_t val
case FT_INT48:
case FT_INT56:
case FT_INT64:
+ switch (val_units_) {
+ case IOG_ITEM_UNIT_CALC_SUM:
+ value = item->double_tot;
+ break;
+ case IOG_ITEM_UNIT_CALC_MAX:
+ value = item->int_max;
+ break;
+ case IOG_ITEM_UNIT_CALC_MIN:
+ value = item->int_min;
+ break;
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
+ value = item->double_tot*(8*1000000/interval_);
+ break;
+ case IOG_ITEM_UNIT_CALC_AVERAGE:
+ if (item->fields) {
+ value = item->double_tot / item->fields;
+ } else {
+ value = 0;
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
@@ -178,16 +216,18 @@ double get_io_graph_item(const io_graph_item_t *items_, io_graph_item_unit_t val
case FT_UINT48:
case FT_UINT56:
case FT_UINT64:
- case FT_DOUBLE:
switch (val_units_) {
case IOG_ITEM_UNIT_CALC_SUM:
value = item->double_tot;
break;
case IOG_ITEM_UNIT_CALC_MAX:
- value = item->double_max;
+ value = item->uint_max;
break;
case IOG_ITEM_UNIT_CALC_MIN:
- value = item->double_min;
+ value = item->uint_min;
+ break;
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
+ value = item->double_tot*(8*1000000/interval_);
break;
case IOG_ITEM_UNIT_CALC_AVERAGE:
if (item->fields) {
@@ -201,20 +241,21 @@ double get_io_graph_item(const io_graph_item_t *items_, io_graph_item_unit_t val
}
break;
+ case FT_DOUBLE:
case FT_FLOAT:
switch (val_units_) {
case IOG_ITEM_UNIT_CALC_SUM:
- value = item->float_tot;
+ value = item->double_tot;
break;
case IOG_ITEM_UNIT_CALC_MAX:
- value = item->float_max;
+ value = item->double_max;
break;
case IOG_ITEM_UNIT_CALC_MIN:
- value = item->float_min;
+ value = item->double_min;
break;
case IOG_ITEM_UNIT_CALC_AVERAGE:
if (item->fields) {
- value = (double)item->float_tot / item->fields;
+ value = item->double_tot / item->fields;
} else {
value = 0;
}
@@ -245,14 +286,17 @@ double get_io_graph_item(const io_graph_item_t *items_, io_graph_item_unit_t val
case IOG_ITEM_UNIT_CALC_LOAD:
// "LOAD graphs plot the QUEUE-depth of the connection over time"
// (for response time fields such as smb.time, rpc.time, etc.)
- // This interval is expressed in milliseconds.
+ // This interval is expressed in microseconds.
if (idx == cur_idx_ && cap_file) {
- interval = (guint32)(nstime_to_msec(&cap_file->elapsed_time) + 0.5);
- interval -= (interval_ * idx);
+ // If this is the last interval, it may not be full width.
+ uint64_t start_us = (uint64_t)interval_ * idx;
+ nstime_t timediff = NSTIME_INIT_SECS_USECS(start_us / 1000000, start_us % 1000000);
+ nstime_delta(&timediff, &cap_file->elapsed_time, &timediff);
+ interval = (uint32_t)(1000*nstime_to_msec(&timediff) + 0.5);
} else {
interval = interval_;
}
- value = nstime_to_msec(&item->time_tot) / interval;
+ value = (1000 * nstime_to_msec(&item->time_tot)) / interval;
break;
default:
break;
diff --git a/ui/io_graph_item.h b/ui/io_graph_item.h
index 1323691b..d2475e06 100644
--- a/ui/io_graph_item.h
+++ b/ui/io_graph_item.h
@@ -17,6 +17,8 @@
#include "cfile.h"
#include <wsutil/ws_assert.h>
+#include <epan/epan_dissect.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -32,33 +34,42 @@ typedef enum {
IOG_ITEM_UNIT_CALC_MAX,
IOG_ITEM_UNIT_CALC_MIN,
IOG_ITEM_UNIT_CALC_AVERAGE,
+ IOG_ITEM_UNIT_CALC_THROUGHPUT,
IOG_ITEM_UNIT_CALC_LOAD,
IOG_ITEM_UNIT_LAST = IOG_ITEM_UNIT_CALC_LOAD,
NUM_IOG_ITEM_UNITS
} io_graph_item_unit_t;
typedef struct _io_graph_item_t {
- guint32 frames; /* always calculated, will hold number of frames*/
- guint64 bytes; /* always calculated, will hold number of bytes*/
- guint64 fields;
- gint64 int_max;
- gint64 int_min;
- gint64 int_tot;
- /* XXX - Why do we always use 64-bit ints but split floats between
- * gfloat and gdouble?
+ uint32_t frames; /* always calculated, will hold number of frames*/
+ uint64_t bytes; /* always calculated, will hold number of bytes*/
+ uint64_t fields;
+ /* We use a double for totals because of overflow. For min and max,
+ * unsigned 64 bit integers larger than 2^53 cannot all be represented
+ * in a double, and this is useful for determining the frame with the
+ * min or max value, even though for plotting it will be converted to a
+ * double.
*/
- gfloat float_max;
- gfloat float_min;
- gfloat float_tot;
- gdouble double_max;
- gdouble double_min;
- gdouble double_tot;
- nstime_t time_max;
- nstime_t time_min;
- nstime_t time_tot;
- guint32 first_frame_in_invl;
- guint32 extreme_frame_in_invl; /* frame with min/max value */
- guint32 last_frame_in_invl;
+ union {
+ nstime_t time_max;
+ double double_max;
+ int64_t int_max;
+ uint64_t uint_max;
+ };
+ union {
+ nstime_t time_min;
+ double double_min;
+ int64_t int_min;
+ uint64_t uint_min;
+ };
+ union {
+ nstime_t time_tot;
+ double double_tot;
+ };
+ uint32_t first_frame_in_invl;
+ uint32_t min_frame_in_invl;
+ uint32_t max_frame_in_invl;
+ uint32_t last_frame_in_invl;
} io_graph_item_t;
/** Reset (zero) an io_graph_item_t.
@@ -67,9 +78,9 @@ typedef struct _io_graph_item_t {
* @param count [in] The number of items in the array.
*/
static inline void
-reset_io_graph_items(io_graph_item_t *items, gsize count) {
+reset_io_graph_items(io_graph_item_t *items, size_t count, int hf_index _U_) {
io_graph_item_t *item;
- gsize i;
+ size_t i;
for (i = 0; i < count; i++) {
item = &items[i];
@@ -77,21 +88,70 @@ reset_io_graph_items(io_graph_item_t *items, gsize count) {
item->frames = 0;
item->bytes = 0;
item->fields = 0;
- item->int_max = 0;
- item->int_min = 0;
- item->int_tot = 0;
- item->float_max = 0;
- item->float_min = 0;
- item->float_tot = 0;
- item->double_max = 0;
- item->double_min = 0;
- item->double_tot = 0;
+ item->first_frame_in_invl = 0;
+ item->min_frame_in_invl = 0;
+ item->max_frame_in_invl = 0;
+ item->last_frame_in_invl = 0;
+
nstime_set_zero(&item->time_max);
nstime_set_zero(&item->time_min);
nstime_set_zero(&item->time_tot);
- item->first_frame_in_invl = 0;
- item->extreme_frame_in_invl = 0;
- item->last_frame_in_invl = 0;
+
+#if 0
+ /* XXX - On C, type punning is explicitly allowed since C99 so
+ * setting the nstime_t values to 0 is always sufficient.
+ * On C++ that appears technically to be undefined behavior (though
+ * I don't know of any compilers for which it doesn't work and I
+ * can't get UBSAN to complain about it) and this would be safer.
+ */
+ if (hf_index > 0) {
+
+ switch (proto_registrar_get_ftype(hf_index)) {
+
+ case FT_INT8:
+ case FT_INT16:
+ case FT_INT24:
+ case FT_INT32:
+ case FT_INT40:
+ case FT_INT48:
+ case FT_INT56:
+ case FT_INT64:
+ item->int_max = 0;
+ item->int_min = 0;
+ item->double_tot = 0;
+ break;
+
+ case FT_UINT8:
+ case FT_UINT16:
+ case FT_UINT24:
+ case FT_UINT32:
+ case FT_UINT40:
+ case FT_UINT48:
+ case FT_UINT56:
+ case FT_UINT64:
+ item->uint_max = 0;
+ item->uint_min = 0;
+ item->double_tot = 0;
+ break;
+
+ case FT_DOUBLE:
+ case FT_FLOAT:
+ item->double_max = 0;
+ item->double_min = 0;
+ item->double_tot = 0;
+ break;
+
+ case FT_RELATIVE_TIME:
+ nstime_set_zero(&item->time_max);
+ nstime_set_zero(&item->time_min);
+ nstime_set_zero(&item->time_tot);
+ break;
+
+ default:
+ break;
+ }
+ }
+#endif
}
}
@@ -100,10 +160,14 @@ reset_io_graph_items(io_graph_item_t *items, gsize count) {
* It is up to the caller to determine if the return value is valid.
*
* @param [in] pinfo Packet of interest.
- * @param [in] interval Time interval in milliseconds.
+ * @param [in] interval Time interval in microseconds
* @return Array index on success, -1 on failure.
+ *
+ * @note pinfo->rel_ts, and hence the index, is not affected by ignoring
+ * frames, but is affected by time references. (Ignoring frames before
+ * a time reference can be useful, though.)
*/
-int get_io_graph_index(packet_info *pinfo, int interval);
+int64_t get_io_graph_index(packet_info *pinfo, int interval);
/** Check field and item unit compatibility
*
@@ -139,11 +203,11 @@ double get_io_graph_item(const io_graph_item_t *items, io_graph_item_unit_t val_
* @param edt [in] Dissection information for advanced statistics. May be NULL.
* @param hf_index [in] Header field index for advanced statistics.
* @param item_unit [in] The type of unit to calculate. From IOG_ITEM_UNITS.
- * @param interval [in] Timing interval in ms.
- * @return TRUE if the update was successful, otherwise FALSE.
+ * @param interval [in] Timing interval in μs.
+ * @return true if the update was successful, otherwise false.
*/
-static inline gboolean
-update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_dissect_t *edt, int hf_index, int item_unit, guint32 interval) {
+static inline bool
+update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_dissect_t *edt, int hf_index, int item_unit, uint32_t interval) {
io_graph_item_t *item = &items[idx];
/* Set the first and last frame num in current interval matching the target field+filter */
@@ -154,18 +218,18 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
if (edt && hf_index >= 0) {
GPtrArray *gp;
- guint i;
+ unsigned i;
gp = proto_get_finfo_ptr_array(edt->tree, hf_index);
if (!gp) {
- return FALSE;
+ return false;
}
/* Update the appropriate counters. If fields == 0, this is the first seen
* value so set any min/max values accordingly. */
for (i=0; i < gp->len; i++) {
- gint64 new_int64;
- guint64 new_uint64;
+ int64_t new_int64;
+ uint64_t new_uint64;
float new_float;
double new_double;
const nstime_t *new_time;
@@ -177,22 +241,15 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
case FT_UINT32:
new_uint64 = fvalue_get_uinteger(((field_info *)gp->pdata[i])->value);
- if ((new_uint64 > (guint64)item->int_max) || (item->fields == 0)) {
- item->int_max = new_uint64;
- item->double_max = (gdouble)new_uint64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ if ((new_uint64 > item->uint_max) || (item->fields == 0)) {
+ item->uint_max = new_uint64;
+ item->max_frame_in_invl = pinfo->num;
}
- if ((new_uint64 < (guint64)item->int_min) || (item->fields == 0)) {
- item->int_min = new_uint64;
- item->double_min = (gdouble)new_uint64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ if ((new_uint64 < item->uint_min) || (item->fields == 0)) {
+ item->uint_min = new_uint64;
+ item->min_frame_in_invl = pinfo->num;
}
- item->int_tot += new_uint64;
- item->double_tot += (gdouble)new_uint64;
+ item->double_tot += (double)new_uint64;
item->fields++;
break;
case FT_INT8:
@@ -202,20 +259,13 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
new_int64 = fvalue_get_sinteger(((field_info *)gp->pdata[i])->value);
if ((new_int64 > item->int_max) || (item->fields == 0)) {
item->int_max = new_int64;
- item->double_max = (gdouble)new_int64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->max_frame_in_invl = pinfo->num;
}
if ((new_int64 < item->int_min) || (item->fields == 0)) {
item->int_min = new_int64;
- item->double_min = (gdouble)new_int64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->min_frame_in_invl = pinfo->num;
}
- item->int_tot += new_int64;
- item->double_tot += (gdouble)new_int64;
+ item->double_tot += (double)new_int64;
item->fields++;
break;
case FT_UINT40:
@@ -223,22 +273,15 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
case FT_UINT56:
case FT_UINT64:
new_uint64 = fvalue_get_uinteger64(((field_info *)gp->pdata[i])->value);
- if ((new_uint64 > (guint64)item->int_max) || (item->fields == 0)) {
- item->int_max = new_uint64;
- item->double_max = (gdouble)new_uint64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ if ((new_uint64 > item->uint_max) || (item->fields == 0)) {
+ item->uint_max = new_uint64;
+ item->max_frame_in_invl = pinfo->num;
}
- if ((new_uint64 < (guint64)item->int_min) || (item->fields == 0)) {
- item->int_min = new_uint64;
- item->double_min = (gdouble)new_uint64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ if ((new_uint64 < item->uint_min) || (item->fields == 0)) {
+ item->uint_min = new_uint64;
+ item->min_frame_in_invl = pinfo->num;
}
- item->int_tot += new_uint64;
- item->double_tot += (gdouble)new_uint64;
+ item->double_tot += (double)new_uint64;
item->fields++;
break;
case FT_INT40:
@@ -248,52 +291,37 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
new_int64 = fvalue_get_sinteger64(((field_info *)gp->pdata[i])->value);
if ((new_int64 > item->int_max) || (item->fields == 0)) {
item->int_max = new_int64;
- item->double_max = (gdouble)new_int64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->max_frame_in_invl = pinfo->num;
}
if ((new_int64 < item->int_min) || (item->fields == 0)) {
item->int_min = new_int64;
- item->double_min = (gdouble)new_int64;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->min_frame_in_invl = pinfo->num;
}
- item->int_tot += new_int64;
- item->double_tot += (gdouble)new_int64;
+ item->double_tot += (double)new_int64;
item->fields++;
break;
case FT_FLOAT:
- new_float = (gfloat)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
- if ((new_float > item->float_max) || (item->fields == 0)) {
- item->float_max = new_float;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ new_float = (float)fvalue_get_floating(((field_info *)gp->pdata[i])->value);
+ if ((new_float > item->double_max) || (item->fields == 0)) {
+ item->double_max = new_float;
+ item->max_frame_in_invl = pinfo->num;
}
- if ((new_float < item->float_min) || (item->fields == 0)) {
- item->float_min = new_float;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ if ((new_float < item->double_min) || (item->fields == 0)) {
+ item->double_min = new_float;
+ item->min_frame_in_invl = pinfo->num;
}
- item->float_tot += new_float;
+ item->double_tot += new_float;
item->fields++;
break;
case FT_DOUBLE:
new_double = fvalue_get_floating(((field_info *)gp->pdata[i])->value);
if ((new_double > item->double_max) || (item->fields == 0)) {
item->double_max = new_double;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->max_frame_in_invl = pinfo->num;
}
if ((new_double < item->double_min) || (item->fields == 0)) {
item->double_min = new_double;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->min_frame_in_invl = pinfo->num;
}
item->double_tot += new_double;
item->fields++;
@@ -304,20 +332,28 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
switch (item_unit) {
case IOG_ITEM_UNIT_CALC_LOAD:
{
- guint64 t, pt; /* time in us */
+ uint64_t t, pt; /* time in us */
int j;
/*
- * Add the time this call spanned each interval according to its contribution
- * to that interval.
+ * Add the time this call spanned each interval according to
+ * its contribution to that interval.
+ * If the call time is negative (unlikely, requires both an
+ * out of order capture file plus retransmission), ignore.
*/
+ const nstime_t time_zero = NSTIME_INIT_ZERO;
+ if (nstime_cmp(new_time, &time_zero) < 0) {
+ break;
+ }
t = new_time->secs;
t = t * 1000000 + new_time->nsecs / 1000;
j = idx;
/*
* Handle current interval
+ * This cannot be negative, because get_io_graph_index
+ * returns an invalid interval if so.
*/
pt = pinfo->rel_ts.secs * 1000000 + pinfo->rel_ts.nsecs / 1000;
- pt = pt % (interval * 1000);
+ pt = pt % interval;
if (pt > t) {
pt = t;
}
@@ -330,14 +366,15 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
load_item->time_tot.secs++;
load_item->time_tot.nsecs -= 1000000000;
}
+ load_item->fields++;
if (j == 0) {
break;
}
j--;
t -= pt;
- if (t > (guint64) interval * 1000) {
- pt = (guint64) interval * 1000;
+ if (t > (uint64_t) interval) {
+ pt = (uint64_t) interval;
} else {
pt = t;
}
@@ -345,23 +382,15 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
break;
}
default:
- if ( (new_time->secs > item->time_max.secs)
- || ( (new_time->secs == item->time_max.secs)
- && (new_time->nsecs > item->time_max.nsecs))
+ if ( (nstime_cmp(new_time, &item->time_max) > 0)
|| (item->fields == 0)) {
item->time_max = *new_time;
- if (item_unit == IOG_ITEM_UNIT_CALC_MAX) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->max_frame_in_invl = pinfo->num;
}
- if ( (new_time->secs<item->time_min.secs)
- || ( (new_time->secs == item->time_min.secs)
- && (new_time->nsecs < item->time_min.nsecs))
+ if ( (nstime_cmp(new_time, &item->time_min) < 0)
|| (item->fields == 0)) {
item->time_min = *new_time;
- if (item_unit == IOG_ITEM_UNIT_CALC_MIN) {
- item->extreme_frame_in_invl = pinfo->num;
- }
+ item->min_frame_in_invl = pinfo->num;
}
nstime_add(&item->time_tot, new_time);
item->fields++;
@@ -393,7 +422,7 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d
item->frames++;
item->bytes += pinfo->fd->pkt_len;
- return TRUE;
+ return true;
}
diff --git a/ui/language.c b/ui/language.c
index a76fcdb7..38e5e1b2 100644
--- a/ui/language.c
+++ b/ui/language.c
@@ -26,12 +26,12 @@
#define LANGUAGE_FILE_NAME "language"
#define LANGUAGE_PREF_LANGUAGE "language"
-char *language = NULL;
+char *language;
/* set one user's recent common file key/value pair */
static prefs_set_pref_e
-read_language_pref(gchar *key, const gchar *value,
- void *private_data _U_, gboolean return_range_errors _U_)
+read_language_pref(char *key, const char *value,
+ void *private_data _U_, bool return_range_errors _U_)
{
if (strcmp(key, LANGUAGE_PREF_LANGUAGE) == 0) {
g_free(language);
@@ -61,7 +61,7 @@ read_language_prefs(void)
char *rf_path;
FILE *rf;
- rf_path = get_persconffile_path(LANGUAGE_FILE_NAME, FALSE);
+ rf_path = get_persconffile_path(LANGUAGE_FILE_NAME, false);
if ((rf = ws_fopen(rf_path, "r")) != NULL) {
read_prefs_file(rf_path, rf, read_language_pref, NULL);
@@ -72,7 +72,7 @@ read_language_prefs(void)
g_free(rf_path);
}
-gboolean
+bool
write_language_prefs(void)
{
char *pf_dir_path;
@@ -92,16 +92,16 @@ write_language_prefs(void)
"Can't create directory\n\"%s\"\nfor language file: %s.", pf_dir_path,
g_strerror(errno));
g_free(pf_dir_path);
- return FALSE;
+ return false;
}
- rf_path = get_persconffile_path(LANGUAGE_FILE_NAME, FALSE);
+ rf_path = get_persconffile_path(LANGUAGE_FILE_NAME, false);
if ((rf = ws_fopen(rf_path, "w")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't open recent file\n\"%s\": %s.", rf_path,
g_strerror(errno));
g_free(rf_path);
- return FALSE;
+ return false;
}
g_free(rf_path);
@@ -115,5 +115,5 @@ write_language_prefs(void)
fclose(rf);
- return TRUE;
+ return true;
}
diff --git a/ui/language.h b/ui/language.h
index dad48b97..36ee1b71 100644
--- a/ui/language.h
+++ b/ui/language.h
@@ -12,6 +12,8 @@
#ifndef __LANGUAGE_H__
#define __LANGUAGE_H__
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -20,8 +22,8 @@ extern "C" {
extern char *language;
-extern void read_language_prefs(void);
-extern int write_language_prefs(void);
+extern void read_language_prefs(void);
+extern bool write_language_prefs(void);
#ifdef __cplusplus
}
diff --git a/ui/logray/CMakeLists.txt b/ui/logray/CMakeLists.txt
index 2af4cceb..9e113406 100644
--- a/ui/logray/CMakeLists.txt
+++ b/ui/logray/CMakeLists.txt
@@ -16,116 +16,123 @@ endif()
ADD_CUSTOM_CMAKE_INCLUDE()
set(WIRESHARK_WIDGET_HEADERS
- ../qt/widgets/additional_toolbar.h
- ../qt/widgets/apply_line_edit.h
- ../qt/widgets/byte_view_text.h
- ../qt/widgets/capture_filter_combo.h
- ../qt/widgets/capture_filter_edit.h
- ../qt/widgets/clickable_label.h
- ../qt/widgets/copy_from_profile_button.h
- ../qt/widgets/detachable_tabwidget.h
- ../qt/widgets/display_filter_combo.h
- ../qt/widgets/display_filter_edit.h
- ../qt/widgets/dissector_syntax_line_edit.h
- ../qt/widgets/dissector_tables_view.h
- ../qt/widgets/drag_drop_toolbar.h
- ../qt/widgets/drag_label.h
- ../qt/widgets/editor_file_dialog.h
- ../qt/widgets/elided_label.h
- ../qt/widgets/expert_info_view.h
- ../qt/widgets/export_objects_view.h
- ../qt/widgets/field_filter_edit.h
- ../qt/widgets/filter_expression_toolbar.h
- ../qt/widgets/find_line_edit.h
- ../qt/widgets/interface_toolbar_lineedit.h
- ../qt/widgets/label_stack.h
- ../qt/widgets/overlay_scroll_bar.h
- ../qt/widgets/packet_list_header.h
- ../qt/widgets/path_selection_edit.h
- ../qt/widgets/pref_module_view.h
- ../qt/widgets/profile_tree_view.h
- ../qt/widgets/range_syntax_lineedit.h
- ../qt/widgets/splash_overlay.h
- ../qt/widgets/stock_icon_tool_button.h
- ../qt/widgets/syntax_line_edit.h
- ../qt/widgets/wireless_timeline.h # Required by PacketListModel
- ../qt/widgets/tabnav_tree_view.h
- ../qt/widgets/traffic_tab.h
- ../qt/widgets/traffic_tree.h
- ../qt/widgets/traffic_types_list.h
- ../qt/widgets/wireshark_file_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/additional_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/apply_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/byte_view_text.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_combo.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/clickable_label.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/compression_group_box.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/copy_from_profile_button.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/detachable_tabwidget.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_combo.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_syntax_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_tables_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_drop_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_label.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/editor_file_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/elided_label.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/expert_info_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/field_filter_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/filter_expression_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/find_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/follow_stream_text.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/interface_toolbar_lineedit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/label_stack.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/overlay_scroll_bar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/packet_list_header.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/path_selection_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/pref_module_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/profile_tree_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_elided.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_si.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_string_legend_item.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/range_syntax_lineedit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resize_header_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resolved_addresses_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/rowmove_tree_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/splash_overlay.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/stock_icon_tool_button.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/syntax_line_edit.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireless_timeline.h # Required by PacketListModel
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/tabnav_tree_view.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tab.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tree.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_types_list.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireshark_file_dialog.h
)
set (LOGRAY_WIDGET_HEADERS ${WIRESHARK_WIDGET_HEADERS})
set(WIRESHARK_3RD_PARTY_WIDGET_HEADERS
- ../qt/widgets/qcustomplot.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcustomplot.h
)
set (LOGRAY_3RD_PARTY_WIDGET_HEADERS ${WIRESHARK_3RD_PARTY_WIDGET_HEADERS})
set(WIRESHARK_MANAGER_HEADERS
- ../qt/manager/preference_manager.h
- ../qt/manager/wireshark_preference.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/preference_manager.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/wireshark_preference.h
)
set (LOGRAY_MANAGER_HEADERS ${WIRESHARK_MANAGER_HEADERS})
set(WIRESHARK_UTILS_HEADERS
- ../qt/utils/color_utils.h
- ../qt/utils/data_printer.h
- ../qt/utils/field_information.h
- ../qt/utils/frame_information.h
- ../qt/utils/idata_printable.h
- ../qt/utils/proto_node.h
- ../qt/utils/qt_ui_utils.h
- ../qt/utils/stock_icon.h
- ../qt/utils/tango_colors.h
- ../qt/utils/variant_pointer.h
- ../qt/utils/wireshark_mime_data.h
- ../qt/utils/wireshark_zip_helper.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/color_utils.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/data_printer.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/field_information.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/frame_information.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/idata_printable.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/profile_switcher.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/proto_node.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/qt_ui_utils.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/stock_icon.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/tango_colors.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/variant_pointer.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_mime_data.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_zip_helper.h
)
set (LOGRAY_UTILS_HEADERS ${WIRESHARK_UTILS_HEADERS})
set(WIRESHARK_MODEL_HEADERS
- ../qt/models/astringlist_list_model.h
- ../qt/models/atap_data_model.h
- ../qt/models/cache_proxy_model.h
- ../qt/models/coloring_rules_delegate.h
- ../qt/models/coloring_rules_model.h
- ../qt/models/column_list_model.h
- ../qt/models/decode_as_delegate.h
- ../qt/models/decode_as_model.h
- ../qt/models/dissector_tables_model.h
- ../qt/models/enabled_protocols_model.h
- ../qt/models/expert_info_model.h
- ../qt/models/expert_info_proxy_model.h
- ../qt/models/export_objects_model.h
- ../qt/models/fileset_entry_model.h
- ../qt/models/filter_list_model.h
- ../qt/models/info_proxy_model.h
- ../qt/models/interface_sort_filter_model.h
- ../qt/models/interface_tree_cache_model.h
- ../qt/models/interface_tree_model.h
- ../qt/models/numeric_value_chooser_delegate.h
- ../qt/models/packet_list_model.h
- ../qt/models/packet_list_record.h
- ../qt/models/path_selection_delegate.h
- ../qt/models/percent_bar_delegate.h
- ../qt/models/pref_delegate.h
- ../qt/models/pref_models.h
- ../qt/models/profile_model.h
- ../qt/models/proto_tree_model.h
- ../qt/models/related_packet_delegate.h
- ../qt/models/resolved_addresses_models.h
- ../qt/models/sparkline_delegate.h
- ../qt/models/supported_protocols_model.h
- ../qt/models/timeline_delegate.h
- ../qt/models/tree_model_helpers.h
- ../qt/models/uat_delegate.h
- ../qt/models/uat_model.h
- ../qt/models/url_link_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/astringlist_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/atap_data_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/cache_proxy_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/column_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/dissector_tables_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/enabled_protocols_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_proxy_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/fileset_entry_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/filter_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/info_proxy_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_sort_filter_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_cache_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/numeric_value_chooser_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_record.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/path_selection_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/percent_bar_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_models.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/profile_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/proto_tree_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/related_packet_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/resolved_addresses_models.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/sparkline_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/supported_protocols_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/timeline_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/tree_model_helpers.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_delegate.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_model.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/url_link_delegate.h
)
set (LOGRAY_MODEL_HEADERS ${WIRESHARK_MODEL_HEADERS})
@@ -133,108 +140,111 @@ set (LOGRAY_MODEL_HEADERS ${WIRESHARK_MODEL_HEADERS})
# All .h files which inherit from QObject aka which use the Q_OBJECT macro
# need to go here.
set(WIRESHARK_QT_HEADERS
- ../qt/about_dialog.h
- ../qt/accordion_frame.h
- ../qt/address_editor_frame.h
- ../qt/byte_view_tab.h
- ../qt/capture_file_dialog.h
- ../qt/capture_file_properties_dialog.h
- ../qt/capture_file.h
- ../qt/capture_filter_syntax_worker.h
- ../qt/capture_options_dialog.h
- ../qt/capture_preferences_frame.h
- ../qt/coloring_rules_dialog.h
- ../qt/column_editor_frame.h
- ../qt/column_preferences_frame.h
- ../qt/compiled_filter_output.h
- ../qt/conversation_colorize_action.h
- ../qt/conversation_dialog.h
- ../qt/conversation_hash_tables_dialog.h
- ../qt/decode_as_dialog.h
- ../qt/display_filter_expression_dialog.h
- ../qt/dissector_tables_dialog.h
- ../qt/enabled_protocols_dialog.h
- ../qt/endpoint_dialog.h
- ../qt/expert_info_dialog.h
- ../qt/export_dissection_dialog.h
- ../qt/export_object_action.h
- ../qt/export_object_dialog.h
- ../qt/export_pdu_dialog.h
- ../qt/extcap_argument_file.h
- ../qt/extcap_argument_multiselect.h
- ../qt/extcap_argument.h
- ../qt/extcap_options_dialog.h
- ../qt/file_set_dialog.h
- ../qt/filter_action.h
- ../qt/filter_dialog.h
- ../qt/filter_dialog.h
- ../qt/filter_expression_frame.h
- ../qt/follow_stream_action.h
- ../qt/font_color_preferences_frame.h
- ../qt/funnel_statistics.h
- ../qt/funnel_string_dialog.h
- ../qt/funnel_text_dialog.h
- ../qt/geometry_state_dialog.h
- ../qt/glib_mainloop_on_qeventloop.h
- ../qt/import_text_dialog.h
- ../qt/interface_frame.h
- ../qt/interface_toolbar_reader.h
- ../qt/interface_toolbar.h
- ../qt/io_console_dialog.h
- ../qt/io_graph_dialog.h
- ../qt/layout_preferences_frame.h
- ../qt/main_application.h
- ../qt/main_status_bar.h
- ../qt/main_window_preferences_frame.h
- ../qt/main_window.h
- ../qt/manage_interfaces_dialog.h
- ../qt/module_preferences_scroll_area.h
- ../qt/packet_comment_dialog.h
- ../qt/packet_diagram.h
- ../qt/packet_dialog.h
- ../qt/packet_format_group_box.h
- ../qt/packet_list.h
- ../qt/packet_range_group_box.h
- ../qt/preference_editor_frame.h
- ../qt/preferences_dialog.h
- ../qt/print_dialog.h
- ../qt/profile_dialog.h
- ../qt/progress_frame.h
- ../qt/proto_tree.h
- ../qt/protocol_hierarchy_dialog.h
- ../qt/protocol_preferences_menu.h
- ../qt/recent_file_status.h
- ../qt/resolved_addresses_dialog.h
- ../qt/response_time_delay_dialog.h
- ../qt/rsa_keys_frame.h
- ../qt/search_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/about_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/accordion_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/address_editor_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/byte_view_tab.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_comment_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_properties_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_filter_syntax_worker.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_options_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/coloring_rules_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_editor_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/compiled_filter_output.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_colorize_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_hash_tables_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/decode_as_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/display_filter_expression_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/dissector_tables_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/enabled_protocols_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/endpoint_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/expert_info_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/export_dissection_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_file.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_multiselect.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_options_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/file_set_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_expression_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/font_color_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_statistics.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_string_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_text_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/geometry_state_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/glib_mainloop_on_qeventloop.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/import_text_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar_reader.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_console_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_action.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/layout_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_application.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_status_bar.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_preferences_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/manage_interfaces_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/module_preferences_scroll_area.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_comment_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_format_group_box.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_list.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_range_group_box.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/preference_editor_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/preferences_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/print_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/profile_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/progress_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/proto_tree.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_hierarchy_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_preferences_menu.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/recent_file_status.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/resolved_addresses_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/response_time_delay_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/rsa_keys_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/search_frame.h
# XXX Depends on RTP Stream Dialog
- # ../qt/sequence_diagram.h
- # ../qt/sequence_dialog.h
- ../qt/show_packet_bytes_dialog.h
- ../qt/simple_statistics_dialog.h
- ../qt/stats_tree_dialog.h
- ../qt/supported_protocols_dialog.h
- ../qt/tabnav_tree_widget.h
- ../qt/tap_parameter_dialog.h
- ../qt/tcp_stream_dialog.h
- ../qt/time_shift_dialog.h
- ../qt/traffic_table_dialog.h
- ../qt/uat_dialog.h
- ../qt/uat_frame.h
- ../qt/welcome_page.h
- ../qt/wireshark_dialog.h
- ../qt/${WIRESHARK_CUSTOM_QT_HEADERS}
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_diagram.h
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/show_packet_bytes_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/simple_statistics_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/stats_tree_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/supported_protocols_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/tabnav_tree_widget.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/tap_parameter_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/tcp_stream_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/time_shift_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/traffic_table_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_frame.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/welcome_page.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_dialog.h
)
+if(WIRESHARK_CUSTOM_QT_HEADERS)
+ list(APPEND WIRESHARK_QT_HEADERS
+ ${CMAKE_SOURCE_DIR}/ui/qt/${WIRESHARK_CUSTOM_QT_HEADERS}
+ )
+endif()
+
if(ENABLE_PCAP)
list(APPEND WIRESHARK_QT_HEADERS
- ../qt/capture_info_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_info_dialog.h
)
if(HAVE_PCAP_REMOTE)
list(APPEND WIRESHARK_QT_HEADERS
- ../qt/remote_capture_dialog.h
- ../qt/remote_settings_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_capture_dialog.h
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_settings_dialog.h
)
endif()
endif()
@@ -246,216 +256,228 @@ set (LOGRAY_QT_HEADERS
)
set(WIRESHARK_WIDGET_SRCS
- ../qt/widgets/additional_toolbar.cpp
- ../qt/widgets/apply_line_edit.cpp
- ../qt/widgets/byte_view_text.cpp
- ../qt/widgets/capture_filter_combo.cpp
- ../qt/widgets/capture_filter_edit.cpp
- ../qt/widgets/clickable_label.cpp
- ../qt/widgets/copy_from_profile_button.cpp
- ../qt/widgets/detachable_tabwidget.cpp
- ../qt/widgets/display_filter_combo.cpp
- ../qt/widgets/display_filter_edit.cpp
- ../qt/widgets/dissector_syntax_line_edit.cpp
- ../qt/widgets/dissector_tables_view.cpp
- ../qt/widgets/drag_drop_toolbar.cpp
- ../qt/widgets/drag_label.cpp
- ../qt/widgets/editor_file_dialog.cpp
- ../qt/widgets/elided_label.cpp
- ../qt/widgets/expert_info_view.cpp
- ../qt/widgets/export_objects_view.cpp
- ../qt/widgets/field_filter_edit.cpp
- ../qt/widgets/filter_expression_toolbar.cpp
- ../qt/widgets/find_line_edit.cpp
- ../qt/widgets/interface_toolbar_lineedit.cpp
- ../qt/widgets/label_stack.cpp
- ../qt/widgets/overlay_scroll_bar.cpp
- ../qt/widgets/packet_list_header.cpp
- ../qt/widgets/path_selection_edit.cpp
- ../qt/widgets/pref_module_view.cpp
- ../qt/widgets/profile_tree_view.cpp
- ../qt/widgets/range_syntax_lineedit.cpp
- ../qt/widgets/splash_overlay.cpp
- ../qt/widgets/stock_icon_tool_button.cpp
- ../qt/widgets/syntax_line_edit.cpp
- ../qt/widgets/wireless_timeline.cpp # Required by PacketListModel
- ../qt/widgets/tabnav_tree_view.cpp
- ../qt/widgets/traffic_tab.cpp
- ../qt/widgets/traffic_tree.cpp
- ../qt/widgets/traffic_types_list.cpp
- ../qt/widgets/wireshark_file_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/additional_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/apply_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/byte_view_text.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_combo.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/capture_filter_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/clickable_label.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/compression_group_box.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/copy_from_profile_button.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/detachable_tabwidget.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_combo.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/display_filter_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_syntax_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/dissector_tables_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_drop_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/drag_label.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/editor_file_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/elided_label.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/expert_info_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/field_filter_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/filter_expression_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/find_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/follow_stream_text.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/interface_toolbar_lineedit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/label_stack.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/overlay_scroll_bar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/packet_list_header.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/path_selection_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/pref_module_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/profile_tree_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_elided.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_axis_ticker_si.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcp_string_legend_item.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/range_syntax_lineedit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resize_header_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/resolved_addresses_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/rowmove_tree_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/splash_overlay.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/stock_icon_tool_button.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/syntax_line_edit.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireless_timeline.cpp # Required by PacketListModel
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/tabnav_tree_view.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tab.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_tree.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/traffic_types_list.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/wireshark_file_dialog.cpp
)
set (LOGRAY_WIDGET_SRCS ${WIRESHARK_WIDGET_SRCS})
set(WIRESHARK_3RD_PARTY_WIDGET_SRCS
- ../qt/widgets/qcustomplot.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/qcustomplot.cpp
)
set (LOGRAY_3RD_PARTY_WIDGET_SRCS ${WIRESHARK_3RD_PARTY_WIDGET_SRCS})
set(WIRESHARK_MANAGER_SRCS
- ../qt/manager/preference_manager.cpp
- ../qt/manager/wireshark_preference.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/preference_manager.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/manager/wireshark_preference.cpp
)
set (LOGRAY_MANAGER_SRCS ${WIRESHARK_MANAGER_SRCS})
set(WIRESHARK_UTILS_SRCS
- ../qt/utils/color_utils.cpp
- ../qt/utils/data_printer.cpp
- ../qt/utils/field_information.cpp
- ../qt/utils/frame_information.cpp
- ../qt/utils/proto_node.cpp
- ../qt/utils/qt_ui_utils.cpp
- ../qt/utils/stock_icon.cpp
- ../qt/utils/wireshark_mime_data.cpp
- ../qt/utils/wireshark_zip_helper.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/color_utils.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/data_printer.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/field_information.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/frame_information.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/profile_switcher.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/proto_node.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/qt_ui_utils.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/stock_icon.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_mime_data.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/utils/wireshark_zip_helper.cpp
)
set (LOGRAY_UTILS_SRCS ${WIRESHARK_UTILS_SRCS})
set(WIRESHARK_MODEL_SRCS
- ../qt/models/astringlist_list_model.cpp
- ../qt/models/atap_data_model.cpp
- ../qt/models/cache_proxy_model.cpp
- ../qt/models/coloring_rules_delegate.cpp
- ../qt/models/coloring_rules_model.cpp
- ../qt/models/column_list_model.cpp
- ../qt/models/decode_as_delegate.cpp
- ../qt/models/decode_as_model.cpp
- ../qt/models/dissector_tables_model.cpp
- ../qt/models/enabled_protocols_model.cpp
- ../qt/models/expert_info_model.cpp
- ../qt/models/expert_info_proxy_model.cpp
- ../qt/models/export_objects_model.cpp
- ../qt/models/fileset_entry_model.cpp
- ../qt/models/filter_list_model.cpp
- ../qt/models/info_proxy_model.cpp
- ../qt/models/interface_sort_filter_model.cpp
- ../qt/models/interface_tree_cache_model.cpp
- ../qt/models/interface_tree_model.cpp
- ../qt/models/numeric_value_chooser_delegate.cpp
- ../qt/models/packet_list_model.cpp
- ../qt/models/packet_list_record.cpp
- ../qt/models/path_selection_delegate.cpp
- ../qt/models/percent_bar_delegate.cpp
- ../qt/models/pref_delegate.cpp
- ../qt/models/pref_models.cpp
- ../qt/models/profile_model.cpp
- ../qt/models/proto_tree_model.cpp
- ../qt/models/related_packet_delegate.cpp
- ../qt/models/resolved_addresses_models.cpp
- ../qt/models/sparkline_delegate.cpp
- ../qt/models/supported_protocols_model.cpp
- ../qt/models/timeline_delegate.cpp
- ../qt/models/uat_delegate.cpp
- ../qt/models/uat_model.cpp
- ../qt/models/url_link_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/astringlist_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/atap_data_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/cache_proxy_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/coloring_rules_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/column_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/decode_as_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/dissector_tables_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/enabled_protocols_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/expert_info_proxy_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/fileset_entry_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/filter_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/info_proxy_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_sort_filter_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_cache_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/interface_tree_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/numeric_value_chooser_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/packet_list_record.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/path_selection_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/percent_bar_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/pref_models.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/profile_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/proto_tree_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/related_packet_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/resolved_addresses_models.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/sparkline_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/supported_protocols_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/timeline_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_delegate.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/uat_model.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/models/url_link_delegate.cpp
)
set (LOGRAY_MODEL_SRCS ${WIRESHARK_MODEL_SRCS})
set(WIRESHARK_QT_SRC
- ../qt/about_dialog.cpp
- ../qt/accordion_frame.cpp
- ../qt/address_editor_frame.cpp
- ../qt/byte_view_tab.cpp
- ../qt/capture_file_dialog.cpp
- ../qt/capture_file_properties_dialog.cpp
- ../qt/capture_file.cpp
- ../qt/capture_filter_syntax_worker.cpp
- ../qt/capture_options_dialog.cpp
- ../qt/capture_preferences_frame.cpp
- ../qt/coloring_rules_dialog.cpp
- ../qt/column_editor_frame.cpp
- ../qt/column_preferences_frame.cpp
- ../qt/compiled_filter_output.cpp
- ../qt/conversation_colorize_action.cpp
- ../qt/conversation_dialog.cpp
- ../qt/conversation_hash_tables_dialog.cpp
- ../qt/decode_as_dialog.cpp
- ../qt/display_filter_expression_dialog.cpp
- ../qt/dissector_tables_dialog.cpp
- ../qt/enabled_protocols_dialog.cpp
- ../qt/endpoint_dialog.cpp
- ../qt/export_dissection_dialog.cpp
- ../qt/export_object_action.cpp
- ../qt/export_object_dialog.cpp
- ../qt/export_pdu_dialog.cpp
- ../qt/extcap_argument_file.cpp
- ../qt/extcap_argument_multiselect.cpp
- ../qt/extcap_argument.cpp
- ../qt/extcap_options_dialog.cpp
- ../qt/file_set_dialog.cpp
- ../qt/filter_action.cpp
- ../qt/filter_dialog.cpp
- ../qt/filter_expression_frame.cpp
- ../qt/follow_stream_action.cpp
- ../qt/font_color_preferences_frame.cpp
- ../qt/funnel_string_dialog.cpp
- ../qt/funnel_text_dialog.cpp
- ../qt/geometry_state_dialog.cpp
- ../qt/glib_mainloop_on_qeventloop.cpp
- ../qt/import_text_dialog.cpp
- ../qt/interface_frame.cpp
- ../qt/interface_toolbar_reader.cpp
- ../qt/interface_toolbar.cpp
- ../qt/io_console_dialog.cpp
- ../qt/layout_preferences_frame.cpp
- ../qt/main_application.cpp
- ../qt/main_status_bar.cpp
- ../qt/main_window_layout.cpp
- ../qt/main_window_preferences_frame.cpp
- ../qt/main_window.cpp
- ../qt/manage_interfaces_dialog.cpp
- ../qt/module_preferences_scroll_area.cpp
- ../qt/packet_comment_dialog.cpp
- ../qt/packet_diagram.cpp
- ../qt/packet_dialog.cpp
- ../qt/packet_format_group_box.cpp
- ../qt/packet_list.cpp
- ../qt/packet_range_group_box.cpp
- ../qt/preference_editor_frame.cpp
- ../qt/preferences_dialog.cpp
- ../qt/print_dialog.cpp
- ../qt/profile_dialog.cpp
- ../qt/progress_frame.cpp
- ../qt/proto_tree.cpp
- ../qt/protocol_hierarchy_dialog.cpp
- ../qt/protocol_preferences_menu.cpp
- ../qt/recent_file_status.cpp
- ../qt/resolved_addresses_dialog.cpp
- ../qt/response_time_delay_dialog.cpp
- ../qt/rsa_keys_frame.cpp
- ../qt/search_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/about_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/accordion_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/address_editor_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/byte_view_tab.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_comment_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_properties_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_filter_syntax_worker.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_options_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/coloring_rules_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_editor_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/compiled_filter_output.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_colorize_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_hash_tables_dialog.cpp
+ # XXX Required by packet list
+ ${CMAKE_SOURCE_DIR}/ui/qt/decode_as_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/display_filter_expression_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/dissector_tables_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/enabled_protocols_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/endpoint_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/export_dissection_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_file.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument_multiselect.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_argument.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_options_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/file_set_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_expression_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/font_color_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_string_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_text_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/geometry_state_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/glib_mainloop_on_qeventloop.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/import_text_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar_reader.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_console_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_action.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/layout_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_application.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_status_bar.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_layout.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_preferences_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/manage_interfaces_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/module_preferences_scroll_area.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_comment_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_format_group_box.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_list.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_range_group_box.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/preference_editor_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/preferences_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/print_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/profile_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/progress_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/proto_tree.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_hierarchy_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_preferences_menu.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/recent_file_status.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/resolved_addresses_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/response_time_delay_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/rsa_keys_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/search_frame.cpp
# XXX Depends on RTP Stream Dialog
- # ../qt/sequence_diagram.cpp
- # ../qt/sequence_dialog.cpp
- ../qt/show_packet_bytes_dialog.cpp
- ../qt/simple_dialog.cpp
- ../qt/simple_statistics_dialog.cpp
- ../qt/supported_protocols_dialog.cpp
- ../qt/tabnav_tree_widget.cpp
- ../qt/tap_parameter_dialog.cpp
- ../qt/tcp_stream_dialog.cpp
- ../qt/time_shift_dialog.cpp
- ../qt/traffic_table_dialog.cpp
- ../qt/uat_dialog.cpp
- ../qt/uat_frame.cpp
- ../qt/welcome_page.cpp
- ../qt/wireshark_dialog.cpp
- ../qt/${WIRESHARK_CUSTOM_QT_SRCS}
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_diagram.cpp
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/show_packet_bytes_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/simple_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/simple_statistics_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/supported_protocols_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/tabnav_tree_widget.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/tap_parameter_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/tcp_stream_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/time_shift_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/traffic_table_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_frame.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/welcome_page.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_dialog.cpp
)
+if(WIRESHARK_CUSTOM_QT_SRCS)
+ list(APPEND WIRESHARK_QT_SRC
+ ${CMAKE_SOURCE_DIR}/ui/qt/${WIRESHARK_CUSTOM_QT_SRCS}
+ )
+endif()
+
if(ENABLE_PCAP)
list(APPEND WIRESHARK_QT_SRC
- ../qt/capture_info_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_info_dialog.cpp
)
if(HAVE_PCAP_REMOTE)
list(APPEND WIRESHARK_QT_SRC
- ../qt/remote_capture_dialog.cpp
- ../qt/remote_settings_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_capture_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_settings_dialog.cpp
)
endif()
endif()
@@ -468,10 +490,10 @@ set (LOGRAY_QT_SRC
${WIRESHARK_QT_SRC})
set(WIRESHARK_QT_TAP_SRC
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/expert_info_dialog.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/funnel_statistics.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/io_graph_dialog.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt/stats_tree_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/expert_info_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_statistics.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_dialog.cpp
+ ${CMAKE_SOURCE_DIR}/ui/qt/stats_tree_dialog.cpp
${WIRESHARK_CUSTOM_TAP_SRC}
)
@@ -485,71 +507,71 @@ set(WIRESHARK_QT_FILES
set (LOGRAY_QT_FILES ${WIRESHARK_QT_FILES})
set(WIRESHARK_QT_UI
- ../qt/about_dialog.ui
- ../qt/address_editor_frame.ui
- ../qt/capture_file_properties_dialog.ui
- ../qt/capture_info_dialog.ui
- ../qt/capture_options_dialog.ui
- ../qt/capture_preferences_frame.ui
- ../qt/coloring_rules_dialog.ui
- ../qt/column_editor_frame.ui
- ../qt/column_preferences_frame.ui
- ../qt/compiled_filter_output.ui
- ../qt/conversation_hash_tables_dialog.ui
- ../qt/decode_as_dialog.ui
- ../qt/display_filter_expression_dialog.ui
- ../qt/dissector_tables_dialog.ui
- ../qt/enabled_protocols_dialog.ui
- ../qt/expert_info_dialog.ui
- ../qt/export_object_dialog.ui
- ../qt/export_pdu_dialog.ui
- ../qt/extcap_options_dialog.ui
- ../qt/file_set_dialog.ui
- ../qt/filter_dialog.ui
- ../qt/filter_expression_frame.ui
- ../qt/font_color_preferences_frame.ui
- ../qt/funnel_string_dialog.ui
- ../qt/funnel_text_dialog.ui
- ../qt/import_text_dialog.ui
- ../qt/interface_frame.ui
- ../qt/interface_toolbar.ui
- ../qt/io_console_dialog.ui
- ../qt/io_graph_dialog.ui
- ../qt/layout_preferences_frame.ui
- ../qt/main_window_preferences_frame.ui
- ../qt/manage_interfaces_dialog.ui
- ../qt/module_preferences_scroll_area.ui
- ../qt/packet_comment_dialog.ui
- ../qt/packet_dialog.ui
- ../qt/packet_format_group_box.ui
- ../qt/packet_range_group_box.ui
- ../qt/preference_editor_frame.ui
- ../qt/preferences_dialog.ui
- ../qt/print_dialog.ui
- ../qt/profile_dialog.ui
- ../qt/progress_frame.ui
- ../qt/protocol_hierarchy_dialog.ui
- ../qt/resolved_addresses_dialog.ui
- ../qt/rsa_keys_frame.ui
- ../qt/search_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/about_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/address_editor_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_comment_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_file_properties_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_info_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_options_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/capture_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/coloring_rules_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_editor_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/column_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/compiled_filter_output.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/conversation_hash_tables_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/decode_as_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/display_filter_expression_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/dissector_tables_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/enabled_protocols_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/expert_info_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/extcap_options_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/file_set_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/filter_expression_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/follow_stream_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/font_color_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_string_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/funnel_text_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/import_text_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/interface_toolbar.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_console_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/io_graph_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/layout_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/main_window_preferences_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/manage_interfaces_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/module_preferences_scroll_area.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_comment_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_format_group_box.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/packet_range_group_box.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/preference_editor_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/preferences_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/print_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/profile_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/progress_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/protocol_hierarchy_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/resolved_addresses_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/rsa_keys_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/search_frame.ui
# XXX Depends on RTP Stream Dialog
- # ../qt/sequence_dialog.ui
- ../qt/show_packet_bytes_dialog.ui
- ../qt/supported_protocols_dialog.ui
- ../qt/tap_parameter_dialog.ui
- ../qt/tcp_stream_dialog.ui
- ../qt/time_shift_dialog.ui
- ../qt/traffic_table_dialog.ui
- ../qt/uat_dialog.ui
- ../qt/uat_frame.ui
- ../qt/welcome_page.ui
- ../qt/widgets/splash_overlay.ui
+ # ${CMAKE_SOURCE_DIR}/ui/qt/sequence_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/show_packet_bytes_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/supported_protocols_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/tap_parameter_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/tcp_stream_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/time_shift_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/traffic_table_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/uat_frame.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/welcome_page.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/widgets/splash_overlay.ui
)
if(HAVE_PCAP_REMOTE)
list(APPEND WIRESHARK_QT_UI
- ../qt/remote_capture_dialog.ui
- ../qt/remote_settings_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_capture_dialog.ui
+ ${CMAKE_SOURCE_DIR}/ui/qt/remote_settings_dialog.ui
)
endif()
@@ -559,18 +581,18 @@ set (LOGRAY_QT_UI
)
set(WIRESHARK_QT_TS
- ../qt/wireshark_de.ts
- ../qt/wireshark_en.ts # lupdate -pluralonly
- ../qt/wireshark_es.ts
- ../qt/wireshark_fr.ts
- ../qt/wireshark_it.ts
- ../qt/wireshark_ja_JP.ts
- ../qt/wireshark_pl.ts
- ../qt/wireshark_ru.ts
- ../qt/wireshark_sv.ts
- ../qt/wireshark_tr_TR.ts
- ../qt/wireshark_uk.ts
- ../qt/wireshark_zh_CN.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_de.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_en.ts # lupdate -pluralonly
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_es.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_fr.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_it.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_ja_JP.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_pl.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_ru.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_sv.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_tr_TR.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_uk.ts
+ ${CMAKE_SOURCE_DIR}/ui/qt/wireshark_zh_CN.ts
)
set(LOGRAY_QT_TS
@@ -583,15 +605,35 @@ foreach(_file ${LOGRAY_QT_TS})
set(_qresource_qm "${_qresource}.qm")
set(i18n_qresource "${i18n_qresource}\n <file>${_qresource_qm}</file>")
endforeach()
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/i18n.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
+configure_file(i18n.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/authors.qrc"
+"<RCC>\n"
+" <qresource prefix=\"/about\">\n"
+" <file compress-algo=\"zstd\">authors.csv</file>\n"
+" </qresource>\n"
+"</RCC>\n"
+)
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-authors-csv.py
+ < ${CMAKE_SOURCE_DIR}/AUTHORS
+ > ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/tools/make-authors-csv.py
+ ${CMAKE_SOURCE_DIR}/AUTHORS
+)
set(LOGRAY_QT_QRC
- ../../resources/about.qrc
- ../../resources/languages/languages.qrc
- ../../resources/layout.qrc
- ../../resources/lricon.qrc
- ../../resources/stock_icons.qrc
+ ${CMAKE_SOURCE_DIR}/resources/about.qrc
+ ${CMAKE_SOURCE_DIR}/resources/languages/languages.qrc
+ ${CMAKE_SOURCE_DIR}/resources/layout.qrc
+ ${CMAKE_SOURCE_DIR}/resources/lricon.qrc
+ ${CMAKE_SOURCE_DIR}/resources/stock_icons.qrc
${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc
+ ${CMAKE_CURRENT_BINARY_DIR}/authors.qrc
+ ${CMAKE_CURRENT_BINARY_DIR}/authors.csv
)
if(NOT Qt${qtver}Widgets_VERSION VERSION_LESS "5.9")
@@ -688,13 +730,14 @@ target_include_directories(ui_logray
${QT5_INCLUDE_DIRS}
${GCRYPT_INCLUDE_DIRS}
${MINIZIP_INCLUDE_DIRS}
+ ${MINIZIPNG_INCLUDE_DIRS}
${PCAP_INCLUDE_DIRS}
${SPEEXDSP_INCLUDE_DIRS}
${WINSPARKLE_INCLUDE_DIRS}
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/../qt
+ ${CMAKE_SOURCE_DIR}/ui/qt
)
if(USE_qt6)
@@ -707,6 +750,9 @@ if(USE_qt6)
if(Qt6Multimedia_FOUND)
target_link_libraries(ui_logray PUBLIC Qt6::Multimedia)
endif()
+ if(Qt6DBus_FOUND)
+ target_link_libraries(ui_logray PUBLIC Qt6::DBus)
+ endif()
endif()
target_compile_definitions(ui_logray
diff --git a/ui/logray/logray_application.cpp b/ui/logray/logray_application.cpp
index 76106c42..ab0bc722 100644
--- a/ui/logray/logray_application.cpp
+++ b/ui/logray/logray_application.cpp
@@ -13,7 +13,7 @@
#include "ui/iface_lists.h"
#include "ui/ws_ui_util.h"
-LograyApplication *lwApp = NULL;
+LograyApplication *lwApp;
LograyApplication::LograyApplication(int &argc, char **argv) :
MainApplication(argc, argv)
@@ -34,8 +34,17 @@ void LograyApplication::refreshLocalInterfaces()
extcap_clear_interfaces();
#ifdef HAVE_LIBPCAP
+ free_interface_list(cached_if_list_);
+ cached_if_list_ = NULL;
+
GList * filter_list = NULL;
- filter_list = g_list_append(filter_list, GUINT_TO_POINTER((guint) IF_EXTCAP));
+ filter_list = g_list_append(filter_list, GUINT_TO_POINTER((unsigned) IF_EXTCAP));
+
+ // We don't need to (re)start the stats (which calls dumpcap) because
+ // Logray only uses extcaps now. If that changes, do the below instead.
+#if 0
+ emit scanLocalInterfaces(filter_list);
+#endif
scan_local_interfaces_filtered(filter_list, main_window_update);
diff --git a/ui/logray/logray_en.ts b/ui/logray/logray_en.ts
index 1b989309..69c98095 100644
--- a/ui/logray/logray_en.ts
+++ b/ui/logray/logray_en.ts
@@ -12,11 +12,11 @@
<context>
<name>AboutDialog</name>
<message>
- <source>About Wireshark</source>
+ <source>About Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark</source>
+ <source>Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -860,12 +860,12 @@
</message>
<message>
<source>Open Capture File</source>
- <oldsource>Wireshark: Open Capture File</oldsource>
+ <oldsource>Logray: Open Capture File</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
<source>Save Capture File As</source>
- <oldsource>Wireshark: Save Capture File As</oldsource>
+ <oldsource>Logray: Save Capture File As</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -874,7 +874,7 @@
</message>
<message>
<source>Export Specified Packets</source>
- <oldsource>Wireshark: Export Specified Packets</oldsource>
+ <oldsource>Logray: Export Specified Packets</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -883,7 +883,7 @@
</message>
<message>
<source>Merge Capture File</source>
- <oldsource>Wireshark: Merge Capture File</oldsource>
+ <oldsource>Logray: Merge Capture File</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -891,7 +891,7 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
+ <source>Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1128,7 +1128,7 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Created by Wireshark %1
+ <source>Created by Logray %1
</source>
<translation type="unfinished"></translation>
@@ -1672,7 +1672,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark doesn&apos;t recognize one or more of your coloring rules. They have been disabled.</source>
+ <source>Logray doesn&apos;t recognize one or more of your coloring rules. They have been disabled.</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -2469,7 +2469,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>ExportDissectionDialog</name>
<message>
<source>Export Packet Dissections</source>
- <oldsource>Wireshark: Export Packet Dissections</oldsource>
+ <oldsource>Logray: Export Packet Dissections</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3789,7 +3789,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark I/O Graphs: %1</source>
+ <source>Logray I/O Graphs: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4148,7 +4148,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Import a standard hex dump as exported by Wireshark</source>
+ <source>Import a standard hex dump as exported by Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4559,7 +4559,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark was built without packet capture support.</source>
+ <source>This version of Logray was built without packet capture support.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6073,7 +6073,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>MainWindow</name>
<message>
- <source>Wireshark</source>
+ <source>Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6197,7 +6197,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Quit Wireshark</source>
+ <source>Quit Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6225,7 +6225,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireshark Filter</source>
+ <source>Logray Filter</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6269,7 +6269,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;About Wireshark</source>
+ <source>&amp;About Logray</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6704,7 +6704,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Manage Wireshark&apos;s preferences</source>
+ <source>Manage Logray&apos;s preferences</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7700,7 +7700,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
+ <source>Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7734,7 +7734,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
+ <source>There is no &quot;rtp.ssrc&quot; field in this version of Logray.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7760,7 +7760,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>The Wireshark Network Analyzer</source>
+ <source>The Logray System Call and Log Analyzer</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -7882,7 +7882,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Please wait while Wireshark is initializing…</source>
+ <source>Please wait while Logray is initializing…</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -8093,15 +8093,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark does not save pipe settings.</source>
+ <source>This version of Logray does not save pipe settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark does not save remote settings.</source>
+ <source>This version of Logray does not save remote settings.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>This version of Wireshark does not support remote interfaces.</source>
+ <source>This version of Logray does not support remote interfaces.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -11001,7 +11001,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>SCTPAllAssocsDialog</name>
<message>
- <source>Wireshark - SCTP Associations</source>
+ <source>Logray - SCTP Associations</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -11288,7 +11288,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>SCTPAssocAnalyseDialog</name>
<message>
- <source>Wireshark - Analyse Association</source>
+ <source>Logray - Analyse Association</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13423,7 +13423,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:large;&quot;&gt;Welcome to Wireshark&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:large;&quot;&gt;Welcome to Logray&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13520,11 +13520,11 @@ a:hover {
</translation>
</message>
<message>
- <source>You are sniffing the glue that holds the Internet together using Wireshark </source>
+ <source>You are sniffing the glue that holds the Internet together using Logray </source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>You are running Wireshark </source>
+ <source>You are running Logray </source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13587,7 +13587,7 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>Wireless controls are not supported in this version of Wireshark.</source>
+ <source>Wireless controls are not supported in this version of Logray.</source>
<translation type="unfinished"></translation>
</message>
<message>
diff --git a/ui/logray/logray_main.cpp b/ui/logray/logray_main.cpp
index 2b754402..ff81b546 100644
--- a/ui/logray/logray_main.cpp
+++ b/ui/logray/logray_main.cpp
@@ -10,8 +10,6 @@
#include <config.h>
#define WS_LOG_DOMAIN LOG_DOMAIN_MAIN
-#include <glib.h>
-
#include <locale.h>
#ifdef _WIN32
@@ -133,7 +131,7 @@ void exit_application(int status) {
/*
* Report an error in command-line arguments.
*
- * On Windows, Wireshark is built for the Windows subsystem, and runs
+ * On Windows, Logray is built for the Windows subsystem, and runs
* without a console, so we create a console on Windows to receive the
* output.
*
@@ -142,25 +140,25 @@ void exit_application(int status) {
*
* On UN*Xes:
*
- * If Wireshark is run from the command line, its output either goes
+ * If Logray is run from the command line, its output either goes
* to the terminal or to wherever the standard error was redirected.
*
- * If Wireshark is run by executing it as a remote command, e.g. with
+ * If Logray is run by executing it as a remote command, e.g. with
* ssh, its output either goes to whatever socket was set up for the
* remote command's standard error or to wherever the standard error
* was redirected.
*
- * If Wireshark was run from the GUI, e.g. by double-clicking on its
+ * If Logray was run from the GUI, e.g. by double-clicking on its
* icon or on a file that it opens, there are no guarantees as to
* where the standard error went. It could be going to /dev/null
* (current macOS), or to a socket to systemd for the journal, or
* to a log file in the user's home directory, or to the "console
* device" ("workstation console"), or....
*
- * Part of determining that, at least for locally-run Wireshark,
+ * Part of determining that, at least for locally-run Logray,
* is to try to open /dev/tty to determine whether the process
* has a controlling terminal. (It fails, at a minimum, for
- * Wireshark launched from the GUI under macOS, Ubuntu with GNOME,
+ * Logray launched from the GUI under macOS, Ubuntu with GNOME,
* and Ubuntu with KDE; in all cases, an attempt to open /dev/tty
* fails with ENXIO.) If it does have a controlling terminal,
* write to the standard error, otherwise assume that the standard
@@ -302,7 +300,7 @@ qt_log_message_handler(QtMsgType type, const QMessageLogContext &, const QString
static void
check_and_warn_user_startup()
{
- gchar *cur_user, *cur_group;
+ char *cur_user, *cur_group;
/* Tell the user not to run as root. */
if (running_with_special_privs() && recent.privs_warn_if_elevated) {
@@ -311,7 +309,7 @@ check_and_warn_user_startup()
simple_message_box(ESD_TYPE_WARN, &recent.privs_warn_if_elevated,
"Running as user \"%s\" and group \"%s\".\n"
"This could be dangerous.\n\n"
- "If you're running Wireshark this way in order to perform live capture, "
+ "If you're running Logray this way in order to perform live capture, "
"you may want to be aware that there is a better way documented at\n"
WS_WIKI_URL("CaptureSetup/CapturePrivileges"), cur_user, cur_group);
g_free(cur_user);
@@ -330,7 +328,7 @@ check_and_warn_user_startup()
//
// and
//
-// - You install Wireshark that was built on a machine with Qt version
+// - You install Logray that was built on a machine with Qt version
// 5.x.z installed in the default location.
//
// Qt5Core.dll will load qwindows.dll from your local C:\Qt\5.x\...\plugins
@@ -402,18 +400,22 @@ macos_enable_layer_backing(void)
#ifdef HAVE_LIBPCAP
static GList *
-capture_opts_get_interface_list(int *err, char **err_str)
+capture_opts_get_interface_list(int *err _U_, char **err_str _U_)
{
- /*
- * XXX - should this pass an update callback?
- * We already have a window up by the time we start parsing
- * the majority of the command-line arguments, because
- * we need to do a bunch of initialization work before
- * parsing those arguments, and we want to let the user
- * know that we're doing that initialization, given that
- * it can take a while.
- */
- return capture_interface_list(err, err_str, NULL);
+ // logray only wants the IF_EXTCAP interfaces, so there's no point
+ // in spawning dumpcap to retrieve the other types of interfaces.
+#if 0
+ if (mainApp) {
+ GList *if_list = mainApp->getInterfaceList();
+ if (if_list == NULL) {
+ if_list = capture_interface_list(err, err_str, main_window_update);
+ mainApp->setInterfaceList(if_list);
+ }
+ return if_list;
+ }
+ return capture_interface_list(err, err_str, main_window_update);
+#endif
+ return append_extcap_interface_list(NULL);
}
#endif
@@ -432,15 +434,15 @@ int main(int argc, char *qt_argv[])
char *rf_path;
int rf_open_errno;
#ifdef HAVE_LIBPCAP
- gchar *err_str, *err_str_secondary;;
+ char *err_str, *err_str_secondary;
#else
#ifdef _WIN32
#ifdef HAVE_AIRPCAP
- gchar *err_str;
+ char *err_str;
#endif
#endif
#endif
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
df_error_t *df_err = NULL;
QString dfilter, read_filter;
@@ -448,7 +450,7 @@ int main(int argc, char *qt_argv[])
int caps_queries = 0;
#endif
/* Start time in microseconds */
- guint64 start_time = g_get_monotonic_time();
+ uint64_t start_time = g_get_monotonic_time();
static const struct report_message_routines wireshark_report_routines = {
vfailure_alert_box,
vwarning_alert_box,
@@ -499,7 +501,7 @@ int main(int argc, char *qt_argv[])
/* Initialize log handler early so we can have proper logging during startup. */
ws_log_init("logray", vcmdarg_err);
/* For backward compatibility with GLib logging and Wireshark 3.4. */
- ws_log_console_writer_set_use_stdout(TRUE);
+ ws_log_console_writer_set_use_stdout(true);
qInstallMessageHandler(qt_log_message_handler);
@@ -632,7 +634,7 @@ int main(int argc, char *qt_argv[])
g_free (rf_path);
}
- profile_store_persconffiles(TRUE);
+ profile_store_persconffiles(true);
recent_init();
/* Read the profile independent recent file. We have to do this here so we can */
@@ -664,7 +666,7 @@ int main(int argc, char *qt_argv[])
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
- /* Create The Wireshark app */
+ /* Create The Logray app */
LograyApplication ls_app(argc, qt_argv);
/* initialize the funnel mini-api */
@@ -728,7 +730,7 @@ int main(int argc, char *qt_argv[])
}
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
#ifdef HAVE_LIBPCAP
@@ -742,17 +744,17 @@ int main(int argc, char *qt_argv[])
* dissection-time handlers for file-type-dependent blocks can
* register using the file type/subtype value for the file type.
*/
- wtap_init(TRUE);
+ wtap_init(true);
splash_update(RA_DISSECTORS, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling epan init, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling epan init, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Register all dissectors; we must do this before checking for the
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
- if (!epan_init(splash_update, NULL, TRUE)) {
+ if (!epan_init(splash_update, NULL, true)) {
SimpleDialog::displayQueuedMessages(main_w);
ret_val = WS_EXIT_INIT_FAILED;
goto clean_exit;
@@ -760,7 +762,7 @@ int main(int argc, char *qt_argv[])
#ifdef DEBUG_STARTUP_TIME
/* epan_init resets the preferences */
prefs.gui_console_open = console_open_always;
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Register all audio codecs. */
@@ -779,7 +781,7 @@ int main(int argc, char *qt_argv[])
splash_update(RA_LISTENERS, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Register all tap listeners, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Register all tap listeners, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Register all tap listeners; we do this before we parse the arguments,
as the "-z" argument can specify a registered tap. */
@@ -796,14 +798,9 @@ int main(int argc, char *qt_argv[])
in_file_type = open_info_name_to_type(ex_opt_get_next("read_format"));
}
-#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
-#endif
- splash_update(RA_EXTCAP, NULL, NULL);
- extcap_register_preferences();
splash_update(RA_PREFERENCES, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
/* Read the preferences, but don't apply them yet. */
@@ -813,7 +810,17 @@ int main(int argc, char *qt_argv[])
* line, and store them. We have to do this before applying the
* preferences to the capture options.
*/
- commandline_override_prefs(argc, argv, TRUE);
+ commandline_override_prefs(argc, argv, true);
+
+ /* Register the extcap preferences. We do this after seeing if the
+ * capture_no_extcap preference is set in the configuration file
+ * or command line. This will re-read the extcap specific preferences.
+ */
+#ifdef DEBUG_STARTUP_TIME
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
+#endif
+ splash_update(RA_EXTCAP, NULL, NULL);
+ extcap_register_preferences();
/* Some of the preferences affect the capture options. Apply those
* before getting the other command line arguments, which can also
@@ -824,7 +831,7 @@ int main(int argc, char *qt_argv[])
prefs_to_capture_opts();
/* Now get our remaining args */
- commandline_other_options(argc, argv, TRUE);
+ commandline_other_options(argc, argv, true);
/* Convert some command-line parameters to QStrings */
if (global_commandline_info.cf_name != NULL)
@@ -839,19 +846,6 @@ int main(int argc, char *qt_argv[])
timestamp_set_seconds_type (recent.gui_seconds_format);
#ifdef HAVE_LIBPCAP
-#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
-#endif
- splash_update(RA_INTERFACES, NULL, NULL);
-
- if (!global_commandline_info.cf_name && !prefs.capture_no_interface_load) {
- /* Allow only extcap interfaces to be found */
- GList * filter_list = NULL;
- filter_list = g_list_append(filter_list, GUINT_TO_POINTER((guint) IF_EXTCAP));
- fill_in_local_interfaces_filtered(filter_list, main_window_update);
- g_list_free(filter_list);
- }
-
if (global_commandline_info.list_link_layer_types)
caps_queries |= CAPS_QUERY_LINK_TYPES;
if (global_commandline_info.list_timestamp_types)
@@ -873,27 +867,41 @@ int main(int argc, char *qt_argv[])
* and exit.
*/
if (caps_queries) {
- guint i;
+ unsigned i;
#ifdef _WIN32
create_console();
#endif /* _WIN32 */
/* Get the list of link-layer types for the capture devices. */
ret_val = EXIT_SUCCESS;
+ GList *if_cap_queries = NULL;
+ if_cap_query_t *if_cap_query;
+ GHashTable *capability_hash;
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
interface_options *interface_opts;
- if_capabilities_t *caps;
- char *auth_str = NULL;
interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
+ if_cap_query = g_new(if_cap_query_t, 1);
+ if_cap_query->name = interface_opts->name;
+ if_cap_query->monitor_mode = interface_opts->monitor_mode;
+ if_cap_query->auth_username = NULL;
+ if_cap_query->auth_password = NULL;
#ifdef HAVE_PCAP_REMOTE
if (interface_opts->auth_type == CAPTURE_AUTH_PWD) {
- auth_str = g_strdup_printf("%s:%s", interface_opts->auth_username, interface_opts->auth_password);
+ if_cap_query->auth_username = interface_opts->auth_username;
+ if_cap_query->auth_password = interface_opts->auth_password;
}
#endif
- caps = capture_get_if_capabilities(interface_opts->name, interface_opts->monitor_mode,
- auth_str, &err_str, &err_str_secondary, NULL);
- g_free(auth_str);
+ if_cap_queries = g_list_prepend(if_cap_queries, if_cap_query);
+ }
+ if_cap_queries = g_list_reverse(if_cap_queries);
+ capability_hash = capture_get_if_list_capabilities(if_cap_queries, &err_str, &err_str_secondary, NULL);
+ g_list_free_full(if_cap_queries, g_free);
+ for (i = 0; i < global_capture_opts.ifaces->len; i++) {
+ interface_options *interface_opts;
+ if_capabilities_t *caps;
+ interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
+ caps = static_cast<if_capabilities_t*>(g_hash_table_lookup(capability_hash, interface_opts->name));
if (caps == NULL) {
cmdarg_err("%s%s%s", err_str, err_str_secondary ? "\n" : "", err_str_secondary ? err_str_secondary : "");
g_free(err_str);
@@ -903,7 +911,6 @@ int main(int argc, char *qt_argv[])
}
ret_val = capture_opts_print_if_capabilities(caps, interface_opts,
caps_queries);
- free_if_capabilities(caps);
if (ret_val != EXIT_SUCCESS) {
break;
}
@@ -911,9 +918,26 @@ int main(int argc, char *qt_argv[])
#ifdef _WIN32
destroy_console();
#endif /* _WIN32 */
+ g_hash_table_destroy(capability_hash);
goto clean_exit;
}
+#ifdef DEBUG_STARTUP_TIME
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
+#endif
+ splash_update(RA_INTERFACES, NULL, NULL);
+
+ if (!global_commandline_info.cf_name && !prefs.capture_no_interface_load) {
+ /* Allow only extcap interfaces to be found */
+ GList * filter_list = NULL;
+ filter_list = g_list_append(filter_list, GUINT_TO_POINTER((unsigned) IF_EXTCAP));
+ // The below starts the stats; we don't need that since Logray only
+ // supports extcaps.
+ //lwApp->scanLocalInterfaces(filter_list);
+ fill_in_local_interfaces_filtered(filter_list, main_window_update);
+ g_list_free(filter_list);
+ }
+
capture_opts_trim_snaplen(&global_capture_opts, MIN_PACKET_SIZE);
capture_opts_trim_ring_num_files(&global_capture_opts);
#endif /* HAVE_LIBPCAP */
@@ -922,7 +946,7 @@ int main(int argc, char *qt_argv[])
changed either from one of the preferences file or from the command
line that their preferences have changed. */
#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling prefs_apply_all, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time);
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling prefs_apply_all, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
prefs_apply_all();
lwApp->emitAppSignal(LograyApplication::PreferencesChanged);
@@ -930,12 +954,12 @@ int main(int argc, char *qt_argv[])
#ifdef HAVE_LIBPCAP
if ((global_capture_opts.num_selected == 0) &&
(prefs.capture_device != NULL)) {
- guint i;
+ unsigned i;
interface_t *device;
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device->hidden && strcmp(device->display_name, prefs.capture_device) == 0) {
- device->selected = TRUE;
+ device->selected = true;
global_capture_opts.num_selected++;
break;
}
@@ -952,7 +976,7 @@ int main(int argc, char *qt_argv[])
goto clean_exit;
}
- build_column_format_array(&CaptureFile::globalCapFile()->cinfo, global_commandline_info.prefs_p->num_cols, TRUE);
+ build_column_format_array(&CaptureFile::globalCapFile()->cinfo, global_commandline_info.prefs_p->num_cols, true);
lwApp->emitAppSignal(LograyApplication::ColumnsChanged); // We read "recent" widths above.
lwApp->emitAppSignal(LograyApplication::RecentPreferencesRead); // Must be emitted after PreferencesChanged.
@@ -988,7 +1012,7 @@ int main(int argc, char *qt_argv[])
if (global_commandline_info.go_to_packet != 0) {
/* Jump to the specified frame number, kept for backward
compatibility. */
- cf_goto_frame(CaptureFile::globalCapFile(), global_commandline_info.go_to_packet);
+ cf_goto_frame(CaptureFile::globalCapFile(), global_commandline_info.go_to_packet, false);
} else if (global_commandline_info.jfilter != NULL) {
dfilter_t *jump_to_filter = NULL;
/* try to compile given filter */
@@ -1014,7 +1038,7 @@ int main(int argc, char *qt_argv[])
if (global_capture_opts.save_file != NULL) {
/* Save the directory name for future file dialogs. */
/* (get_dirname overwrites filename) */
- gchar *s = g_strdup(global_capture_opts.save_file);
+ char *s = g_strdup(global_capture_opts.save_file);
set_last_open_dir(get_dirname(s));
g_free(s);
}
@@ -1051,8 +1075,9 @@ int main(int argc, char *qt_argv[])
// loaded when the dialog is shown. Register them here.
profile_register_persconffile("io_graphs");
profile_register_persconffile("import_hexdump.json");
+ profile_register_persconffile("remote_hosts.json");
- profile_store_persconffiles(FALSE);
+ profile_store_persconffiles(false);
// If the lwApp->exec() event loop exits cleanly, we call
// LograyApplication::cleanup().
diff --git a/ui/logray/logray_main_window.cpp b/ui/logray/logray_main_window.cpp
index f7886daf..6262bca6 100644
--- a/ui/logray/logray_main_window.cpp
+++ b/ui/logray/logray_main_window.cpp
@@ -12,7 +12,7 @@
/*
* The generated Ui_LograyMainWindow::setupUi() can grow larger than our configured limit,
- * so turn off -Wframe-larger-than= for ui_main_window.h.
+ * so turn off -Wframe-larger-than= for ui_logray_main_window.h.
*/
DIAG_OFF(frame-larger-than=)
#include <ui_logray_main_window.h>
@@ -26,12 +26,11 @@ DIAG_ON(frame-larger-than=)
#include <wsutil/ws_assert.h>
#include <wsutil/version_info.h>
#include <epan/prefs.h>
-#include <epan/stats_tree_priv.h>
#include <epan/plugin_if.h>
-#include <epan/export_object.h>
#include <frame_tvbuff.h>
#include "ui/iface_toolbar.h"
+#include "ui/commandline.h"
#ifdef HAVE_LIBPCAP
#include "ui/capture.h"
@@ -55,13 +54,12 @@ DIAG_ON(frame-larger-than=)
#endif
#include "conversation_colorize_action.h"
#include "export_dissection_dialog.h"
-#include "export_object_action.h"
#include "file_set_dialog.h"
#include "filter_dialog.h"
+#include "follow_stream_action.h"
#include "funnel_statistics.h"
#include "import_text_dialog.h"
#include "interface_toolbar.h"
-#include "packet_diagram.h"
#include "packet_list.h"
#include "proto_tree.h"
#include "simple_dialog.h"
@@ -72,6 +70,7 @@ DIAG_ON(frame-larger-than=)
#include <ui/qt/widgets/filter_expression_toolbar.h>
#include <ui/qt/utils/color_utils.h>
+#include <ui/qt/utils/profile_switcher.h>
#include <ui/qt/utils/qt_ui_utils.h>
#include <ui/qt/utils/stock_icon.h>
#include <ui/qt/utils/variant_pointer.h>
@@ -93,7 +92,7 @@ DIAG_ON(frame-larger-than=)
//menu_recent_file_write_all
// If we ever add support for multiple windows this will need to be replaced.
-static LograyMainWindow *gbl_cur_main_window_ = NULL;
+static LograyMainWindow *gbl_cur_main_window_;
static void plugin_if_mainwindow_apply_filter(GHashTable * data_set)
{
@@ -116,9 +115,9 @@ static void plugin_if_mainwindow_preference(GHashTable * data_set)
const char * pref_value;
DIAG_OFF_CAST_AWAY_CONST
- if (g_hash_table_lookup_extended(data_set, "pref_module", NULL, (gpointer *)&module_name) &&
- g_hash_table_lookup_extended(data_set, "pref_key", NULL, (gpointer *)&pref_name) &&
- g_hash_table_lookup_extended(data_set, "pref_value", NULL, (gpointer *)&pref_value))
+ if (g_hash_table_lookup_extended(data_set, "pref_module", NULL, (void * *)&module_name) &&
+ g_hash_table_lookup_extended(data_set, "pref_key", NULL, (void * *)&pref_name) &&
+ g_hash_table_lookup_extended(data_set, "pref_value", NULL, (void * *)&pref_value))
{
unsigned int changed_flags = prefs_store_ext(module_name, pref_name, pref_value);
if (changed_flags) {
@@ -134,7 +133,7 @@ static void plugin_if_mainwindow_gotoframe(GHashTable * data_set)
if (!gbl_cur_main_window_ || !data_set)
return;
- gpointer framenr;
+ void *framenr;
if (g_hash_table_lookup_extended(data_set, "frame_nr", NULL, &framenr)) {
if (GPOINTER_TO_UINT(framenr) != 0)
@@ -212,7 +211,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
}
else {
ws_info->cf_framenr = 0;
- ws_info->frame_passed_dfilter = FALSE;
+ ws_info->frame_passed_dfilter = false;
}
}
else
@@ -220,7 +219,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
/* Initialise the other ws_info structure values */
ws_info->cf_count = 0;
ws_info->cf_framenr = 0;
- ws_info->frame_passed_dfilter = FALSE;
+ ws_info->frame_passed_dfilter = false;
}
}
@@ -290,7 +289,7 @@ static void mainwindow_add_toolbar(const iface_toolbar *toolbar_entry)
}
}
-static void mainwindow_remove_toolbar(const gchar *menu_title)
+static void mainwindow_remove_toolbar(const char *menu_title)
{
if (gbl_cur_main_window_ && menu_title)
{
@@ -298,16 +297,22 @@ static void mainwindow_remove_toolbar(const gchar *menu_title)
}
}
-QMenu* LograyMainWindow::findOrAddMenu(QMenu *parent_menu, QString& menu_text) {
- QList<QAction *> actions = parent_menu->actions();
- QList<QAction *>::const_iterator i;
- for (i = actions.constBegin(); i != actions.constEnd(); ++i) {
- if ((*i)->text()==menu_text) {
- return (*i)->menu();
+QMenu* LograyMainWindow::findOrAddMenu(QMenu *parent_menu, const QStringList& menu_parts) {
+ for (auto const & menu_text : menu_parts) {
+ bool found = false;
+ for (auto const & action : parent_menu->actions()) {
+ if (action->text() == menu_text.trimmed()) {
+ parent_menu = action->menu();
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // If we get here the menu entry was not found, add a sub menu
+ parent_menu = parent_menu->addMenu(menu_text.trimmed());
}
}
- // If we get here there menu entry was not found, add a sub menu
- return parent_menu->addMenu(menu_text);
+ return parent_menu;
}
LograyMainWindow::LograyMainWindow(QWidget *parent) :
@@ -322,7 +327,8 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
freeze_focus_(NULL),
was_maximized_(false),
capture_stopping_(false),
- capture_filter_valid_(false)
+ capture_filter_valid_(false),
+ use_capturing_title_(false)
#ifdef HAVE_LIBPCAP
, capture_options_dialog_(NULL)
, info_data_()
@@ -332,10 +338,9 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
#endif
{
if (!gbl_cur_main_window_) {
- connect(mainApp, SIGNAL(openStatCommandDialog(QString, const char*, void*)),
- this, SLOT(openStatCommandDialog(QString, const char*, void*)));
- connect(mainApp, SIGNAL(openTapParameterDialog(QString, const QString, void*)),
- this, SLOT(openTapParameterDialog(QString, const QString, void*)));
+ connect(mainApp, &MainApplication::openStatCommandDialog, this, &LograyMainWindow::openStatCommandDialog);
+ connect(mainApp, &MainApplication::openTapParameterDialog,
+ this, [=](const QString cfg_str, const QString arg, void *userdata) {openTapParameterDialog(cfg_str, arg, userdata);});
}
gbl_cur_main_window_ = this;
#ifdef HAVE_LIBPCAP
@@ -356,7 +361,7 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
<< REGISTER_LOG_STAT_GROUP_UNSORTED;
setWindowIcon(mainApp->normalIcon());
- setTitlebarForCaptureFile();
+ updateTitlebar();
setMenusForCaptureFile();
setForCapturedPackets(false);
setMenusForFileSet(false);
@@ -369,35 +374,36 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
qRegisterMetaType<FilterAction::Action>("FilterAction::Action");
qRegisterMetaType<FilterAction::ActionType>("FilterAction::ActionType");
- connect(this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SLOT(queuedFilterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- Qt::QueuedConnection);
+ connect(this, &LograyMainWindow::filterAction, this, &LograyMainWindow::queuedFilterAction, Qt::QueuedConnection);
//To prevent users use features before initialization complete
//Otherwise unexpected problems may occur
setFeaturesEnabled(false);
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(setFeaturesEnabled()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(applyGlobalCommandLineOptions()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(zoomText()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initViewColorizeMenu()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addStatsPluginsToMenu()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addDynamicMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addPluginIFStructures()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initConversationMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initExportObjectsMenus()));
-
- connect(mainApp, SIGNAL(profileChanging()), this, SLOT(saveWindowGeometry()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(layoutPanes()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(layoutToolbars()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(updatePreferenceActions()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(zoomText()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(setTitlebarForCaptureFile()));
-
- connect(mainApp, SIGNAL(updateRecentCaptureStatus(const QString &, qint64, bool)), this, SLOT(updateRecentCaptures()));
+ connect(mainApp, &MainApplication::appInitialized, this, [this]() { setFeaturesEnabled(); });
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::applyGlobalCommandLineOptions);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::zoomText);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::initViewColorizeMenu);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::addStatsPluginsToMenu);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::addDynamicMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::addPluginIFStructures);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::initConversationMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &LograyMainWindow::initFollowStreamMenus);
+ connect(mainApp, &MainApplication::appInitialized, this,
+ [=]() { addDisplayFilterTranslationActions(main_ui_->menuEditCopy); });
+
+ connect(mainApp, &MainApplication::profileChanging, this, &LograyMainWindow::saveWindowGeometry);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::layoutPanes);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::layoutToolbars);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::updatePreferenceActions);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::zoomText);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::updateTitlebar);
+
+ connect(mainApp, &MainApplication::updateRecentCaptureStatus, this, &LograyMainWindow::updateRecentCaptures);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &LograyMainWindow::updateRecentCaptures);
updateRecentCaptures();
#if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
- connect(mainApp, SIGNAL(softwareUpdateRequested()), this, SLOT(softwareUpdateRequested()),
+ connect(mainApp, &MainApplication::softwareUpdateRequested, this, &LograyMainWindow::softwareUpdateRequested,
Qt::BlockingQueuedConnection);
#endif
@@ -406,12 +412,13 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
funnel_statistics_ = new FunnelStatistics(this, capture_file_);
connect(df_combo_box_, &QComboBox::editTextChanged, funnel_statistics_, &FunnelStatistics::displayFilterTextChanged);
connect(funnel_statistics_, &FunnelStatistics::setDisplayFilter, this, &LograyMainWindow::setDisplayFilter);
- connect(funnel_statistics_, SIGNAL(openCaptureFile(QString, QString)),
- this, SLOT(openCaptureFile(QString, QString)));
+ connect(funnel_statistics_, &FunnelStatistics::openCaptureFile, this,
+ [=](QString cf_path, QString filter) { openCaptureFile(cf_path, filter); });
+
+ connect(df_combo_box_, &QComboBox::editTextChanged, this, &LograyMainWindow::updateDisplayFilterTranslationActions);
file_set_dialog_ = new FileSetDialog(this);
- connect(file_set_dialog_, SIGNAL(fileSetOpenCaptureFile(QString)),
- this, SLOT(openCaptureFile(QString)));
+ connect(file_set_dialog_, &FileSetDialog::fileSetOpenCaptureFile, this, [=](QString cf_path) { openCaptureFile(cf_path); });
initMainToolbarIcons();
@@ -428,15 +435,13 @@ LograyMainWindow::LograyMainWindow(QWidget *parent) :
main_ui_->displayFilterToolBar->addWidget(filter_expression_toolbar_);
main_ui_->goToFrame->hide();
- connect(main_ui_->goToFrame, SIGNAL(visibilityChanged(bool)),
- main_ui_->actionGoGoToPacket, SLOT(setChecked(bool)));
+ connect(main_ui_->goToFrame, &AccordionFrame::visibilityChanged, main_ui_->actionGoGoToPacket, &QAction::setChecked);
// XXX For some reason the cursor is drawn funny with an input mask set
// https://bugreports.qt-project.org/browse/QTBUG-7174
main_ui_->searchFrame->hide();
- connect(main_ui_->searchFrame, SIGNAL(visibilityChanged(bool)),
- main_ui_->actionEditFindPacket, SLOT(setChecked(bool)));
+ connect(main_ui_->searchFrame, &SearchFrame::visibilityChanged, main_ui_->actionEditFindPacket, &QAction::setChecked);
main_ui_->addressEditorFrame->hide();
main_ui_->columnEditorFrame->hide();
@@ -483,7 +488,7 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
#ifdef HAVE_SOFTWARE_UPDATE
QAction *update_sep = main_ui_->menuHelp->insertSeparator(main_ui_->actionHelpAbout);
main_ui_->menuHelp->insertAction(update_sep, update_action_);
- connect(update_action_, SIGNAL(triggered()), this, SLOT(checkForUpdates()));
+ connect(update_action_, &QAction::triggered, this, &LograyMainWindow::checkForUpdates);
#endif
master_split_.setObjectName("splitterMaster");
extra_split_.setObjectName("splitterExtra");
@@ -495,22 +500,21 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
empty_pane_.setVisible(false);
packet_list_ = new PacketList(&master_split_);
- connect(packet_list_, SIGNAL(framesSelected(QList<int>)), this, SLOT(setMenusForSelectedPacket()));
- connect(packet_list_, SIGNAL(framesSelected(QList<int>)), this, SIGNAL(framesSelected(QList<int>)));
+ connect(packet_list_, &PacketList::framesSelected, this, &LograyMainWindow::setMenusForSelectedPacket);
+ connect(packet_list_, &PacketList::framesSelected, this, &LograyMainWindow::framesSelected);
QAction *action = main_ui_->menuPacketComment->addAction(tr("Add New Comment…"));
connect(action, &QAction::triggered, this, &LograyMainWindow::addPacketComment);
action->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_C));
- connect(main_ui_->menuPacketComment, SIGNAL(aboutToShow()), this, SLOT(setEditCommentsMenu()));
+ connect(main_ui_->menuPacketComment, &QMenu::aboutToShow, this, &LograyMainWindow::setEditCommentsMenu);
proto_tree_ = new ProtoTree(&master_split_);
proto_tree_->installEventFilter(this);
packet_list_->setProtoTree(proto_tree_);
+ packet_list_->setProfileSwitcher(profile_switcher_);
packet_list_->installEventFilter(this);
- packet_diagram_ = new PacketDiagram(&master_split_);
-
main_stack_ = main_ui_->mainStack;
welcome_page_ = main_ui_->welcomePage;
main_status_bar_ = main_ui_->statusBar;
@@ -546,40 +550,27 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
setTabOrder(df_combo_box_->lineEdit(), packet_list_);
setTabOrder(packet_list_, proto_tree_);
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- this, SLOT(captureEventHandler(CaptureEvent)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- mainApp, SLOT(captureEventHandler(CaptureEvent)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent)));
-
- connect(mainApp, SIGNAL(freezePacketList(bool)),
- packet_list_, SLOT(freezePacketList(bool)));
- connect(mainApp, SIGNAL(columnsChanged()),
- packet_list_, SLOT(columnsChanged()));
- connect(mainApp, SIGNAL(preferencesChanged()),
- packet_list_, SLOT(preferencesChanged()));
- connect(mainApp, SIGNAL(recentPreferencesRead()),
- this, SLOT(applyRecentPaneGeometry()));
- connect(mainApp, SIGNAL(recentPreferencesRead()),
- this, SLOT(updateRecentActions()));
- connect(mainApp, SIGNAL(packetDissectionChanged()),
- this, SLOT(redissectPackets()), Qt::QueuedConnection);
-
- connect(mainApp, SIGNAL(checkDisplayFilter()),
- this, SLOT(checkDisplayFilter()));
- connect(mainApp, SIGNAL(fieldsChanged()),
- this, SLOT(fieldsChanged()));
- connect(mainApp, SIGNAL(reloadLuaPlugins()),
- this, SLOT(reloadLuaPlugins()));
-
- connect(main_ui_->mainStack, SIGNAL(currentChanged(int)),
- this, SLOT(mainStackChanged(int)));
-
- connect(welcome_page_, SIGNAL(startCapture(QStringList)),
- this, SLOT(startCapture(QStringList)));
- connect(welcome_page_, SIGNAL(recentFileActivated(QString)),
- this, SLOT(openCaptureFile(QString)));
+ connect(&capture_file_, &CaptureFile::captureEvent, this, &LograyMainWindow::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, mainApp, &WiresharkApplication::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, main_ui_->statusBar, &MainStatusBar::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, profile_switcher_, &ProfileSwitcher::captureEventHandler);
+
+ connect(mainApp, &MainApplication::freezePacketList, packet_list_, &PacketList::freezePacketList);
+ connect(mainApp, &MainApplication::columnsChanged, packet_list_, &PacketList::columnsChanged);
+ connect(mainApp, &MainApplication::colorsChanged, packet_list_, &PacketList::colorsChanged);
+ connect(mainApp, &MainApplication::preferencesChanged, packet_list_, &PacketList::preferencesChanged);
+ connect(mainApp, &MainApplication::recentPreferencesRead, this, &LograyMainWindow::applyRecentPaneGeometry);
+ connect(mainApp, &MainApplication::recentPreferencesRead, this, &LograyMainWindow::updateRecentActions);
+ connect(mainApp, &MainApplication::packetDissectionChanged, this, &LograyMainWindow::redissectPackets, Qt::QueuedConnection);
+
+ connect(mainApp, &MainApplication::checkDisplayFilter, this, &LograyMainWindow::checkDisplayFilter);
+ connect(mainApp, &MainApplication::fieldsChanged, this, &LograyMainWindow::fieldsChanged);
+ connect(mainApp, &MainApplication::reloadLuaPlugins, this, &LograyMainWindow::reloadLuaPlugins);
+
+ connect(main_ui_->mainStack, &QStackedWidget::currentChanged, this, &LograyMainWindow::mainStackChanged);
+
+ connect(welcome_page_, &WelcomePage::startCapture, this, [this](QStringList) { startCapture(); });
+ connect(welcome_page_, &WelcomePage::recentFileActivated, this, [this](QString cfile) { openCaptureFile(cfile); });
connect(main_ui_->addressEditorFrame, &AddressEditorFrame::redissectPackets,
this, &LograyMainWindow::redissectPackets);
@@ -602,10 +593,8 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
connect(this, &LograyMainWindow::setCaptureFile,
proto_tree_, &ProtoTree::setCaptureFile);
- connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
- packet_list_, SLOT(setMonospaceFont(QFont)));
- connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
- proto_tree_, SLOT(setMonospaceFont(QFont)));
+ connect(mainApp, &MainApplication::zoomMonospaceFont, packet_list_, &PacketList::setMonospaceFont);
+ connect(mainApp, &MainApplication::zoomMonospaceFont, proto_tree_, &ProtoTree::setMonospaceFont);
connectFileMenuActions();
connectEditMenuActions();
@@ -614,28 +603,21 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
connectCaptureMenuActions();
connectAnalyzeMenuActions();
connectStatisticsMenuActions();
+ connectToolsMenuActions();
connectHelpMenuActions();
- connect(packet_list_, SIGNAL(packetDissectionChanged()),
- this, SLOT(redissectPackets()));
- connect(packet_list_, SIGNAL(showColumnPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
- connect(packet_list_, SIGNAL(showProtocolPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(packet_list_, &PacketList::packetDissectionChanged, this, &LograyMainWindow::redissectPackets);
+ connect(packet_list_, &PacketList::showColumnPreferences, this, &LograyMainWindow::showPreferencesDialog);
+ connect(packet_list_, &PacketList::showProtocolPreferences, this, &LograyMainWindow::showPreferencesDialog);
connect(packet_list_, SIGNAL(editProtocolPreference(preference*, pref_module*)),
main_ui_->preferenceEditorFrame, SLOT(editPreference(preference*, pref_module*)));
- connect(packet_list_, SIGNAL(editColumn(int)), this, SLOT(showColumnEditor(int)));
- connect(main_ui_->columnEditorFrame, SIGNAL(columnEdited()),
- packet_list_, SLOT(columnsChanged()));
- connect(packet_list_, SIGNAL(doubleClicked(QModelIndex)),
- this, SLOT(openPacketDialog()));
- connect(packet_list_, SIGNAL(packetListScrolled(bool)),
- main_ui_->actionGoAutoScroll, SLOT(setChecked(bool)));
-
- connect(proto_tree_, SIGNAL(openPacketInNewWindow(bool)),
- this, SLOT(openPacketDialog(bool)));
- connect(proto_tree_, SIGNAL(showProtocolPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(packet_list_, &PacketList::editColumn, this, &LograyMainWindow::showColumnEditor);
+ connect(main_ui_->columnEditorFrame, &ColumnEditorFrame::columnEdited, packet_list_, &PacketList::columnsChanged);
+ connect(packet_list_, &QAbstractItemView::doubleClicked, this, [=](const QModelIndex &){ openPacketDialog(); });
+ connect(packet_list_, &PacketList::packetListScrolled, main_ui_->actionGoAutoScroll, &QAction::setChecked);
+
+ connect(proto_tree_, &ProtoTree::openPacketInNewWindow, this, &LograyMainWindow::openPacketDialog);
+ connect(proto_tree_, &ProtoTree::showProtocolPreferences, this, &LograyMainWindow::showPreferencesDialog);
connect(proto_tree_, SIGNAL(editProtocolPreference(preference*, pref_module*)),
main_ui_->preferenceEditorFrame, SLOT(editPreference(preference*, pref_module*)));
@@ -657,16 +639,13 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
#ifdef HAVE_LIBPCAP
QTreeWidget *iface_tree = findChild<QTreeWidget *>("interfaceTree");
if (iface_tree) {
- connect(iface_tree, SIGNAL(itemSelectionChanged()),
- this, SLOT(interfaceSelectionChanged()));
+ connect(iface_tree, &QTreeWidget::itemSelectionChanged, this, &LograyMainWindow::interfaceSelectionChanged);
}
- connect(main_ui_->welcomePage, SIGNAL(captureFilterSyntaxChanged(bool)),
- this, SLOT(captureFilterSyntaxChanged(bool)));
+ connect(main_ui_->welcomePage, &WelcomePage::captureFilterSyntaxChanged,
+ this, &LograyMainWindow::captureFilterSyntaxChanged);
- connect(this, SIGNAL(showExtcapOptions(QString&, bool)),
- this, SLOT(showExtcapOptionsDialog(QString&, bool)));
- connect(this->welcome_page_, SIGNAL(showExtcapOptions(QString&, bool)),
- this, SLOT(showExtcapOptionsDialog(QString&, bool)));
+ connect(this, &LograyMainWindow::showExtcapOptions, this, &LograyMainWindow::showExtcapOptionsDialog);
+ connect(this->welcome_page_, &WelcomePage::showExtcapOptions, this, &LograyMainWindow::showExtcapOptionsDialog);
#endif // HAVE_LIBPCAP
@@ -697,7 +676,7 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
main_ui_->actionHelpMPText2pcap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TEXT2PCAP)));
main_ui_->actionHelpMPTShark->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TSHARK)));
- main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_USERGUIDE)));
+ main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(HELP_CONTENT)));
main_ui_->actionHelpWebsite->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_HOME)));
main_ui_->actionHelpFAQ->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_FAQ)));
main_ui_->actionHelpAsk->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_ASK)));
@@ -711,11 +690,14 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
LograyMainWindow::~LograyMainWindow()
{
disconnect(main_ui_->mainStack, 0, 0, 0);
+ if (previous_focus_ != nullptr) {
+ disconnect(previous_focus_, &QWidget::destroyed, this, &LograyMainWindow::resetPreviousFocus);
+ }
#ifndef Q_OS_MAC
// Below dialogs inherit GeometryStateDialog
// For reasons described in geometry_state_dialog.h no parent is set when
- // instantiating the dialogs and as a resul objects are not automatically
+ // instantiating the dialogs and as a result objects are not automatically
// freed by its parent. Free then here explicitly to avoid leak and numerous
// Valgrind complaints.
delete file_set_dialog_;
@@ -753,7 +735,6 @@ QMenu *LograyMainWindow::createPopupMenu()
menu->addAction(main_ui_->actionViewPacketList);
menu->addAction(main_ui_->actionViewPacketDetails);
menu->addAction(main_ui_->actionViewPacketBytes);
- menu->addAction(main_ui_->actionViewPacketDiagram);
return menu;
}
@@ -780,8 +761,8 @@ void LograyMainWindow::addInterfaceToolbar(const iface_toolbar *toolbar_entry)
menu->insertAction(before, action);
InterfaceToolbar *interface_toolbar = new InterfaceToolbar(this, toolbar_entry);
- connect(mainApp, SIGNAL(appInitialized()), interface_toolbar, SLOT(interfaceListChanged()));
- connect(mainApp, SIGNAL(localInterfaceListChanged()), interface_toolbar, SLOT(interfaceListChanged()));
+ connect(mainApp, &MainApplication::appInitialized, interface_toolbar, &InterfaceToolbar::interfaceListChanged);
+ connect(mainApp, &MainApplication::localInterfaceListChanged, interface_toolbar, &InterfaceToolbar::interfaceListChanged);
QToolBar *toolbar = new QToolBar(this);
toolbar->addWidget(interface_toolbar);
@@ -800,7 +781,7 @@ void LograyMainWindow::addInterfaceToolbar(const iface_toolbar *toolbar_entry)
menu->menuAction()->setVisible(true);
}
-void LograyMainWindow::removeInterfaceToolbar(const gchar *menu_title)
+void LograyMainWindow::removeInterfaceToolbar(const char *menu_title)
{
QMenu *menu = main_ui_->menuInterfaceToolbars;
QAction *action = NULL;
@@ -829,6 +810,23 @@ void LograyMainWindow::removeInterfaceToolbar(const gchar *menu_title)
menu->menuAction()->setVisible(!menu->actions().isEmpty());
}
+void LograyMainWindow::updateStyleSheet()
+{
+#ifdef Q_OS_MAC
+ // TODO: The event type QEvent::ApplicationPaletteChange is not sent to all child widgets.
+ // Workaround this by doing it manually for all AccordionFrame.
+ main_ui_->addressEditorFrame->updateStyleSheet();
+ main_ui_->columnEditorFrame->updateStyleSheet();
+ main_ui_->filterExpressionFrame->updateStyleSheet();
+ main_ui_->goToFrame->updateStyleSheet();
+ main_ui_->preferenceEditorFrame->updateStyleSheet();
+ main_ui_->searchFrame->updateStyleSheet();
+
+ df_combo_box_->updateStyleSheet();
+ welcome_page_->updateStyleSheets();
+#endif
+}
+
bool LograyMainWindow::eventFilter(QObject *obj, QEvent *event) {
// The user typed some text. Start filling in a filter.
@@ -852,6 +850,7 @@ bool LograyMainWindow::event(QEvent *event)
switch (event->type()) {
case QEvent::ApplicationPaletteChange:
initMainToolbarIcons();
+ updateStyleSheet();
break;
default:
break;
@@ -1008,10 +1007,10 @@ void LograyMainWindow::dropEvent(QDropEvent *event)
if (cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, static_cast<int>(local_files.size()),
in_filenames,
wtap_pcapng_file_type_subtype(),
- FALSE) == CF_OK) {
+ false) == CF_OK) {
/* Merge succeeded; close the currently-open file and try
to open the merged capture file. */
- openCaptureFile(tmpname, QString(), WTAP_TYPE_AUTO, TRUE);
+ openCaptureFile(tmpname, QString(), WTAP_TYPE_AUTO, true);
}
g_free(tmpname);
@@ -1030,6 +1029,18 @@ void LograyMainWindow::loadWindowGeometry()
#ifndef Q_OS_MAC
if (recent.gui_geometry_main_maximized) {
+ // [save|restore]Geometry does a better job (on Linux and Windows)
+ // of restoring to the original monitor because it saves
+ // QGuiApplication::screens().indexOf(screen())
+ // (it also saves Qt::WindowFullScreen, restores the non-maximized
+ // size even when starting out maximized, etc.)
+ // Monitors of different DPI might still be tricky:
+ // https://bugreports.qt.io/browse/QTBUG-70721
+ // https://bugreports.qt.io/browse/QTBUG-77385
+ //
+ // We might eventually want to always use restoreGeometry, but
+ // for now at least use it just for maximized because it's better
+ // then what we've been doing.
setWindowState(Qt::WindowMaximized);
} else
#endif
@@ -1061,6 +1072,13 @@ void LograyMainWindow::loadWindowGeometry()
void LograyMainWindow::saveWindowGeometry()
{
+ if (prefs.gui_geometry_save_position ||
+ prefs.gui_geometry_save_size ||
+ prefs.gui_geometry_save_maximized) {
+ g_free(recent.gui_geometry_main);
+ recent.gui_geometry_main = g_strdup(saveGeometry().toHex().constData());
+ }
+
if (prefs.gui_geometry_save_position) {
recent.gui_geometry_main_x = pos().x();
recent.gui_geometry_main_y = pos().y();
@@ -1073,9 +1091,20 @@ void LograyMainWindow::saveWindowGeometry()
if (prefs.gui_geometry_save_maximized) {
// On macOS this is false when it shouldn't be
+ // XXX: Does save/restoreGeometry work any better on macOS
+ // for maximized windows? Apparently not:
+ // https://bugreports.qt.io/browse/QTBUG-100272
recent.gui_geometry_main_maximized = isMaximized();
}
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = g_strdup(master_split_.saveState().toHex().constData());
+ recent.gui_geometry_main_extra_split = g_strdup(extra_split_.saveState().toHex().constData());
+
+ // Saving the QSplitter state is more accurate (#19361), but save
+ // the old GTK-style pane information for backwards compatibility
+ // for switching back and forth with older versions.
if (master_split_.sizes().length() > 0) {
recent.gui_geometry_main_upper_pane = master_split_.sizes()[0];
}
@@ -1090,7 +1119,7 @@ void LograyMainWindow::saveWindowGeometry()
// Our event loop becomes nested whenever we call update_progress_dlg, which
// includes several places in file.c. The GTK+ UI stays out of trouble by
// showing a modal progress dialog. We attempt to do the equivalent below by
-// disabling parts of the main window. At a minumum the ProgressFrame in the
+// disabling parts of the main window. At a minimum the ProgressFrame in the
// main status bar must remain accessible.
//
// We might want to do this any time the main status bar progress frame is
@@ -1132,7 +1161,7 @@ void LograyMainWindow::mergeCaptureFile()
if (prefs.gui_ask_unsaved) {
if (cf_has_unsaved_data(capture_file_.capFile())) {
QMessageBox msg_dialog;
- gchar *display_basename;
+ char *display_basename;
int response;
msg_dialog.setIcon(QMessageBox::Question);
@@ -1202,17 +1231,17 @@ void LograyMainWindow::mergeCaptureFile()
/* chronological order */
in_filenames[0] = g_strdup(capture_file_.capFile()->filename);
in_filenames[1] = qstring_strdup(file_name);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, FALSE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, false);
} else if (merge_dlg.mergeType() <= 0) {
/* prepend file */
in_filenames[0] = qstring_strdup(file_name);
in_filenames[1] = g_strdup(capture_file_.capFile()->filename);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, true);
} else {
/* append file */
in_filenames[0] = g_strdup(capture_file_.capFile()->filename);
in_filenames[1] = qstring_strdup(file_name);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, true);
}
g_free(in_filenames[0]);
@@ -1227,8 +1256,10 @@ void LograyMainWindow::mergeCaptureFile()
cf_close(capture_file_.capFile());
/* Try to open the merged capture file. */
+ // XXX - Just free rfcode and call
+ // openCaptureFile(tmpname, read_filter, WTAP_TYPE_AUTO, true);
CaptureFile::globalCapFile()->window = this;
- if (cf_open(CaptureFile::globalCapFile(), tmpname, WTAP_TYPE_AUTO, TRUE /* temporary file */, &err) != CF_OK) {
+ if (cf_open(CaptureFile::globalCapFile(), tmpname, WTAP_TYPE_AUTO, true /* temporary file */, &err) != CF_OK) {
/* We couldn't open it; fail. */
CaptureFile::globalCapFile()->window = NULL;
dfilter_free(rfcode);
@@ -1241,7 +1272,7 @@ void LograyMainWindow::mergeCaptureFile()
previous read filter attached to "cf"). */
cf_set_rfcode(CaptureFile::globalCapFile(), rfcode);
- switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/FALSE)) {
+ switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
@@ -1259,8 +1290,7 @@ void LograyMainWindow::mergeCaptureFile()
return;
}
- /* Save the name of the containing directory specified in the path name. */
- mainApp->setLastOpenDirFromFilename(tmpname);
+ /* This is a tempfile; don't change the last open directory. */
g_free(tmpname);
main_ui_->statusBar->showExpert();
return;
@@ -1282,12 +1312,12 @@ void LograyMainWindow::importCaptureFile() {
return;
}
- openCaptureFile(import_dlg.capfileName());
+ openCaptureFile(import_dlg.capfileName(), QString(), WTAP_TYPE_AUTO, true);
}
bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
QString file_name;
- gboolean discard_comments;
+ bool discard_comments;
if (cf->is_tempfile) {
/* This is a temporary capture file, so saving it means saving
@@ -1297,7 +1327,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
probably pcapng, which supports comments and, if it's
not pcapng, let the user decide what they want to do
if they've added comments. */
- return saveAsCaptureFile(cf, FALSE, dont_reopen);
+ return saveAsCaptureFile(cf, false, dont_reopen);
} else {
if (cf->unsaved_changes) {
cf_write_status_t status;
@@ -1316,7 +1346,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1324,7 +1354,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1332,7 +1362,7 @@ bool LograyMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
support comments, and the user said not to delete the
comments. Do a "Save As" so the user can select
one of those formats and choose a file name. */
- return saveAsCaptureFile(cf, TRUE, dont_reopen);
+ return saveAsCaptureFile(cf, true, dont_reopen);
case CANCELLED:
/* The user said "forget it". Just return. */
@@ -1400,8 +1430,8 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
int file_type;
wtap_compression_type compression_type;
cf_write_status_t status;
- gchar *dirname;
- gboolean discard_comments = FALSE;
+ char *dirname;
+ bool discard_comments = false;
if (!cf) {
return false;
@@ -1418,7 +1448,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1426,7 +1456,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1436,7 +1466,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
formats that don't support comments trimmed from it,
so run the dialog again, to let the user decide
whether to save in one of those formats or give up. */
- must_support_comments = TRUE;
+ must_support_comments = true;
continue;
case CANCELLED:
@@ -1451,17 +1481,12 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
msg_dialog.setIcon(QMessageBox::Critical);
msg_dialog.setText(tr("Unknown file type returned by merge dialog."));
- msg_dialog.setInformativeText(tr("Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues."));
+ msg_dialog.setInformativeText(tr("Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues."));
msg_dialog.exec();
return false;
}
compression_type = save_as_dlg.compressionType();
-#ifdef Q_OS_WIN
- // the Windows dialog does not fixup extensions, do it manually here.
- fileAddExtension(file_name, file_type, compression_type);
-#endif // Q_OS_WIN
-
//#ifndef _WIN32
// /* If the file exists and it's user-immutable or not writable,
// ask the user whether they want to override that. */
@@ -1502,7 +1527,7 @@ bool LograyMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_com
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(qUtf8Printable(file_name));
+ add_menu_recent_capture_file(qUtf8Printable(file_name), false);
return true;
case CF_WRITE_ERROR:
@@ -1523,7 +1548,7 @@ void LograyMainWindow::exportSelectedPackets() {
wtap_compression_type compression_type;
packet_range_t range;
cf_write_status_t status;
- gchar *dirname;
+ char *dirname;
bool discard_comments = false;
if (!capture_file_.capFile())
@@ -1531,8 +1556,8 @@ void LograyMainWindow::exportSelectedPackets() {
/* Init the packet range */
packet_range_init(&range, capture_file_.capFile());
- range.process_filtered = TRUE;
- range.include_dependents = TRUE;
+ range.process_filtered = true;
+ range.include_dependents = true;
QList<int> rows = packet_list_->selectedRows(true);
@@ -1552,7 +1577,7 @@ void LograyMainWindow::exportSelectedPackets() {
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1560,7 +1585,7 @@ void LograyMainWindow::exportSelectedPackets() {
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1588,7 +1613,7 @@ void LograyMainWindow::exportSelectedPackets() {
*/
if (files_identical(capture_file_.capFile()->filename, qUtf8Printable(file_name))) {
QMessageBox msg_box;
- gchar *display_basename = g_filename_display_basename(qUtf8Printable(file_name));
+ char *display_basename = g_filename_display_basename(qUtf8Printable(file_name));
msg_box.setIcon(QMessageBox::Critical);
msg_box.setText(QString(tr("Unable to export to \"%1\".").arg(display_basename)));
@@ -1607,15 +1632,11 @@ void LograyMainWindow::exportSelectedPackets() {
msg_box.setIcon(QMessageBox::Critical);
msg_box.setText(tr("Unknown file type returned by export dialog."));
- msg_box.setInformativeText(tr("Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues."));
+ msg_box.setInformativeText(tr("Please report this as a Logray issue at https://gitlab.com/wireshark/wireshark/-/issues."));
msg_box.exec();
goto cleanup;
}
compression_type = esp_dlg.compressionType();
-#ifdef Q_OS_WIN
- // the Windows dialog does not fixup extensions, do it manually here.
- fileAddExtension(file_name, file_type, compression_type);
-#endif // Q_OS_WIN
//#ifndef _WIN32
// /* If the file exists and it's user-immutable or not writable,
@@ -1644,7 +1665,7 @@ void LograyMainWindow::exportSelectedPackets() {
if (discard_comments)
packet_list_->redrawVisiblePackets();
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(qUtf8Printable(file_name));
+ add_menu_recent_capture_file(qUtf8Printable(file_name), false);
goto cleanup;
case CF_WRITE_ERROR:
@@ -1678,110 +1699,6 @@ void LograyMainWindow::exportDissections(export_type_e export_type) {
ed_dlg->show();
}
-#ifdef Q_OS_WIN
-/*
- * Ensure that:
- *
- * If the file is to be compressed:
- *
- * if there is a set of extensions used by the file type to be used,
- * the file name has one of those extensions followed by the extension
- * for the compression type to be used;
- *
- * otherwise, the file name has the extension for the compression type
- * to be used;
- *
- * otherwise:
- *
- * if there is a set of extensions used by the file type to be used,
- * the file name has one of those extensions.
- */
-void LograyMainWindow::fileAddExtension(QString &file_name, int file_type, wtap_compression_type compression_type) {
- QString file_name_lower;
- GSList *extensions_list;
- const char *compressed_file_extension;
- gboolean add_extension_for_file_type;
-
- /* Lower-case the file name, so the extension matching is case-insensitive. */
- file_name_lower = file_name.toLower();
-
- /* Get a list of all extensions used for this file type; don't
- include the ones with compression type extensions, as we
- only want to check for the extension for the compression
- type we'll be using. */
- extensions_list = wtap_get_file_extensions_list(file_type, FALSE);
-
- /* Get the extension for the compression type we'll be using;
- NULL is returned if the type isn't supported or compression
- is not being done. */
- compressed_file_extension = wtap_compression_type_extension(compression_type);
-
- if (extensions_list != NULL) {
- GSList *extension;
-
- /* This file type has one or more extensions.
- Start out assuming we need to add the default one. */
- add_extension_for_file_type = TRUE;
-
- /* OK, see if the file has one of those extensions, followed
- by the appropriate compression type extension if it's to be
- compressed. */
- for (extension = extensions_list; extension != NULL;
- extension = g_slist_next(extension)) {
- QString file_suffix = QString(".") + (char *)extension->data;
- if (compressed_file_extension != NULL)
- file_suffix += QString(".") + compressed_file_extension;
- if (file_name_lower.endsWith(file_suffix)) {
- /*
- * The file name has one of the extensions for this file
- * type, followed by a compression type extension if
- * appropriate, so we don't need to add an extension for
- * the file type or the compression type.
- */
- add_extension_for_file_type = FALSE;
- break;
- }
- }
- } else {
- /* We have no extensions for this file type. Just check
- to see if we need to add an extension for the compressed
- file type.
-
- Start out assuming we do. */
- add_extension_for_file_type = TRUE;
- if (compressed_file_extension != NULL) {
- QString file_suffix = QString(".") + compressed_file_extension;
- if (file_name_lower.endsWith(file_suffix)) {
- /*
- * The file name has the appropriate compressed file extension,
- * so we don't need to add an extension for the compression
- * type.
- */
- add_extension_for_file_type = FALSE;
- }
- }
- }
-
- /*
- * If we need to add an extension for the file type or compressed
- * file type, do so.
- */
- if (add_extension_for_file_type) {
- if (wtap_default_file_extension(file_type) != NULL) {
- /* This file type has a default extension; append it. */
- file_name += QString(".") + wtap_default_file_extension(file_type);
- }
- if (compression_type != WTAP_UNCOMPRESSED) {
- /*
- * The file is to be compressed, so append the extension for
- * its compression type.
- */
- file_name += QString(".") + compressed_file_extension;
- }
- }
-}
-#endif // Q_OS_WIN
-
bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContext context) {
bool capture_in_progress = false;
bool do_close_file = false;
@@ -1820,7 +1737,7 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
// We're being called from the software update window;
// don't spawn yet another dialog. Just try again later.
// XXX: The WinSparkle dialogs *aren't* modal, and a user
- // can bring Wireshark to the foreground, close/save the
+ // can bring Logray to the foreground, close/save the
// file, and then click "Install Update" again, but it
// seems like many users don't expect that (and also don't
// know that Help->Check for Updates... exist, only knowing
@@ -1854,7 +1771,7 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
}
} else {
// No capture in progress and not a tempfile, so this is not unsaved packets
- gchar *display_basename = g_filename_display_basename(capture_file_.capFile()->filename);
+ char *display_basename = g_filename_display_basename(capture_file_.capFile()->filename);
question = tr("Do you want to save the changes you've made to the capture file \"%1\"%2?").arg(display_basename, before_what);
infotext = tr("Your changes will be lost if you don't save them.");
g_free(display_basename);
@@ -1929,7 +1846,7 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
*/
QList<QAbstractButton *> buttons = msg_dialog.buttons();
for (int i = 0; i < buttons.size(); ++i) {
- QPushButton *button = static_cast<QPushButton *>(buttons.at(i));;
+ QPushButton *button = static_cast<QPushButton *>(buttons.at(i));
button->setAutoDefault(false);
}
@@ -1939,7 +1856,13 @@ bool LograyMainWindow::testCaptureFileClose(QString before_what, FileCloseContex
*/
discard_button->setFocus();
#endif
-
+ /*
+ * On Windows, if multiple Wireshark processes are open, another
+ * application has focus, and "Close all [Wireshark] windows" is
+ * chosen from the taskbar, we need to activate the window to
+ * at least flash the taskbar (#16309).
+ */
+ activateWindow();
msg_dialog.exec();
/* According to the Qt doc:
* when using QMessageBox with custom buttons, exec() function returns an opaque value.
@@ -2057,7 +1980,7 @@ void LograyMainWindow::findTextCodecs() {
// annoying to properly place IBM00858 and IBM00924 in the middle of
// code page numbers not zero padded to 5 digits.
// We could manipulate the key further to have more commonly used
- // charsets earlier. IANA MIB ordering would be unxpected:
+ // charsets earlier. IANA MIB ordering would be unexpected:
// https://www.iana.org/assignments/character-sets/character-sets.xml
// For data about use in HTTP (other protocols can be quite different):
// https://w3techs.com/technologies/overview/character_encoding
@@ -2090,11 +2013,10 @@ void LograyMainWindow::initMainToolbarIcons()
main_ui_->actionCaptureRestart->setIcon(StockIcon("x-capture-restart-circle"));
main_ui_->actionCaptureOptions->setIcon(StockIcon("x-capture-options"));
- // Menu icons are disabled in main_window.ui for these items.
+ // Menu icons are disabled in logray_main_window.ui for these File-> items.
main_ui_->actionFileOpen->setIcon(StockIcon("document-open"));
main_ui_->actionFileSave->setIcon(StockIcon("x-capture-file-save"));
main_ui_->actionFileClose->setIcon(StockIcon("x-capture-file-close"));
- main_ui_->actionViewReload->setIcon(StockIcon("x-capture-file-reload"));
main_ui_->actionEditFindPacket->setIcon(StockIcon("edit-find"));
main_ui_->actionGoPreviousPacket->setIcon(StockIcon("go-previous"));
@@ -2121,6 +2043,8 @@ void LograyMainWindow::initMainToolbarIcons()
main_ui_->actionViewZoomOut->setIcon(StockIcon("zoom-out"));
main_ui_->actionViewNormalSize->setIcon(StockIcon("zoom-original"));
main_ui_->actionViewResizeColumns->setIcon(StockIcon("x-resize-columns"));
+ main_ui_->actionViewResetLayout->setIcon(StockIcon("x-reset-layout_2"));
+ main_ui_->actionViewReload->setIcon(StockIcon("x-capture-file-reload"));
main_ui_->actionNewDisplayFilterExpression->setIcon(StockIcon("list-add"));
}
@@ -2141,7 +2065,6 @@ void LograyMainWindow::initShowHideMainWidgets()
shmw_actions[main_ui_->actionViewPacketList] = packet_list_;
shmw_actions[main_ui_->actionViewPacketDetails] = proto_tree_;
shmw_actions[main_ui_->actionViewPacketBytes] = byte_view_tab_;
- shmw_actions[main_ui_->actionViewPacketDiagram] = packet_diagram_;
foreach(QAction *shmwa, shmw_actions.keys()) {
shmwa->setData(QVariant::fromValue(shmw_actions[shmwa]));
@@ -2154,7 +2077,7 @@ void LograyMainWindow::initShowHideMainWidgets()
/* Initially hide the additional toolbars menus */
main_ui_->menuAdditionalToolbars->menuAction()->setVisible(false);
- connect(show_hide_actions_, SIGNAL(triggered(QAction*)), this, SLOT(showHideMainWidgets(QAction*)));
+ connect(show_hide_actions_, &QActionGroup::triggered, this, &LograyMainWindow::showHideMainWidgets);
}
void LograyMainWindow::initTimeDisplayFormatMenu()
@@ -2181,7 +2104,7 @@ void LograyMainWindow::initTimeDisplayFormatMenu()
time_display_actions_->addAction(tda);
}
- connect(time_display_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setTimestampFormat(QAction*)));
+ connect(time_display_actions_, &QActionGroup::triggered, this, &LograyMainWindow::setTimestampFormat);
}
void LograyMainWindow::initTimePrecisionFormatMenu()
@@ -2209,7 +2132,7 @@ void LograyMainWindow::initTimePrecisionFormatMenu()
time_precision_actions_->addAction(tpa);
}
- connect(time_precision_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setTimestampPrecision(QAction*)));
+ connect(time_precision_actions_, &QActionGroup::triggered, this, &LograyMainWindow::setTimestampPrecision);
}
// Menu items which will be disabled when we freeze() and whose state will
@@ -2219,10 +2142,10 @@ void LograyMainWindow::initFreezeActions()
QList<QAction *> freeze_actions = QList<QAction *>()
<< main_ui_->actionFileClose
<< main_ui_->actionViewReload
- << main_ui_->actionEditMarkPacket
+ << main_ui_->actionEditMarkSelected
<< main_ui_->actionEditMarkAllDisplayed
<< main_ui_->actionEditUnmarkAllDisplayed
- << main_ui_->actionEditIgnorePacket
+ << main_ui_->actionEditIgnoreSelected
<< main_ui_->actionEditIgnoreAllDisplayed
<< main_ui_->actionEditUnignoreAllDisplayed
<< main_ui_->actionEditSetTimeReference
@@ -2250,8 +2173,8 @@ void LograyMainWindow::initConversationMenus()
ConversationAction *conv_action = new ConversationAction(main_ui_->menuConversationFilter, conv_filter);
main_ui_->menuConversationFilter->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(applyConversationFilter()), Qt::QueuedConnection);
+ connect(this, &LograyMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &LograyMainWindow::applyConversationFilter, Qt::QueuedConnection);
// Packet list context menu items
packet_list_->conversationMenu()->addAction(conv_action);
@@ -2265,15 +2188,15 @@ void LograyMainWindow::initConversationMenus()
conv_action->setIcon(cc_action->icon());
conv_action->setColorNumber(i++);
submenu->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
}
conv_action = new ConversationAction(submenu, conv_filter);
conv_action->setText(main_ui_->actionViewColorizeNewColoringRule->text());
submenu->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
// Proto tree conversation menu is filled in in ProtoTree::contextMenuEvent.
// We should probably do that here.
@@ -2288,65 +2211,92 @@ void LograyMainWindow::initConversationMenus()
colorize_action->setIcon(cc_action->icon());
colorize_action->setColorNumber(i++);
proto_tree_->colorizeMenu()->addAction(colorize_action);
- connect(this, SIGNAL(fieldFilterChanged(QByteArray)), colorize_action, SLOT(setFieldFilter(QByteArray)));
- connect(colorize_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::fieldFilterChanged, colorize_action, &ColorizeAction::setFieldFilter);
+ connect(colorize_action, &ColorizeAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
}
colorize_action = new ColorizeAction(proto_tree_->colorizeMenu());
colorize_action->setText(main_ui_->actionViewColorizeNewColoringRule->text());
proto_tree_->colorizeMenu()->addAction(colorize_action);
- connect(this, SIGNAL(fieldFilterChanged(QByteArray)), colorize_action, SLOT(setFieldFilter(QByteArray)));
- connect(colorize_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &LograyMainWindow::fieldFilterChanged, colorize_action, &ColorizeAction::setFieldFilter);
+ connect(colorize_action, &ColorizeAction::triggered, this, &LograyMainWindow::colorizeActionTriggered);
}
-bool LograyMainWindow::addExportObjectsMenuItem(const void *, void *value, void *userdata)
+bool LograyMainWindow::addFollowStreamMenuItem(const void *key _U_, void *value, void *userdata)
{
- register_eo_t *eo = (register_eo_t*)value;
+ register_follow_t *follow = (register_follow_t*)value;
LograyMainWindow *window = (LograyMainWindow*)userdata;
- ExportObjectAction *export_action = new ExportObjectAction(window->main_ui_->menuFileExportObjects, eo);
- window->main_ui_->menuFileExportObjects->addAction(export_action);
+ FollowStreamAction *follow_action = new FollowStreamAction(window->main_ui_->menuFollow, follow);
+ window->main_ui_->menuFollow->addAction(follow_action);
- //initially disable until a file is loaded (then file signals will take over)
- export_action->setEnabled(false);
+ follow_action->setEnabled(false);
- connect(&window->capture_file_, SIGNAL(captureEvent(CaptureEvent)), export_action, SLOT(captureFileEvent(CaptureEvent)));
- connect(export_action, SIGNAL(triggered()), window, SLOT(applyExportObject()));
- return FALSE;
+ /* Special features for some of the built in follow types, like
+ * shortcuts and overriding the name. XXX: Should these go in
+ * FollowStreamAction, or should some of these (e.g. TCP and UDP)
+ * be registered in initFollowStreamMenus so that they can be
+ * on the top of the menu list too?
+ */
+ // XXX - Should we add matches for syscall properties, e.g. file descriptors?
+ const char *short_name = (const char*)key;
+ if (g_strcmp0(short_name, "Falco Bridge") == 0) {
+ follow_action->setText(tr("File Descriptor Stream"));
+ }
+ // if (g_strcmp0(short_name, "TCP") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_T);
+ // } else if (g_strcmp0(short_name, "UDP") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_U);
+ // } else if (g_strcmp0(short_name, "DCCP") == 0) {
+ // /* XXX: Not sure this one is widely enough used to need a shortcut. */
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_E);
+ // } else if (g_strcmp0(short_name, "TLS") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_S);
+ // } else if (g_strcmp0(short_name, "HTTP") == 0) {
+ // follow_action->setShortcut(Qt::CTRL | Qt::ALT | Qt::SHIFT | Qt::Key_H);
+ // } else if (g_strcmp0(short_name, "HTTP2") == 0) {
+ // follow_action->setText(tr("HTTP/2 Stream"));
+ // } else if (g_strcmp0(short_name, "SIP") == 0) {
+ // follow_action->setText(tr("SIP Call"));
+ // } else if (g_strcmp0(short_name, "USBCOM") == 0) {
+ // follow_action->setText(tr("USB CDC Data"));
+ // }
+
+ connect(follow_action, &QAction::triggered, window,
+ [window, follow]() { window->openFollowStreamDialog(get_follow_proto_id(follow)); },
+ Qt::QueuedConnection);
+ return false;
}
-void LograyMainWindow::initExportObjectsMenus()
+void LograyMainWindow::initFollowStreamMenus()
{
- eo_iterate_tables(addExportObjectsMenuItem, this);
+ /* This puts them all in the menus in alphabetical order. */
+ follow_iterate_followers(addFollowStreamMenuItem, this);
}
// Titlebar
void LograyMainWindow::setTitlebarForCaptureFile()
{
- if (capture_file_.capFile() && capture_file_.capFile()->filename) {
- setWSWindowTitle(QString("[*]%1").arg(capture_file_.fileDisplayName()));
- //
- // XXX - on non-Mac platforms, put in the application
- // name? Or do so only for temporary files?
- //
- if (!capture_file_.capFile()->is_tempfile) {
- //
- // Set the file path; that way, for macOS, it'll set the
- // "proxy icon".
- //
- setWindowFilePath(capture_file_.filePath());
- }
- setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
- } else {
- /* We have no capture file. */
- setWSWindowTitle();
- }
+ use_capturing_title_ = false;
+ updateTitlebar();
}
QString LograyMainWindow::replaceWindowTitleVariables(QString title)
{
title.replace("%P", get_profile_name());
- title.replace("%V", get_ws_vcs_version_info());
+ title.replace("%V", get_lr_vcs_version_info());
+
+#ifdef HAVE_LIBPCAP
+ if (global_commandline_info.capture_comments) {
+ // Use the first capture comment from command line.
+ title.replace("%C", (char *)g_ptr_array_index(global_commandline_info.capture_comments, 0));
+ } else {
+ // No capture comment.
+ title.remove("%C");
+ }
+#else
+ title.remove("%C");
+#endif
if (title.contains("%F")) {
// %F is file path of the capture file.
@@ -2389,7 +2339,7 @@ QString LograyMainWindow::replaceWindowTitleVariables(QString title)
void LograyMainWindow::setWSWindowTitle(QString title)
{
if (title.isEmpty()) {
- title = tr("The Logray System Log Analyzer");
+ title = tr("The Logray System Call and Log Analyzer");
}
if (prefs.gui_prepend_window_title && prefs.gui_prepend_window_title[0]) {
@@ -2417,10 +2367,30 @@ void LograyMainWindow::setWSWindowTitle(QString title)
void LograyMainWindow::setTitlebarForCaptureInProgress()
{
- if (capture_file_.capFile()) {
+ use_capturing_title_ = true;
+ updateTitlebar();
+}
+
+void LograyMainWindow::updateTitlebar()
+{
+ if (use_capturing_title_ && capture_file_.capFile()) {
setWSWindowTitle(tr("Capturing from %1").arg(cf_get_tempfile_source(capture_file_.capFile())));
+ } else if (capture_file_.capFile() && capture_file_.capFile()->filename) {
+ setWSWindowTitle(QString("[*]%1").arg(capture_file_.fileDisplayName()));
+ //
+ // XXX - on non-Mac platforms, put in the application
+ // name? Or do so only for temporary files?
+ //
+ if (!capture_file_.capFile()->is_tempfile) {
+ //
+ // Set the file path; that way, for macOS, it'll set the
+ // "proxy icon".
+ //
+ setWindowFilePath(capture_file_.filePath());
+ }
+ setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
} else {
- /* We have no capture in progress. */
+ /* We have no capture file. */
setWSWindowTitle();
}
}
@@ -2466,12 +2436,6 @@ void LograyMainWindow::setMenusForCaptureFile(bool force_disable)
main_ui_->actionFileExportAsPSML->setEnabled(enable);
main_ui_->actionFileExportAsJSON->setEnabled(enable);
- main_ui_->actionFileExportPDU->setEnabled(enable);
-
- foreach(QAction *eo_action, main_ui_->menuFileExportObjects->actions()) {
- eo_action->setEnabled(enable);
- }
-
main_ui_->actionViewReload->setEnabled(enable);
#ifdef HAVE_SOFTWARE_UPDATE
@@ -2494,12 +2458,6 @@ void LograyMainWindow::setMenusForCaptureInProgress(bool capture_in_progress) {
main_ui_->actionFileExportAsPSML->setEnabled(capture_in_progress);
main_ui_->actionFileExportAsJSON->setEnabled(capture_in_progress);
- main_ui_->actionFileExportPDU->setEnabled(!capture_in_progress);
-
- foreach(QAction *eo_action, main_ui_->menuFileExportObjects->actions()) {
- eo_action->setEnabled(capture_in_progress);
- }
-
main_ui_->menuFileSet->setEnabled(!capture_in_progress);
main_ui_->actionFileQuit->setEnabled(true);
#ifdef HAVE_SOFTWARE_UPDATE
@@ -2585,7 +2543,7 @@ void LograyMainWindow::setWindowIcon(const QIcon &icon) {
}
void LograyMainWindow::updateForUnsavedChanges() {
- setTitlebarForCaptureFile();
+ updateTitlebar();
setMenusForCaptureFile();
}
@@ -2599,6 +2557,7 @@ void LograyMainWindow::changeEvent(QEvent* event)
main_ui_->retranslateUi(this);
// make sure that the "Clear Menu" item is retranslated
mainApp->emitAppSignal(WiresharkApplication::RecentCapturesChanged);
+ updateTitlebar();
break;
case QEvent::LocaleChange: {
QString locale = QLocale::system().name();
@@ -2649,28 +2608,29 @@ void LograyMainWindow::addMenuActions(QList<QAction *> &actions, int menu_group)
main_ui_->actionStatistics_REGISTER_STAT_GROUP_UNSORTED,
action);
break;
-// case REGISTER_TOOLS_GROUP_UNSORTED:
-// {
-// // Allow the creation of submenus. Mimics the behavor of
-// // ui/gtk/main_menubar.c:add_menu_item_to_main_menubar
-// // and GtkUIManager.
-// //
-// // For now we limit the insanity to the "Tools" menu.
-// QStringList menu_path = action->text().split('/');
-// QMenu *cur_menu = main_ui_->menuTools;
-// while (menu_path.length() > 1) {
-// QString menu_title = menu_path.takeFirst();
-// QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
-// if (!submenu) {
-// submenu = cur_menu->addMenu(menu_title);
-// submenu->setObjectName(menu_title.toLower());
-// }
-// cur_menu = submenu;
-// }
-// action->setText(menu_path.last());
-// cur_menu->addAction(action);
-// break;
-// }
+ case REGISTER_TOOLS_GROUP_UNSORTED:
+ {
+ main_ui_->menuTools->show(); // Remove this if we ever add any built-in tools.
+ // Allow the creation of submenus. Mimics the behaviour of
+ // ui/gtk/main_menubar.c:add_menu_item_to_main_menubar
+ // and GtkUIManager.
+ //
+ // For now we limit the insanity to the "Tools" menu.
+ QStringList menu_path = action->text().split('/');
+ QMenu *cur_menu = main_ui_->menuTools;
+ while (menu_path.length() > 1) {
+ QString menu_title = menu_path.takeFirst();
+ QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
+ if (!submenu) {
+ submenu = cur_menu->addMenu(menu_title);
+ submenu->setObjectName(menu_title.toLower());
+ }
+ cur_menu = submenu;
+ }
+ action->setText(menu_path.last());
+ cur_menu->addAction(action);
+ break;
+ }
default:
// Skip packet items.
return;
@@ -2680,9 +2640,9 @@ void LograyMainWindow::addMenuActions(QList<QAction *> &actions, int menu_group)
// distinguish various types of actions. Setting their objectName
// seems to work OK.
if (action->objectName() == TapParameterDialog::actionName()) {
- connect(action, SIGNAL(triggered(bool)), this, SLOT(openTapParameterDialog()));
+ connect(action, &QAction::triggered, this, [=]() { openTapParameterDialog(); });
} else if (action->objectName() == FunnelStatistics::actionName()) {
- connect(action, SIGNAL(triggered(bool)), funnel_statistics_, SLOT(funnelActionTriggered()));
+ connect(action, &QAction::triggered, funnel_statistics_, &FunnelStatistics::funnelActionTriggered);
}
}
}
@@ -2695,20 +2655,26 @@ void LograyMainWindow::removeMenuActions(QList<QAction *> &actions, int menu_gro
case REGISTER_LOG_STAT_GROUP_UNSORTED:
main_ui_->menuStatistics->removeAction(action);
break;
-// case REGISTER_TOOLS_GROUP_UNSORTED:
-// {
-// // Allow removal of submenus.
-// // For now we limit the insanity to the "Tools" menu.
-// QStringList menu_path = action->text().split('/');
-// QMenu *cur_menu = main_ui_->menuTools;
-// while (menu_path.length() > 1) {
-// QString menu_title = menu_path.takeFirst();
-// QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
-// cur_menu = submenu;
-// }
-// cur_menu->removeAction(action);
-// break;
-// }
+ case REGISTER_TOOLS_GROUP_UNSORTED:
+ {
+ // Allow removal of submenus.
+ // For now we limit the insanity to the "Tools" menu.
+ QStringList menu_path = action->text().split('/');
+ QMenu *cur_menu = main_ui_->menuTools;
+ while (menu_path.length() > 1) {
+ QString menu_title = menu_path.takeFirst();
+ QMenu *submenu = cur_menu->findChild<QMenu *>(menu_title.toLower(), Qt::FindDirectChildrenOnly);
+ cur_menu = submenu;
+ }
+ cur_menu->removeAction(action);
+ // Remove empty submenus.
+ while (cur_menu != main_ui_->menuTools) {
+ QMenu *empty_menu = (cur_menu->isEmpty() ? cur_menu : NULL);
+ cur_menu = dynamic_cast<QMenu *>(cur_menu->parent());
+ delete empty_menu;
+ }
+ break;
+ }
default:
// qDebug() << "FIX: Remove" << action->text() << "from the menu";
break;
@@ -2739,7 +2705,7 @@ void LograyMainWindow::reloadDynamicMenus()
mainApp->clearRemovedMenuGroupItems();
}
-void LograyMainWindow::externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth)
+void LograyMainWindow::externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, int depth)
{
QAction * itemAction = Q_NULLPTR;
ext_menubar_t * item = Q_NULLPTR;
diff --git a/ui/logray/logray_main_window.h b/ui/logray/logray_main_window.h
index 328cf0f8..5b84084d 100644
--- a/ui/logray/logray_main_window.h
+++ b/ui/logray/logray_main_window.h
@@ -40,8 +40,6 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include "ui/ws_ui_util.h"
@@ -81,7 +79,6 @@ class FilterDialog;
class FunnelStatistics;
class WelcomePage;
class PacketCommentDialog;
-class PacketDiagram;
class PacketList;
class ProtoTree;
class FilterExpressionToolBar;
@@ -117,7 +114,7 @@ public:
void removeAdditionalToolbar(QString toolbarName);
void addInterfaceToolbar(const iface_toolbar *toolbar_entry);
- void removeInterfaceToolbar(const gchar *menu_title);
+ void removeInterfaceToolbar(const char *menu_title);
QString getMwFileName();
void setMwFileName(QString fileName);
@@ -172,6 +169,7 @@ private:
bool capture_stopping_;
bool capture_filter_valid_;
+ bool use_capturing_title_;
#ifdef HAVE_LIBPCAP
capture_session cap_session_;
CaptureOptionsDialog *capture_options_dialog_;
@@ -220,11 +218,12 @@ private:
void setMenusForFileSet(bool enable_list_files);
void setWindowIcon(const QIcon &icon);
QString replaceWindowTitleVariables(QString title);
+ void updateStyleSheet();
- void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth);
+ void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, int depth);
void setForCaptureInProgress(bool capture_in_progress = false, bool handle_toolbars = false, GArray *ifaces = NULL);
- QMenu* findOrAddMenu(QMenu *parent_menu, QString& menu_text);
+ QMenu* findOrAddMenu(QMenu *parent_menu, const QStringList& menu_parts);
void captureFileReadStarted(const QString &action);
@@ -255,11 +254,11 @@ public slots:
* @param cf_path Path to the file.
* @param display_filter Display filter to apply. May be empty.
* @param type File type.
- * @param is_tempfile TRUE/FALSE.
+ * @param is_tempfile true/false.
* @return True on success, false on failure.
*/
// XXX We might want to return a cf_read_status_t or a CaptureFile.
- bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, gboolean is_tempfile = FALSE);
+ bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, bool is_tempfile = false);
bool openCaptureFile(QString cf_path = QString(), QString display_filter = QString()) { return openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO); }
void filterPackets(QString new_filter = QString(), bool force = false);
void updateForUnsavedChanges();
@@ -293,8 +292,8 @@ private slots:
void initViewColorizeMenu();
void initConversationMenus();
- static bool addExportObjectsMenuItem(const void *key, void *value, void *userdata);
- void initExportObjectsMenus();
+ static bool addFollowStreamMenuItem(const void *key, void *value, void *userdata);
+ void initFollowStreamMenus();
// in main_window_slots.cpp
/**
@@ -304,6 +303,7 @@ private slots:
*/
void startCapture(QStringList);
void startCapture();
+ void pushLiveCaptureInProgress();
void popLiveCaptureInProgress();
void stopCapture();
@@ -335,6 +335,7 @@ private slots:
void addPluginIFStructures();
QMenu * searchSubMenu(QString objectName);
void activatePluginIFToolbar(bool);
+ void updateTitlebar();
void startInterfaceCapture(bool valid, const QString capture_filter);
@@ -382,8 +383,6 @@ private slots:
// gtk/main_menubar.c
void connectFileMenuActions();
- void exportPacketBytes();
- void exportPDU();
void printFile();
void connectEditMenuActions();
@@ -393,7 +392,7 @@ private slots:
void editConfigurationProfiles();
void editTimeShiftFinished(int);
void addPacketCommentFinished(PacketCommentDialog* pc_dialog, int result);
- void editPacketCommentFinished(PacketCommentDialog* pc_dialog, int result, guint nComment);
+ void editPacketCommentFinished(PacketCommentDialog* pc_dialog, int result, unsigned nComment);
void deleteAllPacketComments();
void deleteAllPacketCommentsFinished(int result);
void showPreferencesDialog(QString module_name);
@@ -429,10 +428,14 @@ private slots:
void filterMenuAboutToShow();
void applyConversationFilter();
- void applyExportObject();
+
+ void openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num, bool use_stream_index = true);
+ void openFollowStreamDialog(int proto_id);
void statCommandExpertInfo(const char *, void *);
+ void connectToolsMenuActions();
+
void connectHelpMenuActions();
#ifdef HAVE_SOFTWARE_UPDATE
@@ -449,8 +452,9 @@ private slots:
void showConversationsDialog();
void showEndpointsDialog();
- void openStatisticsTreeDialog(const gchar *abbr);
+ void openStatisticsTreeDialog(const char *abbr);
void statCommandIOGraph(const char *, void *);
+ void showIOGraphDialog(io_graph_item_unit_t, QString);
void externalMenuItemTriggered();
diff --git a/ui/logray/logray_main_window.ui b/ui/logray/logray_main_window.ui
index bf2f9bc6..15ed7a8b 100644
--- a/ui/logray/logray_main_window.ui
+++ b/ui/logray/logray_main_window.ui
@@ -14,7 +14,7 @@
<bool>true</bool>
</property>
<property name="windowTitle">
- <string>Wireshark</string>
+ <string>Logray</string>
</property>
<property name="unifiedTitleAndToolBarOnMac">
<bool>true</bool>
@@ -67,7 +67,7 @@
<item>
<widget class="QLabel" name="goToPacketLabel">
<property name="text">
- <string>Packet:</string>
+ <string>Event:</string>
</property>
</widget>
</item>
@@ -84,7 +84,7 @@
</size>
</property>
<property name="text">
- <string>Go to packet</string>
+ <string>Go to event</string>
</property>
<property name="default">
<bool>true</bool>
@@ -161,7 +161,7 @@
</widget>
<widget class="QMenu" name="menuFileExportPacketDissections">
<property name="title">
- <string>Export Packet Dissections</string>
+ <string>Export Event Dissections</string>
</property>
<addaction name="actionFileExportAsPlainText"/>
<addaction name="actionFileExportAsCSV"/>
@@ -171,11 +171,6 @@
<addaction name="actionFileExportAsPDML"/>
<addaction name="actionFileExportAsJSON"/>
</widget>
- <widget class="QMenu" name="menuFileExportObjects">
- <property name="title">
- <string>Export Objects</string>
- </property>
- </widget>
<addaction name="actionFileOpen"/>
<addaction name="menuOpenRecentCaptureFile"/>
<addaction name="actionFileMerge"/>
@@ -189,9 +184,6 @@
<addaction name="separator"/>
<addaction name="actionFileExportPackets"/>
<addaction name="menuFileExportPacketDissections"/>
- <addaction name="actionFileExportPacketBytes"/>
- <addaction name="actionFileExportPDU"/>
- <addaction name="menuFileExportObjects"/>
<addaction name="separator"/>
<addaction name="actionFilePrint"/>
<addaction name="separator"/>
@@ -364,7 +356,6 @@
<addaction name="actionViewPacketList"/>
<addaction name="actionViewPacketDetails"/>
<addaction name="actionViewPacketBytes"/>
- <addaction name="actionViewPacketDiagram"/>
<addaction name="separator"/>
<addaction name="menuTime_Display_Format"/>
<addaction name="menuName_Resolution"/>
@@ -403,6 +394,11 @@
<string>Prepare as Filter</string>
</property>
</widget>
+ <widget class="QMenu" name="menuFollow">
+ <property name="title">
+ <string>Follow</string>
+ </property>
+ </widget>
<widget class="QMenu" name="menuConversationFilter">
<property name="title">
<string>Conversation Filter</string>
@@ -418,9 +414,10 @@
<addaction name="menuConversationFilter"/>
<addaction name="separator"/>
<addaction name="actionAnalyzeEnabledProtocols"/>
- <addaction name="actionAnalyzeDecodeAs"/>
<addaction name="actionAnalyzeReloadLuaPlugins"/>
<addaction name="separator"/>
+ <addaction name="menuFollow"/>
+ <addaction name="separator"/>
<addaction name="actionAnalyzeShowPacketBytes"/>
<addaction name="actionAnalyzeExpertInfo"/>
</widget>
@@ -464,7 +461,7 @@
</widget>
<widget class="QMenu" name="menuPacketComment">
<property name="title">
- <string>Packet Comments</string>
+ <string>Event Comments</string>
</property>
</widget>
<addaction name="menuEditCopy"/>
@@ -472,13 +469,13 @@
<addaction name="actionEditFindNext"/>
<addaction name="actionEditFindPrevious"/>
<addaction name="separator"/>
- <addaction name="actionEditMarkPacket"/>
+ <addaction name="actionEditMarkSelected"/>
<addaction name="actionEditMarkAllDisplayed"/>
<addaction name="actionEditUnmarkAllDisplayed"/>
<addaction name="actionEditNextMark"/>
<addaction name="actionEditPreviousMark"/>
<addaction name="separator"/>
- <addaction name="actionEditIgnorePacket"/>
+ <addaction name="actionEditIgnoreSelected"/>
<addaction name="actionEditIgnoreAllDisplayed"/>
<addaction name="actionEditUnignoreAllDisplayed"/>
<addaction name="separator"/>
@@ -562,6 +559,7 @@
<addaction name="actionViewZoomOut"/>
<addaction name="actionViewNormalSize"/>
<addaction name="actionViewResizeColumns"/>
+ <addaction name="actionViewResetLayout"/>
</widget>
<widget class="MainStatusBar" name="statusBar"/>
<widget class="QToolBar" name="displayFilterToolBar">
@@ -604,7 +602,7 @@
<string>&amp;Quit</string>
</property>
<property name="toolTip">
- <string>Quit Wireshark</string>
+ <string>Quit Logray</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Q</string>
@@ -621,7 +619,7 @@
<string>&amp;Start</string>
</property>
<property name="toolTip">
- <string>Start capturing packets</string>
+ <string>Start capturing events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+E</string>
@@ -632,7 +630,7 @@
<string>S&amp;top</string>
</property>
<property name="toolTip">
- <string>Stop capturing packets</string>
+ <string>Stop capturing events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+E</string>
@@ -662,17 +660,15 @@
</action>
<action name="actionHelpContents">
<property name="text">
- <string>&amp;Contents</string>
+ <string>&amp;User's Guide</string>
</property>
+ <!-- This tooltip is replaced with the URL -->
<property name="toolTip">
- <string>Help contents</string>
+ <string>Wireshark User's Guide</string>
</property>
<property name="shortcut">
<string notr="true">F1</string>
</property>
- <property name="iconVisibleInMenu">
- <bool>true</bool>
- </property>
</action>
<action name="actionHelpMPWireshark">
<property name="text">
@@ -681,7 +677,7 @@
</action>
<action name="actionHelpMPWireshark_Filter">
<property name="text">
- <string>Wireshark Filter</string>
+ <string>Display Filters</string>
</property>
</action>
<action name="actionHelpMPTShark">
@@ -752,7 +748,7 @@
</action>
<action name="actionHelpAbout">
<property name="text">
- <string>&amp;About Wireshark</string>
+ <string>&amp;About Logray</string>
</property>
<property name="menuRole">
<enum>QAction::AboutRole</enum>
@@ -772,10 +768,10 @@
</action>
<action name="actionGoNextPacket">
<property name="text">
- <string>Next Packet</string>
+ <string>Next Event</string>
</property>
<property name="toolTip">
- <string>Go to the next packet</string>
+ <string>Go to the next event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Down</string>
@@ -783,10 +779,10 @@
</action>
<action name="actionGoPreviousPacket">
<property name="text">
- <string>Previous Packet</string>
+ <string>Previous Event</string>
</property>
<property name="toolTip">
- <string>Go to the previous packet</string>
+ <string>Go to the previous event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Up</string>
@@ -794,10 +790,10 @@
</action>
<action name="actionGoNextConversationPacket">
<property name="text">
- <string>Next Packet in Conversation</string>
+ <string>Next Event in Conversation</string>
</property>
<property name="toolTip">
- <string>Go to the next packet in this conversation</string>
+ <string>Go to the next event in this conversation</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+.</string>
@@ -805,10 +801,10 @@
</action>
<action name="actionGoPreviousConversationPacket">
<property name="text">
- <string>Previous Packet in Conversation</string>
+ <string>Previous Event in Conversation</string>
</property>
<property name="toolTip">
- <string>Go to the previous packet in this conversation</string>
+ <string>Go to the previous event in this conversation</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+,</string>
@@ -816,10 +812,10 @@
</action>
<action name="actionGoNextHistoryPacket">
<property name="text">
- <string>Next Packet In History</string>
+ <string>Next Event In History</string>
</property>
<property name="toolTip">
- <string>Go to the next packet in your selection history</string>
+ <string>Go to the next event in your selection history</string>
</property>
<property name="shortcut">
<string notr="true">Alt+Right</string>
@@ -827,10 +823,10 @@
</action>
<action name="actionGoPreviousHistoryPacket">
<property name="text">
- <string>Previous Packet In History</string>
+ <string>Previous Event In History</string>
</property>
<property name="toolTip">
- <string>Go to the previous packet in your selection history</string>
+ <string>Go to the previous event in your selection history</string>
</property>
<property name="shortcut">
<string notr="true">Alt+Left</string>
@@ -838,10 +834,10 @@
</action>
<action name="actionGoFirstPacket">
<property name="text">
- <string>First Packet</string>
+ <string>First Event</string>
</property>
<property name="toolTip">
- <string>Go to the first packet</string>
+ <string>Go to the first event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Home</string>
@@ -849,10 +845,10 @@
</action>
<action name="actionGoLastPacket">
<property name="text">
- <string>Last Packet</string>
+ <string>Last Event</string>
</property>
<property name="toolTip">
- <string>Go to the last packet</string>
+ <string>Go to the last event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+End</string>
@@ -866,7 +862,7 @@
<string>E&amp;xpand Subtrees</string>
</property>
<property name="toolTip">
- <string>Expand the current packet detail</string>
+ <string>Expand the current event detail</string>
</property>
<property name="shortcut">
<string notr="true">Shift+Right</string>
@@ -880,7 +876,7 @@
<string>Collapse Subtrees</string>
</property>
<property name="toolTip">
- <string>Collapse the current packet detail</string>
+ <string>Collapse the current event detail</string>
</property>
<property name="shortcut">
<string notr="true">Shift+Left</string>
@@ -891,7 +887,7 @@
<string>&amp;Expand All</string>
</property>
<property name="toolTip">
- <string>Expand packet details</string>
+ <string>Expand event details</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Right</string>
@@ -902,7 +898,7 @@
<string>Collapse &amp;All</string>
</property>
<property name="toolTip">
- <string>Collapse all packet details</string>
+ <string>Collapse all event details</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Left</string>
@@ -913,10 +909,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Go to Packet…</string>
+ <string>Go to Event…</string>
</property>
<property name="toolTip">
- <string>Go to specified packet</string>
+ <string>Go to specified event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+G</string>
@@ -965,18 +961,10 @@
</action>
<action name="actionFileExportPackets">
<property name="text">
- <string>Export Specified Packets…</string>
+ <string>Export Specified Events…</string>
</property>
<property name="toolTip">
- <string>Export specified packets</string>
- </property>
- </action>
- <action name="actionFileExportPacketBytes">
- <property name="text">
- <string>Export Packet &amp;Bytes…</string>
- </property>
- <property name="shortcut">
- <string notr="true">Ctrl+Shift+X</string>
+ <string>Export specified events</string>
</property>
</action>
<action name="actionFilePrint">
@@ -1188,7 +1176,7 @@
<string>Apply as Column</string>
</property>
<property name="toolTip">
- <string>Create a packet list column from the selected field.</string>
+ <string>Create an event list column from the selected field.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+I</string>
@@ -1196,10 +1184,10 @@
</action>
<action name="actionEditFindPacket">
<property name="text">
- <string>&amp;Find Packet…</string>
+ <string>&amp;Find Event…</string>
</property>
<property name="toolTip">
- <string>Find a packet</string>
+ <string>Find an event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+F</string>
@@ -1210,7 +1198,7 @@
<string>Find Ne&amp;xt</string>
</property>
<property name="toolTip">
- <string>Find the next packet</string>
+ <string>Find the next event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+N</string>
@@ -1221,18 +1209,18 @@
<string>Find Pre&amp;vious</string>
</property>
<property name="toolTip">
- <string>Find the previous packet</string>
+ <string>Find the previous event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+B</string>
</property>
</action>
- <action name="actionEditMarkPacket">
+ <action name="actionEditMarkSelected">
<property name="text">
- <string>&amp;Mark/Unmark Packet(s)</string>
+ <string>&amp;Mark/Unmark Selected</string>
</property>
<property name="toolTip">
- <string>Mark or unmark each selected packet</string>
+ <string>Mark or unmark each selected event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+M</string>
@@ -1243,7 +1231,7 @@
<string>Mark All Displayed</string>
</property>
<property name="toolTip">
- <string>Mark all displayed packets</string>
+ <string>Mark all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+M</string>
@@ -1254,7 +1242,7 @@
<string>&amp;Unmark All Displayed</string>
</property>
<property name="toolTip">
- <string>Unmark all displayed packets</string>
+ <string>Unmark all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+M</string>
@@ -1265,7 +1253,7 @@
<string>Next Mark</string>
</property>
<property name="toolTip">
- <string>Go to the next marked packet</string>
+ <string>Go to the next marked event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+N</string>
@@ -1276,18 +1264,18 @@
<string>Previous Mark</string>
</property>
<property name="toolTip">
- <string>Go to the previous marked packet</string>
+ <string>Go to the previous marked event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+B</string>
</property>
</action>
- <action name="actionEditIgnorePacket">
+ <action name="actionEditIgnoreSelected">
<property name="text">
- <string>&amp;Ignore/Unignore Packet(s)</string>
+ <string>&amp;Ignore/Unignore Selected</string>
</property>
<property name="toolTip">
- <string>Ignore or unignore each selected packet</string>
+ <string>Ignore or unignore each selected event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+D</string>
@@ -1298,7 +1286,7 @@
<string>Ignore All Displayed</string>
</property>
<property name="toolTip">
- <string>Ignore all displayed packets</string>
+ <string>Ignore all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+D</string>
@@ -1309,7 +1297,7 @@
<string>U&amp;nignore All Displayed</string>
</property>
<property name="toolTip">
- <string>Unignore all displayed packets</string>
+ <string>Unignore all displayed events</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+D</string>
@@ -1320,7 +1308,7 @@
<string>Set/Unset Time Reference</string>
</property>
<property name="toolTip">
- <string>Set or unset a time reference for this packet</string>
+ <string>Set or unset a time reference for this event</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+T</string>
@@ -1364,7 +1352,7 @@
<string>Time Shift…</string>
</property>
<property name="toolTip">
- <string>Shift or change packet timestamps</string>
+ <string>Shift or change event timestamps</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+T</string>
@@ -1372,10 +1360,10 @@
</action>
<action name="actionDeleteAllPacketComments">
<property name="text">
- <string>Delete All Packet Comments</string>
+ <string>Delete All Event Comments</string>
</property>
<property name="toolTip">
- <string>Remove all packet comments in the capture file</string>
+ <string>Remove all event comments in the capture file</string>
</property>
</action>
<action name="actionEditConfigurationProfiles">
@@ -1403,7 +1391,7 @@
<string>&amp;Preferences…</string>
</property>
<property name="toolTip">
- <string>Manage Wireshark's preferences</string>
+ <string>Manage Logray's preferences</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+P</string>
@@ -1457,21 +1445,10 @@
</action>
<action name="actionStatisticsPacketLengths">
<property name="text">
- <string>Packet Lengths</string>
- </property>
- <property name="toolTip">
- <string>Packet length statistics</string>
- </property>
- </action>
- <action name="actionAnalyzeDecodeAs">
- <property name="text">
- <string>Decode &amp;As…</string>
+ <string>Event Lengths</string>
</property>
<property name="toolTip">
- <string>Change the way packets are dissected</string>
- </property>
- <property name="shortcut">
- <string notr="true">Ctrl+Shift+U</string>
+ <string>Event length statistics</string>
</property>
</action>
<action name="actionAnalyzeReloadLuaPlugins">
@@ -1485,11 +1462,6 @@
<string notr="true">Ctrl+Shift+L</string>
</property>
</action>
- <action name="actionFileExportPDU">
- <property name="text">
- <string>Export PDUs to File…</string>
- </property>
- </action>
<action name="actionStatisticsIOGraph">
<property name="text">
<string>&amp;I/O Graphs</string>
@@ -1547,10 +1519,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Colorize Packet List</string>
+ <string>Colorize Event List</string>
</property>
<property name="toolTip">
- <string>Draw packets using your coloring rules</string>
+ <string>Draw events using your coloring rules</string>
</property>
</action>
<action name="actionViewZoomIn">
@@ -1591,7 +1563,7 @@
<string>Reset Layout</string>
</property>
<property name="toolTip">
- <string>Reset appearance layout to default size</string>
+ <string>Reset layout to default size</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+W</string>
@@ -1602,7 +1574,7 @@
<string>Resize Columns</string>
</property>
<property name="toolTip">
- <string>Resize packet list columns to fit contents</string>
+ <string>Resize event list columns to fit contents</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+R</string>
@@ -1616,7 +1588,7 @@
<string>Date and Time of Day (1970-01-01 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the date and time of day.</string>
+ <string>Show event times as the date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+1</string>
@@ -1630,7 +1602,7 @@
<string>Year, Day of Year, and Time of Day (1970/001 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the year, day of the year and time of day.</string>
+ <string>Show event times as the year, day of the year and time of day.</string>
</property>
</action>
<action name="actionViewTimeDisplayFormatTimeOfDay">
@@ -1641,7 +1613,7 @@
<string>Time of Day (01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the date and time of day.</string>
+ <string>Show event times as the date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+2</string>
@@ -1655,7 +1627,7 @@
<string>Seconds Since 1970-01-01</string>
</property>
<property name="toolTip">
- <string>Show packet times as the seconds since the UNIX / POSIX epoch (1970-01-01).</string>
+ <string>Show event times as the seconds since the UNIX / POSIX epoch (1970-01-01).</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+3</string>
@@ -1669,7 +1641,7 @@
<string>Seconds Since Beginning of Capture</string>
</property>
<property name="toolTip">
- <string>Show packet times as the date and time of day.</string>
+ <string>Show event times as the date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+4</string>
@@ -1680,10 +1652,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Seconds Since Previous Captured Packet</string>
+ <string>Seconds Since Previous Captured Event</string>
</property>
<property name="toolTip">
- <string>Show packet times as the seconds since the previous captured packet.</string>
+ <string>Show event times as the seconds since the previous captured event.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+5</string>
@@ -1694,10 +1666,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Seconds Since Previous Displayed Packet</string>
+ <string>Seconds Since Previous Displayed Event</string>
</property>
<property name="toolTip">
- <string>Show packet times as the seconds since the previous displayed packet.</string>
+ <string>Show event times as the seconds since the previous displayed event.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+6</string>
@@ -1711,7 +1683,7 @@
<string>UTC Date and Time of Day (1970-01-01 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the UTC date and time of day.</string>
+ <string>Show event times as the UTC date and time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+7</string>
@@ -1725,7 +1697,7 @@
<string>UTC Year, Day of Year, and Time of Day (1970/001 01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the UTC year, day of the year and time of day.</string>
+ <string>Show event times as the UTC year, day of the year and time of day.</string>
</property>
</action>
<action name="actionViewTimeDisplayFormatUTCTimeOfDay">
@@ -1736,7 +1708,7 @@
<string>UTC Time of Day (01:02:03.123456)</string>
</property>
<property name="toolTip">
- <string>Show packet times as the UTC time of day.</string>
+ <string>Show event times as the UTC time of day.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+8</string>
@@ -1899,10 +1871,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Packet &amp;List</string>
+ <string>Event &amp;List</string>
</property>
<property name="toolTip">
- <string>Show or hide the packet list</string>
+ <string>Show or hide the event list</string>
</property>
</action>
<action name="actionViewPacketDetails">
@@ -1913,10 +1885,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Packet &amp;Details</string>
+ <string>Event &amp;Details</string>
</property>
<property name="toolTip">
- <string>Show or hide the packet details</string>
+ <string>Show or hide the event details</string>
</property>
</action>
<action name="actionViewPacketBytes">
@@ -1927,24 +1899,10 @@
<bool>true</bool>
</property>
<property name="text">
- <string>Packet &amp;Bytes</string>
- </property>
- <property name="toolTip">
- <string>Show or hide the packet bytes</string>
- </property>
- </action>
- <action name="actionViewPacketDiagram">
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>Packet &amp;Diagram</string>
+ <string>Event &amp;Bytes</string>
</property>
<property name="toolTip">
- <string>Show or hide the packet diagram</string>
+ <string>Show or hide the event bytes</string>
</property>
</action>
<action name="actionViewInternalsConversationHashTables">
@@ -1976,23 +1934,23 @@
<string>&amp;Coloring Rules…</string>
</property>
<property name="toolTip">
- <string>Edit the packet list coloring rules.</string>
+ <string>Edit the event list coloring rules.</string>
</property>
</action>
<action name="actionViewShowPacketInNewWindow">
<property name="text">
- <string>Show Packet in New &amp;Window</string>
+ <string>Show Event in New &amp;Window</string>
</property>
<property name="toolTip">
- <string>Show this packet in a separate window.</string>
+ <string>Show this event in a separate window.</string>
</property>
</action>
<action name="actionContextShowLinkedPacketInNewWindow">
<property name="text">
- <string>Show Linked Packet in New Window</string>
+ <string>Show Linked Event in New Window</string>
</property>
<property name="toolTip">
- <string>Show the linked packet in a separate window.</string>
+ <string>Show the linked event in a separate window.</string>
</property>
</action>
<action name="actionGoAutoScroll">
@@ -2003,7 +1961,7 @@
<string>Auto Scroll in Li&amp;ve Capture</string>
</property>
<property name="toolTip">
- <string>Automatically scroll to the last packet during a live capture.</string>
+ <string>Automatically scroll to the last event during a live capture.</string>
</property>
</action>
<action name="actionAnalyzeExpertInfo">
@@ -2194,7 +2152,7 @@
</action>
<action name="actionAnalyzeShowPacketBytes">
<property name="text">
- <string>Show Packet Bytes…</string>
+ <string>Show Event Bytes…</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+O</string>
@@ -2218,10 +2176,10 @@
</action>
<action name="actionGoGoToLinkedPacket">
<property name="text">
- <string>Go to &amp;Linked Packet</string>
+ <string>Go to &amp;Linked Event</string>
</property>
<property name="toolTip">
- <string>Go to the packet referenced by the selected field.</string>
+ <string>Go to the event referenced by the selected field.</string>
</property>
</action>
<action name="actionNewDisplayFilterExpression">
diff --git a/ui/logray/logray_main_window_slots.cpp b/ui/logray/logray_main_window_slots.cpp
index bf9c05bc..7a691f23 100644
--- a/ui/logray/logray_main_window_slots.cpp
+++ b/ui/logray/logray_main_window_slots.cpp
@@ -19,7 +19,7 @@
/*
* The generated Ui_LograyMainWindow::setupUi() can grow larger than our configured limit,
- * so turn off -Wframe-larger-than= for ui_main_window.h.
+ * so turn off -Wframe-larger-than= for ui_logray_main_window.h.
*/
DIAG_OFF(frame-larger-than=)
#include <ui_logray_main_window.h>
@@ -40,7 +40,6 @@ DIAG_ON(frame-larger-than=)
#include "ui/urls.h"
#include "epan/color_filters.h"
-#include "epan/export_object.h"
#include "wsutil/file_util.h"
#include "wsutil/filesystem.h"
@@ -105,20 +104,18 @@ DIAG_ON(frame-larger-than=)
#include "dissector_tables_dialog.h"
#include "endpoint_dialog.h"
#include "expert_info_dialog.h"
-#include "export_object_action.h"
-#include "export_object_dialog.h"
-#include "export_pdu_dialog.h"
#include "extcap_options_dialog.h"
#include "file_set_dialog.h"
#include "filter_action.h"
#include "filter_dialog.h"
+#include "follow_stream_action.h"
+#include "follow_stream_dialog.h"
#include "funnel_statistics.h"
#include "interface_toolbar.h"
#include "io_graph_dialog.h"
#include <ui/qt/widgets/additional_toolbar.h>
#include "main_application.h"
#include "packet_comment_dialog.h"
-#include "packet_diagram.h"
#include "packet_dialog.h"
#include "packet_list.h"
#include "preferences_dialog.h"
@@ -157,14 +154,14 @@ DIAG_ON(frame-larger-than=)
// Public slots
//
-bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned int type, gboolean is_tempfile)
+bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned int type, bool is_tempfile)
{
QString file_name = "";
dfilter_t *rfcode = NULL;
df_error_t *df_err = NULL;
int err;
- gboolean name_param;
- gboolean ret = true;
+ bool name_param;
+ bool ret = true;
// was a file name given as function parameter?
name_param = !cf_path.isEmpty();
@@ -232,7 +229,7 @@ bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, uns
continue;
}
- switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/FALSE)) {
+ switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
/* Just because we got an error, that doesn't mean we were unable
@@ -252,7 +249,9 @@ bool LograyMainWindow::openCaptureFile(QString cf_path, QString read_filter, uns
break;
}
- mainApp->setLastOpenDirFromFilename(cf_path);
+ if (!is_tempfile) {
+ mainApp->setLastOpenDirFromFilename(cf_path);
+ }
main_ui_->statusBar->showExpert();
@@ -331,16 +330,28 @@ void LograyMainWindow::layoutToolbars()
}
}
+static const char* layout_icons[] = {
+ NULL,
+ "x-reset-layout_5",
+ "x-reset-layout_2",
+ "x-reset-layout_1",
+ "x-reset-layout_4",
+ "x-reset-layout_3",
+ "x-reset-layout_6"
+};
+
void LograyMainWindow::updatePreferenceActions()
{
main_ui_->actionViewPacketList->setEnabled(prefs_has_layout_pane_content(layout_pane_content_plist));
main_ui_->actionViewPacketDetails->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pdetails));
main_ui_->actionViewPacketBytes->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pbytes));
- main_ui_->actionViewPacketDiagram->setEnabled(prefs_has_layout_pane_content(layout_pane_content_pdiagram));
main_ui_->actionViewNameResolutionPhysical->setChecked(gbl_resolv_flags.mac_name);
main_ui_->actionViewNameResolutionNetwork->setChecked(gbl_resolv_flags.network_name);
main_ui_->actionViewNameResolutionTransport->setChecked(gbl_resolv_flags.transport_name);
+
+ if (prefs.gui_layout_type > 0)
+ main_ui_->actionViewResetLayout->setIcon(StockIcon(layout_icons[prefs.gui_layout_type]));
}
void LograyMainWindow::updateRecentActions()
@@ -351,7 +362,6 @@ void LograyMainWindow::updateRecentActions()
main_ui_->actionViewPacketList->setChecked(recent.packet_list_show && prefs_has_layout_pane_content(layout_pane_content_plist));
main_ui_->actionViewPacketDetails->setChecked(recent.tree_view_show && prefs_has_layout_pane_content(layout_pane_content_pdetails));
main_ui_->actionViewPacketBytes->setChecked(recent.byte_view_show && prefs_has_layout_pane_content(layout_pane_content_pbytes));
- main_ui_->actionViewPacketDiagram->setChecked(recent.packet_diagram_show && prefs_has_layout_pane_content(layout_pane_content_pdiagram));
foreach(QAction *action, main_ui_->menuInterfaceToolbars->actions()) {
if (g_list_find_custom(recent.interface_toolbars, action->text().toUtf8(), (GCompareFunc)strcmp)) {
@@ -388,7 +398,7 @@ void LograyMainWindow::updateRecentActions()
main_ui_->actionGoAutoScroll->setChecked(recent.capture_auto_scroll);
}
-// Don't connect to this directly. Connect to or emit fiterAction(...) instead.
+// Don't connect to this directly. Connect to or emit filterAction(...) instead.
void LograyMainWindow::queuedFilterAction(QString action_filter, FilterAction::Action action, FilterAction::ActionType type)
{
QString cur_filter, new_filter;
@@ -472,17 +482,17 @@ void LograyMainWindow::queuedFilterAction(QString action_filter, FilterAction::A
#ifdef HAVE_LIBPCAP
void LograyMainWindow::captureCapturePrepared(capture_session *session) {
setTitlebarForCaptureInProgress();
-
setWindowIcon(mainApp->captureIcon());
+ pushLiveCaptureInProgress();
/* Disable menu items that make no sense if you're currently running
a capture. */
bool handle_toolbars = (session->session_will_restart ? false : true);
setForCaptureInProgress(true, handle_toolbars, session->capture_opts->ifaces);
-// set_capture_if_dialog_for_capture_in_progress(TRUE);
+// set_capture_if_dialog_for_capture_in_progress(true);
// /* Don't set up main window for a capture file. */
-// main_set_for_capture_file(FALSE);
+// main_set_for_capture_file(false);
showCapture();
}
@@ -492,6 +502,7 @@ void LograyMainWindow::captureCaptureUpdateStarted(capture_session *session) {
switching to the next multiple file. */
setTitlebarForCaptureInProgress();
setWindowIcon(mainApp->captureIcon());
+ pushLiveCaptureInProgress();
bool handle_toolbars = (session->session_will_restart ? false : true);
setForCaptureInProgress(true, handle_toolbars, session->capture_opts->ifaces);
@@ -506,6 +517,7 @@ void LograyMainWindow::captureCaptureUpdateFinished(capture_session *session) {
/* Update the main window as appropriate */
updateForUnsavedChanges();
+ setTitlebarForCaptureFile();
/* Enable menu items that make sense if you're not currently running
a capture. */
@@ -527,6 +539,7 @@ void LograyMainWindow::captureCaptureFixedFinished(capture_session *) {
/* The capture isn't stopping any more - it's stopped. */
capture_stopping_ = false;
+ setTitlebarForCaptureFile();
/* Enable menu items that make sense if you're not currently running
a capture. */
@@ -549,7 +562,7 @@ void LograyMainWindow::captureCaptureFixedFinished(capture_session *) {
void LograyMainWindow::captureCaptureFailed(capture_session *) {
/* Capture isn't stopping any more. */
capture_stopping_ = false;
-
+ setTitlebarForCaptureFile();
setForCaptureInProgress(false);
showWelcome();
@@ -632,7 +645,7 @@ void LograyMainWindow::captureEventHandler(CaptureEvent ev)
thaw();
break;
case CaptureEvent::Flushed:
- draw_tap_listeners(FALSE);
+ draw_tap_listeners(false);
break;
default:
break;
@@ -722,7 +735,7 @@ void LograyMainWindow::captureFileReadStarted(const QString &action) {
// tap_param_dlg_update();
/* Set up main window for a capture file. */
-// main_set_for_capture_file(TRUE);
+// main_set_for_capture_file(true);
mainApp->popStatus(WiresharkApplication::FileStatus);
QString msg = QString(tr("%1: %2")).arg(action).arg(capture_file_.fileName());
@@ -735,7 +748,7 @@ void LograyMainWindow::captureFileReadStarted(const QString &action) {
void LograyMainWindow::captureFileReadFinished() {
if (!capture_file_.capFile()->is_tempfile && capture_file_.capFile()->filename) {
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(capture_file_.capFile()->filename);
+ add_menu_recent_capture_file(capture_file_.capFile()->filename, false);
/* Remember folder for next Open dialog and save it in recent */
mainApp->setLastOpenDirFromFilename(capture_file_.capFile()->filename);
@@ -757,6 +770,7 @@ void LograyMainWindow::captureFileReadFinished() {
void LograyMainWindow::captureFileClosing() {
setMenusForCaptureFile(true);
+ setTitlebarForCaptureFile();
setForCapturedPackets(false);
setForCaptureInProgress(false);
@@ -797,16 +811,16 @@ void LograyMainWindow::captureFileClosed() {
// ui/gtk/capture_dlg.c:start_capture_confirmed
-void LograyMainWindow::startCapture() {
- startCapture(QStringList());
+void LograyMainWindow::startCapture(QStringList) {
+ startCapture();
}
-void LograyMainWindow::startCapture(QStringList interfaces _U_) {
+void LograyMainWindow::startCapture() {
#ifdef HAVE_LIBPCAP
interface_options *interface_opts;
- guint i;
+ unsigned i;
interface_t *device;
- gboolean can_start_capture = TRUE;
+ bool can_start_capture = true;
/* did the user ever select a capture interface before? */
if (global_capture_opts.num_selected == 0) {
@@ -824,11 +838,11 @@ void LograyMainWindow::startCapture(QStringList interfaces _U_) {
*/
if (extcap_requires_configuration(device->name))
{
- /* Request openning of extcap options dialog */
+ /* Request opening of extcap options dialog */
QString device_name(device->name);
emit showExtcapOptions(device_name, false);
/* Cancel start of capture */
- can_start_capture = FALSE;
+ can_start_capture = false;
}
}
}
@@ -871,24 +885,6 @@ void LograyMainWindow::startCapture(QStringList interfaces _U_) {
info_data_.ui.ui = this;
if (capture_start(&global_capture_opts, NULL, &cap_session_, &info_data_,
main_window_update)) {
- capture_options *capture_opts = cap_session_.capture_opts;
- GString *interface_names;
-
- /* Add "interface name<live capture in progress>" on main status bar */
- interface_names = get_iface_list_string(capture_opts, 0);
- if (strlen(interface_names->str) > 0) {
- g_string_append(interface_names, ":");
- }
- g_string_append(interface_names, " ");
-
- mainApp->popStatus(WiresharkApplication::FileStatus);
- QString msg = QString("%1<live capture in progress>").arg(interface_names->str);
- QString msgtip = QString("to file: ");
- if (capture_opts->save_file)
- msgtip += capture_opts->save_file;
- mainApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
- g_string_free(interface_names, TRUE);
-
/* The capture succeeded, which means the capture filter syntax is
valid; add this capture filter to the recent capture filter list. */
QByteArray filter_ba;
@@ -919,6 +915,28 @@ void LograyMainWindow::startCapture(QStringList interfaces _U_) {
#endif // HAVE_LIBPCAP
}
+void LograyMainWindow::pushLiveCaptureInProgress() {
+#ifdef HAVE_LIBPCAP
+ capture_options *capture_opts = cap_session_.capture_opts;
+ GString *interface_names;
+
+ /* Add "interface name<live capture in progress>" on main status bar */
+ interface_names = get_iface_list_string(capture_opts, 0);
+ if (strlen(interface_names->str) > 0) {
+ g_string_append(interface_names, ":");
+ }
+ g_string_append(interface_names, " ");
+
+ mainApp->popStatus(WiresharkApplication::FileStatus);
+ QString msg = QString("%1<live capture in progress>").arg(interface_names->str);
+ QString msgtip = QString("to file: ");
+ if (capture_opts->save_file)
+ msgtip += capture_opts->save_file;
+ mainApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
+ g_string_free(interface_names, TRUE);
+#endif // HAVE_LIBPCAP
+}
+
void LograyMainWindow::popLiveCaptureInProgress() {
/* Pop the "<live capture in progress>" message off the status bar. */
main_ui_->statusBar->setFileName(capture_file_);
@@ -981,7 +999,9 @@ void LograyMainWindow::updateRecentCaptures() {
/* Iterate through the actions in menuOpenRecentCaptureFile,
* removing special items, a maybe duplicate entry and every item above count_max */
+#if defined(Q_OS_MAC)
int shortcut = Qt::Key_0;
+#endif
foreach(recent_item_status *ri, mainApp->recentItems()) {
// Add the new item
ra = new QAction(recentMenu);
@@ -990,12 +1010,14 @@ void LograyMainWindow::updateRecentCaptures() {
ra->setEnabled(ri->accessible);
recentMenu->insertAction(NULL, ra);
action_cf_name = ra->data().toString();
+#if defined(Q_OS_MAC)
if (shortcut <= Qt::Key_9) {
ra->setShortcut(Qt::META | (Qt::Key)shortcut);
shortcut++;
}
+#endif
ra->setText(action_cf_name);
- connect(ra, SIGNAL(triggered()), this, SLOT(recentActionTriggered()));
+ connect(ra, &QAction::triggered, this, &LograyMainWindow::recentActionTriggered);
/* This is slow, at least on my VM here. The added links also open Wireshark
* in a new window. It might make more sense to add a recent item when we
@@ -1019,8 +1041,15 @@ void LograyMainWindow::updateRecentCaptures() {
QFileInfo fi(ri->filename);
rda->setText(fi.fileName());
dock_menu_->insertAction(NULL, rda);
- connect(rda, SIGNAL(triggered()), ra, SLOT(trigger()));
+ connect(rda, &QAction::triggered, ra, &QAction::trigger);
+#endif
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ if (recentMenu->actions().count() == static_cast<int>(prefs.gui_recent_files_count_max)) {
+#else
+ if (recentMenu->actions().count() == static_cast<qsizetype>(prefs.gui_recent_files_count_max)) {
#endif
+ break;
+ }
}
if (recentMenu->actions().count() > 0) {
@@ -1033,7 +1062,7 @@ void LograyMainWindow::updateRecentCaptures() {
ra = new QAction(recentMenu);
ra->setText(tr("Clear Menu"));
recentMenu->insertAction(NULL, ra);
- connect(ra, SIGNAL(triggered()), mainApp, SLOT(clearRecentCaptures()));
+ connect(ra, &QAction::triggered, mainApp, &MainApplication::clearRecentCaptures);
} else {
if (main_ui_->actionDummyNoFilesFound) {
recentMenu->addAction(main_ui_->actionDummyNoFilesFound);
@@ -1075,34 +1104,34 @@ void LograyMainWindow::setEditCommentsMenu()
const int thisRow = selectedRows().first();
frame_data * current_frame = frameDataForRow(thisRow);
wtap_block_t pkt_block = cf_get_packet_block(capture_file_.capFile(), current_frame);
- guint nComments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ unsigned nComments = wtap_block_count_option(pkt_block, OPT_COMMENT);
if (nComments > 0) {
main_ui_->menuPacketComment->addSeparator();
- for (guint i = 0; i < nComments; i++) {
+ for (unsigned i = 0; i < nComments; i++) {
QString comment = packet_list_->getPacketComment(i);
comment = this->commentToMenuText(comment);
- action = main_ui_->menuPacketComment->addAction(tr("Edit \"%1\"", "edit packet comment").arg(comment));
+ action = main_ui_->menuPacketComment->addAction(tr("Edit \"%1\"", "edit event comment").arg(comment));
connect(action, &QAction::triggered, this, &LograyMainWindow::editPacketComment);
action->setData(i);
}
main_ui_->menuPacketComment->addSeparator();
- for (guint i = 0; i < nComments; i++) {
+ for (unsigned i = 0; i < nComments; i++) {
QString comment = packet_list_->getPacketComment(i);
comment = this->commentToMenuText(comment);
- action = main_ui_->menuPacketComment->addAction(tr("Delete \"%1\"", "delete packet comment").arg(comment));
+ action = main_ui_->menuPacketComment->addAction(tr("Delete \"%1\"", "delete event comment").arg(comment));
connect(action, &QAction::triggered, this, &LograyMainWindow::deletePacketComment);
action->setData(i);
}
main_ui_->menuPacketComment->addSeparator();
- action = main_ui_->menuPacketComment->addAction(tr("Delete packet comments"));
+ action = main_ui_->menuPacketComment->addAction(tr("Delete event comments"));
connect(action, &QAction::triggered, this, &LograyMainWindow::deleteCommentsFromPackets);
}
wtap_block_unref(pkt_block);
}
if (selectedRows().count() > 1) {
main_ui_->menuPacketComment->addSeparator();
- action = main_ui_->menuPacketComment->addAction(tr("Delete comments from %n packet(s)", nullptr, static_cast<int>(selectedRows().count())));
+ action = main_ui_->menuPacketComment->addAction(tr("Delete comments from %n event(s)", nullptr, static_cast<int>(selectedRows().count())));
connect(action, &QAction::triggered, this, &LograyMainWindow::deleteCommentsFromPackets);
}
}
@@ -1170,16 +1199,25 @@ void LograyMainWindow::setMenusForSelectedPacket()
have_time_ref = capture_file_.capFile()->ref_time_count > 0;
another_is_time_ref = have_time_ref && rows.count() <= 1 &&
!(capture_file_.capFile()->ref_time_count == 1 && frame_selected && current_frame->ref_time);
- }
- main_ui_->actionEditMarkPacket->setText(tr("&Mark/Unmark Packet(s)", "", static_cast<int>(selectedRows().count())));
- main_ui_->actionEditIgnorePacket->setText(tr("&Ignore/Unignore Packet(s)", "", static_cast<int>(selectedRows().count())));
+ if (capture_file_.capFile()->edt && ! multi_selection && frame_selected)
+ {
+ foreach (FollowStreamAction *follow_action, main_ui_->menuFollow->findChildren<FollowStreamAction *>()) {
+ bool is_frame = proto_is_frame_protocol(capture_file_.capFile()->edt->pi.layers, follow_action->filterName());
+ follow_action->setEnabled(is_frame);
+ }
+ } else {
+ foreach (FollowStreamAction *follow_action, main_ui_->menuFollow->findChildren<FollowStreamAction *>()) {
+ follow_action->setEnabled(false);
+ }
+ }
+ }
main_ui_->actionCopyListAsText->setEnabled(selectedRows().count() > 0);
main_ui_->actionCopyListAsCSV->setEnabled(selectedRows().count() > 0);
main_ui_->actionCopyListAsYAML->setEnabled(selectedRows().count() > 0);
- main_ui_->actionEditMarkPacket->setEnabled(frame_selected || multi_selection);
+ main_ui_->actionEditMarkSelected->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditMarkAllDisplayed->setEnabled(have_frames);
/* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
main_ui_->actionEditUnmarkAllDisplayed->setEnabled(have_marked);
@@ -1194,7 +1232,7 @@ void LograyMainWindow::setMenusForSelectedPacket()
main_ui_->menuPacketComment->setEnabled(enableEditComments && selectedRows().count() > 0);
main_ui_->actionDeleteAllPacketComments->setEnabled(enableEditComments);
- main_ui_->actionEditIgnorePacket->setEnabled(frame_selected || multi_selection);
+ main_ui_->actionEditIgnoreSelected->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditIgnoreAllDisplayed->setEnabled(have_filtered);
/* Allow un-ignore of all frames even with no frames currently displayed */
main_ui_->actionEditUnignoreAllDisplayed->setEnabled(have_ignored);
@@ -1250,10 +1288,26 @@ void LograyMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
if (fi && fi->ds_tvb && (fi->length > 0)) {
have_packet_bytes = true;
}
+
+ if (!(capture_file_.capFile()->search_in_progress && (capture_file_.capFile()->hex || (capture_file_.capFile()->string && capture_file_.capFile()->packet_data)))) {
+ // If we're not in the middle of a packet bytes search, then set
+ // search_pos and search_len so that we can start a new search
+ // from this point. (If we are, then we already set it.)
+ if (fi && capture_file_.capFile()->edt && (fi->ds_tvb == capture_file_.capFile()->edt->tvb)) {
+ // We can only do a Packet Bytes search in the main bytes from
+ // the frame, not from any secondary data sources. (XXX: This
+ // might be surprising to users, though.)
+ capture_file_.capFile()->search_pos = (uint32_t)(finfo->position().start + finfo->position().length - 1);
+ capture_file_.capFile()->search_len = (uint32_t)finfo->position().length;
+ } else {
+ capture_file_.capFile()->search_pos = 0;
+ capture_file_.capFile()->search_len = 0;
+ }
+ }
}
if (capture_file_.capFile() != NULL && fi != NULL) {
- header_field_info *hfinfo = fi->hfinfo;
+ const header_field_info *hfinfo = fi->hfinfo;
int linked_frame = -1;
can_match_selected = proto_can_match_selected(capture_file_.capFile()->finfo_selected, capture_file_.capFile()->edt);
@@ -1298,7 +1352,6 @@ void LograyMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
main_ui_->actionEditCopyAsFilter->setEnabled(can_match_selected);
main_ui_->actionAnalyzeShowPacketBytes->setEnabled(have_packet_bytes);
- main_ui_->actionFileExportPacketBytes->setEnabled(have_packet_bytes);
main_ui_->actionViewExpandSubtrees->setEnabled(have_subtree);
main_ui_->actionViewCollapseSubtrees->setEnabled(have_subtree);
@@ -1411,7 +1464,7 @@ void LograyMainWindow::checkDisplayFilter()
void LograyMainWindow::fieldsChanged()
{
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
if (!color_filters_reload(&err_msg, color_filter_add_cb)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
@@ -1434,7 +1487,7 @@ void LograyMainWindow::reloadLuaPlugins()
if (mainApp->isReloadingLua())
return;
- gboolean uses_lua_filehandler = FALSE;
+ bool uses_lua_filehandler = false;
if (capture_file_.capFile()) {
// Check if the current capture file is opened with a Lua FileHandler
@@ -1521,11 +1574,11 @@ void LograyMainWindow::initViewColorizeMenu()
<< main_ui_->actionViewColorizeConversation7 << main_ui_->actionViewColorizeConversation8
<< main_ui_->actionViewColorizeConversation9 << main_ui_->actionViewColorizeConversation10;
- guint8 color_num = 1;
+ uint8_t color_num = 1;
foreach(QAction *cc_action, cc_actions) {
cc_action->setData(color_num);
- connect(cc_action, SIGNAL(triggered()), this, SLOT(colorizeConversation()));
+ connect(cc_action, &QAction::triggered, this, &LograyMainWindow::colorizeConversation);
const color_filter_t *colorf = color_filters_tmp_color(color_num);
if (colorf) {
@@ -1562,16 +1615,15 @@ void LograyMainWindow::addStatsPluginsToMenu() {
parent_menu = main_ui_->menuStatistics;
// gtk/main_menubar.c compresses double slashes, hence SkipEmptyParts
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList cfg_name_parts = QString(cfg->name).split("/", Qt::SkipEmptyParts);
+ QStringList cfg_name_parts = QString(cfg->path).split(STATS_TREE_MENU_SEPARATOR, Qt::SkipEmptyParts);
#else
- QStringList cfg_name_parts = QString(cfg->name).split("/", QString::SkipEmptyParts);
+ QStringList cfg_name_parts = QString(cfg->path).split(STATS_TREE_MENU_SEPARATOR, QString::SkipEmptyParts);
#endif
if (cfg_name_parts.isEmpty()) continue;
- QString stat_name = cfg_name_parts.takeLast();
+ QString stat_name = cfg_name_parts.takeLast().trimmed();
if (!cfg_name_parts.isEmpty()) {
- QString menu_name = cfg_name_parts.join("/");
- parent_menu = findOrAddMenu(parent_menu, menu_name);
+ parent_menu = findOrAddMenu(parent_menu, cfg_name_parts);
}
stats_tree_action = new QAction(stat_name, this);
@@ -1602,7 +1654,7 @@ void LograyMainWindow::setFeaturesEnabled(bool enabled)
}
else
{
- main_ui_->statusBar->showMessage(tr("Please wait while Wireshark is initializing…"));
+ main_ui_->statusBar->showMessage(tr("Please wait while Logray is initializing…"));
}
}
@@ -1645,10 +1697,8 @@ void LograyMainWindow::openTapParameterDialog(const QString cfg_str, const QStri
TapParameterDialog *tp_dialog = TapParameterDialog::showTapParameterStatistics(*this, capture_file_, cfg_str, arg, userdata);
if (!tp_dialog) return;
- connect(tp_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(tp_dialog, SIGNAL(updateFilter(QString)),
- df_combo_box_->lineEdit(), SLOT(setText(QString)));
+ connect(tp_dialog, &TapParameterDialog::filterAction, this, &LograyMainWindow::filterAction);
+ connect(tp_dialog, &TapParameterDialog::updateFilter, df_combo_box_->lineEdit(), &QLineEdit::setText);
tp_dialog->show();
}
@@ -1740,57 +1790,10 @@ void LograyMainWindow::connectFileMenuActions()
connect(main_ui_->actionFileExportAsJSON, &QAction::triggered, this,
[this]() { exportDissections(export_type_json); });
- connect(main_ui_->actionFileExportPacketBytes, &QAction::triggered, this,
- [this]() { exportPacketBytes(); }, Qt::QueuedConnection);
-
- connect(main_ui_->actionFileExportPDU, &QAction::triggered, this,
- [this]() { exportPDU(); });
-
connect(main_ui_->actionFilePrint, &QAction::triggered, this,
[this]() { printFile(); });
}
-void LograyMainWindow::exportPacketBytes()
-{
- QString file_name;
-
- if (!capture_file_.capFile() || !capture_file_.capFile()->finfo_selected) return;
-
- file_name = WiresharkFileDialog::getSaveFileName(this,
- mainApp->windowTitleString(tr("Export Selected Packet Bytes")),
- mainApp->openDialogInitialDir().canonicalPath(),
- tr("Raw data (*.bin *.dat *.raw);;All Files (" ALL_FILES_WILDCARD ")")
- );
-
- if (file_name.length() > 0) {
- const guint8 *data_p;
-
- data_p = tvb_get_ptr(capture_file_.capFile()->finfo_selected->ds_tvb, 0, -1) +
- capture_file_.capFile()->finfo_selected->start;
- write_file_binary_mode(qUtf8Printable(file_name), data_p, capture_file_.capFile()->finfo_selected->length);
-
- /* Save the directory name for future file dialogs. */
- mainApp->setLastOpenDirFromFilename(file_name);
- }
-}
-
-void LograyMainWindow::exportPDU()
-{
- ExportPDUDialog *exportpdu_dialog = new ExportPDUDialog(this);
-
- if (exportpdu_dialog->isMinimized() == true)
- {
- exportpdu_dialog->showNormal();
- }
- else
- {
- exportpdu_dialog->show();
- }
-
- exportpdu_dialog->raise();
- exportpdu_dialog->activateWindow();
-}
-
void LograyMainWindow::printFile()
{
capture_file *cf = capture_file_.capFile();
@@ -1851,7 +1854,7 @@ void LograyMainWindow::connectEditMenuActions()
// The items below are used in the packet list and detail context menus.
// Use QueuedConnections so that the context menus aren't destroyed
// prematurely.
- connect(main_ui_->actionEditMarkPacket, &QAction::triggered, this, [this]() {
+ connect(main_ui_->actionEditMarkSelected, &QAction::triggered, this, [this]() {
freeze();
packet_list_->markFrame();
thaw();
@@ -1884,7 +1887,7 @@ void LograyMainWindow::connectEditMenuActions()
}
}, Qt::QueuedConnection);
- connect(main_ui_->actionEditIgnorePacket, &QAction::triggered, this, [this]() {
+ connect(main_ui_->actionEditIgnoreSelected, &QAction::triggered, this, [this]() {
freeze();
packet_list_->ignoreFrame();
thaw();
@@ -1962,7 +1965,7 @@ void LograyMainWindow::copySelectedItems(LograyMainWindow::CopySelected selectio
break;
case CopySelectedValue:
if (finfo_selected && capture_file_.capFile()->edt != 0) {
- gchar* field_str = get_node_field_value(finfo_selected, capture_file_.capFile()->edt);
+ char* field_str = get_node_field_value(finfo_selected, capture_file_.capFile()->edt);
clip.append(field_str);
g_free(field_str);
}
@@ -2053,10 +2056,9 @@ void LograyMainWindow::findPacket()
void LograyMainWindow::editTimeShift()
{
TimeShiftDialog *ts_dialog = new TimeShiftDialog(this, capture_file_.capFile());
- connect(ts_dialog, SIGNAL(finished(int)), this, SLOT(editTimeShiftFinished(int)));
+ connect(ts_dialog, &TimeShiftDialog::finished, this, &LograyMainWindow::editTimeShiftFinished);
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- ts_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(this, &LograyMainWindow::setCaptureFile, ts_dialog, &TimeShiftDialog::setCaptureFile);
connect(ts_dialog, &TimeShiftDialog::timeShifted, packet_list_, &PacketList::applyTimeShift, Qt::QueuedConnection);
ts_dialog->setWindowModality(Qt::ApplicationModal);
@@ -2104,7 +2106,7 @@ void LograyMainWindow::editPacketComment()
return;
QAction *ra = qobject_cast<QAction*>(sender());
- guint nComment = ra->data().toUInt();
+ unsigned nComment = ra->data().toUInt();
PacketCommentDialog* pc_dialog;
pc_dialog = new PacketCommentDialog(true, this, packet_list_->getPacketComment(nComment));
connect(pc_dialog, &QDialog::finished, std::bind(&LograyMainWindow::editPacketCommentFinished, this, pc_dialog, std::placeholders::_1, nComment));
@@ -2113,7 +2115,7 @@ void LograyMainWindow::editPacketComment()
pc_dialog->show();
}
-void LograyMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog _U_, int result _U_, guint nComment)
+void LograyMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog _U_, int result _U_, unsigned nComment)
{
if (result == QDialog::Accepted) {
packet_list_->setPacketComment(nComment, pc_dialog->text());
@@ -2124,7 +2126,7 @@ void LograyMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog
void LograyMainWindow::deletePacketComment()
{
QAction *ra = qobject_cast<QAction*>(sender());
- guint nComment = ra->data().toUInt();
+ unsigned nComment = ra->data().toUInt();
packet_list_->setPacketComment(nComment, QString(""));
updateForUnsavedChanges();
}
@@ -2138,7 +2140,7 @@ void LograyMainWindow::deleteCommentsFromPackets()
void LograyMainWindow::deleteAllPacketComments()
{
QMessageBox *msg_dialog = new QMessageBox();
- connect(msg_dialog, SIGNAL(finished(int)), this, SLOT(deleteAllPacketCommentsFinished(int)));
+ connect(msg_dialog, &QMessageBox::finished, this, &LograyMainWindow::deleteAllPacketCommentsFinished);
msg_dialog->setIcon(QMessageBox::Question);
msg_dialog->setText(tr("Are you sure you want to remove all packet comments?"));
@@ -2171,7 +2173,7 @@ void LograyMainWindow::editConfigurationProfiles()
void LograyMainWindow::showPreferencesDialog(QString module_name)
{
PreferencesDialog *pref_dialog = new PreferencesDialog(this);
- connect(pref_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(pref_dialog, &PreferencesDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
saveWindowGeometry(); // Save in case the layout panes are rearranged
pref_dialog->setPane(module_name);
@@ -2250,7 +2252,7 @@ void LograyMainWindow::connectViewMenuActions()
[this]() { showColoringRulesDialog(); });
connect(main_ui_->actionViewColorizeResetColorization, &QAction::triggered, this, [this]() {
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
if (!color_filters_reset_tmp(&err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
@@ -2265,6 +2267,10 @@ void LograyMainWindow::connectViewMenuActions()
connect(main_ui_->actionViewResetLayout, &QAction::triggered, this, [this]() {
recent.gui_geometry_main_upper_pane = 0;
recent.gui_geometry_main_lower_pane = 0;
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = NULL;
+ recent.gui_geometry_main_extra_split = NULL;
applyRecentPaneGeometry();
});
@@ -2334,9 +2340,6 @@ void LograyMainWindow::showHideMainWidgets(QAction *action)
} else if (widget == byte_view_tab_) {
recent.byte_view_show = show;
main_ui_->actionViewPacketBytes->setChecked(show);
- } else if (widget == packet_diagram_) {
- recent.packet_diagram_show = show;
- main_ui_->actionViewPacketDiagram->setChecked(show);
} else {
foreach(QAction *action, main_ui_->menuInterfaceToolbars->actions()) {
QToolBar *toolbar = action->data().value<QToolBar *>();
@@ -2442,9 +2445,9 @@ void LograyMainWindow::editResolvedName()
void LograyMainWindow::setNameResolution()
{
- gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? TRUE : FALSE;
- gbl_resolv_flags.network_name = main_ui_->actionViewNameResolutionNetwork->isChecked() ? TRUE : FALSE;
- gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? TRUE : FALSE;
+ gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? true : false;
+ gbl_resolv_flags.network_name = main_ui_->actionViewNameResolutionNetwork->isChecked() ? true : false;
+ gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? true : false;
if (packet_list_) {
packet_list_->resetColumns();
@@ -2478,8 +2481,8 @@ void LograyMainWindow::colorizeConversation(bool create_rule)
if (capture_file_.capFile() && selectedRows().count() > 0) {
packet_info *pi = capture_file_.packetInfo();
- guint8 cc_num = colorize_action->data().toUInt();
- gchar *filter = conversation_filter_from_log(pi);
+ uint8_t cc_num = colorize_action->data().toUInt();
+ char *filter = conversation_filter_from_log(pi);
if (filter == NULL) {
mainApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Unable to build conversation filter."));
return;
@@ -2493,8 +2496,8 @@ void LograyMainWindow::colorizeConversation(bool create_rule)
this, &LograyMainWindow::filterAction);
coloring_rules_dialog.exec();
} else {
- gchar *err_msg = NULL;
- if (!color_filters_set_tmp(cc_num, filter, FALSE, &err_msg)) {
+ char *err_msg = NULL;
+ if (!color_filters_set_tmp(cc_num, filter, false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
@@ -2530,8 +2533,8 @@ void LograyMainWindow::colorizeWithFilter(QByteArray filter, int color_number)
if (color_number > 0) {
// Assume "Color X"
- gchar *err_msg = NULL;
- if (!color_filters_set_tmp(color_number, filter.constData(), FALSE, &err_msg)) {
+ char *err_msg = NULL;
+ if (!color_filters_set_tmp(color_number, filter.constData(), false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
@@ -2554,7 +2557,7 @@ void LograyMainWindow::openPacketDialog(bool from_reference)
/* Find the frame for which we're popping up a dialog */
if (from_reference) {
- guint32 framenum = fvalue_get_uinteger(capture_file_.capFile()->finfo_selected->value);
+ uint32_t framenum = fvalue_get_uinteger(capture_file_.capFile()->finfo_selected->value);
if (framenum == 0)
return;
@@ -2680,9 +2683,9 @@ void LograyMainWindow::connectGoMenuActions()
}
void LograyMainWindow::goToConversationFrame(bool go_next) {
- gchar *filter = NULL;
+ char *filter = NULL;
dfilter_t *dfcode = NULL;
- gboolean found_packet = FALSE;
+ bool found_packet = false;
packet_info *pi = capture_file_.packetInfo();
if (!pi) {
@@ -2736,7 +2739,7 @@ void LograyMainWindow::connectCaptureMenuActions()
connect(main_ui_->actionCaptureRestart, &QAction::triggered, this, [this]() {
#ifdef HAVE_LIBPCAP
QString before_what(tr(" before restarting the capture"));
- cap_session_.capture_opts->restart = TRUE;
+ cap_session_.capture_opts->restart = true;
if (!testCaptureFileClose(before_what, Restart)) {
return;
}
@@ -2812,13 +2815,13 @@ void LograyMainWindow::startCaptureTriggered()
// /*
// * There's an options dialog; get the values from it and close it.
// */
-// gboolean success;
+// bool success;
// /* Determine if "capture start" while building of the "capture options" window */
// /* is in progress. If so, ignore the "capture start. */
// /* XXX: Would it be better/cleaner for the "capture options" window code to */
// /* disable the capture start button temporarily ? */
-// if (cap_open_complete == FALSE) {
+// if (cap_open_complete == false) {
// return; /* Building options window: ignore "capture start" */
// }
// success = capture_dlg_prep(cap_open_w);
@@ -2859,14 +2862,10 @@ void LograyMainWindow::connectAnalyzeMenuActions()
});
connect(main_ui_->actionAnalyzeDisplayFilterMacros, &QAction::triggered, this, [=]() {
- struct epan_uat* dfm_uat;
- dfilter_macro_get_uat(&dfm_uat);
- UatDialog *uat_dlg = new UatDialog(parentWidget(), dfm_uat);
- connect(uat_dlg, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
-
- uat_dlg->setWindowModality(Qt::ApplicationModal);
- uat_dlg->setAttribute(Qt::WA_DeleteOnClose);
- uat_dlg->show();
+ FilterDialog *display_filter_dlg = new FilterDialog(window(), FilterDialog::DisplayMacro);
+ display_filter_dlg->setWindowModality(Qt::ApplicationModal);
+ display_filter_dlg->setAttribute(Qt::WA_DeleteOnClose);
+ display_filter_dlg->show();
});
connect(main_ui_->actionDisplayFilterExpression, &QAction::triggered, this, [=]() {
@@ -2882,25 +2881,13 @@ void LograyMainWindow::connectAnalyzeMenuActions()
connect(main_ui_->actionAnalyzeEnabledProtocols, &QAction::triggered, this, [=]() {
EnabledProtocolsDialog *enable_proto_dialog = new EnabledProtocolsDialog(this);
- connect(enable_proto_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(enable_proto_dialog, &EnabledProtocolsDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
enable_proto_dialog->setWindowModality(Qt::ApplicationModal);
enable_proto_dialog->setAttribute(Qt::WA_DeleteOnClose);
enable_proto_dialog->show();
});
- connect(main_ui_->actionAnalyzeDecodeAs, &QAction::triggered, this, [=]() {
- QAction *da_action = qobject_cast<QAction*>(sender());
- bool create_new = da_action && da_action->property("create_new").toBool();
-
- DecodeAsDialog *da_dialog = new DecodeAsDialog(this, capture_file_.capFile(), create_new);
- connect(da_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
-
- da_dialog->setWindowModality(Qt::ApplicationModal);
- da_dialog->setAttribute(Qt::WA_DeleteOnClose);
- da_dialog->show();
- });
-
connect(main_ui_->actionAnalyzeReloadLuaPlugins, &QAction::triggered, this, &LograyMainWindow::reloadLuaPlugins);
connect(main_ui_->actionAnalyzeShowPacketBytes, &QAction::triggered, this, [=]() {
@@ -2959,7 +2946,7 @@ void LograyMainWindow::matchFieldFilter(FilterAction::Action action, FilterActio
void LograyMainWindow::applyFieldAsColumn()
{
if (capture_file_.capFile() != 0 && capture_file_.capFile()->finfo_selected != 0) {
- header_field_info *hfinfo = capture_file_.capFile()->finfo_selected->hfinfo;
+ const header_field_info *hfinfo = capture_file_.capFile()->finfo_selected->hfinfo;
int col = column_prefs_has_custom(hfinfo->abbrev);
if (col == -1) {
insertColumn(hfinfo->name, hfinfo->abbrev);
@@ -2974,7 +2961,7 @@ void LograyMainWindow::applyFieldAsColumn()
if (!get_column_visible(col)) {
packet_list_->setColumnHidden(col, false);
- set_column_visible(col, TRUE);
+ set_column_visible(col, true);
prefs_main_write();
}
}
@@ -2999,16 +2986,23 @@ void LograyMainWindow::applyConversationFilter()
}
}
-void LograyMainWindow::applyExportObject()
-{
- ExportObjectAction *export_action = qobject_cast<ExportObjectAction*>(sender());
- if (!export_action)
- return;
+void LograyMainWindow::openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num, bool use_stream_index) {
+ FollowStreamDialog *fsd = new FollowStreamDialog(*this, capture_file_, proto_id);
+ connect(fsd, &FollowStreamDialog::updateFilter, this, &LograyMainWindow::filterPackets);
+ connect(fsd, &FollowStreamDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ fsd->addCodecs(text_codec_map_);
+ fsd->show();
+ if (use_stream_index) {
+ // If a specific conversation was requested, then ignore any previous
+ // display filters and display all related packets.
+ fsd->follow("", true, stream_num, sub_stream_num);
+ } else {
+ fsd->follow(getFilter());
+ }
+}
- ExportObjectDialog* export_dialog = new ExportObjectDialog(*this, capture_file_, export_action->exportObject());
- export_dialog->setWindowModality(Qt::ApplicationModal);
- export_dialog->setAttribute(Qt::WA_DeleteOnClose);
- export_dialog->show();
+void LograyMainWindow::openFollowStreamDialog(int proto_id) {
+ openFollowStreamDialog(proto_id, 0, 0, false);
}
// -z expert
@@ -3017,10 +3011,9 @@ void LograyMainWindow::statCommandExpertInfo(const char *, void *)
const DisplayFilterEdit *df_edit = dynamic_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
ExpertInfoDialog *expert_dialog = new ExpertInfoDialog(*this, capture_file_, df_edit->text());
- connect(expert_dialog->getExpertInfoView(), SIGNAL(goToPacket(int, int)),
- packet_list_, SLOT(goToPacket(int, int)));
- connect(expert_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(expert_dialog->getExpertInfoView(), &ExpertInfoTreeView::goToPacket,
+ this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(expert_dialog, &ExpertInfoDialog::filterAction, this, &LograyMainWindow::filterAction);
expert_dialog->show();
}
@@ -3034,59 +3027,100 @@ void LograyMainWindow::connectStatisticsMenuActions()
{
connect(main_ui_->actionStatisticsCaptureFileProperties, &QAction::triggered, this, [=]() {
CaptureFilePropertiesDialog *capture_file_properties_dialog = new CaptureFilePropertiesDialog(*this, capture_file_);
- connect(capture_file_properties_dialog, SIGNAL(captureCommentChanged()),
- this, SLOT(updateForUnsavedChanges()));
+ connect(capture_file_properties_dialog, &CaptureFilePropertiesDialog::captureCommentChanged,
+ this, &LograyMainWindow::updateForUnsavedChanges);
capture_file_properties_dialog->show();
});
- connect(main_ui_->actionStatisticsResolvedAddresses, &QAction::triggered, this, &LograyMainWindow::showResolvedAddressesDialog);
+ main_ui_->actionStatisticsResolvedAddresses->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsResolvedAddresses, &QAction::triggered, this, &LograyMainWindow::showResolvedAddressesDialog);
- connect(main_ui_->actionStatisticsProtocolHierarchy, &QAction::triggered, this, [=]() {
- ProtocolHierarchyDialog *phd = new ProtocolHierarchyDialog(*this, capture_file_);
- connect(phd, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- phd->show();
- });
+ main_ui_->actionStatisticsProtocolHierarchy->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsProtocolHierarchy, &QAction::triggered, this, [=]() {
+ // ProtocolHierarchyDialog *phd = new ProtocolHierarchyDialog(*this, capture_file_);
+ // connect(phd, &ProtocolHierarchyDialog::filterAction, this, &LograyMainWindow::filterAction);
+ // phd->show();
+ // });
- connect(main_ui_->actionStatisticsConversations, &QAction::triggered, this, &LograyMainWindow::showConversationsDialog);
- connect(main_ui_->actionStatisticsEndpoints, &QAction::triggered, this, &LograyMainWindow::showEndpointsDialog);
+ main_ui_->actionStatisticsConversations->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsConversations, &QAction::triggered, this, &LograyMainWindow::showConversationsDialog);
+ main_ui_->actionStatisticsEndpoints->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsEndpoints, &QAction::triggered, this, &LograyMainWindow::showEndpointsDialog);
- connect(main_ui_->actionStatisticsPacketLengths, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("plen"); });
+ main_ui_->actionStatisticsPacketLengths->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsPacketLengths, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("plen"); });
connect(main_ui_->actionStatisticsIOGraph, &QAction::triggered, this, [=]() { statCommandIOGraph(NULL, NULL); });
- connect(main_ui_->actionStatisticsFlowGraph, &QAction::triggered, this, [=]() {
- QMessageBox::warning(this, "Oops", "SequenceDialog depends on RTPStreamDialog");
- // SequenceDialog *sequence_dialog = new SequenceDialog(*this, capture_file_);
- // sequence_dialog->show();
- });
+ main_ui_->actionStatisticsFlowGraph->setVisible(false); // Hide for now.
+ // connect(main_ui_->actionStatisticsFlowGraph, &QAction::triggered, this, [=]() {
+ // QMessageBox::warning(this, "Oops", "SequenceDialog depends on RTPStreamDialog");
+ // // SequenceDialog *sequence_dialog = new SequenceDialog(*this, capture_file_);
+ // // sequence_dialog->show();
+ // });
}
-void LograyMainWindow::openStatisticsTreeDialog(const gchar *abbr)
+void LograyMainWindow::openStatisticsTreeDialog(const char *abbr)
{
StatsTreeDialog *st_dialog = new StatsTreeDialog(*this, capture_file_, abbr);
-// connect(st_dialog, SIGNAL(goToPacket(int)),
-// packet_list_, SLOT(goToPacket(int)));
+// connect(st_dialog, &StatsTreeDialog::goToPacket, packet_list_, &PacketList::goToPacket);
st_dialog->show();
}
// -z io,stat
void LograyMainWindow::statCommandIOGraph(const char *, void *)
{
+ showIOGraphDialog(IOG_ITEM_UNIT_PACKETS, QString());
+}
+
+void LograyMainWindow::showIOGraphDialog(io_graph_item_unit_t value_units, QString yfield)
+{
const DisplayFilterEdit *df_edit = qobject_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
+ IOGraphDialog *iog_dialog = nullptr;
QString displayFilter;
if (df_edit)
displayFilter = df_edit->text();
- IOGraphDialog *iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter);
- connect(iog_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(reloadFields()), iog_dialog, SLOT(reloadFields()));
+ if (!yfield.isEmpty()) {
+ QList<IOGraphDialog *> iographdialogs = findChildren<IOGraphDialog *>();
+ // GeometryStateDialogs aren't parented on Linux and Windows
+ // (see geometry_state_dialog.h), so we search for an
+ // I/O Dialog in all the top level widgets.
+ if (iographdialogs.isEmpty()) {
+ foreach(QWidget *topLevelWidget, mainApp->topLevelWidgets()) {
+ if (qobject_cast<IOGraphDialog*>(topLevelWidget)) {
+ iographdialogs << qobject_cast<IOGraphDialog*>(topLevelWidget);
+ }
+ }
+ }
+ bool iog_found = false;
+ foreach(iog_dialog, iographdialogs) {
+ if (!iog_dialog->fileClosed()) {
+ iog_found = true;
+ iog_dialog->addGraph(true, displayFilter, value_units, yfield);
+ break;
+ }
+ }
+ if (!iog_found) {
+ iog_dialog = nullptr;
+ }
+ }
+
+ if (iog_dialog == nullptr) {
+ iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter, value_units, yfield);
+ connect(iog_dialog, &IOGraphDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(this, &LograyMainWindow::reloadFields, iog_dialog, &IOGraphDialog::reloadFields);
+ }
iog_dialog->show();
}
// Tools Menu
-// XXX No log tools yet
+void LograyMainWindow::connectToolsMenuActions()
+{
+ // We don't have any built in tools yet, so hide it until we add actions via Lua scripts.
+ main_ui_->menuTools->hide();
+}
// Help Menu
void LograyMainWindow::connectHelpMenuActions()
@@ -3136,7 +3170,7 @@ void LograyMainWindow::checkForUpdates()
void LograyMainWindow::setPreviousFocus() {
previous_focus_ = mainApp->focusWidget();
if (previous_focus_ != nullptr) {
- connect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
+ connect(previous_focus_, &QWidget::destroyed, this, &LograyMainWindow::resetPreviousFocus);
}
}
@@ -3148,7 +3182,7 @@ void LograyMainWindow::goToCancelClicked()
{
main_ui_->goToFrame->animatedHide();
if (previous_focus_) {
- disconnect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
+ disconnect(previous_focus_, &QWidget::destroyed, this, &LograyMainWindow::resetPreviousFocus);
previous_focus_->setFocus();
resetPreviousFocus();
}
@@ -3183,20 +3217,21 @@ void LograyMainWindow::showResolvedAddressesDialog()
void LograyMainWindow::showConversationsDialog()
{
ConversationDialog *conv_dialog = new ConversationDialog(*this, capture_file_);
- connect(conv_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(conv_dialog, SIGNAL(openFollowStreamDialog(int, guint, guint)),
- this, SLOT(openFollowStreamDialog(int, guint, guint)));
+ connect(conv_dialog, &ConversationDialog::filterAction, this, &LograyMainWindow::filterAction);
+ connect(conv_dialog, &ConversationDialog::openFollowStreamDialog, this,
+ [=](int proto_id, unsigned stream_num, unsigned sub_stream_num) {
+ openFollowStreamDialog(proto_id, stream_num, sub_stream_num);
+ });
conv_dialog->show();
}
void LograyMainWindow::showEndpointsDialog()
{
EndpointDialog *endp_dialog = new EndpointDialog(*this, capture_file_);
- connect(endp_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(endp_dialog, SIGNAL(openFollowStreamDialog(int)),
- this, SLOT(openFollowStreamDialog(int)));
+ connect(endp_dialog, &EndpointDialog::filterAction, this, &LograyMainWindow::filterAction);
+ connect(endp_dialog, &EndpointDialog::openFollowStreamDialog, this,
+ [=](int proto_id) {openFollowStreamDialog(proto_id);
+ });
endp_dialog->show();
}
@@ -3214,9 +3249,9 @@ void LograyMainWindow::externalMenuItemTriggered()
entry = (ext_menubar_t *)v.value<void *>();
if (entry->type == EXT_MENUBAR_ITEM) {
- entry->callback(EXT_MENUBAR_QT_GUI, (gpointer)((void *)main_ui_), entry->user_data);
+ entry->callback(EXT_MENUBAR_QT_GUI, (void *)((void *)main_ui_), entry->user_data);
} else {
- QDesktopServices::openUrl(QUrl(QString((gchar *)entry->user_data)));
+ QDesktopServices::openUrl(QUrl(QString((char *)entry->user_data)));
}
}
}
@@ -3241,14 +3276,12 @@ void LograyMainWindow::showExtcapOptionsDialog(QString &device_name, bool startC
extcap_options_dialog->setModal(true);
extcap_options_dialog->setAttribute(Qt::WA_DeleteOnClose);
if (startCaptureOnClose) {
- connect(extcap_options_dialog, SIGNAL(finished(int)),
- this, SLOT(extcap_options_finished(int)));
+ connect(extcap_options_dialog, &ExtcapOptionsDialog::finished, this, &LograyMainWindow::extcap_options_finished);
}
#ifdef HAVE_LIBPCAP
if (capture_options_dialog_ && startCaptureOnClose) {
/* Allow capture options dialog to close */
- connect(extcap_options_dialog, SIGNAL(accepted()),
- capture_options_dialog_, SLOT(accept()));
+ connect(extcap_options_dialog, &ExtcapOptionsDialog::accepted, capture_options_dialog_, &CaptureOptionsDialog::accept);
}
#endif
extcap_options_dialog->show();
diff --git a/ui/macosx/cocoa_bridge.h b/ui/macosx/cocoa_bridge.h
index 4665fc29..5cf01dd6 100644
--- a/ui/macosx/cocoa_bridge.h
+++ b/ui/macosx/cocoa_bridge.h
@@ -1,6 +1,6 @@
/** @file
*
- * This code was taken directly from:
+ * This code is based upon:
* https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar
*
* Wireshark - Network traffic analyzer
@@ -21,6 +21,8 @@ class CocoaBridge
public:
static void cleanOSGeneratedMenuItems();
+ static void showInFinder(char const *file_path);
+
};
#endif // COCOABRIDGE_H
diff --git a/ui/macosx/cocoa_bridge.mm b/ui/macosx/cocoa_bridge.mm
index 909bf223..4f20d4f7 100644
--- a/ui/macosx/cocoa_bridge.mm
+++ b/ui/macosx/cocoa_bridge.mm
@@ -1,8 +1,5 @@
/* cocoa_bridge.mm
*
- * This code was taken directly from:
- * https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar
- *
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
@@ -17,6 +14,9 @@
void CocoaBridge::cleanOSGeneratedMenuItems()
{
+ // This code was taken directly from:
+ // https://forum.qt.io/topic/82609/remove-native-mac-menu-items-such-as-show-tab-bar
+
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER
// Remove (don't allow) the "Show Tab Bar" menu item from the "View" menu, if
// supported
@@ -33,3 +33,10 @@ void CocoaBridge::cleanOSGeneratedMenuItems()
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSDisabledCharacterPaletteMenuItem"];
}
+
+void CocoaBridge::showInFinder(char const *file_path)
+{
+ NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:file_path]];
+
+ [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[url]];
+}
diff --git a/ui/main_statusbar.h b/ui/main_statusbar.h
index c8dd3c0e..32e7ec00 100644
--- a/ui/main_statusbar.h
+++ b/ui/main_statusbar.h
@@ -28,7 +28,7 @@ void status_capture_comment_update(void);
*
* @param msg_format The format string for the message
*/
-void statusbar_push_field_msg(const gchar *msg_format, ...)
+void statusbar_push_field_msg(const char *msg_format, ...)
G_GNUC_PRINTF(1, 2);
/** Pop a message referring to the currently-selected field off the statusbar.
@@ -40,7 +40,7 @@ void statusbar_pop_field_msg(void);
*
* @param msg_format The format string for the message
*/
-void statusbar_push_filter_msg(const gchar *msg_format, ...)
+void statusbar_push_filter_msg(const char *msg_format, ...)
G_GNUC_PRINTF(1, 2);
/** Pop a message referring to the current filter off the statusbar.
@@ -52,7 +52,7 @@ void statusbar_pop_filter_msg(void);
*
* @param msg_format The format string for the message
*/
-void statusbar_push_temporary_msg(const gchar *msg_format, ...)
+void statusbar_push_temporary_msg(const char *msg_format, ...)
G_GNUC_PRINTF(1, 2);
#ifdef __cplusplus
diff --git a/ui/mcast_stream.c b/ui/mcast_stream.c
index 44f8f22e..1993bfc7 100644
--- a/ui/mcast_stream.c
+++ b/ui/mcast_stream.c
@@ -34,22 +34,22 @@
#include "ui/mcast_stream.h"
-gint32 mcast_stream_trigger = 50; /* limit for triggering the burst alarm (in packets per second) */
-gint32 mcast_stream_bufferalarm = 10000; /* limit for triggering the buffer alarm (in bytes) */
-guint16 mcast_stream_burstint = 100; /* burst interval in ms */
-gint32 mcast_stream_emptyspeed = 5000; /* outgoing speed for single stream (kbps)*/
-gint32 mcast_stream_cumulemptyspeed = 100000; /* outgoiong speed for all streams (kbps)*/
+int32_t mcast_stream_trigger = 50; /* limit for triggering the burst alarm (in packets per second) */
+int32_t mcast_stream_bufferalarm = 10000; /* limit for triggering the buffer alarm (in bytes) */
+uint16_t mcast_stream_burstint = 100; /* burst interval in ms */
+int32_t mcast_stream_emptyspeed = 5000; /* outgoing speed for single stream (kbps)*/
+int32_t mcast_stream_cumulemptyspeed = 100000; /* outgoing speed for all streams (kbps)*/
/* sliding window and buffer usage */
-static gint32 buffsize = (int)((double)MAX_SPEED * 100 / 1000) * 2;
-static guint16 comparetimes(nstime_t *t1, nstime_t *t2, guint16 burstint_lcl);
+static int32_t buffsize = (int)((double)MAX_SPEED * 100 / 1000) * 2;
+static uint16_t comparetimes(nstime_t *t1, nstime_t *t2, uint16_t burstint_lcl);
static void buffusagecalc(mcast_stream_info_t *strinfo, packet_info *pinfo, double emptyspeed_lcl);
static void slidingwindow(mcast_stream_info_t *strinfo, packet_info *pinfo);
/****************************************************************************/
/* GCompareFunc style comparison function for _mcast_stream_info */
-static gint
-mcast_stream_info_cmp(gconstpointer aa, gconstpointer bb)
+static int
+mcast_stream_info_cmp(const void *aa, const void *bb)
{
const struct _mcast_stream_info* a = (const struct _mcast_stream_info *)aa;
const struct _mcast_stream_info* b = (const struct _mcast_stream_info *)bb;
@@ -88,7 +88,7 @@ mcaststream_reset(mcaststream_tapinfo_t *tapinfo)
g_list_free(tapinfo->strinfo_list);
tapinfo->strinfo_list = NULL;
- /* XYZ and why does the line below causes a crach? */
+ /* XYZ and why does the line below causes a crash? */
/*g_free(tapinfo->allstreams->element.buff);*/
g_free(tapinfo->allstreams);
tapinfo->allstreams = NULL;
@@ -147,13 +147,13 @@ mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const
switch (pinfo->net_dst.type) {
case AT_IPv4:
/* 224.0.0.0/4 */
- if (pinfo->net_dst.len == 0 || (((const guint8*)pinfo->net_dst.data)[0] & 0xf0) != 0xe0)
+ if (pinfo->net_dst.len == 0 || (((const uint8_t*)pinfo->net_dst.data)[0] & 0xf0) != 0xe0)
return TAP_PACKET_DONT_REDRAW;
break;
case AT_IPv6:
/* ff00::/8 */
/* XXX This includes DHCPv6. */
- if (pinfo->net_dst.len == 0 || ((const guint8*)pinfo->net_dst.data)[0] != 0xff)
+ if (pinfo->net_dst.len == 0 || ((const uint8_t*)pinfo->net_dst.data)[0] != 0xff)
return TAP_PACKET_DONT_REDRAW;
break;
default:
@@ -288,7 +288,7 @@ remove_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
{
if (tapinfo && tapinfo->is_registered) {
remove_tap_listener(tapinfo);
- tapinfo->is_registered = FALSE;
+ tapinfo->is_registered = false;
}
}
@@ -311,7 +311,7 @@ register_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
mcaststream_draw, NULL);
if (NULL == error_string) {
- tapinfo->is_registered = TRUE;
+ tapinfo->is_registered = true;
}
return error_string;
}
@@ -320,8 +320,8 @@ register_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
/* sliding window and buffer calculations */
/* compare two times */
-static guint16
-comparetimes(nstime_t *t1, nstime_t *t2, guint16 burstint_lcl)
+static uint16_t
+comparetimes(nstime_t *t1, nstime_t *t2, uint16_t burstint_lcl)
{
if(((t2->secs - t1->secs)*1000 + (t2->nsecs - t1->nsecs)/1000000) > burstint_lcl){
return 1;
@@ -334,7 +334,7 @@ comparetimes(nstime_t *t1, nstime_t *t2, guint16 burstint_lcl)
static void
buffusagecalc(mcast_stream_info_t *strinfo, packet_info *pinfo, double emptyspeed_lcl)
{
- gint32 cur, prev;
+ int32_t cur, prev;
nstime_t *buffer;
nstime_t delta;
double timeelapsed;
@@ -359,7 +359,7 @@ buffusagecalc(mcast_stream_info_t *strinfo, packet_info *pinfo, double emptyspee
strinfo->element.buffusage+=pinfo->fd->pkt_len;
/* bytes cleared from buffer */
- strinfo->element.buffusage-= (guint32) (timeelapsed * emptyspeed_lcl / 8);
+ strinfo->element.buffusage-= (uint32_t) (timeelapsed * emptyspeed_lcl / 8);
if(strinfo->element.buffusage < 0) strinfo->element.buffusage=0;
if(strinfo->element.buffusage > strinfo->element.topbuffusage)
@@ -380,7 +380,7 @@ static void
slidingwindow(mcast_stream_info_t *strinfo, packet_info *pinfo)
{
nstime_t *buffer;
- gint32 diff;
+ int32_t diff;
buffer = strinfo->element.buff;
diff --git a/ui/mcast_stream.h b/ui/mcast_stream.h
index fc5c5983..09eee0f3 100644
--- a/ui/mcast_stream.h
+++ b/ui/mcast_stream.h
@@ -29,17 +29,17 @@ extern "C" {
/* typedefs for sliding window and buffer size */
typedef struct buffer{
nstime_t *buff; /* packet times */
- gint32 first; /* pointer to the first element */
- gint32 last; /* pointer to the last element */
- gint32 burstsize; /* current burst */
- gint32 topburstsize; /* maximum burst in the refresh interval*/
- gint32 count; /* packet counter */
- gint32 burststatus; /* burst status */
- gint32 numbursts; /* number of bursts */
- gint32 buffusage; /* buffer usage */
- gint32 buffstatus; /* buffer status */
- gint32 numbuffalarms; /* number of alarms triggered by buffer underruns */
- gint32 topbuffusage; /* top buffer usage in refresh interval */
+ int32_t first; /* pointer to the first element */
+ int32_t last; /* pointer to the last element */
+ int32_t burstsize; /* current burst */
+ int32_t topburstsize; /* maximum burst in the refresh interval*/
+ int32_t count; /* packet counter */
+ int32_t burststatus; /* burst status */
+ int32_t numbursts; /* number of bursts */
+ int32_t buffusage; /* buffer usage */
+ int32_t buffstatus; /* buffer status */
+ int32_t numbuffalarms; /* number of alarms triggered by buffer underruns */
+ int32_t topbuffusage; /* top buffer usage in refresh interval */
double maxbw; /* Maximum bandwidth usage. Bits/s */
} t_buffer;
@@ -47,20 +47,20 @@ typedef struct buffer{
/* defines an mcast stream */
typedef struct _mcast_stream_info {
address src_addr;
- guint16 src_port;
+ uint16_t src_port;
address dest_addr;
- guint16 dest_port;
- guint32 npackets;
+ uint16_t dest_port;
+ uint32_t npackets;
double apackets;
- guint32 total_bytes;
+ uint32_t total_bytes;
double average_bw; /* Bits/s */
- guint32 first_frame_num; /* frame number of first frame */
+ uint32_t first_frame_num; /* frame number of first frame */
/* start of recording (GMT) of this stream */
nstime_t start_abs; /* absolute stream start time */
nstime_t start_rel; /* stream start time relative to first packet in capture */
nstime_t stop_rel; /* stream stop time relative to first packet in capture */
- guint16 vlan_id;
+ uint16_t vlan_id;
/*for the sliding window */
t_buffer element;
@@ -75,22 +75,22 @@ typedef void (*mcaststream_tap_draw_cb)(mcaststream_tapinfo_t *tapinfo);
/* structure that holds the information about all detected streams */
/* struct holding all information of the tap */
struct _mcaststream_tapinfo {
- gpointer user_data; /* User data pointer */
+ void *user_data; /* User data pointer */
mcaststream_tap_reset_cb tap_reset; /**< tap reset callback */
mcaststream_tap_draw_cb tap_draw; /**< tap draw callback */
GList* strinfo_list; /* list of mcast_stream_info_t */
- guint32 npackets; /* total number of mcast packets of all streams */
+ uint32_t npackets; /* total number of mcast packets of all streams */
mcast_stream_info_t* allstreams; /* structure holding information common for all streams */
- gboolean is_registered; /* if the tap listener is currently registered or not */
+ bool is_registered; /* if the tap listener is currently registered or not */
};
-extern gint32 mcast_stream_trigger;
-extern gint32 mcast_stream_bufferalarm;
-extern guint16 mcast_stream_burstint;
-extern gint32 mcast_stream_emptyspeed;
-extern gint32 mcast_stream_cumulemptyspeed;
+extern int32_t mcast_stream_trigger;
+extern int32_t mcast_stream_bufferalarm;
+extern uint16_t mcast_stream_burstint;
+extern int32_t mcast_stream_emptyspeed;
+extern int32_t mcast_stream_cumulemptyspeed;
/****************************************************************************/
/* INTERFACE */
diff --git a/ui/packet_list_utils.c b/ui/packet_list_utils.c
index ce5a6d27..d6c13848 100644
--- a/ui/packet_list_utils.c
+++ b/ui/packet_list_utils.c
@@ -11,19 +11,22 @@
#include "config.h"
+#include <stdint.h>
+#include <stdbool.h>
#include "packet_list_utils.h"
#include <epan/column.h>
-gboolean
-right_justify_column (gint col, capture_file *cf)
+bool
+right_justify_column (int col, capture_file *cf)
{
header_field_info *hfi;
- gboolean right_justify = FALSE;
- guint num_fields, *field_idx, ii;
- guint right_justify_count = 0;
+ bool right_justify = false;
+ unsigned num_fields, ii;
+ col_custom_t *col_custom;
+ unsigned right_justify_count = 0;
- if (!cf) return FALSE;
+ if (!cf) return false;
switch (cf->cinfo.columns[col].col_fmt) {
@@ -37,16 +40,23 @@ right_justify_column (gint col, capture_file *cf)
case COL_DEF_SRC_PORT:
case COL_DELTA_TIME:
case COL_DELTA_TIME_DIS:
- right_justify = TRUE;
+ right_justify = true;
break;
case COL_CUSTOM:
num_fields = g_slist_length(cf->cinfo.columns[col].col_custom_fields_ids);
for (ii = 0; ii < num_fields; ii++) {
- field_idx = (guint *) g_slist_nth_data(cf->cinfo.columns[col].col_custom_fields_ids, ii);
- hfi = proto_registrar_get_nth(*field_idx);
+ col_custom = (col_custom_t *) g_slist_nth_data(cf->cinfo.columns[col].col_custom_fields_ids, ii);
+ if (col_custom->field_id == 0) {
+ /* XXX - If there were some way to check the compiled dfilter's
+ * expected return type, we could use that.
+ */
+ return false;
+ }
+ hfi = proto_registrar_get_nth(col_custom->field_id);
/* Check if this is a valid field and we have no strings lookup table */
+ /* XXX - We should check every hfi with the same abbreviation */
if ((hfi != NULL) && ((hfi->strings == NULL) || !get_column_resolved(col))) {
/* Check for bool, framenum, double, float, relative time and decimal/octal integer types */
if ((hfi->type == FT_BOOLEAN) || (hfi->type == FT_FRAMENUM) || (hfi->type == FT_DOUBLE) ||
@@ -61,7 +71,7 @@ right_justify_column (gint col, capture_file *cf)
if ((num_fields > 0) && (right_justify_count == num_fields)) {
/* All custom fields must meet the right-justify criteria */
- right_justify = TRUE;
+ right_justify = true;
}
break;
@@ -72,22 +82,32 @@ right_justify_column (gint col, capture_file *cf)
return right_justify;
}
-gboolean
-resolve_column (gint col, capture_file *cf)
+bool
+resolve_column (int col, capture_file *cf)
{
header_field_info *hfi;
- gboolean resolve = FALSE;
- guint num_fields, *field_idx, ii;
+ bool resolve = false;
+ unsigned num_fields, ii;
+ col_custom_t *col_custom;
- if (!cf) return FALSE;
+ if (!cf) return false;
switch (cf->cinfo.columns[col].col_fmt) {
case COL_CUSTOM:
num_fields = g_slist_length(cf->cinfo.columns[col].col_custom_fields_ids);
for (ii = 0; ii < num_fields; ii++) {
- field_idx = (guint *) g_slist_nth_data(cf->cinfo.columns[col].col_custom_fields_ids, ii);
- hfi = proto_registrar_get_nth(*field_idx);
+ col_custom = (col_custom_t *) g_slist_nth_data(cf->cinfo.columns[col].col_custom_fields_ids, ii);
+ if (col_custom->field_id == 0) {
+ /* XXX - A "resolved" string might be conceivable for certain
+ * expressions, but would require being able to know which
+ * hfinfo produced each value, if there are multiple hfi with
+ * the same abbreviation.
+ */
+ continue;
+ }
+ hfi = proto_registrar_get_nth(col_custom->field_id);
+ /* XXX - We should check every hfi with the same abbreviation */
/* Check if we have an OID, a (potentially) resolvable network
* address, a Boolean, or a strings table with integer values */
@@ -98,7 +118,7 @@ resolve_column (gint col, capture_file *cf)
((hfi->strings != NULL) &&
(FT_IS_INT(hfi->type) || FT_IS_UINT(hfi->type))))
{
- resolve = TRUE;
+ resolve = true;
break;
}
}
diff --git a/ui/packet_list_utils.h b/ui/packet_list_utils.h
index ce495e1c..2ffc6c81 100644
--- a/ui/packet_list_utils.h
+++ b/ui/packet_list_utils.h
@@ -22,9 +22,9 @@ extern "C" {
* @param [in] col The column number.
* @param [in] cf The capture file containing the packet data.
*
- * @return TRUE if the column should be right justified, FALSE otherwise.
+ * @return true if the column should be right justified, false otherwise.
*/
-gboolean right_justify_column (gint col, capture_file *cf);
+bool right_justify_column (int col, capture_file *cf);
/**
* Check to see if a column's data should be resolved.
@@ -32,9 +32,9 @@ gboolean right_justify_column (gint col, capture_file *cf);
* @param [in] col The column number.
* @param [in] cf The capture file containing the packet data.
*
- * @return TRUE if resolution is required, FALSE otherwise.
+ * @return true if resolution is required, false otherwise.
*/
-gboolean resolve_column (gint col, capture_file *cf);
+bool resolve_column (int col, capture_file *cf);
/**
* @brief The following methods have to be implemented by any class that
@@ -51,10 +51,11 @@ extern void packet_list_clear(void);
extern void packet_list_freeze(void);
extern void packet_list_recreate_visible_rows(void);
extern void packet_list_thaw(void);
-extern guint packet_list_append(column_info *cinfo, frame_data *fdata);
+extern unsigned packet_list_append(column_info *cinfo, frame_data *fdata);
extern void packet_list_queue_draw(void);
-extern gboolean packet_list_select_row_from_data(frame_data *fdata_needle);
-extern gboolean packet_list_multi_select_active(void);
+extern bool packet_list_select_row_from_data(frame_data *fdata_needle);
+extern bool packet_list_select_finfo(field_info *fi);
+extern bool packet_list_multi_select_active(void);
#ifdef __cplusplus
}
diff --git a/ui/packet_range.c b/ui/packet_range.c
index e0ec7db1..5167927a 100644
--- a/ui/packet_range.c
+++ b/ui/packet_range.c
@@ -28,7 +28,7 @@ depended_frames_add(GHashTable* depended_table, frame_data_sequence *frames, fra
{
if (g_hash_table_add(depended_table, GUINT_TO_POINTER(frame->num)) && frame->dependent_frames) {
GHashTableIter iter;
- gpointer key;
+ void *key;
frame_data *depended_fd;
g_hash_table_iter_init(&iter, frame->dependent_frames);
while (g_hash_table_iter_next(&iter, &key, NULL)) {
@@ -40,11 +40,11 @@ depended_frames_add(GHashTable* depended_table, frame_data_sequence *frames, fra
/* (re-)calculate the packet counts (except the user specified range) */
static void packet_range_calc(packet_range_t *range) {
- guint32 framenum;
- guint32 mark_low;
- guint32 mark_high;
- guint32 displayed_mark_low;
- guint32 displayed_mark_high;
+ uint32_t framenum;
+ uint32_t mark_low;
+ uint32_t mark_high;
+ uint32_t displayed_mark_low;
+ uint32_t displayed_mark_high;
frame_data *packet;
@@ -177,7 +177,7 @@ static void packet_range_calc(packet_range_t *range) {
/* (re-)calculate the user specified packet range counts */
static void packet_range_calc_user(packet_range_t *range) {
- guint32 framenum;
+ uint32_t framenum;
frame_data *packet;
range->user_range_cnt = 0;
@@ -232,7 +232,7 @@ static void packet_range_calc_user(packet_range_t *range) {
}
static void packet_range_calc_selection(packet_range_t *range) {
- guint32 framenum;
+ uint32_t framenum;
frame_data *packet;
range->selection_range_cnt = 0;
@@ -320,9 +320,9 @@ convert_ret_t packet_range_check(packet_range_t *range) {
void packet_range_process_init(packet_range_t *range) {
/* Check that, if an explicit range was selected, it's valid. */
/* "enumeration" values */
- range->marked_range_active = FALSE;
+ range->marked_range_active = false;
- if (range->process_filtered == FALSE) {
+ if (range->process_filtered == false) {
range->marked_range_left = range->mark_range_cnt;
} else {
range->marked_range_left = range->displayed_mark_range_cnt;
@@ -333,7 +333,7 @@ void packet_range_process_init(packet_range_t *range) {
}
/* do we have to process all packets? */
-gboolean packet_range_process_all(packet_range_t *range) {
+bool packet_range_process_all(packet_range_t *range) {
return range->process == range_process_all && !range->process_filtered && !range->remove_ignored;
}
@@ -343,7 +343,7 @@ packet_range_process_packet_include_depends(packet_range_t *range, frame_data *f
switch(range->process) {
case(range_process_all):
if (range->process_filtered) {
- if ((fdata->passed_dfilter || fdata->dependent_of_displayed) == FALSE) {
+ if ((fdata->passed_dfilter || fdata->dependent_of_displayed) == false) {
return range_process_next;
}
}
@@ -422,12 +422,12 @@ range_process_e packet_range_process_packet(packet_range_t *range, frame_data *f
case(range_process_all):
break;
case(range_process_selected):
- if (value_is_in_range(range->selection_range, fdata->num) == FALSE) {
+ if (value_is_in_range(range->selection_range, fdata->num) == false) {
return range_process_next;
}
break;
case(range_process_marked):
- if (fdata->marked == FALSE) {
+ if (fdata->marked == false) {
return range_process_next;
}
break;
@@ -435,20 +435,20 @@ range_process_e packet_range_process_packet(packet_range_t *range, frame_data *f
if (range->marked_range_left == 0) {
return range_processing_finished;
}
- if (fdata->marked == TRUE) {
- range->marked_range_active = TRUE;
+ if (fdata->marked == true) {
+ range->marked_range_active = true;
}
- if (range->marked_range_active == FALSE ) {
+ if (range->marked_range_active == false ) {
return range_process_next;
}
if (!range->process_filtered ||
- (range->process_filtered && fdata->passed_dfilter == TRUE))
+ (range->process_filtered && fdata->passed_dfilter == true))
{
range->marked_range_left--;
}
break;
case(range_process_user_range):
- if (value_is_in_range(range->user_range, fdata->num) == FALSE) {
+ if (value_is_in_range(range->user_range, fdata->num) == false) {
return range_process_next;
}
break;
@@ -460,7 +460,7 @@ range_process_e packet_range_process_packet(packet_range_t *range, frame_data *f
* Try next (if we're including dependent packets we called the
* other function above).
*/
- if ((range->process_filtered && fdata->passed_dfilter == FALSE)) {
+ if ((range->process_filtered && fdata->passed_dfilter == false)) {
return range_process_next;
}
@@ -476,7 +476,7 @@ range_process_e packet_range_process_packet(packet_range_t *range, frame_data *f
* the Save/Print-As widget.
*/
-void packet_range_convert_str(packet_range_t *range, const gchar *es)
+void packet_range_convert_str(packet_range_t *range, const char *es)
{
range_t *new_range;
convert_ret_t ret;
@@ -537,3 +537,115 @@ void packet_range_convert_selection_str(packet_range_t *range, const char *es)
/* calculate new user specified packet range counts */
packet_range_calc_selection(range);
}
+
+uint32_t packet_range_count(const packet_range_t *range)
+{
+ uint32_t count;
+ switch(range->process) {
+ case(range_process_all):
+ if (range->process_filtered) {
+ if (range->include_dependents) {
+ count = range->displayed_plus_dependents_cnt;
+ } else {
+ count = range->displayed_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->displayed_ignored_cnt;
+ }
+ } else {
+ count = range->cf->count;
+ if (range->remove_ignored) {
+ count -= range->ignored_cnt;
+ }
+ }
+ break;
+ case(range_process_selected):
+ if (range->process_filtered) {
+ if (range->include_dependents) {
+ count = range->displayed_selected_plus_depends_cnt;
+ } else {
+ count = range->displayed_selection_range_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->displayed_ignored_selection_range_cnt;
+ }
+ } else {
+ if (range->include_dependents) {
+ count = range->selected_plus_depends_cnt;
+ } else {
+ count = range->selection_range_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->ignored_selection_range_cnt;
+ }
+ }
+ break;
+ case(range_process_marked):
+ if (range->process_filtered) {
+ if (range->include_dependents) {
+ count = range->displayed_marked_plus_depends_cnt;
+ } else {
+ count = range->displayed_marked_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->displayed_ignored_marked_cnt;
+ }
+ } else {
+ if (range->include_dependents) {
+ count = range->marked_plus_depends_cnt;
+ } else {
+ count = range->cf->marked_count;
+ }
+ if (range->remove_ignored) {
+ count -= range->ignored_marked_cnt;
+ }
+ }
+ break;
+ case(range_process_marked_range):
+ if (range->process_filtered) {
+ if (range->include_dependents) {
+ count = range->displayed_mark_range_plus_depends_cnt;
+ } else {
+ count = range->displayed_mark_range_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->displayed_ignored_mark_range_cnt;
+ }
+ } else {
+ if (range->include_dependents) {
+ count = range->mark_range_plus_depends_cnt;
+ } else {
+ count = range->mark_range_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->ignored_mark_range_cnt;
+ }
+ }
+ break;
+ case(range_process_user_range):
+ if (range->process_filtered) {
+ if (range->include_dependents) {
+ count = range->displayed_user_range_plus_depends_cnt;
+ } else {
+ count = range->displayed_user_range_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->displayed_ignored_user_range_cnt;
+ }
+ } else {
+ if (range->include_dependents) {
+ count = range->user_range_plus_depends_cnt;
+ } else {
+ count = range->user_range_cnt;
+ }
+ if (range->remove_ignored) {
+ count -= range->ignored_user_range_cnt;
+ }
+ }
+ break;
+ default:
+ ws_assert_not_reached();
+ }
+
+ return count;
+}
diff --git a/ui/packet_range.h b/ui/packet_range.h
index 0328fc87..70727db4 100644
--- a/ui/packet_range.h
+++ b/ui/packet_range.h
@@ -26,7 +26,7 @@
extern "C" {
#endif /* __cplusplus */
-extern guint32 curr_selected_frame;
+extern uint32_t curr_selected_frame;
typedef enum {
range_process_all,
@@ -39,9 +39,9 @@ typedef enum {
typedef struct packet_range_tag {
/* values coming from the UI */
packet_range_e process; /* which range to process */
- gboolean process_filtered; /* captured or filtered packets */
- gboolean remove_ignored; /* remove ignored packets */
- gboolean include_dependents; /* True if packets which are dependents of others should be processed */
+ bool process_filtered; /* captured or filtered packets */
+ bool remove_ignored; /* remove ignored packets */
+ bool include_dependents; /* True if packets which are dependents of others should be processed */
/* user specified range(s) and, if null, error status */
range_t *user_range;
@@ -53,35 +53,35 @@ typedef struct packet_range_tag {
/* current packet counts (captured) */
capture_file *cf; /* Associated capture file. */
- guint32 mark_range_cnt; /* packets in marked range */
- guint32 user_range_cnt; /* packets in user specified range */
- guint32 selection_range_cnt; /* packets in the selected range */
- guint32 marked_plus_depends_cnt;
- guint32 mark_range_plus_depends_cnt;
- guint32 user_range_plus_depends_cnt;
- guint32 selected_plus_depends_cnt;
- guint32 ignored_cnt; /* packets ignored */
- guint32 ignored_marked_cnt; /* packets ignored and marked */
- guint32 ignored_mark_range_cnt; /* packets ignored in marked range */
- guint32 ignored_user_range_cnt; /* packets ignored in user specified range */
- guint32 ignored_selection_range_cnt; /* packets ignored in the selected range */
+ uint32_t mark_range_cnt; /* packets in marked range */
+ uint32_t user_range_cnt; /* packets in user specified range */
+ uint32_t selection_range_cnt; /* packets in the selected range */
+ uint32_t marked_plus_depends_cnt;
+ uint32_t mark_range_plus_depends_cnt;
+ uint32_t user_range_plus_depends_cnt;
+ uint32_t selected_plus_depends_cnt;
+ uint32_t ignored_cnt; /* packets ignored */
+ uint32_t ignored_marked_cnt; /* packets ignored and marked */
+ uint32_t ignored_mark_range_cnt; /* packets ignored in marked range */
+ uint32_t ignored_user_range_cnt; /* packets ignored in user specified range */
+ uint32_t ignored_selection_range_cnt; /* packets ignored in the selected range */
/* current packet counts (displayed) */
- guint32 displayed_cnt;
- guint32 displayed_plus_dependents_cnt;
- guint32 displayed_marked_cnt;
- guint32 displayed_mark_range_cnt;
- guint32 displayed_user_range_cnt;
- guint32 displayed_marked_plus_depends_cnt;
- guint32 displayed_mark_range_plus_depends_cnt;
- guint32 displayed_user_range_plus_depends_cnt;
- guint32 displayed_selection_range_cnt;
- guint32 displayed_selected_plus_depends_cnt;
- guint32 displayed_ignored_cnt;
- guint32 displayed_ignored_marked_cnt;
- guint32 displayed_ignored_mark_range_cnt;
- guint32 displayed_ignored_user_range_cnt;
- guint32 displayed_ignored_selection_range_cnt;
+ uint32_t displayed_cnt;
+ uint32_t displayed_plus_dependents_cnt;
+ uint32_t displayed_marked_cnt;
+ uint32_t displayed_mark_range_cnt;
+ uint32_t displayed_user_range_cnt;
+ uint32_t displayed_marked_plus_depends_cnt;
+ uint32_t displayed_mark_range_plus_depends_cnt;
+ uint32_t displayed_user_range_plus_depends_cnt;
+ uint32_t displayed_selection_range_cnt;
+ uint32_t displayed_selected_plus_depends_cnt;
+ uint32_t displayed_ignored_cnt;
+ uint32_t displayed_ignored_marked_cnt;
+ uint32_t displayed_ignored_mark_range_cnt;
+ uint32_t displayed_ignored_user_range_cnt;
+ uint32_t displayed_ignored_selection_range_cnt;
/* Sets of the chosen frames plus any they depend on for each case */
GHashTable *marked_plus_depends;
@@ -94,8 +94,8 @@ typedef struct packet_range_tag {
GHashTable *displayed_selected_plus_depends;
/* "enumeration" values */
- gboolean marked_range_active; /* marked range is currently processed */
- guint32 marked_range_left; /* marked range packets left to do */
+ bool marked_range_active; /* marked range is currently processed */
+ uint32_t marked_range_left; /* marked range packets left to do */
} packet_range_t;
typedef enum {
@@ -117,17 +117,20 @@ extern convert_ret_t packet_range_check(packet_range_t *range);
extern void packet_range_process_init(packet_range_t *range);
/* do we have to process all packets? */
-extern gboolean packet_range_process_all(packet_range_t *range);
+extern bool packet_range_process_all(packet_range_t *range);
/* do we have to process this packet? */
extern range_process_e packet_range_process_packet(packet_range_t *range, frame_data *fdata);
/* convert user given string to the internal user specified range representation */
-extern void packet_range_convert_str(packet_range_t *range, const gchar *es);
+extern void packet_range_convert_str(packet_range_t *range, const char *es);
/* convert user given string to the internal selection specified range representation */
-extern void packet_range_convert_selection_str(packet_range_t *range, const gchar *es);
+extern void packet_range_convert_selection_str(packet_range_t *range, const char *es);
+/* return the number of packets that will be processed.
+ */
+extern uint32_t packet_range_count(const packet_range_t *range);
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/ui/persfilepath_opt.c b/ui/persfilepath_opt.c
index feaeb74b..ee0d420f 100644
--- a/ui/persfilepath_opt.c
+++ b/ui/persfilepath_opt.c
@@ -24,14 +24,14 @@
* process command line option that affects the paths of the directories
* used for personal files (configuration, saved captures)
*/
-gboolean
+bool
persfilepath_opt(int opt _U_, const char *optstr)
{
- gchar *p, *colonp;
+ char *p, *colonp;
colonp = strchr(optstr, ':');
if (colonp == NULL) {
- return FALSE;
+ return false;
}
p = colonp;
@@ -51,7 +51,7 @@ persfilepath_opt(int opt _U_, const char *optstr)
* looks correct.
*/
*colonp = ':';
- return FALSE;
+ return false;
}
/* directory should be existing */
@@ -63,7 +63,7 @@ persfilepath_opt(int opt _U_, const char *optstr)
* looks correct.
*/
*colonp = ':';
- return FALSE;
+ return false;
}
if (strcmp(optstr,"persconf") == 0) {
@@ -72,8 +72,8 @@ persfilepath_opt(int opt _U_, const char *optstr)
set_persdatafile_dir(p);
} else {
/* XXX - might need to add the temp file path */
- return FALSE;
+ return false;
}
*colonp = ':'; /* put the colon back */
- return TRUE;
+ return true;
}
diff --git a/ui/persfilepath_opt.h b/ui/persfilepath_opt.h
index 8f04cc69..f408f71d 100644
--- a/ui/persfilepath_opt.h
+++ b/ui/persfilepath_opt.h
@@ -22,7 +22,7 @@ extern "C" {
* process command line option that affects the paths of the directories
* used for personal files (configuration, saved captures)
*/
-extern gboolean persfilepath_opt(int opt, const char *optstr);
+extern bool persfilepath_opt(int opt, const char *optstr);
#ifdef __cplusplus
}
diff --git a/ui/preference_utils.c b/ui/preference_utils.c
index 751b47b8..992596a7 100644
--- a/ui/preference_utils.c
+++ b/ui/preference_utils.c
@@ -38,6 +38,7 @@ prefs_to_capture_opts(void)
/* Set promiscuous mode from the preferences setting. */
/* the same applies to other preferences settings as well. */
global_capture_opts.default_options.promisc_mode = prefs.capture_prom_mode;
+ global_capture_opts.default_options.monitor_mode = prefs.capture_monitor_mode;
global_capture_opts.use_pcapng = prefs.capture_pcap_ng;
global_capture_opts.show_info = prefs.capture_show_info;
global_capture_opts.real_time_mode = prefs.capture_real_time;
@@ -93,7 +94,7 @@ prefs_store_ext_helper(const char * module_name, const char *pref_name, const ch
if (!pref)
return 0;
- if (prefs_get_type(pref) == PREF_STRING )
+ if (prefs_get_type(pref) == PREF_STRING || prefs_get_type(pref) == PREF_DISSECTOR)
{
pref_changed |= prefs_set_string_value(pref, pref_value, pref_stashed);
if ( !pref_changed || prefs_get_string_value(pref, pref_stashed) != 0 )
@@ -123,10 +124,10 @@ prefs_store_ext(const char * module_name, const char *pref_name, const char *pre
return 0;
}
-gboolean
+bool
prefs_store_ext_multiple(const char * module, GHashTable * pref_values)
{
- gboolean pref_changed = FALSE;
+ bool pref_changed = false;
GList * keys = NULL;
if ( !prefs_is_registered_protocol(module))
@@ -138,13 +139,13 @@ prefs_store_ext_multiple(const char * module, GHashTable * pref_values)
for ( GList * key = keys; key != NULL; key = g_list_next(key) )
{
- gchar * pref_name = (gchar *)key->data;
- gchar * pref_value = (gchar *) g_hash_table_lookup(pref_values, key->data);
+ char * pref_name = (char *)key->data;
+ char * pref_value = (char *) g_hash_table_lookup(pref_values, key->data);
if ( pref_name && pref_value )
{
if ( prefs_store_ext_helper(module, pref_name, pref_value) )
- pref_changed = TRUE;
+ pref_changed = true;
}
}
g_list_free(keys);
@@ -156,15 +157,15 @@ prefs_store_ext_multiple(const char * module, GHashTable * pref_values)
prefs_to_capture_opts();
}
- return TRUE;
+ return true;
}
-gint
-column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_fields, gint position)
+int
+column_prefs_add_custom(int fmt, const char *title, const char *custom_fields, int position)
{
GList *clp;
fmt_data *cfmt, *last_cfmt;
- gint colnr;
+ int colnr;
cfmt = g_new(fmt_data, 1);
/*
@@ -176,17 +177,18 @@ column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_fields
cfmt->fmt = fmt;
cfmt->custom_fields = g_strdup(custom_fields);
cfmt->custom_occurrence = 0;
- cfmt->resolved = TRUE;
+ cfmt->resolved = true;
colnr = g_list_length(prefs.col_list);
if (custom_fields) {
- cfmt->visible = TRUE;
+ cfmt->visible = true;
clp = g_list_last(prefs.col_list);
last_cfmt = (fmt_data *) clp->data;
if (position > 0 && position <= colnr) {
/* Custom fields may be added at any position, depending on the given argument */
- prefs.col_list = g_list_insert(prefs.col_list, cfmt, position);
+ colnr = position;
+ prefs.col_list = g_list_insert(prefs.col_list, cfmt, colnr);
} else if (last_cfmt->fmt == COL_INFO) {
/* Last column is COL_INFO, add custom column before this */
colnr -= 1;
@@ -195,21 +197,22 @@ column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_fields
prefs.col_list = g_list_append(prefs.col_list, cfmt);
}
} else {
- cfmt->visible = FALSE; /* Will be set to TRUE in visible_toggled() when added to list */
+ cfmt->visible = false; /* Will be set to true in visible_toggled() when added to list */
prefs.col_list = g_list_append(prefs.col_list, cfmt);
}
+ recent_insert_column(colnr);
return colnr;
}
-gint
-column_prefs_has_custom(const gchar *custom_field)
+int
+column_prefs_has_custom(const char *custom_field)
{
GList *clp;
fmt_data *cfmt;
- gint colnr = -1;
+ int colnr = -1;
- for (gint i = 0; i < prefs.num_cols; i++) {
+ for (int i = 0; i < prefs.num_cols; i++) {
clp = g_list_nth(prefs.col_list, i);
if (clp == NULL) /* Sanity check, invalid column requested */
continue;
@@ -224,25 +227,25 @@ column_prefs_has_custom(const gchar *custom_field)
return colnr;
}
-gboolean
-column_prefs_custom_resolve(const gchar* custom_field)
+bool
+column_prefs_custom_resolve(const char* custom_field)
{
- gchar **fields;
+ char **fields;
header_field_info *hfi;
bool resolve = false;
fields = g_regex_split_simple(COL_CUSTOM_PRIME_REGEX, custom_field,
- (GRegexCompileFlags) (G_REGEX_ANCHORED | G_REGEX_RAW),
- G_REGEX_MATCH_ANCHORED);
+ (GRegexCompileFlags) (G_REGEX_RAW),
+ 0);
- for (guint i = 0; i < g_strv_length(fields); i++) {
+ for (unsigned i = 0; i < g_strv_length(fields); i++) {
if (fields[i] && *fields[i]) {
hfi = proto_registrar_get_byname(fields[i]);
if (hfi && ((hfi->type == FT_OID) || (hfi->type == FT_REL_OID) || (hfi->type == FT_ETHER) || (hfi->type == FT_IPv4) || (hfi->type == FT_IPv6) || (hfi->type == FT_FCWWN) || (hfi->type == FT_BOOLEAN) ||
((hfi->strings != NULL) &&
(FT_IS_INT(hfi->type) || FT_IS_UINT(hfi->type)))))
{
- resolve = TRUE;
+ resolve = true;
break;
}
}
@@ -270,12 +273,13 @@ column_prefs_remove_link(GList *col_link)
}
void
-column_prefs_remove_nth(gint col)
+column_prefs_remove_nth(int col)
{
column_prefs_remove_link(g_list_nth(prefs.col_list, col));
+ recent_remove_column(col);
}
-void save_migrated_uat(const char *uat_name, gboolean *old_pref)
+void save_migrated_uat(const char *uat_name, bool *old_pref)
{
char *err = NULL;
@@ -287,7 +291,7 @@ void save_migrated_uat(const char *uat_name, gboolean *old_pref)
// Ensure that any old preferences are removed after successful migration.
if (*old_pref) {
- *old_pref = FALSE;
+ *old_pref = false;
prefs_main_write();
}
}
diff --git a/ui/preference_utils.h b/ui/preference_utils.h
index f115f0a4..be9ad556 100644
--- a/ui/preference_utils.h
+++ b/ui/preference_utils.h
@@ -9,8 +9,10 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#ifndef __PREFRENCE_UTILS_H__
-#define __PREFRENCE_UTILS_H__
+#ifndef __PREFERENCE_UTILS_H__
+#define __PREFERENCE_UTILS_H__
+
+#include <glib.h>
#ifdef __cplusplus
extern "C" {
@@ -23,7 +25,7 @@ extern "C" {
/** If autoscroll in live captures is active or not
*/
-extern gboolean auto_scroll_live;
+extern bool auto_scroll_live;
/** Fill in capture options with values from the preferences
*/
@@ -57,7 +59,7 @@ extern unsigned int prefs_store_ext(const char * module, const char * key, const
*
* @return true if the value has been stored successfully
*/
-extern gboolean prefs_store_ext_multiple(const char * module, GHashTable * pref_values);
+extern bool prefs_store_ext_multiple(const char * module, GHashTable * pref_values);
/** Add a custom column.
*
@@ -68,9 +70,9 @@ extern gboolean prefs_store_ext_multiple(const char * module, GHashTable * pref_
*
* @return The index of the inserted column
*/
-gint column_prefs_add_custom(gint fmt, const gchar *title,
- const gchar *custom_field,
- gint position);
+int column_prefs_add_custom(int fmt, const char *title,
+ const char *custom_field,
+ int position);
/** Check if a custom column exists.
*
@@ -78,7 +80,7 @@ gint column_prefs_add_custom(gint fmt, const gchar *title,
*
* @return The index of the column if existing, -1 if not existing
*/
-gint column_prefs_has_custom(const gchar *custom_field);
+int column_prefs_has_custom(const char *custom_field);
/** Check if a custom column's data can be displayed differently
* resolved or unresolved, e.g. it has a field with a value string.
@@ -89,11 +91,11 @@ gint column_prefs_has_custom(const gchar *custom_field);
*
* @param custom_field column custom field
*
- * @return TRUE if a custom column with the field description
+ * @return true if a custom column with the field description
* would support being displayed differently resolved or unresolved,
- * FALSE otherwise.
+ * false otherwise.
*/
-gboolean column_prefs_custom_resolve(const gchar *custom_field);
+bool column_prefs_custom_resolve(const char *custom_field);
/** Remove a column.
*
@@ -105,15 +107,15 @@ void column_prefs_remove_link(GList* col_link);
*
* @param col Column number
*/
-void column_prefs_remove_nth(gint col);
+void column_prefs_remove_nth(int col);
/** Save the UAT and complete migration of old preferences by writing the main
* preferences file (if necessary).
*/
-void save_migrated_uat(const char *uat_name, gboolean *old_pref);
+void save_migrated_uat(const char *uat_name, bool *old_pref);
#ifdef __cplusplus
}
#endif /* __cplusplus */
-#endif /* __PREFRENCE_UTILS_H__ */
+#endif /* __PREFERENCE_UTILS_H__ */
diff --git a/ui/profile.c b/ui/profile.c
index 59687fac..04025fda 100644
--- a/ui/profile.c
+++ b/ui/profile.c
@@ -16,6 +16,9 @@
#include <glib.h>
+#include <epan/prefs.h>
+#include <epan/prefs-int.h>
+
#include <wsutil/filesystem.h>
#include "profile.h"
@@ -26,8 +29,8 @@
#include <wsutil/file_util.h>
#include <wsutil/ws_assert.h>
-static GList *current_profiles = NULL;
-static GList *edited_profiles = NULL;
+static GList *current_profiles;
+static GList *edited_profiles;
#define PROF_OPERATION_NEW 1
#define PROF_OPERATION_EDIT 2
@@ -40,9 +43,12 @@ GList * edited_profile_list(void) {
return g_list_first(edited_profiles);
}
+static void load_profile_settings(profile_def *profile);
+static void save_profile_settings(profile_def *profile);
+
static GList *
add_profile_entry(GList *fl, const char *profilename, const char *reference, int status,
- gboolean is_global, gboolean from_global, gboolean is_import)
+ bool is_global, bool from_global, bool is_import)
{
profile_def *profile;
@@ -65,19 +71,20 @@ remove_profile_entry(GList *fl, GList *fl_entry)
profile = (profile_def *) fl_entry->data;
g_free(profile->name);
g_free(profile->reference);
+ g_free(profile->auto_switch_filter);
g_free(profile);
list = g_list_remove_link(fl, fl_entry);
g_list_free_1(fl_entry);
return list;
}
-const gchar *
-get_profile_parent (const gchar *profilename)
+const char *
+get_profile_parent (const char *profilename)
{
GList *fl_entry = g_list_first(edited_profiles);
- guint no_edited = g_list_length(edited_profiles);
+ unsigned no_edited = g_list_length(edited_profiles);
profile_def *profile;
- guint i;
+ unsigned i;
if (fl_entry) {
/* We have edited profiles, find parent */
@@ -103,13 +110,13 @@ get_profile_parent (const gchar *profilename)
return profilename;
}
-gchar *apply_profile_changes(void)
+char *apply_profile_changes(void)
{
char *pf_dir_path, *pf_dir_path2, *pf_filename;
GList *fl1, *fl2;
profile_def *profile1, *profile2;
- gboolean found;
- gchar *err_msg;
+ bool found;
+ char *err_msg;
/* First validate all profile names */
fl1 = edited_profile_list();
@@ -117,7 +124,7 @@ gchar *apply_profile_changes(void)
profile1 = (profile_def *) fl1->data;
g_strstrip(profile1->name);
if ((err_msg = profile_name_is_valid(profile1->name)) != NULL) {
- gchar *message = ws_strdup_printf("%s\nProfiles unchanged.", err_msg);
+ char *message = ws_strdup_printf("%s\nProfiles unchanged.", err_msg);
g_free(err_msg);
return message;
}
@@ -186,7 +193,7 @@ gchar *apply_profile_changes(void)
profile1->status = PROF_STAT_EXISTS;
g_free (profile1->reference);
profile1->reference = g_strdup(profile1->name);
- profile1->is_import = FALSE;
+ profile1->is_import = false;
}
} else if (profile1->status == PROF_STAT_CHANGED) {
if (strcmp(profile1->reference, profile1->name)!=0) {
@@ -209,7 +216,7 @@ gchar *apply_profile_changes(void)
/* Last remove deleted */
fl1 = current_profile_list();
while (fl1) {
- found = FALSE;
+ found = false;
profile1 = (profile_def *) fl1->data;
fl2 = edited_profile_list();
while (fl2) {
@@ -217,12 +224,12 @@ gchar *apply_profile_changes(void)
if (!profile2->is_global) {
if (strcmp(profile1->name, profile2->name)==0) {
/* Profile exists in both lists */
- found = TRUE;
+ found = true;
} else if (strcmp(profile1->name, profile2->reference)==0) {
/* Profile has been renamed, update reference to the new name */
g_free (profile2->reference);
profile2->reference = g_strdup(profile2->name);
- found = TRUE;
+ found = true;
}
}
fl2 = g_list_next(fl2);
@@ -240,13 +247,24 @@ gchar *apply_profile_changes(void)
fl1 = g_list_next(fl1);
}
+ /* Save our profile settings */
+ for (fl1 = edited_profile_list() ; fl1 ; fl1 = fl1->next) {
+ profile1 = (profile_def *) fl1->data;
+ if (profile1->is_global) {
+ continue;
+ }
+ if (profile1->prefs_changed) {
+ save_profile_settings(profile1);
+ }
+ }
+
copy_profile_list();
return NULL;
}
GList *
add_to_profile_list(const char *name, const char *expression, int status,
- gboolean is_global, gboolean from_global, gboolean is_imported)
+ bool is_global, bool from_global, bool is_imported)
{
edited_profiles = add_profile_entry(edited_profiles, name, expression, status,
is_global, from_global, is_imported);
@@ -261,7 +279,7 @@ remove_from_profile_list(GList *fl_entry)
}
void
-empty_profile_list(gboolean edit_list)
+empty_profile_list(bool edit_list)
{
GList **flpp;
@@ -297,7 +315,7 @@ copy_profile_list(void)
flp_src = edited_profiles;
/* throw away the "old" destination list - a NULL list is ok here */
- empty_profile_list(FALSE);
+ empty_profile_list(false);
/* copy the list entries */
while(flp_src) {
@@ -305,7 +323,12 @@ copy_profile_list(void)
current_profiles = add_profile_entry(current_profiles, profile->name,
profile->reference, profile->status,
- profile->is_global, profile->from_global, FALSE);
+ profile->is_global, profile->from_global, false);
+ if (profile->auto_switch_filter) {
+ profile_def *new_profile = (profile_def *) g_list_last(current_profiles)->data;
+ new_profile->auto_switch_filter = g_strdup(profile->auto_switch_filter);
+ }
+
flp_src = g_list_next(flp_src);
}
}
@@ -315,16 +338,17 @@ init_profile_list(void)
{
WS_DIR *dir; /* scanned directory */
WS_DIRENT *file; /* current file */
- const gchar *name;
+ const char *name;
GList *local_profiles = NULL;
GList *global_profiles = NULL;
- GList *iter;
- gchar *profiles_dir, *filename;
+ GList *iter, *item;
+ char *profiles_dir, *filename;
- empty_profile_list(TRUE);
+ empty_profile_list(true);
/* Default entry */
- add_to_profile_list(DEFAULT_PROFILE, DEFAULT_PROFILE, PROF_STAT_DEFAULT, FALSE, FALSE, FALSE);
+ item = add_to_profile_list(DEFAULT_PROFILE, DEFAULT_PROFILE, PROF_STAT_DEFAULT, false, false, false);
+ load_profile_settings((profile_def *)item->data);
/* Local (user) profiles */
profiles_dir = get_profiles_dir();
@@ -344,8 +368,9 @@ init_profile_list(void)
local_profiles = g_list_sort(local_profiles, (GCompareFunc)g_ascii_strcasecmp);
for (iter = g_list_first(local_profiles); iter; iter = g_list_next(iter)) {
- name = (gchar *)iter->data;
- add_to_profile_list(name, name, PROF_STAT_EXISTS, FALSE, FALSE, FALSE);
+ name = (char *)iter->data;
+ item = add_to_profile_list(name, name, PROF_STAT_EXISTS, false, false, false);
+ load_profile_settings((profile_def *)item->data);
}
g_list_free_full(local_profiles, g_free);
@@ -367,8 +392,8 @@ init_profile_list(void)
global_profiles = g_list_sort(global_profiles, (GCompareFunc)g_ascii_strcasecmp);
for (iter = g_list_first(global_profiles); iter; iter = g_list_next(iter)) {
- name = (gchar *)iter->data;
- add_to_profile_list(name, name, PROF_STAT_EXISTS, TRUE, TRUE, FALSE);
+ name = (char *)iter->data;
+ add_to_profile_list(name, name, PROF_STAT_EXISTS, true, true, false);
}
g_list_free_full(global_profiles, g_free);
@@ -376,26 +401,26 @@ init_profile_list(void)
copy_profile_list ();
}
-gchar *
-profile_name_is_valid(const gchar *name)
+char *
+profile_name_is_valid(const char *name)
{
- gchar *reason = NULL;
- gchar *message;
+ char *reason = NULL;
+ char *message;
#ifdef _WIN32
char *invalid_dir_char = "\\/:*?\"<>|";
- gboolean invalid = FALSE;
+ bool invalid = false;
int i;
for (i = 0; i < 9; i++) {
if (strchr(name, invalid_dir_char[i])) {
/* Invalid character in directory */
- invalid = TRUE;
+ invalid = true;
}
}
if (name[0] == '.' || name[strlen(name)-1] == '.') {
/* Profile name cannot start or end with period */
- invalid = TRUE;
+ invalid = true;
}
if (invalid) {
reason = ws_strdup_printf("start or end with period (.), or contain any of the following characters:\n"
@@ -417,11 +442,11 @@ profile_name_is_valid(const gchar *name)
return NULL;
}
-gboolean delete_current_profile(void) {
- const gchar *name = get_profile_name();
+bool delete_current_profile(void) {
+ const char *name = get_profile_name();
char *pf_dir_path;
- if (profile_exists(name, FALSE) && strcmp (name, DEFAULT_PROFILE) != 0) {
+ if (profile_exists(name, false) && strcmp (name, DEFAULT_PROFILE) != 0) {
if (delete_persconffile_profile(name, &pf_dir_path) == -1) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't delete profile directory\n\"%s\":\n%s.",
@@ -429,8 +454,70 @@ gboolean delete_current_profile(void) {
g_free(pf_dir_path);
} else {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
+}
+
+// Use a settings file in case we ever want to include an author, description,
+// URL, etc.
+#define PROFILE_SETTINGS_FILENAME "profile_settings"
+#define AUTO_SWITCH_FILTER_KEY "auto_switch_filter"
+
+static char *get_profile_settings_path(const char *profile_name) {
+ char *profile_settings_path;
+ char *profile_dir = get_profile_dir(profile_name, false);
+ profile_settings_path = g_build_filename(profile_dir, PROFILE_SETTINGS_FILENAME, NULL);
+ g_free(profile_dir);
+
+ return profile_settings_path;
+}
+
+/* Set */
+static prefs_set_pref_e
+set_profile_setting(char *key, const char *value, void *profile_ptr, bool return_range_errors _U_)
+{
+ profile_def *profile = (profile_def *) profile_ptr;
+ if (strcmp(key, AUTO_SWITCH_FILTER_KEY) == 0) {
+ g_free(profile->auto_switch_filter);
+ profile->auto_switch_filter = g_strdup(value);
+ }
+
+ return PREFS_SET_OK;
+}
+
+static void load_profile_settings(profile_def *profile)
+{
+ char *profile_settings_path = get_profile_settings_path(profile->name);
+ FILE *fp;
+
+ if ((fp = ws_fopen(profile_settings_path, "r")) != NULL) {
+ read_prefs_file(profile_settings_path, fp, set_profile_setting, profile);
+ fclose(fp);
+ }
+ g_free(profile_settings_path);
+}
+
+void save_profile_settings(profile_def *profile)
+{
+ char *profile_settings_path = get_profile_settings_path(profile->name);
+ FILE *fp;
+
+ if ((fp = ws_fopen(profile_settings_path, "w")) == NULL) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "Can't open recent file\n\"%s\": %s.", profile_settings_path,
+ g_strerror(errno));
+ g_free(profile_settings_path);
+ return;
+ }
+ g_free(profile_settings_path);
+
+ fprintf(fp, "# \"%s\" profile settings file for %s " VERSION ". Edit with care.\n",
+ profile->name, get_configuration_namespace());
+
+ fprintf(fp, "\n# Automatically switch to this profile if this display filter matches.\n");
+ fprintf(fp, AUTO_SWITCH_FILTER_KEY ": %s\n", profile->auto_switch_filter);
+
+ fclose(fp);
}
diff --git a/ui/profile.h b/ui/profile.h
index ebec39b7..9fc89834 100644
--- a/ui/profile.h
+++ b/ui/profile.h
@@ -13,6 +13,8 @@
#ifndef __PROFILE_H__
#define __PROFILE_H__
+#include <glib.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -33,9 +35,12 @@ typedef struct {
char *name; /* profile name */
char *reference; /* profile reference */
int status;
- gboolean is_global;
- gboolean from_global;
- gboolean is_import;
+ bool is_global;
+ bool from_global;
+ bool is_import;
+ // Settings
+ bool prefs_changed;
+ char *auto_switch_filter;
} profile_def;
/** @file
@@ -59,7 +64,7 @@ void init_profile_list(void);
* @return A pointer to the new profile list
*/
GList *add_to_profile_list(const char *name, const char *parent, int status,
- gboolean is_global, gboolean from_global, gboolean is_import);
+ bool is_global, bool from_global, bool is_import);
/** Refresh the current (non-edited) profile list.
*/
@@ -69,7 +74,7 @@ void copy_profile_list(void);
*
* @param edit_list Remove edited entries
*/
-void empty_profile_list(gboolean edit_list);
+void empty_profile_list(bool edit_list);
/** Remove an entry from the profile list.
*
@@ -93,7 +98,7 @@ GList * edited_profile_list(void);
* @return NULL if the operation was successful or an error message otherwise.
* The error message must be freed by the caller.
*/
-gchar *apply_profile_changes(void);
+char *apply_profile_changes(void);
/** Given a profile name, return the name of its parent profile.
*
@@ -101,21 +106,21 @@ gchar *apply_profile_changes(void);
*
* @return Parent profile name
*/
-const gchar *get_profile_parent (const gchar *profilename);
+const char *get_profile_parent(const char *profilename);
/** Check the validity of a profile name.
*
* @param name Profile name
* @return NULL if the name is valid or an error message otherwise.
*/
-gchar *profile_name_is_valid(const gchar *name);
+char *profile_name_is_valid(const char *name);
/** Remove the current profile.
*
- * @return TRUE if the current profile exists and was successfully deleted
- * or FALSE otherwise.
+ * @return true if the current profile exists and was successfully deleted
+ * or false otherwise.
*/
-gboolean delete_current_profile(void);
+bool delete_current_profile(void);
#ifdef __cplusplus
}
diff --git a/ui/progress_dlg.h b/ui/progress_dlg.h
index bdcb147c..be788ae5 100644
--- a/ui/progress_dlg.h
+++ b/ui/progress_dlg.h
@@ -37,15 +37,15 @@ typedef struct progdlg progdlg_t;
* the main window.
* @param task_title The task to do, e.g. "Loading"
* @param item_title The item to do, e.g. "capture.cap"
- * @param terminate_is_stop TRUE if the operation can't be cancelled, just
+ * @param terminate_is_stop true if the operation can't be cancelled, just
* stopped (i.e., it has a "Stop" button and clicking it doesn't undo
- * anything already done), FALSE if it can
+ * anything already done), false if it can
* @param stop_flag A pointer to a Boolean variable that will be
- * set to TRUE if the user hits that button
+ * set to true if the user hits that button
* @return The newly created progress dialog
*/
-progdlg_t *create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title,
- gboolean terminate_is_stop, gboolean *stop_flag);
+progdlg_t *create_progress_dlg(void *top_level_window, const char *task_title, const char *item_title,
+ bool terminate_is_stop, bool *stop_flag);
/**
* Create a progress dialog, but only if it's not likely to disappear
@@ -55,16 +55,16 @@ progdlg_t *create_progress_dlg(gpointer top_level_window, const gchar *task_titl
* May be NULL.
* @param task_title The task to do, e.g. "Loading"
* @param item_title The item to do, e.g. "capture.cap"
- * @param terminate_is_stop TRUE if the operation can't be cancelled, just
+ * @param terminate_is_stop true if the operation can't be cancelled, just
* stopped (i.e., it has a "Stop" button and clicking it doesn't undo
- * anything already done), FALSE if it can
+ * anything already done), false if it can
* @param stop_flag A pointer to a Boolean variable that will be
- * set to TRUE if the user hits that button
+ * set to true if the user hits that button
* @param progress The current progress (0..1)
* @return The newly created progress dialog
*/
-progdlg_t *delayed_create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title,
- gboolean terminate_is_stop, gboolean *stop_flag, gfloat progress);
+progdlg_t *delayed_create_progress_dlg(void *top_level_window, const char *task_title, const char *item_title,
+ bool terminate_is_stop, bool *stop_flag, float progress);
/**
* Update the progress information of the progress dialog box.
@@ -73,7 +73,7 @@ progdlg_t *delayed_create_progress_dlg(gpointer top_level_window, const gchar *t
* @param percentage The current percentage value (0..1)
* @param status the New status string to show, e.g. "3000KB of 6000KB"
*/
-void update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *status);
+void update_progress_dlg(progdlg_t *dlg, float percentage, const char *status);
/**
* Destroy or hide the progress bar.
diff --git a/ui/proto_hier_stats.c b/ui/proto_hier_stats.c
index 6069b008..f7aea2be 100644
--- a/ui/proto_hier_stats.c
+++ b/ui/proto_hier_stats.c
@@ -29,10 +29,10 @@
static int pc_proto_id = -1;
static GNode*
-find_stat_node(GNode *parent_stat_node, header_field_info *needle_hfinfo)
+find_stat_node(GNode *parent_stat_node, const header_field_info *needle_hfinfo)
{
GNode *needle_stat_node, *up_parent_stat_node;
- header_field_info *hfinfo;
+ const header_field_info *hfinfo;
ph_stats_node_t *stats;
/* Look down the tree */
@@ -157,7 +157,7 @@ process_tree(proto_tree *protocol_tree, ph_stats_t* ps)
process_node(ptree_node, ps->stats_tree, ps);
}
- static gboolean
+ static bool
process_record(capture_file *cf, frame_data *frame, column_info *cinfo,
wtap_rec *rec, Buffer *buf, ph_stats_t* ps)
{
@@ -166,12 +166,12 @@ process_record(capture_file *cf, frame_data *frame, column_info *cinfo,
/* Load the record from the capture file */
if (!cf_read_record(cf, frame, rec, buf))
- return FALSE; /* failure */
+ return false; /* failure */
/* Dissect the record tree not visible */
- epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
+ epan_dissect_init(&edt, cf->epan, true, false);
/* Don't fake protocols. We need them for the protocol hierarchy */
- epan_dissect_fake_protocols(&edt, FALSE);
+ epan_dissect_fake_protocols(&edt, false);
epan_dissect_run(&edt, cf->cd_t, rec,
frame_tvbuff_new_buffer(&cf->provider, frame, buf),
frame, cinfo);
@@ -191,21 +191,21 @@ process_record(capture_file *cf, frame_data *frame, column_info *cinfo,
/* Free our memory. */
epan_dissect_cleanup(&edt);
- return TRUE; /* success */
+ return true; /* success */
}
ph_stats_t*
ph_stats_new(capture_file *cf)
{
ph_stats_t *ps;
- guint32 framenum;
+ uint32_t framenum;
frame_data *frame;
progdlg_t *progbar = NULL;
int count;
wtap_rec rec;
Buffer buf;
float progbar_val;
- gchar status_str[100];
+ char status_str[100];
int progbar_nextstep;
int progbar_quantum;
@@ -215,9 +215,9 @@ ph_stats_new(capture_file *cf)
ws_warning("Failing to compute protocol hierarchy stats on \"%s\" since a read is in progress", cf->filename);
return NULL;
}
- cf->read_lock = TRUE;
+ cf->read_lock = true;
- cf->stop_flag = FALSE;
+ cf->stop_flag = false;
pc_proto_id = proto_registrar_get_id_byname("pkt_comment");
@@ -255,7 +255,7 @@ ph_stats_new(capture_file *cf)
progbar = delayed_create_progress_dlg(
cf->window, "Computing",
"protocol hierarchy statistics",
- TRUE, &cf->stop_flag, progbar_val);
+ true, &cf->stop_flag, progbar_val);
/* Update the progress bar, but do it only N_PROGBAR_UPDATES
times; when we update it, we have to run the GTK+ main
@@ -269,7 +269,7 @@ ph_stats_new(capture_file *cf)
*/
ws_assert(cf->count > 0);
- progbar_val = (gfloat) count / cf->count;
+ progbar_val = (float) count / cf->count;
if (progbar != NULL) {
snprintf(status_str, sizeof(status_str),
@@ -315,7 +315,7 @@ ph_stats_new(capture_file *cf)
* just abort rather than popping up
* the statistics window.
*/
- cf->stop_flag = TRUE;
+ cf->stop_flag = true;
break;
}
@@ -344,17 +344,17 @@ ph_stats_new(capture_file *cf)
}
ws_assert(cf->read_lock);
- cf->read_lock = FALSE;
+ cf->read_lock = false;
return ps;
}
static gboolean
-stat_node_free(GNode *node, gpointer data _U_)
+stat_node_free(GNode *node, void *data _U_)
{
ph_stats_node_t *stats = (ph_stats_node_t *)node->data;
g_free(stats);
- return FALSE;
+ return false;
}
void
diff --git a/ui/proto_hier_stats.h b/ui/proto_hier_stats.h
index 1ba09261..222d2c25 100644
--- a/ui/proto_hier_stats.h
+++ b/ui/proto_hier_stats.h
@@ -22,19 +22,19 @@ extern "C" {
*/
typedef struct {
- header_field_info *hfinfo;
- guint num_pkts_total;
- guint num_pdus_total;
- guint num_pkts_last;
- guint num_bytes_total;
- guint num_bytes_last;
- guint last_pkt;
+ const header_field_info *hfinfo;
+ unsigned num_pkts_total;
+ unsigned num_pdus_total;
+ unsigned num_pkts_last;
+ unsigned num_bytes_total;
+ unsigned num_bytes_last;
+ unsigned last_pkt;
} ph_stats_node_t;
typedef struct {
- guint tot_packets;
- guint tot_bytes;
+ unsigned tot_packets;
+ unsigned tot_bytes;
GNode *stats_tree;
double first_time; /* seconds (msec resolution) of first packet */
double last_time; /* seconds (msec resolution) of last packet */
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt
index 6a1aab9a..3308d6f2 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -22,6 +22,7 @@ set(WIRESHARK_WIDGET_HEADERS
widgets/capture_filter_combo.h
widgets/capture_filter_edit.h
widgets/clickable_label.h
+ widgets/compression_group_box.h
widgets/copy_from_profile_button.h
widgets/detachable_tabwidget.h
widgets/display_filter_combo.h
@@ -45,7 +46,13 @@ set(WIRESHARK_WIDGET_HEADERS
widgets/path_selection_edit.h
widgets/pref_module_view.h
widgets/profile_tree_view.h
+ widgets/qcp_axis_ticker_elided.h
+ widgets/qcp_axis_ticker_si.h
+ widgets/qcp_string_legend_item.h
widgets/range_syntax_lineedit.h
+ widgets/resize_header_view.h
+ widgets/resolved_addresses_view.h
+ widgets/rowmove_tree_view.h
widgets/rtp_audio_graph.h
widgets/splash_overlay.h
widgets/stock_icon_tool_button.h
@@ -73,6 +80,7 @@ set(WIRESHARK_UTILS_HEADERS
utils/field_information.h
utils/frame_information.h
utils/idata_printable.h
+ utils/profile_switcher.h
utils/proto_node.h
utils/qt_ui_utils.h
utils/rtp_audio_file.h
@@ -140,6 +148,7 @@ set(WIRESHARK_QT_HEADERS
bluetooth_devices_dialog.h
bluetooth_hci_summary_dialog.h
byte_view_tab.h
+ capture_comment_dialog.h
capture_file_dialog.h
capture_file_properties_dialog.h
capture_file.h
@@ -171,7 +180,6 @@ set(WIRESHARK_QT_HEADERS
file_set_dialog.h
filter_action.h
filter_dialog.h
- filter_dialog.h
filter_expression_frame.h
firewall_rules_dialog.h
follow_stream_action.h
@@ -189,6 +197,7 @@ set(WIRESHARK_QT_HEADERS
interface_toolbar_reader.h
interface_toolbar.h
io_console_dialog.h
+ io_graph_action.h
io_graph_dialog.h
layout_preferences_frame.h
lbm_lbtrm_transport_dialog.h
@@ -282,6 +291,7 @@ set(WIRESHARK_WIDGET_SRCS
widgets/capture_filter_combo.cpp
widgets/capture_filter_edit.cpp
widgets/clickable_label.cpp
+ widgets/compression_group_box.cpp
widgets/copy_from_profile_button.cpp
widgets/detachable_tabwidget.cpp
widgets/display_filter_combo.cpp
@@ -305,7 +315,13 @@ set(WIRESHARK_WIDGET_SRCS
widgets/path_selection_edit.cpp
widgets/pref_module_view.cpp
widgets/profile_tree_view.cpp
+ widgets/qcp_axis_ticker_elided.cpp
+ widgets/qcp_axis_ticker_si.cpp
+ widgets/qcp_string_legend_item.cpp
widgets/range_syntax_lineedit.cpp
+ widgets/resize_header_view.cpp
+ widgets/resolved_addresses_view.cpp
+ widgets/rowmove_tree_view.cpp
widgets/rtp_audio_graph.cpp
widgets/splash_overlay.cpp
widgets/stock_icon_tool_button.cpp
@@ -332,6 +348,7 @@ set(WIRESHARK_UTILS_SRCS
utils/data_printer.cpp
utils/field_information.cpp
utils/frame_information.cpp
+ utils/profile_switcher.cpp
utils/proto_node.cpp
utils/qt_ui_utils.cpp
utils/rtp_audio_file.cpp
@@ -394,6 +411,7 @@ set(WIRESHARK_QT_SRC
bluetooth_devices_dialog.cpp
bluetooth_hci_summary_dialog.cpp
byte_view_tab.cpp
+ capture_comment_dialog.cpp
capture_file_dialog.cpp
capture_file_properties_dialog.cpp
capture_file.cpp
@@ -439,6 +457,7 @@ set(WIRESHARK_QT_SRC
interface_toolbar_reader.cpp
interface_toolbar.cpp
io_console_dialog.cpp
+ io_graph_action.cpp
layout_preferences_frame.cpp
lbm_lbtrm_transport_dialog.cpp
lbm_lbtru_transport_dialog.cpp
@@ -558,6 +577,7 @@ set(WIRESHARK_QT_UI
bluetooth_device_dialog.ui
bluetooth_devices_dialog.ui
bluetooth_hci_summary_dialog.ui
+ capture_comment_dialog.ui
capture_file_properties_dialog.ui
capture_info_dialog.ui
capture_options_dialog.ui
@@ -799,6 +819,9 @@ if(USE_qt6)
if(Qt6Multimedia_FOUND)
target_link_libraries(qtui PUBLIC Qt6::Multimedia)
endif()
+ if(Qt6DBus_FOUND)
+ target_link_libraries(qtui PUBLIC Qt6::DBus)
+ endif()
endif()
target_include_directories(qtui
@@ -810,6 +833,7 @@ target_include_directories(qtui
${QT5_INCLUDE_DIRS}
${GCRYPT_INCLUDE_DIRS}
${MINIZIP_INCLUDE_DIRS}
+ ${MINIZIPNG_INCLUDE_DIRS}
${PCAP_INCLUDE_DIRS}
${SPEEXDSP_INCLUDE_DIRS}
${WINSPARKLE_INCLUDE_DIRS}
diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp
index 01513030..ea111228 100644
--- a/ui/qt/about_dialog.cpp
+++ b/ui/qt/about_dialog.cpp
@@ -29,16 +29,12 @@
#include <epan/wslua/init_wslua.h>
#endif
-#include "ui/alert_box.h"
#include "ui/util.h"
-#include "ui/help_url.h"
-#include <wsutil/utf8_entities.h>
-#include "file.h"
-#include "wsutil/file_util.h"
-#include "wsutil/tempfile.h"
+#include "wsutil/filesystem.h"
#include "wsutil/plugins.h"
#include "wsutil/version_info.h"
+
#include "ui/capture_globals.h"
#include "extcap.h"
@@ -100,7 +96,33 @@ QStringList AuthorListModel::headerColumns() const
return QStringList() << tr("Name") << tr("Email");
}
+#ifdef HAVE_PLUGINS
static void plugins_add_description(const char *name, const char *version,
+ uint32_t flags, const char *filename,
+ void *user_data)
+{
+ QList<QStringList> *plugin_data = (QList<QStringList> *)user_data;
+ QStringList plugin_types;
+ if (flags & WS_PLUGIN_DESC_DISSECTOR)
+ plugin_types << "dissector";
+ if (flags & WS_PLUGIN_DESC_FILE_TYPE)
+ plugin_types << "file type";
+ if (flags & WS_PLUGIN_DESC_CODEC)
+ plugin_types << "codec";
+ if (flags & WS_PLUGIN_DESC_EPAN)
+ plugin_types << "epan";
+ if (flags & WS_PLUGIN_DESC_TAP_LISTENER)
+ plugin_types << "tap listener";
+ if (flags & WS_PLUGIN_DESC_DFILTER)
+ plugin_types << "dfilter";
+ if (plugin_types.empty())
+ plugin_types << "unknown";
+ QStringList plugin_row = QStringList() << name << version << plugin_types.join(", ") << filename;
+ *plugin_data << plugin_row;
+}
+#endif
+
+static void other_plugins_add_description(const char *name, const char *version,
const char *types, const char *filename,
void *user_data)
{
@@ -109,7 +131,7 @@ static void plugins_add_description(const char *name, const char *version,
*plugin_data << plugin_row;
}
-PluginListModel::PluginListModel(QObject * parent) : AStringListListModel(parent)
+PluginListModel::PluginListModel(QObject *parent) : AStringListListModel(parent)
{
QList<QStringList> plugin_data;
#ifdef HAVE_PLUGINS
@@ -117,10 +139,10 @@ PluginListModel::PluginListModel(QObject * parent) : AStringListListModel(parent
#endif
#ifdef HAVE_LUA
- wslua_plugins_get_descriptions(plugins_add_description, &plugin_data);
+ wslua_plugins_get_descriptions(other_plugins_add_description, &plugin_data);
#endif
- extcap_get_descriptions(plugins_add_description, &plugin_data);
+ extcap_get_descriptions(other_plugins_add_description, &plugin_data);
typeNames_ << QString("");
foreach(QStringList row, plugin_data)
@@ -179,35 +201,36 @@ FolderListModel::FolderListModel(QObject * parent):
AStringListListModel(parent)
{
/* "file open" */
- appendRow(QStringList() << tr("\"File\" dialogs") << get_open_dialog_initial_dir() << tr("capture files"));
+ appendRow(QStringList() << tr("\"File\" dialog location") << get_open_dialog_initial_dir() << tr("Capture files"));
/* temp */
- appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : g_get_tmp_dir()) << tr("untitled capture files"));
+ appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : g_get_tmp_dir())
+ << tr("Untitled capture files"));
/* pers conf */
appendRow(QStringList() << tr("Personal configuration")
- << gchar_free_to_qstring(get_persconffile_path("", FALSE))
- << tr("dfilters, preferences, ethers, …"));
+ << gchar_free_to_qstring(get_persconffile_path("", false))
+ << tr("Preferences, profiles, manuf, …"));
/* global conf */
QString dirPath = get_datafile_dir();
if (! dirPath.isEmpty()) {
appendRow (QStringList() << tr("Global configuration") << dirPath
- << tr("dfilters, preferences, manuf, …"));
+ << tr("Preferences, profiles, manuf, …"));
}
/* system */
appendRow(QStringList() << tr("System") << get_systemfile_dir() << tr("ethers, ipxnets"));
/* program */
- appendRow(QStringList() << tr("Program") << get_progfile_dir() << tr("program files"));
+ appendRow(QStringList() << tr("Program") << get_progfile_dir() << tr("Program files"));
#ifdef HAVE_PLUGINS
/* pers plugins */
- appendRow(QStringList() << tr("Personal Plugins") << get_plugins_pers_dir_with_version() << tr("binary plugins"));
+ appendRow(QStringList() << tr("Personal Plugins") << get_plugins_pers_dir_with_version() << tr("Binary plugins"));
/* global plugins */
- appendRow(QStringList() << tr("Global Plugins") << get_plugins_dir_with_version() << tr("binary plugins"));
+ appendRow(QStringList() << tr("Global Plugins") << get_plugins_dir_with_version() << tr("Binary plugins"));
#endif
#ifdef HAVE_LUA
@@ -219,12 +242,12 @@ FolderListModel::FolderListModel(QObject * parent):
#endif
/* Extcap */
- appendRow(QStringList() << tr("Personal Extcap path") << QString(get_extcap_pers_dir()) << tr("external capture (extcap) plugins"));
- appendRow(QStringList() << tr("Global Extcap path") << QString(get_extcap_dir()) << tr("external capture (extcap) plugins"));
+ appendRow(QStringList() << tr("Personal Extcap path") << QString(get_extcap_pers_dir()) << tr("External capture (extcap) plugins"));
+ appendRow(QStringList() << tr("Global Extcap path") << QString(get_extcap_dir()) << tr("External capture (extcap) plugins"));
#ifdef HAVE_MAXMINDDB
/* MaxMind DB */
- QStringList maxMindDbPaths = QString(maxmind_db_get_paths()).split(G_SEARCHPATH_SEPARATOR_S);
+ QStringList maxMindDbPaths = gchar_free_to_qstring(maxmind_db_get_paths()).split(G_SEARCHPATH_SEPARATOR_S);
foreach(QString path, maxMindDbPaths)
appendRow(QStringList() << tr("MaxMind DB path") << path.trimmed() << tr("MaxMind DB database search path"));
#endif
@@ -263,17 +286,10 @@ AboutDialog::AboutDialog(QWidget *parent) :
QFile f_acknowledgements;
QFile f_license;
- AuthorListModel * authorModel = new AuthorListModel(this);
- AStringListListSortFilterProxyModel * proxyAuthorModel = new AStringListListSortFilterProxyModel(this);
- proxyAuthorModel->setSourceModel(authorModel);
- proxyAuthorModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
- proxyAuthorModel->setColumnToFilter(0);
- proxyAuthorModel->setColumnToFilter(1);
- ui->tblAuthors->setModel(proxyAuthorModel);
- ui->tblAuthors->setRootIsDecorated(false);
- ui->tblAuthors->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(ui->tblAuthors, &QTreeView::customContextMenuRequested, this, &AboutDialog::handleCopyMenu);
- connect(ui->searchAuthors, &QLineEdit::textChanged, proxyAuthorModel, &AStringListListSortFilterProxyModel::setFilter);
+ if (!is_packet_configuration_namespace()) {
+ setWindowTitle(tr("About Logray"));
+ ui->tabWidget->setTabText(ui->tabWidget->indexOf(ui->tab_wireshark), tr("Logray"));
+ }
/* Wireshark tab */
updateWiresharkText();
@@ -286,11 +302,27 @@ AboutDialog::AboutDialog(QWidget *parent) :
ui->label_logo->setPixmap(QPixmap(":/about/wssplash_dev.png"));
#endif
+ /* Authors */
+ AuthorListModel * authorModel = new AuthorListModel(this);
+ AStringListListSortFilterProxyModel * authorProxyModel = new AStringListListSortFilterProxyModel(this);
+ authorProxyModel->setSourceModel(authorModel);
+ authorProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ authorProxyModel->setColumnToFilter(0);
+ authorProxyModel->setColumnToFilter(1);
+ ui->tblAuthors->setModel(authorProxyModel);
+ ui->tblAuthors->setRootIsDecorated(false);
+ ui->tblAuthors->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(ui->tblAuthors, &QTreeView::customContextMenuRequested, this, &AboutDialog::handleCopyMenu);
+ connect(ui->searchAuthors, &QLineEdit::textChanged, authorProxyModel, &AStringListListSortFilterProxyModel::setFilter);
+
/* Folders */
FolderListModel * folderModel = new FolderListModel(this);
AStringListListSortFilterProxyModel * folderProxyModel = new AStringListListSortFilterProxyModel(this);
folderProxyModel->setSourceModel(folderModel);
+ folderProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ folderProxyModel->setColumnToFilter(0);
folderProxyModel->setColumnToFilter(1);
+ folderProxyModel->setColumnToFilter(2);
folderProxyModel->setFilterType(AStringListListSortFilterProxyModel::FilterByStart);
AStringListListUrlProxyModel * folderDisplayModel = new AStringListListUrlProxyModel(this);
folderDisplayModel->setSourceModel(folderProxyModel);
@@ -306,13 +338,16 @@ AboutDialog::AboutDialog(QWidget *parent) :
connect(ui->searchFolders, &QLineEdit::textChanged, folderProxyModel, &AStringListListSortFilterProxyModel::setFilter);
connect(ui->tblFolders, &QTreeView::doubleClicked, this, &AboutDialog::urlDoubleClicked);
-
/* Plugins */
ui->label_no_plugins->hide();
PluginListModel * pluginModel = new PluginListModel(this);
AStringListListSortFilterProxyModel * pluginFilterModel = new AStringListListSortFilterProxyModel(this);
pluginFilterModel->setSourceModel(pluginModel);
+ pluginFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
pluginFilterModel->setColumnToFilter(0);
+ pluginFilterModel->setColumnToFilter(1);
+ pluginFilterModel->setColumnToFilter(2);
+ pluginFilterModel->setColumnToFilter(3);
AStringListListSortFilterProxyModel * pluginTypeModel = new AStringListListSortFilterProxyModel(this);
pluginTypeModel->setSourceModel(pluginFilterModel);
pluginTypeModel->setColumnToFilter(2);
@@ -344,6 +379,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
AStringListListSortFilterProxyModel * shortcutProxyModel = new AStringListListSortFilterProxyModel(this);
shortcutProxyModel->setSourceModel(shortcutModel);
shortcutProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ shortcutProxyModel->setColumnToFilter(0);
shortcutProxyModel->setColumnToFilter(1);
shortcutProxyModel->setColumnToFilter(2);
ui->tblShortcuts->setModel(shortcutProxyModel);
@@ -438,7 +474,7 @@ void AboutDialog::showEvent(QShowEvent * event)
void AboutDialog::updateWiresharkText()
{
- QString vcs_version_info_str = get_ws_vcs_version_info();
+ QString vcs_version_info_str = is_packet_configuration_namespace() ? get_ws_vcs_version_info() : get_lr_vcs_version_info();
QString copyright_info_str = get_copyright_info();
QString license_info_str = get_license_info();
QString comp_info_str = gstring_free_to_qbytearray(get_compiled_version_info(gather_wireshark_qt_compiled_info));
diff --git a/ui/qt/about_dialog.ui b/ui/qt/about_dialog.ui
index 4b515de0..bb6de142 100644
--- a/ui/qt/about_dialog.ui
+++ b/ui/qt/about_dialog.ui
@@ -157,7 +157,7 @@
<item>
<widget class="QLineEdit" name="searchFolders">
<property name="placeholderText">
- <string>Filter by path</string>
+ <string>Search Folders</string>
</property>
</widget>
</item>
diff --git a/ui/qt/accordion_frame.cpp b/ui/qt/accordion_frame.cpp
index 8f8cc430..bc1a77d5 100644
--- a/ui/qt/accordion_frame.cpp
+++ b/ui/qt/accordion_frame.cpp
@@ -8,7 +8,6 @@
*/
#include "config.h"
-#include <glib.h>
#include "accordion_frame.h"
@@ -104,4 +103,4 @@ void AccordionFrame::updateStyleSheet()
#endif
setStyleSheet(style_sheet);
-} \ No newline at end of file
+}
diff --git a/ui/qt/address_editor_frame.cpp b/ui/qt/address_editor_frame.cpp
index fb044418..034ac27b 100644
--- a/ui/qt/address_editor_frame.cpp
+++ b/ui/qt/address_editor_frame.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include "file.h"
#include "frame_tvbuff.h"
@@ -55,8 +53,9 @@ AddressEditorFrame::~AddressEditorFrame()
QString AddressEditorFrame::addressToString(const FieldInformation& finfo)
{
address addr;
- ws_in4_addr ipv4;
- const ws_in6_addr* ipv6;
+ QString addr_str;
+ const ipv4_addr_and_mask *ipv4;
+ const ipv6_addr_and_prefix *ipv6;
if (!finfo.isValid()) {
return QString();
@@ -69,18 +68,24 @@ QString AddressEditorFrame::addressToString(const FieldInformation& finfo)
// proto_item_fill_display_label, but that gives us
// the currently resolved version, if resolution is
// available and enabled. We want the unresolved string.
- ipv4 = fvalue_get_uinteger(finfo.fieldInfo()->value);
- set_address(&addr, AT_IPv4, 4, &ipv4);
- return gchar_free_to_qstring(address_to_str(NULL, &addr));
+ ipv4 = fvalue_get_ipv4(finfo.fieldInfo()->value);
+ set_address_ipv4(&addr, ipv4);
+ addr_str = gchar_free_to_qstring(address_to_str(NULL, &addr));
+ free_address(&addr);
+ break;
case FT_IPv6:
ipv6 = fvalue_get_ipv6(finfo.fieldInfo()->value);
- set_address(&addr, AT_IPv6, sizeof(ws_in6_addr), ipv6);
- return gchar_free_to_qstring(address_to_str(NULL, &addr));
+ set_address_ipv6(&addr, ipv6);
+ addr_str = gchar_free_to_qstring(address_to_str(NULL, &addr));
+ free_address(&addr);
+ break;
default:
- return QString();
+ addr_str = QString();
}
+ return addr_str;
}
+// NOLINTNEXTLINE(misc-no-recursion)
void AddressEditorFrame::addAddresses(const ProtoNode& node, QStringList& addresses)
{
QString addrString = addressToString(FieldInformation(&node));
@@ -89,6 +94,7 @@ void AddressEditorFrame::addAddresses(const ProtoNode& node, QStringList& addres
}
ProtoNode::ChildIterator kids = node.children();
while (kids.element().isValid()) {
+ // We recurse here, but we're limited by tree depth checks in epan
addAddresses(kids.element(), addresses);
kids.next();
}
@@ -119,13 +125,13 @@ void AddressEditorFrame::editAddresses(CaptureFile &cf, int column)
// have one in cap_file_->edt->tree as we have a current frame), but
// this is only a single frame that's previously been dissected so
// the performance hit is slight anyway.
- epan_dissect_init(&edt, cap_file_->epan, TRUE, TRUE);
+ epan_dissect_init(&edt, cap_file_->epan, true, true);
col_custom_prime_edt(&edt, &cap_file_->cinfo);
epan_dissect_run(&edt, cap_file_->cd_t, &cap_file_->rec,
frame_tvbuff_new_buffer(&cap_file_->provider, cap_file_->current_frame, &cap_file_->buf),
cap_file_->current_frame, &cap_file_->cinfo);
- epan_dissect_fill_in_columns(&edt, TRUE, TRUE);
+ epan_dissect_fill_in_columns(&edt, true, true);
addAddresses(ProtoNode(edt.tree), addresses);
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.cpp b/ui/qt/bluetooth_att_server_attributes_dialog.cpp
index 00330b3c..8191d495 100644
--- a/ui/qt/bluetooth_att_server_attributes_dialog.cpp
+++ b/ui/qt/bluetooth_att_server_attributes_dialog.cpp
@@ -52,6 +52,24 @@ btatt_handle_tap_reset(void *tapinfo_ptr)
tapinfo->tap_reset(tapinfo);
}
+static QTreeWidgetItem *
+item_with_handle_get(QTreeWidget *tableTree, uint16_t handle)
+{
+ QTreeWidgetItemIterator i_item(tableTree);
+
+ while (*i_item) {
+ QTreeWidgetItem *item = static_cast<QTreeWidgetItem*>(*i_item);
+
+ if (item->data(1, Qt::UserRole).value<uint32_t>() == handle) {
+ return item;
+ }
+
+ ++i_item;
+ }
+
+ return NULL;
+}
+
BluetoothAttServerAttributesDialog::BluetoothAttServerAttributesDialog(QWidget &parent, CaptureFile &cf) :
WiresharkDialog(parent, cf),
ui(new Ui::BluetoothAttServerAttributesDialog)
@@ -98,9 +116,9 @@ BluetoothAttServerAttributesDialog::~BluetoothAttServerAttributesDialog()
void BluetoothAttServerAttributesDialog::captureFileClosed()
{
- ui->interfaceComboBox->setEnabled(FALSE);
- ui->deviceComboBox->setEnabled(FALSE);
- ui->removeDuplicatesCheckBox->setEnabled(FALSE);
+ ui->interfaceComboBox->setEnabled(false);
+ ui->deviceComboBox->setEnabled(false);
+ ui->removeDuplicatesCheckBox->setEnabled(false);
WiresharkDialog::captureFileClosed();
}
@@ -170,11 +188,11 @@ void BluetoothAttServerAttributesDialog::on_actionMark_Unmark_Row_triggered()
QBrush fg;
QBrush bg;
- bool is_marked = TRUE;
+ bool is_marked = true;
for (int i = 0; i < ui->tableTreeWidget->columnCount(); i += 1) {
if (current_item->background(i) != QBrush(ColorUtils::fromColorT(&prefs.gui_marked_bg)))
- is_marked = FALSE;
+ is_marked = false;
}
if (is_marked) {
@@ -245,7 +263,7 @@ tap_packet_status BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_pt
QString handle;
QString uuid;
QString uuid_name;
- gchar *addr = NULL;
+ char *addr = NULL;
if (dialog->file_closed_)
return TAP_PACKET_DONT_REDRAW;
@@ -254,10 +272,11 @@ tap_packet_status BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_pt
return TAP_PACKET_DONT_REDRAW;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) {
- gchar *interface;
+ char *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ unsigned section_number = pinfo->rec->presence_flags & WTAP_HAS_SECTION_NUMBER ? pinfo->rec->section_number : 0;
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id, section_number);
interface = wmem_strdup_printf(pinfo->pool, "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)
@@ -286,24 +305,48 @@ tap_packet_status BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_pt
uuid_name = QString(print_bluetooth_uuid(pinfo->pool, &tap_handles->uuid));
if (dialog->ui->removeDuplicatesCheckBox->checkState() == Qt::Checked) {
- QTreeWidgetItemIterator i_item(dialog->ui->tableTreeWidget);
-
- while (*i_item) {
- QTreeWidgetItem *item = static_cast<QTreeWidgetItem*>(*i_item);
+ QTreeWidgetItem *item = item_with_handle_get(dialog->ui->tableTreeWidget,
+ tap_handles->handle);
+ if (item) {
if (item->text(column_number_handle) == handle &&
item->text(column_number_uuid) == uuid &&
item->text(column_number_uuid_name) == uuid_name)
return TAP_PACKET_REDRAW;
- ++i_item;
}
}
- QTreeWidgetItem *item = new QTreeWidgetItem(dialog->ui->tableTreeWidget);
- item->setText(column_number_handle, handle);
- item->setText(column_number_uuid, uuid);
- item->setText(column_number_uuid_name, uuid_name);
- item->setData(0, Qt::UserRole, QVariant::fromValue(pinfo->num));
+ QTreeWidgetItem *parent = NULL;
+
+ if (tap_handles->attribute_type == ATTRIBUTE_TYPE_SERVICE) {
+ /* Service declarations are the top level items */
+ parent = dialog->ui->tableTreeWidget->invisibleRootItem();
+ } else if ((tap_handles->uuid.bt_uuid == UUID_GATT_INCLUDE_DECLARATION) ||
+ (tap_handles->uuid.bt_uuid == UUID_GATT_CHARACTERISTIC_DECLARATION)) {
+ /* Characteristic and include declarations are part of services. */
+ parent = item_with_handle_get(dialog->ui->tableTreeWidget,
+ tap_handles->service_handle);
+ } else {
+ /* Each characteristic may have several attributes. */
+ parent = item_with_handle_get(dialog->ui->tableTreeWidget,
+ tap_handles->char_decl_handle);
+ }
+
+ if (parent) {
+ QTreeWidgetItem *item = new QTreeWidgetItem(parent);
+
+ item->setText(column_number_handle, handle);
+ item->setText(column_number_uuid, uuid);
+ item->setText(column_number_uuid_name, uuid_name);
+ item->setData(0, Qt::UserRole, QVariant::fromValue(pinfo->num));
+ item->setData(1, Qt::UserRole, QVariant::fromValue(tap_handles->handle));
+
+ parent->setExpanded(true);
+ } else {
+ /* Do not insert items without a known parent into the tree.
+ * The parent will likely be found later.
+ */
+ }
for (int i = 0; i < dialog->ui->tableTreeWidget->columnCount(); i++) {
dialog->ui->tableTreeWidget->resizeColumnToContents(i);
@@ -336,7 +379,7 @@ void BluetoothAttServerAttributesDialog::on_tableTreeWidget_itemActivated(QTreeW
if (file_closed_)
return;
- guint32 frame_number = item->data(0, Qt::UserRole).value<guint32>();
+ uint32_t frame_number = item->data(0, Qt::UserRole).value<uint32_t>();
emit goToPacket(frame_number);
}
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.h b/ui/qt/bluetooth_att_server_attributes_dialog.h
index 2d2a4f88..b377d9cc 100644
--- a/ui/qt/bluetooth_att_server_attributes_dialog.h
+++ b/ui/qt/bluetooth_att_server_attributes_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "wireshark_dialog.h"
#include "cfile.h"
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.ui b/ui/qt/bluetooth_att_server_attributes_dialog.ui
index ba67973f..a51d3864 100644
--- a/ui/qt/bluetooth_att_server_attributes_dialog.ui
+++ b/ui/qt/bluetooth_att_server_attributes_dialog.ui
@@ -35,7 +35,7 @@
<bool>false</bool>
</property>
<property name="itemsExpandable">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
diff --git a/ui/qt/bluetooth_device_dialog.cpp b/ui/qt/bluetooth_device_dialog.cpp
index 6e679b8a..d9729c5b 100644
--- a/ui/qt/bluetooth_device_dialog.cpp
+++ b/ui/qt/bluetooth_device_dialog.cpp
@@ -100,7 +100,7 @@ bluetooth_devices_tap(void *data)
}
-BluetoothDeviceDialog::BluetoothDeviceDialog(QWidget &parent, CaptureFile &cf, QString bdAddr, QString name, guint32 interface_id, guint32 adapter_id, gboolean is_local) :
+BluetoothDeviceDialog::BluetoothDeviceDialog(QWidget &parent, CaptureFile &cf, QString bdAddr, QString name, uint32_t interface_id, uint32_t adapter_id, bool is_local) :
WiresharkDialog(parent, cf),
ui(new Ui::BluetoothDeviceDialog)
{
@@ -234,7 +234,7 @@ void BluetoothDeviceDialog::on_actionMark_Unmark_Row_triggered()
{
QBrush fg;
QBrush bg;
- bool is_marked = TRUE;
+ bool is_marked = true;
QTableWidgetItem *current_item = ui->tableWidget->currentItem();
if (!current_item)
@@ -243,7 +243,7 @@ void BluetoothDeviceDialog::on_actionMark_Unmark_Row_triggered()
for (int i = 0; i < ui->tableWidget->columnCount(); i += 1) {
QTableWidgetItem *item = ui->tableWidget->item(current_item->row(), i);
if (item->background() != QBrush(ColorUtils::fromColorT(&prefs.gui_marked_bg)))
- is_marked = FALSE;
+ is_marked = false;
}
if (is_marked) {
@@ -339,7 +339,7 @@ void BluetoothDeviceDialog::tapReset(void *tapinfo_ptr)
*tapinfo->changes = 0;
}
-void BluetoothDeviceDialog::updateChanges(QTableWidget *tableWidget, QString value, const int row, guint *changes, packet_info *pinfo)
+void BluetoothDeviceDialog::updateChanges(QTableWidget *tableWidget, QString value, const int row, unsigned *changes, packet_info *pinfo)
{
QTableWidgetItem *item = tableWidget->item(row, column_number_value);
bluetooth_item_data_t *item_data = VariantPointer<bluetooth_item_data_t>::asPtr(item->data(Qt::UserRole));
@@ -379,7 +379,7 @@ tap_packet_status BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_inf
bluetooth_device_tap_t *tap_device = static_cast<bluetooth_device_tap_t *>(const_cast<void *>(data));
QString bd_addr;
QString bd_addr_oui;
- const gchar *manuf;
+ const char *manuf;
QTableWidget *tableWidget;
QTableWidgetItem *item;
QString field;
diff --git a/ui/qt/bluetooth_device_dialog.h b/ui/qt/bluetooth_device_dialog.h
index 7ae37bce..a0b408f0 100644
--- a/ui/qt/bluetooth_device_dialog.h
+++ b/ui/qt/bluetooth_device_dialog.h
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include "wireshark_dialog.h"
#include "cfile.h"
@@ -32,18 +30,18 @@ typedef struct _bluetooth_device_tapinfo_t {
tap_reset_cb tap_reset;
tap_packet_cb tap_packet;
QString bdAddr;
- guint32 interface_id;
- guint32 adapter_id;
- gboolean is_local;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ bool is_local;
void *ui;
- guint *changes;
+ unsigned *changes;
} bluetooth_device_tapinfo_t;
typedef struct _bluetooth_item_data_t {
- guint32 interface_id;
- guint32 adapter_id;
- guint32 frame_number;
- gint changes;
+ uint32_t interface_id;
+ uint32_t adapter_id;
+ uint32_t frame_number;
+ int changes;
} bluetooth_item_data_t;
namespace Ui {
@@ -55,7 +53,7 @@ class BluetoothDeviceDialog : public WiresharkDialog
Q_OBJECT
public:
- explicit BluetoothDeviceDialog(QWidget &parent, CaptureFile &cf, QString bdAddr, QString name, guint32 interface_id, guint32 adapter_id, gboolean is_local);
+ explicit BluetoothDeviceDialog(QWidget &parent, CaptureFile &cf, QString bdAddr, QString name, uint32_t interface_id, uint32_t adapter_id, bool is_local);
~BluetoothDeviceDialog();
public slots:
@@ -77,11 +75,11 @@ private:
bluetooth_device_tapinfo_t tapinfo_;
QMenu context_menu_;
- guint changes_;
+ unsigned changes_;
static void tapReset(void *tapinfo_ptr);
static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data, tap_flags_t flags);
- static void updateChanges(QTableWidget *tableWidget, QString value, const int row, guint *changes, packet_info *pinfo);
+ static void updateChanges(QTableWidget *tableWidget, QString value, const int row, unsigned *changes, packet_info *pinfo);
static void saveItemData(QTableWidgetItem *item, bluetooth_device_tap_t *tap_device, packet_info *pinfo);
private slots:
diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp
index 87d77772..0772b3d7 100644
--- a/ui/qt/bluetooth_devices_dialog.cpp
+++ b/ui/qt/bluetooth_devices_dialog.cpp
@@ -112,8 +112,8 @@ BluetoothDevicesDialog::~BluetoothDevicesDialog()
void BluetoothDevicesDialog::captureFileClosed()
{
- ui->interfaceComboBox->setEnabled(FALSE);
- ui->showInformationStepsCheckBox->setEnabled(FALSE);
+ ui->interfaceComboBox->setEnabled(false);
+ ui->showInformationStepsCheckBox->setEnabled(false);
WiresharkDialog::captureFileClosed();
}
@@ -187,11 +187,11 @@ void BluetoothDevicesDialog::on_actionMark_Unmark_Row_triggered()
{
QBrush fg;
QBrush bg;
- bool is_marked = TRUE;
+ bool is_marked = true;
for (int i = 0; i < ui->tableTreeWidget->columnCount(); i += 1) {
if (ui->tableTreeWidget->currentItem()->background(i) != QBrush(ColorUtils::fromColorT(&prefs.gui_marked_bg)))
- is_marked = FALSE;
+ is_marked = false;
}
if (is_marked) {
@@ -260,7 +260,7 @@ tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_in
bluetooth_device_tap_t *tap_device = static_cast<bluetooth_device_tap_t *>(const_cast<void *>(data));
QString bd_addr;
QString bd_addr_oui;
- const gchar *manuf;
+ const char *manuf;
QTreeWidgetItem *item = NULL;
if (dialog->file_closed_)
@@ -270,10 +270,11 @@ tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_in
return TAP_PACKET_DONT_REDRAW;
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) {
- gchar *interface;
+ char *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ unsigned section_number = pinfo->rec->presence_flags & WTAP_HAS_SECTION_NUMBER ? pinfo->rec->section_number : 0;
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id, section_number);
interface = wmem_strdup_printf(pinfo->pool, "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)
diff --git a/ui/qt/bluetooth_devices_dialog.h b/ui/qt/bluetooth_devices_dialog.h
index cf78d9a0..d26039d7 100644
--- a/ui/qt/bluetooth_devices_dialog.h
+++ b/ui/qt/bluetooth_devices_dialog.h
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include "wireshark_dialog.h"
#include "cfile.h"
#include "packet_list.h"
diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp
index 15d2df5e..c4e59283 100644
--- a/ui/qt/bluetooth_hci_summary_dialog.cpp
+++ b/ui/qt/bluetooth_hci_summary_dialog.cpp
@@ -157,8 +157,8 @@ void BluetoothHciSummaryDialog::captureFileClosing()
void BluetoothHciSummaryDialog::captureFileClosed()
{
- ui->interfaceComboBox->setEnabled(FALSE);
- ui->adapterComboBox->setEnabled(FALSE);
+ ui->interfaceComboBox->setEnabled(false);
+ ui->adapterComboBox->setEnabled(false);
WiresharkDialog::captureFileClosed();
}
@@ -232,11 +232,11 @@ void BluetoothHciSummaryDialog::on_actionMark_Unmark_Row_triggered()
{
QBrush fg;
QBrush bg;
- bool is_marked = TRUE;
+ bool is_marked = true;
for (int i = 0; i < ui->tableTreeWidget->columnCount(); i += 1) {
if (ui->tableTreeWidget->currentItem()->background(i) != QBrush(ColorUtils::fromColorT(&prefs.gui_marked_bg)))
- is_marked = FALSE;
+ is_marked = false;
}
if (is_marked) {
@@ -360,10 +360,11 @@ tap_packet_status BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet
name = tr("Unknown");
if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) {
- gchar *interface;
+ char *interface;
const char *interface_name;
- interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id);
+ unsigned section_number = pinfo->rec->presence_flags & WTAP_HAS_SECTION_NUMBER ? pinfo->rec->section_number : 0;
+ interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id, section_number);
interface = wmem_strdup_printf(pinfo->pool, "%u: %s", pinfo->rec->rec_header.packet_header.interface_id, interface_name);
if (dialog->ui->interfaceComboBox->findText(interface) == -1)
diff --git a/ui/qt/bluetooth_hci_summary_dialog.h b/ui/qt/bluetooth_hci_summary_dialog.h
index 8bba405e..61796640 100644
--- a/ui/qt/bluetooth_hci_summary_dialog.h
+++ b/ui/qt/bluetooth_hci_summary_dialog.h
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include "wireshark_dialog.h"
#include "cfile.h"
#include "packet_list.h"
diff --git a/ui/qt/byte_view_tab.cpp b/ui/qt/byte_view_tab.cpp
index cf23c24c..6cb8add7 100644
--- a/ui/qt/byte_view_tab.cpp
+++ b/ui/qt/byte_view_tab.cpp
@@ -308,7 +308,7 @@ void ByteViewTab::selectedFieldChanged(FieldInformation *selected)
if (cap_file_->search_in_progress && (cap_file_->hex || (cap_file_->string && cap_file_->packet_data))) {
// In the hex view, only highlight the target bytes or string. The entire
// field can then be displayed by clicking on any of the bytes in the field.
- f_start = cap_file_->search_pos - cap_file_->search_len + 1;
+ f_start = (int)cap_file_->search_pos;
f_length = (int) cap_file_->search_len;
} else {
f_start = selected->position().start;
diff --git a/ui/qt/capture_comment_dialog.cpp b/ui/qt/capture_comment_dialog.cpp
new file mode 100644
index 00000000..8bea4ca4
--- /dev/null
+++ b/ui/qt/capture_comment_dialog.cpp
@@ -0,0 +1,252 @@
+/* packet_comment_dialog.cpp
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "capture_comment_dialog.h"
+#include <ui_capture_comment_dialog.h>
+
+#include "file.h"
+
+#include "ui/simple_dialog.h"
+#include "ui/qt/utils/qt_ui_utils.h"
+#include "main_application.h"
+
+#include <QTabBar>
+#include <QPushButton>
+#include <QPlainTextEdit>
+
+class CaptureCommentTabWidget : public QTabWidget
+{
+ Q_OBJECT
+public:
+ CaptureCommentTabWidget(QWidget *parent = nullptr) : QTabWidget(parent)
+ {
+
+ setTabsClosable(true);
+ setMovable(true);
+ connect(this, &QTabWidget::tabCloseRequested, this, &CaptureCommentTabWidget::closeTab);
+ connect(tabBar(), &QTabBar::tabMoved, this, &CaptureCommentTabWidget::setTabTitles);
+ }
+ int addTab(QWidget *page);
+ void tabRemoved(int index) override;
+ void closeTab(int index);
+ void setReadOnly(bool ro);
+ char** getCommentsText();
+
+private:
+ void setTabTitles(int from, int to);
+};
+
+int CaptureCommentTabWidget::addTab(QWidget *page)
+{
+ return QTabWidget::addTab(page, tr("Comment %1").arg(count() + 1));
+}
+
+void CaptureCommentTabWidget::closeTab(int index)
+{
+ QPlainTextEdit *te;
+ te = qobject_cast<QPlainTextEdit*>(widget(index));
+ if (te != nullptr) {
+ removeTab(index);
+ delete te;
+ }
+}
+
+void CaptureCommentTabWidget::setReadOnly(bool ro)
+{
+ QPlainTextEdit *commentTextEdit;
+ for (int index = 0; index < count(); index++) {
+ commentTextEdit = qobject_cast<QPlainTextEdit*>(widget(index));
+ if (commentTextEdit != nullptr) {
+ commentTextEdit->setReadOnly(ro);
+ }
+ }
+}
+
+void CaptureCommentTabWidget::tabRemoved(int index)
+{
+ setTabTitles(index, count() - 1);
+}
+
+char** CaptureCommentTabWidget::getCommentsText()
+{
+ /* glib 2.68 and later have g_strv_builder which is slightly
+ * more convenient.
+ */
+ QPlainTextEdit *te;
+ GPtrArray *ptr_array = g_ptr_array_new_full(count() + 1, g_free);
+ for (int index = 0; index < count(); index++) {
+ te = qobject_cast<QPlainTextEdit*>(widget(index));
+ if (te != nullptr) {
+ char *str = qstring_strdup(te->toPlainText());
+
+ /*
+ * Make sure this would fit in a pcapng option.
+ *
+ * XXX - 65535 is the maximum size for an option in pcapng;
+ * what if another capture file format supports larger
+ * comments?
+ */
+ if (strlen(str) > 65535) {
+ /* It doesn't fit. Give up. */
+ g_ptr_array_free(ptr_array, true);
+ return nullptr;
+ }
+ g_ptr_array_add(ptr_array, str);
+ }
+ }
+ g_ptr_array_add(ptr_array, nullptr);
+ return (char**)g_ptr_array_free(ptr_array, false);
+}
+
+void CaptureCommentTabWidget::setTabTitles(int from, int to)
+{
+ if (from < to) {
+ for (; from <= to; from++) {
+ this->setTabText(from, tr("Comment %1").arg(from + 1));
+ }
+ } else {
+ for (; from >= to; from--) {
+ this->setTabText(from, tr("Comment %1").arg(from + 1));
+ }
+ }
+}
+
+CaptureCommentDialog::CaptureCommentDialog(QWidget &parent, CaptureFile &capture_file) :
+ WiresharkDialog(parent, capture_file),
+ ui(new Ui::CaptureCommentDialog)
+{
+
+ ui->setupUi(this);
+ loadGeometry();
+ setWindowSubtitle(tr("Edit Capture Comments"));
+
+ ui->sectionTabWidget->setTabBarAutoHide(true);
+ this->actionAddButton = ui->buttonBox->addButton(tr("Add Comment"), QDialogButtonBox::ActionRole);
+ connect(this->actionAddButton, &QPushButton::clicked, this, &CaptureCommentDialog::addComment);
+
+ connect(this, SIGNAL(captureCommentChanged()),
+ mainApp->mainWindow(), SLOT(updateForUnsavedChanges()));
+ QTimer::singleShot(0, this, SLOT(updateWidgets()));
+}
+
+CaptureCommentDialog::~CaptureCommentDialog()
+{
+ delete ui;
+}
+
+void CaptureCommentDialog::addComment()
+{
+ QPlainTextEdit *commentTextEdit;
+ CaptureCommentTabWidget *currentTW = qobject_cast<CaptureCommentTabWidget*>(ui->sectionTabWidget->currentWidget());
+ if (currentTW != nullptr) {
+ commentTextEdit = new QPlainTextEdit(currentTW);
+
+ currentTW->addTab(commentTextEdit);
+ }
+}
+
+void CaptureCommentDialog::updateWidgets()
+{
+ QPlainTextEdit *commentTextEdit;
+ CaptureCommentTabWidget *shbTW;
+ QPushButton *save_bt = ui->buttonBox->button(QDialogButtonBox::Save);
+
+ if (file_closed_ || !cap_file_.isValid()) {
+ for (int shb = 0; shb < ui->sectionTabWidget->count(); shb++) {
+ shbTW = qobject_cast<CaptureCommentTabWidget*>(ui->sectionTabWidget->widget(shb));
+ shbTW->setReadOnly(true);
+ }
+ if (save_bt) {
+ save_bt->setEnabled(false);
+ }
+ actionAddButton->setEnabled(false);
+ WiresharkDialog::updateWidgets();
+ return;
+ }
+
+ bool enable = wtap_dump_can_write(cap_file_.capFile()->linktypes, WTAP_COMMENT_PER_SECTION);
+ save_bt->setEnabled(enable);
+ actionAddButton->setEnabled(enable);
+
+ unsigned num_shbs = wtap_file_get_num_shbs(cap_file_.capFile()->provider.wth);
+ for (unsigned shb_idx = 0; shb_idx < num_shbs; shb_idx++) {
+ shbTW = qobject_cast<CaptureCommentTabWidget*>(ui->sectionTabWidget->widget(shb_idx));
+ if (shbTW == nullptr) {
+ shbTW = new CaptureCommentTabWidget(ui->sectionTabWidget);
+ ui->sectionTabWidget->addTab(shbTW, tr("Section %1").arg(shb_idx + 1));
+ }
+ wtap_block_t shb = wtap_file_get_shb(cap_file_.capFile()->provider.wth, shb_idx);
+ unsigned num_comments = wtap_block_count_option(shb, OPT_COMMENT);
+ char *shb_comment;
+ for (unsigned index = 0; index < num_comments; index++) {
+ commentTextEdit = qobject_cast<QPlainTextEdit*>(shbTW->widget(index));
+ if (commentTextEdit == nullptr) {
+ commentTextEdit = new QPlainTextEdit(shbTW);
+ shbTW->addTab(commentTextEdit);
+ }
+ if (wtap_block_get_nth_string_option_value(shb, OPT_COMMENT, index,
+ &shb_comment) == WTAP_OPTTYPE_SUCCESS) {
+ commentTextEdit->setPlainText(shb_comment);
+ } else {
+ // XXX: Should we warn about this failure?
+ commentTextEdit->setPlainText("");
+ }
+ commentTextEdit->setReadOnly(!enable);
+ }
+ for (unsigned index = shbTW->count(); index > num_comments; index--) {
+ shbTW->closeTab(index - 1);
+ }
+ }
+
+ WiresharkDialog::updateWidgets();
+}
+
+void CaptureCommentDialog::on_buttonBox_helpRequested()
+{
+// mainApp->helpTopicAction(HELP_CAPTURE_COMMENT_DIALOG);
+}
+
+void CaptureCommentDialog::on_buttonBox_accepted()
+{
+ int ret = QDialog::Rejected;
+
+ if (file_closed_ || !cap_file_.capFile()->filename) {
+ done(ret);
+ return;
+ }
+
+ if (wtap_dump_can_write(cap_file_.capFile()->linktypes, WTAP_COMMENT_PER_SECTION))
+ {
+ CaptureCommentTabWidget *current;
+ char** comments_text;
+ for (int shb_idx = 0; shb_idx < ui->sectionTabWidget->count(); shb_idx++) {
+ current = qobject_cast<CaptureCommentTabWidget*>(ui->sectionTabWidget->widget(shb_idx));
+ comments_text = current->getCommentsText();
+ if (comments_text == nullptr) {
+ /* This is the only error we track currently, so it must be
+ * this. Tell the user and give up. */
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ "A comment is too large to save in a capture file.");
+ done(ret);
+ return;
+ }
+ cf_update_section_comments(cap_file_.capFile(), shb_idx, comments_text);
+ emit captureCommentChanged();
+ ret = QDialog::Accepted;
+ }
+ }
+ done(ret);
+}
+
+void CaptureCommentDialog::on_buttonBox_rejected()
+{
+ reject();
+}
+
+#include "capture_comment_dialog.moc"
diff --git a/ui/qt/capture_comment_dialog.h b/ui/qt/capture_comment_dialog.h
new file mode 100644
index 00000000..5e7cb2b3
--- /dev/null
+++ b/ui/qt/capture_comment_dialog.h
@@ -0,0 +1,42 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef CAPTURE_COMMENT_DIALOG_H
+#define CAPTURE_COMMENT_DIALOG_H
+
+#include "wireshark_dialog.h"
+
+namespace Ui {
+class CaptureCommentDialog;
+}
+
+class CaptureCommentDialog : public WiresharkDialog
+{
+ Q_OBJECT
+
+public:
+ explicit CaptureCommentDialog(QWidget &parent, CaptureFile &capture_file);
+ ~CaptureCommentDialog();
+
+signals:
+ void captureCommentChanged();
+
+private slots:
+ void addComment();
+ void updateWidgets();
+ void on_buttonBox_helpRequested();
+ void on_buttonBox_accepted();
+ void on_buttonBox_rejected();
+
+private:
+ QPushButton *actionAddButton;
+ Ui::CaptureCommentDialog *ui;
+};
+
+#endif // CAPTURE_COMMENT_DIALOG_H
diff --git a/ui/qt/capture_comment_dialog.ui b/ui/qt/capture_comment_dialog.ui
new file mode 100644
index 00000000..a30dec03
--- /dev/null
+++ b/ui/qt/capture_comment_dialog.ui
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>CaptureCommentDialog</class>
+ <widget class="QDialog" name="CaptureCommentDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <!--<property name="modal">
+ <bool>true</bool>
+ </property>-->
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTabWidget" name="sectionTabWidget"/>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Save</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+</ui>
diff --git a/ui/qt/capture_event.h b/ui/qt/capture_event.h
index b4db282b..3959ed17 100644
--- a/ui/qt/capture_event.h
+++ b/ui/qt/capture_event.h
@@ -11,6 +11,7 @@
#define CAPTURE_EVENT_H
#include <QEvent>
+#include <QString>
typedef struct _capture_session capture_session;
diff --git a/ui/qt/capture_file.cpp b/ui/qt/capture_file.cpp
index 0fd088b9..5de2c9d4 100644
--- a/ui/qt/capture_file.cpp
+++ b/ui/qt/capture_file.cpp
@@ -85,9 +85,9 @@ CaptureFile::CaptureFile(QObject *parent, capture_file *cap_file) :
file_state_(QString())
{
#ifdef HAVE_LIBPCAP
- capture_callback_add(captureCallback, (gpointer) this);
+ capture_callback_add(captureCallback, (void *) this);
#endif
- cf_callback_add(captureFileCallback, (gpointer) this);
+ cf_callback_add(captureFileCallback, (void *) this);
}
CaptureFile::~CaptureFile()
@@ -239,7 +239,7 @@ capture_file *CaptureFile::globalCapFile()
return &cfile;
}
-gpointer CaptureFile::window()
+void *CaptureFile::window()
{
if (cap_file_) return cap_file_->window;
return NULL;
@@ -250,7 +250,7 @@ void CaptureFile::setCaptureStopFlag(bool stop_flag)
if (cap_file_) cap_file_->stop_flag = stop_flag;
}
-void CaptureFile::captureFileCallback(gint event, gpointer data, gpointer user_data)
+void CaptureFile::captureFileCallback(int event, void *data, void *user_data)
{
CaptureFile *capture_file = static_cast<CaptureFile *>(user_data);
if (!capture_file) return;
@@ -259,7 +259,7 @@ void CaptureFile::captureFileCallback(gint event, gpointer data, gpointer user_d
}
#ifdef HAVE_LIBPCAP
-void CaptureFile::captureCallback(gint event, capture_session *cap_session, gpointer user_data)
+void CaptureFile::captureCallback(int event, capture_session *cap_session, void *user_data)
{
CaptureFile *capture_file = static_cast<CaptureFile *>(user_data);
if (!capture_file) return;
@@ -268,7 +268,7 @@ void CaptureFile::captureCallback(gint event, capture_session *cap_session, gpoi
}
#endif
-void CaptureFile::captureFileEvent(int event, gpointer data)
+void CaptureFile::captureFileEvent(int event, void *data)
{
switch(event) {
case(cf_cb_file_opened):
diff --git a/ui/qt/capture_file.h b/ui/qt/capture_file.h
index 2249f8e0..89be807f 100644
--- a/ui/qt/capture_file.h
+++ b/ui/qt/capture_file.h
@@ -14,8 +14,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include "capture_event.h"
@@ -117,7 +115,7 @@ public:
// XXX This shouldn't be needed.
static capture_file *globalCapFile();
- gpointer window();
+ void *window();
signals:
void captureEvent(CaptureEvent);
@@ -146,12 +144,12 @@ public slots:
void setCaptureStopFlag(bool stop_flag = true);
private:
- static void captureFileCallback(gint event, gpointer data, gpointer user_data);
+ static void captureFileCallback(int event, void *data, void *user_data);
#ifdef HAVE_LIBPCAP
- static void captureCallback(gint event, capture_session *cap_session, gpointer user_data);
+ static void captureCallback(int event, capture_session *cap_session, void *user_data);
#endif
- void captureFileEvent(int event, gpointer data);
+ void captureFileEvent(int event, void *data);
void captureSessionEvent(int event, capture_session *cap_session);
const QString &getFileBasename();
diff --git a/ui/qt/capture_file_dialog.cpp b/ui/qt/capture_file_dialog.cpp
index 3e1e6230..884cb3f9 100644
--- a/ui/qt/capture_file_dialog.cpp
+++ b/ui/qt/capture_file_dialog.cpp
@@ -17,12 +17,6 @@
#include "capture_file_dialog.h"
-#ifdef Q_OS_WIN
-#include <windows.h>
-#include "ui/packet_range.h"
-#include "ui/win32/file_dlg_win32.h"
-#else // Q_OS_WIN
-
#include <errno.h>
#include "wsutil/filesystem.h"
#include "wsutil/nstime.h"
@@ -40,12 +34,10 @@
#include <QSortFilterProxyModel>
#include <QSpacerItem>
#include <QVBoxLayout>
-#endif // ! Q_OS_WIN
#include <QPushButton>
#include <QMessageBox>
-#include "epan/prefs.h"
#include <ui/qt/utils/qt_ui_utils.h>
#include <main_application.h>
@@ -55,38 +47,13 @@ static const double HEIGHT_SCALE_FACTOR = 1.4;
CaptureFileDialog::CaptureFileDialog(QWidget *parent, capture_file *cf) :
WiresharkFileDialog(parent),
cap_file_(cf),
-#if !defined(Q_OS_WIN)
display_filter_edit_(NULL),
default_ft_(-1),
save_bt_(NULL),
help_topic_(TOPIC_ACTION_NONE)
-#else
- file_type_(-1)
-#endif
{
- switch (prefs.gui_fileopen_style) {
- case FO_STYLE_LAST_OPENED:
- /* The user has specified that we should start out in the last
- * directory in which we opened a file.
- *
- * The open dialog initial directory will be that directory
- * unless we've never opened a file, in which case it will
- * be the user's personal data file directory.
- */
- setDirectory(mainApp->openDialogInitialDir());
- break;
-
- case FO_STYLE_SPECIFIED:
- /* The user has specified that we should always start out in a
- * specified directory; if they've specified that directory,
- * start out by showing the files in that dir.
- */
- if (prefs.gui_fileopen_dir[0] != '\0')
- setDirectory(prefs.gui_fileopen_dir);
- break;
- }
+ setDirectory(mainApp->openDialogInitialDir());
-#if !defined(Q_OS_WIN)
// Add extra widgets
// https://wiki.qt.io/Qt_project_org_faq#How_can_I_add_widgets_to_my_QFileDialog_instance.3F
setOption(QFileDialog::DontUseNativeDialog, true);
@@ -103,14 +70,10 @@ CaptureFileDialog::CaptureFileDialog(QWidget *parent, capture_file *cf) :
// Left and right boxes for controls and preview
h_box->addLayout(&left_v_box_);
h_box->addLayout(&right_v_box_);
-
-#else // Q_OS_WIN
- merge_type_ = 0;
-#endif // Q_OS_WIN
}
check_savability_t CaptureFileDialog::checkSaveAsWithComments(QWidget *parent, capture_file *cf, int file_type) {
- guint32 comment_types;
+ uint32_t comment_types;
bool all_comment_types_supported = true;
/* What types of comments do we have? */
@@ -191,7 +154,7 @@ check_savability_t CaptureFileDialog::checkSaveAsWithComments(QWidget *parent, c
*/
QList<QAbstractButton *> buttons = msg_dialog.buttons();
for (int i = 0; i < buttons.size(); ++i) {
- QPushButton *button = static_cast<QPushButton *>(buttons.at(i));;
+ QPushButton *button = static_cast<QPushButton *>(buttons.at(i));
button->setAutoDefault(false);
}
@@ -234,7 +197,6 @@ check_savability_t CaptureFileDialog::checkSaveAsWithComments(QWidget *parent, c
}
-#ifndef Q_OS_WIN
void CaptureFileDialog::accept()
{
//
@@ -255,7 +217,6 @@ void CaptureFileDialog::accept()
}
WiresharkFileDialog::accept();
}
-#endif // ! Q_OS_WIN
// You have to use open, merge, saveAs, or exportPackets. We should
@@ -265,98 +226,6 @@ int CaptureFileDialog::exec() {
}
-
-// Windows
-// We use native file dialogs here, rather than the Qt dialog
-#ifdef Q_OS_WIN
-int CaptureFileDialog::selectedFileType() {
- return file_type_;
-}
-
-wtap_compression_type CaptureFileDialog::compressionType() {
- return compression_type_;
-}
-
-int CaptureFileDialog::open(QString &file_name, unsigned int &type, QString &display_filter) {
- QString title_str = mainApp->windowTitleString(tr("Open Capture File"));
- GString *fname = g_string_new(file_name.toUtf8().constData());
- GString *dfilter = g_string_new(display_filter.toUtf8().constData());
- gboolean wof_status;
-
- // XXX Add a widget->HWND routine to qt_ui_utils and use it instead.
- wof_status = win32_open_file((HWND)parentWidget()->effectiveWinId(), title_str.toStdWString().c_str(), fname, &type, dfilter);
- file_name = fname->str;
- display_filter = dfilter->str;
-
- g_string_free(fname, TRUE);
- g_string_free(dfilter, TRUE);
-
- return (int) wof_status;
-}
-
-check_savability_t CaptureFileDialog::saveAs(QString &file_name, bool must_support_all_comments) {
- QString title_str = mainApp->windowTitleString(tr("Save Capture File As"));
- GString *fname = g_string_new(file_name.toUtf8().constData());
- gboolean wsf_status;
-
- wsf_status = win32_save_as_file((HWND)parentWidget()->effectiveWinId(), title_str.toStdWString().c_str(), cap_file_, fname, &file_type_, &compression_type_, must_support_all_comments);
- file_name = fname->str;
-
- g_string_free(fname, TRUE);
-
- if (wsf_status) {
- return checkSaveAsWithComments(parentWidget(), cap_file_, file_type_);
- }
-
- return CANCELLED;
-}
-
-check_savability_t CaptureFileDialog::exportSelectedPackets(QString &file_name, packet_range_t *range, QString selRange) {
- QString title_str = mainApp->windowTitleString(tr("Export Specified Packets"));
- GString *fname = g_string_new(file_name.toUtf8().constData());
- gboolean wespf_status;
-
- if (selRange.length() > 0)
- {
- packet_range_convert_selection_str(range, selRange.toUtf8().constData());
- }
-
- wespf_status = win32_export_specified_packets_file((HWND)parentWidget()->effectiveWinId(), title_str.toStdWString().c_str(), cap_file_, fname, &file_type_, &compression_type_, range);
- file_name = fname->str;
-
- g_string_free(fname, TRUE);
-
- if (wespf_status) {
- return checkSaveAsWithComments(parentWidget(), cap_file_, file_type_);
- }
-
- return CANCELLED;
-}
-
-int CaptureFileDialog::merge(QString &file_name, QString &display_filter) {
- QString title_str = mainApp->windowTitleString(tr("Merge Capture File"));
- GString *fname = g_string_new(file_name.toUtf8().constData());
- GString *dfilter = g_string_new(display_filter.toUtf8().constData());
- gboolean wmf_status;
-
-
- wmf_status = win32_merge_file((HWND)parentWidget()->effectiveWinId(), title_str.toStdWString().c_str(), fname, dfilter, &merge_type_);
- file_name = fname->str;
- display_filter = dfilter->str;
-
- g_string_free(fname, TRUE);
- g_string_free(dfilter, TRUE);
-
- return (int) wmf_status;
-}
-
-int CaptureFileDialog::mergeType() {
- return merge_type_;
-}
-
-#else // ! Q_OS_WIN
-// Not Windows
-// We use the Qt dialogs here
QString CaptureFileDialog::fileExtensionType(int et, bool extension_globs)
{
QString extension_type_name;
@@ -420,7 +289,7 @@ QString CaptureFileDialog::fileType(int ft, QStringList &suffixes)
filter = " (";
- extensions_list = wtap_get_file_extensions_list(ft, TRUE);
+ extensions_list = wtap_get_file_extensions_list(ft, true);
if (extensions_list == NULL) {
/* This file type doesn't have any particular extension
conventionally used for it, so we'll just use a
@@ -438,7 +307,7 @@ QString CaptureFileDialog::fileType(int ft, QStringList &suffixes)
for (GSList *extension = extensions_list; extension != NULL;
extension = g_slist_next(extension)) {
QString suffix((char *)extension->data);
- filter += " *." + suffix;;
+ filter += " *." + suffix;
suffixes << suffix;
}
wtap_free_extensions_list(extensions_list);
@@ -549,23 +418,22 @@ void CaptureFileDialog::fixFilenameExtension()
}
// Fixup the new suffix based on whether we're compressing or not.
- if (compressionType() == WTAP_UNCOMPRESSED) {
- // Not compressing; strip off any compression suffix
- GSList *compression_type_extensions = wtap_get_all_compression_type_extensions_list();
- for (GSList *compression_type_extension = compression_type_extensions;
- compression_type_extension != NULL;
- compression_type_extension = g_slist_next(compression_type_extension)) {
- QString suffix = QString(".") + (char *)compression_type_extension->data;
- if (new_suffix.endsWith(suffix)) {
- //
- // It ends with this compression suffix; chop it off.
- //
- new_suffix.chop(suffix.size());
- break;
- }
+ // Strip off any compression suffix
+ GSList *compression_type_extensions = wtap_get_all_compression_type_extensions_list();
+ for (GSList *compression_type_extension = compression_type_extensions;
+ compression_type_extension != NULL;
+ compression_type_extension = g_slist_next(compression_type_extension)) {
+ QString suffix = QString(".") + (char *)compression_type_extension->data;
+ if (new_suffix.endsWith(suffix)) {
+ //
+ // It ends with this compression suffix; chop it off.
+ //
+ new_suffix.chop(suffix.size());
+ break;
}
- g_slist_free(compression_type_extensions);
- } else {
+ }
+ g_slist_free(compression_type_extensions);
+ if (compressionType() != WTAP_UNCOMPRESSED) {
// Compressing; append the appropriate compression suffix.
QString compressed_file_extension = QString(".") + wtap_compression_type_extension(compressionType());
if (valid_extensions.contains(new_suffix + compressed_file_extension)) {
@@ -634,7 +502,7 @@ int CaptureFileDialog::selectedFileType() {
}
wtap_compression_type CaptureFileDialog::compressionType() {
- return compress_.isChecked() ? WTAP_GZIP_COMPRESSED : WTAP_UNCOMPRESSED;
+ return compress_group_box_.compressionType();
}
void CaptureFileDialog::addDisplayFilterEdit(QString &display_filter) {
@@ -670,15 +538,11 @@ void CaptureFileDialog::addFormatTypeSelector(QVBoxLayout &v_box) {
}
void CaptureFileDialog::addGzipControls(QVBoxLayout &v_box) {
- compress_.setText(tr("Compress with g&zip"));
- if (cap_file_->compression_type == WTAP_GZIP_COMPRESSED &&
- wtap_dump_can_compress(default_ft_)) {
- compress_.setChecked(true);
- } else {
- compress_.setChecked(false);
+ if (wtap_dump_can_compress(default_ft_)) {
+ compress_group_box_.setCompressionType(cap_file_->compression_type);
}
- v_box.addWidget(&compress_, 0, Qt::AlignTop);
- connect(&compress_, &QCheckBox::stateChanged, this, &CaptureFileDialog::fixFilenameExtension);
+ v_box.addWidget(&compress_group_box_, 0, Qt::AlignTop);
+ connect(&compress_group_box_, &CompressionGroupBox::stateChanged, this, &CaptureFileDialog::fixFilenameExtension);
}
@@ -724,7 +588,7 @@ int CaptureFileDialog::open(QString &file_name, unsigned int &type, QString &dis
}
if (WiresharkFileDialog::exec() && selectedFiles().length() > 0) {
- file_name = selectedFiles()[0];
+ file_name = selectedNativePath();
type = open_info_name_to_type(qPrintable(format_type_.currentText()));
display_filter.append(display_filter_edit_->text());
@@ -757,7 +621,7 @@ check_savability_t CaptureFileDialog::saveAs(QString &file_name, bool must_suppo
if (WiresharkFileDialog::exec() && selectedFiles().length() > 0) {
int file_type;
- file_name = selectedFiles()[0];
+ file_name = selectedNativePath();
file_type = selectedFileType();
/* Is the file type bogus? */
if (file_type == WTAP_FILE_TYPE_SUBTYPE_UNKNOWN) {
@@ -807,7 +671,7 @@ check_savability_t CaptureFileDialog::exportSelectedPackets(QString &file_name,
if (WiresharkFileDialog::exec() && selectedFiles().length() > 0) {
int file_type;
- file_name = selectedFiles()[0];
+ file_name = selectedNativePath();
file_type = selectedFileType();
/* Is the file type bogus? */
if (file_type == WTAP_FILE_TYPE_SUBTYPE_UNKNOWN) {
@@ -842,7 +706,7 @@ int CaptureFileDialog::merge(QString &file_name, QString &display_filter) {
resize(width() * WIDTH_SCALE_FACTOR, height() * HEIGHT_SCALE_FACTOR + right_v_box_.minimumSize().height() + display_filter_edit_->minimumSize().height());
if (WiresharkFileDialog::exec() && selectedFiles().length() > 0) {
- file_name.append(selectedFiles()[0]);
+ file_name.append(selectedNativePath());
display_filter.append(display_filter_edit_->text());
return QDialog::Accepted;
@@ -853,9 +717,9 @@ int CaptureFileDialog::merge(QString &file_name, QString &display_filter) {
QStringList CaptureFileDialog::buildFileSaveAsTypeList(bool must_support_all_comments) {
QStringList filters;
- guint32 required_comment_types;
+ uint32_t required_comment_types;
GArray *savable_file_types_subtypes;
- guint i;
+ unsigned i;
type_hash_.clear();
type_suffixes_.clear();
@@ -885,7 +749,7 @@ QStringList CaptureFileDialog::buildFileSaveAsTypeList(bool must_support_all_com
filters << type_name + fileType(ft, type_suffixes_[type_name]);
type_hash_[type_name] = ft;
}
- g_array_free(savable_file_types_subtypes, TRUE);
+ g_array_free(savable_file_types_subtypes, true);
}
return filters;
@@ -909,7 +773,7 @@ void CaptureFileDialog::preview(const QString & path)
{
wtap *wth;
int err;
- gchar *err_info;
+ char *err_info;
ws_file_preview_stats stats;
ws_file_preview_stats_status status;
time_t ti_time;
@@ -933,7 +797,7 @@ void CaptureFileDialog::preview(const QString & path)
return;
}
- wth = wtap_open_offline(path.toUtf8().data(), WTAP_TYPE_AUTO, &err, &err_info, TRUE);
+ wth = wtap_open_offline(path.toUtf8().data(), WTAP_TYPE_AUTO, &err, &err_info, true);
if (wth == NULL) {
if (err == WTAP_ERR_FILE_UNKNOWN_FORMAT) {
preview_format_.setText(tr("unknown file format"));
@@ -952,7 +816,7 @@ void CaptureFileDialog::preview(const QString & path)
preview_format_.setText(QString::fromUtf8(wtap_file_type_subtype_description(wtap_file_type_subtype(wth))));
// Size
- gint64 filesize = wtap_file_size(wth, &err);
+ int64_t filesize = wtap_file_size(wth, &err);
// Finder and Windows Explorer use IEC. What do the various Linux file managers use?
QString size_str(gchar_free_to_qstring(format_size(filesize, FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_IEC)));
@@ -963,6 +827,7 @@ void CaptureFileDialog::preview(const QString & path)
g_free(err_info);
preview_size_.setText(tr("%1, error after %Ln data record(s)", "", stats.records)
.arg(size_str));
+ wtap_close(wth);
return;
}
@@ -1032,5 +897,3 @@ void CaptureFileDialog::on_buttonBox_helpRequested()
{
if (help_topic_ != TOPIC_ACTION_NONE) mainApp->helpTopicAction(help_topic_);
}
-
-#endif // ! Q_OS_WIN
diff --git a/ui/qt/capture_file_dialog.h b/ui/qt/capture_file_dialog.h
index 1e22ad8b..2c48100a 100644
--- a/ui/qt/capture_file_dialog.h
+++ b/ui/qt/capture_file_dialog.h
@@ -12,11 +12,10 @@
#include <ui/qt/widgets/wireshark_file_dialog.h>
-#ifndef Q_OS_WIN
#include <ui/qt/widgets/display_filter_edit.h>
+#include <ui/qt/widgets/compression_group_box.h>
#include "packet_range_group_box.h"
#include "ui/help_url.h"
-#endif // Q_OS_WIN
#include <ui/packet_range.h>
@@ -43,14 +42,27 @@ class CaptureFileDialog : public WiresharkFileDialog
//
// You can subclass QFileDialog (which we've done here) and add widgets as
// described at
- // https://web.archive.org/web/20100528190736/http://developer.qt.nokia.com/faq/answer/how_can_i_add_widgets_to_my_qfiledialog_instance
+ //
+ // https://web.archive.org/web/20100528190736/http://developer.qt.nokia.com/faq/answer/how_can_i_add_widgets_to_my_qfiledialog_instance
+ //
// However, Qt's idea of what a file dialog looks like isn't what Microsoft
// and Apple think a file dialog looks like.
//
- // On Windows Vista and later we should probably use IFileOpenDialog. On earlier
- // versions of Windows (including XP) we should use GetOpenFileName, which is
- // what we do in ui/win32/file_dlg_win32.c. macOS we should use NSOpenPanel. On
- // other platforms we should fall back to QFileDialog.
+ // On Windows, we should probably use the Common Item Dialog:
+ //
+ // https://learn.microsoft.com/en-us/windows/win32/shell/common-file-dialog
+ //
+ // We currently use GetOpenFileNam in ui/win32/file_dlg_win32.c.
+ //
+ // On macOS we should use NSOpenPanel and NSSavePanel:
+ //
+ // https://developer.apple.com/documentation/appkit/nsopenpanel?language=objc
+ // https://developer.apple.com/documentation/appkit/nssavepanel?language=objc
+ //
+ // On other platforms we should fall back to QFileDialog (or maybe
+ // KDE's or GTK+/GNOME's file dialog, as appropriate for the desktop
+ // environment being used, if QFileDialog doesn't do so with various
+ // platform plugins).
//
// Yes, that's four implementations of the same window.
//
@@ -62,9 +74,6 @@ class CaptureFileDialog : public WiresharkFileDialog
public:
explicit CaptureFileDialog(QWidget *parent = NULL, capture_file *cf = NULL);
static check_savability_t checkSaveAsWithComments(QWidget *
-#if defined(Q_OS_WIN)
- parent
-#endif // Q_OS_WIN
, capture_file *cf, int file_type);
int mergeType();
@@ -74,7 +83,6 @@ public:
private:
capture_file *cap_file_;
-#if !defined(Q_OS_WIN)
void addMergeControls(QVBoxLayout &v_box);
void addFormatTypeSelector(QVBoxLayout &v_box);
void addDisplayFilterEdit(QString &display_filter);
@@ -110,25 +118,17 @@ private:
int default_ft_;
- QCheckBox compress_;
+ CompressionGroupBox compress_group_box_;
PacketRangeGroupBox packet_range_group_box_;
QPushButton *save_bt_;
topic_action_e help_topic_;
-#else // Q_OS_WIN
- int file_type_;
- int merge_type_;
- wtap_compression_type compression_type_;
-#endif // Q_OS_WIN
-
signals:
public slots:
-#ifndef Q_OS_WIN
void accept() Q_DECL_OVERRIDE;
-#endif
int exec() Q_DECL_OVERRIDE;
int open(QString &file_name, unsigned int &type, QString &display_filter);
check_savability_t saveAs(QString &file_name, bool must_support_comments);
@@ -136,11 +136,9 @@ public slots:
int merge(QString &file_name, QString &display_filter);
private slots:
-#if !defined(Q_OS_WIN)
void fixFilenameExtension();
void preview(const QString & path);
void on_buttonBox_helpRequested();
-#endif // Q_OS_WIN
};
#endif // CAPTURE_FILE_DIALOG_H
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index c7705681..9b4458dc 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -15,12 +15,16 @@
#include "ui/simple_dialog.h"
#include "ui/summary.h"
+#include "wiretap/secrets-types.h"
+
+#include "wsutil/filesystem.h"
#include "wsutil/str_util.h"
#include "wsutil/utf8_entities.h"
#include "wsutil/version_info.h"
#include <ui/qt/utils/qt_ui_utils.h>
#include "main_application.h"
+#include "capture_comment_dialog.h"
#include <QPushButton>
#include <QScrollBar>
@@ -39,10 +43,6 @@ CaptureFilePropertiesDialog::CaptureFilePropertiesDialog(QWidget &parent, Captur
ui->detailsTextEdit->setAcceptRichText(true);
- // make the details box larger than the comments
- ui->splitter->setStretchFactor(0, 6);
- ui->splitter->setStretchFactor(1, 1);
-
QPushButton *button = ui->buttonBox->button(QDialogButtonBox::Reset);
if (button) {
button->setText(tr("Refresh"));
@@ -53,16 +53,14 @@ CaptureFilePropertiesDialog::CaptureFilePropertiesDialog(QWidget &parent, Captur
button->setText(tr("Copy To Clipboard"));
}
- button = ui->buttonBox->button(QDialogButtonBox::Save);
- if (button) {
- button->setText(tr("Save Comments"));
- }
-
button = ui->buttonBox->button(QDialogButtonBox::Close);
if (button) {
button->setDefault(true);
}
+ ui->buttonBox->addButton(ui->actionEditButton, QDialogButtonBox::ActionRole);
+ connect(ui->actionEditButton, &QPushButton::clicked, this, &CaptureFilePropertiesDialog::addCaptureComment);
+
setWindowSubtitle(tr("Capture File Properties"));
QTimer::singleShot(0, this, SLOT(updateWidgets()));
}
@@ -81,34 +79,16 @@ CaptureFilePropertiesDialog::~CaptureFilePropertiesDialog()
void CaptureFilePropertiesDialog::updateWidgets()
{
QPushButton *refresh_bt = ui->buttonBox->button(QDialogButtonBox::Reset);
- QPushButton *save_bt = ui->buttonBox->button(QDialogButtonBox::Save);
if (file_closed_ || !cap_file_.isValid()) {
if (refresh_bt) {
refresh_bt->setEnabled(false);
}
- ui->commentsTextEdit->setReadOnly(true);
- if (save_bt) {
- save_bt->setEnabled(false);
- }
WiresharkDialog::updateWidgets();
return;
}
- bool enable = wtap_dump_can_write(cap_file_.capFile()->linktypes, WTAP_COMMENT_PER_SECTION);
- save_bt->setEnabled(enable);
- ui->commentsTextEdit->setEnabled(enable);
-
fillDetails();
- // XXX - this just handles the first comment in the first section;
- // add support for multiple sections with multiple comments.
- wtap_block_t shb = wtap_file_get_shb(cap_file_.capFile()->provider.wth, 0);
- char *shb_comment;
- if (wtap_block_get_nth_string_option_value(shb, OPT_COMMENT, 0,
- &shb_comment) == WTAP_OPTTYPE_SUCCESS)
- ui->commentsTextEdit->setText(shb_comment);
- else
- ui->commentsTextEdit->setText(NULL);
WiresharkDialog::updateWidgets();
}
@@ -192,7 +172,7 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
QString encaps_str;
if (summary.file_encap_type == WTAP_ENCAP_PER_PACKET) {
- for (guint i = 0; i < summary.packet_encap_types->len; i++)
+ for (unsigned i = 0; i < summary.packet_encap_types->len; i++)
{
encaps_str = QString(wtap_encap_description(g_array_index(summary.packet_encap_types, int, i)));
}
@@ -221,15 +201,23 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
out << table_begin;
// start time
- out << table_row_begin
- << table_vheader_tmpl.arg(tr("First packet"))
- << table_data_tmpl.arg(time_t_to_qstring((time_t)summary.start_time))
+ out << table_row_begin;
+ if (is_packet_configuration_namespace()) {
+ out << table_vheader_tmpl.arg(tr("First packet"));
+ } else {
+ out << table_vheader_tmpl.arg(tr("First event"));
+ }
+ out << table_data_tmpl.arg(time_t_to_qstring((time_t)summary.start_time))
<< table_row_end;
// stop time
- out << table_row_begin
- << table_vheader_tmpl.arg(tr("Last packet"))
- << table_data_tmpl.arg(time_t_to_qstring((time_t)summary.stop_time))
+ out << table_row_begin;
+ if (is_packet_configuration_namespace()) {
+ out << table_vheader_tmpl.arg(tr("Last packet"));
+ } else {
+ out << table_vheader_tmpl.arg(tr("Last event"));
+ }
+ out << table_data_tmpl.arg(time_t_to_qstring((time_t)summary.stop_time))
<< table_row_end;
// elapsed seconds (capture duration)
@@ -257,20 +245,21 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
}
// Information from file sections.
- for (guint section_number = 0;
+ for (unsigned section_number = 0;
section_number < wtap_file_get_num_shbs(cap_file_.capFile()->provider.wth);
section_number++) {
// If we have more than one section, add headers for each section.
if (wtap_file_get_num_shbs(cap_file_.capFile()->provider.wth) > 1)
out << section_tmpl_.arg(QString(tr("Section %1"))
- .arg(section_number));
+ .arg(section_number + 1));
+
+ wtap_block_t shb_inf = wtap_file_get_shb(cap_file_.capFile()->provider.wth, section_number);
// Capture Section
out << section_tmpl_.arg(tr("Capture"));
out << table_begin;
- wtap_block_t shb_inf = wtap_file_get_shb(cap_file_.capFile()->provider.wth, section_number);
char *str;
if (shb_inf != nullptr) {
@@ -317,15 +306,25 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
out << table_begin;
out << table_ul_row_begin
- << table_hheader20_tmpl.arg(tr("Interface"))
- << table_hheader20_tmpl.arg(tr("Dropped packets"))
- << table_hheader20_tmpl.arg(tr("Capture filter"))
- << table_hheader20_tmpl.arg(tr("Link type"))
- << table_hheader20_tmpl.arg(tr("Packet size limit (snaplen)"))
- << table_row_end;
+ << table_hheader20_tmpl.arg(tr("Interface"));
+ if (is_packet_configuration_namespace()) {
+ out << table_hheader20_tmpl.arg(tr("Dropped packets"));
+ } else {
+ out << table_hheader20_tmpl.arg(tr("Dropped events"));
+ }
+ out << table_hheader20_tmpl.arg(tr("Capture filter"))
+ << table_hheader20_tmpl.arg(tr("Link type"));
+ if (is_packet_configuration_namespace()) {
+ out << table_hheader20_tmpl.arg(tr("Packet size limit (snaplen)"));
+ } else {
+ out << table_hheader20_tmpl.arg(tr("Event size limit (snaplen)"));
+ }
+ out << table_row_end;
}
- for (guint i = 0; i < summary.ifaces->len; i++) {
+ // XXX: The mapping of interfaces to different SHBs isn't
+ // handled correctly here or elsewhere
+ for (unsigned i = 0; i < summary.ifaces->len; i++) {
iface_summary_info iface;
iface = g_array_index(summary.ifaces, iface_summary_info, i);
@@ -342,7 +341,7 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
if (iface.drops_known) {
interface_drops = QString("%1 (%2%)").arg(iface.drops).arg(QString::number(
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
- summary.packet_count ? (100.0 * (gint64)iface.drops)/summary.packet_count : 0, 'f', 1));
+ summary.packet_count ? (100.0 * (int64_t)iface.drops)/summary.packet_count : 0, 'f', 1));
}
/* Capture filter */
@@ -366,6 +365,57 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
if (summary.ifaces->len > 0) {
out << table_end;
}
+
+ unsigned num_comments = wtap_block_count_option(shb_inf, OPT_COMMENT);
+ if (num_comments > 0) {
+ out << section_tmpl_.arg(tr("Comments"));
+ char *shb_comment;
+ for (unsigned i = 0; i < num_comments; i++) {
+ if (wtap_block_get_nth_string_option_value(shb_inf, OPT_COMMENT, i,
+ &shb_comment) == WTAP_OPTTYPE_SUCCESS) {
+ QString section_comment = shb_comment;
+ QString section_comment_html;
+ if (num_comments > 1) {
+ out << tr("Comment %1: ").arg(i+1);
+ }
+
+ QString comment_escaped = html_escape(section_comment).replace('\n', "<br>");
+ out << para_tmpl_.arg(comment_escaped);
+ }
+ }
+ }
+ }
+
+ // Done with the interfaces
+ for (unsigned i = 0; i < summary.ifaces->len; i++) {
+ iface_summary_info iface;
+ iface = g_array_index(summary.ifaces, iface_summary_info, i);
+
+ g_free(iface.descr);
+ g_free(iface.name);
+ g_free(iface.cfilter);
+ }
+ g_array_free(summary.ifaces, true);
+
+ if (wtap_file_get_num_dsbs(cap_file_.capFile()->provider.wth) > 0) {
+ out << section_tmpl_.arg(tr("Decryption Secrets"));
+ out << table_begin;
+ out << table_ul_row_begin
+ << table_hheader20_tmpl.arg(tr("Type"))
+ << table_hheader20_tmpl.arg(tr("Size"))
+ << table_row_end;
+ // XXX: A DSB can have (multiple) comments, we could add that too.
+ for (unsigned section_number = 0;
+ section_number < wtap_file_get_num_dsbs(cap_file_.capFile()->provider.wth);
+ section_number++) {
+ wtap_block_t dsb = wtap_file_get_dsb(cap_file_.capFile()->provider.wth, section_number);
+ wtapng_dsb_mandatory_t *dsb_mand = (wtapng_dsb_mandatory_t*)wtap_block_get_mandatory_data(dsb);
+ out << table_row_begin
+ << table_data_tmpl.arg(secrets_type_description(dsb_mand->secrets_type))
+ << table_data_tmpl.arg(tr("%1 bytes").arg(dsb_mand->secrets_len))
+ << table_row_end;
+ }
+ out << table_end;
}
// Statistics Section
@@ -395,9 +445,13 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
.arg(100.0 * summary.marked_count / summary.packet_count, 1, 'f', 1);
}
- out << table_row_begin
- << table_data_tmpl.arg(tr("Packets"))
- << table_data_tmpl.arg(summary.packet_count)
+ out << table_row_begin;
+ if (is_packet_configuration_namespace()) {
+ out << table_data_tmpl.arg(tr("Packets"));
+ } else {
+ out << table_data_tmpl.arg(tr("Events"));
+ }
+ out << table_data_tmpl.arg(summary.packet_count)
<< table_data_tmpl.arg(displayed_str)
<< table_data_tmpl.arg(marked_str)
<< table_row_end;
@@ -441,17 +495,21 @@ QString CaptureFilePropertiesDialog::summaryToHtml()
// Average packet size
captured_str = displayed_str = marked_str = n_a;
if (summary.packet_count > 0) {
- captured_str = QString::number((guint64) ((double)summary.bytes/summary.packet_count + 0.5));
+ captured_str = QString::number((uint64_t) ((double)summary.bytes/summary.packet_count + 0.5));
}
if (summary.filtered_count > 0) {
- displayed_str = QString::number((guint64) ((double)summary.filtered_bytes/summary.filtered_count + 0.5));
+ displayed_str = QString::number((uint64_t) ((double)summary.filtered_bytes/summary.filtered_count + 0.5));
}
if (summary.marked_count > 0) {
- marked_str = QString::number((guint64) ((double)summary.marked_bytes/summary.marked_count + 0.5));
+ marked_str = QString::number((uint64_t) ((double)summary.marked_bytes/summary.marked_count + 0.5));
}
- out << table_row_begin
- << table_data_tmpl.arg(tr("Average packet size, B"))
- << table_data_tmpl.arg(captured_str)
+ out << table_row_begin;
+ if (is_packet_configuration_namespace()) {
+ out << table_data_tmpl.arg(tr("Average packet size, B"));
+ } else {
+ out << table_data_tmpl.arg(tr("Average event size, B"));
+ }
+ out << table_data_tmpl.arg(captured_str)
<< table_data_tmpl.arg(displayed_str)
<< table_data_tmpl.arg(marked_str)
<< table_row_end;
@@ -533,36 +591,21 @@ void CaptureFilePropertiesDialog::fillDetails()
cursor.insertHtml(summary);
cursor.insertBlock(); // Work around rendering oddity.
- // XXX - this just shows the first comment in the first section;
- // add support for multiple sections with multiple comments.
- wtap_block_t shb = wtap_file_get_shb(cap_file_.capFile()->provider.wth, 0);
- char *shb_comment;
- if (wtap_block_get_nth_string_option_value(shb, OPT_COMMENT, 0,
- &shb_comment) == WTAP_OPTTYPE_SUCCESS) {
- QString section_comment = shb_comment;
- QString section_comment_html;
-
- if (!section_comment.isEmpty()) {
- QString comment_escaped = html_escape(section_comment).replace('\n', "<br>");
- section_comment_html += section_tmpl_.arg(QString(tr("Section Comment")));
- section_comment_html += para_tmpl_.arg(comment_escaped);
-
- cursor.insertBlock();
- cursor.insertHtml(section_comment_html);
- }
- }
-
if (cap_file_.capFile()->packet_comment_count > 0) {
cursor.insertBlock();
- cursor.insertHtml(section_tmpl_.arg(tr("Packet Comments")));
+ if (is_packet_configuration_namespace()) {
+ cursor.insertHtml(section_tmpl_.arg(tr("Packet Comments")));
+ } else {
+ cursor.insertHtml(section_tmpl_.arg(tr("Event Comments")));
+ }
- for (guint32 framenum = 1; framenum <= cap_file_.capFile()->count ; framenum++) {
+ for (uint32_t framenum = 1; framenum <= cap_file_.capFile()->count ; framenum++) {
frame_data *fdata = frame_data_sequence_find(cap_file_.capFile()->provider.frames, framenum);
wtap_block_t pkt_block = cf_get_packet_block(cap_file_.capFile(), fdata);
if (pkt_block) {
- guint n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
- for (guint i = 0; i < n_comments; i++) {
+ unsigned n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ for (unsigned i = 0; i < n_comments; i++) {
char *comment_text;
if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_nth_string_option_value(pkt_block, OPT_COMMENT, i, &comment_text)) {
QString frame_comment_html = tr("<p>Frame %1: ").arg(framenum);
@@ -598,45 +641,31 @@ void CaptureFilePropertiesDialog::changeEvent(QEvent* event)
QDialog::changeEvent(event);
}
-void CaptureFilePropertiesDialog::on_buttonBox_helpRequested()
+void CaptureFilePropertiesDialog::addCaptureComment()
{
- mainApp->helpTopicAction(HELP_STATS_SUMMARY_DIALOG);
+ CaptureCommentDialog* cc_dialog;
+ cc_dialog = new CaptureCommentDialog(*this, cap_file_);
+ connect(cc_dialog, &CaptureCommentDialog::captureCommentChanged, this, &CaptureFilePropertiesDialog::updateWidgets);
+ //cc_dialog->setWindowModality(Qt::ApplicationModal);
+ cc_dialog->setAttribute(Qt::WA_DeleteOnClose);
+ cc_dialog->show();
}
-void CaptureFilePropertiesDialog::on_buttonBox_accepted()
+void CaptureFilePropertiesDialog::on_buttonBox_helpRequested()
{
- if (file_closed_ || !cap_file_.capFile()->filename) {
- return;
- }
-
- if (wtap_dump_can_write(cap_file_.capFile()->linktypes, WTAP_COMMENT_PER_SECTION))
- {
- gchar *str = qstring_strdup(ui->commentsTextEdit->toPlainText());
-
- /*
- * Make sure this would fit in a pcapng option.
- *
- * XXX - 65535 is the maximum size for an option in pcapng;
- * what if another capture file format supports larger
- * comments?
- */
- if (strlen(str) > 65535) {
- /* It doesn't fit. Tell the user and give up. */
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- "That comment is too large to save in a capture file.");
- return;
- }
- cf_update_section_comment(cap_file_.capFile(), str);
- emit captureCommentChanged();
- fillDetails();
- }
+ mainApp->helpTopicAction(HELP_STATS_SUMMARY_DIALOG);
}
void CaptureFilePropertiesDialog::on_buttonBox_clicked(QAbstractButton *button)
{
if (button == ui->buttonBox->button(QDialogButtonBox::Apply)) {
QClipboard *clipboard = QApplication::clipboard();
- QString details = tr("Created by Wireshark %1\n\n").arg(get_ws_vcs_version_info());
+ QString details;
+ if (is_packet_configuration_namespace()) {
+ details = tr("Created by Wireshark %1\n\n").arg(get_ws_vcs_version_info());
+ } else {
+ details = tr("Created by Logray %1\n\n").arg(get_lr_vcs_version_info());
+ }
details.append(ui->detailsTextEdit->toPlainText());
clipboard->setText(details);
} else if (button == ui->buttonBox->button(QDialogButtonBox::Reset)) {
diff --git a/ui/qt/capture_file_properties_dialog.h b/ui/qt/capture_file_properties_dialog.h
index dd1698a6..27b8d86f 100644
--- a/ui/qt/capture_file_properties_dialog.h
+++ b/ui/qt/capture_file_properties_dialog.h
@@ -14,8 +14,6 @@
#include <config.h>
-#include <glib.h>
-
#include <string.h>
#include <time.h>
@@ -62,8 +60,8 @@ private:
private slots:
void updateWidgets();
+ void addCaptureComment();
void on_buttonBox_helpRequested();
- void on_buttonBox_accepted();
void on_buttonBox_clicked(QAbstractButton *button);
void on_buttonBox_rejected();
};
diff --git a/ui/qt/capture_file_properties_dialog.ui b/ui/qt/capture_file_properties_dialog.ui
index bf5cd634..65b28f12 100644
--- a/ui/qt/capture_file_properties_dialog.ui
+++ b/ui/qt/capture_file_properties_dialog.ui
@@ -21,65 +21,38 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
- <widget class="QSplitter" name="splitter">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="opaqueResize">
- <bool>false</bool>
- </property>
- <property name="childrenCollapsible">
- <bool>false</bool>
- </property>
- <widget class="QWidget" name="">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="detailsLabel">
- <property name="text">
- <string>Details</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="detailsTextEdit">
- <property name="readOnly">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="">
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QLabel" name="commentsLabel">
- <property name="text">
- <string>Capture file comments</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="commentsTextEdit">
- <property name="sizeIncrement">
- <size>
- <width>0</width>
- <height>10</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
+ <widget class="QWidget" name="">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="detailsLabel">
+ <property name="text">
+ <string>Details</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="detailsTextEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
- <set>QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Reset|QDialogButtonBox::Save</set>
+ <set>QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Reset</set>
</property>
</widget>
</item>
</layout>
+ <widget class="QPushButton" name="actionEditButton">
+ <property name="text">
+ <string>Edit Comments</string>
+ </property>
+ </widget>
</widget>
<resources/>
<connections/>
diff --git a/ui/qt/capture_filter_syntax_worker.cpp b/ui/qt/capture_filter_syntax_worker.cpp
index 89ef981c..0fb6b543 100644
--- a/ui/qt/capture_filter_syntax_worker.cpp
+++ b/ui/qt/capture_filter_syntax_worker.cpp
@@ -10,7 +10,6 @@
#include "config.h"
#ifdef HAVE_LIBPCAP
-#include <glib.h>
#ifdef __MINGW32__
#include <_bsd_types.h>
@@ -50,8 +49,8 @@ static QMutex pcap_compile_mtx_;
void CaptureFilterSyntaxWorker::checkFilter(const QString filter)
{
#ifdef HAVE_LIBPCAP
- QSet<gint> active_dlts;
- QSet<guint> active_extcap;
+ QSet<int> active_dlts;
+ QSet<unsigned> active_extcap;
struct bpf_program fcode;
pcap_t *pd;
int pc_err;
@@ -66,7 +65,7 @@ void CaptureFilterSyntaxWorker::checkFilter(const QString filter)
return;
}
- for (guint if_idx = 0; if_idx < global_capture_opts.all_ifaces->len; if_idx++) {
+ for (unsigned if_idx = 0; if_idx < global_capture_opts.all_ifaces->len; if_idx++) {
interface_t *device;
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, if_idx);
@@ -85,7 +84,7 @@ void CaptureFilterSyntaxWorker::checkFilter(const QString filter)
}
}
- foreach(gint dlt, active_dlts.values()) {
+ foreach(int dlt, active_dlts.values()) {
pcap_compile_mtx_.lock();
pd = pcap_open_dead(dlt, DUMMY_SNAPLENGTH);
if (pd == NULL)
@@ -109,6 +108,7 @@ void CaptureFilterSyntaxWorker::checkFilter(const QString filter)
err_str = pcap_geterr(pd);
} else {
DEBUG_SYNTAX_CHECK("unknown", "known good");
+ pcap_freecode(&fcode);
}
pcap_close(pd);
@@ -118,9 +118,9 @@ void CaptureFilterSyntaxWorker::checkFilter(const QString filter)
}
// If it's already invalid, don't bother to check extcap
if (state != SyntaxLineEdit::Invalid) {
- foreach(guint extcapif, active_extcap.values()) {
+ foreach(unsigned extcapif, active_extcap.values()) {
interface_t *device;
- gchar *error = NULL;
+ char *error = NULL;
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, extcapif);
extcap_filter_status status = extcap_verify_capture_filter(device->name, filter.toUtf8().constData(), &error);
diff --git a/ui/qt/capture_info_dialog.cpp b/ui/qt/capture_info_dialog.cpp
index 5a29652c..e171ba3d 100644
--- a/ui/qt/capture_info_dialog.cpp
+++ b/ui/qt/capture_info_dialog.cpp
@@ -19,7 +19,7 @@
#include "ui/capture.h"
#include "capture_info_dialog.h"
-#include "ui_capture_info_dialog.h"
+#include <ui_capture_info_dialog.h>
#include "main_application.h"
@@ -146,7 +146,7 @@ void CaptureInfoModel::updateInfo()
if (!cap_info_) return;
GHashTableIter iter;
- gpointer key, value;
+ void *key, *value;
samples_++;
other_points_.append(cap_info_->counts->other - last_other_);
diff --git a/ui/qt/capture_options_dialog.cpp b/ui/qt/capture_options_dialog.cpp
index a0aed791..6763f14d 100644
--- a/ui/qt/capture_options_dialog.cpp
+++ b/ui/qt/capture_options_dialog.cpp
@@ -94,10 +94,10 @@ enum
static interface_t *find_device_by_if_name(const QString &interface_name)
{
interface_t *device;
- guint i;
+ unsigned i;
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
- if (!interface_name.compare(device->display_name) && !device->hidden && device->type != IF_PIPE) {
+ if (!interface_name.compare(device->display_name) && !device->hidden && device->if_info.type != IF_PIPE) {
return device;
}
}
@@ -214,6 +214,7 @@ CaptureOptionsDialog::CaptureOptionsDialog(QWidget *parent) :
#endif
#ifndef SHOW_MONITOR_COLUMN
ui->interfaceTree->setColumnHidden(col_monitor_, true);
+ ui->captureMonitorModeCheckBox->setVisible(false);
#endif
ui->interfaceTree->setItemDelegateForColumn(col_filter_, &interface_item_delegate_);
@@ -222,6 +223,7 @@ CaptureOptionsDialog::CaptureOptionsDialog(QWidget *parent) :
ui->filenameLineEdit->setPlaceholderText(tr("Leave blank to use a temporary file"));
ui->rbCompressionNone->setChecked(true);
+ ui->rbTimeNum->setChecked(true);
ui->tempDirLineEdit->setPlaceholderText(g_get_tmp_dir());
ui->tempDirLineEdit->setText(global_capture_opts.temp_dir);
@@ -246,6 +248,27 @@ CaptureOptionsDialog::CaptureOptionsDialog(QWidget *parent) :
connect(ui->interfaceTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
connect(ui->tempDirBrowseButton, SIGNAL(clicked()), this, SLOT(tempDirBrowseButtonClicked()));
+ // Ring buffer minimums (all 1 except # of files)
+ ui->PktSpinBox->setMinimum(1);
+ ui->MBSpinBox->setMinimum(1);
+ ui->SecsSpinBox->setMinimum(1);
+ ui->IntervalSecsSpinBox->setMinimum(1);
+ ui->RbSpinBox->setMinimum(2);
+
+ // Autostop minimums
+ ui->stopPktSpinBox->setMinimum(1);
+ ui->stopFilesSpinBox->setMinimum(1);
+ ui->stopMBSpinBox->setMinimum(1);
+ ui->stopSecsSpinBox->setMinimum(1);
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ connect(ui->MBComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &CaptureOptionsDialog::MBComboBoxIndexChanged);
+ connect(ui->stopMBComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &CaptureOptionsDialog::stopMBComboBoxIndexChanged);
+#else
+ connect(ui->MBComboBox, &QComboBox::currentIndexChanged, this, &CaptureOptionsDialog::MBComboBoxIndexChanged);
+ connect(ui->stopMBComboBox, &QComboBox::currentIndexChanged, this, &CaptureOptionsDialog::stopMBComboBoxIndexChanged);
+#endif
+
ui->tabWidget->setCurrentIndex(0);
updateWidgets();
@@ -266,14 +289,14 @@ void CaptureOptionsDialog::updateGlobalDeviceSelections()
while (*iter) {
QString device_name = (*iter)->data(col_interface_, Qt::UserRole).value<QString>();
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (device_name.compare(QString().fromUtf8(device->name)) == 0) {
if ((*iter)->isSelected()) {
- device->selected = TRUE;
+ device->selected = true;
global_capture_opts.num_selected++;
} else {
- device->selected = FALSE;
+ device->selected = false;
}
break;
}
@@ -294,7 +317,7 @@ void CaptureOptionsDialog::updateFromGlobalDeviceSelections()
while (*iter) {
QString device_name = (*iter)->data(col_interface_, Qt::UserRole).value<QString>();
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (device_name.compare(QString().fromUtf8(device->name)) == 0) {
if ((bool)device->selected != (*iter)->isSelected()) {
@@ -373,22 +396,27 @@ void CaptureOptionsDialog::on_capturePromModeCheckBox_toggled(bool checked)
}
}
-void CaptureOptionsDialog::browseButtonClicked()
+void CaptureOptionsDialog::on_captureMonitorModeCheckBox_toggled(bool checked)
{
- const char *open_dir = NULL;
-
- switch (prefs.gui_fileopen_style) {
-
- case FO_STYLE_LAST_OPENED:
- open_dir = get_open_dialog_initial_dir();
- break;
+ interface_t *device;
+ prefs.capture_monitor_mode = checked;
+ for (int row = 0; row < ui->interfaceTree->topLevelItemCount(); row++) {
+ InterfaceTreeWidgetItem *ti = dynamic_cast<InterfaceTreeWidgetItem *>(ui->interfaceTree->topLevelItem(row));
+ if (!ti) continue;
- case FO_STYLE_SPECIFIED:
- if (prefs.gui_fileopen_dir[0] != '\0')
- open_dir = prefs.gui_fileopen_dir;
- break;
+ QString device_name = ti->data(col_interface_, Qt::UserRole).toString();
+ device = getDeviceByName(device_name);
+ if (!device) continue;
+ if (device->monitor_mode_supported) {
+ device->monitor_mode_enabled = checked;
+ ti->updateInterfaceColumns(device);
+ }
}
- QString file_name = WiresharkFileDialog::getSaveFileName(this, tr("Specify a Capture File"), open_dir);
+}
+
+void CaptureOptionsDialog::browseButtonClicked()
+{
+ QString file_name = WiresharkFileDialog::getSaveFileName(this, tr("Specify a Capture File"), get_open_dialog_initial_dir());
ui->filenameLineEdit->setText(file_name);
}
@@ -416,15 +444,15 @@ void CaptureOptionsDialog::interfaceItemChanged(QTreeWidgetItem *item, int colum
switch(column) {
case col_pmode_:
- device->pmode = item->checkState(col_pmode_) == Qt::Checked ? TRUE : FALSE;
+ device->pmode = item->checkState(col_pmode_) == Qt::Checked ? true : false;
ti->updateInterfaceColumns(device);
break;
#ifdef SHOW_MONITOR_COLUMN
case col_monitor_:
{
- gboolean monitor_mode = FALSE;
- if (ti->checkState(col_monitor_) == Qt::Checked) monitor_mode = TRUE;
+ bool monitor_mode = false;
+ if (ti->checkState(col_monitor_) == Qt::Checked) monitor_mode = true;
if_capabilities_t *caps;
char *auth_str = NULL;
@@ -444,15 +472,16 @@ void CaptureOptionsDialog::interfaceItemChanged(QTreeWidgetItem *item, int colum
if (caps != Q_NULLPTR) {
for (int i = static_cast<int>(g_list_length(device->links)) - 1; i >= 0; i--) {
- GList* rem = g_list_nth(device->links, static_cast<guint>(i));
+ GList* rem = g_list_nth(device->links, static_cast<unsigned>(i));
device->links = g_list_remove_link(device->links, rem);
g_list_free_1(rem);
}
device->active_dlt = -1;
device->monitor_mode_supported = caps->can_set_rfmon;
- device->monitor_mode_enabled = monitor_mode;
+ device->monitor_mode_enabled = monitor_mode && caps->can_set_rfmon;
+ GList *lt_list = device->monitor_mode_enabled ? caps->data_link_types_rfmon : caps->data_link_types;
- for (GList *lt_entry = caps->data_link_types; lt_entry != Q_NULLPTR; lt_entry = gxx_list_next(lt_entry)) {
+ for (GList *lt_entry = lt_list; lt_entry != Q_NULLPTR; lt_entry = gxx_list_next(lt_entry)) {
link_row *linkr = new link_row();
data_link_info_t *data_link_info = gxx_list_data(data_link_info_t *, lt_entry);
/*
@@ -470,7 +499,7 @@ void CaptureOptionsDialog::interfaceItemChanged(QTreeWidgetItem *item, int colum
}
linkr->name = g_strdup(data_link_info->description);
} else {
- gchar *str;
+ char *str;
/* XXX - should we just omit them? */
str = ws_strdup_printf("%s (not supported)", data_link_info->name);
linkr->dlt = -1;
@@ -483,8 +512,8 @@ void CaptureOptionsDialog::interfaceItemChanged(QTreeWidgetItem *item, int colum
} else {
/* We don't know whether this supports monitor mode or not;
don't ask for monitor mode. */
- device->monitor_mode_enabled = FALSE;
- device->monitor_mode_supported = FALSE;
+ device->monitor_mode_enabled = false;
+ device->monitor_mode_supported = false;
}
ti->updateInterfaceColumns(device);
@@ -565,6 +594,36 @@ void CaptureOptionsDialog::itemDoubleClicked(QTreeWidgetItem *item, int column)
}
}
+void CaptureOptionsDialog::MBComboBoxIndexChanged(int index)
+{
+ switch (index) {
+ case 0: // kilobytes
+ ui->MBSpinBox->setMaximum(2000000000);
+ break;
+ case 1: // megabytes
+ ui->MBSpinBox->setMaximum(2000000);
+ break;
+ case 2: // gigabytes
+ ui->MBSpinBox->setMaximum(2000);
+ break;
+ }
+}
+
+void CaptureOptionsDialog::stopMBComboBoxIndexChanged(int index)
+{
+ switch (index) {
+ case 0: // kilobytes
+ ui->stopMBSpinBox->setMaximum(2000000000);
+ break;
+ case 1: // megabytes
+ ui->stopMBSpinBox->setMaximum(2000000);
+ break;
+ case 2: // gigabytes
+ ui->stopMBSpinBox->setMaximum(2000);
+ break;
+ }
+}
+
void CaptureOptionsDialog::on_gbStopCaptureAuto_toggled(bool checked)
{
global_capture_opts.has_file_interval = checked;
@@ -578,7 +637,7 @@ void CaptureOptionsDialog::on_gbNewFileAuto_toggled(bool checked)
ui->stopMBComboBox->setEnabled(checked?false:true);
ui->gbCompression->setEnabled(checked);
ui->rbCompressionNone->setEnabled(checked);
-#ifdef HAVE_ZLIB
+#if defined(HAVE_ZLIB) || defined(HAVE_ZLIBNG)
ui->rbCompressionGzip->setEnabled(checked);
#else
ui->rbCompressionGzip->setEnabled(false);
@@ -665,6 +724,8 @@ void CaptureOptionsDialog::updateInterfaces()
ui->rbPcap->setChecked(true);
}
ui->capturePromModeCheckBox->setChecked(prefs.capture_prom_mode);
+ ui->captureMonitorModeCheckBox->setChecked(prefs.capture_monitor_mode);
+ ui->captureMonitorModeCheckBox->setEnabled(false);
if (global_capture_opts.saving_to_file) {
ui->filenameLineEdit->setText(QString(global_capture_opts.orig_save_file));
@@ -781,10 +842,10 @@ void CaptureOptionsDialog::updateInterfaces()
ui->interfaceTree->clear();
#ifdef SHOW_BUFFER_COLUMN
- gint buffer;
+ int buffer;
#endif
- gint snaplen;
- gboolean hassnap, pmode;
+ int snaplen;
+ bool hassnap, pmode;
QList<QTreeWidgetItem *> selected_interfaces;
disconnect(ui->interfaceTree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(interfaceItemChanged(QTreeWidgetItem*,int)));
@@ -792,7 +853,7 @@ void CaptureOptionsDialog::updateInterfaces()
if (global_capture_opts.all_ifaces->len > 0) {
interface_t *device;
- for (guint device_idx = 0; device_idx < global_capture_opts.all_ifaces->len; device_idx++) {
+ for (unsigned device_idx = 0; device_idx < global_capture_opts.all_ifaces->len; device_idx++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, device_idx);
/* Continue if capture device is hidden */
@@ -835,11 +896,11 @@ void CaptureOptionsDialog::updateInterfaces()
if (capture_dev_user_snaplen_find(device->name, &hassnap, &snaplen)) {
/* Default snap length set in preferences */
device->snaplen = snaplen;
- device->has_snaplen = snaplen == WTAP_MAX_PACKET_SIZE_STANDARD ? FALSE : hassnap;
+ device->has_snaplen = snaplen == WTAP_MAX_PACKET_SIZE_STANDARD ? false : hassnap;
} else {
/* No preferences set yet, use default values */
device->snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
- device->has_snaplen = FALSE;
+ device->has_snaplen = false;
}
#ifdef SHOW_BUFFER_COLUMN
@@ -850,6 +911,11 @@ void CaptureOptionsDialog::updateInterfaces()
device->buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
}
#endif
+#ifdef SHOW_MONITOR_COLUMN
+ if (device->monitor_mode_supported) {
+ ui->captureMonitorModeCheckBox->setEnabled(true);
+ }
+#endif
ti->updateInterfaceColumns(device);
if (device->selected) {
@@ -921,14 +987,14 @@ void CaptureOptionsDialog::updateStatistics(void)
disconnect(ui->interfaceTree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(interfaceItemChanged(QTreeWidgetItem*,int)));
for (int row = 0; row < ui->interfaceTree->topLevelItemCount(); row++) {
- for (guint if_idx = 0; if_idx < global_capture_opts.all_ifaces->len; if_idx++) {
+ for (unsigned if_idx = 0; if_idx < global_capture_opts.all_ifaces->len; if_idx++) {
QTreeWidgetItem *ti = ui->interfaceTree->topLevelItem(row);
if (!ti) {
continue;
}
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, if_idx);
QString device_name = ti->text(col_interface_);
- if (device_name.compare(device->display_name) || device->hidden || device->type == IF_PIPE) {
+ if (device_name.compare(device->display_name) || device->hidden || device->if_info.type == IF_PIPE) {
continue;
}
QList<int> points = ti->data(col_traffic_, Qt::UserRole).value<QList<int> >();
@@ -942,13 +1008,17 @@ void CaptureOptionsDialog::updateStatistics(void)
void CaptureOptionsDialog::on_compileBPF_clicked()
{
- QStringList interfaces;
+ QList<InterfaceFilter> interfaces;
foreach (QTreeWidgetItem *ti, ui->interfaceTree->selectedItems()) {
- interfaces.append(ti->text(col_interface_));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ interfaces.emplaceBack(ti->text(col_interface_), ti->text(col_filter_));
+#else
+ interfaces.append(InterfaceFilter(ti->text(col_interface_), ti->text(col_filter_)));
+#endif
}
QString filter = ui->captureFilterComboBox->currentText();
- CompiledFilterOutput *cfo = new CompiledFilterOutput(this, interfaces, filter);
+ CompiledFilterOutput *cfo = new CompiledFilterOutput(this, interfaces);
cfo->show();
}
@@ -1033,17 +1103,17 @@ bool CaptureOptionsDialog::saveOptionsToPreferences()
global_capture_opts.autostop_filesize = ui->MBSpinBox->value();
int index = ui->MBComboBox->currentIndex();
switch (index) {
- case 1: if (global_capture_opts.autostop_filesize > 2000) {
+ case 1: if (global_capture_opts.autostop_filesize > 2000000) {
QMessageBox::warning(this, tr("Error"),
- tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB."));
+ tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB."));
return false;
} else {
global_capture_opts.autostop_filesize *= 1000;
}
break;
- case 2: if (global_capture_opts.autostop_filesize > 2) {
+ case 2: if (global_capture_opts.autostop_filesize > 2000) {
QMessageBox::warning(this, tr("Error"),
- tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB."));
+ tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB."));
return false;
} else {
global_capture_opts.autostop_filesize *= 1000000;
@@ -1072,17 +1142,17 @@ bool CaptureOptionsDialog::saveOptionsToPreferences()
global_capture_opts.autostop_filesize = ui->stopMBSpinBox->value();
int index = ui->stopMBComboBox->currentIndex();
switch (index) {
- case 1: if (global_capture_opts.autostop_filesize > 2000) {
+ case 1: if (global_capture_opts.autostop_filesize > 2000000) {
QMessageBox::warning(this, tr("Error"),
- tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB."));
+ tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB."));
return false;
} else {
global_capture_opts.autostop_filesize *= 1000;
}
break;
- case 2: if (global_capture_opts.autostop_filesize > 2) {
+ case 2: if (global_capture_opts.autostop_filesize > 2000) {
QMessageBox::warning(this, tr("Error"),
- tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB."));
+ tr("Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB."));
return false;
} else {
global_capture_opts.autostop_filesize *= 1000000;
@@ -1185,7 +1255,7 @@ bool CaptureOptionsDialog::saveOptionsToPreferences()
QTreeWidgetItem *ti = ui->interfaceTree->topLevelItem(row);
QString device_name = ti->data(col_interface_, Qt::UserRole).toString();
device = getDeviceByName(device_name);
- if (!device || device->pmode == -1) {
+ if (!device || !device->pmode) {
continue;
}
pmode_list << QString("%1(%2)").arg(device->name).arg(device->pmode);
@@ -1248,6 +1318,14 @@ bool CaptureOptionsDialog::saveOptionsToPreferences()
global_capture_opts.compress_type = NULL;
}
+ if (ui->rbTimeNum->isChecked() ) {
+ global_capture_opts.has_nametimenum = true;
+ } else if (ui->rbNumTime->isChecked() ) {
+ global_capture_opts.has_nametimenum = false;
+ } else {
+ global_capture_opts.has_nametimenum = false;
+ }
+
prefs_main_write();
return true;
}
@@ -1293,7 +1371,7 @@ void CaptureOptionsDialog::changeEvent(QEvent* event)
interface_t *CaptureOptionsDialog::getDeviceByName(const QString device_name)
{
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (device_name.compare(QString().fromUtf8(device->name)) == 0) {
return device;
@@ -1328,6 +1406,13 @@ QVariant InterfaceTreeWidgetItem::data(int column, int role) const
return QVariant::fromValue(points);
}
+ if (column == col_snaplen_ && role == Qt::DisplayRole) {
+ QVariant data = QTreeWidgetItem::data(column, role);
+ if (data.toInt() == WTAP_MAX_PACKET_SIZE_STANDARD || data.toInt() == 0) {
+ return InterfaceTreeDelegate::tr("default");
+ }
+ return data;
+ }
return QTreeWidgetItem::data(column, role);
}
@@ -1366,9 +1451,9 @@ QWidget* InterfaceTreeDelegate::createEditor(QWidget *parent, const QStyleOption
{
QWidget *w = NULL;
#ifdef SHOW_BUFFER_COLUMN
- gint buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
+ int buffer = DEFAULT_CAPTURE_BUFFER_SIZE;
#endif
- guint snap = WTAP_MAX_PACKET_SIZE_STANDARD;
+ unsigned snap = WTAP_MAX_PACKET_SIZE_STANDARD;
GList *links = NULL;
if (idx.column() > 1 && idx.data().toString().compare(UTF8_EM_DASH)) {
@@ -1419,9 +1504,10 @@ QWidget* InterfaceTreeDelegate::createEditor(QWidget *parent, const QStyleOption
case col_snaplen_:
{
QSpinBox *sb = new QSpinBox(parent);
- sb->setRange(1, WTAP_MAX_PACKET_SIZE_STANDARD);
+ sb->setRange(0, WTAP_MAX_PACKET_SIZE_STANDARD);
sb->setValue(snap);
sb->setWrapping(true);
+ sb->setSpecialValueText(tr("default"));
connect(sb, SIGNAL(valueChanged(int)), this, SLOT(snapshotLengthChanged(int)));
w = (QWidget*) sb;
break;
@@ -1505,7 +1591,7 @@ void InterfaceTreeDelegate::snapshotLengthChanged(int value)
if (!device) {
return;
}
- if (value != WTAP_MAX_PACKET_SIZE_STANDARD) {
+ if (value != WTAP_MAX_PACKET_SIZE_STANDARD && value != 0) {
device->has_snaplen = true;
device->snaplen = value;
} else {
diff --git a/ui/qt/capture_options_dialog.h b/ui/qt/capture_options_dialog.h
index e9eea761..cc57467e 100644
--- a/ui/qt/capture_options_dialog.h
+++ b/ui/qt/capture_options_dialog.h
@@ -70,6 +70,7 @@ protected:
private slots:
void on_capturePromModeCheckBox_toggled(bool checked);
+ void on_captureMonitorModeCheckBox_toggled(bool checked);
void on_gbStopCaptureAuto_toggled(bool checked);
void on_cbUpdatePacketsRT_toggled(bool checked);
void on_cbAutoScroll_toggled(bool checked);
@@ -94,6 +95,8 @@ private slots:
void itemDoubleClicked(QTreeWidgetItem *item, int column);
void changeEvent(QEvent* event);
void tempDirBrowseButtonClicked();
+ void MBComboBoxIndexChanged(int index);
+ void stopMBComboBoxIndexChanged(int index);
signals:
void startCapture();
diff --git a/ui/qt/capture_options_dialog.ui b/ui/qt/capture_options_dialog.ui
index 2ace9a95..c9eba3b6 100644
--- a/ui/qt/capture_options_dialog.ui
+++ b/ui/qt/capture_options_dialog.ui
@@ -98,6 +98,16 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="captureMonitorModeCheckBox">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="text">
+ <string>Enable monitor mode on all 802.11 interfaces</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -321,12 +331,6 @@
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
- <property name="minimum">
- <number>1</number>
- </property>
- <property name="maximum">
- <number>1000000</number>
- </property>
<property name="value">
<number>1</number>
</property>
@@ -375,9 +379,6 @@
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
- <property name="minimum">
- <number>1</number>
- </property>
<property name="maximum">
<number>1000000</number>
</property>
@@ -431,9 +432,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
- <property name="minimum">
- <number>1</number>
- </property>
<property name="maximum">
<number>1000000</number>
</property>
@@ -473,7 +471,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
<property name="title">
<string>compression</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_5">
+ <layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QRadioButton" name="rbCompressionNone">
<property name="text">
@@ -497,6 +495,44 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
</layout>
</widget>
</item>
+ <item row="5" column="1" colspan="2">
+ <widget class="QGroupBox" name="nameTemplateGB">
+ <property name="title">
+ <string>File infix pattern</string>
+ </property>
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QRadioButton" name="rbTimeNum">
+ <property name="text">
+ <string>YYYYmmDDHHMMSS_NNNNN</string>
+ </property>
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">nameTimeNumBG</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="rbNumTime">
+ <property name="text">
+ <string>NNNNN_YYYYmmDDHHMMSS</string>
+ </property>
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">nameTimeNumBG</string>
+ </attribute>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="0" column="3" rowspan="4">
<spacer name="horizontalSpacer_8">
<property name="orientation">
@@ -530,9 +566,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
<property name="wrapping">
<bool>true</bool>
</property>
- <property name="minimum">
- <number>2</number>
- </property>
<property name="maximum">
<number>65535</number>
</property>
@@ -782,7 +815,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
</sizepolicy>
</property>
<property name="toolTip">
- <string>Stop capturing after the specified number of packets have been captured.</string>
+ <string>Stop capturing after the specified number of files have been created.</string>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
@@ -820,9 +853,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
<property name="buttonSymbols">
<enum>QAbstractSpinBox::PlusMinus</enum>
</property>
- <property name="maximum">
- <number>2147483647</number>
- </property>
<property name="value">
<number>1</number>
</property>
@@ -972,5 +1002,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</stri
<connections/>
<buttongroups>
<buttongroup name="buttonGroup"/>
+ <buttongroup name="nameTimeNumBG"/>
</buttongroups>
</ui>
diff --git a/ui/qt/capture_preferences_frame.cpp b/ui/qt/capture_preferences_frame.cpp
index 361eb656..b20bfbed 100644
--- a/ui/qt/capture_preferences_frame.cpp
+++ b/ui/qt/capture_preferences_frame.cpp
@@ -36,6 +36,7 @@ CapturePreferencesFrame::CapturePreferencesFrame(QWidget *parent) :
pref_device_ = prefFromPrefPtr(&prefs.capture_device);
pref_prom_mode_ = prefFromPrefPtr(&prefs.capture_prom_mode);
+ pref_monitor_mode_ = prefFromPrefPtr(&prefs.capture_monitor_mode);
pref_pcap_ng_ = prefFromPrefPtr(&prefs.capture_pcap_ng);
pref_real_time_ = prefFromPrefPtr(&prefs.capture_real_time);
pref_update_interval_ = prefFromPrefPtr(&prefs.capture_update_interval);
@@ -71,7 +72,7 @@ void CapturePreferencesFrame::updateWidgets()
}
ui->defaultInterfaceComboBox->clear();
if ((global_capture_opts.all_ifaces->len == 0) &&
- (prefs_get_bool_value(pref_no_interface_load_, pref_stashed) == FALSE)) {
+ (prefs_get_bool_value(pref_no_interface_load_, pref_stashed) == false)) {
/*
* No interfaces - try refreshing the local interfaces, to
* see whether any have showed up (or privileges have changed
@@ -79,7 +80,7 @@ void CapturePreferencesFrame::updateWidgets()
*/
mainApp->refreshLocalInterfaces();
}
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
/* Continue if capture device is hidden */
@@ -122,6 +123,7 @@ void CapturePreferencesFrame::updateWidgets()
}
ui->capturePromModeCheckBox->setChecked(prefs_get_bool_value(pref_prom_mode_, pref_stashed));
+ ui->captureMonitorModeCheckBox->setChecked(prefs_get_bool_value(pref_monitor_mode_, pref_stashed));
ui->capturePcapNgCheckBox->setChecked(prefs_get_bool_value(pref_pcap_ng_, pref_stashed));
ui->captureRealTimeCheckBox->setChecked(prefs_get_bool_value(pref_real_time_, pref_stashed));
ui->captureUpdateIntervalLineEdit->setText(QString::number(prefs_get_uint_value_real(pref_update_interval_, pref_stashed)));
@@ -142,6 +144,11 @@ void CapturePreferencesFrame::on_capturePromModeCheckBox_toggled(bool checked)
prefs_set_bool_value(pref_prom_mode_, checked, pref_stashed);
}
+void CapturePreferencesFrame::on_captureMonitorModeCheckBox_toggled(bool checked)
+{
+ prefs_set_bool_value(pref_monitor_mode_, checked, pref_stashed);
+}
+
void CapturePreferencesFrame::on_capturePcapNgCheckBox_toggled(bool checked)
{
prefs_set_bool_value(pref_pcap_ng_, checked, pref_stashed);
diff --git a/ui/qt/capture_preferences_frame.h b/ui/qt/capture_preferences_frame.h
index 33cf29b8..35e3b495 100644
--- a/ui/qt/capture_preferences_frame.h
+++ b/ui/qt/capture_preferences_frame.h
@@ -32,6 +32,7 @@ protected:
private slots:
void on_defaultInterfaceComboBox_editTextChanged(const QString &new_iface);
void on_capturePromModeCheckBox_toggled(bool checked);
+ void on_captureMonitorModeCheckBox_toggled(bool checked);
void on_capturePcapNgCheckBox_toggled(bool checked);
void on_captureRealTimeCheckBox_toggled(bool checked);
void on_captureUpdateIntervalLineEdit_textChanged(const QString &new_str);
@@ -43,6 +44,7 @@ private:
pref_t *pref_device_;
pref_t *pref_prom_mode_;
+ pref_t *pref_monitor_mode_;
pref_t *pref_pcap_ng_;
pref_t *pref_real_time_;
pref_t *pref_update_interval_;
diff --git a/ui/qt/capture_preferences_frame.ui b/ui/qt/capture_preferences_frame.ui
index b5a0b4b8..c0a76efd 100644
--- a/ui/qt/capture_preferences_frame.ui
+++ b/ui/qt/capture_preferences_frame.ui
@@ -68,6 +68,16 @@
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="captureMonitorModeCheckBox">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="text">
+ <string>Capture packets in monitor mode on 802.11 devices</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="capturePcapNgCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
diff --git a/ui/qt/coloring_rules_dialog.cpp b/ui/qt/coloring_rules_dialog.cpp
index 20eb72b2..c33013b6 100644
--- a/ui/qt/coloring_rules_dialog.cpp
+++ b/ui/qt/coloring_rules_dialog.cpp
@@ -96,7 +96,7 @@ ColoringRulesDialog::ColoringRulesDialog(QWidget *parent, QString add_filter) :
ui->buttonBox->addButton(copy_button, QDialogButtonBox::ActionRole);
connect(copy_button, &CopyFromProfileButton::copyProfile, this, &ColoringRulesDialog::copyFromProfile);
- QString abs_path = gchar_free_to_qstring(get_persconffile_path(COLORFILTERS_FILE_NAME, TRUE));
+ QString abs_path = gchar_free_to_qstring(get_persconffile_path(COLORFILTERS_FILE_NAME, true));
if (file_exists(abs_path.toUtf8().constData())) {
ui->pathLabel->setText(abs_path);
ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
@@ -229,7 +229,7 @@ void ColoringRulesDialog::updateHint(QModelIndex idx)
if (errors_.count() > 0) {
//take the list of QModelIndexes and sort them so first color rule error is displayed
- //This isn't the most efficent algorithm, but the list shouldn't be large to matter
+ //This isn't the most efficient algorithm, but the list shouldn't be large to matter
QList<QModelIndex> keys = errors_.keys();
//list is not guaranteed to be sorted, so force it
@@ -315,7 +315,7 @@ void ColoringRulesDialog::changeColor(bool foreground)
if (!current.isValid())
return;
- QColorDialog *color_dlg = new QColorDialog();
+ QColorDialog *color_dlg = new QColorDialog(this);
color_dlg->setCurrentColor(colorRuleModel_.data(current, foreground ? Qt::ForegroundRole : Qt::BackgroundRole).toString());
connect(color_dlg, &QColorDialog::colorSelected, std::bind(&ColoringRulesDialog::colorChanged, this, foreground, std::placeholders::_1));
diff --git a/ui/qt/column_editor_frame.cpp b/ui/qt/column_editor_frame.cpp
index ea527b9a..4525ea2c 100644
--- a/ui/qt/column_editor_frame.cpp
+++ b/ui/qt/column_editor_frame.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/column.h>
#include <epan/prefs.h>
#include <ui/recent.h>
@@ -25,6 +23,7 @@
#include <QPushButton>
#include <QComboBox>
#include <QKeyEvent>
+#include <QAbstractItemView>
ColumnEditorFrame::ColumnEditorFrame(QWidget *parent) :
AccordionFrame(parent),
@@ -43,10 +42,32 @@ ColumnEditorFrame::ColumnEditorFrame(QWidget *parent) :
ui->typeComboBox->addItem(col_format_desc(i), QVariant(i));
}
+ // We want a behavior where the occurrenceLineEdit and type line edit
+ // will shrink, but where they won't expand past their needed space.
+ // Setting a stretch factor will make them expand (ignoring their
+ // SizePolicy) unless we also set the maximum width to their size hints.
+ //
+ ui->horizontalLayout->setStretchFactor(ui->titleLineEdit, 2);
+ ui->horizontalLayout->setStretchFactor(ui->occurrenceLineEdit, 1);
+ ui->occurrenceLineEdit->setMaximumWidth(ui->occurrenceLineEdit->sizeHint().width());
+ // On Windows, this is necessary to make the popup be the width of the
+ // longest item, instead of the width matching the combobox and using
+ // ellipses. (Linux has the popup wider by default.)
+ ui->typeComboBox->view()->setMinimumWidth(ui->typeComboBox->sizeHint().width());
+ // This lets the typeComboBox shrink a bit if the width is very small.
+ ui->typeComboBox->setMinimumContentsLength(20);
+
connect(ui->fieldsNameLineEdit, &FieldFilterEdit::textChanged,
ui->fieldsNameLineEdit, &FieldFilterEdit::checkCustomColumn);
connect(ui->fieldsNameLineEdit, &FieldFilterEdit::textChanged,
this, &ColumnEditorFrame::checkCanResolve);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ connect(ui->typeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
+ &ColumnEditorFrame::typeChanged);
+#else
+ connect(ui->typeComboBox, &QComboBox::currentIndexChanged, this,
+ &ColumnEditorFrame::typeChanged);
+#endif
}
ColumnEditorFrame::~ColumnEditorFrame()
@@ -82,6 +103,34 @@ void ColumnEditorFrame::setFields(int index)
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok);
}
+void ColumnEditorFrame::typeChanged(int index)
+{
+ // The fieldsNameLineEdit and occurrenceLineEdit are only relevant if the
+ // typeComboBox is COL_CUSTOM. The text for "Custom" is small. So when
+ // COL_CUSTOM is selected, shrink the size of the typeComboBox to what is
+ // necessary for "Custom" and give extra space to the fieldsNameLineEdit.
+ // For any other column type, do the reverse.
+ if (index == COL_CUSTOM) {
+ int width = fontMetrics().boundingRect(ui->typeComboBox->currentText()).width();
+ if (!ui->typeComboBox->itemIcon(index).isNull()) {
+ width += ui->typeComboBox->iconSize().width() + 4;
+ }
+ QStyleOptionComboBox opt;
+ opt.initFrom(ui->typeComboBox);
+ QSize sh(width, ui->typeComboBox->height());
+ width = ui->typeComboBox->style()->sizeFromContents(QStyle::CT_ComboBox, &opt, sh, ui->typeComboBox).width();
+ ui->typeComboBox->setMaximumWidth(width);
+ ui->fieldsNameLineEdit->setMaximumWidth(16777215); // Default (no) maximum
+ ui->horizontalLayout->setStretchFactor(ui->typeComboBox, 1);
+ ui->horizontalLayout->setStretchFactor(ui->fieldsNameLineEdit, 4);
+ } else {
+ ui->typeComboBox->setMaximumWidth(ui->typeComboBox->sizeHint().width());
+ ui->fieldsNameLineEdit->setMaximumWidth(ui->fieldsNameLineEdit->sizeHint().width());
+ ui->horizontalLayout->setStretchFactor(ui->typeComboBox, 2);
+ ui->horizontalLayout->setStretchFactor(ui->fieldsNameLineEdit, 1);
+ }
+}
+
void ColumnEditorFrame::editColumn(int column)
{
cur_column_ = column;
@@ -146,12 +195,8 @@ void ColumnEditorFrame::on_buttonBox_accepted()
set_column_title(cur_column_, col_str.constData());
set_column_format(cur_column_, ui->typeComboBox->currentIndex());
if (ui->typeComboBox->currentIndex() == COL_CUSTOM) {
- gint width = recent_get_column_width(cur_column_);
- gchar xalign = recent_get_column_xalign(cur_column_);
col_str = ui->fieldsNameLineEdit->text().toUtf8();
set_column_custom_fields(cur_column_, col_str.constData());
- recent_set_column_width(cur_column_, width);
- recent_set_column_xalign(cur_column_, xalign);
if (!ui->occurrenceLineEdit->text().isEmpty()) {
set_column_custom_occurrence(cur_column_, ui->occurrenceLineEdit->text().toInt());
}
diff --git a/ui/qt/column_editor_frame.h b/ui/qt/column_editor_frame.h
index 3778fb0d..6bd18cbb 100644
--- a/ui/qt/column_editor_frame.h
+++ b/ui/qt/column_editor_frame.h
@@ -47,6 +47,7 @@ private:
QString saved_fields_;
QString saved_occurrence_;
void setFields(int index);
+ void typeChanged(int index);
};
#endif // COLUMN_EDITOR_FRAME_H
diff --git a/ui/qt/column_editor_frame.ui b/ui/qt/column_editor_frame.ui
index 682be2bc..781b2d9b 100644
--- a/ui/qt/column_editor_frame.ui
+++ b/ui/qt/column_editor_frame.ui
@@ -19,7 +19,7 @@
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0,0,0,0,2,0,0,0,0,0">
+ <layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
@@ -43,7 +43,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>20</width>
+ <width>10</width>
<height>5</height>
</size>
</property>
@@ -66,7 +66,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>20</width>
+ <width>10</width>
<height>5</height>
</size>
</property>
@@ -89,7 +89,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>20</width>
+ <width>10</width>
<height>5</height>
</size>
</property>
@@ -125,7 +125,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>20</width>
+ <width>10</width>
<height>5</height>
</size>
</property>
diff --git a/ui/qt/column_preferences_frame.cpp b/ui/qt/column_preferences_frame.cpp
index 961e2737..3bfd8bdb 100644
--- a/ui/qt/column_preferences_frame.cpp
+++ b/ui/qt/column_preferences_frame.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/column.h>
#include <epan/prefs.h>
#include <epan/proto.h>
diff --git a/ui/qt/compiled_filter_output.cpp b/ui/qt/compiled_filter_output.cpp
index 1db9c899..7e7d778e 100644
--- a/ui/qt/compiled_filter_output.cpp
+++ b/ui/qt/compiled_filter_output.cpp
@@ -28,10 +28,9 @@
#include <QClipboard>
#include <QPushButton>
-CompiledFilterOutput::CompiledFilterOutput(QWidget *parent, QStringList &intList, QString &compile_filter) :
+CompiledFilterOutput::CompiledFilterOutput(QWidget *parent, QList<InterfaceFilter> &intList) :
GeometryStateDialog(parent),
intList_(intList),
- compile_filter_(compile_filter),
ui(new Ui::CompiledFilterOutput)
{
ui->setupUi(this);
@@ -47,8 +46,7 @@ CompiledFilterOutput::CompiledFilterOutput(QWidget *parent, QStringList &intList
close_bt->setDefault(true);
interface_list_ = ui->interfaceList;
- pcap_compile_mtx = g_new(GMutex,1);
- g_mutex_init(pcap_compile_mtx);
+ g_mutex_init(&pcap_compile_mtx_);
#ifdef HAVE_LIBPCAP
compileFilter();
#endif
@@ -64,6 +62,7 @@ CompiledFilterOutput::~CompiledFilterOutput()
parentWidget()->activateWindow();
}
delete ui;
+ g_mutex_clear(&pcap_compile_mtx_);
}
#ifdef HAVE_LIBPCAP
@@ -71,21 +70,21 @@ void CompiledFilterOutput::compileFilter()
{
struct bpf_program fcode;
- foreach (QString interfaces, intList_) {
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ foreach (InterfaceFilter current, intList_) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
- if (interfaces.compare(device->display_name)) {
+ if (current.interface.compare(device->display_name)) {
continue;
} else {
pcap_t *pd = pcap_open_dead(device->active_dlt, WTAP_MAX_PACKET_SIZE_STANDARD);
if (pd == NULL)
break;
- g_mutex_lock(pcap_compile_mtx);
- if (pcap_compile(pd, &fcode, compile_filter_.toUtf8().data(), 1, 0) < 0) {
- compile_results.insert(interfaces, QString(pcap_geterr(pd)));
- g_mutex_unlock(pcap_compile_mtx);
- ui->interfaceList->addItem(new QListWidgetItem(QIcon(":expert/expert_error.png"),interfaces));
+ g_mutex_lock(&pcap_compile_mtx_);
+ if (pcap_compile(pd, &fcode, current.filter.toUtf8().data(), 1, 0) < 0) {
+ compile_results.insert(current.interface, QString(pcap_geterr(pd)));
+ g_mutex_unlock(&pcap_compile_mtx_);
+ ui->interfaceList->addItem(new QListWidgetItem(QIcon(":expert/expert_error.png"), current.interface));
} else {
GString *bpf_code_dump = g_string_new("");
struct bpf_insn *insn = fcode.bf_insns;
@@ -94,11 +93,13 @@ void CompiledFilterOutput::compileFilter()
g_string_append(bpf_code_dump, bpf_image(insn, ii));
g_string_append(bpf_code_dump, "\n");
}
- g_mutex_unlock(pcap_compile_mtx);
- compile_results.insert(interfaces, QString(bpf_code_dump->str));
+ g_mutex_unlock(&pcap_compile_mtx_);
+ compile_results.insert(current.interface, QString(bpf_code_dump->str));
g_string_free(bpf_code_dump, TRUE);
- ui->interfaceList->addItem(new QListWidgetItem(interfaces));
+ ui->interfaceList->addItem(new QListWidgetItem(current.interface));
+ pcap_freecode(&fcode);
}
+ pcap_close(pd);
break;
}
}
diff --git a/ui/qt/compiled_filter_output.h b/ui/qt/compiled_filter_output.h
index a94fc4f0..d87c7c29 100644
--- a/ui/qt/compiled_filter_output.h
+++ b/ui/qt/compiled_filter_output.h
@@ -19,6 +19,13 @@
#include <glib.h>
+struct InterfaceFilter {
+ InterfaceFilter(QString intf, QString filt) : interface(intf), filter(filt) {}
+
+ QString interface;
+ QString filter;
+};
+
namespace Ui {
class CompiledFilterOutput;
}
@@ -28,10 +35,9 @@ class CompiledFilterOutput : public GeometryStateDialog
Q_OBJECT
private:
- QStringList intList_;
- QString &compile_filter_;
+ QList<InterfaceFilter> intList_;
Ui::CompiledFilterOutput *ui;
- GMutex *pcap_compile_mtx;
+ GMutex pcap_compile_mtx_;
QHash<QString, QString> compile_results;
QListWidget *interface_list_;
QPushButton *copy_bt_;
@@ -40,7 +46,7 @@ private:
#endif
public:
- explicit CompiledFilterOutput(QWidget *parent = 0, QStringList &intList = *new QStringList(), QString &filter = *new QString());
+ explicit CompiledFilterOutput(QWidget *parent = 0, QList<InterfaceFilter> &intList = *new QList<InterfaceFilter>());
~CompiledFilterOutput();
diff --git a/ui/qt/conversation_colorize_action.cpp b/ui/qt/conversation_colorize_action.cpp
index 9518e1ee..cb358472 100644
--- a/ui/qt/conversation_colorize_action.cpp
+++ b/ui/qt/conversation_colorize_action.cpp
@@ -11,8 +11,6 @@
#include <config.h>
-#include <glib.h>
-
#include "epan/conversation_filter.h"
#include <QMenu>
diff --git a/ui/qt/conversation_dialog.cpp b/ui/qt/conversation_dialog.cpp
index bad3d6d2..cd69e434 100644
--- a/ui/qt/conversation_dialog.cpp
+++ b/ui/qt/conversation_dialog.cpp
@@ -71,7 +71,7 @@ ConversationDialog::ConversationDialog(QWidget &parent, CaptureFile &cf) :
{
trafficList()->setProtocolInfo(table_name_, &(recent.conversation_tabs));
- trafficTab()->setProtocolInfo(table_name_, trafficList(), &(recent.conversation_tabs_columns), &createModel);
+ trafficTab()->setProtocolInfo(table_name_, trafficList(), &(recent.conversation_tabs), &(recent.conversation_tabs_columns), &createModel);
trafficTab()->setDelegate(&createDelegate);
trafficTab()->setDelegate(&createDelegate);
trafficTab()->setFilter(cf.displayFilter());
@@ -148,6 +148,9 @@ void ConversationDialog::graphTcp()
void ConversationDialog::tabChanged(int)
{
+ // By default we'll open the last known opened tab from the Profile
+ GList *selected_tab = NULL;
+
bool follow = false;
bool graph = false;
@@ -155,6 +158,19 @@ void ConversationDialog::tabChanged(int)
QVariant proto_id = trafficTab()->currentItemData(ATapDataModel::PROTO_ID);
if (!proto_id.isNull()) {
follow = (get_follow_by_proto_id(proto_id.toInt()) != nullptr);
+
+ for (GList * endTab = recent.conversation_tabs; endTab; endTab = endTab->next) {
+ int protoId = proto_get_id_by_short_name((const char *)endTab->data);
+ if ((protoId > -1) && (protoId==proto_id.toInt())) {
+ selected_tab = endTab;
+ }
+ }
+
+ // Move the selected tab to the head
+ if (selected_tab != nullptr) {
+ recent.conversation_tabs = g_list_remove_link(recent.conversation_tabs, selected_tab);
+ recent.conversation_tabs = g_list_prepend(recent.conversation_tabs, selected_tab->data);
+ }
}
int endpointType = trafficTab()->currentItemData(ATapDataModel::ENDPOINT_DATATYPE).toInt();
switch(endpointType) {
diff --git a/ui/qt/conversation_dialog.h b/ui/qt/conversation_dialog.h
index 5ad058ac..e54b67f4 100644
--- a/ui/qt/conversation_dialog.h
+++ b/ui/qt/conversation_dialog.h
@@ -28,7 +28,7 @@ protected:
void captureFileClosing();
signals:
- void openFollowStreamDialog(int proto_id, guint stream_num, guint sub_stream_num);
+ void openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num);
private:
QPushButton *follow_bt_;
diff --git a/ui/qt/conversation_hash_tables_dialog.cpp b/ui/qt/conversation_hash_tables_dialog.cpp
index cc699dae..f7f4fc74 100644
--- a/ui/qt/conversation_hash_tables_dialog.cpp
+++ b/ui/qt/conversation_hash_tables_dialog.cpp
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/conversation.h>
#include <epan/conversation_debug.h>
@@ -21,7 +19,7 @@
#include "main_application.h"
static void
-fill_named_table(gpointer key, gpointer value _U_, gpointer user_data)
+fill_named_table(void *key, void *value _U_, void *user_data)
{
const conversation_element_t *elements = static_cast<const conversation_element_t *>(key);
QString* html_table = static_cast<QString *>(user_data);
@@ -38,6 +36,8 @@ fill_named_table(gpointer key, gpointer value _U_, gpointer user_data)
int uint_count = 1;
int uint64_count = 1;
int int_count = 1;
+ int int64_count = 1;
+ int blob_count = 1;
for (const conversation_element_t *cur_el = elements; ; cur_el++) {
QString title;
switch (cur_el->type) {
@@ -59,6 +59,12 @@ fill_named_table(gpointer key, gpointer value _U_, gpointer user_data)
case CE_INT:
title = QString("Int %1").arg(int_count++);
break;
+ case CE_INT64:
+ title = QString("Int64 %1").arg(int64_count++);
+ break;
+ case CE_BLOB:
+ title = QString("Blob %1").arg(blob_count++);
+ break;
case CE_CONVERSATION_TYPE:
html_table->append(QString("<th>Endpoint</th>"));
goto title_done;
@@ -93,6 +99,12 @@ title_done:
case CE_INT:
val = QString::number(cur_el->int_val);
break;
+ case CE_INT64:
+ val = QString::number(cur_el->int64_val);
+ break;
+ case CE_BLOB:
+ val = QString(QByteArray::fromRawData((const char *)cur_el->blob.val, (int)cur_el->blob.len).toHex());
+ break;
case CE_CONVERSATION_TYPE:
html_table->append(QString("<td>%1</td>").arg(QString::number(cur_el->conversation_type_val)));
goto val_done;
diff --git a/ui/qt/decode_as_dialog.cpp b/ui/qt/decode_as_dialog.cpp
index edc6ccc7..c45fae2e 100644
--- a/ui/qt/decode_as_dialog.cpp
+++ b/ui/qt/decode_as_dialog.cpp
@@ -65,7 +65,7 @@ DecodeAsDialog::DecodeAsDialog(QWidget *parent, capture_file *cf, bool create_ne
setWindowTitle(mainApp->windowTitleString(tr("Decode As…")));
- QString abs_path = gchar_free_to_qstring(get_persconffile_path(DECODE_AS_ENTRIES_FILE_NAME, TRUE));
+ QString abs_path = gchar_free_to_qstring(get_persconffile_path(DECODE_AS_ENTRIES_FILE_NAME, true));
if (file_exists(abs_path.toUtf8().constData())) {
ui->pathLabel->setText(abs_path);
ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
@@ -137,7 +137,7 @@ void DecodeAsDialog::on_decodeAsTreeView_currentItemChanged(const QModelIndex &c
void DecodeAsDialog::copyFromProfile(QString filename)
{
- const gchar *err = NULL;
+ const char *err = NULL;
if (!model_->copyFromProfile(filename, &err)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Error while loading %s: %s", filename.toUtf8().constData(), err);
@@ -213,7 +213,7 @@ void DecodeAsDialog::on_buttonBox_clicked(QAbstractButton *button)
break;
case QDialogButtonBox::Save:
{
- gchar* err = NULL;
+ char* err = NULL;
applyChanges();
if (save_decode_as_entries(&err) < 0) {
diff --git a/ui/qt/decode_as_dialog.h b/ui/qt/decode_as_dialog.h
index 8765489a..73d664d3 100644
--- a/ui/qt/decode_as_dialog.h
+++ b/ui/qt/decode_as_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include <ui/qt/models/decode_as_model.h>
#include <ui/qt/models/decode_as_delegate.h>
diff --git a/ui/qt/display_filter_expression_dialog.cpp b/ui/qt/display_filter_expression_dialog.cpp
index e071d0ab..d192ec4f 100644
--- a/ui/qt/display_filter_expression_dialog.cpp
+++ b/ui/qt/display_filter_expression_dialog.cpp
@@ -316,9 +316,9 @@ void DisplayFilterExpressionDialog::updateWidgets()
void DisplayFilterExpressionDialog::fillEnumBooleanValues(const true_false_string *tfs)
{
- QListWidgetItem *eli = new QListWidgetItem(tfs_get_string(TRUE, tfs), ui->enumListWidget);
+ QListWidgetItem *eli = new QListWidgetItem(tfs_get_string(true, tfs), ui->enumListWidget);
eli->setData(Qt::UserRole, QString("1"));
- eli = new QListWidgetItem(tfs_get_string(FALSE, tfs), ui->enumListWidget);
+ eli = new QListWidgetItem(tfs_get_string(false, tfs), ui->enumListWidget);
eli->setData(Qt::UserRole, QString("0"));
}
diff --git a/ui/qt/endpoint_dialog.cpp b/ui/qt/endpoint_dialog.cpp
index 38a30be2..d3fd98d0 100644
--- a/ui/qt/endpoint_dialog.cpp
+++ b/ui/qt/endpoint_dialog.cpp
@@ -69,7 +69,7 @@ EndpointDialog::EndpointDialog(QWidget &parent, CaptureFile &cf) :
{
trafficList()->setProtocolInfo(table_name_, &(recent.endpoint_tabs));
- trafficTab()->setProtocolInfo(table_name_, trafficList(), &(recent.endpoint_tabs_columns), &createModel);
+ trafficTab()->setProtocolInfo(table_name_, trafficList(), &(recent.endpoint_tabs), &(recent.endpoint_tabs_columns), &createModel);
trafficTab()->setFilter(cf.displayFilter());
connect(trafficTab(), &TrafficTab::filterAction, this, &EndpointDialog::filterAction);
@@ -111,6 +111,29 @@ void EndpointDialog::tabChanged(int idx)
Q_UNUSED(idx);
#endif
+
+ // By default we'll open the last known opened tab from the Profile
+ GList *selected_tab = NULL;
+
+ if (!file_closed_) {
+ QVariant proto_id = trafficTab()->currentItemData(ATapDataModel::PROTO_ID);
+ if (!proto_id.isNull()) {
+
+ for (GList * endTab = recent.endpoint_tabs; endTab; endTab = endTab->next) {
+ int protoId = proto_get_id_by_short_name((const char *)endTab->data);
+ if ((protoId > -1) && (protoId==proto_id.toInt())) {
+ selected_tab = endTab;
+ }
+ }
+
+ // Move the selected tab to the head
+ if (selected_tab != nullptr) {
+ recent.endpoint_tabs = g_list_remove_link(recent.endpoint_tabs, selected_tab);
+ recent.endpoint_tabs = g_list_prepend(recent.endpoint_tabs, selected_tab->data);
+ }
+ }
+ }
+
TrafficTableDialog::currentTabChanged();
}
diff --git a/ui/qt/expert_info_dialog.h b/ui/qt/expert_info_dialog.h
index 1494ffb4..38eb8f09 100644
--- a/ui/qt/expert_info_dialog.h
+++ b/ui/qt/expert_info_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "filter_action.h"
#include "wireshark_dialog.h"
#include <ui/qt/models/expert_info_model.h>
diff --git a/ui/qt/export_dissection_dialog.cpp b/ui/qt/export_dissection_dialog.cpp
index 5b09efcd..3a51bfd4 100644
--- a/ui/qt/export_dissection_dialog.cpp
+++ b/ui/qt/export_dissection_dialog.cpp
@@ -9,12 +9,6 @@
#include "export_dissection_dialog.h"
-#ifdef Q_OS_WIN
-#include <windows.h>
-#include "ui/packet_range.h"
-#include "ui/win32/file_dlg_win32.h"
-#else // Q_OS_WIN
-
#include "ui/alert_box.h"
#include "ui/help_url.h"
#include "ui/util.h"
@@ -28,12 +22,9 @@
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QPushButton>
-#endif // Q_OS_WIN
-#include <epan/prefs.h>
#include "main_application.h"
-#if !defined(Q_OS_WIN)
static const QStringList export_extensions = QStringList()
<< ""
<< "txt"
@@ -44,45 +35,16 @@ static const QStringList export_extensions = QStringList()
<< "c"
<< "json";
-#endif
-
ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *cap_file, export_type_e export_type, QString selRange):
WiresharkFileDialog(parent),
export_type_(export_type),
cap_file_(cap_file)
-#if !defined(Q_OS_WIN)
, save_bt_(NULL)
-#else
- , sel_range_(selRange)
-#endif /* Q_OS_WIN */
{
setWindowTitle(mainApp->windowTitleString(tr("Export Packet Dissections")));
- switch (prefs.gui_fileopen_style) {
-
- case FO_STYLE_LAST_OPENED:
- /* The user has specified that we should start out in the last directory
- * we looked in. If we've already opened a file, use its containing
- * directory, if we could determine it, as the directory, otherwise
- * use the "last opened" directory saved in the preferences file if
- * there was one.
- */
- setDirectory(mainApp->openDialogInitialDir());
- break;
-
- case FO_STYLE_SPECIFIED:
- /* The user has specified that we should always start out in a
- * specified directory; if they've specified that directory,
- * start out by showing the files in that dir.
- */
- if (prefs.gui_fileopen_dir[0] != '\0')
- setDirectory(prefs.gui_fileopen_dir);
- break;
- }
+ setDirectory(mainApp->openDialogInitialDir());
-#if !defined(Q_OS_WIN)
- // Add extra widgets
- // https://wiki.qt.io/Qt_project_org_faq#How_can_I_add_widgets_to_my_QFileDialog_instance.3F
setOption(QFileDialog::DontUseNativeDialog, true);
QDialogButtonBox *button_box = findChild<QDialogButtonBox *>();
QGridLayout *fd_grid = qobject_cast<QGridLayout*>(layout());
@@ -119,7 +81,7 @@ ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *ca
/* Init the export range */
packet_range_init(&print_args_.range, cap_file_);
/* Default to displayed packets */
- print_args_.range.process_filtered = TRUE;
+ print_args_.range.process_filtered = true;
packet_range_group_box_.initRange(&print_args_.range, selRange);
h_box->addWidget(&packet_range_group_box_);
@@ -128,47 +90,39 @@ ExportDissectionDialog::ExportDissectionDialog(QWidget *parent, capture_file *ca
if (button_box) {
button_box->addButton(QDialogButtonBox::Help);
- connect(button_box, SIGNAL(helpRequested()), this, SLOT(on_buttonBox_helpRequested()));
+ connect(button_box, &QDialogButtonBox::helpRequested, this, &ExportDissectionDialog::on_buttonBox_helpRequested);
save_bt_ = button_box->button(QDialogButtonBox::Save);
}
if (save_bt_) {
- connect(&packet_range_group_box_, SIGNAL(validityChanged(bool)),
- this, SLOT(checkValidity()));
- connect(&packet_format_group_box_, SIGNAL(formatChanged()),
- this, SLOT(checkValidity()));
+ connect(&packet_range_group_box_, &PacketRangeGroupBox::validityChanged,
+ this, &ExportDissectionDialog::checkValidity);
+ connect(&packet_format_group_box_, &PacketFormatGroupBox::formatChanged,
+ this, &ExportDissectionDialog::checkValidity);
+ save_bt_->installEventFilter(this);
}
- connect(this, SIGNAL(filterSelected(QString)), this, SLOT(exportTypeChanged(QString)));
+ connect(this, &ExportDissectionDialog::filterSelected, this, &ExportDissectionDialog::exportTypeChanged);
// Grow the dialog to account for the extra widgets.
resize(width(), height() + (packet_range_group_box_.height() * 2 / 3));
- connect(this, SIGNAL(filesSelected(QStringList)), this, SLOT(dialogAccepted(QStringList)));
-#else // Q_OS_WIN
-#endif // Q_OS_WIN
+ connect(this, &ExportDissectionDialog::filesSelected, this, &ExportDissectionDialog::dialogAccepted);
}
ExportDissectionDialog::~ExportDissectionDialog()
{
-#if !defined(Q_OS_WIN)
g_free(print_args_.file);
packet_range_cleanup(&print_args_.range);
-#endif
}
void ExportDissectionDialog::show()
{
-#if !defined(Q_OS_WIN)
if (cap_file_) {
WiresharkFileDialog::show();
}
-#else // Q_OS_WIN
- win32_export_file((HWND)parentWidget()->effectiveWinId(), windowTitle().toStdWString().c_str(), cap_file_, export_type_, sel_range_.toStdString().c_str());
-#endif // Q_OS_WIN
}
-#ifndef Q_OS_WIN
void ExportDissectionDialog::dialogAccepted(const QStringList &selected)
{
if (selected.length() > 0) {
@@ -179,19 +133,19 @@ void ExportDissectionDialog::dialogAccepted(const QStringList &selected)
*/
hide();
cf_print_status_t status;
- QString file_name = selected[0];
+ QString file_name = QDir::toNativeSeparators(selected[0]);
/* Fill in our print (and export) args */
print_args_.file = qstring_strdup(file_name);
print_args_.format = PR_FMT_TEXT;
- print_args_.to_file = TRUE;
+ print_args_.to_file = true;
print_args_.cmd = NULL;
- print_args_.print_summary = TRUE;
- print_args_.print_col_headings = TRUE;
+ print_args_.print_summary = true;
+ print_args_.print_col_headings = true;
print_args_.print_dissections = print_dissections_as_displayed;
- print_args_.print_hex = FALSE;
- print_args_.print_formfeed = FALSE;
+ print_args_.print_hex = false;
+ print_args_.print_formfeed = false;
switch (export_type_) {
case export_type_text: /* Text */
@@ -208,12 +162,12 @@ void ExportDissectionDialog::dialogAccepted(const QStringList &selected)
}
print_args_.print_hex = packet_format_group_box_.bytesEnabled();
print_args_.hexdump_options = packet_format_group_box_.getHexdumpOptions();
- print_args_.stream = print_stream_text_new(TRUE, print_args_.file);
+ print_args_.stream = print_stream_text_new(true, print_args_.file);
if (print_args_.stream == NULL) {
- open_failure_alert_box(print_args_.file, errno, TRUE);
+ open_failure_alert_box(print_args_.file, errno, true);
return;
}
- status = cf_print_packets(cap_file_, &print_args_, TRUE);
+ status = cf_print_packets(cap_file_, &print_args_, true);
break;
case export_type_csv: /* CSV */
status = cf_write_csv_packets(cap_file_, &print_args_);
@@ -238,14 +192,14 @@ void ExportDissectionDialog::dialogAccepted(const QStringList &selected)
case CF_PRINT_OK:
break;
case CF_PRINT_OPEN_ERROR:
- open_failure_alert_box(print_args_.file, errno, TRUE);
+ open_failure_alert_box(print_args_.file, errno, true);
break;
case CF_PRINT_WRITE_ERROR:
write_failure_alert_box(print_args_.file, errno);
break;
}
- gchar *dirname;
+ char *dirname;
/* Save the directory name for future file dialogs. */
dirname = get_dirname(print_args_.file); /* Overwrites file_name data */
set_last_open_dir(dirname);
@@ -266,28 +220,55 @@ void ExportDissectionDialog::exportTypeChanged(QString name_filter)
setDefaultSuffix(export_extensions[export_type_]);
}
-void ExportDissectionDialog::checkValidity()
+bool ExportDissectionDialog::isValid()
{
- bool enable = true;
-
- if (!save_bt_) return;
+ bool valid = true;
- if (!packet_range_group_box_.isValid()) enable = false;
+ if (!packet_range_group_box_.isValid()) valid = false;
if (export_type_ == export_type_text) {
if (! packet_format_group_box_.summaryEnabled() &&
! packet_format_group_box_.detailsEnabled() &&
! packet_format_group_box_.bytesEnabled())
{
- enable = false;
+ valid = false;
}
}
- save_bt_->setEnabled(enable);
+ return valid;
+}
+
+void ExportDissectionDialog::checkValidity()
+{
+ if (!save_bt_) return;
+
+ save_bt_->setEnabled(isValid());
}
void ExportDissectionDialog::on_buttonBox_helpRequested()
{
mainApp->helpTopicAction(HELP_EXPORT_FILE_DIALOG);
}
-#endif // Q_OS_WIN
+
+bool ExportDissectionDialog::eventFilter(QObject *obj, QEvent *event)
+{
+ // The QFileDialogPrivate will enable the Ok (Open/Save) button when
+ // anything is typed or selected. We can't catch that beforehand, so
+ // watch for the enable status change and re-disable it if the
+ // group boxes are invalid.
+ // We could do extra work (here and elsewhere) not to disable the button
+ // if what's selected in the dialog is a directory, but even with save_bt_
+ // disabled clicking on the directory still opens it.
+ if (event->type() == QEvent::EnabledChange) {
+ QPushButton *button = qobject_cast<QPushButton *>(obj);
+ if (button && button == save_bt_) {
+ // The button is already changed by the time we get this event.
+ if (button->isEnabled() && !isValid()) {
+ button->setEnabled(false);
+ return true;
+ }
+ }
+ }
+
+ return QObject::eventFilter(obj, event);
+}
diff --git a/ui/qt/export_dissection_dialog.h b/ui/qt/export_dissection_dialog.h
index 6d794918..47cb8ac8 100644
--- a/ui/qt/export_dissection_dialog.h
+++ b/ui/qt/export_dissection_dialog.h
@@ -12,18 +12,14 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include "epan/print.h"
#include "ui/file_dialog.h"
#include <ui/qt/widgets/wireshark_file_dialog.h>
-#ifndef Q_OS_WIN
#include "packet_range_group_box.h"
#include "packet_format_group_box.h"
-#endif // Q_OS_WIN
#include <QMap>
@@ -38,18 +34,18 @@ public:
public slots:
void show();
+protected:
+ bool eventFilter(QObject *obj, QEvent *event) override;
+
private slots:
-#ifndef Q_OS_WIN
void dialogAccepted(const QStringList &selected);
void exportTypeChanged(QString name_filter);
void checkValidity();
void on_buttonBox_helpRequested();
-#endif // Q_OS_WIN
private:
export_type_e export_type_;
capture_file *cap_file_;
-#ifndef Q_OS_WIN
print_args_t print_args_;
QMap<QString, export_type_e> export_type_map_;
@@ -58,9 +54,8 @@ private:
PacketFormatGroupBox packet_format_group_box_;
QPushButton *save_bt_;
-#else
- QString sel_range_;
-#endif // Q_OS_WIN
+
+ bool isValid();
};
#endif // EXPORT_DISSECTION_DIALOG_H
diff --git a/ui/qt/export_object_action.cpp b/ui/qt/export_object_action.cpp
index bccf84ff..84626647 100644
--- a/ui/qt/export_object_action.cpp
+++ b/ui/qt/export_object_action.cpp
@@ -9,7 +9,6 @@
#include <config.h>
-#include <glib.h>
#include <epan/packet_info.h>
#include <epan/proto_data.h>
#include <epan/packet.h>
diff --git a/ui/qt/export_object_action.h b/ui/qt/export_object_action.h
index e4cc4cc5..7e6f0656 100644
--- a/ui/qt/export_object_action.h
+++ b/ui/qt/export_object_action.h
@@ -12,7 +12,6 @@
#include "config.h"
-#include <glib.h>
#include <epan/packet_info.h>
#include <epan/export_object.h>
diff --git a/ui/qt/export_pdu_dialog.cpp b/ui/qt/export_pdu_dialog.cpp
index 09709e18..27b77842 100644
--- a/ui/qt/export_pdu_dialog.cpp
+++ b/ui/qt/export_pdu_dialog.cpp
@@ -19,6 +19,8 @@
#include "ui/export_pdu_ui_utils.h"
#include "ui/capture_globals.h"
+#include "main_application.h"
+
ExportPDUDialog::ExportPDUDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::ExportPDUDialog)
@@ -27,12 +29,15 @@ ExportPDUDialog::ExportPDUDialog(QWidget *parent) :
ui->setupUi(this);
+ setWindowTitle(mainApp->windowTitleString(tr("Export PDUs")));
+
for (tap_name_list = get_export_pdu_tap_list(); tap_name_list; tap_name_list = g_slist_next(tap_name_list)) {
if (export_pdu_tap_get_encap((const char*)tap_name_list->data) == WTAP_ENCAP_WIRESHARK_UPPER_PDU) {
ui->comboBox->addItem((const char*)(tap_name_list->data));
}
}
}
+
void ExportPDUDialog::on_buttonBox_accepted()
{
const QByteArray& filter = ui->displayFilterLineEdit->text().toUtf8();
@@ -40,6 +45,12 @@ void ExportPDUDialog::on_buttonBox_accepted()
do_export_pdu(filter.constData(), global_capture_opts.temp_dir, tap_name.constData());
}
+
+void ExportPDUDialog::on_buttonBox_helpRequested()
+{
+ mainApp->helpTopicAction(HELP_EXPORT_PDUS_DIALOG);
+}
+
ExportPDUDialog::~ExportPDUDialog()
{
delete ui;
diff --git a/ui/qt/export_pdu_dialog.h b/ui/qt/export_pdu_dialog.h
index e76399a9..48d76f71 100644
--- a/ui/qt/export_pdu_dialog.h
+++ b/ui/qt/export_pdu_dialog.h
@@ -30,6 +30,7 @@ private:
private slots:
void on_buttonBox_accepted();
+ void on_buttonBox_helpRequested();
};
#endif // EXPORT_PDU_DIALOG_H
diff --git a/ui/qt/export_pdu_dialog.ui b/ui/qt/export_pdu_dialog.ui
index 2a0fae81..6127ba8b 100644
--- a/ui/qt/export_pdu_dialog.ui
+++ b/ui/qt/export_pdu_dialog.ui
@@ -26,7 +26,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Help</set>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
@@ -75,32 +75,12 @@
<signal>accepted()</signal>
<receiver>ExportPDUDialog</receiver>
<slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ExportPDUDialog</receiver>
<slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
</connection>
</connections>
</ui>
diff --git a/ui/qt/extcap_argument.cpp b/ui/qt/extcap_argument.cpp
index 0a965a79..84cbf906 100644
--- a/ui/qt/extcap_argument.cpp
+++ b/ui/qt/extcap_argument.cpp
@@ -38,6 +38,7 @@
#include <epan/prefs-int.h>
#include <wsutil/wslog.h>
#include <ui/qt/utils/color_utils.h>
+#include <ui/qt/utils/qt_ui_utils.h>
#include <extcap_parser.h>
#include <extcap_argument_file.h>
@@ -105,7 +106,7 @@ QString ExtArgTimestamp::prefValue()
bool ExtArgTimestamp::isSetDefaultValueSupported()
{
- return TRUE;
+ return true;
}
void ExtArgTimestamp::setDefaultValue()
@@ -230,7 +231,7 @@ QString ExtArgSelector::value()
bool ExtArgSelector::isSetDefaultValueSupported()
{
- return TRUE;
+ return true;
}
void ExtArgSelector::setDefaultValue()
@@ -313,6 +314,11 @@ void ExtArgEditSelector::setDefaultValue()
ExtArgRadio::ExtArgRadio(extcap_arg * argument, QObject * parent) :
ExtcapArgument(argument, parent), selectorGroup(0), callStrings(0) {}
+ExtArgRadio::~ExtArgRadio() {
+ if (callStrings != nullptr)
+ delete callStrings;
+}
+
QWidget * ExtArgRadio::createEditor(QWidget * parent)
{
int count = 0;
@@ -394,7 +400,7 @@ bool ExtArgRadio::isValid()
bool ExtArgRadio::isSetDefaultValueSupported()
{
- return TRUE;
+ return true;
}
void ExtArgRadio::setDefaultValue()
@@ -497,7 +503,7 @@ bool ExtArgBool::defaultBool()
if (_argument)
{
- if (extcap_complex_get_bool(_argument->default_complex) == (gboolean)TRUE)
+ if (extcap_complex_get_bool(_argument->default_complex) == true)
result = true;
}
@@ -511,7 +517,7 @@ QString ExtArgBool::defaultValue()
bool ExtArgBool::isSetDefaultValueSupported()
{
- return TRUE;
+ return true;
}
void ExtArgBool::setDefaultValue()
@@ -618,7 +624,7 @@ bool ExtArgText::isValid()
bool ExtArgText::isSetDefaultValueSupported()
{
- return TRUE;
+ return true;
}
void ExtArgText::setDefaultValue()
@@ -654,14 +660,14 @@ QWidget * ExtArgNumber::createEditor(QWidget * parent)
val = extcap_complex_get_int(_argument->range_start);
else if (_argument->arg_type == EXTCAP_ARG_UNSIGNED)
{
- guint tmp = extcap_complex_get_uint(_argument->range_start);
- if (tmp > G_MAXINT)
+ unsigned tmp = extcap_complex_get_uint(_argument->range_start);
+ if (tmp > INT_MAX)
{
ws_log(LOG_DOMAIN_CAPTURE, LOG_LEVEL_DEBUG, "Defined value for range_start of %s exceeds valid integer range", _argument->call);
- val = G_MAXINT;
+ val = INT_MAX;
}
else
- val = (gint)tmp;
+ val = (int)tmp;
}
textValidator->setBottom(val);
@@ -679,14 +685,14 @@ QWidget * ExtArgNumber::createEditor(QWidget * parent)
val = extcap_complex_get_int(_argument->range_end);
else if (_argument->arg_type == EXTCAP_ARG_UNSIGNED)
{
- guint tmp = extcap_complex_get_uint(_argument->range_end);
- if (tmp > G_MAXINT)
+ unsigned tmp = extcap_complex_get_uint(_argument->range_end);
+ if (tmp > INT_MAX)
{
ws_log(LOG_DOMAIN_CAPTURE, LOG_LEVEL_DEBUG, "Defined value for range_end of %s exceeds valid integer range", _argument->call);
- val = G_MAXINT;
+ val = INT_MAX;
}
else
- val = (gint)tmp;
+ val = (int)tmp;
}
textValidator->setTop(val);
@@ -807,7 +813,7 @@ ExtcapValueList ExtcapArgument::loadValues(QString parent)
QString call = QString().fromUtf8(v->call);
ExtcapValue element = ExtcapValue(display, call,
- v->enabled == (gboolean)TRUE, v->is_default == (gboolean)TRUE);
+ v->enabled == true, v->is_default == true);
if (!call.isEmpty())
element.setChildren(this->loadValues(call));
@@ -839,6 +845,7 @@ bool ExtcapArgument::reloadValues()
}
ExtcapArgument::~ExtcapArgument() {
+ extcap_free_arg(_argument);
}
QWidget * ExtcapArgument::createLabel(QWidget * parent)
@@ -907,9 +914,9 @@ QString ExtcapArgument::defaultValue()
{
if (_argument != 0 && _argument->default_complex != 0)
{
- gchar * str = extcap_get_complex_as_string(_argument->default_complex);
- if (str != 0)
- return QString(str);
+ char * str = extcap_get_complex_as_string(_argument->default_complex);
+ if (str != nullptr)
+ return gchar_free_to_qstring(str);
}
return QString();
}
@@ -946,7 +953,7 @@ bool ExtcapArgument::isRequired()
if (_argument != NULL)
return _argument->is_required;
- return FALSE;
+ return false;
}
bool ExtcapArgument::reload()
@@ -962,7 +969,7 @@ bool ExtcapArgument::fileExists()
if (_argument != NULL)
return _argument->fileexists;
- return FALSE;
+ return false;
}
bool ExtcapArgument::isDefault()
@@ -1027,7 +1034,7 @@ void ExtcapArgument::onBoolChanged(bool)
bool ExtcapArgument::isSetDefaultValueSupported()
{
- return FALSE;
+ return false;
}
void ExtcapArgument::setDefaultValue()
diff --git a/ui/qt/extcap_argument.h b/ui/qt/extcap_argument.h
index 2efa4e42..d9e852d7 100644
--- a/ui/qt/extcap_argument.h
+++ b/ui/qt/extcap_argument.h
@@ -211,6 +211,7 @@ class ExtArgRadio : public ExtcapArgument
public:
ExtArgRadio(extcap_arg * argument, QObject *parent = Q_NULLPTR);
+ virtual ~ExtArgRadio();
virtual QWidget * createEditor(QWidget * parent);
virtual QString value();
diff --git a/ui/qt/extcap_argument_multiselect.cpp b/ui/qt/extcap_argument_multiselect.cpp
index 6f816b98..4eb2e4d5 100644
--- a/ui/qt/extcap_argument_multiselect.cpp
+++ b/ui/qt/extcap_argument_multiselect.cpp
@@ -212,7 +212,7 @@ QString ExtArgMultiSelect::defaultValue()
bool ExtArgMultiSelect::isSetDefaultValueSupported()
{
- return TRUE;
+ return true;
}
void ExtArgMultiSelect::setDefaultValue()
diff --git a/ui/qt/extcap_options_dialog.cpp b/ui/qt/extcap_options_dialog.cpp
index 52c360c0..014a949a 100644
--- a/ui/qt/extcap_options_dialog.cpp
+++ b/ui/qt/extcap_options_dialog.cpp
@@ -9,8 +9,6 @@
#include <config.h>
-#include <glib.h>
-
#include <extcap_options_dialog.h>
#include <ui_extcap_options_dialog.h>
@@ -59,8 +57,7 @@ ExtcapOptionsDialog::ExtcapOptionsDialog(bool startCaptureOnClose, QWidget *pare
ui(new Ui::ExtcapOptionsDialog),
device_name(""),
device_idx(0),
- defaultValueIcon_(StockIcon("x-reset")),
- start_capture_on_close_(startCaptureOnClose)
+ defaultValueIcon_(StockIcon("x-reset"))
{
ui->setupUi(this);
@@ -68,10 +65,11 @@ ExtcapOptionsDialog::ExtcapOptionsDialog(bool startCaptureOnClose, QWidget *pare
ui->checkSaveOnStart->setCheckState(prefs.extcap_save_on_start ? Qt::Checked : Qt::Unchecked);
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start"));
if (startCaptureOnClose) {
- ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Start"));
- } else {
- ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Save"));
+ // This dialog was spawned because the user wanted to start a capture
+ // immediately but a mandatory parameter was not configured.
+ ui->buttonBox->button(QDialogButtonBox::Save)->hide();
}
}
@@ -80,7 +78,7 @@ ExtcapOptionsDialog * ExtcapOptionsDialog::createForDevice(QString &dev_name, bo
interface_t *device;
ExtcapOptionsDialog * resultDialog = NULL;
bool dev_found = false;
- guint if_idx;
+ unsigned if_idx;
if (dev_name.length() == 0)
return NULL;
@@ -118,26 +116,6 @@ ExtcapOptionsDialog::~ExtcapOptionsDialog()
delete ui;
}
-void ExtcapOptionsDialog::on_buttonBox_accepted()
-{
- if (saveOptionToCaptureInfo()) {
- /* Starting a new capture with those values */
- prefs.extcap_save_on_start = ui->checkSaveOnStart->checkState() == Qt::Checked;
-
- /* If the button says "Save" instead of "Start", unconditionally
- * save. XXX - Why not have both buttons? (#19199)
- *
- * XXX - If extcap_save_on_start is the only preference that has
- * changed, or if it changed from true to false, we should write
- * out a new preference file with its new value, but don't.
- */
- if (prefs.extcap_save_on_start || !start_capture_on_close_)
- storeValues();
-
- accept();
- }
-}
-
void ExtcapOptionsDialog::anyValueChanged()
{
bool allowStart = true;
@@ -241,7 +219,7 @@ void ExtcapOptionsDialog::loadArguments()
extcapArguments << optional;
/* argument items are now owned by ExtcapArgument. Only free the lists */
- extcap_free_if_configuration(arguments, FALSE);
+ extcap_free_if_configuration(arguments, false);
}
void ExtcapOptionsDialog::updateWidgets()
@@ -403,12 +381,6 @@ void ExtcapOptionsDialog::updateWidgets()
}
}
-// Not sure why we have to do this manually.
-void ExtcapOptionsDialog::on_buttonBox_rejected()
-{
- reject();
-}
-
void ExtcapOptionsDialog::on_buttonBox_helpRequested()
{
interface_t *device;
@@ -474,8 +446,8 @@ bool ExtcapOptionsDialog::saveOptionToCaptureInfo()
continue;
}
- gchar * call_string = qstring_strdup(call);
- gchar * value_string = NULL;
+ char * call_string = qstring_strdup(call);
+ char * value_string = NULL;
if (value.length() > 0)
value_string = qstring_strdup(value);
@@ -491,8 +463,41 @@ bool ExtcapOptionsDialog::saveOptionToCaptureInfo()
void ExtcapOptionsDialog::on_buttonBox_clicked(QAbstractButton *button)
{
/* Only the save button has the ActionRole */
- if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::ResetRole)
+ switch (ui->buttonBox->buttonRole(button)) {
+ case QDialogButtonBox::ResetRole:
resetValues();
+ break;
+ case QDialogButtonBox::RejectRole:
+ case QDialogButtonBox::DestructiveRole:
+ /* entries are only saved if saveOptionToCaptureInfo() is called,
+ * so do nothing. */
+ reject();
+ break;
+ case QDialogButtonBox::AcceptRole:
+ if (saveOptionToCaptureInfo()) {
+ /* Starting a new capture with those values */
+ prefs.extcap_save_on_start = ui->checkSaveOnStart->checkState() == Qt::Checked;
+
+ /* XXX - If extcap_save_on_start is the only preference that has
+ * changed, or if it changed from true to false, we should write
+ * out a new preference file with its new value, but don't.
+ */
+ if (ui->buttonBox->standardButton(button) == QDialogButtonBox::Save) {
+ storeValues();
+ /* Reject the dialog, because we don't want to start a capture. */
+ reject();
+ } else {
+ /* Start */
+ if (prefs.extcap_save_on_start) {
+ storeValues();
+ }
+ accept();
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
void ExtcapOptionsDialog::resetValues()
@@ -549,14 +554,14 @@ void ExtcapOptionsDialog::resetValues()
}
- /* Values are stored when dialog is commited, just check validity*/
+ /* Values are stored when dialog is committed, just check validity */
anyValueChanged();
}
}
GHashTable *ExtcapOptionsDialog::getArgumentSettings(bool useCallsAsKey, bool includeEmptyValues)
{
- GHashTable * entries = g_hash_table_new(g_str_hash, g_str_equal);
+ GHashTable * entries = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
ExtcapArgumentList::const_iterator iter;
QString value;
@@ -615,7 +620,7 @@ GHashTable *ExtcapOptionsDialog::getArgumentSettings(bool useCallsAsKey, bool in
if ((key.length() > 0) && (includeEmptyValues || isBoolflag || value.length() > 0) )
{
- gchar * val = qstring_strdup(value);
+ char * val = qstring_strdup(value);
g_hash_table_insert(entries, qstring_strdup(key), val);
}
@@ -634,6 +639,8 @@ void ExtcapOptionsDialog::storeValues()
mainApp->emitAppSignal(MainApplication::PreferencesChanged);
}
+
+ g_hash_table_unref(entries);
}
ExtcapValueList ExtcapOptionsDialog::loadValuesFor(int argNum, QString argumentName, QString parent)
@@ -673,7 +680,7 @@ ExtcapValueList ExtcapOptionsDialog::loadValuesFor(int argNum, QString argumentN
QString call = QString().fromUtf8(v->call);
ExtcapValue element = ExtcapValue(display, call,
- v->enabled == (gboolean)TRUE, v->is_default == (gboolean)TRUE);
+ v->enabled == true, v->is_default == true);
#if 0
/* TODO: Disabled due to wrong parent handling. It leads to an infinite loop for now. To implement this properly, other things
diff --git a/ui/qt/extcap_options_dialog.h b/ui/qt/extcap_options_dialog.h
index bb1d8e89..ddf82165 100644
--- a/ui/qt/extcap_options_dialog.h
+++ b/ui/qt/extcap_options_dialog.h
@@ -40,8 +40,6 @@ public:
ExtcapValueList loadValuesFor(int argNum, QString call, QString parent = "");
private Q_SLOTS:
- void on_buttonBox_accepted();
- void on_buttonBox_rejected();
void on_buttonBox_clicked(QAbstractButton *button);
void on_buttonBox_helpRequested();
void updateWidgets();
@@ -52,9 +50,8 @@ private:
Ui::ExtcapOptionsDialog *ui;
QString device_name;
- guint device_idx;
+ unsigned device_idx;
QIcon defaultValueIcon_;
- bool start_capture_on_close_;
ExtcapArgumentList extcapArguments;
diff --git a/ui/qt/extcap_options_dialog.ui b/ui/qt/extcap_options_dialog.ui
index 337a0c9d..1c6f0d7b 100644
--- a/ui/qt/extcap_options_dialog.ui
+++ b/ui/qt/extcap_options_dialog.ui
@@ -40,7 +40,7 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
- <set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
+ <set>QDialogButtonBox::Discard|QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::Save|QDialogButtonBox::RestoreDefaults</set>
</property>
</widget>
</item>
diff --git a/ui/qt/file_set_dialog.cpp b/ui/qt/file_set_dialog.cpp
index 70f38914..0cb2d232 100644
--- a/ui/qt/file_set_dialog.cpp
+++ b/ui/qt/file_set_dialog.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include "file.h"
#include "fileset.h"
diff --git a/ui/qt/file_set_dialog.h b/ui/qt/file_set_dialog.h
index d4158898..defdeda6 100644
--- a/ui/qt/file_set_dialog.h
+++ b/ui/qt/file_set_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include "fileset.h"
diff --git a/ui/qt/filter_action.cpp b/ui/qt/filter_action.cpp
index f8b7732f..3a54cf67 100644
--- a/ui/qt/filter_action.cpp
+++ b/ui/qt/filter_action.cpp
@@ -66,25 +66,18 @@ const QString FilterAction::actionName(Action action) {
switch (action) {
case ActionApply:
return QObject::tr("Apply as Filter");
- break;
case ActionPrepare:
return QObject::tr("Prepare as Filter");
- break;
case ActionFind:
return QObject::tr("Find");
- break;
case ActionColorize:
return QObject::tr("Colorize");
- break;
case ActionWebLookup:
return QObject::tr("Look Up");
- break;
case ActionCopy:
return QObject::tr("Copy");
- break;
default:
return QObject::tr("UNKNOWN");
- break;
}
}
@@ -118,25 +111,18 @@ const QString FilterAction::actionTypeName(ActionType type) {
switch (type) {
case ActionTypePlain:
return QObject::tr("Selected");
- break;
case ActionTypeNot:
return QObject::tr("Not Selected");
- break;
case ActionTypeAnd:
return QObject::tr("…and Selected");
- break;
case ActionTypeOr:
return QObject::tr("…or Selected");
- break;
case ActionTypeAndNot:
return QObject::tr("…and not Selected");
- break;
case ActionTypeOrNot:
return QObject::tr("…or not Selected");
- break;
default:
return QObject::tr("UNKNOWN");
- break;
}
}
@@ -160,34 +146,24 @@ const QString FilterAction::actionDirectionName(ActionDirection direction) {
switch (direction) {
case ActionDirectionAToFromB:
return QObject::tr("A " UTF8_LEFT_RIGHT_ARROW " B");
- break;
case ActionDirectionAToB:
return QObject::tr("A " UTF8_RIGHTWARDS_ARROW " B");
- break;
case ActionDirectionAFromB:
return QObject::tr("B " UTF8_RIGHTWARDS_ARROW " A");
- break;
case ActionDirectionAToFromAny:
return QObject::tr("A " UTF8_LEFT_RIGHT_ARROW " Any");
- break;
case ActionDirectionAToAny:
return QObject::tr("A " UTF8_RIGHTWARDS_ARROW " Any");
- break;
case ActionDirectionAFromAny:
return QObject::tr("Any " UTF8_RIGHTWARDS_ARROW " A");
- break;
case ActionDirectionAnyToFromB:
return QObject::tr("Any " UTF8_LEFT_RIGHT_ARROW " B");
- break;
case ActionDirectionAnyToB:
return QObject::tr("Any " UTF8_RIGHTWARDS_ARROW " B");
- break;
case ActionDirectionAnyFromB:
return QObject::tr("B " UTF8_RIGHTWARDS_ARROW " Any");
- break;
default:
return QObject::tr("UNKNOWN");
- break;
}
}
diff --git a/ui/qt/filter_dialog.cpp b/ui/qt/filter_dialog.cpp
index 1ed86b87..e1617611 100644
--- a/ui/qt/filter_dialog.cpp
+++ b/ui/qt/filter_dialog.cpp
@@ -9,8 +9,6 @@
#include <config.h>
-#include <glib.h>
-
#include <wsutil/filter_files.h>
#include <wsutil/filesystem.h>
@@ -59,18 +57,29 @@ FilterDialog::FilterDialog(QWidget *parent, FilterType filter_type, QString new_
ui->filterTreeView->setAcceptDrops(true);
ui->filterTreeView->setDropIndicatorShown(true);
- const gchar * filename = NULL;
+ const char * filename = NULL;
QString newFilterText;
- if (filter_type == CaptureFilter) {
- setWindowTitle(mainApp->windowTitleString(tr("Capture Filters")));
- filename = CFILTER_FILE_NAME;
- newFilterText = tr("New capture filter");
- model_ = new FilterListModel(FilterListModel::Capture, this);
- } else {
- setWindowTitle(mainApp->windowTitleString(tr("Display Filters")));
- filename = DFILTER_FILE_NAME;
- newFilterText = tr("New display filter");
- model_ = new FilterListModel(FilterListModel::Display, this);
+ switch (filter_type) {
+ case CaptureFilter:
+ setWindowTitle(mainApp->windowTitleString(tr("Capture Filters")));
+ filename = CFILTER_FILE_NAME;
+ newFilterText = tr("New capture filter");
+ model_ = new FilterListModel(FilterListModel::Capture, this);
+ break;
+ case DisplayFilter:
+ setWindowTitle(mainApp->windowTitleString(tr("Display Filters")));
+ filename = DFILTER_FILE_NAME;
+ newFilterText = tr("New display filter");
+ model_ = new FilterListModel(FilterListModel::Display, this);
+ break;
+ case DisplayMacro:
+ setWindowTitle(mainApp->windowTitleString(tr("Display Filter Macros")));
+ filename = DMACROS_FILE_NAME;
+ newFilterText = tr("New macro");
+ model_ = new FilterListModel(FilterListModel::DisplayMacro, this);
+ break;
+ default:
+ ws_assert_not_reached();
}
if (new_filter_.length() > 0)
@@ -84,7 +93,7 @@ FilterDialog::FilterDialog(QWidget *parent, FilterType filter_type, QString new_
connect(ui->filterTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &FilterDialog::selectionChanged);
- QString abs_path = gchar_free_to_qstring(get_persconffile_path(filename, TRUE));
+ QString abs_path = gchar_free_to_qstring(get_persconffile_path(filename, true));
if (file_exists(abs_path.toUtf8().constData())) {
ui->pathLabel->setText(abs_path);
ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
@@ -129,14 +138,24 @@ void FilterDialog::on_newToolButton_clicked()
QString name;
QString filter;
- if (filter_type_ == CaptureFilter) {
- //: This text is automatically filled in when a new filter is created
- name = tr("New capture filter");
- filter = "ip host host.example.com";
- } else {
- //: This text is automatically filled in when a new filter is created
- name = tr("New display filter");
- filter = "ip.host == host.example.com";
+ switch (filter_type_) {
+ case CaptureFilter:
+ //: This text is automatically filled in when a new filter is created
+ name = tr("New capture filter");
+ filter = "ip host host.example.com";
+ break;
+ case DisplayFilter:
+ //: This text is automatically filled in when a new filter is created
+ name = tr("New display filter");
+ filter = "ip.host == host.example.com";
+ break;
+ case DisplayMacro:
+ //: This text is automatically filled in when a new filter is created
+ name = "eq_example_com";
+ filter = "$1 == host.example.com";
+ break;
+ default:
+ ws_assert_not_reached();
}
addFilter(name, filter, true);
@@ -172,19 +191,43 @@ void FilterDialog::on_buttonBox_accepted()
{
model_->saveList();
- if (filter_type_ == CaptureFilter) {
- mainApp->emitAppSignal(MainApplication::CaptureFilterListChanged);
- } else {
- mainApp->emitAppSignal(MainApplication::DisplayFilterListChanged);
+ switch (filter_type_) {
+ case CaptureFilter:
+ mainApp->emitAppSignal(MainApplication::CaptureFilterListChanged);
+ break;
+ case DisplayFilter:
+ mainApp->emitAppSignal(MainApplication::DisplayFilterListChanged);
+ break;
+ case DisplayMacro:
+ mainApp->reloadDisplayFilterMacros();
+ // The function above emits MainApplication::FieldsChanged, which
+ // takes care of invalidating the current display filter text if
+ // it no longer compiles.
+ // XXX - What if the current display filter means something
+ // different now? Should we force a refilter (not redissection,
+ // the dissection shouldn't have changed) with the current display
+ // filter, or wait for the user to refilter?
+ // The UAT based display macro system did not refilter.
+ break;
+ default:
+ ws_assert_not_reached();
}
}
void FilterDialog::on_buttonBox_helpRequested()
{
- if (filter_type_ == CaptureFilter) {
- mainApp->helpTopicAction(HELP_CAPTURE_FILTERS_DIALOG);
- } else {
- mainApp->helpTopicAction(HELP_DISPLAY_FILTERS_DIALOG);
+ switch (filter_type_) {
+ case CaptureFilter:
+ mainApp->helpTopicAction(HELP_CAPTURE_FILTERS_DIALOG);
+ break;
+ case DisplayFilter:
+ mainApp->helpTopicAction(HELP_DISPLAY_FILTERS_DIALOG);
+ break;
+ case DisplayMacro:
+ mainApp->helpTopicAction(HELP_DISPLAY_MACRO_DIALOG);
+ break;
+ default:
+ ws_assert_not_reached();
}
}
@@ -204,17 +247,26 @@ QWidget *FilterTreeDelegate::createEditor(QWidget *parent, const QStyleOptionVie
if (index.column() != FilterListModel::ColumnExpression) {
w = QStyledItemDelegate::createEditor(parent, option, index);
}
- else
- {
- if (filter_type_ == FilterDialog::CaptureFilter) {
- w = new CaptureFilterEdit(parent, true);
- } else {
- w = new DisplayFilterEdit(parent, DisplayFilterToEnter);
- }
+ else if (filter_type_ == FilterDialog::CaptureFilter) {
+ w = new CaptureFilterEdit(parent, true);
+ }
+ else if (filter_type_ == FilterDialog::DisplayFilter) {
+ w = new DisplayFilterEdit(parent, DisplayFilterToEnter);
+ }
+ else {
+ w = QStyledItemDelegate::createEditor(parent, option, index);
}
- if (qobject_cast<QLineEdit *>(w) && index.column() == FilterListModel::ColumnName)
- qobject_cast<QLineEdit *>(w)->setValidator(new FilterValidator());
+ if (qobject_cast<QLineEdit *>(w)) {
+ if (index.column() == FilterListModel::ColumnName) {
+ if (filter_type_ == FilterDialog::DisplayMacro) {
+ qobject_cast<QLineEdit *>(w)->setValidator(new MacroNameValidator());
+ }
+ else {
+ qobject_cast<QLineEdit *>(w)->setValidator(new FilterValidator());
+ }
+ }
+ }
return w;
}
@@ -244,3 +296,17 @@ QValidator::State FilterValidator::validate(QString & input, int & /*pos*/) cons
return QValidator::Acceptable;
}
+
+QValidator::State MacroNameValidator::validate(QString &input, int & /*pos*/) const
+{
+ if (input.length() <= 0)
+ return QValidator::Intermediate;
+
+ for (QChar ch: input) {
+ if (!ch.isLetterOrNumber() && ch != '_') {
+ return QValidator::Invalid;
+ }
+ }
+
+ return QValidator::Acceptable;
+}
diff --git a/ui/qt/filter_dialog.h b/ui/qt/filter_dialog.h
index 34b3a156..90d2f1b2 100644
--- a/ui/qt/filter_dialog.h
+++ b/ui/qt/filter_dialog.h
@@ -29,7 +29,7 @@ class FilterDialog : public GeometryStateDialog
Q_OBJECT
public:
- enum FilterType { CaptureFilter, DisplayFilter };
+ enum FilterType { CaptureFilter, DisplayFilter, DisplayMacro };
explicit FilterDialog(QWidget *parent = 0, FilterType filter_type = CaptureFilter, const QString new_filter = QString());
~FilterDialog();
@@ -81,4 +81,10 @@ public:
virtual QValidator::State validate(QString & input, int & pos) const override;
};
+class MacroNameValidator : public QValidator
+{
+public:
+ virtual QValidator::State validate(QString & input, int & pos) const override;
+};
+
#endif // FILTER_DIALOG_H
diff --git a/ui/qt/filter_expression_frame.cpp b/ui/qt/filter_expression_frame.cpp
index 38975977..dd40b3fa 100644
--- a/ui/qt/filter_expression_frame.cpp
+++ b/ui/qt/filter_expression_frame.cpp
@@ -144,7 +144,7 @@ void FilterExpressionFrame::on_buttonBox_accepted()
}
else
{
- filter_expression_new(label_ba.constData(), expr_ba.constData(), comment_ba.constData(), TRUE);
+ filter_expression_new(label_ba.constData(), expr_ba.constData(), comment_ba.constData(), true);
}
save_migrated_uat("Display expressions", &prefs.filter_expressions_old);
diff --git a/ui/qt/firewall_rules_dialog.cpp b/ui/qt/firewall_rules_dialog.cpp
index a74355e1..e36e4235 100644
--- a/ui/qt/firewall_rules_dialog.cpp
+++ b/ui/qt/firewall_rules_dialog.cpp
@@ -127,15 +127,15 @@ void FirewallRulesDialog::updateWidgets()
}
#define ADDR_BUF_LEN 200
-void FirewallRulesDialog::addRule(QString description, syntax_func rule_func, address *addr, guint32 port)
+void FirewallRulesDialog::addRule(QString description, syntax_func rule_func, address *addr, uint32_t port)
{
if (!rule_func) return;
char addr_buf[ADDR_BUF_LEN];
QString comment_pfx = firewall_product_comment_prefix(prod_);
GString *rule_str = g_string_new("");
- gboolean inbound = ui->inboundCheckBox->isChecked();
- gboolean deny = ui->denyCheckBox->isChecked();
+ bool inbound = ui->inboundCheckBox->isChecked();
+ bool deny = ui->denyCheckBox->isChecked();
address_to_str_buf(addr, addr_buf, ADDR_BUF_LEN);
rule_func(rule_str, addr_buf, port, ptype_, inbound, deny);
diff --git a/ui/qt/firewall_rules_dialog.h b/ui/qt/firewall_rules_dialog.h
index e14456f4..9d298048 100644
--- a/ui/qt/firewall_rules_dialog.h
+++ b/ui/qt/firewall_rules_dialog.h
@@ -20,7 +20,7 @@ class FirewallRulesDialog;
class QAbstractButton;
-typedef void (*syntax_func)(GString *rtxt, gchar *addr, guint32 port, port_type ptype, gboolean inbound, gboolean deny);
+typedef void (*syntax_func)(GString *rtxt, char *addr, uint32_t port, port_type ptype, bool inbound, bool deny);
class FirewallRulesDialog : public WiresharkDialog
{
@@ -50,11 +50,11 @@ private:
address net_src_;
address net_dst_;
port_type ptype_;
- guint32 src_port_;
- guint32 dst_port_;
+ uint32_t src_port_;
+ uint32_t dst_port_;
void updateWidgets();
- void addRule(QString description, syntax_func rule_func, address *addr, guint32 port);
+ void addRule(QString description, syntax_func rule_func, address *addr, uint32_t port);
};
#endif // FIREWALL_RULES_DIALOG_H
diff --git a/ui/qt/follow_stream_action.cpp b/ui/qt/follow_stream_action.cpp
index c9a946a1..0be2d561 100644
--- a/ui/qt/follow_stream_action.cpp
+++ b/ui/qt/follow_stream_action.cpp
@@ -9,7 +9,6 @@
#include <config.h>
-#include <glib.h>
#include <epan/packet_info.h>
#include <epan/proto_data.h>
#include <epan/packet.h>
diff --git a/ui/qt/follow_stream_action.h b/ui/qt/follow_stream_action.h
index 8c7c58e3..5357bae4 100644
--- a/ui/qt/follow_stream_action.h
+++ b/ui/qt/follow_stream_action.h
@@ -12,7 +12,6 @@
#include "config.h"
-#include <glib.h>
#include <epan/packet_info.h>
#include <epan/follow.h>
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index dbae1604..532d37f5 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -29,6 +29,7 @@
#include "wsutil/file_util.h"
#include "wsutil/str_util.h"
+#include "wsutil/filesystem.h"
#include "ws_symbol_export.h"
@@ -53,8 +54,6 @@
// - Instead of calling QMessageBox, display the error message in the text
// box and disable the appropriate controls.
// - Add a progress bar and connect captureCaptureUpdateContinue to it
-// - User's Guide documents the "Raw" type as "same as ASCII, but saving binary
-// data". However it currently displays hex-encoded data.
// Matches SplashOverlay.
static int info_update_freq_ = 100;
@@ -63,7 +62,7 @@ static int info_update_freq_ = 100;
static QMutex loop_break_mutex;
// Indicates that a Follow Stream is currently running
-static gboolean isReadRunning;
+static bool isReadRunning;
Q_DECLARE_METATYPE(bytes_show_type)
@@ -72,7 +71,6 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, int pro
ui(new Ui::FollowStreamDialog),
b_find_(NULL),
follower_(NULL),
- truncated_(false),
client_buffer_count_(0),
server_buffer_count_(0),
client_packet_count_(0),
@@ -101,6 +99,8 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, int pro
follow_info_.show_stream = BOTH_HOSTS;
follow_info_.substream_id = SUBSTREAM_UNUSED;
+ nstime_set_zero(&last_ts_);
+
ui->teStreamContent->installEventFilter(this);
connect(ui->leFind, SIGNAL(useRegexFind(bool)), this, SLOT(useRegexFind(bool)));
@@ -118,27 +118,46 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, int pro
cbcs->setCurrentIndex(cbcs->findData(recent.gui_follow_show));
cbcs->blockSignals(false);
+ ui->deltaComboBox->setCurrentIndex(recent.gui_follow_delta);
+
b_filter_out_ = ui->buttonBox->addButton(tr("Filter Out This Stream"), QDialogButtonBox::ActionRole);
- connect(b_filter_out_, SIGNAL(clicked()), this, SLOT(filterOut()));
+ connect(b_filter_out_, &QPushButton::clicked, this, &FollowStreamDialog::filterOut);
b_print_ = ui->buttonBox->addButton(tr("Print"), QDialogButtonBox::ActionRole);
- connect(b_print_, SIGNAL(clicked()), this, SLOT(printStream()));
+ connect(b_print_, &QPushButton::clicked, this, &FollowStreamDialog::printStream);
b_save_ = ui->buttonBox->addButton(tr("Save as…"), QDialogButtonBox::ActionRole);
- connect(b_save_, SIGNAL(clicked()), this, SLOT(saveAs()));
+ connect(b_save_, &QPushButton::clicked, this, &FollowStreamDialog::saveAs);
b_back_ = ui->buttonBox->addButton(tr("Back"), QDialogButtonBox::ActionRole);
- connect(b_back_, SIGNAL(clicked()), this, SLOT(backButton()));
+ connect(b_back_, &QPushButton::clicked, this, &FollowStreamDialog::backButton);
ProgressFrame::addToButtonBox(ui->buttonBox, &parent);
- connect(ui->buttonBox, SIGNAL(helpRequested()), this, SLOT(helpButton()));
- connect(ui->teStreamContent, SIGNAL(mouseMovedToTextCursorPosition(int)),
- this, SLOT(fillHintLabel(int)));
- connect(ui->teStreamContent, SIGNAL(mouseClickedOnTextCursorPosition(int)),
- this, SLOT(goToPacketForTextPos(int)));
+ connect(ui->cbDirections, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &FollowStreamDialog::cbDirectionsCurrentIndexChanged);
+ connect(ui->cbCharset, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &FollowStreamDialog::cbCharsetCurrentIndexChanged);
+ connect(ui->deltaComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &FollowStreamDialog::deltaComboBoxCurrentIndexChanged);
+
+ connect(ui->streamNumberSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
+ this, &FollowStreamDialog::streamNumberSpinBoxValueChanged);
+ connect(ui->subStreamNumberSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
+ this, &FollowStreamDialog::subStreamNumberSpinBoxValueChanged);
+
+ connect(ui->buttonBox, &QDialogButtonBox::helpRequested, this, &FollowStreamDialog::helpButton);
+ connect(ui->teStreamContent, &FollowStreamText::mouseMovedToPacket,
+ this, &FollowStreamDialog::fillHintLabel);
+ connect(ui->teStreamContent, &FollowStreamText::mouseClickedOnPacket,
+ this, &FollowStreamDialog::goToPacketForTextPos);
+
+ connect(ui->bFind, &QPushButton::clicked, this, &FollowStreamDialog::bFindClicked);
+ connect(ui->leFind, &FindLineEdit::returnPressed, this, &FollowStreamDialog::leFindReturnPressed);
+
+ connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &FollowStreamDialog::buttonBoxRejected);
- fillHintLabel(-1);
+ fillHintLabel();
}
FollowStreamDialog::~FollowStreamDialog()
@@ -169,29 +188,37 @@ void FollowStreamDialog::printStream()
#endif
}
-void FollowStreamDialog::fillHintLabel(int text_pos)
+void FollowStreamDialog::fillHintLabel(int pkt)
{
QString hint;
- int pkt = -1;
- if (text_pos >= 0) {
- QMap<int, guint32>::iterator it = text_pos_to_packet_.upperBound(text_pos);
- if (it != text_pos_to_packet_.end()) {
- pkt = it.value();
+ bool is_logray = strcmp(get_configuration_namespace(), "Logray") == 0;
+
+ if (is_logray) {
+ if (pkt > 0) {
+ hint = QString(tr("Event %1. ")).arg(pkt);
}
- }
- if (pkt > 0) {
- hint = QString(tr("Packet %1. ")).arg(pkt);
- }
+ hint += tr("%Ln <span style=\"color: %1; background-color:%2\">reads</span>, ", "", client_packet_count_)
+ .arg(ColorUtils::fromColorT(prefs.st_client_fg).name(),
+ ColorUtils::fromColorT(prefs.st_client_bg).name())
+ + tr("%Ln <span style=\"color: %1; background-color:%2\">writes</span>, ", "", server_packet_count_)
+ .arg(ColorUtils::fromColorT(prefs.st_server_fg).name(),
+ ColorUtils::fromColorT(prefs.st_server_bg).name())
+ + tr("%Ln turn(s).", "", turns_);
+ } else {
+ if (pkt > 0) {
+ hint = QString(tr("Packet %1. ")).arg(pkt);
+ }
- hint += tr("%Ln <span style=\"color: %1; background-color:%2\">client</span> pkt(s), ", "", client_packet_count_)
- .arg(ColorUtils::fromColorT(prefs.st_client_fg).name())
- .arg(ColorUtils::fromColorT(prefs.st_client_bg).name())
- + tr("%Ln <span style=\"color: %1; background-color:%2\">server</span> pkt(s), ", "", server_packet_count_)
- .arg(ColorUtils::fromColorT(prefs.st_server_fg).name())
- .arg(ColorUtils::fromColorT(prefs.st_server_bg).name())
- + tr("%Ln turn(s).", "", turns_);
+ hint += tr("%Ln <span style=\"color: %1; background-color:%2\">client</span> pkt(s), ", "", client_packet_count_)
+ .arg(ColorUtils::fromColorT(prefs.st_client_fg).name(),
+ ColorUtils::fromColorT(prefs.st_client_bg).name())
+ + tr("%Ln <span style=\"color: %1; background-color:%2\">server</span> pkt(s), ", "", server_packet_count_)
+ .arg(ColorUtils::fromColorT(prefs.st_server_fg).name(),
+ ColorUtils::fromColorT(prefs.st_server_bg).name())
+ + tr("%Ln turn(s).", "", turns_);
+ }
if (pkt > 0) {
hint.append(QString(tr(" Click to select.")));
@@ -202,20 +229,12 @@ void FollowStreamDialog::fillHintLabel(int text_pos)
ui->hintLabel->setText(hint);
}
-void FollowStreamDialog::goToPacketForTextPos(int text_pos)
+void FollowStreamDialog::goToPacketForTextPos(int pkt)
{
- int pkt = -1;
if (file_closed_) {
return;
}
- if (text_pos >= 0) {
- QMap<int, guint32>::iterator it = text_pos_to_packet_.upperBound(text_pos);
- if (it != text_pos_to_packet_.end()) {
- pkt = it.value();
- }
- }
-
if (pkt > 0) {
emit goToPacket(pkt);
}
@@ -255,20 +274,40 @@ void FollowStreamDialog::useRegexFind(bool use_regex)
ui->lFind->setText(tr("Find:"));
}
+// This only calls itself with go_back false, so never recurses more than once.
+// NOLINTNEXTLINE(misc-no-recursion)
void FollowStreamDialog::findText(bool go_back)
{
if (ui->leFind->text().isEmpty()) return;
bool found;
+
+ QTextDocument::FindFlags options;
+ if (ui->caseCheckBox->isChecked()) {
+ options |= QTextDocument::FindCaseSensitively;
+ }
if (use_regex_find_) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
+ // https://bugreports.qt.io/browse/QTBUG-88721
+ // QPlainTextEdit::find() searches case-insensitively unless
+ // QTextDocument::FindCaseSensitively is explicitly given.
+ // This *does* apply to QRegularExpression (overriding
+ // CaseInsensitiveOption), but not QRegExp.
+ //
+ // QRegularExpression and QRegExp do not support Perl's /i, but
+ // the former at least does support the mode modifiers (?i) and
+ // (?-i), which can override QTextDocument::FindCaseSensitively.
+ //
+ // To make matters worse, while the QTextDocument::find() documentation
+ // is correct, QPlainTextEdit::find() claims that QRegularExpression
+ // works like QRegExp, which is incorrect.
QRegularExpression regex(ui->leFind->text(), QRegularExpression::UseUnicodePropertiesOption);
#else
- QRegExp regex(ui->leFind->text());
+ QRegExp regex(ui->leFind->text(), (options & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);
#endif
- found = ui->teStreamContent->find(regex);
+ found = ui->teStreamContent->find(regex, options);
} else {
- found = ui->teStreamContent->find(ui->leFind->text());
+ found = ui->teStreamContent->find(ui->leFind->text(), options);
}
if (found) {
@@ -288,15 +327,17 @@ void FollowStreamDialog::saveAs()
QFile file(file_name);
if (!file.open(QIODevice::WriteOnly)) {
- open_failure_alert_box(file_name.toUtf8().constData(), errno, TRUE);
+ open_failure_alert_box(file_name.toUtf8().constData(), errno, true);
return;
}
+ // XXX: What if truncated_ is true? We should save the entire stream.
// Unconditionally save data as UTF-8 (even if data is decoded otherwise).
QByteArray bytes = ui->teStreamContent->toPlainText().toUtf8();
if (recent.gui_follow_show == SHOW_RAW) {
// The "Raw" format is currently displayed as hex data and needs to be
- // converted to binary data.
+ // converted to binary data. fromHex() skips over non hex characters
+ // including line breaks, which is what we want.
bytes = QByteArray::fromHex(bytes);
}
@@ -337,12 +378,12 @@ void FollowStreamDialog::close()
// previous_filter if 'Close' (passed in follow() method)
// filter_out_filter_ if 'Filter Out This Stream' (built by appending !current_stream to previous_filter)
// leave filter alone if window closed. (current stream)
- emit updateFilter(output_filter_, TRUE);
+ emit updateFilter(output_filter_, true);
WiresharkDialog::close();
}
-void FollowStreamDialog::on_cbDirections_currentIndexChanged(int idx)
+void FollowStreamDialog::cbDirectionsCurrentIndexChanged(int idx)
{
switch(idx)
{
@@ -362,24 +403,43 @@ void FollowStreamDialog::on_cbDirections_currentIndexChanged(int idx)
readStream();
}
-void FollowStreamDialog::on_cbCharset_currentIndexChanged(int idx)
+void FollowStreamDialog::cbCharsetCurrentIndexChanged(int idx)
{
if (idx < 0) return;
recent.gui_follow_show = ui->cbCharset->currentData().value<bytes_show_type>();
+
+ switch (recent.gui_follow_show) {
+ case SHOW_EBCDIC:
+ case SHOW_ASCII:
+ case SHOW_CODEC:
+ ui->deltaComboBox->setEnabled(true);
+ break;
+ default:
+ ui->deltaComboBox->setEnabled(false);
+ }
+
+ readStream();
+}
+
+void FollowStreamDialog::deltaComboBoxCurrentIndexChanged(int idx)
+{
+ if (idx < 0) return;
+ recent.gui_follow_delta = static_cast<follow_delta_type>(ui->deltaComboBox->currentIndex());
+
readStream();
}
-void FollowStreamDialog::on_bFind_clicked()
+void FollowStreamDialog::bFindClicked()
{
findText();
}
-void FollowStreamDialog::on_leFind_returnPressed()
+void FollowStreamDialog::leFindReturnPressed()
{
findText();
}
-void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num)
+void FollowStreamDialog::streamNumberSpinBoxValueChanged(int stream_num)
{
if (file_closed_) return;
@@ -388,7 +448,7 @@ void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num)
sub_stream_num = ui->subStreamNumberSpinBox->value();
ui->subStreamNumberSpinBox->blockSignals(false);
- gboolean ok;
+ bool ok;
if (ui->subStreamNumberSpinBox->isVisible()) {
/* We need to find a suitable sub stream for the new stream */
follow_sub_stream_id_func sub_stream_func;
@@ -399,7 +459,7 @@ void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num)
return;
}
- guint sub_stream_num_new = static_cast<guint>(sub_stream_num);
+ unsigned sub_stream_num_new = static_cast<unsigned>(sub_stream_num);
if (sub_stream_num < 0) {
// Stream ID 0 should always exist as it is used for control messages.
// XXX: That is only guaranteed for HTTP2. For example, in QUIC,
@@ -411,14 +471,14 @@ void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num)
// follow? Right now the substream spinbox is left active and
// the user can change the value to no effect.
sub_stream_num_new = 0;
- ok = TRUE;
+ ok = true;
} else {
- ok = sub_stream_func(static_cast<guint>(stream_num), sub_stream_num_new, FALSE, &sub_stream_num_new);
+ ok = sub_stream_func(static_cast<unsigned>(stream_num), sub_stream_num_new, false, &sub_stream_num_new);
if (!ok) {
- ok = sub_stream_func(static_cast<guint>(stream_num), sub_stream_num_new, TRUE, &sub_stream_num_new);
+ ok = sub_stream_func(static_cast<unsigned>(stream_num), sub_stream_num_new, true, &sub_stream_num_new);
}
}
- sub_stream_num = static_cast<gint>(sub_stream_num_new);
+ sub_stream_num = static_cast<int>(sub_stream_num_new);
} else {
/* XXX: For HTTP and TLS, we use the TCP stream index, and really should
* return false if the TCP stream doesn't have HTTP or TLS. (Or we could
@@ -434,7 +494,7 @@ void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num)
}
-void FollowStreamDialog::on_subStreamNumberSpinBox_valueChanged(int sub_stream_num)
+void FollowStreamDialog::subStreamNumberSpinBoxValueChanged(int sub_stream_num)
{
if (file_closed_) return;
@@ -451,20 +511,20 @@ void FollowStreamDialog::on_subStreamNumberSpinBox_valueChanged(int sub_stream_n
return;
}
- guint sub_stream_num_new = static_cast<guint>(sub_stream_num);
- gboolean ok;
+ unsigned sub_stream_num_new = static_cast<unsigned>(sub_stream_num);
+ bool ok;
/* previous_sub_stream_num_ is a hack to track which buttons was pressed without event handling */
if (sub_stream_num < 0) {
// Stream ID 0 should always exist as it is used for control messages.
// XXX: That is only guaranteed for HTTP2, see above.
sub_stream_num_new = 0;
- ok = TRUE;
+ ok = true;
} else if (previous_sub_stream_num_ < sub_stream_num) {
- ok = sub_stream_func(static_cast<guint>(stream_num), sub_stream_num_new, FALSE, &sub_stream_num_new);
+ ok = sub_stream_func(static_cast<unsigned>(stream_num), sub_stream_num_new, false, &sub_stream_num_new);
} else {
- ok = sub_stream_func(static_cast<guint>(stream_num), sub_stream_num_new, TRUE, &sub_stream_num_new);
+ ok = sub_stream_func(static_cast<unsigned>(stream_num), sub_stream_num_new, true, &sub_stream_num_new);
}
- sub_stream_num = static_cast<gint>(sub_stream_num_new);
+ sub_stream_num = static_cast<int>(sub_stream_num_new);
if (ok) {
follow(previous_filter_, true, stream_num, sub_stream_num);
@@ -472,7 +532,7 @@ void FollowStreamDialog::on_subStreamNumberSpinBox_valueChanged(int sub_stream_n
}
}
-void FollowStreamDialog::on_buttonBox_rejected()
+void FollowStreamDialog::buttonBoxRejected()
{
// Ignore the close button if FollowStreamDialog::close() is running.
if (terminating_)
@@ -490,60 +550,34 @@ void FollowStreamDialog::removeStreamControls()
ui->subStreamNumberSpinBox->setVisible(false);
}
-void FollowStreamDialog::resetStream()
+void FollowStreamDialog::resetStream(void *tap_data)
{
- GList *cur;
- follow_record_t *follow_record;
-
- filter_out_filter_.clear();
- text_pos_to_packet_.clear();
- if (!data_out_filename_.isEmpty()) {
- ws_unlink(data_out_filename_.toUtf8().constData());
- }
- for (cur = follow_info_.payload; cur; cur = gxx_list_next(cur)) {
- follow_record = gxx_list_data(follow_record_t *, cur);
- if (follow_record->data) {
- g_byte_array_free(follow_record->data, TRUE);
- }
- g_free(follow_record);
- }
- g_list_free(follow_info_.payload);
-
- //Only TCP stream uses fragments
- for (cur = follow_info_.fragments[0]; cur; cur = gxx_list_next(cur)) {
- follow_record = gxx_list_data(follow_record_t *, cur);
- if (follow_record->data) {
- g_byte_array_free(follow_record->data, TRUE);
- }
- g_free(follow_record);
- }
- follow_info_.fragments[0] = Q_NULLPTR;
- for (cur = follow_info_.fragments[1]; cur; cur = gxx_list_next(cur)) {
- follow_record = gxx_list_data(follow_record_t *, cur);
- if (follow_record->data) {
- g_byte_array_free(follow_record->data, TRUE);
- }
- g_free(follow_record);
- }
- follow_info_.fragments[1] = Q_NULLPTR;
+ follow_info_t *follow_info = static_cast<follow_info_t*>(tap_data);
+ follow_reset_stream(follow_info);
+ // If we ever draw the text while tapping (instead of only after
+ // the tap finishes), reset the GUI here too.
+}
- free_address(&follow_info_.client_ip);
- free_address(&follow_info_.server_ip);
- follow_info_.payload = Q_NULLPTR;
- follow_info_.client_port = 0;
+void FollowStreamDialog::resetStream()
+{
+ FollowStreamDialog::resetStream(&follow_info_);
}
-frs_return_t
-FollowStreamDialog::readStream()
+void FollowStreamDialog::readStream()
{
// interrupt any reading already running
loop_break_mutex.lock();
- isReadRunning = FALSE;
+ isReadRunning = false;
loop_break_mutex.unlock();
+ double scroll_ratio = 0.0;
+ int doc_length = ui->teStreamContent->verticalScrollBar()->maximum() + ui->teStreamContent->verticalScrollBar()->pageStep();
+ if (doc_length > 0) {
+ scroll_ratio = static_cast<double>(ui->teStreamContent->verticalScrollBar()->value()) / doc_length;
+ }
+
ui->teStreamContent->clear();
- text_pos_to_packet_.clear();
switch (recent.gui_follow_show) {
case SHOW_CARRAY:
@@ -561,9 +595,6 @@ FollowStreamDialog::readStream()
ui->teStreamContent->setWordWrapMode(QTextOption::WrapAnywhere);
}
- truncated_ = false;
- frs_return_t ret;
-
client_buffer_count_ = 0;
server_buffer_count_ = 0;
client_packet_count_ = 0;
@@ -571,16 +602,16 @@ FollowStreamDialog::readStream()
last_packet_ = 0;
turns_ = 0;
- if (follower_) {
- ret = readFollowStream();
- } else {
- ret = (frs_return_t)0;
+ if (!follower_) {
ws_assert_not_reached();
}
+ readFollowStream();
+
ui->teStreamContent->moveCursor(QTextCursor::Start);
- return ret;
+ doc_length = ui->teStreamContent->verticalScrollBar()->maximum() + ui->teStreamContent->verticalScrollBar()->pageStep();
+ ui->teStreamContent->verticalScrollBar()->setValue(doc_length * scroll_ratio);
}
void
@@ -589,49 +620,9 @@ FollowStreamDialog::followStream()
readStream();
}
-const int FollowStreamDialog::max_document_length_ = 500 * 1000 * 1000; // Just a guess
-void FollowStreamDialog::addText(QString text, gboolean is_from_server, guint32 packet_num, gboolean colorize)
+void FollowStreamDialog::addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize)
{
- if (truncated_) {
- return;
- }
-
- int char_count = ui->teStreamContent->document()->characterCount();
- if (char_count + text.length() > max_document_length_) {
- text.truncate(max_document_length_ - char_count);
- truncated_ = true;
- }
-
- setUpdatesEnabled(false);
- int cur_pos = ui->teStreamContent->verticalScrollBar()->value();
- ui->teStreamContent->moveCursor(QTextCursor::End);
-
- QTextCharFormat tcf = ui->teStreamContent->currentCharFormat();
- if (!colorize) {
- tcf.setBackground(palette().window().color());
- tcf.setForeground(palette().windowText().color());
- } else if (is_from_server) {
- tcf.setForeground(ColorUtils::fromColorT(prefs.st_server_fg));
- tcf.setBackground(ColorUtils::fromColorT(prefs.st_server_bg));
- } else {
- tcf.setForeground(ColorUtils::fromColorT(prefs.st_client_fg));
- tcf.setBackground(ColorUtils::fromColorT(prefs.st_client_bg));
- }
- ui->teStreamContent->setCurrentCharFormat(tcf);
-
- ui->teStreamContent->insertPlainText(text);
- text_pos_to_packet_[ui->teStreamContent->textCursor().anchor()] = packet_num;
-
- if (truncated_) {
- tcf = ui->teStreamContent->currentCharFormat();
- tcf.setBackground(palette().window().color());
- tcf.setForeground(palette().windowText().color());
- ui->teStreamContent->insertPlainText("\n" + tr("[Stream output truncated]"));
- ui->teStreamContent->moveCursor(QTextCursor::End);
- } else {
- ui->teStreamContent->verticalScrollBar()->setValue(cur_pos);
- }
- setUpdatesEnabled(true);
+ ui->teStreamContent->addText(std::move(text), is_from_server, packet_num, colorize);
}
// The following keyboard shortcuts should work (although
@@ -682,33 +673,64 @@ void FollowStreamDialog::keyPressEvent(QKeyEvent *event)
QDialog::keyPressEvent(event);
}
-static inline void sanitize_buffer(char *buffer, size_t nchars) {
- for (size_t i = 0; i < nchars; i++) {
- if (buffer[i] == '\n' || buffer[i] == '\r' || buffer[i] == '\t')
+// Replaces non printable ASCII characters in the QByteArray with .
+// Causes buffer to detach/deep copy *only* if a character has to be
+// replaced.
+static inline void sanitize_buffer(QByteArray &buffer, size_t nchars) {
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ for (int i = 0; i < (int)nchars; i++) {
+#else
+ for (qsizetype i = 0; i < (qsizetype)nchars; i++) {
+#endif
+ if (buffer.at(i) == '\n' || buffer.at(i) == '\r' || buffer.at(i) == '\t')
continue;
- if (! g_ascii_isprint((guchar)buffer[i])) {
+ if (! g_ascii_isprint((unsigned char)buffer.at(i))) {
buffer[i] = '.';
}
}
}
-frs_return_t
-FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_server, guint32 packet_num,
- nstime_t abs_ts, guint32 *global_pos)
+void FollowStreamDialog::showBuffer(QByteArray &buffer, size_t nchars, bool is_from_server, uint32_t packet_num,
+ nstime_t abs_ts, uint32_t *global_pos)
{
- gchar initbuf[256];
- guint32 current_pos;
- static const gchar hexchars[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+ char initbuf[256];
+ uint32_t current_pos;
+ static const char hexchars[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+ bool show_delta = false;
+
+ if (last_packet_ == 0) {
+ last_from_server_ = is_from_server;
+ } else {
+ if (recent.gui_follow_delta == FOLLOW_DELTA_ALL ||
+ (recent.gui_follow_delta == FOLLOW_DELTA_TURN && last_from_server_ != is_from_server)) {
+ show_delta = true;
+ }
+ }
+
+ double delta = 0.0;
+ if (!nstime_is_zero(&abs_ts)) {
+ // packet-tcp.c and possibly other dissectors can return a zero abs_ts when
+ // a fragment is missing.
+ nstime_t delta_ts;
+ nstime_delta(&delta_ts, &abs_ts, &last_ts_);
+ delta = nstime_to_sec(&delta_ts);
+ last_ts_ = abs_ts;
+ }
switch (recent.gui_follow_show) {
case SHOW_EBCDIC:
{
/* If our native arch is ASCII, call: */
- EBCDIC_to_ASCII((guint8*)buffer, (guint) nchars);
+ EBCDIC_to_ASCII((uint8_t*)buffer.data(), (unsigned) nchars);
+ if (show_delta) {
+ ui->teStreamContent->addDeltaTime(delta);
+ }
+ if (show_delta || last_from_server_ != is_from_server) {
+ addText("\n", is_from_server, packet_num);
+ }
sanitize_buffer(buffer, nchars);
- QByteArray ba = QByteArray(buffer, (int)nchars);
- addText(ba, is_from_server, packet_num);
+ addText(buffer, is_from_server, packet_num);
break;
}
@@ -717,32 +739,41 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
/* If our native arch is EBCDIC, call:
* ASCII_TO_EBCDIC(buffer, nchars);
*/
+ if (show_delta) {
+ ui->teStreamContent->addDeltaTime(delta);
+ }
+ if (show_delta || last_from_server_ != is_from_server) {
+ addText("\n", is_from_server, packet_num);
+ }
sanitize_buffer(buffer, nchars);
- QByteArray ba = QByteArray(buffer, (int)nchars);
- addText(ba, is_from_server, packet_num);
+ addText(buffer, is_from_server, packet_num);
break;
}
case SHOW_CODEC:
{
+ if (show_delta) {
+ ui->teStreamContent->addDeltaTime(delta);
+ }
+ if (show_delta || last_from_server_ != is_from_server) {
+ addText("\n", is_from_server, packet_num);
+ }
// This assumes that multibyte characters don't span packets in the
// stream. To handle that case properly (which might occur with fixed
// block sizes, e.g. transferring over TFTP, we would need to create
// two stateful QTextDecoders, one for each direction, presumably in
// on_cbCharset_currentIndexChanged()
QTextCodec *codec = QTextCodec::codecForName(ui->cbCharset->currentText().toUtf8());
- QByteArray ba = QByteArray(buffer, (int)nchars);
- QString decoded = codec->toUnicode(ba);
- addText(decoded, is_from_server, packet_num);
+ addText(codec->toUnicode(buffer), is_from_server, packet_num);
break;
}
case SHOW_HEXDUMP:
current_pos = 0;
while (current_pos < nchars) {
- gchar hexbuf[256];
+ char hexbuf[256];
int i;
- gchar *cur = hexbuf, *ascii_start;
+ char *cur = hexbuf, *ascii_start;
/* is_from_server indentation : put 4 spaces at the
* beginning of the string */
@@ -756,9 +787,9 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
ascii_start = cur + 49 + 2;
for (i = 0; i < 16 && current_pos + i < nchars; i++) {
*cur++ =
- hexchars[(buffer[current_pos + i] & 0xf0) >> 4];
+ hexchars[(buffer.at(current_pos + i) & 0xf0) >> 4];
*cur++ =
- hexchars[buffer[current_pos + i] & 0x0f];
+ hexchars[buffer.at(current_pos + i) & 0x0f];
*cur++ = ' ';
if (i == 7)
*cur++ = ' ';
@@ -770,8 +801,8 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
/* Now dump bytes as text */
for (i = 0; i < 16 && current_pos + i < nchars; i++) {
*cur++ =
- (g_ascii_isprint((guchar)buffer[current_pos + i]) ?
- buffer[current_pos + i] : '.');
+ (g_ascii_isprint((unsigned char)buffer.at(current_pos + i)) ?
+ buffer.at(current_pos + i) : '.');
if (i == 7) {
*cur++ = ' ';
}
@@ -794,7 +825,7 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
addText(initbuf, is_from_server, packet_num);
while (current_pos < nchars) {
- gchar hexbuf[256];
+ char hexbuf[256];
int i, cur;
cur = 0;
@@ -803,9 +834,9 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
hexbuf[cur++] = '0';
hexbuf[cur++] = 'x';
hexbuf[cur++] =
- hexchars[(buffer[current_pos + i] & 0xf0) >> 4];
+ hexchars[(buffer.at(current_pos + i) & 0xf0) >> 4];
hexbuf[cur++] =
- hexchars[buffer[current_pos + i] & 0x0f];
+ hexchars[buffer.at(current_pos + i) & 0x0f];
/* Delimit array entries with a comma */
if (current_pos + i + 1 < nchars)
@@ -849,15 +880,13 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
" - peer: 0\n"
" host: %1\n"
" port: %2\n")
- .arg(hostname0)
- .arg(port0), false, 0);
+ .arg(hostname0, port0), false, 0);
addText(QString(
" - peer: 1\n"
" host: %1\n"
" port: %2\n")
- .arg(hostname1)
- .arg(port1), true, 0);
+ .arg(hostname1, port1), true, 0);
wmem_free(NULL, port0);
wmem_free(NULL, port1);
@@ -879,7 +908,7 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser
}
while (current_pos < nchars) {
int len = current_pos + base64_raw_len < nchars ? base64_raw_len : (int) nchars - current_pos;
- QByteArray base64_data(&buffer[current_pos], len);
+ QByteArray base64_data(&buffer.constData()[current_pos], len);
/* XXX: GCC 12.1 has a bogus stringop-overread warning using the Qt
* conversions from QByteArray to QString at -O2 and higher due to
@@ -896,15 +925,13 @@ DIAG_ON(stringop-overread)
current_pos += len;
(*global_pos) += len;
}
- addText(yaml_text, is_from_server, packet_num);
+ addText(std::move(yaml_text), is_from_server, packet_num);
break;
}
case SHOW_RAW:
{
- QByteArray ba = QByteArray(buffer, (int)nchars).toHex();
- ba += '\n';
- addText(ba, is_from_server, packet_num);
+ addText(buffer.toHex() + '\n', is_from_server, packet_num);
break;
}
@@ -915,10 +942,6 @@ DIAG_ON(stringop-overread)
ws_assert_not_reached();
}
- if (last_packet_ == 0) {
- last_from_server_ = is_from_server;
- }
-
if (packet_num != last_packet_) {
last_packet_ = packet_num;
if (is_from_server) {
@@ -931,11 +954,9 @@ DIAG_ON(stringop-overread)
turns_++;
}
}
-
- return FRS_OK;
}
-bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index, guint stream_num, guint sub_stream_num)
+bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index, unsigned stream_num, unsigned sub_stream_num)
{
QString follow_filter;
const char *hostname0 = NULL, *hostname1 = NULL;
@@ -943,12 +964,10 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
QString server_to_client_string;
QString client_to_server_string;
QString both_directions_string;
- gboolean is_follower = FALSE;
+ bool is_follower = false;
int stream_count;
follow_stream_count_func stream_count_func = NULL;
- resetStream();
-
if (file_closed_)
{
QMessageBox::warning(this, tr("No capture file."), tr("Please make sure you have a capture file opened."));
@@ -969,8 +988,6 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
}
}
- follow_reset_stream(&follow_info_);
-
/* Create a new filter that matches all packets in the TCP stream,
and set the display filter entry accordingly */
if (use_stream_index) {
@@ -993,7 +1010,7 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
/* append the negation */
if (!previous_filter.isEmpty()) {
filter_out_filter_ = QString("%1 and !(%2)")
- .arg(previous_filter).arg(follow_filter);
+ .arg(previous_filter, follow_filter);
}
else
{
@@ -1005,7 +1022,8 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
/* data will be passed via tap callback*/
if (!registerTapListener(get_follow_tap_string(follower_), &follow_info_,
follow_filter.toUtf8().constData(),
- 0, NULL, get_follow_tap_handler(follower_), NULL)) {
+ 0, FollowStreamDialog::resetStream,
+ get_follow_tap_handler(follower_), NULL)) {
return false;
}
@@ -1026,9 +1044,9 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
follow_sub_stream_id_func sub_stream_func;
sub_stream_func = get_follow_sub_stream_id_func(follower_);
if (sub_stream_func != NULL) {
- guint substream_max_id = 0;
- sub_stream_func(static_cast<guint>(stream_num), G_MAXINT32, TRUE, &substream_max_id);
- stream_count = static_cast<gint>(substream_max_id);
+ unsigned substream_max_id = 0;
+ sub_stream_func(static_cast<unsigned>(stream_num), INT32_MAX, true, &substream_max_id);
+ stream_count = static_cast<int>(substream_max_id);
ui->subStreamNumberSpinBox->blockSignals(true);
ui->subStreamNumberSpinBox->setEnabled(true);
ui->subStreamNumberSpinBox->setMaximum(stream_count);
@@ -1054,43 +1072,83 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
/* Run the display filter so it goes in effect - even if it's the
same as the previous display filter. */
- emit updateFilter(follow_filter, TRUE);
+ /* XXX: This forces a cf_filter_packets() - but if a rescan (or something else
+ * that sets cf->read_lock) is in progress, this will queue the filter
+ * and return immediately. It will also cause a rescan in progress to
+ * stop and restart with the new filter. That also applies to this rescan;
+ * changing the main display filter (from the main window, or from, e.g.
+ * another FollowStreamDialog) will cause this to restart and reset the
+ * tap.
+ *
+ * Other tapping dialogs call cf_retap_packets (which retaps but doesn't
+ * set the main display filter, freeze the packet list, etc.), which
+ * has somewhat different behavior when another dialog tries to retap,
+ * but also results in the taps being reset mid tap.
+ *
+ * Either way, we should be event driven and listening for CaptureEvents
+ * instead of drawing after this returns. (Or like other taps, draw
+ * periodically in a callback, provided that can be done without causing
+ * issues with changing the Decode As type.)
+ */
+ emit updateFilter(follow_filter, true);
removeTapListeners();
- hostname0 = address_to_name(&follow_info_.client_ip);
- hostname1 = address_to_name(&follow_info_.server_ip);
-
- port0 = get_follow_port_to_display(follower_)(NULL, follow_info_.client_port);
- port1 = get_follow_port_to_display(follower_)(NULL, follow_info_.server_port);
-
- server_to_client_string =
- QString("%1:%2 %3 %4:%5 (%6)")
- .arg(hostname0).arg(port0)
- .arg(UTF8_RIGHTWARDS_ARROW)
- .arg(hostname1).arg(port1)
- .arg(gchar_free_to_qstring(format_size(
- follow_info_.bytes_written[0],
- FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
-
- client_to_server_string =
- QString("%1:%2 %3 %4:%5 (%6)")
- .arg(hostname1).arg(port1)
- .arg(UTF8_RIGHTWARDS_ARROW)
- .arg(hostname0).arg(port0)
- .arg(gchar_free_to_qstring(format_size(
- follow_info_.bytes_written[1],
- FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
-
- wmem_free(NULL, port0);
- wmem_free(NULL, port1);
-
- both_directions_string = tr("Entire conversation (%1)")
- .arg(gchar_free_to_qstring(format_size(
- follow_info_.bytes_written[0] + follow_info_.bytes_written[1],
- FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
- setWindowSubtitle(tr("Follow %1 Stream (%2)").arg(proto_get_protocol_short_name(find_protocol_by_id(get_follow_proto_id(follower_))))
- .arg(follow_filter));
+ bool is_logray = strcmp(get_configuration_namespace(), "Logray") == 0;
+
+ if (is_logray) {
+ server_to_client_string =
+ tr("Read activity(%6)")
+ .arg(gchar_free_to_qstring(format_size(
+ follow_info_.bytes_written[0],
+ FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
+
+ client_to_server_string =
+ tr("Write activity(%6)")
+ .arg(gchar_free_to_qstring(format_size(
+ follow_info_.bytes_written[1],
+ FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
+
+ both_directions_string = tr("Entire I/O activity (%1)")
+ .arg(gchar_free_to_qstring(format_size(
+ follow_info_.bytes_written[0] + follow_info_.bytes_written[1],
+ FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
+ } else {
+ hostname0 = address_to_name(&follow_info_.client_ip);
+ hostname1 = address_to_name(&follow_info_.server_ip);
+
+ port0 = get_follow_port_to_display(follower_)(NULL, follow_info_.client_port);
+ port1 = get_follow_port_to_display(follower_)(NULL, follow_info_.server_port);
+
+ server_to_client_string =
+ QString("%1:%2 %3 %4:%5 (%6)")
+ .arg(hostname0, port0)
+ .arg(UTF8_RIGHTWARDS_ARROW)
+ .arg(hostname1, port1)
+ .arg(gchar_free_to_qstring(format_size(
+ follow_info_.bytes_written[0],
+ FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
+
+ client_to_server_string =
+ QString("%1:%2 %3 %4:%5 (%6)")
+ .arg(hostname1, port1)
+ .arg(UTF8_RIGHTWARDS_ARROW)
+ .arg(hostname0, port0)
+ .arg(gchar_free_to_qstring(format_size(
+ follow_info_.bytes_written[1],
+ FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
+
+ wmem_free(NULL, port0);
+ wmem_free(NULL, port1);
+
+ both_directions_string = tr("Entire conversation (%1)")
+ .arg(gchar_free_to_qstring(format_size(
+ follow_info_.bytes_written[0] + follow_info_.bytes_written[1],
+ FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI)));
+ }
+
+ setWindowSubtitle(tr("Follow %1 Stream (%2)").arg(proto_get_protocol_short_name(find_protocol_by_id(get_follow_proto_id(follower_))),
+ follow_filter));
ui->cbDirections->blockSignals(true);
ui->cbDirections->clear();
@@ -1100,13 +1158,13 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
ui->cbDirections->blockSignals(false);
followStream();
- fillHintLabel(-1);
+ fillHintLabel();
updateWidgets(false);
endRetapPackets();
if (prefs.restore_filter_after_following_stream) {
- emit updateFilter(previous_filter_, TRUE);
+ emit updateFilter(previous_filter_, true);
}
return true;
@@ -1120,74 +1178,53 @@ void FollowStreamDialog::captureFileClosed()
WiresharkDialog::captureFileClosed();
}
-/*
- * XXX - the routine pointed to by "print_line_fcn_p" doesn't get handed lines,
- * it gets handed bufferfuls. That's fine for "follow_write_raw()"
- * and "follow_add_to_gtk_text()", but, as "follow_print_text()" calls
- * the "print_line()" routine from "print.c", and as that routine might
- * genuinely expect to be handed a line (if, for example, it's using
- * some OS or desktop environment's printing API, and that API expects
- * to be handed lines), "follow_print_text()" should probably accumulate
- * lines in a buffer and hand them "print_line()". (If there's a
- * complete line in a buffer - i.e., there's nothing of the line in
- * the previous buffer or the next buffer - it can just hand that to
- * "print_line()" after filtering out non-printables, as an
- * optimization.)
- *
- * This might or might not be the reason why C arrays display
- * correctly but get extra blank lines very other line when printed.
- */
-frs_return_t
-FollowStreamDialog::readFollowStream()
+void FollowStreamDialog::readFollowStream()
{
- guint32 global_client_pos = 0, global_server_pos = 0;
- guint32 *global_pos;
- gboolean skip;
+ uint32_t global_client_pos = 0, global_server_pos = 0;
+ uint32_t *global_pos;
+ bool skip;
GList* cur;
- frs_return_t frs_return;
follow_record_t *follow_record;
QElapsedTimer elapsed_timer;
+ QByteArray buffer;
elapsed_timer.start();
loop_break_mutex.lock();
- isReadRunning = TRUE;
+ isReadRunning = true;
loop_break_mutex.unlock();
for (cur = g_list_last(follow_info_.payload); cur; cur = g_list_previous(cur)) {
if (dialogClosed() || !isReadRunning) break;
follow_record = (follow_record_t *)cur->data;
- skip = FALSE;
+ skip = false;
if (!follow_record->is_server) {
global_pos = &global_client_pos;
if (follow_info_.show_stream == FROM_SERVER) {
- skip = TRUE;
+ skip = true;
}
} else {
global_pos = &global_server_pos;
if (follow_info_.show_stream == FROM_CLIENT) {
- skip = TRUE;
+ skip = true;
}
}
- QByteArray buffer;
if (!skip) {
- // We want a deep copy.
- buffer.clear();
- buffer.append((const char *) follow_record->data->data,
- follow_record->data->len);
- frs_return = showBuffer(
- buffer.data(),
- follow_record->data->len,
- follow_record->is_server,
- follow_record->packet_num,
- follow_record->abs_ts,
- global_pos);
- if (frs_return == FRS_PRINT_ERROR)
- return frs_return;
+ // This will only detach / deep copy if the buffer data is
+ // modified. Try to avoid doing that as much as possible
+ // (and avoid new memory allocations that have to be freed).
+ buffer.setRawData((char*)follow_record->data->data, follow_record->data->len);
+ showBuffer(
+ buffer,
+ follow_record->data->len,
+ follow_record->is_server,
+ follow_record->packet_num,
+ follow_record->abs_ts,
+ global_pos);
if (elapsed_timer.elapsed() > info_update_freq_) {
- fillHintLabel(ui->teStreamContent->textCursor().position());
+ fillHintLabel(ui->teStreamContent->currentPacket());
mainApp->processEvents();
elapsed_timer.start();
}
@@ -1195,8 +1232,7 @@ FollowStreamDialog::readFollowStream()
}
loop_break_mutex.lock();
- isReadRunning = FALSE;
+ isReadRunning = false;
loop_break_mutex.unlock();
-
- return FRS_OK;
}
+
diff --git a/ui/qt/follow_stream_dialog.h b/ui/qt/follow_stream_dialog.h
index e56023de..859c0534 100644
--- a/ui/qt/follow_stream_dialog.h
+++ b/ui/qt/follow_stream_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <stdio.h>
#ifdef HAVE_UNISTD_H
@@ -44,7 +42,7 @@ public:
~FollowStreamDialog();
void addCodecs(const QMap<QString, QTextCodec *> &codecMap);
- bool follow(QString previous_filter = QString(), bool use_stream_index = false, guint stream_num = 0, guint sub_stream_num = 0);
+ bool follow(QString previous_filter = QString(), bool use_stream_index = false, unsigned stream_num = 0, unsigned sub_stream_num = 0);
protected:
bool eventFilter(QObject *obj, QEvent *event);
@@ -52,10 +50,11 @@ protected:
void captureFileClosed();
private slots:
- void on_cbCharset_currentIndexChanged(int idx);
- void on_cbDirections_currentIndexChanged(int idx);
- void on_bFind_clicked();
- void on_leFind_returnPressed();
+ void cbCharsetCurrentIndexChanged(int idx);
+ void deltaComboBoxCurrentIndexChanged(int idx);
+ void cbDirectionsCurrentIndexChanged(int idx);
+ void bFindClicked();
+ void leFindReturnPressed();
void helpButton();
void backButton();
@@ -65,33 +64,33 @@ private slots:
void findText(bool go_back = true);
void saveAs();
void printStream();
- void fillHintLabel(int text_pos);
- void goToPacketForTextPos(int text_pos);
+ void fillHintLabel(int pkt = 0);
+ void goToPacketForTextPos(int pkt = 0);
- void on_streamNumberSpinBox_valueChanged(int stream_num);
- void on_subStreamNumberSpinBox_valueChanged(int sub_stream_num);
+ void streamNumberSpinBoxValueChanged(int stream_num);
+ void subStreamNumberSpinBoxValueChanged(int sub_stream_num);
- void on_buttonBox_rejected();
+ void buttonBoxRejected();
signals:
void updateFilter(QString filter, bool force);
void goToPacket(int packet_num);
private:
+ // Callback for register_tap_listener
+ static void resetStream(void *tapData);
+
void removeStreamControls();
void resetStream(void);
void updateWidgets(bool follow_in_progress);
void updateWidgets() { updateWidgets(false); } // Needed for WiresharkDialog?
- frs_return_t
- showBuffer(char *buffer, size_t nchars, gboolean is_from_server,
- guint32 packet_num, nstime_t abs_ts, guint32 *global_pos);
-
- frs_return_t readStream();
- frs_return_t readFollowStream();
- frs_return_t readSslStream();
+ void showBuffer(QByteArray &buffer, size_t nchars, bool is_from_server,
+ uint32_t packet_num, nstime_t abs_ts, uint32_t *global_pos);
+ void readStream();
+ void readFollowStream();
void followStream();
- void addText(QString text, gboolean is_from_server, guint32 packet_num, gboolean colorize = true);
+ void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize = true);
Ui::FollowStreamDialog *ui;
@@ -103,9 +102,6 @@ private:
follow_info_t follow_info_;
register_follow_t* follower_;
- QString data_out_filename_;
- static const int max_document_length_;
- bool truncated_;
QString previous_filter_;
QString filter_out_filter_;
QString output_filter_;
@@ -113,10 +109,10 @@ private:
int server_buffer_count_;
int client_packet_count_;
int server_packet_count_;
- guint32 last_packet_;
- gboolean last_from_server_;
+ uint32_t last_packet_;
+ bool last_from_server_;
+ nstime_t last_ts_;
int turns_;
- QMap<int,guint32> text_pos_to_packet_;
bool use_regex_find_;
diff --git a/ui/qt/follow_stream_dialog.ui b/ui/qt/follow_stream_dialog.ui
index 3b4a76a4..dc77586e 100644
--- a/ui/qt/follow_stream_dialog.ui
+++ b/ui/qt/follow_stream_dialog.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>609</width>
+ <width>750</width>
<height>600</height>
</rect>
</property>
@@ -41,7 +41,7 @@
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,1,0,0,0,0">
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,1,0,0,0,0">
<item>
<widget class="QComboBox" name="cbDirections">
<property name="sizeAdjustPolicy">
@@ -50,7 +50,7 @@
</widget>
</item>
<item>
- <spacer name="horizontalSpacer">
+ <spacer name="charsetSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -65,7 +65,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
- <string>Show data as</string>
+ <string>Show as</string>
</property>
</widget>
</item>
@@ -77,6 +77,38 @@
</widget>
</item>
<item>
+ <spacer name="deltaSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QComboBox" name="deltaComboBox">
+ <item>
+ <property name="text">
+ <string>No delta times</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Turn delta times</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>All delta times</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
<spacer name="streamNumberSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -124,6 +156,13 @@
<widget class="FindLineEdit" name="leFind"/>
</item>
<item>
+ <widget class="QCheckBox" name="caseCheckBox">
+ <property name="text">
+ <string>Case sensitive</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QPushButton" name="bFind">
<property name="text">
<string>Find &amp;Next</string>
diff --git a/ui/qt/font_color_preferences_frame.cpp b/ui/qt/font_color_preferences_frame.cpp
index 0a09e0f4..ceb94c31 100644
--- a/ui/qt/font_color_preferences_frame.cpp
+++ b/ui/qt/font_color_preferences_frame.cpp
@@ -15,6 +15,7 @@
#include <ui_font_color_preferences_frame.h>
#include <ui/qt/utils/color_utils.h>
#include "main_application.h"
+#include "wsutil/array.h"
#include <functional>
#include <QFontDialog>
@@ -28,7 +29,7 @@ static const char *font_pangrams_[] = {
QT_TRANSLATE_NOOP("FontColorPreferencesFrame", "Example GIF query packets have jumbo window sizes"),
QT_TRANSLATE_NOOP("FontColorPreferencesFrame", "Lazy badgers move unique waxy jellyfish packets")
};
-const int num_font_pangrams_ = (sizeof font_pangrams_ / sizeof font_pangrams_[0]);
+const int num_font_pangrams_ = array_length(font_pangrams_);
FontColorPreferencesFrame::FontColorPreferencesFrame(QWidget *parent) :
QFrame(parent),
@@ -78,7 +79,7 @@ void FontColorPreferencesFrame::showEvent(QShowEvent *)
void FontColorPreferencesFrame::updateWidgets()
{
- gint colorstyle;
+ int colorstyle;
QColor foreground;
QColor background1;
QColor background2;
diff --git a/ui/qt/funnel_statistics.cpp b/ui/qt/funnel_statistics.cpp
index f5ed6745..943c354b 100644
--- a/ui/qt/funnel_statistics.cpp
+++ b/ui/qt/funnel_statistics.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include "epan/color_filters.h"
#include "file.h"
@@ -43,23 +41,23 @@
extern "C" {
static struct _funnel_text_window_t* text_window_new(funnel_ops_id_t *ops_id, const char* title);
-static void string_dialog_new(funnel_ops_id_t *ops_id, const gchar* title, const gchar** field_names, const gchar** field_values, funnel_dlg_cb_t dialog_cb, void* dialog_cb_data, funnel_dlg_cb_data_free_t dialog_cb_data_free);
+static void string_dialog_new(funnel_ops_id_t *ops_id, const char* title, const char** field_names, const char** field_values, funnel_dlg_cb_t dialog_cb, void* dialog_cb_data, funnel_dlg_cb_data_free_t dialog_cb_data_free);
static void funnel_statistics_retap_packets(funnel_ops_id_t *ops_id);
static void funnel_statistics_copy_to_clipboard(GString *text);
-static const gchar *funnel_statistics_get_filter(funnel_ops_id_t *ops_id);
+static const char *funnel_statistics_get_filter(funnel_ops_id_t *ops_id);
static void funnel_statistics_set_filter(funnel_ops_id_t *ops_id, const char* filter_string);
-static gchar* funnel_statistics_get_color_filter_slot(guint8 filter_num);
-static void funnel_statistics_set_color_filter_slot(guint8 filter_num, const gchar* filter_string);
-static gboolean funnel_statistics_open_file(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char**);
+static char* funnel_statistics_get_color_filter_slot(uint8_t filter_num);
+static void funnel_statistics_set_color_filter_slot(uint8_t filter_num, const char* filter_string);
+static bool funnel_statistics_open_file(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char**);
static void funnel_statistics_reload_packets(funnel_ops_id_t *ops_id);
static void funnel_statistics_redissect_packets(funnel_ops_id_t *ops_id);
static void funnel_statistics_reload_lua_plugins(funnel_ops_id_t *ops_id);
static void funnel_statistics_apply_filter(funnel_ops_id_t *ops_id);
-static gboolean browser_open_url(const gchar *url);
-static void browser_open_data_file(const gchar *filename);
-static struct progdlg *progress_window_new(funnel_ops_id_t *ops_id, const gchar* title, const gchar* task, gboolean terminate_is_stop, gboolean *stop_flag);
-static void progress_window_update(struct progdlg *progress_dialog, float percentage, const gchar* status);
+static bool browser_open_url(const char *url);
+static void browser_open_data_file(const char *filename);
+static struct progdlg *progress_window_new(funnel_ops_id_t *ops_id, const char* title, const char* task, bool terminate_is_stop, bool *stop_flag);
+static void progress_window_update(struct progdlg *progress_dialog, float percentage, const char* status);
static void progress_window_destroy(struct progdlg *progress_dialog);
}
@@ -67,14 +65,14 @@ FunnelAction::FunnelAction(QObject *parent) :
QAction(parent),
callback_(nullptr),
callback_data_(NULL),
- retap_(FALSE),
+ retap_(false),
packetCallback_(nullptr),
packetData_(NULL)
{
}
-FunnelAction::FunnelAction(QString title, funnel_menu_callback callback, gpointer callback_data, gboolean retap, QObject *parent = nullptr) :
+FunnelAction::FunnelAction(QString title, funnel_menu_callback callback, void *callback_data, bool retap, QObject *parent = nullptr) :
QAction(parent),
title_(title),
callback_(callback),
@@ -89,7 +87,7 @@ FunnelAction::FunnelAction(QString title, funnel_menu_callback callback, gpointe
packetRequiredFields_ = QSet<QString>();
}
-FunnelAction::FunnelAction(QString title, funnel_packet_menu_callback callback, gpointer callback_data, gboolean retap, const char *packet_required_fields, QObject *parent = nullptr) :
+FunnelAction::FunnelAction(QString title, funnel_packet_menu_callback callback, void *callback_data, bool retap, const char *packet_required_fields, QObject *parent = nullptr) :
QAction(parent),
title_(title),
callback_data_(callback_data),
@@ -248,7 +246,7 @@ void FunnelConsoleAction::triggerCallback() {
static QHash<int, QList<FunnelAction *> > funnel_actions_;
const QString FunnelStatistics::action_name_ = "FunnelStatisticsAction";
-static gboolean menus_registered = FALSE;
+static bool menus_registered;
struct _funnel_ops_id_t {
FunnelStatistics *funnel_statistics;
@@ -313,7 +311,7 @@ void FunnelStatistics::retapPackets()
capture_file_.retapPackets();
}
-struct progdlg *FunnelStatistics::progressDialogNew(const gchar *task_title, const gchar *item_title, gboolean terminate_is_stop, gboolean *stop_flag)
+struct progdlg *FunnelStatistics::progressDialogNew(const char *task_title, const char *item_title, bool terminate_is_stop, bool *stop_flag)
{
return create_progress_dlg(parent(), task_title, item_title, terminate_is_stop, stop_flag);
}
@@ -373,7 +371,7 @@ struct _funnel_text_window_t* text_window_new(funnel_ops_id_t *ops_id, const cha
return FunnelTextDialog::textWindowNew(qobject_cast<QWidget *>(ops_id->funnel_statistics->parent()), title);
}
-void string_dialog_new(funnel_ops_id_t *ops_id, const gchar* title, const gchar** field_names, const gchar** field_values, funnel_dlg_cb_t dialog_cb, void* dialog_cb_data, funnel_dlg_cb_data_free_t dialog_cb_data_free)
+void string_dialog_new(funnel_ops_id_t *ops_id, const char* title, const char** field_names, const char** field_values, funnel_dlg_cb_t dialog_cb, void* dialog_cb_data, funnel_dlg_cb_data_free_t dialog_cb_data_free)
{
QList<QPair<QString, QString>> field_list;
for (int i = 0; field_names[i]; i++) {
@@ -398,7 +396,7 @@ void funnel_statistics_copy_to_clipboard(GString *text) {
mainApp->clipboard()->setText(text->str);
}
-const gchar *funnel_statistics_get_filter(funnel_ops_id_t *ops_id) {
+const char *funnel_statistics_get_filter(funnel_ops_id_t *ops_id) {
if (!ops_id || !ops_id->funnel_statistics) return nullptr;
return ops_id->funnel_statistics->displayFilter();
@@ -410,28 +408,28 @@ void funnel_statistics_set_filter(funnel_ops_id_t *ops_id, const char* filter_st
ops_id->funnel_statistics->emitSetDisplayFilter(filter_string);
}
-gchar* funnel_statistics_get_color_filter_slot(guint8 filter_num) {
+char* funnel_statistics_get_color_filter_slot(uint8_t filter_num) {
return color_filters_get_tmp(filter_num);
}
-void funnel_statistics_set_color_filter_slot(guint8 filter_num, const gchar* filter_string) {
- gchar *err_msg = nullptr;
- if (!color_filters_set_tmp(filter_num, filter_string, FALSE, &err_msg)) {
+void funnel_statistics_set_color_filter_slot(uint8_t filter_num, const char* filter_string) {
+ char *err_msg = nullptr;
+ if (!color_filters_set_tmp(filter_num, filter_string, false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
}
-gboolean funnel_statistics_open_file(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char**) {
+bool funnel_statistics_open_file(funnel_ops_id_t *ops_id, const char* fname, const char* filter, char**) {
// XXX We need to return a proper error value. We should probably move
// MainWindow::openCaptureFile to CaptureFile and add error handling
// there.
- if (!ops_id || !ops_id->funnel_statistics) return FALSE;
+ if (!ops_id || !ops_id->funnel_statistics) return false;
QString cf_name(fname);
QString cf_filter(filter);
ops_id->funnel_statistics->emitOpenCaptureFile(cf_name, cf_filter);
- return TRUE;
+ return true;
}
void funnel_statistics_reload_packets(funnel_ops_id_t *ops_id) {
@@ -458,21 +456,21 @@ void funnel_statistics_apply_filter(funnel_ops_id_t *ops_id) {
ops_id->funnel_statistics->emitApplyDisplayFilter();
}
-gboolean browser_open_url(const gchar *url) {
- return QDesktopServices::openUrl(QUrl(url)) ? TRUE : FALSE;
+bool browser_open_url(const char *url) {
+ return QDesktopServices::openUrl(QUrl(url)) ? true : false;
}
-void browser_open_data_file(const gchar *filename) {
+void browser_open_data_file(const char *filename) {
QDesktopServices::openUrl(QUrl::fromLocalFile(filename));
}
-struct progdlg *progress_window_new(funnel_ops_id_t *ops_id, const gchar* task_title, const gchar* item_title, gboolean terminate_is_stop, gboolean *stop_flag) {
+struct progdlg *progress_window_new(funnel_ops_id_t *ops_id, const char* task_title, const char* item_title, bool terminate_is_stop, bool *stop_flag) {
if (!ops_id || !ops_id->funnel_statistics) return nullptr;
return ops_id->funnel_statistics->progressDialogNew(task_title, item_title, terminate_is_stop, stop_flag);
}
-void progress_window_update(struct progdlg *progress_dialog, float percentage, const gchar* status) {
+void progress_window_update(struct progdlg *progress_dialog, float percentage, const char* status) {
update_progress_dlg(progress_dialog, percentage, status);
}
@@ -487,8 +485,8 @@ void register_tap_listener_qt_funnel(void);
static void register_menu_cb(const char *name,
register_stat_group_t group,
funnel_menu_callback callback,
- gpointer callback_data,
- gboolean retap)
+ void *callback_data,
+ bool retap)
{
FunnelAction *funnel_action = new FunnelAction(name, callback, callback_data, retap, mainApp);
if (menus_registered) {
@@ -519,8 +517,8 @@ static void register_menu_cb(const char *name,
static void register_packet_menu_cb(const char *name,
const char *required_fields,
funnel_packet_menu_callback callback,
- gpointer callback_data,
- gboolean retap)
+ void *callback_data,
+ bool retap)
{
FunnelAction *funnel_action = new FunnelAction(name, callback, callback_data, retap, required_fields, mainApp);
MainWindow * mainwindow = qobject_cast<MainWindow *>(mainApp->mainWindow());
@@ -552,7 +550,7 @@ register_tap_listener_qt_funnel(void)
{
funnel_register_all_menus(register_menu_cb);
funnel_statistics_load_console_menus();
- menus_registered = TRUE;
+ menus_registered = true;
}
void
@@ -566,9 +564,9 @@ funnel_statistics_reload_menus(void)
/**
* Returns whether the packet menus have been modified since they were last registered
*
- * @return TRUE if the packet menus were modified since the last registration
+ * @return true if the packet menus were modified since the last registration
*/
-gboolean
+bool
funnel_statistics_packet_menus_modified(void)
{
return funnel_packet_menus_modified();
diff --git a/ui/qt/funnel_statistics.h b/ui/qt/funnel_statistics.h
index 65b36ab8..b6ed12f7 100644
--- a/ui/qt/funnel_statistics.h
+++ b/ui/qt/funnel_statistics.h
@@ -26,7 +26,7 @@ struct progdlg;
/**
* Signature of function that can be called from a custom packet menu entry
*/
-typedef void (* funnel_packet_menu_callback)(gpointer, GPtrArray*);
+typedef void (* funnel_packet_menu_callback)(void *, GPtrArray*);
class FunnelStatistics : public QObject
{
@@ -35,7 +35,7 @@ public:
explicit FunnelStatistics(QObject *parent, CaptureFile &cf);
~FunnelStatistics();
void retapPackets();
- struct progdlg *progressDialogNew(const gchar *task_title, const gchar *item_title, gboolean terminate_is_stop, gboolean *stop_flag);
+ struct progdlg *progressDialogNew(const char *task_title, const char *item_title, bool terminate_is_stop, bool *stop_flag);
const char *displayFilter();
void emitSetDisplayFilter(const QString filter);
void reloadPackets();
@@ -68,8 +68,8 @@ class FunnelAction : public QAction
Q_OBJECT
public:
FunnelAction(QObject *parent = nullptr);
- FunnelAction(QString title, funnel_menu_callback callback, gpointer callback_data, gboolean retap, QObject *parent);
- FunnelAction(QString title, funnel_packet_menu_callback callback, gpointer callback_data, gboolean retap, const char *packet_required_fields, QObject *parent);
+ FunnelAction(QString title, funnel_menu_callback callback, void *callback_data, bool retap, QObject *parent);
+ FunnelAction(QString title, funnel_packet_menu_callback callback, void *callback_data, bool retap, const char *packet_required_fields, QObject *parent);
~FunnelAction();
funnel_menu_callback callback() const;
QString title() const;
@@ -89,8 +89,8 @@ private:
QString title_;
QString packetSubmenu_;
funnel_menu_callback callback_;
- gpointer callback_data_;
- gboolean retap_;
+ void *callback_data_;
+ bool retap_;
funnel_packet_menu_callback packetCallback_;
GPtrArray* packetData_;
QSet<QString> packetRequiredFields_;
@@ -120,7 +120,7 @@ extern "C" {
void funnel_statistics_reload_menus(void);
void funnel_statistics_load_packet_menus(void);
void funnel_statistics_load_console_menus(void);
- gboolean funnel_statistics_packet_menus_modified(void);
+ bool funnel_statistics_packet_menus_modified(void);
} // extern "C"
#endif // FUNNELSTATISTICS_H
diff --git a/ui/qt/funnel_string_dialog.cpp b/ui/qt/funnel_string_dialog.cpp
index de52e73f..c8cffe09 100644
--- a/ui/qt/funnel_string_dialog.cpp
+++ b/ui/qt/funnel_string_dialog.cpp
@@ -81,7 +81,7 @@ void FunnelStringDialog::on_buttonBox_accepted()
}
g_ptr_array_add(returns, NULL);
- gchar **user_input = (gchar **)g_ptr_array_free(returns, FALSE);
+ char **user_input = (char **)g_ptr_array_free(returns, false);
dialog_cb_(user_input, dialog_cb_data_);
}
diff --git a/ui/qt/funnel_string_dialog.h b/ui/qt/funnel_string_dialog.h
index bd4f3d35..2ac277aa 100644
--- a/ui/qt/funnel_string_dialog.h
+++ b/ui/qt/funnel_string_dialog.h
@@ -10,8 +10,6 @@
#ifndef FUNNEL_STRING_DIALOG_H
#define FUNNEL_STRING_DIALOG_H
-#include <glib.h>
-
#include "epan/funnel.h"
#include <QDialog>
diff --git a/ui/qt/funnel_text_dialog.cpp b/ui/qt/funnel_text_dialog.cpp
index 84bbb941..15043926 100644
--- a/ui/qt/funnel_text_dialog.cpp
+++ b/ui/qt/funnel_text_dialog.cpp
@@ -57,17 +57,17 @@ void FunnelTextDialog::reject()
close_cb_(close_cb_data_);
}
- QHash<QObject *, funnel_bt_t*>::iterator i;
- for (i = text_button_to_funnel_button_.begin(); i != text_button_to_funnel_button_.end(); ++i) {
- funnel_bt_t *funnel_button = i.value();
- if (funnel_button->free_data_fcn) {
- funnel_button->free_data_fcn(funnel_button->data);
- }
- if (funnel_button->free_fcn) {
- funnel_button->free_fcn(funnel_button);
+ for (const auto& button : ui->buttonBox->buttons()) {
+ funnel_bt_t *funnel_button = text_button_to_funnel_button_.take(qobject_cast<QObject*>(button));
+ if (funnel_button != nullptr) {
+ if (funnel_button->free_data_fcn) {
+ funnel_button->free_data_fcn(funnel_button->data);
+ }
+ if (funnel_button->free_fcn) {
+ funnel_button->free_fcn(funnel_button);
+ }
}
}
- text_button_to_funnel_button_.clear();
disconnect();
deleteLater();
@@ -113,7 +113,7 @@ void FunnelTextDialog::setCloseCallback(text_win_close_cb_t close_cb, void *clos
close_cb_data_ = close_cb_data;
}
-void FunnelTextDialog::setTextEditable(gboolean editable)
+void FunnelTextDialog::setTextEditable(bool editable)
{
ui->textEdit->setReadOnly(!editable);
}
@@ -214,7 +214,7 @@ void text_window_set_close_cb(funnel_text_window_t *ftw, text_win_close_cb_t clo
}
}
-void text_window_set_editable(funnel_text_window_t *ftw, gboolean editable)
+void text_window_set_editable(funnel_text_window_t *ftw, bool editable)
{
if (ftw) {
ftw->funnel_text_dialog->setTextEditable(editable);
diff --git a/ui/qt/funnel_text_dialog.h b/ui/qt/funnel_text_dialog.h
index 84a313c9..19476dd3 100644
--- a/ui/qt/funnel_text_dialog.h
+++ b/ui/qt/funnel_text_dialog.h
@@ -10,8 +10,6 @@
#ifndef FUNNEL_TEXT_DIALOG_H
#define FUNNEL_TEXT_DIALOG_H
-#include <glib.h>
-
#include "epan/funnel.h"
#include "geometry_state_dialog.h"
@@ -44,7 +42,7 @@ public:
void clearText();
const char *getText();
void setCloseCallback(text_win_close_cb_t close_cb, void* close_cb_data);
- void setTextEditable(gboolean editable);
+ void setTextEditable(bool editable);
void addButton(funnel_bt_t *button_cb, QString label);
private slots:
@@ -66,7 +64,7 @@ void text_window_prepend(funnel_text_window_t* ftw, const char* text);
void text_window_clear(funnel_text_window_t *ftw);
const char *text_window_get_text(funnel_text_window_t* ftw);
void text_window_set_close_cb(funnel_text_window_t *ftw, text_win_close_cb_t close_cb, void* close_cb_data);
-void text_window_set_editable(funnel_text_window_t* ftw, gboolean editable);
+void text_window_set_editable(funnel_text_window_t* ftw, bool editable);
void text_window_destroy(funnel_text_window_t* ftw);
void text_window_add_button(funnel_text_window_t* ftw, funnel_bt_t* funnel_button, const char* label);
}
diff --git a/ui/qt/geometry_state_dialog.cpp b/ui/qt/geometry_state_dialog.cpp
index ca6d3980..28a746ee 100644
--- a/ui/qt/geometry_state_dialog.cpp
+++ b/ui/qt/geometry_state_dialog.cpp
@@ -14,7 +14,8 @@
GeometryStateDialog::~GeometryStateDialog()
{
- saveGeometry();
+ saveWindowGeometry();
+ saveSplitterState();
}
void GeometryStateDialog::loadGeometry(int width, int height, const QString &dialog_name)
@@ -23,24 +24,30 @@ void GeometryStateDialog::loadGeometry(int width, int height, const QString &dia
dialog_name_ = dialog_name.isEmpty() ? objectName() : dialog_name;
if (!dialog_name_.isEmpty() && window_geom_load(dialog_name_.toUtf8().constData(), &geom)) {
- QRect recent_geom(geom.x, geom.y, geom.width, geom.height);
+ if (geom.qt_geom == nullptr || !restoreGeometry(QByteArray::fromHex(geom.qt_geom))) {
+ // restoreGeometry didn't work, fallback to older (but other
+ // toolkit compatible?) less-accurate method. (restoreGeometry
+ // is supposed to take care of things like making sure the window
+ // is on screen, setting the non-maximized size if maximized, etc.)
+ QRect recent_geom(geom.x, geom.y, geom.width, geom.height);
- // Check if the dialog is visible on any screen
- if (rect_on_screen(recent_geom)) {
- move(recent_geom.topLeft());
- resize(recent_geom.size());
- } else {
- // Not visible, move within a reasonable area and try size only
- recent_geom.moveTopLeft(QPoint(50, 50));
+ // Check if the dialog is visible on any screen
if (rect_on_screen(recent_geom)) {
+ move(recent_geom.topLeft());
resize(recent_geom.size());
- } else if (width > 0 && height > 0) {
- // We're not visible on any screens, use defaults
- resize(width, height);
+ } else {
+ // Not visible, move within a reasonable area and try size only
+ recent_geom.moveTopLeft(QPoint(50, 50));
+ if (rect_on_screen(recent_geom)) {
+ resize(recent_geom.size());
+ } else if (width > 0 && height > 0) {
+ // We're not visible on any screens, use defaults
+ resize(width, height);
+ }
+ }
+ if (geom.maximized) {
+ showFullScreen();
}
- }
- if (geom.maximized) {
- showFullScreen();
}
} else if (width > 0 && height > 0) {
// No saved geometry found, use defaults
@@ -48,7 +55,34 @@ void GeometryStateDialog::loadGeometry(int width, int height, const QString &dia
}
}
-void GeometryStateDialog::saveGeometry()
+#ifndef Q_OS_MAC
+void GeometryStateDialog::setWindowModality(Qt::WindowModality modality)
+{
+ if (modality != windowModality()) {
+ if (modality == Qt::NonModal) {
+ setParent(nullptr, windowFlags());
+ } else {
+ setParent(parent_, windowFlags());
+ }
+ }
+ QDialog::setWindowModality(modality);
+}
+#endif
+
+void GeometryStateDialog::loadSplitterState(QSplitter *splitter)
+{
+ if (splitter == nullptr) {
+ splitter = findChild<QSplitter *>();
+ }
+ if (splitter != nullptr) {
+ const char* splitter_state = window_splitter_load(dialog_name_.toUtf8().constData());
+ if (splitter_state != nullptr) {
+ splitter->restoreState(QByteArray::fromHex(splitter_state));
+ }
+ }
+}
+
+void GeometryStateDialog::saveWindowGeometry()
{
if (dialog_name_.isEmpty())
return;
@@ -56,14 +90,27 @@ void GeometryStateDialog::saveGeometry()
window_geometry_t geom;
geom.key = NULL;
- geom.set_pos = TRUE;
+ geom.set_pos = true;
geom.x = pos().x();
geom.y = pos().y();
- geom.set_size = TRUE;
+ geom.set_size = true;
geom.width = size().width();
geom.height = size().height();
- geom.set_maximized = TRUE;
+ geom.set_maximized = true;
+ // XXX: maximized and fullScreen are different window states; we've been
+ // using the maximized key for fullScreen ever since this was added.
geom.maximized = isFullScreen();
+ geom.qt_geom = g_strdup(saveGeometry().toHex().constData());
window_geom_save(dialog_name_.toUtf8().constData(), &geom);
}
+
+void GeometryStateDialog::saveSplitterState(const QSplitter *splitter)
+{
+ if (splitter == nullptr) {
+ splitter = findChild<QSplitter *>();
+ }
+ if (splitter != nullptr) {
+ window_splitter_save(dialog_name_.toUtf8().constData(), splitter->saveState().toHex().constData());
+ }
+}
diff --git a/ui/qt/geometry_state_dialog.h b/ui/qt/geometry_state_dialog.h
index 613fad8a..15f0af63 100644
--- a/ui/qt/geometry_state_dialog.h
+++ b/ui/qt/geometry_state_dialog.h
@@ -11,6 +11,7 @@
#define GEOMETRY_STATE_DIALOG_H
#include <QDialog>
+#include <QSplitter>
class GeometryStateDialog : public QDialog
{
@@ -44,24 +45,51 @@ public:
//
// Additionally, maximized, parent-less dialogs can close to a black screen
// on macOS: https://gitlab.com/wireshark/wireshark/-/issues/12544
+// (aka https://bugreports.qt.io/browse/QTBUG-46701 ), which claims to
+// be fixed in Qt 6.2.0
//
// Pass in the parent on macOS and NULL elsewhere so that we have an
// independent window that un-maximizes correctly.
+//
+// Pass Qt::Window as the flags that we have minimize and maximize buttons, as
+// this class is for dialogs where we want to remember user-set geometry.
+// (We're still at the mercy of the platform and Qt, e.g. recent GNOME defaults
+// to not having min or max buttons, instead requiring right-clicking on the
+// menu title bar to perform the minimize or maximize actions. We can't do
+// anything about that, though users can.)
+//
+// However, we want modal dialogs to always be on top of their parent.
+// On Linux with Mutter (and maybe some other window managers), an orphan
+// ApplicationModal dialog is not always on top, and it's confusing if a
+// modal dialog is behind other windows it blocks (Issue #19099). On Windows,
+// a modal orphan dialog is always on top, but setting the parent adds effects
+// like causing the modal dialog to shake if the blocked parent is clicked.
+// So when setting the dialog modal, set the parent if we haven't yet.
#ifdef Q_OS_MAC
- explicit GeometryStateDialog(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags()) : QDialog(parent, f) {}
+ explicit GeometryStateDialog(QWidget *parent, Qt::WindowFlags f = Qt::Window) : QDialog(parent, f) {}
#else
- explicit GeometryStateDialog(QWidget *, Qt::WindowFlags f = Qt::WindowFlags()) : QDialog(NULL, f) {}
+ explicit GeometryStateDialog(QWidget *parent, Qt::WindowFlags f = Qt::Window) : QDialog(NULL, f), parent_(parent) {}
#endif
~GeometryStateDialog();
+#ifndef Q_OS_MAC
+public:
+ void setWindowModality(Qt::WindowModality windowModality);
+#endif
+
protected:
void loadGeometry(int width = 0, int height = 0, const QString &dialog_name = QString());
+ void loadSplitterState(QSplitter *splitter = nullptr);
private:
- void saveGeometry();
+ void saveWindowGeometry();
+ void saveSplitterState(const QSplitter *splitter = nullptr);
QString dialog_name_;
+#ifndef Q_OS_MAC
+ QWidget *parent_;
+#endif
};
#endif // GEOMETRY_STATE_DIALOG_H
diff --git a/ui/qt/glib_mainloop_on_qeventloop.cpp b/ui/qt/glib_mainloop_on_qeventloop.cpp
index f715bbc7..c92901b5 100644
--- a/ui/qt/glib_mainloop_on_qeventloop.cpp
+++ b/ui/qt/glib_mainloop_on_qeventloop.cpp
@@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
+#include <glib.h>
+
#include <QTimer>
#include "glib_mainloop_on_qeventloop.h"
@@ -24,7 +26,7 @@ GLibPoller::~GLibPoller()
void GLibPoller::run()
{
- gint timeout;
+ int timeout;
mutex_.lock();
while (!isInterruptionRequested())
diff --git a/ui/qt/glib_mainloop_on_qeventloop.h b/ui/qt/glib_mainloop_on_qeventloop.h
index 9f66c681..9a641e04 100644
--- a/ui/qt/glib_mainloop_on_qeventloop.h
+++ b/ui/qt/glib_mainloop_on_qeventloop.h
@@ -11,7 +11,6 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
-#include <glib.h>
class GLibPoller : public QThread
{
@@ -26,9 +25,9 @@ protected:
QMutex mutex_;
QWaitCondition dispatched_;
GMainContext *ctx_;
- gint priority_;
+ int priority_;
GPollFD *fds_;
- gint allocated_fds_, nfds_;
+ int allocated_fds_, nfds_;
signals:
void polled(void);
diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp
index 3652c7c7..acdcd48b 100644
--- a/ui/qt/gsm_map_summary_dialog.cpp
+++ b/ui/qt/gsm_map_summary_dialog.cpp
@@ -16,8 +16,6 @@
#include "config.h"
-#include <glib.h>
-
#include "ui/summary.h"
#include <epan/packet.h>
diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp
index 7e3fb82e..dfac2ee7 100644
--- a/ui/qt/iax2_analysis_dialog.cpp
+++ b/ui/qt/iax2_analysis_dialog.cpp
@@ -134,7 +134,7 @@ public:
}
}
- guint32 frameNum() { return frame_num_; }
+ uint32_t frameNum() { return frame_num_; }
bool frameStatus() { return ok_; }
QList<QVariant> rowData() {
@@ -153,19 +153,14 @@ public:
switch (treeWidget()->sortColumn()) {
case (packet_col_):
return frame_num_ < other_row->frame_num_;
- break;
case (delta_col_):
return delta_ < other_row->delta_;
- break;
case (jitter_col_):
return jitter_ < other_row->jitter_;
- break;
case (bandwidth_col_):
return bandwidth_ < other_row->bandwidth_;
- break;
case (length_col_):
return pkt_len_ < other_row->pkt_len_;
- break;
default:
break;
}
@@ -174,9 +169,9 @@ public:
return QTreeWidgetItem::operator <(other);
}
private:
- guint32 frame_num_;
- guint32 pkt_len_;
- guint32 flags_;
+ uint32_t frame_num_;
+ uint32_t pkt_len_;
+ uint32_t flags_;
double delta_;
double jitter_;
double bandwidth_;
@@ -228,6 +223,9 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) :
this, SLOT(graphClicked(QMouseEvent*)));
graph_ctx_menu_.addAction(ui->actionSaveGraph);
+ ui->streamGraph->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(ui->streamGraph, &QCustomPlot::customContextMenuRequested, this,
+ &Iax2AnalysisDialog::showGraphMenu);
QStringList header_labels;
for (int i = 0; i < ui->forwardTreeWidget->columnCount(); i++) {
@@ -289,9 +287,9 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) :
#if 0
/* Only accept Voice or MiniPacket packets */
- const gchar filter_text[] = "iax2.call && (ip || ipv6)";
+ const char filter_text[] = "iax2.call && (ip || ipv6)";
#else
- const gchar filter_text[] = "iax2 && (ip || ipv6)";
+ const char filter_text[] = "iax2 && (ip || ipv6)";
#endif
dfilter_t *sfcode;
df_error_t *df_err;
@@ -318,7 +316,7 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) :
epan_dissect_t edt;
- epan_dissect_init(&edt, cap_file_.capFile()->epan, TRUE, FALSE);
+ epan_dissect_init(&edt, cap_file_.capFile()->epan, true, false);
epan_dissect_prime_with_dfilter(&edt, sfcode);
epan_dissect_run(&edt, cap_file_.capFile()->cd_t, &cap_file_.capFile()->rec,
frame_tvbuff_new_buffer(&cap_file_.capFile()->provider, fdata, &cap_file_.capFile()->buf),
@@ -337,10 +335,10 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) :
dfilter_free(sfcode);
/* ok, it is a IAX2 frame, so let's get the ip and port values */
- rtpstream_id_copy_pinfo(&(edt.pi),&(fwd_id_),FALSE);
+ rtpstream_id_copy_pinfo(&(edt.pi),&(fwd_id_),false);
/* assume the inverse ip/port combination for the reverse direction */
- rtpstream_id_copy_pinfo(&(edt.pi),&(rev_id_),TRUE);
+ rtpstream_id_copy_pinfo(&(edt.pi),&(rev_id_),true);
epan_dissect_cleanup(&edt);
@@ -652,8 +650,8 @@ void Iax2AnalysisDialog::resetStatistics()
memset(&fwd_statinfo_, 0, sizeof(fwd_statinfo_));
memset(&rev_statinfo_, 0, sizeof(rev_statinfo_));
- fwd_statinfo_.first_packet = TRUE;
- rev_statinfo_.first_packet = TRUE;
+ fwd_statinfo_.first_packet = true;
+ rev_statinfo_.first_packet = true;
fwd_statinfo_.reg_pt = PT_UNDEFINED;
rev_statinfo_.reg_pt = PT_UNDEFINED;
@@ -703,17 +701,17 @@ void Iax2AnalysisDialog::addPacket(bool forward, packet_info *pinfo, const struc
}
// iax2_analysis.c:rtp_packet_save_payload
-const guint8 silence_pcmu_ = 0xff;
-const guint8 silence_pcma_ = 0x55;
+const uint8_t silence_pcmu_ = 0xff;
+const uint8_t silence_pcma_ = 0x55;
void Iax2AnalysisDialog::savePayload(QTemporaryFile *tmpfile, packet_info *pinfo, const struct _iax2_info_t *iax2info)
{
/* Is this the first packet we got in this direction? */
// if (statinfo->flags & STAT_FLAG_FIRST) {
// if (saveinfo->fp == NULL) {
-// saveinfo->saved = FALSE;
+// saveinfo->saved = false;
// saveinfo->error_type = TAP_RTP_FILE_OPEN_ERROR;
// } else {
-// saveinfo->saved = TRUE;
+// saveinfo->saved = true;
// }
// }
@@ -896,9 +894,9 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
}
QFile save_file(file_path);
- gint16 sample;
- guint8 pd[4];
- gboolean stop_flag = FALSE;
+ int16_t sample;
+ uint8_t pd[4];
+ bool stop_flag = false;
qint64 nchars;
save_file.open(QIODevice::WriteOnly);
@@ -1009,16 +1007,16 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
case dir_both_:
{
char f_rawvalue, r_rawvalue;
- guint32 f_write_silence = 0;
- guint32 r_write_silence = 0;
+ uint32_t f_write_silence = 0;
+ uint32_t r_write_silence = 0;
/* since conversation in one way can start later than in the other one,
* we have to write some silence information for one channel */
if (fwd_statinfo_.start_time > rev_statinfo_.start_time) {
- f_write_silence = (guint32)
+ f_write_silence = (uint32_t)
((fwd_statinfo_.start_time - rev_statinfo_.start_time)
* (8000/1000));
} else if (fwd_statinfo_.start_time < rev_statinfo_.start_time) {
- r_write_silence = (guint32)
+ r_write_silence = (uint32_t)
((rev_statinfo_.start_time - fwd_statinfo_.start_time)
* (8000/1000));
}
@@ -1222,16 +1220,14 @@ bool Iax2AnalysisDialog::eventFilter(QObject *, QEvent *event)
return false;
}
-void Iax2AnalysisDialog::graphClicked(QMouseEvent *event)
+void Iax2AnalysisDialog::showGraphMenu(const QPoint &pos)
+{
+ graph_ctx_menu_.popup(ui->streamGraph->mapToGlobal(pos));
+}
+
+void Iax2AnalysisDialog::graphClicked(QMouseEvent *)
{
updateWidgets();
- if (event->button() == Qt::RightButton) {
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- graph_ctx_menu_.popup(event->globalPosition().toPoint());
-#else
- graph_ctx_menu_.popup(event->globalPos());
-#endif
- }
}
void Iax2AnalysisDialog::showStreamMenu(QPoint pos)
diff --git a/ui/qt/iax2_analysis_dialog.h b/ui/qt/iax2_analysis_dialog.h
index c6daedd0..b1d40331 100644
--- a/ui/qt/iax2_analysis_dialog.h
+++ b/ui/qt/iax2_analysis_dialog.h
@@ -17,8 +17,6 @@
#include <config.h>
-#include <glib.h>
-
#include <epan/address.h>
#include "ui/tap-iax2-analysis.h"
@@ -74,6 +72,7 @@ private slots:
void on_actionSaveGraph_triggered();
void on_buttonBox_helpRequested();
void showStreamMenu(QPoint pos);
+ void showGraphMenu(const QPoint &pos);
void graphClicked(QMouseEvent *event);
private:
@@ -120,8 +119,8 @@ private:
void saveCsv(StreamDirection direction);
#if 0
- guint32 processNode(proto_node *ptree_node, header_field_info *hfinformation, const gchar* proto_field, bool *ok);
- guint32 getIntFromProtoTree(proto_tree *protocol_tree, const gchar *proto_name, const gchar *proto_field, bool *ok);
+ uint32_t processNode(proto_node *ptree_node, header_field_info *hfinformation, const char* proto_field, bool *ok);
+ uint32_t getIntFromProtoTree(proto_tree *protocol_tree, const char *proto_name, const char *proto_field, bool *ok);
#endif
bool eventFilter(QObject*, QEvent* event);
diff --git a/ui/qt/import_text_dialog.cpp b/ui/qt/import_text_dialog.cpp
index 0916c417..17c1734d 100644
--- a/ui/qt/import_text_dialog.cpp
+++ b/ui/qt/import_text_dialog.cpp
@@ -14,8 +14,6 @@
#include "wiretap/wtap.h"
#include "wiretap/pcap-encap.h"
-#include <epan/prefs.h>
-
#include "ui/text_import_scanner.h"
#include "ui/util.h"
#include "ui/alert_box.h"
@@ -26,8 +24,8 @@
#include "wsutil/file_util.h"
#include "wsutil/inet_addr.h"
#include "wsutil/time_util.h"
-#include "wsutil/tempfile.h"
#include "wsutil/filesystem.h"
+#include <wsutil/array.h>
#include <ui_import_text_dialog.h>
#include "main_application.h"
@@ -127,7 +125,7 @@ ImportTextDialog::ImportTextDialog(QWidget *parent) :
{"Plain bin", ENCODING_PLAIN_BIN},
{"Base 64", ENCODING_BASE64}
};
- for (i = 0; i < (int) (sizeof(encodings) / sizeof(encodings[0])); ++i) {
+ for (i = 0; i < (int)array_length(encodings); ++i) {
ti_ui_->dataEncodingComboBox->addItem(encodings[i].name, QVariant(encodings[i].id));
}
@@ -185,7 +183,7 @@ ImportTextDialog::~ImportTextDialog()
void ImportTextDialog::loadSettingsFile()
{
- QFileInfo fileInfo(gchar_free_to_qstring(get_profile_dir(get_profile_name(), FALSE)), QString(SETTINGS_FILE));
+ QFileInfo fileInfo(gchar_free_to_qstring(get_profile_dir(get_profile_name(), false)), QString(SETTINGS_FILE));
QFile loadFile(fileInfo.filePath());
if (!fileInfo.exists() || !fileInfo.isFile()) {
@@ -202,7 +200,7 @@ void ImportTextDialog::loadSettingsFile()
void ImportTextDialog::saveSettingsFile()
{
- QFileInfo fileInfo(gchar_free_to_qstring(get_profile_dir(get_profile_name(), FALSE)), QString(SETTINGS_FILE));
+ QFileInfo fileInfo(gchar_free_to_qstring(get_profile_dir(get_profile_name(), false)), QString(SETTINGS_FILE));
QFile saveFile(fileInfo.filePath());
if (fileInfo.exists() && !fileInfo.isFile()) {
@@ -407,7 +405,7 @@ int ImportTextDialog::exec() {
char* tmp;
GError* gerror = NULL;
int err;
- gchar *err_info;
+ char *err_info;
wtap_dump_params params;
int file_type_subtype;
QString interface_name;
@@ -427,10 +425,12 @@ int ImportTextDialog::exec() {
import_info_.import_text_filename = qstring_strdup(ti_ui_->textFileLineEdit->text());
import_info_.timestamp_format = qstring_strdup(ti_ui_->timestampFormatLineEdit->text());
if (strlen(import_info_.timestamp_format) == 0) {
- g_free((gpointer) import_info_.timestamp_format);
+ g_free((void *) import_info_.timestamp_format);
import_info_.timestamp_format = NULL;
}
+ mainApp->setLastOpenDirFromFilename(QString(import_info_.import_text_filename));
+
switch (import_info_.mode) {
default: /* should never happen */
setResult(QDialog::Rejected);
@@ -438,7 +438,7 @@ int ImportTextDialog::exec() {
case TEXT_IMPORT_HEXDUMP:
import_info_.hexdump.import_text_FILE = ws_fopen(import_info_.import_text_filename, "rb");
if (!import_info_.hexdump.import_text_FILE) {
- open_failure_alert_box(import_info_.import_text_filename, errno, FALSE);
+ open_failure_alert_box(import_info_.import_text_filename, errno, false);
setResult(QDialog::Rejected);
goto cleanup_mode;
}
@@ -452,7 +452,7 @@ int ImportTextDialog::exec() {
case TEXT_IMPORT_REGEX:
import_info_.regex.import_text_GMappedFile = g_mapped_file_new(import_info_.import_text_filename, true, &gerror);
if (gerror) {
- open_failure_alert_box(import_info_.import_text_filename, gerror->code, FALSE);
+ open_failure_alert_box(import_info_.import_text_filename, gerror->code, false);
g_error_free(gerror);
setResult(QDialog::Rejected);
goto cleanup_mode;
@@ -539,7 +539,7 @@ int ImportTextDialog::exec() {
wtap_free_idb_info(params.idb_inf);
wtap_dump_params_cleanup(&params);
g_free(tmp);
- g_free((gpointer) import_info_.payload);
+ g_free((void *) import_info_.payload);
switch (import_info_.mode) {
case TEXT_IMPORT_HEXDUMP:
fclose(import_info_.hexdump.import_text_FILE);
@@ -547,13 +547,13 @@ int ImportTextDialog::exec() {
case TEXT_IMPORT_REGEX:
g_mapped_file_unref(import_info_.regex.import_text_GMappedFile);
g_regex_unref((GRegex*) import_info_.regex.format);
- g_free((gpointer) import_info_.regex.in_indication);
- g_free((gpointer) import_info_.regex.out_indication);
+ g_free((void *) import_info_.regex.in_indication);
+ g_free((void *) import_info_.regex.out_indication);
break;
}
cleanup_mode:
- g_free((gpointer) import_info_.import_text_filename);
- g_free((gpointer) import_info_.timestamp_format);
+ g_free((void *) import_info_.import_text_filename);
+ g_free((void *) import_info_.timestamp_format);
return result();
}
@@ -606,26 +606,7 @@ void ImportTextDialog::on_textFileBrowseButton_clicked()
if (ti_ui_->textFileLineEdit->text().length() > 0) {
open_dir = ti_ui_->textFileLineEdit->text();
} else {
- switch (prefs.gui_fileopen_style) {
-
- case FO_STYLE_LAST_OPENED:
- /* The user has specified that we should start out in the last directory
- we looked in. If we've already opened a file, use its containing
- directory, if we could determine it, as the directory, otherwise
- use the "last opened" directory saved in the preferences file if
- there was one. */
- /* This is now the default behaviour in file_selection_new() */
- open_dir = get_open_dialog_initial_dir();
- break;
-
- case FO_STYLE_SPECIFIED:
- /* The user has specified that we should always start out in a
- specified directory; if they've specified that directory,
- start out by showing the files in that dir. */
- if (prefs.gui_fileopen_dir[0] != '\0')
- open_dir = prefs.gui_fileopen_dir;
- break;
- }
+ open_dir = get_open_dialog_initial_dir();
}
QString file_name = WiresharkFileDialog::getOpenFileName(this, mainApp->windowTitleString(tr("Import Text File")), open_dir);
@@ -637,7 +618,7 @@ bool ImportTextDialog::checkDateTimeFormat(const QString &time_format)
/* nonstandard is f for fractions of seconds */
const QString valid_code = "aAbBcdDFfHIjmMpsSTUwWxXyYzZ%";
int idx = 0;
- int ret = false;
+ bool ret = false;
/* XXX: Temporary(?) hack to allow ISO format time, a checkbox is
* probably better */
@@ -742,7 +723,7 @@ void ImportTextDialog::on_asciiIdentificationCheckBox_toggled(bool checked)
void ImportTextDialog::on_regexTextEdit_textChanged()
{
- gchar* regex_gchar_p = qstring_strdup(ti_ui_->regexTextEdit->toPlainText());;
+ char* regex_gchar_p = qstring_strdup(ti_ui_->regexTextEdit->toPlainText());
GError* gerror = NULL;
/* TODO: Use GLib's c++ interface or enable C++ int to enum casting
* because the flags are declared as enum, so we can't pass 0 like
@@ -953,7 +934,7 @@ void ImportTextDialog::on_ipVersionComboBox_currentIndexChanged(int index)
on_destinationAddressLineEdit_textChanged(ti_ui_->destinationAddressLineEdit->text());
}
-void ImportTextDialog::check_line_edit(SyntaxLineEdit *le, bool &ok_enabled, const QString &num_str, int base, guint max_val, bool is_short, guint *val_ptr) {
+void ImportTextDialog::check_line_edit(SyntaxLineEdit *le, bool &ok_enabled, const QString &num_str, int base, unsigned max_val, bool is_short, unsigned *val_ptr) {
bool conv_ok;
SyntaxLineEdit::SyntaxState syntax_state = SyntaxLineEdit::Empty;
@@ -967,7 +948,7 @@ void ImportTextDialog::check_line_edit(SyntaxLineEdit *le, bool &ok_enabled, con
if (is_short) {
*val_ptr = num_str.toUShort(&conv_ok, base);
} else {
- *val_ptr = (guint)num_str.toULong(&conv_ok, base);
+ *val_ptr = (unsigned)num_str.toULong(&conv_ok, base);
}
if (conv_ok && *val_ptr <= max_val) {
syntax_state = SyntaxLineEdit::Valid;
diff --git a/ui/qt/import_text_dialog.h b/ui/qt/import_text_dialog.h
index ac9537d9..d2fe13cb 100644
--- a/ui/qt/import_text_dialog.h
+++ b/ui/qt/import_text_dialog.h
@@ -14,8 +14,6 @@
#include <stdio.h>
-#include <glib.h>
-
#include "ui/text_import.h"
#include <ui/qt/widgets/syntax_line_edit.h>
@@ -44,7 +42,7 @@ private:
/* regex fields */
void enableFieldWidgets(bool enable_direction_input = true, bool enable_time_input = true);
- void check_line_edit(SyntaxLineEdit *le, bool &ok_enable, const QString &num_str, int base, guint max_val, bool is_short, guint *val_ptr);
+ void check_line_edit(SyntaxLineEdit *le, bool &ok_enable, const QString &num_str, int base, unsigned max_val, bool is_short, unsigned *val_ptr);
void checkAddress(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in4_addr *val_ptr);
void checkIPv6Address(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in6_addr *val_ptr);
bool checkDateTimeFormat(const QString &time_format);
diff --git a/ui/qt/interface_frame.cpp b/ui/qt/interface_frame.cpp
index b1f34b22..ba2d42e0 100644
--- a/ui/qt/interface_frame.cpp
+++ b/ui/qt/interface_frame.cpp
@@ -32,6 +32,7 @@
#include <ui/recent.h>
#include "capture_opts.h"
#include "ui/capture_globals.h"
+#include <ui/iface_lists.h>
#include <wsutil/utf8_entities.h>
#include <QDesktopServices>
@@ -41,6 +42,8 @@
#include <QLabel>
#include <QPushButton>
#include <QUrl>
+#include <QMutex>
+#include <QDebug>
#include <epan/prefs.h>
@@ -51,6 +54,8 @@ const int stat_update_interval_ = 1000; // ms
#endif
const char *no_capture_link = "#no_capture";
+static QMutex scan_mutex;
+
InterfaceFrame::InterfaceFrame(QWidget * parent)
: QFrame(parent),
ui(new Ui::InterfaceFrame)
@@ -205,6 +210,27 @@ void InterfaceFrame::showEvent(QShowEvent *) {
#endif // HAVE_LIBPCAP
}
+#ifdef HAVE_LIBPCAP
+void InterfaceFrame::scanLocalInterfaces(GList *filter_list)
+{
+ GList *if_list = NULL;
+ if (scan_mutex.tryLock()) {
+ if (isVisible()) {
+ source_model_.stopStatistic();
+ if_stat_cache_t * stat_cache = capture_interface_stat_start(&global_capture_opts, &if_list);
+ source_model_.setCache(stat_cache);
+ }
+ mainApp->setInterfaceList(if_list);
+ free_interface_list(if_list);
+ scan_local_interfaces_filtered(filter_list, main_window_update);
+ mainApp->emitAppSignal(MainApplication::LocalInterfacesChanged);
+ scan_mutex.unlock();
+ } else {
+ qDebug() << "scan mutex locked, can't scan interfaces";
+ }
+}
+#endif // HAVE_LIBPCAP
+
void InterfaceFrame::actionButton_toggled(bool checked)
{
QVariant ifType = sender()->property(BTN_IFTYPE_PROPERTY);
@@ -422,7 +448,7 @@ void InterfaceFrame::on_interfaceTree_doubleClicked(const QModelIndex &index)
interfaces << device_name;
/* We trust the string here. If this interface is really extcap, the string is
- * being checked immediatly before the dialog is being generated */
+ * being checked immediately before the dialog is being generated */
if (extcap_string.length() > 0)
{
/* this checks if configuration is required and not yet provided or saved via prefs */
@@ -454,7 +480,7 @@ void InterfaceFrame::on_interfaceTree_clicked(const QModelIndex &index)
QString extcap_string = source_model_.getColumnContent(realIndex.row(), IFTREE_COL_EXTCAP_PATH).toString();
/* We trust the string here. If this interface is really extcap, the string is
- * being checked immediatly before the dialog is being generated */
+ * being checked immediately before the dialog is being generated */
if (extcap_string.length() > 0)
{
/* this checks if configuration is required and not yet provided or saved via prefs */
@@ -534,7 +560,7 @@ void InterfaceFrame::showContextMenu(QPoint pos)
void InterfaceFrame::on_warningLabel_linkActivated(const QString &link)
{
if (link.compare(no_capture_link) == 0) {
- recent.sys_warn_if_no_capture = FALSE;
+ recent.sys_warn_if_no_capture = false;
resetInterfaceTreeDisplay();
} else {
QDesktopServices::openUrl(QUrl(link));
diff --git a/ui/qt/interface_frame.h b/ui/qt/interface_frame.h
index f36ce945..211350e7 100644
--- a/ui/qt/interface_frame.h
+++ b/ui/qt/interface_frame.h
@@ -15,8 +15,6 @@
#include <config.h>
-#include <glib.h>
-
#include <ui/qt/models/info_proxy_model.h>
#include <ui/qt/models/interface_tree_model.h>
#include <ui/qt/models/interface_sort_filter_model.h>
@@ -52,6 +50,9 @@ Q_SIGNALS:
void typeSelectionChanged();
public slots:
+#ifdef HAVE_LIBPCAP
+ void scanLocalInterfaces(GList *filter_list = nullptr);
+#endif
void updateSelectedInterfaces();
void interfaceListChanged();
void toggleHiddenInterfaces();
diff --git a/ui/qt/interface_toolbar.cpp b/ui/qt/interface_toolbar.cpp
index be2cde66..e4472d8c 100644
--- a/ui/qt/interface_toolbar.cpp
+++ b/ui/qt/interface_toolbar.cpp
@@ -79,7 +79,7 @@ InterfaceToolbar::InterfaceToolbar(QWidget *parent, const iface_toolbar *toolbar
// Fill inn interfaces list and initialize default interface values
for (GList *walker = toolbar->ifnames; walker; walker = walker->next)
{
- QString ifname((gchar *)walker->data);
+ QString ifname((char *)walker->data);
interface_[ifname].reader_thread = NULL;
interface_[ifname].out_fd = -1;
}
@@ -193,14 +193,14 @@ QWidget *InterfaceToolbar::createCheckbox(iface_toolbar_control *control)
QWidget *InterfaceToolbar::createButton(iface_toolbar_control *control)
{
- QPushButton *button = new QPushButton(QString().fromUtf8((gchar *)control->display));
+ QPushButton *button = new QPushButton(QString().fromUtf8((char *)control->display));
button->setMaximumHeight(27);
button->setToolTip(QString().fromUtf8(control->tooltip));
switch (control->ctrl_role)
{
case INTERFACE_ROLE_CONTROL:
- setDefaultValue(control->num, (gchar *)control->display);
+ setDefaultValue(control->num, (char *)control->display);
connect(button, SIGNAL(clicked()), this, SLOT(onControlButtonClicked()));
break;
@@ -242,13 +242,13 @@ QWidget *InterfaceToolbar::createSelector(iface_toolbar_control *control)
for (GList *walker = control->values; walker; walker = walker->next)
{
iface_toolbar_value *val = (iface_toolbar_value *)walker->data;
- QString value = QString().fromUtf8((gchar *)val->value);
+ QString value = QString().fromUtf8((char *)val->value);
if (value.isEmpty())
{
// Invalid value
continue;
}
- QString display = QString().fromUtf8((gchar *)val->display);
+ QString display = QString().fromUtf8((char *)val->display);
QByteArray interface_value;
interface_value.append(value.toUtf8());
@@ -746,7 +746,7 @@ void InterfaceToolbar::startCapture(GArray *ifaces)
QString first_capturing_ifname;
bool selected_found = false;
- for (guint i = 0; i < ifaces->len; i++)
+ for (unsigned i = 0; i < ifaces->len; i++)
{
interface_options *interface_opts = &g_array_index(ifaces, interface_options, i);
QString ifname(interface_opts->name);
@@ -774,7 +774,7 @@ void InterfaceToolbar::startCapture(GArray *ifaces)
// The control out pipe will close when both out_fd and extcap_control_out_h are closed.
HANDLE duplicate_out_handle = INVALID_HANDLE_VALUE;
if (!DuplicateHandle(GetCurrentProcess(), interface_opts->extcap_control_out_h,
- GetCurrentProcess(), &duplicate_out_handle, 0, TRUE, DUPLICATE_SAME_ACCESS))
+ GetCurrentProcess(), &duplicate_out_handle, 0, true, DUPLICATE_SAME_ACCESS))
{
simple_dialog_async(ESD_TYPE_ERROR, ESD_BTN_OK,
"Failed to duplicate extcap control out handle: %s\n.",
@@ -962,7 +962,7 @@ void InterfaceToolbar::interfaceListChanged()
ui->interfacesComboBox->blockSignals(true);
ui->interfacesComboBox->clear();
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++)
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++)
{
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (device->hidden)
diff --git a/ui/qt/interface_toolbar.h b/ui/qt/interface_toolbar.h
index f9879fa2..fc20c197 100644
--- a/ui/qt/interface_toolbar.h
+++ b/ui/qt/interface_toolbar.h
@@ -10,8 +10,6 @@
#ifndef INTERFACE_TOOLBAR_H
#define INTERFACE_TOOLBAR_H
-#include <glib.h>
-
#include "ui/iface_toolbar.h"
#include "funnel_text_dialog.h"
#include "interface_toolbar_reader.h"
diff --git a/ui/qt/interface_toolbar_reader.cpp b/ui/qt/interface_toolbar_reader.cpp
index d12f7472..6b5c1f1a 100644
--- a/ui/qt/interface_toolbar_reader.cpp
+++ b/ui/qt/interface_toolbar_reader.cpp
@@ -34,7 +34,7 @@ int InterfaceToolbarReader::async_pipe_read(void *data, int nbyte)
int bytes_read = -1;
overlap.Pointer = 0;
- overlap.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ overlap.hEvent = CreateEvent(NULL, true, false, NULL);
if (overlap.hEvent == NULL)
{
// CreateEvent failed with error code GetLastError()
@@ -54,7 +54,7 @@ int InterfaceToolbarReader::async_pipe_read(void *data, int nbyte)
if (WaitForSingleObject(overlap.hEvent, INFINITE) == WAIT_OBJECT_0)
{
// The wait operation has completed.
- success = GetOverlappedResult(control_in_, &overlap, &nof_bytes_read, FALSE);
+ success = GetOverlappedResult(control_in_, &overlap, &nof_bytes_read, false);
if (success && nof_bytes_read != 0)
{
diff --git a/ui/qt/io_console_dialog.cpp b/ui/qt/io_console_dialog.cpp
index 92d4c542..600a544b 100644
--- a/ui/qt/io_console_dialog.cpp
+++ b/ui/qt/io_console_dialog.cpp
@@ -44,6 +44,7 @@ IOConsoleDialog::IOConsoleDialog(QWidget &parent,
title = QString("Console");
loadGeometry(0, 0, title);
+ loadSplitterState(ui->splitter);
setWindowTitle(mainApp->windowTitleString(title));
QPushButton *eval_button = ui->buttonBox->addButton(tr("Evaluate"), QDialogButtonBox::ActionRole);
diff --git a/ui/qt/io_graph_action.cpp b/ui/qt/io_graph_action.cpp
new file mode 100644
index 00000000..777f87b1
--- /dev/null
+++ b/ui/qt/io_graph_action.cpp
@@ -0,0 +1,134 @@
+/* @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "io_graph_action.h"
+
+#include <ui/qt/main_application.h>
+#include <ui/qt/main_window.h>
+#include <ui/qt/io_graph_dialog.h>
+#include <ui/qt/utils/field_information.h>
+
+#include <ui/io_graph_item.h>
+
+#include <wsutil/filesystem.h>
+
+#include <QMenu>
+
+IOGraphAction::IOGraphAction(QObject *parent, io_graph_item_unit_t unit, QString field) :
+ QAction(parent),
+ unit_(unit),
+ field_(field)
+{
+ setText(unitName(unit));
+ connect(this, &QAction::triggered, [&](){ emit openIOGraphDialog(unit_, field_); });
+}
+
+const QString IOGraphAction::unitName(io_graph_item_unit_t unit) {
+ switch (unit) {
+ case IOG_ITEM_UNIT_PACKETS:
+ if (is_packet_configuration_namespace()) {
+ return QObject::tr("PACKETS");
+ }
+ return QObject::tr("EVENTS");
+ case IOG_ITEM_UNIT_BYTES:
+ return QObject::tr("BYTES");
+ case IOG_ITEM_UNIT_BITS:
+ return QObject::tr("BITS");
+ case IOG_ITEM_UNIT_CALC_FRAMES:
+ return QObject::tr("COUNT FRAMES");
+ case IOG_ITEM_UNIT_CALC_FIELDS:
+ return QObject::tr("COUNT FIELDS");
+ case IOG_ITEM_UNIT_CALC_SUM:
+ return QObject::tr("SUM");
+ case IOG_ITEM_UNIT_CALC_MAX:
+ return QObject::tr("MAX");
+ case IOG_ITEM_UNIT_CALC_MIN:
+ return QObject::tr("MIN");
+ case IOG_ITEM_UNIT_CALC_AVERAGE:
+ return QObject::tr("AVERAGE");
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
+ return QObject::tr("THROUGHPUT");
+ case IOG_ITEM_UNIT_CALC_LOAD:
+ return QObject::tr("LOAD");
+ default:
+ return QObject::tr("UNKNOWN");
+ }
+}
+
+QList<io_graph_item_unit_t> IOGraphAction::unitTypes(const FieldInformation::HeaderInfo& headerinfo)
+{
+ static const QList<io_graph_item_unit_t> simple_types_ = QList<io_graph_item_unit_t>()
+ << IOG_ITEM_UNIT_CALC_FRAMES
+ << IOG_ITEM_UNIT_CALC_FIELDS;
+
+ static const QList<io_graph_item_unit_t> number_types_ = QList<io_graph_item_unit_t>()
+ << IOG_ITEM_UNIT_CALC_SUM
+ << IOG_ITEM_UNIT_CALC_FRAMES
+ << IOG_ITEM_UNIT_CALC_FIELDS
+ << IOG_ITEM_UNIT_CALC_MAX
+ << IOG_ITEM_UNIT_CALC_MIN
+ << IOG_ITEM_UNIT_CALC_THROUGHPUT
+ << IOG_ITEM_UNIT_CALC_AVERAGE;
+
+ static const QList<io_graph_item_unit_t> time_types_ = QList<io_graph_item_unit_t>(number_types_)
+ << IOG_ITEM_UNIT_CALC_LOAD;
+
+ switch (headerinfo.type) {
+ case FT_UINT8:
+ case FT_UINT16:
+ case FT_UINT24:
+ case FT_UINT32:
+ case FT_UINT64:
+ case FT_INT8:
+ case FT_INT16:
+ case FT_INT24:
+ case FT_INT32:
+ case FT_INT64:
+ case FT_FLOAT:
+ case FT_DOUBLE:
+ return number_types_;
+ case FT_RELATIVE_TIME:
+ return time_types_;
+ default:
+ return simple_types_;
+ }
+}
+
+QMenu * IOGraphAction::createMenu(const FieldInformation::HeaderInfo& headerinfo, QWidget * parent)
+{
+ MainWindow *mw(nullptr);
+ if (mainApp)
+ {
+ QWidget * mainWin = mainApp->mainWindow();
+ if (qobject_cast<MainWindow *>(mainWin)) {
+ mw = qobject_cast<MainWindow *>(mainWin);
+ }
+ }
+
+ QString title("I/O Graph");
+ QMenu * submenu = new QMenu(title, parent);
+
+ int one_em = submenu->fontMetrics().height();
+ QString prep_text = QString("%1: %2").arg(title).arg(headerinfo.abbreviation);
+ prep_text = submenu->fontMetrics().elidedText(prep_text, Qt::ElideRight, one_em * 40);
+ QAction * comment = submenu->addAction(prep_text);
+ comment->setEnabled(false);
+ submenu->addSeparator();
+
+ IOGraphAction *graphAction;
+ for (const auto &unit : IOGraphAction::unitTypes(headerinfo)) {
+ graphAction = new IOGraphAction(submenu, unit, headerinfo.abbreviation);
+ if (mw) {
+ connect(graphAction, &IOGraphAction::openIOGraphDialog, mw, &MainWindow::showIOGraphDialog);
+ }
+ submenu->addAction(graphAction);
+ }
+
+ return submenu;
+}
diff --git a/ui/qt/io_graph_action.h b/ui/qt/io_graph_action.h
new file mode 100644
index 00000000..290f1880
--- /dev/null
+++ b/ui/qt/io_graph_action.h
@@ -0,0 +1,47 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef IO_GRAPH_ACTION_H
+#define IO_GRAPH_ACTION_H
+
+#include <ui/qt/utils/field_information.h>
+#include <ui/io_graph_item.h>
+
+#include <QAction>
+
+class IOGraphAction : public QAction
+{
+ Q_OBJECT
+public:
+ explicit IOGraphAction(QObject *parent, io_graph_item_unit_t unit = IOG_ITEM_UNIT_PACKETS, QString field = QString());
+ explicit IOGraphAction(QObject *parent);
+
+ io_graph_item_unit_t unit() const { return unit_; }
+
+ QString valueField() const { return field_; }
+
+ static const QString unitName(io_graph_item_unit_t unit);
+
+ static QList<io_graph_item_unit_t> unitTypes(const FieldInformation::HeaderInfo& headerinfo);
+ static QMenu * createMenu(const FieldInformation::HeaderInfo& headerinfo, QWidget * parent);
+
+signals:
+ void openIOGraphDialog(io_graph_item_unit_t, QString);
+
+public slots:
+
+private:
+ io_graph_item_unit_t unit_;
+ QString field_;
+
+private slots:
+
+};
+
+#endif // IO_GRAPH_ACTION_H
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index 002b98f9..8e7821a4 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -7,13 +7,14 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
+#define WS_LOG_DOMAIN LOG_DOMAIN_QTUI
#include "io_graph_dialog.h"
#include <ui_io_graph_dialog.h>
#include "file.h"
+#include "locale.h"
#include <epan/stat_tap_ui.h>
-#include "epan/stats_tree_priv.h"
#include "epan/uat-int.h"
#include <wsutil/utf8_entities.h>
@@ -25,11 +26,16 @@
#include <ui/qt/utils/color_utils.h>
#include <ui/qt/widgets/qcustomplot.h>
+#include <ui/qt/widgets/qcp_string_legend_item.h>
+#include <ui/qt/widgets/qcp_axis_ticker_si.h>
#include "progress_frame.h"
#include "main_application.h"
+#include <ui/qt/main_window.h>
#include <wsutil/filesystem.h>
#include <wsutil/report_message.h>
+#include <wsutil/nstime.h>
+#include <wsutil/to_str.h>
#include <ui/qt/utils/tango_colors.h> //provides some default colors
#include <ui/qt/widgets/copy_from_profile_button.h>
@@ -47,6 +53,8 @@
#include <QTimer>
#include <QVariant>
+#include <new> // std::bad_alloc
+
// Bugs and uncertainties:
// - Regular (non-stacked) bar graphs are drawn on top of each other on the Z axis.
// The QCP forum suggests drawing them side by side:
@@ -54,15 +62,30 @@
// - We retap and redraw more than we should.
// - Smoothing doesn't seem to match GTK+
// - Closing the color picker on macOS sends the dialog to the background.
-// - The color picker triggers https://bugreports.qt.io/browse/QTBUG-58699.
+// - X-axis time buckets are based on the file relative time, even in
+// Time of Day / absolute time mode. (See io_graph_item.c/get_io_graph_index)
+// Changing this would mean retapping when switching to ToD mode, though.
// To do:
// - Use scroll bars?
-// - Scroll during live captures
+// https://www.qcustomplot.com/index.php/tutorials/specialcases/scrollbar
+// - Scroll during live captures (currently the graph auto rescales instead)
// - Set ticks per pixel (e.g. pressing "2" sets 2 tpp).
// - Explicitly handle missing values, e.g. via NAN.
// - Add a "show missing" or "show zero" option to the UAT?
// It would add yet another graph configuration column.
+// - Increase max number of items (or make configurable)
+// - Dark Mode support, e.g.
+// https://www.qcustomplot.com/index.php/demos/barchartdemo
+// - Multiple y-axes?
+// https://www.qcustomplot.com/index.php/demos/multiaxisdemo
+// https://www.qcustomplot.com/index.php/tutorials/specialcases/axistags
+
+// Scale factor to convert the units the interval is stored in to seconds.
+// Must match what get_io_graph_index() in io_graph_item expects.
+// Increase this in order to make smaller intervals possible.
+const int SCALE = 1000000;
+const double SCALE_F = (double)SCALE;
const qreal graph_line_width_ = 1.0;
@@ -77,15 +100,15 @@ const int stat_update_interval_ = 200; // ms
// Saved graph settings
typedef struct _io_graph_settings_t {
- gboolean enabled;
+ bool enabled;
char* name;
char* dfilter;
- guint color;
- guint32 style;
- guint32 yaxis;
+ unsigned color;
+ uint32_t style;
+ uint32_t yaxis;
char* yfield;
- guint32 sma_period;
- guint32 y_axis_factor;
+ uint32_t sma_period;
+ uint32_t y_axis_factor;
} io_graph_settings_t;
static const value_string graph_style_vs[] = {
@@ -105,7 +128,7 @@ static const value_string graph_style_vs[] = {
{ 0, NULL }
};
-static const value_string y_axis_vs[] = {
+static const value_string y_axis_packet_vs[] = {
{ IOG_ITEM_UNIT_PACKETS, "Packets" },
{ IOG_ITEM_UNIT_BYTES, "Bytes" },
{ IOG_ITEM_UNIT_BITS, "Bits" },
@@ -115,10 +138,25 @@ static const value_string y_axis_vs[] = {
{ IOG_ITEM_UNIT_CALC_MAX, "MAX(Y Field)" },
{ IOG_ITEM_UNIT_CALC_MIN, "MIN(Y Field)" },
{ IOG_ITEM_UNIT_CALC_AVERAGE, "AVG(Y Field)" },
+ { IOG_ITEM_UNIT_CALC_THROUGHPUT, "THROUGHPUT(Y Field)" },
{ IOG_ITEM_UNIT_CALC_LOAD, "LOAD(Y Field)" },
{ 0, NULL }
};
+static const value_string y_axis_event_vs[] = {
+ { IOG_ITEM_UNIT_PACKETS, "Events" },
+ y_axis_packet_vs[1],
+ y_axis_packet_vs[2],
+ y_axis_packet_vs[3],
+ y_axis_packet_vs[4],
+ y_axis_packet_vs[5],
+ y_axis_packet_vs[6],
+ y_axis_packet_vs[7],
+ y_axis_packet_vs[8],
+ y_axis_packet_vs[9],
+ { 0, NULL }
+};
+
static const value_string moving_avg_vs[] = {
{ 0, "None" },
{ 10, "10 interval SMA" },
@@ -131,24 +169,31 @@ static const value_string moving_avg_vs[] = {
{ 0, NULL }
};
-static io_graph_settings_t *iog_settings_ = NULL;
-static guint num_io_graphs_ = 0;
-static uat_t *iog_uat_ = NULL;
+static io_graph_settings_t *iog_settings_;
+static unsigned num_io_graphs_;
+static uat_t *iog_uat_;
+// XXX - Multiple UatModels with the same uat can crash if one is
+// edited, because the underlying uat_t* data changes but the
+// record_errors and dirty_records lists do not.
+static QPointer<UatModel> static_uat_model_;
// y_axis_factor was added in 3.6. Provide backward compatibility.
static const char *iog_uat_defaults_[] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "1"
};
+static char *decimal_point;
+
extern "C" {
-//Allow the enable/disable field to be a checkbox, but for backwards compatibility,
-//the strings have to be "Enabled"/"Disabled", not "TRUE"/"FALSE"
+//Allow the enable/disable field to be a checkbox, but for backwards
+//compatibility with pre-2.6 versions, the strings are "Enabled"/"Disabled",
+//not "true"/"false". (Pre-4.4 versions require "true" to be all-caps.)
#define UAT_BOOL_ENABLE_CB_DEF(basename,field_name,rec_t) \
-static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, guint len, const void* UNUSED_PARAMETER(u1), const void* UNUSED_PARAMETER(u2)) {\
+static void basename ## _ ## field_name ## _set_cb(void* rec, const char* buf, unsigned len, const void* UNUSED_PARAMETER(u1), const void* UNUSED_PARAMETER(u2)) {\
char* tmp_str = g_strndup(buf,len); \
- if ((g_strcmp0(tmp_str, "Enabled") == 0) || \
- (g_strcmp0(tmp_str, "TRUE") == 0)) \
+ if (tmp_str && ((g_strcmp0(tmp_str, "Enabled") == 0) || \
+ (g_ascii_strcasecmp(tmp_str, "true") == 0))) \
((rec_t*)rec)->field_name = 1; \
else \
((rec_t*)rec)->field_name = 0; \
@@ -157,32 +202,33 @@ static void basename ## _ ## field_name ## _tostr_cb(void* rec, char** out_ptr,
*out_ptr = ws_strdup_printf("%s",((rec_t*)rec)->field_name ? "Enabled" : "Disabled"); \
*out_len = (unsigned)strlen(*out_ptr); }
-static bool uat_fld_chk_enable(void* u1 _U_, const char* strptr, guint len, const void* u2 _U_, const void* u3 _U_, char** err)
+static bool uat_fld_chk_enable(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, char** err)
{
char* str = g_strndup(strptr,len);
- if ((g_strcmp0(str, "Enabled") == 0) ||
+ if (str &&
+ ((g_strcmp0(str, "Enabled") == 0) ||
(g_strcmp0(str, "Disabled") == 0) ||
- (g_strcmp0(str, "TRUE") == 0) || //just for UAT functionality
- (g_strcmp0(str, "FALSE") == 0)) {
+ (g_ascii_strcasecmp(str, "true") == 0) || //just for UAT functionality
+ (g_ascii_strcasecmp(str, "false") == 0))) {
*err = NULL;
g_free(str);
- return TRUE;
+ return true;
}
//User should never see this unless they are manually modifying UAT
*err = ws_strdup_printf("invalid value: %s (must be Enabled or Disabled)", str);
g_free(str);
- return FALSE;
+ return false;
}
#define UAT_FLD_BOOL_ENABLE(basename,field_name,title,desc) \
{#field_name, title, PT_TXTMOD_BOOL,{uat_fld_chk_enable,basename ## _ ## field_name ## _set_cb,basename ## _ ## field_name ## _tostr_cb},{0,0,0},0,desc,FLDFILL}
//"Custom" handler for sma_period enumeration for backwards compatibility
-static void io_graph_sma_period_set_cb(void* rec, const char* buf, guint len, const void* vs, const void* u2 _U_)
+static void io_graph_sma_period_set_cb(void* rec, const char* buf, unsigned len, const void* vs, const void* u2 _U_)
{
- guint i;
+ unsigned i;
char* str = g_strndup(buf,len);
const char* cstr;
((io_graph_settings_t*)rec)->sma_period = 0;
@@ -202,7 +248,7 @@ static void io_graph_sma_period_set_cb(void* rec, const char* buf, guint len, co
for (i=0; (cstr = ((const value_string*)vs)[i].strptr) ;i++) {
if (g_str_equal(cstr,str)) {
- ((io_graph_settings_t*)rec)->sma_period = (guint32)((const value_string*)vs)[i].value;
+ ((io_graph_settings_t*)rec)->sma_period = (uint32_t)((const value_string*)vs)[i].value;
g_free(str);
return;
}
@@ -212,7 +258,7 @@ static void io_graph_sma_period_set_cb(void* rec, const char* buf, guint len, co
//Duplicated because macro covers both functions
static void io_graph_sma_period_tostr_cb(void* rec, char** out_ptr, unsigned* out_len, const void* vs, const void* u2 _U_)
{
- guint i;
+ unsigned i;
for (i=0;((const value_string*)vs)[i].strptr;i++) {
if (((const value_string*)vs)[i].value == ((io_graph_settings_t*)rec)->sma_period) {
*out_ptr = g_strdup(((const value_string*)vs)[i].strptr);
@@ -224,9 +270,9 @@ static void io_graph_sma_period_tostr_cb(void* rec, char** out_ptr, unsigned* ou
*out_len = (unsigned)strlen("None");
}
-static bool sma_period_chk_enum(void* u1 _U_, const char* strptr, guint len, const void* v, const void* u3 _U_, char** err) {
+static bool sma_period_chk_enum(void* u1 _U_, const char* strptr, unsigned len, const void* v, const void* u3 _U_, char** err) {
char *str = g_strndup(strptr,len);
- guint i;
+ unsigned i;
const value_string* vs = (const value_string *)v;
//Original UAT had just raw numbers and not enumerated values with "interval SMA"
@@ -246,13 +292,13 @@ static bool sma_period_chk_enum(void* u1 _U_, const char* strptr, guint len, con
if (g_strcmp0(vs[i].strptr,str) == 0) {
*err = NULL;
g_free(str);
- return TRUE;
+ return true;
}
}
*err = ws_strdup_printf("invalid value: %s",str);
g_free(str);
- return FALSE;
+ return false;
}
#define UAT_FLD_SMA_PERIOD(basename,field_name,title,enum,desc) \
@@ -263,18 +309,33 @@ UAT_BOOL_ENABLE_CB_DEF(io_graph, enabled, io_graph_settings_t)
UAT_CSTRING_CB_DEF(io_graph, name, io_graph_settings_t)
UAT_DISPLAY_FILTER_CB_DEF(io_graph, dfilter, io_graph_settings_t)
UAT_COLOR_CB_DEF(io_graph, color, io_graph_settings_t)
-UAT_VS_DEF(io_graph, style, io_graph_settings_t, guint32, 0, "Line")
-UAT_VS_DEF(io_graph, yaxis, io_graph_settings_t, guint32, 0, "Packets")
+UAT_VS_DEF(io_graph, style, io_graph_settings_t, uint32_t, 0, "Line")
+// XXX Need to use "Events" where appropriate.
+UAT_VS_DEF(io_graph, yaxis, io_graph_settings_t, uint32_t, 0, "Packets")
UAT_PROTO_FIELD_CB_DEF(io_graph, yfield, io_graph_settings_t)
UAT_DEC_CB_DEF(io_graph, y_axis_factor, io_graph_settings_t)
-static uat_field_t io_graph_fields[] = {
+static uat_field_t io_graph_packet_fields[] = {
+ UAT_FLD_BOOL_ENABLE(io_graph, enabled, "Enabled", "Graph visibility"),
+ UAT_FLD_CSTRING(io_graph, name, "Graph Name", "The name of the graph"),
+ UAT_FLD_DISPLAY_FILTER(io_graph, dfilter, "Display Filter", "Graph packets matching this display filter"),
+ UAT_FLD_COLOR(io_graph, color, "Color", "Graph color (#RRGGBB)"),
+ UAT_FLD_VS(io_graph, style, "Style", graph_style_vs, "Graph style (Line, Bars, etc.)"),
+ UAT_FLD_VS(io_graph, yaxis, "Y Axis", y_axis_packet_vs, "Y Axis units"),
+ UAT_FLD_PROTO_FIELD(io_graph, yfield, "Y Field", "Apply calculations to this field"),
+ UAT_FLD_SMA_PERIOD(io_graph, sma_period, "SMA Period", moving_avg_vs, "Simple moving average period"),
+ UAT_FLD_DEC(io_graph, y_axis_factor, "Y Axis Factor", "Y Axis Factor"),
+
+ UAT_END_FIELDS
+};
+
+static uat_field_t io_graph_event_fields[] = {
UAT_FLD_BOOL_ENABLE(io_graph, enabled, "Enabled", "Graph visibility"),
UAT_FLD_CSTRING(io_graph, name, "Graph Name", "The name of the graph"),
UAT_FLD_DISPLAY_FILTER(io_graph, dfilter, "Display Filter", "Graph packets matching this display filter"),
UAT_FLD_COLOR(io_graph, color, "Color", "Graph color (#RRGGBB)"),
UAT_FLD_VS(io_graph, style, "Style", graph_style_vs, "Graph style (Line, Bars, etc.)"),
- UAT_FLD_VS(io_graph, yaxis, "Y Axis", y_axis_vs, "Y Axis units"),
+ UAT_FLD_VS(io_graph, yaxis, "Y Axis", y_axis_event_vs, "Y Axis units"),
UAT_FLD_PROTO_FIELD(io_graph, yfield, "Y Field", "Apply calculations to this field"),
UAT_FLD_SMA_PERIOD(io_graph, sma_period, "SMA Period", moving_avg_vs, "Simple moving average period"),
UAT_FLD_DEC(io_graph, y_axis_factor, "Y Axis Factor", "Y Axis Factor"),
@@ -306,16 +367,25 @@ static void io_graph_free_cb(void* p) {
g_free(iogs->yfield);
}
+// If the uat changes outside the model, e.g. when changing profiles,
+// we need to tell the UatModel.
+static void io_graph_post_update_cb() {
+ if (static_uat_model_) {
+ static_uat_model_->reloadUat();
+ }
+}
+
} // extern "C"
-IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter) :
+IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter,
+ io_graph_item_unit_t value_units, QString yfield) :
WiresharkDialog(parent, cf),
ui(new Ui::IOGraphDialog),
uat_model_(nullptr),
uat_delegate_(nullptr),
base_graph_(nullptr),
tracer_(nullptr),
- start_time_(0.0),
+ start_time_(NSTIME_INIT_ZERO),
mouse_drags_(true),
rubber_band_(nullptr),
stat_timer_(nullptr),
@@ -355,15 +425,17 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
QPushButton *copy_bt = ui->buttonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
connect (copy_bt, SIGNAL(clicked()), this, SLOT(copyAsCsvClicked()));
- CopyFromProfileButton * copy_button = new CopyFromProfileButton(this, "io_graphs", tr("Copy graphs from another profile."));
- ui->buttonBox->addButton(copy_button, QDialogButtonBox::ActionRole);
- connect(copy_button, &CopyFromProfileButton::copyProfile, this, &IOGraphDialog::copyFromProfile);
+ copy_profile_bt_ = new CopyFromProfileButton(this, "io_graphs", tr("Copy graphs from another profile."));
+ ui->buttonBox->addButton(copy_profile_bt_, QDialogButtonBox::ActionRole);
+ connect(copy_profile_bt_, &CopyFromProfileButton::copyProfile, this, &IOGraphDialog::copyFromProfile);
QPushButton *close_bt = ui->buttonBox->button(QDialogButtonBox::Close);
if (close_bt) {
close_bt->setDefault(true);
}
+ connect(ui->buttonBox, &QDialogButtonBox::clicked, this, &IOGraphDialog::buttonBoxClicked);
+
ui->automaticUpdateCheckBox->setChecked(prefs.gui_io_graph_automatic_update ? true : false);
ui->enableLegendCheckBox->setChecked(prefs.gui_io_graph_enable_legend ? true : false);
@@ -373,22 +445,38 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
stat_timer_->start(stat_update_interval_);
// Intervals (ms)
- ui->intervalComboBox->addItem(tr("1 ms"), 1);
- ui->intervalComboBox->addItem(tr("2 ms"), 2);
- ui->intervalComboBox->addItem(tr("5 ms"), 5);
- ui->intervalComboBox->addItem(tr("10 ms"), 10);
- ui->intervalComboBox->addItem(tr("20 ms"), 20);
- ui->intervalComboBox->addItem(tr("50 ms"), 50);
- ui->intervalComboBox->addItem(tr("100 ms"), 100);
- ui->intervalComboBox->addItem(tr("200 ms"), 200);
- ui->intervalComboBox->addItem(tr("500 ms"), 500);
- ui->intervalComboBox->addItem(tr("1 sec"), 1000);
- ui->intervalComboBox->addItem(tr("2 sec"), 2000);
- ui->intervalComboBox->addItem(tr("5 sec"), 5000);
- ui->intervalComboBox->addItem(tr("10 sec"), 10000);
- ui->intervalComboBox->addItem(tr("1 min"), 60000);
- ui->intervalComboBox->addItem(tr("10 min"), 600000);
- ui->intervalComboBox->setCurrentIndex(9);
+ // #6441 asks for arbitrary values. We could probably do that with
+ // a QSpinBox, e.g. using QAbstractSpinBox::AdaptiveDecimalStepType
+ // or similar (it only exists starting in Qt 5.12) and suffix(),
+ // or something fancier with valueFromText() and textFromValue() to
+ // convert to and from SI prefixes.
+ ui->intervalComboBox->addItem(tr("1 μs"), SCALE / 1000000);
+ ui->intervalComboBox->addItem(tr("2 μs"), SCALE / 500000);
+ ui->intervalComboBox->addItem(tr("5 μs"), SCALE / 200000);
+ ui->intervalComboBox->addItem(tr("10 μs"), SCALE / 100000);
+ ui->intervalComboBox->addItem(tr("20 μs"), SCALE / 50000);
+ ui->intervalComboBox->addItem(tr("50 μs"), SCALE / 20000);
+ ui->intervalComboBox->addItem(tr("100 μs"), SCALE / 10000);
+ ui->intervalComboBox->addItem(tr("200 μs"), SCALE / 5000);
+ ui->intervalComboBox->addItem(tr("500 μs"), SCALE / 2000);
+ ui->intervalComboBox->addItem(tr("1 ms"), SCALE / 1000);
+ ui->intervalComboBox->addItem(tr("2 ms"), SCALE / 500);
+ ui->intervalComboBox->addItem(tr("5 ms"), SCALE / 200);
+ ui->intervalComboBox->addItem(tr("10 ms"), SCALE / 100);
+ ui->intervalComboBox->addItem(tr("20 ms"), SCALE / 50);
+ ui->intervalComboBox->addItem(tr("50 ms"), SCALE / 20);
+ ui->intervalComboBox->addItem(tr("100 ms"), SCALE / 10);
+ ui->intervalComboBox->addItem(tr("200 ms"), SCALE / 5);
+ ui->intervalComboBox->addItem(tr("500 ms"), SCALE / 2);
+ ui->intervalComboBox->addItem(tr("1 sec"), SCALE);
+ ui->intervalComboBox->addItem(tr("2 sec"), SCALE * 2);
+ ui->intervalComboBox->addItem(tr("5 sec"), SCALE * 5);
+ ui->intervalComboBox->addItem(tr("10 sec"), SCALE * 10);
+ ui->intervalComboBox->addItem(tr("1 min"), SCALE * 60);
+ ui->intervalComboBox->addItem(tr("2 min"), SCALE * 120);
+ ui->intervalComboBox->addItem(tr("5 min"), SCALE * 300);
+ ui->intervalComboBox->addItem(tr("10 min"), SCALE * 600);
+ ui->intervalComboBox->setCurrentIndex(18);
ui->todCheckBox->setChecked(false);
iop->xAxis->setTicker(number_ticker_);
@@ -419,6 +507,9 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
ctx_menu_.addAction(ui->actionCrosshairs);
set_action_shortcuts_visible_in_context_menu(ctx_menu_.actions());
+ iop->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(iop, &QCustomPlot::customContextMenuRequested, this, &IOGraphDialog::showContextMenu);
+
iop->xAxis->setLabel(tr("Time (s)"));
iop->setMouseTracking(true);
@@ -433,22 +524,23 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
loadProfileGraphs();
bool filterExists = false;
- QString graph_name = is_packet_configuration_namespace() ? tr("Filtered packets") : tr("Filtered events");
if (uat_model_->rowCount() > 0) {
for (int i = 0; i < uat_model_->rowCount(); i++) {
createIOGraph(i);
- if (ioGraphs_.at(i)->filter().compare(displayFilter) == 0)
+ IOGraph *iog = ioGraphs_.at(i);
+ if (iog->filter().compare(displayFilter) == 0 &&
+ iog->valueUnitField().compare(yfield) == 0 &&
+ iog->valueUnits() == value_units) {
filterExists = true;
+ }
}
- if (! filterExists && displayFilter.length() > 0)
- addGraph(true, graph_name, displayFilter, ColorUtils::graphColor(uat_model_->rowCount()),
- IOGraph::psLine, IOG_ITEM_UNIT_PACKETS, QString(), DEFAULT_MOVING_AVERAGE, DEFAULT_Y_AXIS_FACTOR);
} else {
addDefaultGraph(true, 0);
addDefaultGraph(true, 1);
- if (displayFilter.length() > 0)
- addGraph(true, graph_name, displayFilter, ColorUtils::graphColor(uat_model_->rowCount()),
- IOGraph::psLine, IOG_ITEM_UNIT_PACKETS, QString(), DEFAULT_MOVING_AVERAGE, DEFAULT_Y_AXIS_FACTOR);
+ }
+
+ if (! filterExists && (!displayFilter.isEmpty() || !yfield.isEmpty())) {
+ addGraph(true, displayFilter, value_units, yfield);
}
toggleTracerStyle(true);
@@ -460,14 +552,23 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
ui->splitter->setStretchFactor(0, 95);
ui->splitter->setStretchFactor(1, 5);
+ loadSplitterState(ui->splitter);
//XXX - resize columns?
+ //ui->graphUat->header()->resizeSections(QHeaderView::ResizeToContents);
ProgressFrame::addToButtonBox(ui->buttonBox, &parent);
connect(iop, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(graphClicked(QMouseEvent*)));
connect(iop, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*)));
connect(iop, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*)));
+
+ connect(iop, &QCustomPlot::beforeReplot, this, &IOGraphDialog::updateLegend);
+
+ MainWindow *main_window = qobject_cast<MainWindow *>(mainApp->mainWindow());
+ if (main_window != nullptr) {
+ connect(main_window, &MainWindow::framesSelected, this, &IOGraphDialog::selectedFrameChanged);
+ }
}
IOGraphDialog::~IOGraphDialog()
@@ -482,15 +583,18 @@ IOGraphDialog::~IOGraphDialog()
void IOGraphDialog::copyFromProfile(QString filename)
{
- guint orig_data_len = iog_uat_->raw_data->len;
+ if (uat_model_ == nullptr)
+ return;
- gchar *err = NULL;
+ char *err = NULL;
+ // uat_load appends rows to the current UAT, using filename.
+ // We should let the UatModel handle it, and have the UatModel
+ // call beginInsertRows() and endInsertRows(), so that we can
+ // just add the new rows instead of resetting the information.
if (uat_load(iog_uat_, filename.toUtf8().constData(), &err)) {
- iog_uat_->changed = TRUE;
- uat_model_->reloadUat();
- for (guint i = orig_data_len; i < iog_uat_->raw_data->len; i++) {
- createIOGraph(i);
- }
+ iog_uat_->changed = true;
+ // uat_load calls the post update cb, which reloads the Uat.
+ //uat_model_->reloadUat();
} else {
report_failure("Error while loading %s: %s", iog_uat_->name, err);
g_free(err);
@@ -499,6 +603,8 @@ void IOGraphDialog::copyFromProfile(QString filename)
void IOGraphDialog::addGraph(bool checked, QString name, QString dfilter, QRgb color_idx, IOGraph::PlotStyles style, io_graph_item_unit_t value_units, QString yfield, int moving_average, int y_axis_factor)
{
+ if (uat_model_ == nullptr)
+ return;
QVariantList newRowData;
newRowData.append(checked ? Qt::Checked : Qt::Unchecked);
@@ -507,12 +613,12 @@ void IOGraphDialog::addGraph(bool checked, QString name, QString dfilter, QRgb c
newRowData.append(QColor(color_idx));
newRowData.append(val_to_str_const(style, graph_style_vs, "None"));
if (is_packet_configuration_namespace()) {
- newRowData.append(val_to_str_const(value_units, y_axis_vs, "Packets"));
+ newRowData.append(val_to_str_const(value_units, y_axis_packet_vs, "Packets"));
} else {
- newRowData.append(val_to_str_const(value_units, y_axis_vs, "Events"));
+ newRowData.append(val_to_str_const(value_units, y_axis_event_vs, "Events"));
}
newRowData.append(yfield);
- newRowData.append(val_to_str_const((guint32) moving_average, moving_avg_vs, "None"));
+ newRowData.append(val_to_str_const((uint32_t) moving_average, moving_avg_vs, "None"));
newRowData.append(y_axis_factor);
QModelIndex newIndex = uat_model_->appendEntry(newRowData);
@@ -522,11 +628,36 @@ void IOGraphDialog::addGraph(bool checked, QString name, QString dfilter, QRgb c
return;
}
ui->graphUat->setCurrentIndex(newIndex);
- createIOGraph(newIndex.row());
+}
+
+void IOGraphDialog::addGraph(bool checked, QString dfilter, io_graph_item_unit_t value_units, QString yfield)
+{
+ if (uat_model_ == nullptr)
+ return;
+
+ QString graph_name;
+ if (yfield.isEmpty()) {
+ if (!dfilter.isEmpty()) {
+ graph_name = is_packet_configuration_namespace() ? tr("Filtered packets") : tr("Filtered events");
+ } else {
+ graph_name = is_packet_configuration_namespace() ? tr("All packets") : tr("All events");
+ }
+ } else {
+ if (is_packet_configuration_namespace()) {
+ graph_name = QString(val_to_str_const(value_units, y_axis_packet_vs, "Unknown")).replace("Y Field", yfield);
+ } else {
+ graph_name = QString(val_to_str_const(value_units, y_axis_event_vs, "Unknown")).replace("Y Field", yfield);
+ }
+ }
+ addGraph(checked, std::move(graph_name), dfilter, ColorUtils::graphColor(uat_model_->rowCount()),
+ IOGraph::psLine, value_units, yfield, DEFAULT_MOVING_AVERAGE, DEFAULT_Y_AXIS_FACTOR);
}
void IOGraphDialog::addGraph(bool copy_from_current)
{
+ if (uat_model_ == nullptr)
+ return;
+
const QModelIndex &current = ui->graphUat->currentIndex();
if (copy_from_current && !current.isValid())
return;
@@ -540,8 +671,6 @@ void IOGraphDialog::addGraph(bool copy_from_current)
qDebug() << "Failed to add a new record";
return;
}
- createIOGraph(copyIdx.row());
-
ui->graphUat->setCurrentIndex(copyIdx);
} else {
addDefaultGraph(false);
@@ -553,22 +682,19 @@ void IOGraphDialog::addGraph(bool copy_from_current)
void IOGraphDialog::createIOGraph(int currentRow)
{
- // XXX - Should IOGraph have it's own list that has to sync with UAT?
- ioGraphs_.append(new IOGraph(ui->ioPlot));
+ // XXX - Should IOGraph have its own list that has to sync with UAT?
+ ioGraphs_.insert(currentRow, new IOGraph(ui->ioPlot));
IOGraph* iog = ioGraphs_[currentRow];
- connect(this, SIGNAL(recalcGraphData(capture_file *, bool)), iog, SLOT(recalcGraphData(capture_file *, bool)));
- connect(this, SIGNAL(reloadValueUnitFields()), iog, SLOT(reloadValueUnitField()));
- connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)),
- iog, SLOT(captureEvent(CaptureEvent)));
- connect(iog, SIGNAL(requestRetap()), this, SLOT(scheduleRetap()));
- connect(iog, SIGNAL(requestRecalc()), this, SLOT(scheduleRecalc()));
- connect(iog, SIGNAL(requestReplot()), this, SLOT(scheduleReplot()));
+ connect(this, &IOGraphDialog::recalcGraphData, iog, &IOGraph::recalcGraphData);
+ connect(this, &IOGraphDialog::reloadValueUnitFields, iog, &IOGraph::reloadValueUnitField);
+ connect(&cap_file_, &CaptureFile::captureEvent, iog, &IOGraph::captureEvent);
+ connect(iog, &IOGraph::requestRetap, this, [=]() { scheduleRetap(); });
+ connect(iog, &IOGraph::requestRecalc, this, [=]() { scheduleRecalc(); });
+ connect(iog, &IOGraph::requestReplot, this, [=]() { scheduleReplot(); });
syncGraphSettings(currentRow);
- if (iog->visible()) {
- scheduleRetap();
- }
+ iog->setNeedRetap(true);
}
void IOGraphDialog::addDefaultGraph(bool enabled, int idx)
@@ -591,7 +717,7 @@ void IOGraphDialog::addDefaultGraph(bool enabled, int idx)
IOGraph::psLine, IOG_ITEM_UNIT_PACKETS, QString(), DEFAULT_MOVING_AVERAGE, DEFAULT_Y_AXIS_FACTOR);
break;
default:
- addGraph(enabled, tr("Access Denied"), "ct.error == \"AccessDenied\"", ColorUtils::graphColor(4), // 4 = red
+ addGraph(enabled, tr("All Execs"), "evt.type == \"execve\"", ColorUtils::graphColor(4), // 4 = red
IOGraph::psDot, IOG_ITEM_UNIT_PACKETS, QString(), DEFAULT_MOVING_AVERAGE, DEFAULT_Y_AXIS_FACTOR);
break;
}
@@ -613,11 +739,10 @@ void IOGraphDialog::syncGraphSettings(int row)
{
IOGraph *iog = ioGraphs_.value(row, Q_NULLPTR);
- if (!uat_model_->index(row, colEnabled).isValid() || !iog)
+ if (!uat_model_ || !uat_model_->index(row, colEnabled).isValid() || !iog)
return;
bool visible = graphIsEnabled(row);
- bool retap = !iog->visible() && visible;
QString data_str;
iog->setName(uat_model_->data(uat_model_->index(row, colName)).toString());
@@ -625,7 +750,11 @@ void IOGraphDialog::syncGraphSettings(int row)
/* plot style depend on the value unit, so set it first. */
data_str = uat_model_->data(uat_model_->index(row, colYAxis)).toString();
- iog->setValueUnits((int) str_to_val(qUtf8Printable(data_str), y_axis_vs, IOG_ITEM_UNIT_PACKETS));
+ if (is_packet_configuration_namespace()) {
+ iog->setValueUnits((int) str_to_val(qUtf8Printable(data_str), y_axis_packet_vs, IOG_ITEM_UNIT_PACKETS));
+ } else {
+ iog->setValueUnits((int) str_to_val(qUtf8Printable(data_str), y_axis_event_vs, IOG_ITEM_UNIT_PACKETS));
+ }
iog->setValueUnitField(uat_model_->data(uat_model_->index(row, colYField)).toString());
iog->setColor(uat_model_->data(uat_model_->index(row, colColor), Qt::DecorationRole).value<QColor>().rgb());
@@ -642,7 +771,6 @@ void IOGraphDialog::syncGraphSettings(int row)
if (!iog->configError().isEmpty()) {
hint_err_ = iog->configError();
visible = false;
- retap = false;
} else {
hint_err_.clear();
}
@@ -650,18 +778,18 @@ void IOGraphDialog::syncGraphSettings(int row)
iog->setVisible(visible);
getGraphInfo();
- mouseMoved(NULL); // Update hint
- updateLegend();
+ updateHint();
if (visible) {
- if (retap) {
- scheduleRetap();
- } else {
- scheduleReplot();
- }
+ scheduleReplot();
}
}
+qsizetype IOGraphDialog::graphCount() const
+{
+ return uat_model_ ? uat_model_->rowCount() : ioGraphs_.size();
+}
+
void IOGraphDialog::updateWidgets()
{
WiresharkDialog::updateWidgets();
@@ -671,9 +799,6 @@ void IOGraphDialog::scheduleReplot(bool now)
{
need_replot_ = true;
if (now) updateStatistics();
- // A plot finished, force an update of the legend now in case a time unit
- // was involved (which might append "(ms)" to the label).
- updateLegend();
}
void IOGraphDialog::scheduleRecalc(bool now)
@@ -693,6 +818,27 @@ void IOGraphDialog::reloadFields()
emit reloadValueUnitFields();
}
+void IOGraphDialog::captureFileClosing()
+{
+ // The other buttons will be disabled when the model is set to null.
+ ui->newToolButton->setEnabled(false);
+ ui->intervalComboBox->setEnabled(false);
+ copy_profile_bt_->setEnabled(false);
+ if (uat_model_) {
+ applyChanges();
+ disconnect(uat_model_, nullptr, this, nullptr);
+ }
+ // It would be nice to keep the information in the UAT about the graphs
+ // visible in a read-only state after closing, but if the view is just
+ // disabled, updating the model from elsewhere (e.g., other dialogs)
+ // will still change it, so we'd need to copy the information into
+ // a new model.
+ uat_model_ = nullptr;
+ ui->graphUat->setModel(nullptr);
+ ui->graphUat->setVisible(false);
+ WiresharkDialog::captureFileClosing();
+}
+
void IOGraphDialog::keyPressEvent(QKeyEvent *event)
{
int pan_pixels = event->modifiers() & Qt::ShiftModifier ? 1 : 10;
@@ -764,19 +910,25 @@ void IOGraphDialog::keyPressEvent(QKeyEvent *event)
QDialog::keyPressEvent(event);
}
-void IOGraphDialog::reject()
+void IOGraphDialog::applyChanges()
{
- if (!uat_model_)
+ if (!static_uat_model_)
return;
// Changes to the I/O Graphs settings are always saved,
// there is no possibility for "rejection".
QString error;
- if (uat_model_->applyChanges(error)) {
+ if (static_uat_model_->applyChanges(error)) {
if (!error.isEmpty()) {
report_failure("%s", qPrintable(error));
}
}
+}
+
+void IOGraphDialog::reject()
+{
+ if (uat_model_)
+ applyChanges();
QDialog::reject();
}
@@ -881,12 +1033,12 @@ void IOGraphDialog::toggleTracerStyle(bool force_default)
IOGraph *IOGraphDialog::currentActiveGraph() const
{
QModelIndex index = ui->graphUat->currentIndex();
- if (index.isValid()) {
+ if (index.isValid() && graphIsEnabled(index.row())) {
return ioGraphs_.value(index.row(), NULL);
}
//if no currently selected item, go with first item enabled
- for (int row = 0; row < uat_model_->rowCount(); row++)
+ for (int row = 0; row < graphCount(); row++)
{
if (graphIsEnabled(row)) {
return ioGraphs_.value(row, NULL);
@@ -898,8 +1050,13 @@ IOGraph *IOGraphDialog::currentActiveGraph() const
bool IOGraphDialog::graphIsEnabled(int row) const
{
- Qt::CheckState state = static_cast<Qt::CheckState>(uat_model_->data(uat_model_->index(row, colEnabled), Qt::CheckStateRole).toInt());
- return state == Qt::Checked;
+ if (uat_model_) {
+ Qt::CheckState state = static_cast<Qt::CheckState>(uat_model_->data(uat_model_->index(row, colEnabled), Qt::CheckStateRole).toInt());
+ return state == Qt::Checked;
+ } else {
+ IOGraph* iog = ioGraphs_.value(row, nullptr);
+ return (iog && iog->visible());
+ }
}
// Scan through our graphs and gather information.
@@ -909,7 +1066,7 @@ void IOGraphDialog::getGraphInfo()
{
base_graph_ = NULL;
QCPBars *prev_bars = NULL;
- start_time_ = 0.0;
+ nstime_set_zero(&start_time_);
tracer_->setGraph(NULL);
IOGraph *selectedGraph = currentActiveGraph();
@@ -931,9 +1088,9 @@ void IOGraphDialog::getGraphInfo()
prev_bars = bars;
}
if (iog->visible() && iog->maxInterval() >= 0) {
- double iog_start = iog->startOffset();
- if (start_time_ == 0.0 || iog_start < start_time_) {
- start_time_ = iog_start;
+ nstime_t iog_start = iog->startTime();
+ if (nstime_is_zero(&start_time_) || nstime_cmp(&iog_start, &start_time_) < 0) {
+ nstime_copy(&start_time_, &iog_start);
}
}
@@ -946,9 +1103,78 @@ void IOGraphDialog::getGraphInfo()
}
}
+void IOGraphDialog::updateHint()
+{
+ QCustomPlot *iop = ui->ioPlot;
+ QString hint;
+
+ // XXX: ElidedLabel doesn't support rich text / HTML, we
+ // used to bold this error
+ if (!hint_err_.isEmpty()) {
+ hint += QString("%1 ").arg(hint_err_);
+ }
+ if (mouse_drags_) {
+ double ts = 0;
+ packet_num_ = 0;
+ int interval_packet = -1;
+
+ if (tracer_->graph()) {
+ ts = tracer_->position->key();
+ if (IOGraph *iog = currentActiveGraph()) {
+ interval_packet = iog->packetFromTime(ts - nstime_to_sec(&start_time_));
+ }
+ }
+
+ if (interval_packet < 0) {
+ hint += tr("Hover over the graph for details.");
+ } else {
+ QString msg = is_packet_configuration_namespace() ? tr("No packets in interval") : tr("No events in interval");
+ QString val;
+ if (interval_packet > 0) {
+ packet_num_ = (uint32_t) interval_packet;
+ if (is_packet_configuration_namespace()) {
+ msg = QString("%1 %2")
+ .arg(!file_closed_ ? tr("Click to select packet") : tr("Packet"))
+ .arg(packet_num_);
+ } else {
+ msg = QString("%1 %2")
+ .arg(!file_closed_ ? tr("Click to select event") : tr("Event"))
+ .arg(packet_num_);
+ }
+ val = " = " + QString::number(tracer_->position->value(), 'g', 4);
+ }
+ // XXX - If Time of Day is selected, should we use ISO 8601
+ // timestamps or something similar here instead of epoch time?
+ hint += tr("%1 (%2s%3).")
+ .arg(msg)
+ .arg(QString::number(ts, 'f', precision_))
+ .arg(val);
+ }
+ iop->replot(QCustomPlot::rpQueuedReplot);
+ } else {
+ if (rubber_band_ && rubber_band_->isVisible()) {
+ QRectF zoom_ranges = getZoomRanges(rubber_band_->geometry());
+ if (zoom_ranges.width() > 0.0 && zoom_ranges.height() > 0.0) {
+ hint += tr("Release to zoom, x = %1 to %2, y = %3 to %4")
+ .arg(zoom_ranges.x())
+ .arg(zoom_ranges.x() + zoom_ranges.width())
+ .arg(zoom_ranges.y())
+ .arg(zoom_ranges.y() + zoom_ranges.height());
+ } else {
+ hint += tr("Unable to select range.");
+ }
+ } else {
+ hint += tr("Click to select a portion of the graph.");
+ }
+ }
+
+ ui->hintLabel->setText(hint);
+}
+
void IOGraphDialog::updateLegend()
{
QCustomPlot *iop = ui->ioPlot;
+ QSet<format_size_units_e> format_units_set;
QSet<QString> vu_label_set;
QString intervalText = ui->intervalComboBox->itemText(ui->intervalComboBox->currentIndex());
@@ -956,49 +1182,60 @@ void IOGraphDialog::updateLegend()
iop->yAxis->setLabel(QString());
// Find unique labels
- if (uat_model_ != NULL) {
- for (int row = 0; row < uat_model_->rowCount(); row++) {
- IOGraph *iog = ioGraphs_.value(row, Q_NULLPTR);
- if (graphIsEnabled(row) && iog) {
- QString label(iog->valueUnitLabel());
- if (!iog->scaledValueUnit().isEmpty()) {
- label += " (" + iog->scaledValueUnit() + ")";
- }
- vu_label_set.insert(label);
- }
+ for (int row = 0; row < graphCount(); row++) {
+ IOGraph *iog = ioGraphs_.value(row, Q_NULLPTR);
+ if (graphIsEnabled(row) && iog) {
+ QString label(iog->valueUnitLabel());
+ vu_label_set.insert(label);
+ format_units_set.insert(iog->formatUnits());
}
}
// Nothing.
if (vu_label_set.size() < 1) {
+ iop->legend->layer()->replot();
return;
}
+ format_size_units_e format_units = FORMAT_SIZE_UNIT_NONE;
+ if (format_units_set.size() == 1) {
+ format_units = format_units_set.values().constFirst();
+ }
+
+ QSharedPointer<QCPAxisTickerSi> si_ticker = qSharedPointerDynamicCast<QCPAxisTickerSi>(iop->yAxis->ticker());
+ if (format_units != FORMAT_SIZE_UNIT_NONE) {
+ if (si_ticker) {
+ si_ticker->setUnit(format_units);
+ } else {
+ iop->yAxis->setTicker(QSharedPointer<QCPAxisTickerSi>(new QCPAxisTickerSi(format_units, QString(), ui->logCheckBox->isChecked())));
+ }
+ } else {
+ if (si_ticker) {
+ if (ui->logCheckBox->isChecked()) {
+ iop->yAxis->setTicker(QSharedPointer<QCPAxisTickerLog>(new QCPAxisTickerLog));
+ } else {
+ iop->yAxis->setTicker(QSharedPointer<QCPAxisTicker>(new QCPAxisTicker));
+ }
+ }
+ }
+
// All the same. Use the Y Axis label.
if (vu_label_set.size() == 1) {
- iop->yAxis->setLabel(vu_label_set.values()[0] + "/" + intervalText);
- return;
+ iop->yAxis->setLabel(vu_label_set.values().constFirst() + "/" + intervalText);
}
- // Differing labels. Create a legend with a Title label at top.
+ // Create a legend with a Title label at top.
// Legend Title thanks to: https://www.qcustomplot.com/index.php/support/forum/443
- QCPTextElement* legendTitle = qobject_cast<QCPTextElement*>(iop->legend->elementAt(0));
- if (legendTitle == NULL) {
- legendTitle = new QCPTextElement(iop, QString(""));
- iop->legend->insertRow(0);
- iop->legend->addElement(0, 0, legendTitle);
- }
- legendTitle->setText(QString(intervalText + " Intervals "));
-
- if (uat_model_ != NULL) {
- for (int row = 0; row < uat_model_->rowCount(); row++) {
- IOGraph *iog = ioGraphs_.value(row, Q_NULLPTR);
- if (iog) {
- if (graphIsEnabled(row)) {
- iog->addToLegend();
- } else {
- iog->removeFromLegend();
- }
+ iop->legend->clearItems();
+ QCPStringLegendItem *legendTitle = new QCPStringLegendItem(iop->legend, QString(tr("%1 Intervals ").arg(intervalText)));
+ iop->legend->insertRow(0);
+ iop->legend->addElement(0, 0, legendTitle);
+
+ for (int row = 0; row < graphCount(); row++) {
+ IOGraph *iog = ioGraphs_.value(row, Q_NULLPTR);
+ if (iog) {
+ if (graphIsEnabled(row)) {
+ iog->addToLegend();
}
}
}
@@ -1037,19 +1274,37 @@ QRectF IOGraphDialog::getZoomRanges(QRect zoom_rect)
return zoom_ranges;
}
+void IOGraphDialog::showContextMenu(const QPoint &pos)
+{
+ if (ui->ioPlot->legend->selectTest(pos, false) >= 0) {
+ QMenu *menu = new QMenu(this);
+ menu->setAttribute(Qt::WA_DeleteOnClose);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ menu->addAction(tr("Move to top left"), this, &IOGraphDialog::moveLegend)->setData((Qt::AlignTop|Qt::AlignLeft).toInt());
+ menu->addAction(tr("Move to top center"), this, &IOGraphDialog::moveLegend)->setData((Qt::AlignTop|Qt::AlignHCenter).toInt());
+ menu->addAction(tr("Move to top right"), this, &IOGraphDialog::moveLegend)->setData((Qt::AlignTop|Qt::AlignRight).toInt());
+ menu->addAction(tr("Move to bottom left"), this, &IOGraphDialog::moveLegend)->setData((Qt::AlignBottom|Qt::AlignLeft).toInt());
+ menu->addAction(tr("Move to bottom center"), this, &IOGraphDialog::moveLegend)->setData((Qt::AlignBottom|Qt::AlignHCenter).toInt());
+ menu->addAction(tr("Move to bottom right"), this, &IOGraphDialog::moveLegend)->setData((Qt::AlignBottom|Qt::AlignRight).toInt());
+#else
+ menu->addAction(tr("Move to top left"), this, &IOGraphDialog::moveLegend)->setData(static_cast<Qt::Alignment::Int>(Qt::AlignTop|Qt::AlignLeft));
+ menu->addAction(tr("Move to top center"), this, &IOGraphDialog::moveLegend)->setData(static_cast<Qt::Alignment::Int>(Qt::AlignTop|Qt::AlignHCenter));
+ menu->addAction(tr("Move to top right"), this, &IOGraphDialog::moveLegend)->setData(static_cast<Qt::Alignment::Int>(Qt::AlignTop|Qt::AlignRight));
+ menu->addAction(tr("Move to bottom left"), this, &IOGraphDialog::moveLegend)->setData(static_cast<Qt::Alignment::Int>(Qt::AlignBottom|Qt::AlignLeft));
+ menu->addAction(tr("Move to bottom center"), this, &IOGraphDialog::moveLegend)->setData(static_cast<Qt::Alignment::Int>(Qt::AlignBottom|Qt::AlignHCenter));
+ menu->addAction(tr("Move to bottom right"), this, &IOGraphDialog::moveLegend)->setData(static_cast<Qt::Alignment::Int>(Qt::AlignBottom|Qt::AlignRight));
+#endif
+ menu->popup(ui->ioPlot->mapToGlobal(pos));
+ } else {
+ ctx_menu_.popup(ui->ioPlot->mapToGlobal(pos));
+ }
+}
+
void IOGraphDialog::graphClicked(QMouseEvent *event)
{
QCustomPlot *iop = ui->ioPlot;
- if (event->button() == Qt::RightButton) {
- // XXX We should find some way to get ioPlot to handle a
- // contextMenuEvent instead.
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- ctx_menu_.popup(event->globalPosition().toPoint());
-#else
- ctx_menu_.popup(event->globalPos());
-#endif
- } else if (mouse_drags_) {
+ if (mouse_drags_) {
if (iop->axisRect()->rect().contains(event->pos())) {
iop->setCursor(QCursor(Qt::ClosedHandCursor));
}
@@ -1068,87 +1323,35 @@ void IOGraphDialog::graphClicked(QMouseEvent *event)
void IOGraphDialog::mouseMoved(QMouseEvent *event)
{
QCustomPlot *iop = ui->ioPlot;
- QString hint;
Qt::CursorShape shape = Qt::ArrowCursor;
- // XXX: ElidedLabel doesn't support rich text / HTML, we
- // used to bold this error
- if (!hint_err_.isEmpty()) {
- hint += QString("%1 ").arg(hint_err_);
- }
- if (event) {
- if (event->buttons().testFlag(Qt::LeftButton)) {
- if (mouse_drags_) {
- shape = Qt::ClosedHandCursor;
- } else {
- shape = Qt::CrossCursor;
- }
- } else if (iop->axisRect()->rect().contains(event->pos())) {
- if (mouse_drags_) {
- shape = Qt::OpenHandCursor;
- } else {
- shape = Qt::CrossCursor;
- }
+ if (event->buttons().testFlag(Qt::LeftButton)) {
+ if (mouse_drags_) {
+ shape = Qt::ClosedHandCursor;
+ } else {
+ shape = Qt::CrossCursor;
+ }
+ } else if (iop->axisRect()->rect().contains(event->pos())) {
+ if (mouse_drags_) {
+ shape = Qt::OpenHandCursor;
+ } else {
+ shape = Qt::CrossCursor;
}
- iop->setCursor(QCursor(shape));
}
+ iop->setCursor(QCursor(shape));
if (mouse_drags_) {
- double ts = 0;
- packet_num_ = 0;
- int interval_packet = -1;
-
- if (event && tracer_->graph()) {
+ if (tracer_->graph()) {
tracer_->setGraphKey(iop->xAxis->pixelToCoord(event->pos().x()));
- ts = tracer_->position->key();
- if (IOGraph *iog = currentActiveGraph()) {
- interval_packet = iog->packetFromTime(ts - start_time_);
- }
}
- if (interval_packet < 0) {
- hint += tr("Hover over the graph for details.");
- } else {
- QString msg = is_packet_configuration_namespace() ? tr("No packets in interval") : tr("No events in interval");
- QString val;
- if (interval_packet > 0) {
- packet_num_ = (guint32) interval_packet;
- if (is_packet_configuration_namespace()) {
- msg = QString("%1 %2")
- .arg(!file_closed_ ? tr("Click to select packet") : tr("Packet"))
- .arg(packet_num_);
- } else {
- msg = QString("%1 %2")
- .arg(!file_closed_ ? tr("Click to select event") : tr("Event"))
- .arg(packet_num_);
- }
- val = " = " + QString::number(tracer_->position->value(), 'g', 4);
- }
- hint += tr("%1 (%2s%3).")
- .arg(msg)
- .arg(QString::number(ts, 'g', 4))
- .arg(val);
- }
- iop->replot();
} else {
- if (event && rubber_band_ && rubber_band_->isVisible()) {
+ if (rubber_band_ && rubber_band_->isVisible()) {
rubber_band_->setGeometry(QRect(rb_origin_, event->pos()).normalized());
- QRectF zoom_ranges = getZoomRanges(QRect(rb_origin_, event->pos()));
- if (zoom_ranges.width() > 0.0 && zoom_ranges.height() > 0.0) {
- hint += tr("Release to zoom, x = %1 to %2, y = %3 to %4")
- .arg(zoom_ranges.x())
- .arg(zoom_ranges.x() + zoom_ranges.width())
- .arg(zoom_ranges.y())
- .arg(zoom_ranges.y() + zoom_ranges.height());
- } else {
- hint += tr("Unable to select range.");
- }
- } else {
- hint += tr("Click to select a portion of the graph.");
}
}
- ui->hintLabel->setText(hint);
+ updateHint();
}
void IOGraphDialog::mouseReleased(QMouseEvent *event)
@@ -1172,51 +1375,99 @@ void IOGraphDialog::mouseReleased(QMouseEvent *event)
}
}
+void IOGraphDialog::moveLegend()
+{
+ if (QAction *contextAction = qobject_cast<QAction*>(sender())) {
+ if (contextAction->data().canConvert<Qt::Alignment::Int>()) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ ui->ioPlot->axisRect()->insetLayout()->setInsetAlignment(0, Qt::Alignment::fromInt(contextAction->data().value<Qt::Alignment::Int>()));
+#else
+ ui->ioPlot->axisRect()->insetLayout()->setInsetAlignment(0, static_cast<Qt::Alignment>(contextAction->data().value<Qt::Alignment::Int>()));
+#endif
+ ui->ioPlot->replot();
+ }
+ }
+}
+
void IOGraphDialog::resetAxes()
{
QCustomPlot *iop = ui->ioPlot;
- QCPRange x_range = iop->xAxis->scaleType() == QCPAxis::stLogarithmic ?
- iop->xAxis->range().sanitizedForLogScale() : iop->xAxis->range();
-
double pixel_pad = 10.0; // per side
iop->rescaleAxes(true);
+ QCPRange x_range = iop->xAxis->scaleType() == QCPAxis::stLogarithmic ?
+ iop->xAxis->range().sanitizedForLogScale() : iop->xAxis->range();
double axis_pixels = iop->xAxis->axisRect()->width();
iop->xAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, x_range.center());
+ QCPRange y_range = iop->yAxis->scaleType() == QCPAxis::stLogarithmic ?
+ iop->yAxis->range().sanitizedForLogScale() : iop->yAxis->range();
axis_pixels = iop->yAxis->axisRect()->height();
- iop->yAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, iop->yAxis->range().center());
+ iop->yAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, y_range.center());
auto_axes_ = true;
iop->replot();
}
+void IOGraphDialog::selectedFrameChanged(QList<int> frames)
+{
+ if (frames.count() == 1 && cap_file_.isValid() && !file_closed_ && tracer_->graph() && cap_file_.packetInfo() != nullptr) {
+ packet_info *pinfo = cap_file_.packetInfo();
+ if (pinfo->num != packet_num_) {
+ // This prevents being triggered by the IOG's own GoToPacketAction,
+ // although that is mostly harmless.
+ int interval = ui->intervalComboBox->itemData(ui->intervalComboBox->currentIndex()).toInt();
+
+ /*
+ * setGraphKey (with Interpolation false, as it is by default)
+ * finds the nearest point to the key. Our buckets are derived
+ * from rounding down (XXX - which is appropriate for relative
+ * time but less so when absolute time of day is selected.)
+ * We could call get_io_graph_index() and then multiply to get
+ * the exact ts for the bucket, but it's fewer math operations
+ * operations simply to subtract half the interval.
+ * XXX - Getting the exact value would be superior if we wished
+ * to avoid doing anything in the case that the tracer is
+ * already pointing at the correct bucket. (Is the hint always
+ * correct in that case?)
+ */
+#if 0
+ int64_t idx = get_io_graph_index(pinfo, interval);
+ double ts = (double)idx * interval / SCALE_F + nstime_to_sec(&start_time);
+#endif
+ double key = nstime_to_sec(&pinfo->rel_ts) - (interval / (2 * SCALE_F)) + nstime_to_sec(&start_time_);
+ tracer_->setGraphKey(key);
+ ui->ioPlot->replot();
+ updateHint();
+ }
+ }
+}
+
void IOGraphDialog::updateStatistics()
{
if (!isVisible()) return;
- if (need_retap_ && !file_closed_ && prefs.gui_io_graph_automatic_update) {
+ /* XXX - If we're currently retapping, what we really want to do is
+ * abort the current tap and start over. process_specified_records()
+ * in file.c doesn't let us do that, because it doesn't know whether
+ * it's holding cf->read_lock for something that could be restarted
+ * (like tapping or dissection) or something that needs to run to
+ * completion (saving, printing.)
+ *
+ * So we wait and see if we're no longer tapping the next check.
+ */
+ if (need_retap_ && !file_closed_ && !retapDepth() && prefs.gui_io_graph_automatic_update) {
need_retap_ = false;
- cap_file_.retapPackets();
+ QTimer::singleShot(0, &cap_file_, &CaptureFile::retapPackets);
// The user might have closed the window while tapping, which means
// we might no longer exist.
} else {
if (need_recalc_ && !file_closed_ && prefs.gui_io_graph_automatic_update) {
need_recalc_ = false;
need_replot_ = true;
- int enabled_graphs = 0;
- if (uat_model_ != NULL) {
- for (int row = 0; row < uat_model_->rowCount(); row++) {
- if (graphIsEnabled(row)) {
- ++enabled_graphs;
- }
- }
- }
- // With multiple visible graphs, disable Y scaling to avoid
- // multiple, distinct units.
- emit recalcGraphData(cap_file_.capFile(), enabled_graphs == 1);
+ emit recalcGraphData(cap_file_.capFile());
if (!tracer_->graph()) {
if (base_graph_ && base_graph_->data()->size() > 0) {
tracer_->setGraph(base_graph_);
@@ -1239,11 +1490,15 @@ void IOGraphDialog::updateStatistics()
void IOGraphDialog::loadProfileGraphs()
{
if (iog_uat_ == NULL) {
+ uat_field_t *io_graph_fields = io_graph_packet_fields;
+ if (!is_packet_configuration_namespace()) {
+ io_graph_fields = io_graph_event_fields;
+ }
iog_uat_ = uat_new("I/O Graphs",
sizeof(io_graph_settings_t),
"io_graphs",
- TRUE,
+ true,
&iog_settings_,
&num_io_graphs_,
0, /* doesn't affect anything that requires a GUI update */
@@ -1251,7 +1506,7 @@ void IOGraphDialog::loadProfileGraphs()
io_graph_copy_cb,
NULL,
io_graph_free_cb,
- NULL,
+ io_graph_post_update_cb,
NULL,
io_graph_fields);
@@ -1263,16 +1518,26 @@ void IOGraphDialog::loadProfileGraphs()
g_free(err);
uat_clear(iog_uat_);
}
+
+ static_uat_model_ = new UatModel(mainApp, iog_uat_);
+ connect(mainApp, &MainApplication::profileChanging, IOGraphDialog::applyChanges);
}
- uat_model_ = new UatModel(NULL, iog_uat_);
- uat_delegate_ = new UatDelegate;
+ uat_model_ = static_uat_model_;
+ uat_delegate_ = new UatDelegate(ui->graphUat);
ui->graphUat->setModel(uat_model_);
ui->graphUat->setItemDelegate(uat_delegate_);
+ ui->graphUat->setSelectionMode(QAbstractItemView::ContiguousSelection);
+
+ ui->graphUat->setHeader(new ResizeHeaderView(Qt::Horizontal, ui->graphUat));
- connect(uat_model_, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
- this, SLOT(modelDataChanged(QModelIndex)));
- connect(uat_model_, SIGNAL(modelReset()), this, SLOT(modelRowsReset()));
+ connect(uat_model_, &UatModel::dataChanged, this, &IOGraphDialog::modelDataChanged);
+ connect(uat_model_, &UatModel::modelReset, this, &IOGraphDialog::modelRowsReset);
+ connect(uat_model_, &UatModel::rowsInserted, this, &IOGraphDialog::modelRowsInserted);
+ connect(uat_model_, &UatModel::rowsRemoved, this, &IOGraphDialog::modelRowsRemoved);
+ connect(uat_model_, &UatModel::rowsMoved, this, &IOGraphDialog::modelRowsMoved);
+
+ connect(ui->graphUat->selectionModel(), &QItemSelectionModel::selectionChanged, this, &IOGraphDialog::graphUatSelectionChanged);
}
// Slots
@@ -1282,6 +1547,22 @@ void IOGraphDialog::on_intervalComboBox_currentIndexChanged(int)
int interval = ui->intervalComboBox->itemData(ui->intervalComboBox->currentIndex()).toInt();
bool need_retap = false;
+ precision_ = ceil(log10(SCALE_F / interval));
+ if (precision_ < 0) {
+ precision_ = 0;
+ }
+
+ // XXX - This is the default QCP date time format, but adding fractional
+ // seconds when our interval is small. Should we make it something else,
+ // like ISO 8601 (but still with a line break between time and date)?
+ // Note this is local time, with no time zone offset displayed. Should
+ // it be in UTC? (call setDateTimeSpec())
+ if (precision_) {
+ datetime_ticker_->setDateTimeFormat("hh:mm:ss.z\ndd.MM.yy");
+ } else {
+ datetime_ticker_->setDateTimeFormat("hh:mm:ss\ndd.MM.yy");
+ }
+
if (uat_model_ != NULL) {
for (int row = 0; row < uat_model_->rowCount(); row++) {
IOGraph *iog = ioGraphs_.value(row, NULL);
@@ -1289,6 +1570,8 @@ void IOGraphDialog::on_intervalComboBox_currentIndexChanged(int)
iog->setInterval(interval);
if (iog->visible()) {
need_retap = true;
+ } else {
+ iog->setNeedRetap(true);
}
}
}
@@ -1297,13 +1580,12 @@ void IOGraphDialog::on_intervalComboBox_currentIndexChanged(int)
if (need_retap) {
scheduleRetap(true);
}
-
- updateLegend();
}
void IOGraphDialog::on_todCheckBox_toggled(bool checked)
{
- double orig_start = start_time_;
+ nstime_t orig_start;
+ nstime_copy(&orig_start, &start_time_);
bool orig_auto = auto_axes_;
if (checked) {
@@ -1315,46 +1597,135 @@ void IOGraphDialog::on_todCheckBox_toggled(bool checked)
scheduleRecalc(true);
auto_axes_ = orig_auto;
getGraphInfo();
- ui->ioPlot->xAxis->moveRange(start_time_ - orig_start);
- mouseMoved(NULL); // Update hint
+ nstime_delta(&orig_start, &start_time_, &orig_start);
+ ui->ioPlot->xAxis->moveRange(nstime_to_sec(&orig_start));
+ updateHint();
}
void IOGraphDialog::modelRowsReset()
{
+ foreach(IOGraph* iog, ioGraphs_) {
+ delete iog;
+ }
+ ioGraphs_.clear();
+
+ for (int i = 0; i < uat_model_->rowCount(); i++) {
+ createIOGraph(i);
+ }
ui->deleteToolButton->setEnabled(false);
ui->copyToolButton->setEnabled(false);
ui->clearToolButton->setEnabled(uat_model_->rowCount() != 0);
}
-void IOGraphDialog::on_graphUat_currentItemChanged(const QModelIndex &current, const QModelIndex&)
+void IOGraphDialog::modelRowsInserted(const QModelIndex &, int first, int last)
{
- if (current.isValid()) {
+ // first to last is inclusive
+ for (int i = first; i <= last; i++) {
+ createIOGraph(i);
+ }
+}
+
+void IOGraphDialog::modelRowsRemoved(const QModelIndex &, int first, int last)
+{
+ // first to last is inclusive
+ for (int i = last; i >= first; i--) {
+ IOGraph *iog = ioGraphs_.takeAt(i);
+ delete iog;
+ }
+}
+
+void IOGraphDialog::modelRowsMoved(const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &dest, int destinationRow)
+{
+ // The source and destination parent are always the same for UatModel.
+ ws_assert(source == dest);
+ // Either destinationRow < sourceStart, or destinationRow > sourceEnd.
+ // When moving rows down the same parent, the rows are placed _before_
+ // destinationRow, otherwise it's the row to which items are moved.
+ if (destinationRow < sourceStart) {
+ for (int i = 0; i <= sourceEnd - sourceStart; i++) {
+ // When moving up the same parent, moving an earlier
+ // item doesn't change the row.
+ ioGraphs_.move(sourceStart + i, destinationRow + i);
+ }
+ } else {
+ for (int i = 0; i <= sourceEnd - sourceStart; i++) {
+ // When moving down the same parent, moving an earlier
+ // item means the next items move up (so all the moved
+ // rows are always at sourceStart.)
+ ioGraphs_.move(sourceStart, destinationRow - 1);
+ }
+ }
+
+ // setting a QCPLayerable to its current layer moves it to the end
+ // as though it were the last added. Do that for all the plottables
+ // starting with the first one that changed, so that the graphs appear
+ // as though they were added in the current order.
+ // (moveToLayer() is the same thing but with a parameter to prepend
+ // instead, which would be faster if we're in the top half of the
+ // list, except that's a protected function. There's no function
+ // to swap layerables in a layer.)
+ IOGraph *iog;
+ for (int row = qMin(sourceStart, destinationRow); row < uat_model_->rowCount(); row++) {
+ iog = ioGraphs_.at(row);
+ if (iog->graph()) {
+ iog->graph()->setLayer(iog->graph()->layer());
+ } else if (iog->bars()) {
+ iog->bars()->setLayer(iog->bars()->layer());
+ }
+ }
+ ui->ioPlot->replot();
+}
+
+void IOGraphDialog::graphUatSelectionChanged(const QItemSelection&, const QItemSelection&)
+{
+ QModelIndexList selectedRows = ui->graphUat->selectionModel()->selectedRows();
+ qsizetype num_selected = selectedRows.size();
+ if (num_selected > 0) {
+ std::sort(selectedRows.begin(), selectedRows.end());
ui->deleteToolButton->setEnabled(true);
ui->copyToolButton->setEnabled(true);
- ui->clearToolButton->setEnabled(true);
- ui->moveUpwardsToolButton->setEnabled(true);
- ui->moveDownwardsToolButton->setEnabled(true);
+ ui->moveUpwardsToolButton->setEnabled(selectedRows.first().row() > 0);
+ ui->moveDownwardsToolButton->setEnabled(selectedRows.last().row() < uat_model_->rowCount() - 1);
} else {
ui->deleteToolButton->setEnabled(false);
ui->copyToolButton->setEnabled(false);
- ui->clearToolButton->setEnabled(false);
ui->moveUpwardsToolButton->setEnabled(false);
ui->moveDownwardsToolButton->setEnabled(false);
}
}
-void IOGraphDialog::modelDataChanged(const QModelIndex &index)
+void IOGraphDialog::on_graphUat_currentItemChanged(const QModelIndex &current, const QModelIndex&)
+{
+ if (current.isValid()) {
+ ui->clearToolButton->setEnabled(true);
+ if (graphIsEnabled(current.row())) {
+ // Try to set the tracer to the new current graph.
+ // If it's not enabled, don't try to switch from the
+ // old graph to the one in the first row.
+ getGraphInfo();
+ }
+ } else {
+ ui->clearToolButton->setEnabled(false);
+ }
+}
+
+void IOGraphDialog::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &)
{
bool recalc = false;
- switch (index.column())
- {
- case colYAxis:
- case colSMAPeriod:
- recalc = true;
+ for (int col = topLeft.column(); col <= bottomRight.column(); col++) {
+ switch (col)
+ {
+ case colYAxis:
+ case colSMAPeriod:
+ case colYAxisFactor:
+ recalc = true;
+ }
}
- syncGraphSettings(index.row());
+ for (int row = topLeft.row(); row <= bottomRight.row(); row++) {
+ syncGraphSettings(row);
+ }
if (recalc) {
scheduleRecalc(true);
@@ -1363,11 +1734,6 @@ void IOGraphDialog::modelDataChanged(const QModelIndex &index)
}
}
-void IOGraphDialog::on_resetButton_clicked()
-{
- resetAxes();
-}
-
void IOGraphDialog::on_newToolButton_clicked()
{
addGraph();
@@ -1375,70 +1741,95 @@ void IOGraphDialog::on_newToolButton_clicked()
void IOGraphDialog::on_deleteToolButton_clicked()
{
- const QModelIndex &current = ui->graphUat->currentIndex();
- if (uat_model_ && current.isValid()) {
- delete ioGraphs_[current.row()];
- ioGraphs_.remove(current.row());
+ if (uat_model_ == nullptr) {
+ return;
+ }
- if (!uat_model_->removeRows(current.row(), 1)) {
- qDebug() << "Failed to remove row";
+ for (const auto &range : ui->graphUat->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty()) {
+ if (!uat_model_->removeRows(range.top(), range.bottom() - range.top() + 1)) {
+ qDebug() << "Failed to remove rows" << range.top() << "to" << range.bottom();
+ }
}
}
// We should probably be smarter about this.
hint_err_.clear();
- mouseMoved(NULL);
+ updateHint();
}
void IOGraphDialog::on_copyToolButton_clicked()
{
- addGraph(true);
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ QModelIndexList selectedRows = ui->graphUat->selectionModel()->selectedRows();
+ if (selectedRows.size() > 0) {
+ std::sort(selectedRows.begin(), selectedRows.end());
+
+ QModelIndex copyIdx;
+
+ for (const auto &idx : selectedRows) {
+ copyIdx = uat_model_->copyRow(idx);
+ if (!copyIdx.isValid())
+ {
+ qDebug() << "Failed to copy row" << idx.row();
+ }
+ }
+ ui->graphUat->setCurrentIndex(copyIdx);
+ }
}
void IOGraphDialog::on_clearToolButton_clicked()
{
if (uat_model_) {
- foreach(IOGraph* iog, ioGraphs_) {
- delete iog;
- }
- ioGraphs_.clear();
uat_model_->clearAll();
}
hint_err_.clear();
- mouseMoved(NULL);
+ updateHint();
}
void IOGraphDialog::on_moveUpwardsToolButton_clicked()
{
- const QModelIndex& current = ui->graphUat->currentIndex();
- if (uat_model_ && current.isValid()) {
-
- int current_row = current.row();
- if (current_row > 0){
- // Swap current row with the one above
- IOGraph* temp = ioGraphs_[current_row - 1];
- ioGraphs_[current_row - 1] = ioGraphs_[current_row];
- ioGraphs_[current_row] = temp;
+ if (uat_model_ == nullptr) {
+ return;
+ }
- uat_model_->moveRow(current_row, current_row - 1);
+ for (const auto &range : ui->graphUat->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty() && range.top() > 0) {
+ // Swap range of rows with the row above the top
+ if (! uat_model_->moveRows(QModelIndex(), range.top(), range.bottom() - range.top() + 1, QModelIndex(), range.top() - 1)) {
+ qDebug() << "Failed to move up rows" << range.top() << "to" << range.bottom();
+ }
+ // Our moveRows implementation calls begin/endMoveRows(), so
+ // range.top() already has the new row number.
+ ui->moveUpwardsToolButton->setEnabled(range.top() > 0);
+ ui->moveDownwardsToolButton->setEnabled(true);
}
}
}
void IOGraphDialog::on_moveDownwardsToolButton_clicked()
{
- const QModelIndex& current = ui->graphUat->currentIndex();
- if (uat_model_ && current.isValid()) {
-
- int current_row = current.row();
- if (current_row < uat_model_->rowCount() - 1) {
- // Swap current row with the one below
- IOGraph* temp = ioGraphs_[current_row + 1];
- ioGraphs_[current_row + 1] = ioGraphs_[current_row];
- ioGraphs_[current_row] = temp;
+ if (uat_model_ == nullptr) {
+ return;
+ }
- uat_model_->moveRow(current_row, current_row + 1);
+ for (const auto &range : ui->graphUat->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty() && range.bottom() + 1 < uat_model_->rowCount()) {
+ // Swap range of rows with the row below the top
+ if (! uat_model_->moveRows(QModelIndex(), range.top(), range.bottom() - range.top() + 1, QModelIndex(), range.bottom() + 1)) {
+ qDebug() << "Failed to move down rows" << range.top() << "to" << range.bottom();
+ }
+ // Our moveRows implementation calls begin/endMoveRows, so
+ // range.bottom() already has the new row number.
+ ui->moveUpwardsToolButton->setEnabled(true);
+ ui->moveDownwardsToolButton->setEnabled(range.bottom() < uat_model_->rowCount() - 1);
}
}
}
@@ -1461,14 +1852,28 @@ void IOGraphDialog::on_zoomRadioButton_toggled(bool checked)
void IOGraphDialog::on_logCheckBox_toggled(bool checked)
{
QCustomPlot *iop = ui->ioPlot;
+ QSharedPointer<QCPAxisTickerSi> si_ticker = qSharedPointerDynamicCast<QCPAxisTickerSi>(iop->yAxis->ticker());
+ if (si_ticker != nullptr) {
+ si_ticker->setLog(checked);
+ }
- iop->yAxis->setScaleType(checked ? QCPAxis::stLogarithmic : QCPAxis::stLinear);
+ if (checked) {
+ iop->yAxis->setScaleType(QCPAxis::stLogarithmic);
+ if (si_ticker == nullptr) {
+ iop->yAxis->setTicker(QSharedPointer<QCPAxisTickerLog>(new QCPAxisTickerLog));
+ }
+ } else {
+ iop->yAxis->setScaleType(QCPAxis::stLinear);
+ if (si_ticker == nullptr) {
+ iop->yAxis->setTicker(QSharedPointer<QCPAxisTicker>(new QCPAxisTicker));
+ }
+ }
iop->replot();
}
void IOGraphDialog::on_automaticUpdateCheckBox_toggled(bool checked)
{
- prefs.gui_io_graph_automatic_update = checked ? TRUE : FALSE;
+ prefs.gui_io_graph_automatic_update = checked ? true : false;
prefs_main_write();
@@ -1480,16 +1885,16 @@ void IOGraphDialog::on_automaticUpdateCheckBox_toggled(bool checked)
void IOGraphDialog::on_enableLegendCheckBox_toggled(bool checked)
{
- prefs.gui_io_graph_enable_legend = checked ? TRUE : FALSE;
+ prefs.gui_io_graph_enable_legend = checked ? true : false;
prefs_main_write();
- updateLegend();
+ ui->ioPlot->legend->layer()->replot();
}
void IOGraphDialog::on_actionReset_triggered()
{
- on_resetButton_clicked();
+ resetAxes();
}
void IOGraphDialog::on_actionZoomIn_triggered()
@@ -1585,7 +1990,7 @@ void IOGraphDialog::on_actionToggleTimeOrigin_triggered()
void IOGraphDialog::on_actionCrosshairs_triggered()
{
-
+ toggleTracerStyle();
}
void IOGraphDialog::on_buttonBox_helpRequested()
@@ -1638,6 +2043,17 @@ void IOGraphDialog::on_buttonBox_accepted()
}
}
+void IOGraphDialog::buttonBoxClicked(QAbstractButton *button)
+{
+ switch (ui->buttonBox->buttonRole(button)) {
+ case QDialogButtonBox::ResetRole:
+ resetAxes();
+ break;
+ default:
+ break;
+ }
+}
+
void IOGraphDialog::makeCsv(QTextStream &stream) const
{
QList<IOGraph *> activeGraphs;
@@ -1646,25 +2062,47 @@ void IOGraphDialog::makeCsv(QTextStream &stream) const
int max_interval = 0;
stream << "\"Interval start\"";
- if (uat_model_ != NULL) {
- for (int row = 0; row < uat_model_->rowCount(); row++) {
- if (graphIsEnabled(row) && ioGraphs_[row] != NULL) {
- activeGraphs.append(ioGraphs_[row]);
- if (max_interval < ioGraphs_[row]->maxInterval()) {
- max_interval = ioGraphs_[row]->maxInterval();
- }
- QString name = ioGraphs_[row]->name().toUtf8();
- name = QString("\"%1\"").arg(name.replace("\"", "\"\"")); // RFC 4180
- stream << "," << name;
+ for (int row = 0; row < graphCount(); row++) {
+ if (graphIsEnabled(row) && ioGraphs_[row] != NULL) {
+ activeGraphs.append(ioGraphs_[row]);
+ if (max_interval < ioGraphs_[row]->maxInterval()) {
+ max_interval = ioGraphs_[row]->maxInterval();
}
+ QString name = ioGraphs_[row]->name().toUtf8();
+ name = QString("\"%1\"").arg(name.replace("\"", "\"\"")); // RFC 4180
+ stream << "," << name;
}
}
stream << '\n';
for (int interval = 0; interval <= max_interval; interval++) {
- double interval_start = (double)interval * ((double)ui_interval / 1000.0);
- stream << interval_start;
+ int64_t interval_start = (int64_t)interval * ui_interval;
+ if (qSharedPointerDynamicCast<QCPAxisTickerDateTime>(ui->ioPlot->xAxis->ticker()) != nullptr) {
+ nstime_t interval_time = NSTIME_INIT_SECS_USECS((time_t)(interval_start / SCALE), (int)(interval_start % SCALE));
+
+ nstime_add(&interval_time, &start_time_);
+
+ static char time_string_buf[39];
+
+ if (decimal_point == nullptr) {
+ decimal_point = g_strdup(localeconv()->decimal_point);
+ }
+ // Should we convert to UTC for output, even if the graph axis has
+ // local time?
+ // The question of what precision to use is somewhat tricky.
+ // The buckets are aligned to the relative time start, not to
+ // absolute time, so the timestamp precision should be used instead
+ // of the bucket precision. We can save the precision of the
+ // start time timestamp for each graph, but we don't necessarily
+ // have a guarantee that all timestamps in the file have the same
+ // precision. Possibly nstime_t should store precision, cf. #15579
+ format_nstime_as_iso8601(time_string_buf, sizeof time_string_buf, &interval_time, decimal_point, true, 9); // precision_);
+
+ stream << time_string_buf;
+ } else {
+ stream << (double)interval_start / SCALE_F;
+ }
foreach (IOGraph *iog, activeGraphs) {
double value = 0.0;
if (interval <= iog->maxInterval()) {
@@ -1698,11 +2136,14 @@ bool IOGraphDialog::saveCsv(const QString &file_name) const
IOGraph::IOGraph(QCustomPlot *parent) :
parent_(parent),
+ tap_registered_(true),
visible_(false),
graph_(NULL),
bars_(NULL),
val_units_(IOG_ITEM_UNIT_FIRST),
hf_index_(-1),
+ interval_(0),
+ start_time_(NSTIME_INIT_ZERO),
cur_idx_(-1)
{
Q_ASSERT(parent_ != NULL);
@@ -1723,11 +2164,12 @@ IOGraph::IOGraph(QCustomPlot *parent) :
// error_string->str);
// config_err_ = error_string->str;
g_string_free(error_string, TRUE);
+ tap_registered_ = false;
}
}
IOGraph::~IOGraph() {
- remove_tap_listener(this);
+ removeTapListener();
if (graph_) {
parent_->removeGraph(graph_);
}
@@ -1736,9 +2178,17 @@ IOGraph::~IOGraph() {
}
}
+void IOGraph::removeTapListener()
+{
+ if (tap_registered_) {
+ remove_tap_listener(this);
+ tap_registered_ = false;
+ }
+}
+
// Construct a full filter string from the display filter and value unit / Y axis.
-// Check for errors and sets config_err_ if any are found.
-void IOGraph::setFilter(const QString &filter)
+// Check for errors and sets config_err_ and returns false if any are found.
+bool IOGraph::setFilter(const QString &filter)
{
GString *error_string;
QString full_filter(filter.trimmed());
@@ -1756,7 +2206,7 @@ void IOGraph::setFilter(const QString &filter)
config_err_ = QString::fromUtf8(df_err->msg);
df_error_free(&df_err);
filter_ = full_filter;
- return;
+ return false;
}
}
@@ -1765,7 +2215,7 @@ void IOGraph::setFilter(const QString &filter)
if (error_string) {
config_err_ = error_string->str;
g_string_free(error_string, TRUE);
- return;
+ return false;
}
// Make sure vu_field_ survives edt tree pruning by adding it to our filter
@@ -1778,17 +2228,36 @@ void IOGraph::setFilter(const QString &filter)
}
}
- error_string = set_tap_dfilter(this, full_filter.toUtf8().constData());
- if (error_string) {
- config_err_ = error_string->str;
- g_string_free(error_string, TRUE);
- return;
- } else {
- if (filter_.compare(filter) && visible_) {
- emit requestRetap();
+ if (full_filter_.compare(full_filter)) {
+ error_string = set_tap_dfilter(this, full_filter.toUtf8().constData());
+ if (error_string) {
+ config_err_ = error_string->str;
+ g_string_free(error_string, TRUE);
+ return false;
}
+
filter_ = filter;
+ full_filter_ = full_filter;
+ /* If we changed the tap filter the graph is visible, we need to
+ * retap.
+ * Note that setting the tap dfilter will mark the tap as needing a
+ * redraw, which will cause a recalculation (via tapDraw) via the
+ * (fairly long) main application timer.
+ */
+ /* XXX - When changing from an advanced graph to one that doesn't
+ * use the field, we don't actually need to retap if filter and
+ * full_filter produce the same results. (We do have to retap
+ * regardless if changing _to_ an advanced graph, because the
+ * extra fields in the io_graph_item_t aren't filled in from the
+ * edt for the basic graph.)
+ * Checking that in full generality would require more optimization
+ * in the dfilter engine plus functions to compare filters, but
+ * we could test the simple case where filter and vu_field are
+ * the same string.
+ */
+ setNeedRetap(true);
}
+ return true;
}
void IOGraph::applyCurrentColor()
@@ -1796,7 +2265,15 @@ void IOGraph::applyCurrentColor()
if (graph_) {
graph_->setPen(QPen(color_, graph_line_width_));
} else if (bars_) {
- bars_->setPen(QPen(QBrush(ColorUtils::graphColor(0)), graph_line_width_)); // ...or omit it altogether?
+ bars_->setPen(QPen(color_.color().darker(110), graph_line_width_));
+ // ...or omit it altogether?
+ // bars_->setPen(QPen(color_);
+ // XXX - We should do something like
+ // bars_->setPen(QPen(ColorUtils::alphaBlend(color_, palette().windowText(), 0.65));
+ // to get a darker outline in light mode and a lighter outline in dark
+ // mode, but we don't yet respect dark mode in IOGraph (or anything
+ // that uses QCustomPlot) - see link below for how to set QCP colors:
+ // https://www.qcustomplot.com/index.php/demos/barchartdemo
bars_->setBrush(color_);
}
}
@@ -1812,7 +2289,28 @@ void IOGraph::setVisible(bool visible)
bars_->setVisible(visible_);
}
if (old_visibility != visible_) {
- emit requestReplot();
+ if (visible_ && need_retap_) {
+ need_retap_ = false;
+ emit requestRetap();
+ } else {
+ // XXX - If the number of enabled graphs changed to or from 1, we
+ // need to recalculate to possibly change the rescaling. (This is
+ // why QCP recommends doing scaling in the axis ticker instead.)
+ // If we can't determine the number of enabled graphs here, always
+ // request a recalculation instead of a replot. (At least until we
+ // change the scaling to be done in the ticker.)
+ //emit requestReplot();
+ emit requestRecalc();
+ }
+ }
+}
+
+void IOGraph::setNeedRetap(bool retap)
+{
+ if (visible_ && retap) {
+ emit requestRetap();
+ } else {
+ need_retap_ = retap;
}
}
@@ -1827,7 +2325,7 @@ void IOGraph::setName(const QString &name)
}
}
-QRgb IOGraph::color()
+QRgb IOGraph::color() const
{
return color_.color().rgb();
}
@@ -1840,14 +2338,24 @@ void IOGraph::setColor(const QRgb color)
void IOGraph::setPlotStyle(int style)
{
+ bool recalc = false;
+ bool shows_zero = showsZero();
+
// Switch plottable if needed
switch (style) {
case psBar:
case psStackedBar:
if (graph_) {
bars_ = new QCPBars(parent_->xAxis, parent_->yAxis);
+ // default widthType is wtPlotCoords. Scale with the interval
+ // size to prevent overlap. (Multiply this by a factor to have
+ // a gap between bars; the QCustomPlot default is 0.75.)
+ if (interval_) {
+ bars_->setWidth(interval_ / SCALE_F);
+ }
parent_->removeGraph(graph_);
graph_ = NULL;
+ recalc = true;
}
break;
default:
@@ -1855,6 +2363,7 @@ void IOGraph::setPlotStyle(int style)
graph_ = parent_->addGraph(parent_->xAxis, parent_->yAxis);
parent_->removePlottable(bars_);
bars_ = NULL;
+ recalc = true;
}
break;
}
@@ -1930,13 +2439,26 @@ void IOGraph::setPlotStyle(int style)
break;
}
+ if (shows_zero != showsZero()) {
+ // recalculate if whether zero is added changed
+ recalc = true;
+ }
+
setName(name_);
applyCurrentColor();
+
+ if (recalc) {
+ // switching the plottable requires recalculation to add the data
+ emit requestRecalc();
+ }
}
-const QString IOGraph::valueUnitLabel()
+QString IOGraph::valueUnitLabel() const
{
- return val_to_str_const(val_units_, y_axis_vs, "Unknown");
+ if (is_packet_configuration_namespace()) {
+ return val_to_str_const(val_units_, y_axis_packet_vs, "Unknown");
+ }
+ return val_to_str_const(val_units_, y_axis_event_vs, "Unknown");
}
void IOGraph::setValueUnits(int val_units)
@@ -1946,9 +2468,21 @@ void IOGraph::setValueUnits(int val_units)
val_units_ = (io_graph_item_unit_t)val_units;
if (old_val_units != val_units) {
- setFilter(filter_); // Check config & prime vu field
- if (val_units < IOG_ITEM_UNIT_CALC_SUM) {
- emit requestRecalc();
+ // If val_units changed, switching between a type that doesn't
+ // use the vu_field/hfi/edt to one of the advanced graphs that
+ // does requires a retap. setFilter will handle that, because
+ // the full filter strings will be different.
+ if (setFilter(filter_)) { // Check config & prime vu field
+ if (val_units == IOG_ITEM_UNIT_CALC_LOAD ||
+ old_val_units == IOG_ITEM_UNIT_CALC_LOAD) {
+ // LOAD graphs fill in the io_graph_item_t differently
+ // than other advanced graphs, so we have to retap even
+ // if the filter is the same. (update_io_graph_item could
+ // instead calculate and store LOAD information for any
+ // advanced graph type, but the tradeoff might not be
+ // worth it.)
+ setNeedRetap(true);
+ }
}
}
}
@@ -1967,6 +2501,8 @@ void IOGraph::setValueUnitField(const QString &vu_field)
}
if (old_hf_index != hf_index_) {
+ // If the field changed, and val_units is a type that uses it,
+ // we need to retap. setFilter will handle that.
setFilter(filter_); // Check config & prime vu field
}
}
@@ -1993,25 +2529,44 @@ bool IOGraph::removeFromLegend()
return false;
}
-double IOGraph::startOffset()
+// This returns what graph key offset corresponds with relative time 0.0,
+// i.e. when absolute times are used the difference between abs_ts and
+// rel_ts of the first tapped packet. Generally the same for all graphs
+// that are displayed and have some data, unless they're on the opposite
+// sides of time references.
+// XXX - If the graph spans a time reference, it's not clear how we want
+// to switch from relative to absolute times.
+double IOGraph::startOffset() const
{
- if (graph_ && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(graph_->keyAxis()->ticker()) && graph_->data()->size() > 0) {
- return graph_->data()->at(0)->key;
+ if (graph_ && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(graph_->keyAxis()->ticker())) {
+ return nstime_to_sec(&start_time_);
}
- if (bars_ && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(bars_->keyAxis()->ticker()) && bars_->data()->size() > 0) {
- return bars_->data()->at(0)->key;
+ if (bars_ && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(bars_->keyAxis()->ticker())) {
+ return nstime_to_sec(&start_time_);
}
return 0.0;
}
-int IOGraph::packetFromTime(double ts)
+nstime_t IOGraph::startTime() const
{
- int idx = ts * 1000 / interval_;
- if (idx >= 0 && idx < (int) cur_idx_) {
+ if (graph_ && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(graph_->keyAxis()->ticker())) {
+ return start_time_;
+ }
+ if (bars_ && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(bars_->keyAxis()->ticker())) {
+ return start_time_;
+ }
+ return nstime_t(NSTIME_INIT_ZERO);
+}
+
+int IOGraph::packetFromTime(double ts) const
+{
+ int idx = ts * SCALE_F / interval_;
+ if (idx >= 0 && idx <= cur_idx_) {
switch (val_units_) {
case IOG_ITEM_UNIT_CALC_MAX:
+ return items_[idx].max_frame_in_invl;
case IOG_ITEM_UNIT_CALC_MIN:
- return items_[idx].extreme_frame_in_invl;
+ return items_[idx].min_frame_in_invl;
default:
return items_[idx].last_frame_in_invl;
}
@@ -2022,31 +2577,30 @@ int IOGraph::packetFromTime(double ts)
void IOGraph::clearAllData()
{
cur_idx_ = -1;
- reset_io_graph_items(items_, max_io_items_);
+ if (items_.size()) {
+ reset_io_graph_items(&items_[0], items_.size(), hf_index_);
+ }
if (graph_) {
graph_->data()->clear();
}
if (bars_) {
bars_->data()->clear();
}
- start_time_ = 0.0;
+ nstime_set_zero(&start_time_);
}
-void IOGraph::recalcGraphData(capture_file *cap_file, bool enable_scaling)
+void IOGraph::recalcGraphData(capture_file *cap_file)
{
/* Moving average variables */
unsigned int mavg_in_average_count = 0, mavg_left = 0;
unsigned int mavg_to_remove = 0, mavg_to_add = 0;
double mavg_cumulated = 0;
- QCPAxis *x_axis = nullptr;
if (graph_) {
graph_->data()->clear();
- x_axis = graph_->keyAxis();
}
if (bars_) {
bars_->data()->clear();
- x_axis = bars_->keyAxis();
}
if (moving_avg_period_ > 0 && cur_idx_ >= 0) {
@@ -2054,7 +2608,7 @@ void IOGraph::recalcGraphData(capture_file *cap_file, bool enable_scaling)
* just to make sure average on leftmost and rightmost displayed
* values is as reliable as possible
*/
- guint64 warmup_interval = 0;
+ uint64_t warmup_interval = 0;
// for (; warmup_interval < first_interval; warmup_interval += interval_) {
// mavg_cumulated += get_it_value(io, i, (int)warmup_interval/interval_);
@@ -2064,8 +2618,8 @@ void IOGraph::recalcGraphData(capture_file *cap_file, bool enable_scaling)
mavg_cumulated += getItemValue((int)warmup_interval/interval_, cap_file);
mavg_in_average_count++;
for (warmup_interval = interval_;
- ((warmup_interval < (0 + (moving_avg_period_ / 2) * (guint64)interval_)) &&
- (warmup_interval <= (cur_idx_ * (guint64)interval_)));
+ ((warmup_interval < (0 + (moving_avg_period_ / 2) * (uint64_t)interval_)) &&
+ (warmup_interval <= (cur_idx_ * (uint64_t)interval_)));
warmup_interval += interval_) {
mavg_cumulated += getItemValue((int)warmup_interval / interval_, cap_file);
@@ -2074,11 +2628,9 @@ void IOGraph::recalcGraphData(capture_file *cap_file, bool enable_scaling)
mavg_to_add = (unsigned int)warmup_interval;
}
+ double ts_offset = startOffset();
for (int i = 0; i <= cur_idx_; i++) {
- double ts = (double) i * interval_ / 1000;
- if (x_axis && qSharedPointerDynamicCast<QCPAxisTickerDateTime>(x_axis->ticker())) {
- ts += start_time_;
- }
+ double ts = (double) i * interval_ / SCALE_F + ts_offset;
double val = getItemValue(i, cap_file);
if (moving_avg_period_ > 0) {
@@ -2112,73 +2664,46 @@ void IOGraph::recalcGraphData(capture_file *cap_file, bool enable_scaling)
bars_->addData(ts, val);
}
}
-// qDebug() << "=rgd i" << i << ts << val;
- }
-
- // attempt to rescale time values to specific units
- if (enable_scaling) {
- calculateScaledValueUnit();
- } else {
- scaled_value_unit_.clear();
}
emit requestReplot();
}
-void IOGraph::calculateScaledValueUnit()
+format_size_units_e IOGraph::formatUnits() const
{
- // Reset unit and recalculate if needed.
- scaled_value_unit_.clear();
-
- // If there is no field, scaling is not possible.
- if (hf_index_ < 0) {
- return;
- }
-
switch (val_units_) {
+ case IOG_ITEM_UNIT_PACKETS:
+ case IOG_ITEM_UNIT_CALC_FRAMES:
+ if (is_packet_configuration_namespace()) {
+ return FORMAT_SIZE_UNIT_PACKETS;
+ }
+ return FORMAT_SIZE_UNIT_EVENTS;
+ case IOG_ITEM_UNIT_BYTES:
+ return FORMAT_SIZE_UNIT_BYTES;
+ case IOG_ITEM_UNIT_BITS:
+ return FORMAT_SIZE_UNIT_BITS;
+ case IOG_ITEM_UNIT_CALC_LOAD:
+ return FORMAT_SIZE_UNIT_ERLANGS;
+ case IOG_ITEM_UNIT_CALC_FIELDS:
+ return FORMAT_SIZE_UNIT_FIELDS;
case IOG_ITEM_UNIT_CALC_SUM:
case IOG_ITEM_UNIT_CALC_MAX:
case IOG_ITEM_UNIT_CALC_MIN:
case IOG_ITEM_UNIT_CALC_AVERAGE:
// Unit is not yet known, continue detecting it.
- break;
- default:
- // Unit is Packets, Bytes, Bits, etc.
- return;
- }
-
- if (proto_registrar_get_ftype(hf_index_) == FT_RELATIVE_TIME) {
- // find maximum absolute value and scale accordingly
- double maxValue = 0;
- if (graph_) {
- maxValue = maxValueFromGraphData(*graph_->data());
- } else if (bars_) {
- maxValue = maxValueFromGraphData(*bars_->data());
- }
- // If the maximum value is zero, then either we have no data or
- // everything is zero, do not scale the unit in this case.
- if (maxValue == 0) {
- return;
- }
-
- // XXX GTK+ always uses "ms" for log scale, should we do that too?
- int value_multiplier;
- if (maxValue >= 1.0) {
- scaled_value_unit_ = "s";
- value_multiplier = 1;
- } else if (maxValue >= 0.001) {
- scaled_value_unit_ = "ms";
- value_multiplier = 1000;
- } else {
- scaled_value_unit_ = "us";
- value_multiplier = 1000000;
- }
-
- if (graph_) {
- scaleGraphData(*graph_->data(), value_multiplier);
- } else if (bars_) {
- scaleGraphData(*bars_->data(), value_multiplier);
+ if (hf_index_ > 0) {
+ if (proto_registrar_get_ftype(hf_index_) == FT_RELATIVE_TIME) {
+ return FORMAT_SIZE_UNIT_SECONDS;
+ }
+ // Could we look if it's BASE_UNIT_STRING and use that?
+ // One complication is that prefixes shouldn't be combined,
+ // and some unit strings are already prefixed units.
}
+ return FORMAT_SIZE_UNIT_NONE;
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
+ return FORMAT_SIZE_UNIT_BITS_S;
+ default:
+ return FORMAT_SIZE_UNIT_NONE;
}
}
@@ -2211,7 +2736,7 @@ void IOGraph::captureEvent(CaptureEvent e)
if ((e.captureContext() == CaptureEvent::File) &&
(e.eventType() == CaptureEvent::Closing))
{
- remove_tap_listener(this);
+ removeTapListener();
}
}
@@ -2222,6 +2747,38 @@ void IOGraph::reloadValueUnitField()
}
}
+// returns true if the current plot style shows zero values,
+// false if null values are omitted.
+bool IOGraph::showsZero() const
+{
+ switch (val_units_) {
+ case IOG_ITEM_UNIT_PACKETS:
+ case IOG_ITEM_UNIT_BYTES:
+ case IOG_ITEM_UNIT_BITS:
+ case IOG_ITEM_UNIT_CALC_FRAMES:
+ case IOG_ITEM_UNIT_CALC_FIELDS:
+ if (graph_ && graph_->lineStyle() == QCPGraph::lsNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ case IOG_ITEM_UNIT_CALC_SUM:
+ case IOG_ITEM_UNIT_CALC_MAX:
+ case IOG_ITEM_UNIT_CALC_MIN:
+ case IOG_ITEM_UNIT_CALC_AVERAGE:
+ case IOG_ITEM_UNIT_CALC_LOAD:
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
+ // These are not the same sort of "omitted zeros" as above,
+ // but changing val_units_ always results in a recalculation
+ // so it doesn't matter (see modelDataChanged)
+ return false;
+
+ default:
+ return true;
+ }
+}
+
// Check if a packet is available at the given interval (idx).
bool IOGraph::hasItemToShow(int idx, double value) const
{
@@ -2237,7 +2794,7 @@ bool IOGraph::hasItemToShow(int idx, double value) const
case IOG_ITEM_UNIT_BITS:
case IOG_ITEM_UNIT_CALC_FRAMES:
case IOG_ITEM_UNIT_CALC_FIELDS:
- if(value == 0.0 && (graph_ && graph_->scatterStyle().shape() != QCPScatterStyle::ssNone)) {
+ if (value == 0.0 && (graph_ && graph_->lineStyle() == QCPGraph::lsNone)) {
result = false;
}
else {
@@ -2250,6 +2807,7 @@ bool IOGraph::hasItemToShow(int idx, double value) const
case IOG_ITEM_UNIT_CALC_MIN:
case IOG_ITEM_UNIT_CALC_AVERAGE:
case IOG_ITEM_UNIT_CALC_LOAD:
+ case IOG_ITEM_UNIT_CALC_THROUGHPUT:
if (item->fields) {
result = true;
}
@@ -2266,6 +2824,9 @@ bool IOGraph::hasItemToShow(int idx, double value) const
void IOGraph::setInterval(int interval)
{
interval_ = interval;
+ if (bars_) {
+ bars_->setWidth(interval_ / SCALE_F);
+ }
}
// Get the value at the given interval (idx) for the current value unit.
@@ -2273,7 +2834,7 @@ double IOGraph::getItemValue(int idx, const capture_file *cap_file) const
{
ws_assert(idx < max_io_items_);
- return get_io_graph_item(items_, val_units_, idx, hf_index_, cap_file, interval_, cur_idx_);
+ return get_io_graph_item(&items_[0], val_units_, idx, hf_index_, cap_file, interval_, cur_idx_);
}
// "tap_reset" callback for register_tap_listener
@@ -2294,27 +2855,60 @@ tap_packet_status IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dis
return TAP_PACKET_DONT_REDRAW;
}
- int idx = get_io_graph_index(pinfo, iog->interval_);
+ int64_t tmp_idx = get_io_graph_index(pinfo, iog->interval_);
bool recalc = false;
/* some sanity checks */
- if ((idx < 0) || (idx >= max_io_items_)) {
- iog->cur_idx_ = max_io_items_ - 1;
+ if ((tmp_idx < 0) || (tmp_idx >= max_io_items_)) {
+ iog->cur_idx_ = (int)iog->items_.size() - 1;
return TAP_PACKET_DONT_REDRAW;
}
+ int idx = (int)tmp_idx;
+ /* If the graph isn't visible, don't do the work or redraw, but mark
+ * the graph in need of a retap if it is ever enabled. The alternative
+ * is to do the work, but clear pending retaps when the taps are reset
+ * (which indicates something else triggered a retap.) The tradeoff would
+ * be more calculation and memory usage when a graph is disabled in
+ * exchange for fewer scenarios that involve retaps when toggling the
+ * enabled/disabled taps.
+ */
+ if (!iog->visible()) {
+ if (idx > iog->cur_idx_) {
+ iog->need_retap_ = true;
+ }
+ return TAP_PACKET_DONT_REDRAW;
+ }
+
+ if ((size_t)idx >= iog->items_.size()) {
+ const size_t old_size = iog->items_.size();
+ size_t new_size;
+ if (old_size == 0) {
+ new_size = 1024;
+ } else {
+ new_size = MIN((old_size * 3) / 2, max_io_items_);
+ }
+ new_size = MAX(new_size, (size_t)idx + 1);
+ try {
+ iog->items_.resize(new_size);
+ } catch (std::bad_alloc&) {
+ // std::vector.resize() has strong exception safety
+ ws_warning("Failed memory allocation!");
+ return TAP_PACKET_DONT_REDRAW;
+ }
+ // resize zero-initializes new items, which is what we want
+ //reset_io_graph_items(&iog->items_[old_size], new_size - old_size);
+ }
+
/* update num_items */
if (idx > iog->cur_idx_) {
- iog->cur_idx_ = (guint32) idx;
+ iog->cur_idx_ = idx;
recalc = true;
}
/* set start time */
- if (iog->start_time_ == 0.0) {
- nstime_t start_nstime;
- nstime_set_zero(&start_nstime);
- nstime_delta(&start_nstime, &pinfo->abs_ts, &pinfo->rel_ts);
- iog->start_time_ = nstime_to_sec(&start_nstime);
+ if (nstime_is_zero(&iog->start_time_)) {
+ nstime_delta(&iog->start_time_, &pinfo->abs_ts, &pinfo->rel_ts);
}
epan_dissect_t *adv_edt = NULL;
@@ -2323,7 +2917,7 @@ tap_packet_status IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dis
adv_edt = edt;
}
- if (!update_io_graph_item(iog->items_, idx, pinfo, adv_edt, iog->hf_index_, iog->val_units_, iog->interval_)) {
+ if (!update_io_graph_item(&iog->items_[0], idx, pinfo, adv_edt, iog->hf_index_, iog->val_units_, iog->interval_)) {
return TAP_PACKET_DONT_REDRAW;
}
diff --git a/ui/qt/io_graph_dialog.h b/ui/qt/io_graph_dialog.h
index f0bd4cdf..736ec93d 100644
--- a/ui/qt/io_graph_dialog.h
+++ b/ui/qt/io_graph_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "epan/epan_dissect.h"
#include "epan/prefs.h"
#include "ui/preference_utils.h"
@@ -25,12 +23,20 @@
#include <ui/qt/models/uat_model.h>
#include <ui/qt/models/uat_delegate.h>
+#include <wsutil/str_util.h>
+
+#include <QPointer>
#include <QIcon>
#include <QMenu>
#include <QTextStream>
+#include <QItemSelection>
+
+#include <vector>
class QRubberBand;
class QTimer;
+class QAbstractButton;
+class CopyFromProfileButton;
class QCPBars;
class QCPGraph;
@@ -39,8 +45,16 @@ class QCustomPlot;
class QCPAxisTicker;
class QCPAxisTickerDateTime;
-// GTK+ sets this to 100000 (NUM_IO_ITEMS)
-const int max_io_items_ = 250000;
+// GTK+ set this to 100000 (NUM_IO_ITEMS) before raising it to unlimited
+// in commit 524583298beb671f43e972476693866754d38a38.
+// This is the maximum index returned from get_io_graph_index that will
+// be added to the graph. Thus, for a minimum interval size of 1 μs no
+// more than 33.55 s.
+// Each io_graph_item_t is 88 bytes on a system with 64 bit time_t, so
+// the max size we'll attempt to allocate for the array of items is 2.75 GiB
+// (plus a tiny amount extra for the std::vector bookkeeping.)
+// 2^25 = 16777216
+const int max_io_items_ = 1 << 25;
// XXX - Move to its own file?
class IOGraph : public QObject {
@@ -51,33 +65,37 @@ public:
explicit IOGraph(QCustomPlot *parent);
~IOGraph();
- const QString configError() { return config_err_; }
- const QString name() { return name_; }
+ QString configError() const { return config_err_; }
+ QString name() const { return name_; }
void setName(const QString &name);
- const QString filter() { return filter_; }
- void setFilter(const QString &filter);
+ QString filter() const { return filter_; }
+ bool setFilter(const QString &filter);
void applyCurrentColor();
- bool visible() { return visible_; }
+ bool visible() const { return visible_; }
void setVisible(bool visible);
- QRgb color();
+ bool needRetap() const { return need_retap_; }
+ void setNeedRetap(bool retap);
+ QRgb color() const;
void setColor(const QRgb color);
void setPlotStyle(int style);
- const QString valueUnitLabel();
+ QString valueUnitLabel() const;
+ format_size_units_e formatUnits() const;
+ io_graph_item_unit_t valueUnits() const { return val_units_; }
void setValueUnits(int val_units);
- const QString valueUnitField() { return vu_field_; }
+ QString valueUnitField() const { return vu_field_; }
void setValueUnitField(const QString &vu_field);
- unsigned int movingAveragePeriod() { return moving_avg_period_; }
+ unsigned int movingAveragePeriod() const { return moving_avg_period_; }
void setInterval(int interval);
bool addToLegend();
bool removeFromLegend();
- QCPGraph *graph() { return graph_; }
- QCPBars *bars() { return bars_; }
- double startOffset();
- int packetFromTime(double ts);
+ QCPGraph *graph() const { return graph_; }
+ QCPBars *bars() const { return bars_; }
+ double startOffset() const;
+ nstime_t startTime() const;
+ int packetFromTime(double ts) const;
bool hasItemToShow(int idx, double value) const;
double getItemValue(int idx, const capture_file *cap_file) const;
int maxInterval () const { return cur_idx_; }
- QString scaledValueUnit() const { return scaled_value_unit_; }
void clearAllData();
@@ -85,7 +103,7 @@ public:
unsigned int y_axis_factor_;
public slots:
- void recalcGraphData(capture_file *cap_file, bool enable_scaling);
+ void recalcGraphData(capture_file *cap_file);
void captureEvent(CaptureEvent e);
void reloadValueUnitField();
@@ -100,28 +118,33 @@ private:
static tap_packet_status tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags);
static void tapDraw(void *iog_ptr);
- void calculateScaledValueUnit();
+ void removeTapListener();
+
+ bool showsZero() const;
+
template<class DataMap> double maxValueFromGraphData(const DataMap &map);
template<class DataMap> void scaleGraphData(DataMap &map, int scalar);
QCustomPlot *parent_;
QString config_err_;
QString name_;
+ bool tap_registered_;
bool visible_;
+ bool need_retap_;
QCPGraph *graph_;
QCPBars *bars_;
QString filter_;
+ QString full_filter_; // Includes vu_field_ if used
QBrush color_;
io_graph_item_unit_t val_units_;
QString vu_field_;
int hf_index_;
int interval_;
- double start_time_;
- QString scaled_value_unit_;
+ nstime_t start_time_;
// Cached data. We should be able to change the Y axis without retapping as
// much as is feasible.
- io_graph_item_t items_[max_io_items_];
+ std::vector<io_graph_item_t> items_;
int cur_idx_;
};
@@ -134,40 +157,50 @@ class IOGraphDialog : public WiresharkDialog
Q_OBJECT
public:
- explicit IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter = QString());
+ explicit IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFilter = QString(), io_graph_item_unit_t value_units = IOG_ITEM_UNIT_PACKETS, QString yfield = QString());
~IOGraphDialog();
enum UatColumns { colEnabled = 0, colName, colDFilter, colColor, colStyle, colYAxis, colYField, colSMAPeriod, colYAxisFactor, colMaxNum};
void addGraph(bool checked, QString name, QString dfilter, QRgb color_idx, IOGraph::PlotStyles style,
io_graph_item_unit_t value_units, QString yfield, int moving_average, int yaxisfactor);
+ void addGraph(bool checked, QString dfilter, io_graph_item_unit_t value_units, QString yfield);
void addGraph(bool copy_from_current = false);
void addDefaultGraph(bool enabled, int idx = 0);
void syncGraphSettings(int row);
+ qsizetype graphCount() const;
public slots:
void scheduleReplot(bool now = false);
void scheduleRecalc(bool now = false);
void scheduleRetap(bool now = false);
- void modelRowsReset();
void reloadFields();
protected:
+ void captureFileClosing();
void keyPressEvent(QKeyEvent *event);
void reject();
+protected slots:
+ void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
+ void modelRowsReset();
+ void modelRowsInserted(const QModelIndex &parent, int first, int last);
+ void modelRowsRemoved(const QModelIndex &parent, int first, int last);
+ void modelRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow);
+
signals:
void goToPacket(int packet_num);
- void recalcGraphData(capture_file *cap_file, bool enable_scaling);
+ void recalcGraphData(capture_file *cap_file);
void intervalChanged(int interval);
void reloadValueUnitFields();
private:
Ui::IOGraphDialog *ui;
+ CopyFromProfileButton *copy_profile_bt_;
//Model and delegate were chosen over UatFrame because add/remove/copy
//buttons would need realignment (UatFrame has its own)
- UatModel *uat_model_;
+ QPointer<UatModel> uat_model_;
UatDelegate *uat_delegate_;
// XXX - This needs to stay synced with UAT index
@@ -176,8 +209,8 @@ private:
QString hint_err_;
QCPGraph *base_graph_;
QCPItemTracer *tracer_;
- guint32 packet_num_;
- double start_time_;
+ uint32_t packet_num_;
+ nstime_t start_time_;
bool mouse_drags_;
QRubberBand *rubber_band_;
QPoint rb_origin_;
@@ -187,6 +220,7 @@ private:
bool need_recalc_; // Medium weight: recalculate values, then replot
bool need_retap_; // Heavy weight: re-read packet data
bool auto_axes_;
+ int precision_;
QSharedPointer<QCPAxisTicker> number_ticker_;
QSharedPointer<QCPAxisTickerDateTime> datetime_ticker_;
@@ -199,6 +233,7 @@ private:
void panAxes(int x_pixels, int y_pixels);
void toggleTracerStyle(bool force_default = false);
void getGraphInfo();
+ void updateHint();
void updateLegend();
QRectF getZoomRanges(QRect zoom_rect);
void createIOGraph(int currentRow);
@@ -209,22 +244,26 @@ private:
bool graphIsEnabled(int row) const;
private slots:
+ static void applyChanges();
+
void copyFromProfile(QString filename);
void updateWidgets();
+ void showContextMenu(const QPoint &pos);
void graphClicked(QMouseEvent *event);
void mouseMoved(QMouseEvent *event);
void mouseReleased(QMouseEvent *event);
+ void selectedFrameChanged(QList<int> frames);
+ void moveLegend();
void resetAxes();
void updateStatistics(void);
void copyAsCsvClicked();
+ void graphUatSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void on_intervalComboBox_currentIndexChanged(int index);
void on_todCheckBox_toggled(bool checked);
- void modelDataChanged(const QModelIndex &index);
void on_graphUat_currentItemChanged(const QModelIndex &current, const QModelIndex &previous);
- void on_resetButton_clicked();
void on_logCheckBox_toggled(bool checked);
void on_automaticUpdateCheckBox_toggled(bool checked);
void on_enableLegendCheckBox_toggled(bool checked);
@@ -257,6 +296,7 @@ private slots:
void on_actionCrosshairs_triggered();
void on_buttonBox_helpRequested();
void on_buttonBox_accepted();
+ void buttonBoxClicked(QAbstractButton *button);
};
#endif // IO_GRAPH_DIALOG_H
diff --git a/ui/qt/io_graph_dialog.ui b/ui/qt/io_graph_dialog.ui
index 91f071ee..25cc41c7 100644
--- a/ui/qt/io_graph_dialog.ui
+++ b/ui/qt/io_graph_dialog.ui
@@ -72,7 +72,7 @@
</item>
</layout>
</widget>
- <widget class="TabnavTreeView" name="graphUat">
+ <widget class="RowMoveTreeView" name="graphUat">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@@ -97,14 +97,14 @@
<item>
<widget class="StockIconToolButton" name="deleteToolButton">
<property name="toolTip">
- <string>Remove this graph.</string>
+ <string>Remove the selected graph(s).</string>
</property>
</widget>
</item>
<item>
<widget class="StockIconToolButton" name="copyToolButton">
<property name="toolTip">
- <string>Duplicate this graph.</string>
+ <string>Duplicate the selected graph(s).</string>
</property>
<property name="text">
<string/>
@@ -112,32 +112,32 @@
</widget>
</item>
<item>
- <widget class="StockIconToolButton" name="clearToolButton">
+ <widget class="StockIconToolButton" name="moveUpwardsToolButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Clear all graphs.</string>
+ <string>Move the selected graph(s) upwards.</string>
</property>
</widget>
</item>
<item>
- <widget class="StockIconToolButton" name="moveUpwardsToolButton">
+ <widget class="StockIconToolButton" name="moveDownwardsToolButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Move this graph upwards.</string>
+ <string>Move the selected graph(s) downwards.</string>
</property>
</widget>
</item>
<item>
- <widget class="StockIconToolButton" name="moveDownwardsToolButton">
+ <widget class="StockIconToolButton" name="clearToolButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Move this graph downwards.</string>
+ <string>Clear all graphs.</string>
</property>
</widget>
</item>
@@ -290,26 +290,6 @@
</property>
</widget>
</item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="resetButton">
- <property name="text">
- <string>Reset</string>
- </property>
- </widget>
- </item>
</layout>
</item>
<item>
@@ -318,7 +298,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
- <set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Save</set>
+ <set>QDialogButtonBox::Close|QDialogButtonBox::Help|QDialogButtonBox::Save|QDialogButtonBox::Reset</set>
</property>
</widget>
</item>
@@ -540,9 +520,14 @@
<header>widgets/elided_label.h</header>
</customwidget>
<customwidget>
- <class>TabnavTreeView</class>
+ <class>RowMoveTreeView</class>
<extends>QTreeView</extends>
- <header>widgets/tabnav_tree_view.h</header>
+ <header>widgets/rowmove_tree_view.h</header>
+ </customwidget>
+ <customwidget>
+ <class>ResizeHeaderView</class>
+ <extends>QHeaderView</extends>
+ <header>widgets/resize_header_view.h</header>
</customwidget>
<customwidget>
<class>StockIconToolButton</class>
@@ -555,6 +540,11 @@
<header>widgets/qcustomplot.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>QCPStringLegendItem</class>
+ <extends>QCPAbstractLegendItem</extends>
+ <header>widgets/qcp_string_legend_item.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections>
diff --git a/ui/qt/layout_preferences_frame.cpp b/ui/qt/layout_preferences_frame.cpp
index 07b97c57..693ef228 100644
--- a/ui/qt/layout_preferences_frame.cpp
+++ b/ui/qt/layout_preferences_frame.cpp
@@ -358,22 +358,22 @@ void LayoutPreferencesFrame::on_restoreButtonBox_clicked(QAbstractButton *)
void LayoutPreferencesFrame::on_packetListSeparatorCheckBox_toggled(bool checked)
{
- prefs_set_bool_value(pref_packet_list_separator_, (gboolean) checked, pref_stashed);
+ prefs_set_bool_value(pref_packet_list_separator_, (bool) checked, pref_stashed);
}
void LayoutPreferencesFrame::on_packetListHeaderShowColumnDefinition_toggled(bool checked)
{
- prefs_set_bool_value(pref_packet_header_column_definition_, (gboolean) checked, pref_stashed);
+ prefs_set_bool_value(pref_packet_header_column_definition_, (bool) checked, pref_stashed);
}
void LayoutPreferencesFrame::on_packetListHoverStyleCheckbox_toggled(bool checked)
{
- prefs_set_bool_value(pref_packet_list_hover_style_, (gboolean) checked, pref_stashed);
+ prefs_set_bool_value(pref_packet_list_hover_style_, (bool) checked, pref_stashed);
}
void LayoutPreferencesFrame::on_packetListAllowSorting_toggled(bool checked)
{
- prefs_set_bool_value(pref_packet_list_sorting_, (gboolean) checked, pref_stashed);
+ prefs_set_bool_value(pref_packet_list_sorting_, (bool) checked, pref_stashed);
}
void LayoutPreferencesFrame::on_packetListCachedRowsLineEdit_textEdited(const QString &new_str)
@@ -387,10 +387,10 @@ void LayoutPreferencesFrame::on_packetListCachedRowsLineEdit_textEdited(const QS
void LayoutPreferencesFrame::on_statusBarShowSelectedPacketCheckBox_toggled(bool checked)
{
- prefs_set_bool_value(pref_show_selected_packet_, (gboolean) checked, pref_stashed);
+ prefs_set_bool_value(pref_show_selected_packet_, (bool) checked, pref_stashed);
}
void LayoutPreferencesFrame::on_statusBarShowFileLoadTimeCheckBox_toggled(bool checked)
{
- prefs_set_bool_value(pref_show_file_load_time_, (gboolean) checked, pref_stashed);
+ prefs_set_bool_value(pref_show_file_load_time_, (bool) checked, pref_stashed);
}
diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp
index 9391183e..9f8b9301 100644
--- a/ui/qt/lbm_lbtrm_transport_dialog.cpp
+++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp
@@ -69,7 +69,7 @@ namespace
static const double OneGigabit = OneMegabit * OneKilobit;
}
-static QString format_rate(const nstime_t & elapsed, guint64 bytes)
+static QString format_rate(const nstime_t & elapsed, uint64_t bytes)
{
QString result;
double elapsed_sec;
@@ -143,15 +143,15 @@ static QString format_rate(const nstime_t & elapsed, guint64 bytes)
class LBMLBTRMFrameEntry : public QTreeWidgetItem
{
public:
- LBMLBTRMFrameEntry(guint32 frame);
+ LBMLBTRMFrameEntry(uint32_t frame);
virtual ~LBMLBTRMFrameEntry(void) { }
- guint32 getFrame(void) { return (m_frame); }
+ uint32_t getFrame(void) { return (m_frame); }
private:
- guint32 m_frame;
+ uint32_t m_frame;
};
-LBMLBTRMFrameEntry::LBMLBTRMFrameEntry(guint32 frame) :
+LBMLBTRMFrameEntry::LBMLBTRMFrameEntry(uint32_t frame) :
QTreeWidgetItem(),
m_frame(frame)
{
@@ -160,25 +160,25 @@ LBMLBTRMFrameEntry::LBMLBTRMFrameEntry(guint32 frame) :
setText(Detail_Frame_Column, QString("%1").arg(m_frame));
}
-typedef QMap<guint32, LBMLBTRMFrameEntry *> LBMLBTRMFrameMap;
-typedef QMap<guint32, LBMLBTRMFrameEntry *>::iterator LBMLBTRMFrameMapIterator;
+typedef QMap<uint32_t, LBMLBTRMFrameEntry *> LBMLBTRMFrameMap;
+typedef QMap<uint32_t, LBMLBTRMFrameEntry *>::iterator LBMLBTRMFrameMapIterator;
// A SQN (SeQuence Number) entry
class LBMLBTRMSQNEntry : public QTreeWidgetItem
{
public:
- LBMLBTRMSQNEntry(guint32 sqn);
+ LBMLBTRMSQNEntry(uint32_t sqn);
virtual ~LBMLBTRMSQNEntry(void);
- void processFrame(guint32 frame);
+ void processFrame(uint32_t frame);
private:
LBMLBTRMSQNEntry(void);
- guint32 m_sqn;
- guint32 m_count;
+ uint32_t m_sqn;
+ uint32_t m_count;
LBMLBTRMFrameMap m_frames;
};
-LBMLBTRMSQNEntry::LBMLBTRMSQNEntry(guint32 sqn) :
+LBMLBTRMSQNEntry::LBMLBTRMSQNEntry(uint32_t sqn) :
QTreeWidgetItem(),
m_sqn(sqn),
m_count(0),
@@ -200,7 +200,7 @@ LBMLBTRMSQNEntry::~LBMLBTRMSQNEntry(void)
m_frames.clear();
}
-void LBMLBTRMSQNEntry::processFrame(guint32 frame)
+void LBMLBTRMSQNEntry::processFrame(uint32_t frame)
{
LBMLBTRMFrameMapIterator it;
@@ -221,19 +221,19 @@ void LBMLBTRMSQNEntry::processFrame(guint32 frame)
class LBMLBTRMNCFReasonEntry : public QTreeWidgetItem
{
public:
- LBMLBTRMNCFReasonEntry(guint8 reason);
+ LBMLBTRMNCFReasonEntry(uint8_t reason);
virtual ~LBMLBTRMNCFReasonEntry(void);
- void processFrame(guint32 frame);
+ void processFrame(uint32_t frame);
private:
LBMLBTRMNCFReasonEntry(void);
- guint8 m_reason;
+ uint8_t m_reason;
QString m_reason_string;
- guint32 m_count;
+ uint32_t m_count;
LBMLBTRMFrameMap m_frames;
};
-LBMLBTRMNCFReasonEntry::LBMLBTRMNCFReasonEntry(guint8 reason) :
+LBMLBTRMNCFReasonEntry::LBMLBTRMNCFReasonEntry(uint8_t reason) :
QTreeWidgetItem(),
m_reason(reason),
m_reason_string(),
@@ -273,7 +273,7 @@ LBMLBTRMNCFReasonEntry::~LBMLBTRMNCFReasonEntry(void)
m_frames.clear();
}
-void LBMLBTRMNCFReasonEntry::processFrame(guint32 frame)
+void LBMLBTRMNCFReasonEntry::processFrame(uint32_t frame)
{
LBMLBTRMFrameMapIterator it;
@@ -290,25 +290,25 @@ void LBMLBTRMNCFReasonEntry::processFrame(guint32 frame)
setTextAlignment(Detail_Count_Column, Qt::AlignRight);
}
-typedef QMap<guint32, LBMLBTRMNCFReasonEntry *> LBMLBTRMNCFReasonMap;
-typedef QMap<guint32, LBMLBTRMNCFReasonEntry *>::iterator LBMLBTRMNCFReasonMapIterator;
+typedef QMap<uint32_t, LBMLBTRMNCFReasonEntry *> LBMLBTRMNCFReasonMap;
+typedef QMap<uint32_t, LBMLBTRMNCFReasonEntry *>::iterator LBMLBTRMNCFReasonMapIterator;
// An NCF SQN entry
class LBMLBTRMNCFSQNEntry : public QTreeWidgetItem
{
public:
- LBMLBTRMNCFSQNEntry(guint32 sqn);
+ LBMLBTRMNCFSQNEntry(uint32_t sqn);
virtual ~LBMLBTRMNCFSQNEntry(void);
- void processFrame(guint8 reason, guint32 frame);
+ void processFrame(uint8_t reason, uint32_t frame);
private:
LBMLBTRMNCFSQNEntry(void);
- guint32 m_sqn;
- guint32 m_count;
+ uint32_t m_sqn;
+ uint32_t m_count;
LBMLBTRMNCFReasonMap m_reasons;
};
-LBMLBTRMNCFSQNEntry::LBMLBTRMNCFSQNEntry(guint32 sqn) :
+LBMLBTRMNCFSQNEntry::LBMLBTRMNCFSQNEntry(uint32_t sqn) :
QTreeWidgetItem(),
m_sqn(sqn),
m_count(0),
@@ -330,7 +330,7 @@ LBMLBTRMNCFSQNEntry::~LBMLBTRMNCFSQNEntry(void)
m_reasons.clear();
}
-void LBMLBTRMNCFSQNEntry::processFrame(guint8 reason, guint32 frame)
+void LBMLBTRMNCFSQNEntry::processFrame(uint8_t reason, uint32_t frame)
{
LBMLBTRMNCFReasonMapIterator it;
LBMLBTRMNCFReasonEntry * entry = NULL;
@@ -353,10 +353,10 @@ void LBMLBTRMNCFSQNEntry::processFrame(guint8 reason, guint32 frame)
entry->processFrame(frame);
}
-typedef QMap<guint32, LBMLBTRMSQNEntry *> LBMLBTRMSQNMap;
-typedef QMap<guint32, LBMLBTRMSQNEntry *>::iterator LBMLBTRMSQNMapIterator;
-typedef QMap<guint32, LBMLBTRMNCFSQNEntry *> LBMLBTRMNCFSQNMap;
-typedef QMap<guint32, LBMLBTRMNCFSQNEntry *>::iterator LBMLBTRMNCFSQNMapIterator;
+typedef QMap<uint32_t, LBMLBTRMSQNEntry *> LBMLBTRMSQNMap;
+typedef QMap<uint32_t, LBMLBTRMSQNEntry *>::iterator LBMLBTRMSQNMapIterator;
+typedef QMap<uint32_t, LBMLBTRMNCFSQNEntry *> LBMLBTRMNCFSQNMap;
+typedef QMap<uint32_t, LBMLBTRMNCFSQNEntry *>::iterator LBMLBTRMNCFSQNMapIterator;
// A source transport entry
class LBMLBTRMSourceTransportEntry : public QTreeWidgetItem
@@ -373,15 +373,15 @@ class LBMLBTRMSourceTransportEntry : public QTreeWidgetItem
private:
void fillItem(void);
- guint64 m_data_frames;
- guint64 m_data_bytes;
- guint64 m_rx_data_frames;
- guint64 m_rx_data_bytes;
- guint64 m_ncf_frames;
- guint64 m_ncf_count;
- guint64 m_ncf_bytes;
- guint64 m_sm_frames;
- guint64 m_sm_bytes;
+ uint64_t m_data_frames;
+ uint64_t m_data_bytes;
+ uint64_t m_rx_data_frames;
+ uint64_t m_rx_data_bytes;
+ uint64_t m_ncf_frames;
+ uint64_t m_ncf_count;
+ uint64_t m_ncf_bytes;
+ uint64_t m_sm_frames;
+ uint64_t m_sm_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
@@ -502,13 +502,13 @@ void LBMLBTRMSourceTransportEntry::processPacket(const packet_info * pinfo, cons
}
else if (tap_info->type == LBTRM_PACKET_TYPE_NCF)
{
- guint16 idx;
+ uint16_t idx;
LBMLBTRMNCFSQNMapIterator it;
LBMLBTRMNCFSQNEntry * sqn = NULL;
m_ncf_frames++;
m_ncf_bytes += pinfo->fd->pkt_len;
- m_ncf_count += (guint64)tap_info->num_sqns;
+ m_ncf_count += (uint64_t)tap_info->num_sqns;
for (idx = 0; idx < tap_info->num_sqns; idx++)
{
it = m_ncf_sqns.find(tap_info->sqns[idx]);
@@ -612,15 +612,15 @@ class LBMLBTRMSourceEntry : public QTreeWidgetItem
void fillItem(void);
QString m_address;
QString m_transport;
- guint64 m_data_frames;
- guint64 m_data_bytes;
- guint64 m_rx_data_frames;
- guint64 m_rx_data_bytes;
- guint64 m_ncf_frames;
- guint64 m_ncf_count;
- guint64 m_ncf_bytes;
- guint64 m_sm_frames;
- guint64 m_sm_bytes;
+ uint64_t m_data_frames;
+ uint64_t m_data_bytes;
+ uint64_t m_rx_data_frames;
+ uint64_t m_rx_data_bytes;
+ uint64_t m_ncf_frames;
+ uint64_t m_ncf_count;
+ uint64_t m_ncf_bytes;
+ uint64_t m_sm_frames;
+ uint64_t m_sm_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
@@ -783,9 +783,9 @@ class LBMLBTRMReceiverTransportEntry : public QTreeWidgetItem
private:
void fillItem(void);
QString m_transport;
- guint64 m_nak_frames;
- guint64 m_nak_count;
- guint64 m_nak_bytes;
+ uint64_t m_nak_frames;
+ uint64_t m_nak_count;
+ uint64_t m_nak_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
@@ -839,7 +839,7 @@ void LBMLBTRMReceiverTransportEntry::processPacket(const packet_info * pinfo, co
}
if (tap_info->type == LBTRM_PACKET_TYPE_NAK)
{
- guint16 idx;
+ uint16_t idx;
LBMLBTRMSQNEntry * sqn = NULL;
LBMLBTRMSQNMapIterator it;
@@ -899,9 +899,9 @@ class LBMLBTRMReceiverEntry : public QTreeWidgetItem
void fillItem(void);
QString m_address;
QString m_transport;
- guint64 m_nak_frames;
- guint64 m_nak_count;
- guint64 m_nak_bytes;
+ uint64_t m_nak_frames;
+ uint64_t m_nak_count;
+ uint64_t m_nak_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
diff --git a/ui/qt/lbm_lbtrm_transport_dialog.h b/ui/qt/lbm_lbtrm_transport_dialog.h
index 2e31dc50..5e6b66be 100644
--- a/ui/qt/lbm_lbtrm_transport_dialog.h
+++ b/ui/qt/lbm_lbtrm_transport_dialog.h
@@ -14,8 +14,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include <epan/packet_info.h>
#include <epan/tap.h>
diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp
index 529d7776..cc98c3d5 100644
--- a/ui/qt/lbm_lbtru_transport_dialog.cpp
+++ b/ui/qt/lbm_lbtru_transport_dialog.cpp
@@ -87,7 +87,7 @@ namespace
static const double OneGigabit = OneMegabit * OneKilobit;
}
-static QString format_rate(const nstime_t & elapsed, guint64 bytes)
+static QString format_rate(const nstime_t & elapsed, uint64_t bytes)
{
QString result;
double elapsed_sec;
@@ -161,15 +161,15 @@ static QString format_rate(const nstime_t & elapsed, guint64 bytes)
class LBMLBTRUFrameEntry : public QTreeWidgetItem
{
public:
- LBMLBTRUFrameEntry(guint32 frame);
+ LBMLBTRUFrameEntry(uint32_t frame);
virtual ~LBMLBTRUFrameEntry(void) { }
- guint32 getFrame(void) { return (m_frame); }
+ uint32_t getFrame(void) { return (m_frame); }
private:
- guint32 m_frame;
+ uint32_t m_frame;
};
-LBMLBTRUFrameEntry::LBMLBTRUFrameEntry(guint32 frame) :
+LBMLBTRUFrameEntry::LBMLBTRUFrameEntry(uint32_t frame) :
QTreeWidgetItem(),
m_frame(frame)
{
@@ -178,25 +178,25 @@ LBMLBTRUFrameEntry::LBMLBTRUFrameEntry(guint32 frame) :
setText(Detail_Frame_Column, QString("%1").arg(m_frame));
}
-typedef QMap<guint32, LBMLBTRUFrameEntry *> LBMLBTRUFrameMap;
-typedef QMap<guint32, LBMLBTRUFrameEntry *>::iterator LBMLBTRUFrameMapIterator;
+typedef QMap<uint32_t, LBMLBTRUFrameEntry *> LBMLBTRUFrameMap;
+typedef QMap<uint32_t, LBMLBTRUFrameEntry *>::iterator LBMLBTRUFrameMapIterator;
// An SQN (SeQuence Number) entry
class LBMLBTRUSQNEntry : public QTreeWidgetItem
{
public:
- LBMLBTRUSQNEntry(guint32 sqn);
+ LBMLBTRUSQNEntry(uint32_t sqn);
virtual ~LBMLBTRUSQNEntry(void);
- void processFrame(guint32 frame);
+ void processFrame(uint32_t frame);
private:
LBMLBTRUSQNEntry(void);
- guint32 m_sqn;
- guint32 m_count;
+ uint32_t m_sqn;
+ uint32_t m_count;
LBMLBTRUFrameMap m_frames;
};
-LBMLBTRUSQNEntry::LBMLBTRUSQNEntry(guint32 sqn) :
+LBMLBTRUSQNEntry::LBMLBTRUSQNEntry(uint32_t sqn) :
QTreeWidgetItem(),
m_sqn(sqn),
m_count(0),
@@ -218,7 +218,7 @@ LBMLBTRUSQNEntry::~LBMLBTRUSQNEntry(void)
m_frames.clear();
}
-void LBMLBTRUSQNEntry::processFrame(guint32 frame)
+void LBMLBTRUSQNEntry::processFrame(uint32_t frame)
{
LBMLBTRUFrameMapIterator it;
@@ -239,18 +239,18 @@ void LBMLBTRUSQNEntry::processFrame(guint32 frame)
class LBMLBTRUNCFReasonEntry : public QTreeWidgetItem
{
public:
- LBMLBTRUNCFReasonEntry(guint8 reason);
+ LBMLBTRUNCFReasonEntry(uint8_t reason);
virtual ~LBMLBTRUNCFReasonEntry(void);
- void processFrame(guint32 frame);
+ void processFrame(uint32_t frame);
private:
LBMLBTRUNCFReasonEntry(void);
- guint8 m_reason;
- guint32 m_count;
+ uint8_t m_reason;
+ uint32_t m_count;
LBMLBTRUFrameMap m_frames;
};
-LBMLBTRUNCFReasonEntry::LBMLBTRUNCFReasonEntry(guint8 reason) :
+LBMLBTRUNCFReasonEntry::LBMLBTRUNCFReasonEntry(uint8_t reason) :
QTreeWidgetItem(),
m_reason(reason),
m_count(0),
@@ -288,7 +288,7 @@ LBMLBTRUNCFReasonEntry::~LBMLBTRUNCFReasonEntry(void)
m_frames.clear();
}
-void LBMLBTRUNCFReasonEntry::processFrame(guint32 frame)
+void LBMLBTRUNCFReasonEntry::processFrame(uint32_t frame)
{
LBMLBTRUFrameMapIterator it;
@@ -305,25 +305,25 @@ void LBMLBTRUNCFReasonEntry::processFrame(guint32 frame)
setTextAlignment(Detail_Count_Column, Qt::AlignRight);
}
-typedef QMap<guint8, LBMLBTRUNCFReasonEntry *> LBMLBTRUNCFReasonMap;
-typedef QMap<guint8, LBMLBTRUNCFReasonEntry *>::iterator LBMLBTRUNCFReasonMapIterator;
+typedef QMap<uint8_t, LBMLBTRUNCFReasonEntry *> LBMLBTRUNCFReasonMap;
+typedef QMap<uint8_t, LBMLBTRUNCFReasonEntry *>::iterator LBMLBTRUNCFReasonMapIterator;
// An NCF SQN entry
class LBMLBTRUNCFSQNEntry : public QTreeWidgetItem
{
public:
- LBMLBTRUNCFSQNEntry(guint32 sqn);
+ LBMLBTRUNCFSQNEntry(uint32_t sqn);
virtual ~LBMLBTRUNCFSQNEntry(void);
- void processFrame(guint8 reason, guint32 frame);
+ void processFrame(uint8_t reason, uint32_t frame);
private:
LBMLBTRUNCFSQNEntry(void);
- guint32 m_sqn;
- guint32 m_count;
+ uint32_t m_sqn;
+ uint32_t m_count;
LBMLBTRUNCFReasonMap m_reasons;
};
-LBMLBTRUNCFSQNEntry::LBMLBTRUNCFSQNEntry(guint32 sqn) :
+LBMLBTRUNCFSQNEntry::LBMLBTRUNCFSQNEntry(uint32_t sqn) :
QTreeWidgetItem(),
m_sqn(sqn),
m_count(0),
@@ -345,7 +345,7 @@ LBMLBTRUNCFSQNEntry::~LBMLBTRUNCFSQNEntry(void)
m_reasons.clear();
}
-void LBMLBTRUNCFSQNEntry::processFrame(guint8 reason, guint32 frame)
+void LBMLBTRUNCFSQNEntry::processFrame(uint8_t reason, uint32_t frame)
{
LBMLBTRUNCFReasonMapIterator it;
LBMLBTRUNCFReasonEntry * entry = NULL;
@@ -372,19 +372,19 @@ void LBMLBTRUNCFSQNEntry::processFrame(guint8 reason, guint32 frame)
class LBMLBTRURSTReasonEntry : public QTreeWidgetItem
{
public:
- LBMLBTRURSTReasonEntry(guint32 reason);
+ LBMLBTRURSTReasonEntry(uint32_t reason);
virtual ~LBMLBTRURSTReasonEntry(void);
- void processFrame(guint32 frame);
+ void processFrame(uint32_t frame);
private:
LBMLBTRURSTReasonEntry(void);
- guint32 m_reason;
+ uint32_t m_reason;
QString m_reason_string;
- guint32 m_count;
+ uint32_t m_count;
LBMLBTRUFrameMap m_frames;
};
-LBMLBTRURSTReasonEntry::LBMLBTRURSTReasonEntry(guint32 reason) :
+LBMLBTRURSTReasonEntry::LBMLBTRURSTReasonEntry(uint32_t reason) :
QTreeWidgetItem(),
m_reason(reason),
m_reason_string(),
@@ -416,7 +416,7 @@ LBMLBTRURSTReasonEntry::~LBMLBTRURSTReasonEntry(void)
m_frames.clear();
}
-void LBMLBTRURSTReasonEntry::processFrame(guint32 frame)
+void LBMLBTRURSTReasonEntry::processFrame(uint32_t frame)
{
LBMLBTRUFrameMapIterator it;
@@ -437,19 +437,19 @@ void LBMLBTRURSTReasonEntry::processFrame(guint32 frame)
class LBMLBTRUCREQRequestEntry : public QTreeWidgetItem
{
public:
- LBMLBTRUCREQRequestEntry(guint32 request);
+ LBMLBTRUCREQRequestEntry(uint32_t request);
virtual ~LBMLBTRUCREQRequestEntry(void);
- void processFrame(guint32 frame);
+ void processFrame(uint32_t frame);
private:
LBMLBTRUCREQRequestEntry(void);
- guint32 m_request;
+ uint32_t m_request;
QString m_request_string;
- guint32 m_count;
+ uint32_t m_count;
LBMLBTRUFrameMap m_frames;
};
-LBMLBTRUCREQRequestEntry::LBMLBTRUCREQRequestEntry(guint32 request) :
+LBMLBTRUCREQRequestEntry::LBMLBTRUCREQRequestEntry(uint32_t request) :
QTreeWidgetItem(),
m_request(request),
m_request_string(),
@@ -481,7 +481,7 @@ LBMLBTRUCREQRequestEntry::~LBMLBTRUCREQRequestEntry(void)
m_frames.clear();
}
-void LBMLBTRUCREQRequestEntry::processFrame(guint32 frame)
+void LBMLBTRUCREQRequestEntry::processFrame(uint32_t frame)
{
LBMLBTRUFrameMapIterator it;
@@ -498,14 +498,14 @@ void LBMLBTRUCREQRequestEntry::processFrame(guint32 frame)
setTextAlignment(Detail_Count_Column, Qt::AlignRight);
}
-typedef QMap<guint32, LBMLBTRUSQNEntry *> LBMLBTRUSQNMap;
-typedef QMap<guint32, LBMLBTRUSQNEntry *>::iterator LBMLBTRUSQNMapIterator;
-typedef QMap<guint32, LBMLBTRUNCFSQNEntry *> LBMLBTRUNCFSQNMap;
-typedef QMap<guint32, LBMLBTRUNCFSQNEntry *>::iterator LBMLBTRUNCFSQNMapIterator;
-typedef QMap<guint32, LBMLBTRURSTReasonEntry *> LBMLBTRURSTReasonMap;
-typedef QMap<guint32, LBMLBTRURSTReasonEntry *>::iterator LBMLBTRURSTReasonMapIterator;
-typedef QMap<guint32, LBMLBTRUCREQRequestEntry *> LBMLBTRUCREQRequestMap;
-typedef QMap<guint32, LBMLBTRUCREQRequestEntry *>::iterator LBMLBTRUCREQRequestMapIterator;
+typedef QMap<uint32_t, LBMLBTRUSQNEntry *> LBMLBTRUSQNMap;
+typedef QMap<uint32_t, LBMLBTRUSQNEntry *>::iterator LBMLBTRUSQNMapIterator;
+typedef QMap<uint32_t, LBMLBTRUNCFSQNEntry *> LBMLBTRUNCFSQNMap;
+typedef QMap<uint32_t, LBMLBTRUNCFSQNEntry *>::iterator LBMLBTRUNCFSQNMapIterator;
+typedef QMap<uint32_t, LBMLBTRURSTReasonEntry *> LBMLBTRURSTReasonMap;
+typedef QMap<uint32_t, LBMLBTRURSTReasonEntry *>::iterator LBMLBTRURSTReasonMapIterator;
+typedef QMap<uint32_t, LBMLBTRUCREQRequestEntry *> LBMLBTRUCREQRequestMap;
+typedef QMap<uint32_t, LBMLBTRUCREQRequestEntry *>::iterator LBMLBTRUCREQRequestMapIterator;
// A source transport entry
class LBMLBTRUSourceTransportEntry : public QTreeWidgetItem
@@ -522,17 +522,17 @@ class LBMLBTRUSourceTransportEntry : public QTreeWidgetItem
private:
void fillItem(void);
- guint64 m_data_frames;
- guint64 m_data_bytes;
- guint64 m_rx_data_frames;
- guint64 m_rx_data_bytes;
- guint64 m_ncf_frames;
- guint64 m_ncf_count;
- guint64 m_ncf_bytes;
- guint64 m_sm_frames;
- guint64 m_sm_bytes;
- guint64 m_rst_frames;
- guint64 m_rst_bytes;
+ uint64_t m_data_frames;
+ uint64_t m_data_bytes;
+ uint64_t m_rx_data_frames;
+ uint64_t m_rx_data_bytes;
+ uint64_t m_ncf_frames;
+ uint64_t m_ncf_count;
+ uint64_t m_ncf_bytes;
+ uint64_t m_sm_frames;
+ uint64_t m_sm_bytes;
+ uint64_t m_rst_frames;
+ uint64_t m_rst_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
@@ -664,13 +664,13 @@ void LBMLBTRUSourceTransportEntry::processPacket(const packet_info * pinfo, cons
}
else if (tap_info->type == LBTRU_PACKET_TYPE_NCF)
{
- guint16 idx;
+ uint16_t idx;
LBMLBTRUNCFSQNMapIterator it;
LBMLBTRUNCFSQNEntry * sqn = NULL;
m_ncf_frames++;
m_ncf_bytes += pinfo->fd->pkt_len;
- m_ncf_count += (guint64)tap_info->num_sqns;
+ m_ncf_count += (uint64_t)tap_info->num_sqns;
for (idx = 0; idx < tap_info->num_sqns; idx++)
{
it = m_ncf_sqns.find(tap_info->sqns[idx]);
@@ -801,17 +801,17 @@ class LBMLBTRUSourceEntry : public QTreeWidgetItem
void fillItem(void);
QString m_address;
QString m_transport;
- guint64 m_data_frames;
- guint64 m_data_bytes;
- guint64 m_rx_data_frames;
- guint64 m_rx_data_bytes;
- guint64 m_ncf_frames;
- guint64 m_ncf_count;
- guint64 m_ncf_bytes;
- guint64 m_sm_frames;
- guint64 m_sm_bytes;
- guint64 m_rst_frames;
- guint64 m_rst_bytes;
+ uint64_t m_data_frames;
+ uint64_t m_data_bytes;
+ uint64_t m_rx_data_frames;
+ uint64_t m_rx_data_bytes;
+ uint64_t m_ncf_frames;
+ uint64_t m_ncf_count;
+ uint64_t m_ncf_bytes;
+ uint64_t m_sm_frames;
+ uint64_t m_sm_bytes;
+ uint64_t m_rst_frames;
+ uint64_t m_rst_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
@@ -988,13 +988,13 @@ class LBMLBTRUReceiverTransportEntry : public QTreeWidgetItem
private:
void fillItem(void);
QString m_transport;
- guint64 m_nak_frames;
- guint64 m_nak_count;
- guint64 m_nak_bytes;
- guint64 m_ack_frames;
- guint64 m_ack_bytes;
- guint64 m_creq_frames;
- guint64 m_creq_bytes;
+ uint64_t m_nak_frames;
+ uint64_t m_nak_count;
+ uint64_t m_nak_bytes;
+ uint64_t m_ack_frames;
+ uint64_t m_ack_bytes;
+ uint64_t m_creq_frames;
+ uint64_t m_creq_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
@@ -1070,7 +1070,7 @@ void LBMLBTRUReceiverTransportEntry::processPacket(const packet_info * pinfo, co
{
case LBTRU_PACKET_TYPE_NAK:
{
- guint16 idx;
+ uint16_t idx;
LBMLBTRUSQNEntry * sqn = NULL;
LBMLBTRUSQNMapIterator it;
@@ -1135,7 +1135,6 @@ void LBMLBTRUReceiverTransportEntry::processPacket(const packet_info * pinfo, co
break;
default:
return;
- break;
}
fillItem();
}
@@ -1194,13 +1193,13 @@ class LBMLBTRUReceiverEntry : public QTreeWidgetItem
void fillItem(void);
QString m_address;
QString m_transport;
- guint64 m_nak_frames;
- guint64 m_nak_count;
- guint64 m_nak_bytes;
- guint64 m_ack_frames;
- guint64 m_ack_bytes;
- guint64 m_creq_frames;
- guint64 m_creq_bytes;
+ uint64_t m_nak_frames;
+ uint64_t m_nak_count;
+ uint64_t m_nak_bytes;
+ uint64_t m_ack_frames;
+ uint64_t m_ack_bytes;
+ uint64_t m_creq_frames;
+ uint64_t m_creq_bytes;
nstime_t m_first_frame_timestamp;
bool m_first_frame_timestamp_valid;
nstime_t m_last_frame_timestamp;
diff --git a/ui/qt/lbm_lbtru_transport_dialog.h b/ui/qt/lbm_lbtru_transport_dialog.h
index 56590102..b606fe84 100644
--- a/ui/qt/lbm_lbtru_transport_dialog.h
+++ b/ui/qt/lbm_lbtru_transport_dialog.h
@@ -14,8 +14,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include <epan/packet_info.h>
#include <epan/tap.h>
diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp
index 65ddcc47..8988240b 100644
--- a/ui/qt/lbm_stream_dialog.cpp
+++ b/ui/qt/lbm_stream_dialog.cpp
@@ -44,9 +44,9 @@ namespace
class LBMSubstreamEntry
{
public:
- LBMSubstreamEntry(guint64 channel, guint32 substream_id, const address * source_address, guint16 source_port, const address * destination_address, guint16 destination_port);
+ LBMSubstreamEntry(uint64_t channel, uint32_t substream_id, const address * source_address, uint16_t source_port, const address * destination_address, uint16_t destination_port);
~LBMSubstreamEntry(void);
- void processPacket(guint32 frame, guint32 bytes);
+ void processPacket(uint32_t frame, uint32_t bytes);
void setItem(QTreeWidgetItem * item);
QTreeWidgetItem * getItem(void)
{
@@ -54,22 +54,22 @@ class LBMSubstreamEntry
}
private:
- void fillItem(gboolean update_only = TRUE);
- guint64 m_channel;
- guint32 m_substream_id;
+ void fillItem(bool update_only = true);
+ uint64_t m_channel;
+ uint32_t m_substream_id;
QString m_endpoint_a;
QString m_endpoint_b;
- guint32 m_first_frame;
- guint32 m_flast_frame;
- guint32 m_messages;
- guint32 m_bytes;
+ uint32_t m_first_frame;
+ uint32_t m_flast_frame;
+ uint32_t m_messages;
+ uint32_t m_bytes;
QTreeWidgetItem * m_item;
};
-LBMSubstreamEntry::LBMSubstreamEntry(guint64 channel, guint32 substream_id, const address * source_address, guint16 source_port, const address * destination_address, guint16 destination_port) :
+LBMSubstreamEntry::LBMSubstreamEntry(uint64_t channel, uint32_t substream_id, const address * source_address, uint16_t source_port, const address * destination_address, uint16_t destination_port) :
m_channel(channel),
m_substream_id(substream_id),
- m_first_frame((guint32)(~0)),
+ m_first_frame((uint32_t)(~0)),
m_flast_frame(0),
m_messages(0),
m_bytes(0),
@@ -87,7 +87,7 @@ LBMSubstreamEntry::~LBMSubstreamEntry(void)
{
}
-void LBMSubstreamEntry::processPacket(guint32 frame, guint32 bytes)
+void LBMSubstreamEntry::processPacket(uint32_t frame, uint32_t bytes)
{
if (m_first_frame > frame)
{
@@ -105,12 +105,12 @@ void LBMSubstreamEntry::processPacket(guint32 frame, guint32 bytes)
void LBMSubstreamEntry::setItem(QTreeWidgetItem * item)
{
m_item = item;
- fillItem(FALSE);
+ fillItem(false);
}
-void LBMSubstreamEntry::fillItem(gboolean update_only)
+void LBMSubstreamEntry::fillItem(bool update_only)
{
- if (update_only == FALSE)
+ if (update_only == false)
{
m_item->setText(Stream_Column, QString("%1.%2").arg(m_channel).arg(m_substream_id));
m_item->setText(EndpointA_Column, m_endpoint_a);
@@ -122,13 +122,13 @@ void LBMSubstreamEntry::fillItem(gboolean update_only)
m_item->setText(LastFrame_Column, QString("%1").arg(m_flast_frame));
}
-typedef QMap<guint32, LBMSubstreamEntry *> LBMSubstreamMap;
-typedef QMap<guint32, LBMSubstreamEntry *>::iterator LBMSubstreamMapIterator;
+typedef QMap<uint32_t, LBMSubstreamEntry *> LBMSubstreamMap;
+typedef QMap<uint32_t, LBMSubstreamEntry *>::iterator LBMSubstreamMapIterator;
class LBMStreamEntry
{
public:
- LBMStreamEntry(const packet_info * pinfo, guint64 channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b);
+ LBMStreamEntry(const packet_info * pinfo, uint64_t channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b);
~LBMStreamEntry(void);
void processPacket(const packet_info * pinfo, const lbm_uim_stream_tap_info_t * stream_info);
void setItem(QTreeWidgetItem * item);
@@ -138,22 +138,22 @@ class LBMStreamEntry
}
private:
- void fillItem(gboolean update_only = TRUE);
+ void fillItem(bool update_only = true);
QString formatEndpoint(const packet_info * pinfo, const lbm_uim_stream_endpoint_t * endpoint);
- guint64 m_channel;
+ uint64_t m_channel;
QString m_endpoint_a;
QString m_endpoint_b;
- guint32 m_first_frame;
- guint32 m_flast_frame;
- guint32 m_messages;
- guint32 m_bytes;
+ uint32_t m_first_frame;
+ uint32_t m_flast_frame;
+ uint32_t m_messages;
+ uint32_t m_bytes;
QTreeWidgetItem * m_item;
LBMSubstreamMap m_substreams;
};
-LBMStreamEntry::LBMStreamEntry(const packet_info * pinfo, guint64 channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b) :
+LBMStreamEntry::LBMStreamEntry(const packet_info * pinfo, uint64_t channel, const lbm_uim_stream_endpoint_t * endpoint_a, const lbm_uim_stream_endpoint_t * endpoint_b) :
m_channel(channel),
- m_first_frame((guint32)(~0)),
+ m_first_frame((uint32_t)(~0)),
m_flast_frame(0),
m_messages(0),
m_bytes(0),
@@ -228,12 +228,12 @@ void LBMStreamEntry::processPacket(const packet_info * pinfo, const lbm_uim_stre
void LBMStreamEntry::setItem(QTreeWidgetItem * item)
{
m_item = item;
- fillItem(FALSE);
+ fillItem(false);
}
-void LBMStreamEntry::fillItem(gboolean update_only)
+void LBMStreamEntry::fillItem(bool update_only)
{
- if (update_only == FALSE)
+ if (update_only == false)
{
m_item->setData(Stream_Column, Qt::DisplayRole, QVariant((qulonglong)m_channel));
m_item->setText(EndpointA_Column, m_endpoint_a);
@@ -245,8 +245,8 @@ void LBMStreamEntry::fillItem(gboolean update_only)
m_item->setText(LastFrame_Column, QString("%1").arg(m_flast_frame));
}
-typedef QMap<guint64, LBMStreamEntry *> LBMStreamMap;
-typedef QMap<guint64, LBMStreamEntry *>::iterator LBMStreamMapIterator;
+typedef QMap<uint64_t, LBMStreamEntry *> LBMStreamMap;
+typedef QMap<uint64_t, LBMStreamEntry *>::iterator LBMStreamMapIterator;
class LBMStreamDialogInfo
{
diff --git a/ui/qt/lbm_stream_dialog.h b/ui/qt/lbm_stream_dialog.h
index 0bc75d29..0efc141d 100644
--- a/ui/qt/lbm_stream_dialog.h
+++ b/ui/qt/lbm_stream_dialog.h
@@ -14,8 +14,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include <epan/packet_info.h>
#include <epan/tap.h>
diff --git a/ui/qt/lte_mac_statistics_dialog.cpp b/ui/qt/lte_mac_statistics_dialog.cpp
index 691128ea..7646caf3 100644
--- a/ui/qt/lte_mac_statistics_dialog.cpp
+++ b/ui/qt/lte_mac_statistics_dialog.cpp
@@ -25,6 +25,7 @@
// Whole-UE headings.
enum {
+ col_rat_,
col_rnti_,
col_type_,
col_ueid_,
@@ -56,7 +57,7 @@ enum {
// Calculate and return a bandwidth figure, in Mbs
static double calculate_bw(const nstime_t *start_time, const nstime_t *stop_time,
- guint32 bytes)
+ uint32_t bytes)
{
// Can only calculate bandwidth if have time delta
if (memcmp(start_time, stop_time, sizeof(nstime_t)) != 0) {
@@ -83,13 +84,14 @@ static double calculate_bw(const nstime_t *start_time, const nstime_t *stop_time
class MacULDLTreeWidgetItem : public QTreeWidgetItem
{
public:
- MacULDLTreeWidgetItem(QTreeWidgetItem *parent, unsigned ueid, unsigned rnti, int row_type) :
+ MacULDLTreeWidgetItem(QTreeWidgetItem *parent, unsigned ueid, unsigned rnti, unsigned rat, int row_type) :
QTreeWidgetItem (parent, row_type),
ueid_(ueid),
- rnti_(rnti)
+ rnti_(rnti),
+ rat_(rat)
{
// Init values held for all lcids to 0.
- for (int n=0; n < MAC_LTE_DATA_LCID_COUNT_MAX; n++) {
+ for (int n=0; n < MAC_3GPP_DATA_LCID_COUNT_MAX; n++) {
lcids[n] = 0;
}
@@ -124,43 +126,62 @@ public:
// Show current value of counter for each LCID.
// N.B. fields that are set as % using percent_bar_delegate.h
// for UE headings don't display here...
- for (int n=0; n < MAC_LTE_DATA_LCID_COUNT_MAX; n++) {
+ for (int n=0; n < MAC_3GPP_DATA_LCID_COUNT_MAX; n++) {
setText(col_type_+n, QString::number((uint)lcids[n]));
}
}
// Increase value held for lcid by given value.
- void updateLCID(guint8 lcid, guint value)
+ void updateLCID(uint8_t lcid, unsigned value)
{
lcids[lcid] += value;
}
// Generate expression for this UE and direction, also filter for SRs and RACH if indicated.
- const QString filterExpression(bool showSR, bool showRACH) {
+ const QString filterExpression(bool showSR, bool showRACH)
+ {
int direction = (type() == mac_dlsch_packet_count_row_type) ||
(type() == mac_dlsch_byte_count_row_type);
QString filter_expr;
if (showSR) {
- filter_expr = QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ // Only applies to LTE.
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr = QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ }
}
if (showRACH) {
- filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ }
+ else {
+ filter_expr += QString("mac-nr.rar or ");
+ }
}
// Main expression matching this UE and direction
- filter_expr += QString("mac-lte.ueid==%1 && mac-lte.rnti==%2 && mac-lte.direction==%3").
- arg(ueid_).arg(rnti_).arg(direction);
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString("mac-lte.ueid==%1 && mac-lte.rnti==%2 && mac-lte.direction==%3").
+ arg(ueid_).arg(rnti_).arg(direction);
+ }
+ else {
+ filter_expr += QString("mac-nr.ueid==%1 && mac-nr.rnti==%2 && mac-nr.direction==%3").
+ arg(ueid_).arg(rnti_).arg(direction);
+ }
// Close () if open because of SR
if (showSR) {
- filter_expr += QString(")");
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
// Close () if open because of RACH
if (showRACH) {
- filter_expr += QString(")");
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
return filter_expr;
@@ -176,7 +197,8 @@ public:
private:
unsigned ueid_;
unsigned rnti_;
- int lcids[MAC_LTE_DATA_LCID_COUNT_MAX]; /* 0 to 10 and 32 to 38 */
+ unsigned rat_;
+ int lcids[MAC_3GPP_DATA_LCID_COUNT_MAX]; /* For LTE, mapped to 0 to 10 and 32 to 38 */
};
@@ -185,7 +207,7 @@ private:
class MacUETreeWidgetItem : public QTreeWidgetItem
{
public:
- MacUETreeWidgetItem(QTreeWidget *parent, const mac_lte_tap_info *mlt_info) :
+ MacUETreeWidgetItem(QTreeWidget *parent, const mac_3gpp_tap_info *mlt_info) :
QTreeWidgetItem (parent, mac_whole_ue_row_type_),
rnti_(0),
type_(0),
@@ -203,9 +225,13 @@ public:
dl_retx_(0)
{
// Set fixed fields.
- rnti_ = mlt_info->rnti;
- type_ = mlt_info->rntiType;
- ueid_ = mlt_info->ueid;
+ rnti_ = mlt_info->rnti;
+ type_ = mlt_info->rntiType;
+ ueid_ = mlt_info->ueid;
+ rat_ = mlt_info->rat;
+ setText(col_rat_, (mlt_info->rat == MAC_RAT_LTE) ?
+ QObject::tr("LTE") :
+ QObject::tr("NR"));
setText(col_rnti_, QString::number(rnti_));
setText(col_type_, type_ == C_RNTI ? QObject::tr("C-RNTI") : QObject::tr("SPS-RNTI"));
setText(col_ueid_, QString::number(ueid_));
@@ -215,14 +241,15 @@ public:
}
// Does this tap-info match this existing UE item?
- bool isMatch(const mac_lte_tap_info *mlt_info) {
+ bool isMatch(const mac_3gpp_tap_info *mlt_info) {
return ((rnti_ == mlt_info->rnti) &&
(type_ == mlt_info->rntiType) &&
- (ueid_ == mlt_info->ueid));
+ (ueid_ == mlt_info->ueid) &&
+ (rat_ == mlt_info->rat));
}
// Update this UE according to the tap info
- void update(const mac_lte_tap_info *mlt_info) {
+ void update(const mac_3gpp_tap_info *mlt_info) {
// Uplink.
if (mlt_info->direction == DIRECTION_UPLINK) {
@@ -239,9 +266,9 @@ public:
// Update time range
if (ul_frames_ == 0) {
- ul_time_start_ = mlt_info->mac_lte_time;
+ ul_time_start_ = mlt_info->mac_time;
}
- ul_time_stop_ = mlt_info->mac_lte_time;
+ ul_time_stop_ = mlt_info->mac_time;
ul_frames_++;
@@ -251,7 +278,7 @@ public:
// N.B. Not going to support predefined data in Qt version..
if (!mlt_info->isPredefinedData) {
- for (int n=0; n < MAC_LTE_DATA_LCID_COUNT_MAX; n++) {
+ for (int n=0; n < MAC_3GPP_DATA_LCID_COUNT_MAX; n++) {
// Update UL child items
ul_frames_item_->updateLCID(n, mlt_info->sdus_for_lcid[n]);
ul_bytes_item_->updateLCID(n, mlt_info->bytes_for_lcid[n]);
@@ -283,9 +310,9 @@ public:
// Update time range
if (dl_frames_ == 0) {
- dl_time_start_ = mlt_info->mac_lte_time;
+ dl_time_start_ = mlt_info->mac_time;
}
- dl_time_stop_ = mlt_info->mac_lte_time;
+ dl_time_stop_ = mlt_info->mac_time;
dl_frames_++;
@@ -295,7 +322,7 @@ public:
// N.B. Not going to support predefined data in Qt version..
if (!mlt_info->isPredefinedData) {
- for (int n=0; n < MAC_LTE_DATA_LCID_COUNT_MAX; n++) {
+ for (int n=0; n < MAC_3GPP_DATA_LCID_COUNT_MAX; n++) {
// Update DL child items
dl_frames_item_->updateLCID(n, mlt_info->sdus_for_lcid[n]);
dl_bytes_item_->updateLCID(n, mlt_info->bytes_for_lcid[n]);
@@ -308,10 +335,10 @@ public:
void addDetails() {
// Add UL/DL packet and byte counts.
- ul_frames_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, mac_ulsch_packet_count_row_type);
- ul_bytes_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, mac_ulsch_byte_count_row_type);
- dl_frames_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, mac_dlsch_packet_count_row_type);
- dl_bytes_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, mac_dlsch_byte_count_row_type);
+ ul_frames_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, rat_, mac_ulsch_packet_count_row_type);
+ ul_bytes_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, rat_, mac_ulsch_byte_count_row_type);
+ dl_frames_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, rat_, mac_dlsch_packet_count_row_type);
+ dl_bytes_item_ = new MacULDLTreeWidgetItem(this, ueid_, rnti_, rat_, mac_dlsch_byte_count_row_type);
setExpanded(false);
}
@@ -382,23 +409,39 @@ public:
QString filter_expr;
if (showSR) {
- filter_expr = QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr = QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ }
}
if (showRACH) {
- filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ }
+ else {
+ filter_expr += QString("mac-nr.rar or ");
+ }
}
// Main expression matching this UE
- filter_expr += QString("mac-lte.ueid==%1 && mac-lte.rnti==%2").arg(ueid_).arg(rnti_);
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString("mac-lte.ueid==%1 && mac-lte.rnti==%2").arg(ueid_).arg(rnti_);
+ }
+ else {
+ filter_expr += QString("mac-nr.ueid==%1 && mac-nr.rnti==%2").arg(ueid_).arg(rnti_);
+ }
// Close () if open because of SR
if (showSR) {
- filter_expr += QString(")");
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
// Close () if open because of RACH
if (showRACH) {
- filter_expr += QString(")");
+ if (rat_ == MAC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
return filter_expr;
@@ -432,6 +475,7 @@ public:
private:
// Unchanging (key) fields.
+ uint8_t rat_;
unsigned rnti_;
unsigned type_;
unsigned ueid_;
@@ -467,7 +511,7 @@ private:
// Label headings. Show according to which type of tree item is currently selected.
static const QStringList mac_whole_ue_row_labels = QStringList()
- << QObject::tr("RNTI") << QObject::tr("Type") << QObject::tr("UEId")
+ << QObject::tr("RAT") << QObject::tr("RNTI") << QObject::tr("Type") << QObject::tr("UEId")
<< QObject::tr("UL Frames") << QObject::tr("UL Bytes") << QObject::tr("UL MB/s")
<< QObject::tr("UL Padding %") << QObject::tr("UL Re TX")
<< QObject::tr("DL Frames") << QObject::tr("DL Bytes") << QObject::tr("DL MB/s")
@@ -477,7 +521,7 @@ static const QStringList mac_whole_ue_row_labels = QStringList()
<< QObject::tr("") << QObject::tr("") << QObject::tr("") << QObject::tr("") << QObject::tr("");
static const QStringList mac_channel_counts_labels = QStringList()
- << QObject::tr("") << QObject::tr("CCCH")
+ << QObject::tr("") << QObject::tr("") << QObject::tr("CCCH")
<< QObject::tr("LCID 1") << QObject::tr("LCID 2") << QObject::tr("LCID 3")
<< QObject::tr("LCID 4") << QObject::tr("LCID 5") << QObject::tr("LCID 6")
<< QObject::tr("LCID 7") << QObject::tr("LCID 8") << QObject::tr("LCID 9")
@@ -495,7 +539,7 @@ LteMacStatisticsDialog::LteMacStatisticsDialog(QWidget &parent, CaptureFile &cf,
TapParameterDialog(parent, cf, HELP_STATS_LTE_MAC_TRAFFIC_DIALOG),
commonStatsCurrent_(false)
{
- setWindowSubtitle(tr("LTE Mac Statistics"));
+ setWindowSubtitle(tr("LTE/NR Mac Statistics"));
loadGeometry(parent.width() * 1, parent.height() * 3 / 4, "LTEMacStatisticsDialog");
clearCommonStats();
@@ -617,7 +661,7 @@ LteMacStatisticsDialog::~LteMacStatisticsDialog()
}
// Update system/common counters, and redraw if changed.
-void LteMacStatisticsDialog::updateCommonStats(const mac_lte_tap_info *tap_info)
+void LteMacStatisticsDialog::updateCommonStats(const mac_3gpp_tap_info *tap_info)
{
commonStats_.all_frames++;
@@ -719,11 +763,11 @@ void LteMacStatisticsDialog::tapReset(void *ws_dlg_ptr)
//---------------------------------------------------------------------------------------
// Process tap info from a new packet.
// Returns TAP_PACKET_REDRAW if a redraw is needed, TAP_PACKET_DONT_REDRAW otherwise.
-tap_packet_status LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *mac_lte_tap_info_ptr, tap_flags_t)
+tap_packet_status LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *mac_3gpp_tap_info_ptr, tap_flags_t)
{
// Look up dialog and tap info.
LteMacStatisticsDialog *ws_dlg = static_cast<LteMacStatisticsDialog *>(ws_dlg_ptr);
- const mac_lte_tap_info *mlt_info = (const mac_lte_tap_info *) mac_lte_tap_info_ptr;
+ const mac_3gpp_tap_info *mlt_info = (const mac_3gpp_tap_info *)mac_3gpp_tap_info_ptr;
if (!ws_dlg || !mlt_info) {
return TAP_PACKET_DONT_REDRAW;
}
@@ -799,7 +843,7 @@ void LteMacStatisticsDialog::tapDraw(void *ws_dlg_ptr)
ws_dlg->drawCommonStats();
// Update title
- ws_dlg->setWindowSubtitle(QString("LTE Mac Statistics (%1 UEs, %2 frames)").
+ ws_dlg->setWindowSubtitle(QString("3GPP Mac Statistics (%1 UEs, %2 frames)").
arg(ws_dlg->statsTreeWidget()->topLevelItemCount()).arg(ws_dlg->getFrameCount()));
}
@@ -825,7 +869,7 @@ const QString LteMacStatisticsDialog::filterExpression()
void LteMacStatisticsDialog::fillTree()
{
- if (!registerTapListener("mac-lte",
+ if (!registerTapListener("mac-3gpp",
this,
displayFilter_.toLatin1().data(),
TL_REQUIRES_NOTHING,
@@ -910,12 +954,12 @@ lte_mac_statistics_init(const char *args, void*) {
}
static stat_tap_ui lte_mac_statistics_ui = {
- REGISTER_STAT_GROUP_TELEPHONY_LTE,
+ REGISTER_TELEPHONY_GROUP_3GPP_UU,
QT_TRANSLATE_NOOP("LteMacStatisticsDialog", "MAC Statistics"),
- "mac-lte,stat",
+ "mac-3gpp,stat", // cli_string
lte_mac_statistics_init,
- 0,
- NULL
+ 0, // nparams
+ NULL // params
};
extern "C" {
diff --git a/ui/qt/lte_mac_statistics_dialog.h b/ui/qt/lte_mac_statistics_dialog.h
index 411d0614..c3ea692d 100644
--- a/ui/qt/lte_mac_statistics_dialog.h
+++ b/ui/qt/lte_mac_statistics_dialog.h
@@ -18,20 +18,20 @@
#include <ui/qt/models/percent_bar_delegate.h>
// Common channel stats
-typedef struct mac_lte_common_stats {
- guint32 all_frames;
- guint32 mib_frames;
- guint32 sib_frames;
- guint32 sib_bytes;
- guint32 pch_frames;
- guint32 pch_bytes;
- guint32 pch_paging_ids;
- guint32 rar_frames;
- guint32 rar_entries;
-
- guint16 max_ul_ues_in_tti;
- guint16 max_dl_ues_in_tti;
-} mac_lte_common_stats;
+typedef struct mac_3gpp_common_stats {
+ uint32_t all_frames;
+ uint32_t mib_frames;
+ uint32_t sib_frames;
+ uint32_t sib_bytes;
+ uint32_t pch_frames;
+ uint32_t pch_bytes;
+ uint32_t pch_paging_ids;
+ uint32_t rar_frames;
+ uint32_t rar_entries;
+
+ uint16_t max_ul_ues_in_tti;
+ uint16_t max_dl_ues_in_tti;
+} mac_3gpp_common_stats;
class LteMacStatisticsDialog : public TapParameterDialog
@@ -55,15 +55,15 @@ private:
// Callbacks for register_tap_listener
static void tapReset(void *ws_dlg_ptr);
- static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_lte_tap_info_ptr, tap_flags_t flags);
+ static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_3gpp_tap_info_ptr, tap_flags_t flags);
static void tapDraw(void *ws_dlg_ptr);
virtual const QString filterExpression();
// Common stats.
- mac_lte_common_stats commonStats_;
+ mac_3gpp_common_stats commonStats_;
bool commonStatsCurrent_; // Set when changes have not yet been drawn
- void updateCommonStats(const struct mac_lte_tap_info *mlt_info);
+ void updateCommonStats(const struct mac_3gpp_tap_info *mlt_info);
void drawCommonStats();
void clearCommonStats();
diff --git a/ui/qt/lte_rlc_graph_dialog.cpp b/ui/qt/lte_rlc_graph_dialog.cpp
index f1ac2b46..6158c21b 100644
--- a/ui/qt/lte_rlc_graph_dialog.cpp
+++ b/ui/qt/lte_rlc_graph_dialog.cpp
@@ -31,6 +31,8 @@
#include "ui/qt/widgets/wireshark_file_dialog.h"
#include <epan/dissectors/packet-rlc-lte.h>
+#include <epan/dissectors/packet-rlc-3gpp-common.h>
+
#include <ui/tap-rlc-graph.h>
@@ -62,7 +64,7 @@ LteRlcGraphDialog::LteRlcGraphDialog(QWidget &parent, CaptureFile &cf, bool chan
rp->xAxis->setLabel(tr("Time"));
rp->yAxis->setLabel(tr("Sequence Number"));
- // TODO: couldn't work out how to tell rp->xAxis not to label fractions of a SN...
+ // TODO: couldn't work out how to tell rp->yAxis not to label fractions of a SN...
ui->dragRadioButton->setChecked(mouse_drags_);
@@ -95,6 +97,9 @@ LteRlcGraphDialog::LteRlcGraphDialog(QWidget &parent, CaptureFile &cf, bool chan
ctx_menu_->addAction(ui->actionSwitchDirection);
set_action_shortcuts_visible_in_context_menu(ctx_menu_->actions());
+ rp->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(rp, &QCustomPlot::customContextMenuRequested, this, &LteRlcGraphDialog::showContextMenu);
+
// Zero out this struct.
memset(&graph_, 0, sizeof(graph_));
@@ -111,15 +116,16 @@ LteRlcGraphDialog::~LteRlcGraphDialog()
}
// Set the channel information that this graph should show.
-void LteRlcGraphDialog::setChannelInfo(guint16 ueid, guint8 rlcMode,
- guint16 channelType, guint16 channelId, guint8 direction,
+void LteRlcGraphDialog::setChannelInfo(uint8_t rat, uint16_t ueid, uint8_t rlcMode,
+ uint16_t channelType, uint16_t channelId, uint8_t direction,
bool maybe_empty)
{
+ graph_.rat = rat;
graph_.ueid = ueid;
graph_.rlcMode = rlcMode;
graph_.channelType = channelType;
graph_.channelId = channelId;
- graph_.channelSet = TRUE;
+ graph_.channelSet = true;
graph_.direction = direction;
completeGraph(maybe_empty);
@@ -135,7 +141,8 @@ void LteRlcGraphDialog::completeGraph(bool may_be_empty)
// Set window title here.
if (graph_.channelSet) {
- QString dlg_title = tr("LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)")
+ QString dlg_title = tr("%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)")
+ .arg((graph_.rat == RLC_RAT_LTE) ? "LTE" : "NR")
.arg(graph_.ueid)
.arg((graph_.channelType == CHANNEL_TYPE_SRB) ? "SRB" : "DRB")
.arg(graph_.channelId)
@@ -144,7 +151,7 @@ void LteRlcGraphDialog::completeGraph(bool may_be_empty)
setWindowTitle(dlg_title);
}
else {
- setWindowTitle(tr("LTE RLC Graph - no channel selected"));
+ setWindowTitle(tr("3GPP RLC Graph - no channel selected"));
}
// Set colours/styles for each of the traces on the graph.
@@ -186,7 +193,8 @@ void LteRlcGraphDialog::completeGraph(bool may_be_empty)
// See if the given segment matches the channel this graph is plotting.
bool LteRlcGraphDialog::compareHeaders(rlc_segment *seg)
{
- return compare_rlc_headers(graph_.ueid, graph_.channelType,
+ return compare_rlc_headers(graph_.rat, seg->rat,
+ graph_.ueid, graph_.channelType,
graph_.channelId, graph_.rlcMode, graph_.direction,
seg->ueid, seg->channelType,
seg->channelId, seg->rlcMode, seg->direction,
@@ -230,13 +238,13 @@ void LteRlcGraphDialog::fillGraph()
return;
}
- tracer_->setGraph(NULL);
-
base_graph_->setLineStyle(QCPGraph::lsNone); // dot
reseg_graph_->setLineStyle(QCPGraph::lsNone); // dot
acks_graph_->setLineStyle(QCPGraph::lsStepLeft); // to get step effect...
nacks_graph_->setLineStyle(QCPGraph::lsNone); // dot, but bigger.
+ tracer_->setGraph(NULL);
+
// Will show all graphs with data we find.
for (int i = 0; i < sp->graphCount(); i++) {
sp->graph(i)->data()->clear();
@@ -252,14 +260,13 @@ void LteRlcGraphDialog::fillGraph()
// NACKs are shown bigger than others.
nacks_graph_->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc, pkt_point_size_*2));
- // Map timestamps -> segments in first pass.
+ // Map timestamps -> segments (time_stamp_map_) in first pass.
time_stamp_map_.clear();
for (struct rlc_segment *seg = graph_.segments; seg != NULL; seg = seg->next) {
if (!compareHeaders(seg)) {
continue;
}
double ts = seg->rel_secs + seg->rel_usecs / 1000000.0;
-
time_stamp_map_.insert(ts, seg);
}
@@ -268,12 +275,23 @@ void LteRlcGraphDialog::fillGraph()
reseg_seq_time, reseg_seq,
acks_time, acks,
nacks_time, nacks;
+
+ uint32_t last_ackSN = uint32_t(-1); // start with invalid value
+ uint32_t maxSN = 0;
+
+ // Note the max possible SN
+ if (graph_.segments) {
+ maxSN = (1 << graph_.segments->sequenceNumberLength);
+ }
+
+ // Run through the segments to get data
for (struct rlc_segment *seg = graph_.segments; seg != NULL; seg = seg->next) {
double ts = seg->rel_secs + (seg->rel_usecs / 1000000.0);
if (compareHeaders(seg)) {
if (!seg->isControlPDU) {
- // Data
+ // Data PDUs
if (seg->isResegmented) {
+ // LTE only
reseg_seq_time.append(ts);
reseg_seq.append(seg->SN);
}
@@ -283,22 +301,31 @@ void LteRlcGraphDialog::fillGraph()
}
}
else {
- // Status (ACKs/NACKs)
- acks_time.append(ts);
- acks.append(seg->ACKNo-1);
- for (int n=0; n < seg->noOfNACKs; n++) {
- nacks_time.append(ts);
- nacks.append(seg->NACKs[n]);
+ // Status PDUs
+
+ // Filter out ACKS that are likely caused by MAC retx, so track last ACK
+ if (seg->ACKNo != last_ackSN) {
+ // Status (ACKs/NACKs)
+ acks_time.append(ts);
+ acks.append((seg->ACKNo-1) % maxSN);
+ last_ackSN = seg->ACKNo;
+
+ // Any NACKs
+ for (int n=0; n < seg->noOfNACKs; n++) {
+ nacks_time.append(ts);
+ nacks.append(seg->NACKs[n]);
+ }
}
}
}
}
// Add the data from the graphs.
- base_graph_->setData(seq_time, seq);
- reseg_graph_->setData(reseg_seq_time, reseg_seq);
- acks_graph_->setData(acks_time, acks);
- nacks_graph_->setData(nacks_time, nacks);
+ // N.B. passing true to assume the timestamps are already sorted..
+ base_graph_->setData(seq_time, seq, true);
+ reseg_graph_->setData(reseg_seq_time, reseg_seq, true);
+ acks_graph_->setData(acks_time, acks, true);
+ nacks_graph_->setData(nacks_time, nacks, true);
sp->setEnabled(true);
@@ -533,19 +560,16 @@ QRectF LteRlcGraphDialog::getZoomRanges(QRect zoom_rect)
return zoom_ranges;
}
+void LteRlcGraphDialog::showContextMenu(const QPoint &pos)
+{
+ ctx_menu_->popup(ui->rlcPlot->mapToGlobal(pos));
+}
+
void LteRlcGraphDialog::graphClicked(QMouseEvent *event)
{
QCustomPlot *rp = ui->rlcPlot;
- if (event->button() == Qt::RightButton) {
- // XXX We should find some way to get rlcPlot to handle a
- // contextMenuEvent instead.
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- ctx_menu_->popup(event->globalPosition().toPoint());
-#else
- ctx_menu_->popup(event->globalPos());
-#endif
- } else if (mouse_drags_) {
+ if (mouse_drags_) {
if (rp->axisRect()->rect().contains(event->pos())) {
rp->setCursor(QCursor(Qt::ClosedHandCursor));
}
@@ -675,21 +699,21 @@ void LteRlcGraphDialog::resetAxes()
{
QCustomPlot *rp = ui->rlcPlot;
- QCPRange x_range = rp->xAxis->scaleType() == QCPAxis::stLogarithmic ?
- rp->xAxis->range().sanitizedForLogScale() : rp->xAxis->range();
-
double pixel_pad = 10.0; // per side
rp->rescaleAxes(true);
- base_graph_->rescaleValueAxis(false, true);
+
+ QCPRange x_range = rp->xAxis->range();
double axis_pixels = rp->xAxis->axisRect()->width();
rp->xAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, x_range.center());
axis_pixels = rp->yAxis->axisRect()->height();
- rp->yAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, rp->yAxis->range().center());
+ rp->yAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels,
+ rp->yAxis->range().center());
- rp->replot(QCustomPlot::rpQueuedReplot);
+ // N.B. TCP Stream Dialog uses default (rpRefreshHint) - was using QCustomPlot::rpQueuedReplot
+ rp->replot();
}
void LteRlcGraphDialog::on_actionGoToPacket_triggered()
@@ -800,7 +824,8 @@ void LteRlcGraphDialog::on_actionSwitchDirection_triggered()
{
// Channel settings exactly the same, except change direction.
// N.B. do not fail and close if there are no packets in opposite direction.
- setChannelInfo(graph_.ueid,
+ setChannelInfo(graph_.rat,
+ graph_.ueid,
graph_.rlcMode,
graph_.channelType,
graph_.channelId,
diff --git a/ui/qt/lte_rlc_graph_dialog.h b/ui/qt/lte_rlc_graph_dialog.h
index 07661ab2..2b83f0ff 100644
--- a/ui/qt/lte_rlc_graph_dialog.h
+++ b/ui/qt/lte_rlc_graph_dialog.h
@@ -33,8 +33,8 @@ public:
explicit LteRlcGraphDialog(QWidget &parent, CaptureFile &cf, bool channelKnown);
~LteRlcGraphDialog();
- void setChannelInfo(guint16 ueid, guint8 rlcMode,
- guint16 channelType, guint16 channelId, guint8 direction,
+ void setChannelInfo(uint8_t rat, uint16_t ueid, uint8_t rlcMode,
+ uint16_t channelType, uint16_t channelId, uint8_t direction,
bool maybe_empty=false);
signals:
@@ -51,19 +51,19 @@ private:
QPoint rb_origin_;
QMenu *ctx_menu_;
- // Data gleaned directly from tapping packets (shared with gtk impl)
+ // Data gleaned directly from tapping packets
struct rlc_graph graph_;
// Data
- QMultiMap<double, struct rlc_segment *> time_stamp_map_;
+ QMultiMap<double, struct rlc_segment *> time_stamp_map_; // used for mapping clicks back to segment/frame
QMap<double, struct rlc_segment *> sequence_num_map_;
- QCPGraph *base_graph_; // Clickable packets
+ QCPGraph *base_graph_; // Data SNs - clickable packets
QCPGraph *reseg_graph_;
QCPGraph *acks_graph_;
QCPGraph *nacks_graph_;
QCPItemTracer *tracer_;
- guint32 packet_num_;
+ uint32_t packet_num_;
void completeGraph(bool may_be_empty=false);
@@ -82,6 +82,7 @@ private:
void toggleTracerStyle(bool force_default);
private slots:
+ void showContextMenu(const QPoint &pos);
void graphClicked(QMouseEvent *event);
void mouseMoved(QMouseEvent *event);
void mouseReleased(QMouseEvent *event);
diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp
index 43b5c81b..77553c96 100644
--- a/ui/qt/lte_rlc_statistics_dialog.cpp
+++ b/ui/qt/lte_rlc_statistics_dialog.cpp
@@ -13,8 +13,6 @@
#include <epan/strutil.h>
#include <epan/tap.h>
-#include <epan/dissectors/packet-rlc-lte.h>
-
#include <QFormLayout>
#include <QTreeWidgetItem>
#include <QPushButton>
@@ -26,6 +24,7 @@
// TODO: have never tested in a live capture.
enum {
+ col_rat_,
col_ueid_,
col_mode_, // channel only
col_priority_, // channel only
@@ -49,7 +48,7 @@ enum {
};
/* Calculate and return a bandwidth figure, in Mbs */
-static double calculate_bw(const nstime_t *start_time, const nstime_t *stop_time, guint32 bytes)
+static double calculate_bw(const nstime_t *start_time, const nstime_t *stop_time, uint32_t bytes)
{
/* Can only calculate bandwidth if have time delta */
if (memcmp(start_time, stop_time, sizeof(nstime_t)) != 0) {
@@ -74,31 +73,31 @@ static double calculate_bw(const nstime_t *start_time, const nstime_t *stop_time
// Stats kept for one channel.
typedef struct rlc_channel_stats {
- guint8 rlcMode;
- guint8 priority;
- guint16 channelType;
- guint16 channelId;
+ uint8_t rlcMode;
+ uint8_t priority;
+ uint16_t channelType;
+ uint16_t channelId;
- guint32 UL_frames;
- guint32 UL_bytes;
+ uint32_t UL_frames;
+ uint32_t UL_bytes;
nstime_t UL_time_start;
nstime_t UL_time_stop;
- gboolean UL_has_data; // i.e. not just ACKs for DL.
+ bool UL_has_data; // i.e. not just ACKs for DL.
- guint32 DL_frames;
- guint32 DL_bytes;
+ uint32_t DL_frames;
+ uint32_t DL_bytes;
nstime_t DL_time_start;
nstime_t DL_time_stop;
- gboolean DL_has_data; // i.e. not just ACKs for UL.
+ bool DL_has_data; // i.e. not just ACKs for UL.
- guint32 UL_acks;
- guint32 UL_nacks;
+ uint32_t UL_acks;
+ uint32_t UL_nacks;
- guint32 DL_acks;
- guint32 DL_nacks;
+ uint32_t DL_acks;
+ uint32_t DL_nacks;
- guint32 UL_missing;
- guint32 DL_missing;
+ uint32_t UL_missing;
+ uint32_t DL_missing;
} rlc_channel_stats;
//-------------------------------------------------------------------
@@ -108,10 +107,12 @@ class RlcChannelTreeWidgetItem : public QTreeWidgetItem
{
public:
RlcChannelTreeWidgetItem(QTreeWidgetItem *parent,
+ uint8_t rat,
unsigned ueid,
unsigned mode,
unsigned channelType, unsigned channelId) :
QTreeWidgetItem(parent, rlc_channel_row_type_),
+ rat_(rat),
ueid_(ueid),
channelType_(channelType),
channelId_(channelId),
@@ -163,7 +164,7 @@ public:
}
// Update UE/channels from tap info.
- void update(const rlc_lte_tap_info *tap_info) {
+ void update(const rlc_3gpp_tap_info *tap_info) {
// Copy these fields into UE stats.
if (tap_info->rlcMode != stats_.rlcMode) {
@@ -183,9 +184,9 @@ public:
if (tap_info->direction == DIRECTION_UPLINK) {
// Update time range.
if (stats_.UL_frames == 0) {
- stats_.UL_time_start = tap_info->rlc_lte_time;
+ stats_.UL_time_start = tap_info->rlc_time;
}
- stats_.UL_time_stop = tap_info->rlc_lte_time;
+ stats_.UL_time_stop = tap_info->rlc_time;
stats_.UL_frames++;
stats_.UL_bytes += tap_info->pduLength;
@@ -195,15 +196,15 @@ public:
stats_.UL_acks++;
}
else {
- stats_.UL_has_data = TRUE;
+ stats_.UL_has_data = true;
}
}
else {
// Update time range.
if (stats_.DL_frames == 0) {
- stats_.DL_time_start = tap_info->rlc_lte_time;
+ stats_.DL_time_start = tap_info->rlc_time;
}
- stats_.DL_time_stop = tap_info->rlc_lte_time;
+ stats_.DL_time_stop = tap_info->rlc_time;
stats_.DL_frames++;
stats_.DL_bytes += tap_info->pduLength;
@@ -213,7 +214,7 @@ public:
stats_.DL_acks++;
}
else {
- stats_.DL_has_data = TRUE;
+ stats_.DL_has_data = true;
}
}
}
@@ -269,47 +270,81 @@ public:
return QTreeWidgetItem::operator< (other);
}
- // Filter expression for channel.
+ // Filter expression for this bearer.
const QString filterExpression(bool showSR, bool showRACH) {
// Create an expression to match with all traffic for this UE.
QString filter_expr;
// Are we taking RLC PDUs from MAC, or not?
if (!recent.gui_rlc_use_pdus_from_mac) {
- filter_expr += QString("not mac-lte and ");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("not mac-lte and ");
+ }
+ else {
+ filter_expr += QString("not mac-nr and ");
+ }
}
else {
- filter_expr += QString("mac-lte and ");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("mac-lte and ");
+ }
+ else {
+ filter_expr += QString("mac-nr and ");
+ }
}
if (showSR) {
- filter_expr += QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ }
}
if (showRACH) {
- filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ }
+ else {
+ filter_expr += QString("(mac-nr.rar or ");
+ }
}
// Main part of expression.
- filter_expr += QString("rlc-lte.ueid==%1 and rlc-lte.channel-type == %2").
- arg(ueid_).arg(channelType_);
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("rlc-lte.ueid==%1 and rlc-lte.channel-type == %2").
+ arg(ueid_).arg(channelType_);
+ }
+ else {
+ filter_expr += QString("rlc-nr.ueid==%1 and rlc-nr.bearer-type == %2").
+ arg(ueid_).arg(channelType_);
+ }
+ // Channel/bearer Id
if ((channelType_ == CHANNEL_TYPE_SRB) || (channelType_ == CHANNEL_TYPE_DRB)) {
- filter_expr += QString(" and rlc-lte.channel-id == %1").arg(channelId_);
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString(" and rlc-lte.channel-id == %1").arg(channelId_);
+ }
+ else {
+ filter_expr += QString(" and rlc-nr.bearer-id == %1").arg(channelId_);
+ }
}
// Close () if open because of SR
if (showSR) {
- filter_expr += QString(")");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
// Close () if open because of RACH
if (showRACH) {
- filter_expr += QString(")");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
return filter_expr;
}
// Accessors (queried for launching graph)
+ uint8_t get_rat() const { return rat_; }
unsigned get_ueid() const { return ueid_; }
unsigned get_channelType() const { return channelType_; }
unsigned get_channelId() const { return channelId_; }
@@ -325,10 +360,11 @@ public:
}
private:
+ uint8_t rat_;
unsigned ueid_;
unsigned channelType_;
unsigned channelId_;
- unsigned mode_;
+ unsigned mode_; // RLC mode for this bearer
unsigned priority_;
unsigned channelRank() const
@@ -353,21 +389,21 @@ private:
// Stats for one UE. TODO: private to class?
typedef struct rlc_ue_stats {
- guint32 UL_frames;
- guint32 UL_total_bytes;
+ uint32_t UL_frames;
+ uint32_t UL_total_bytes;
nstime_t UL_time_start;
nstime_t UL_time_stop;
- guint32 UL_total_acks;
- guint32 UL_total_nacks;
- guint32 UL_total_missing;
+ uint32_t UL_total_acks;
+ uint32_t UL_total_nacks;
+ uint32_t UL_total_missing;
- guint32 DL_frames;
- guint32 DL_total_bytes;
+ uint32_t DL_frames;
+ uint32_t DL_total_bytes;
nstime_t DL_time_start;
nstime_t DL_time_stop;
- guint32 DL_total_acks;
- guint32 DL_total_nacks;
- guint32 DL_total_missing;
+ uint32_t DL_total_acks;
+ uint32_t DL_total_nacks;
+ uint32_t DL_total_missing;
} rlc_ue_stats;
@@ -377,11 +413,17 @@ typedef struct rlc_ue_stats {
class RlcUeTreeWidgetItem : public QTreeWidgetItem
{
public:
- RlcUeTreeWidgetItem(QTreeWidget *parent, const rlc_lte_tap_info *rlt_info) :
+ RlcUeTreeWidgetItem(QTreeWidget *parent, const rlc_3gpp_tap_info *rlt_info) :
QTreeWidgetItem (parent, rlc_ue_row_type_),
ueid_(0)
{
ueid_ = rlt_info->ueid;
+ rat_ = rlt_info->rat;
+
+ // Version matches UE number
+ setText(col_rat_, (rat_ == RLC_RAT_LTE) ?
+ QObject::tr("LTE") :
+ QObject::tr("NR"));
setText(col_ueid_, QString::number(ueid_));
// We create RlcChannelTreeWidgetItems when first data on new channel is seen.
@@ -398,20 +440,14 @@ public:
}
// Does UE match?
- bool isMatch(const rlc_lte_tap_info *rlt_info) {
- return ueid_ == rlt_info->ueid;
+ bool isMatch(const rlc_3gpp_tap_info *rlt_info)
+ {
+ return (rat_ == rlt_info->rat) && (ueid_ == rlt_info->ueid);
}
// Update UE/channels from tap info.
- void update(const rlc_lte_tap_info *tap_info) {
-
- // Are we ignoring RLC frames that were found in MAC frames, or only those
- // that were logged separately?
- if ((!recent.gui_rlc_use_pdus_from_mac && tap_info->loggedInMACFrame) ||
- (recent.gui_rlc_use_pdus_from_mac && !tap_info->loggedInMACFrame)) {
- return;
- }
-
+ void update(const rlc_3gpp_tap_info *tap_info)
+ {
// TODO: update title with number of UEs and frames like MAC does?
// N.B. not really expecting to see common stats - ignoring them.
@@ -430,9 +466,9 @@ public:
if (tap_info->direction == DIRECTION_UPLINK) {
// Update time range.
if (stats_.UL_frames == 0) {
- stats_.UL_time_start = tap_info->rlc_lte_time;
+ stats_.UL_time_start = tap_info->rlc_time;
}
- stats_.UL_time_stop = tap_info->rlc_lte_time;
+ stats_.UL_time_stop = tap_info->rlc_time;
stats_.UL_frames++;
stats_.UL_total_bytes += tap_info->pduLength;
@@ -448,9 +484,9 @@ public:
else {
// Update time range.
if (stats_.DL_frames == 0) {
- stats_.DL_time_start = tap_info->rlc_lte_time;
+ stats_.DL_time_start = tap_info->rlc_time;
}
- stats_.DL_time_stop = tap_info->rlc_lte_time;
+ stats_.DL_time_stop = tap_info->rlc_time;
stats_.DL_frames++;
stats_.DL_total_bytes += tap_info->pduLength;
@@ -472,7 +508,7 @@ public:
channel_item = CCCH_stats_;
if (channel_item == NULL) {
channel_item = CCCH_stats_ =
- new RlcChannelTreeWidgetItem(this, tap_info->ueid, RLC_TM_MODE,
+ new RlcChannelTreeWidgetItem(this, tap_info->rat, tap_info->ueid, RLC_TM_MODE,
tap_info->channelType, tap_info->channelId);
}
break;
@@ -481,7 +517,7 @@ public:
channel_item = srb_stats_[tap_info->channelId-1];
if (channel_item == NULL) {
channel_item = srb_stats_[tap_info->channelId-1] =
- new RlcChannelTreeWidgetItem(this, tap_info->ueid, RLC_AM_MODE,
+ new RlcChannelTreeWidgetItem(this, tap_info->rat, tap_info->ueid, RLC_AM_MODE,
tap_info->channelType, tap_info->channelId);
}
break;
@@ -490,7 +526,7 @@ public:
channel_item = drb_stats_[tap_info->channelId-1];
if (channel_item == NULL) {
channel_item = drb_stats_[tap_info->channelId-1] =
- new RlcChannelTreeWidgetItem(this, tap_info->ueid, tap_info->rlcMode,
+ new RlcChannelTreeWidgetItem(this, tap_info->rat, tap_info->ueid, tap_info->rlcMode,
tap_info->channelType, tap_info->channelId);
}
break;
@@ -505,7 +541,8 @@ public:
}
// Draw UE entry
- void draw() {
+ void draw()
+ {
// Fixed fields only drawn once from constructor so don't redraw here.
/* Calculate bandwidths. */
@@ -516,6 +553,8 @@ public:
&stats_.DL_time_stop,
stats_.DL_total_bytes);
+ setText(col_rat_, (rat_ == RLC_RAT_LTE) ? QString("LTE") : QString("NR"));
+
// Uplink.
setText(col_ul_frames_, QString::number(stats_.UL_frames));
setText(col_ul_bytes_, QString::number(stats_.UL_total_bytes));
@@ -564,35 +603,63 @@ public:
}
// Filter expression for UE.
- const QString filterExpression(bool showSR, bool showRACH) {
+ const QString filterExpression(bool showSR, bool showRACH)
+ {
// Create an expression to match with all traffic for this UE.
QString filter_expr;
// Are we taking RLC PDUs from MAC, or not?
if (!recent.gui_rlc_use_pdus_from_mac) {
- filter_expr += QString("not mac-lte and ");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("not mac-lte and ");
+ }
+ else {
+ filter_expr += QString("not mac-nr and ");
+ }
}
else {
- filter_expr += QString("mac-lte and ");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("mac-lte and ");
+ }
+ else {
+ filter_expr += QString("mac-nr and ");
+ }
}
if (showSR) {
- filter_expr += QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("(mac-lte.sr-req and mac-lte.ueid == %1) or (").arg(ueid_);
+ }
}
if (showRACH) {
- filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("(mac-lte.rar or (mac-lte.preamble-sent and mac-lte.ueid == %1)) or (").arg(ueid_);
+ }
+ else {
+ filter_expr += QString("mac-nr.rar or ");
+ }
}
- filter_expr += QString("rlc-lte.ueid==%1").arg(ueid_);
+ // Must match UE
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString("rlc-lte.ueid==%1").arg(ueid_);
+ }
+ else {
+ filter_expr += QString("rlc-nr.ueid==%1").arg(ueid_);
+ }
// Close () if open because of SR
if (showSR) {
- filter_expr += QString(")");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
// Close () if open because of RACH
if (showRACH) {
- filter_expr += QString(")");
+ if (rat_ == RLC_RAT_LTE) {
+ filter_expr += QString(")");
+ }
}
return filter_expr;
@@ -623,6 +690,7 @@ public:
}
private:
+ uint8_t rat_;
unsigned ueid_;
rlc_ue_stats stats_;
@@ -633,15 +701,16 @@ private:
};
-// Only the first 3 columns headings differ between UE and channel rows.
-
-static const QString ue_col_0_title_ = QObject::tr("UE Id");
-static const QString ue_col_1_title_ = QObject::tr("");
+// Only the first 4 columns headings differ between UE and channel rows.
+static const QString ue_col_0_title_ = QObject::tr("RAT");
+static const QString ue_col_1_title_ = QObject::tr("UE Id");
static const QString ue_col_2_title_ = QObject::tr("");
+static const QString ue_col_3_title_ = QObject::tr("");
-static const QString channel_col_0_title_ = QObject::tr("Name");
-static const QString channel_col_1_title_ = QObject::tr("Mode");
-static const QString channel_col_2_title_ = QObject::tr("Priority");
+static const QString channel_col_0_title_ = QObject::tr("");
+static const QString channel_col_1_title_ = QObject::tr("Name");
+static const QString channel_col_2_title_ = QObject::tr("Mode");
+static const QString channel_col_3_title_ = QObject::tr("Priority");
@@ -650,11 +719,11 @@ static const QString channel_col_2_title_ = QObject::tr("Priority");
// Constructor.
LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *filter) :
- TapParameterDialog(parent, cf, HELP_STATS_LTE_MAC_TRAFFIC_DIALOG),
+ TapParameterDialog(parent, cf, HELP_STATS_LTE_RLC_TRAFFIC_DIALOG),
cf_(cf),
packet_count_(0)
{
- setWindowSubtitle(tr("LTE RLC Statistics"));
+ setWindowSubtitle(tr("3GPP RLC Statistics"));
loadGeometry((parent.width() * 5) / 5, (parent.height() * 3) / 4, "LTERLCStatisticsDialog");
// Create a grid for filtering-related widgetsto also appear in layout.
@@ -692,7 +761,7 @@ LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf,
filter_controls_grid->addWidget(useRLCFramesFromMacCheckBox_);
QStringList header_labels = QStringList()
- << "" << "" << ""
+ << "" << "" << "" << ""
<< tr("UL Frames") << tr("UL Bytes") << tr("UL MB/s")
<< tr("UL ACKs") << tr("UL NACKs") << tr("UL Missing")
<< tr("DL Frames") << tr("DL Bytes") << tr("DL MB/s")
@@ -705,6 +774,9 @@ LteRlcStatisticsDialog::LteRlcStatisticsDialog(QWidget &parent, CaptureFile &cf,
// resizeColumnToContents doesn't work well here, so set sizes manually.
for (int col = 0; col < statsTreeWidget()->columnCount() - 1; col++) {
switch (col) {
+ case col_rat_:
+ statsTreeWidget()->setColumnWidth(col, one_em * 3);
+ break;
case col_ueid_:
statsTreeWidget()->setColumnWidth(col, one_em * 7);
break;
@@ -770,24 +842,33 @@ void LteRlcStatisticsDialog::tapReset(void *ws_dlg_ptr)
// Process the tap info from a dissected RLC PDU.
// Returns TAP_PACKET_REDRAW if a redraw is needed, TAP_PACKET_DONT_REDRAW otherwise.
-tap_packet_status LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *rlc_lte_tap_info_ptr, tap_flags_t)
+tap_packet_status LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *rlc_3gpp_tap_info_ptr, tap_flags_t)
{
// Look up dialog.
LteRlcStatisticsDialog *ws_dlg = static_cast<LteRlcStatisticsDialog *>(ws_dlg_ptr);
- const rlc_lte_tap_info *rlt_info = (const rlc_lte_tap_info *) rlc_lte_tap_info_ptr;
+ const rlc_3gpp_tap_info *rlt_info = (const rlc_3gpp_tap_info *) rlc_3gpp_tap_info_ptr;
if (!ws_dlg || !rlt_info) {
return TAP_PACKET_DONT_REDRAW;
}
+ // Are we ignoring RLC frames that were found in MAC frames, or only those
+ // that were logged separately?
+ if ((!recent.gui_rlc_use_pdus_from_mac && rlt_info->loggedInMACFrame) ||
+ (recent.gui_rlc_use_pdus_from_mac && !rlt_info->loggedInMACFrame)) {
+ return TAP_PACKET_DONT_REDRAW;
+ }
+
ws_dlg->incFrameCount();
- // Look for this UE (TODO: avoid linear search if have lots of UEs in capture...)
+ // Look for this UE (TODO: avoid linear search if have lots of UEs in capture?)
RlcUeTreeWidgetItem *ue_ti = NULL;
for (int i = 0; i < ws_dlg->statsTreeWidget()->topLevelItemCount(); i++) {
QTreeWidgetItem *ti = ws_dlg->statsTreeWidget()->topLevelItem(i);
if (ti->type() != rlc_ue_row_type_) continue;
+ // Get UE object for this entry
RlcUeTreeWidgetItem *cur_ru_ti = static_cast<RlcUeTreeWidgetItem*>(ti);
+ // Does it match this tap?
if (cur_ru_ti->isMatch(rlt_info)) {
ue_ti = cur_ru_ti;
break;
@@ -842,6 +923,7 @@ void LteRlcStatisticsDialog::useRLCFramesFromMacCheckBoxToggled(bool state)
fillTree();
}
+// Return a filter expression for currently selected UE or bearer row
const QString LteRlcStatisticsDialog::filterExpression()
{
QString filter_expr;
@@ -864,7 +946,7 @@ const QString LteRlcStatisticsDialog::filterExpression()
void LteRlcStatisticsDialog::fillTree()
{
- if (!registerTapListener("rlc-lte",
+ if (!registerTapListener("rlc-3gpp",
this,
displayFilter_.toLatin1().data(),
TL_REQUIRES_NOTHING,
@@ -904,14 +986,16 @@ void LteRlcStatisticsDialog::updateHeaderLabels()
statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
// UE column headings.
- statsTreeWidget()->headerItem()->setText(col_ueid_, channel_col_0_title_);
- statsTreeWidget()->headerItem()->setText(col_mode_, channel_col_1_title_);
- statsTreeWidget()->headerItem()->setText(col_priority_, channel_col_2_title_);
+ statsTreeWidget()->headerItem()->setText(col_rat_, channel_col_0_title_);
+ statsTreeWidget()->headerItem()->setText(col_ueid_, channel_col_1_title_);
+ statsTreeWidget()->headerItem()->setText(col_mode_, channel_col_2_title_);
+ statsTreeWidget()->headerItem()->setText(col_priority_, channel_col_3_title_);
} else {
// Channel column headings.
- statsTreeWidget()->headerItem()->setText(col_ueid_, ue_col_0_title_);
- statsTreeWidget()->headerItem()->setText(col_mode_, ue_col_1_title_);
- statsTreeWidget()->headerItem()->setText(col_priority_, ue_col_2_title_);
+ statsTreeWidget()->headerItem()->setText(col_rat_, ue_col_0_title_);
+ statsTreeWidget()->headerItem()->setText(col_ueid_, ue_col_1_title_);
+ statsTreeWidget()->headerItem()->setText(col_mode_, ue_col_2_title_);
+ statsTreeWidget()->headerItem()->setText(col_priority_, ue_col_3_title_);
}
}
@@ -925,11 +1009,15 @@ void LteRlcStatisticsDialog::captureFileClosing()
// Launch a UL graph for the currently-selected channel.
void LteRlcStatisticsDialog::launchULGraphButtonClicked()
{
- if (statsTreeWidget()->selectedItems().count() > 0 && statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
+ if (statsTreeWidget()->selectedItems().count() > 0 &&
+ statsTreeWidget()->selectedItems()[0]->type() == rlc_channel_row_type_) {
+
// Get the channel item.
QTreeWidgetItem *ti = statsTreeWidget()->selectedItems()[0];
RlcChannelTreeWidgetItem *rc_ti = static_cast<RlcChannelTreeWidgetItem*>(ti);
+ // Launch the graph.
emit launchRLCGraph(true,
+ rc_ti->get_rat(),
rc_ti->get_ueid(),
rc_ti->get_mode(),
rc_ti->get_channelType(),
@@ -946,6 +1034,7 @@ void LteRlcStatisticsDialog::launchDLGraphButtonClicked()
QTreeWidgetItem *ti = statsTreeWidget()->selectedItems()[0];
RlcChannelTreeWidgetItem *rc_ti = static_cast<RlcChannelTreeWidgetItem*>(ti);
emit launchRLCGraph(true,
+ rc_ti->get_rat(),
rc_ti->get_ueid(),
rc_ti->get_mode(),
rc_ti->get_channelType(),
@@ -982,7 +1071,8 @@ QList<QVariant> LteRlcStatisticsDialog::treeItemData(QTreeWidgetItem *item) cons
// Stat command + args
static void
-lte_rlc_statistics_init(const char *args, void*) {
+lte_rlc_statistics_init(const char *args, void*)
+{
QStringList args_l = QString(args).split(',');
QByteArray filter;
if (args_l.length() > 2) {
@@ -992,12 +1082,12 @@ lte_rlc_statistics_init(const char *args, void*) {
}
static stat_tap_ui lte_rlc_statistics_ui = {
- REGISTER_STAT_GROUP_TELEPHONY_LTE,
+ REGISTER_TELEPHONY_GROUP_3GPP_UU,
QT_TRANSLATE_NOOP("LteRlcStatisticsDialog", "RLC Statistics"),
- "rlc-lte,stat",
+ "rlc-3gpp,stat", // cli_string
lte_rlc_statistics_init,
- 0,
- NULL
+ 0, // nparams
+ NULL // params
};
extern "C" {
diff --git a/ui/qt/lte_rlc_statistics_dialog.h b/ui/qt/lte_rlc_statistics_dialog.h
index 50e1af92..fc97996e 100644
--- a/ui/qt/lte_rlc_statistics_dialog.h
+++ b/ui/qt/lte_rlc_statistics_dialog.h
@@ -12,6 +12,10 @@
#include "tap_parameter_dialog.h"
+#include <epan/dissectors/packet-rlc-lte.h>
+#include <epan/dissectors/packet-rlc-3gpp-common.h>
+
+
#include <QCheckBox>
class LteRlcStatisticsDialog : public TapParameterDialog
@@ -30,9 +34,11 @@ protected:
signals:
void launchRLCGraph(bool channelKnown,
- guint16 ueid, guint8 rlcMode,
- guint16 channelType, guint16 channelId,
- guint8 direction);
+ uint8_t version,
+ uint16_t ueid,
+ uint8_t rlcMode,
+ uint16_t channelType, uint16_t channelId,
+ uint8_t direction);
private:
// Extra controls needed for this dialog.
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 582855f2..c7d459b1 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -10,8 +10,6 @@
#include <config.h>
#define WS_LOG_DOMAIN LOG_DOMAIN_MAIN
-#include <glib.h>
-
#include <locale.h>
#ifdef _WIN32
@@ -77,6 +75,7 @@
#include "ui/preference_utils.h"
#include "ui/software_update.h"
#include "ui/taps.h"
+#include "ui/profile.h"
#include "ui/qt/conversation_dialog.h"
#include "ui/qt/utils/color_utils.h"
@@ -209,11 +208,27 @@ gather_wireshark_qt_compiled_info(feature_list l)
#endif
gather_caplibs_compile_info(l);
epan_gather_compile_info(l);
+#ifdef HAVE_MINIZIPNG
+ with_feature(l, "Minizip-ng %s", MINIZIPNG_VERSION);
+#else
+#ifdef HAVE_MINIZIP
+ with_feature(l, "Minizip %s", MINIZIP_VERSION);
+#else
+ without_feature(l, "Minizip");
+#endif
+#endif /* HAVE_MINIZIPNG */
#ifdef QT_MULTIMEDIA_LIB
with_feature(l, "QtMultimedia");
#else
without_feature(l, "QtMultimedia");
#endif
+#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
+#ifdef QT_DBUS_LIB
+ with_feature(l, "QtDBus");
+#else
+ without_feature(l, "QtDBus");
+#endif
+#endif /* !Q_OS_WIN && !Q_OS_MAC */
const char *update_info = software_update_info();
if (update_info) {
@@ -228,12 +243,6 @@ gather_wireshark_qt_compiled_info(feature_list l)
without_feature(l, "AirPcap");
#endif
#endif /* _WIN32 */
-
-#ifdef HAVE_MINIZIP
- with_feature(l, "Minizip");
-#else
- without_feature(l, "Minizip");
-#endif
}
void
@@ -339,7 +348,7 @@ qt_log_message_handler(QtMsgType type, const QMessageLogContext &context, const
static void
check_and_warn_user_startup()
{
- gchar *cur_user, *cur_group;
+ char *cur_user, *cur_group;
/* Tell the user not to run as root. */
if (running_with_special_privs() && recent.privs_warn_if_elevated) {
@@ -447,16 +456,15 @@ macos_enable_layer_backing(void)
static GList *
capture_opts_get_interface_list(int *err, char **err_str)
{
- /*
- * XXX - should this pass an update callback?
- * We already have a window up by the time we start parsing
- * the majority of the command-line arguments, because
- * we need to do a bunch of initialization work before
- * parsing those arguments, and we want to let the user
- * know that we're doing that initialization, given that
- * it can take a while.
- */
- return capture_interface_list(err, err_str, NULL);
+ if (mainApp) {
+ GList *if_list = mainApp->getInterfaceList();
+ if (if_list == NULL) {
+ if_list = capture_interface_list(err, err_str, main_window_update);
+ mainApp->setInterfaceList(if_list);
+ }
+ return if_list;
+ }
+ return capture_interface_list(err, err_str, main_window_update);
}
#endif
@@ -475,15 +483,15 @@ int main(int argc, char *qt_argv[])
char *rf_path;
int rf_open_errno;
#ifdef HAVE_LIBPCAP
- gchar *err_str, *err_str_secondary;;
+ char *err_str, *err_str_secondary;
#else
#ifdef _WIN32
#ifdef HAVE_AIRPCAP
- gchar *err_str;
+ char *err_str;
#endif
#endif
#endif
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
df_error_t *df_err = NULL;
QString dfilter, read_filter;
@@ -491,7 +499,7 @@ int main(int argc, char *qt_argv[])
int caps_queries = 0;
#endif
/* Start time in microseconds */
- guint64 start_time = g_get_monotonic_time();
+ uint64_t start_time = g_get_monotonic_time();
static const struct report_message_routines wireshark_report_routines = {
vfailure_alert_box,
vwarning_alert_box,
@@ -542,7 +550,7 @@ int main(int argc, char *qt_argv[])
/* Initialize log handler early so we can have proper logging during startup. */
ws_log_init("wireshark", vcmdarg_err);
/* For backward compatibility with GLib logging and Wireshark 3.4. */
- ws_log_console_writer_set_use_stdout(TRUE);
+ ws_log_console_writer_set_use_stdout(true);
qInstallMessageHandler(qt_log_message_handler);
@@ -551,7 +559,7 @@ int main(int argc, char *qt_argv[])
#endif
#ifdef DEBUG_STARTUP_TIME
- prefs.gui_console_open = console_open_always;
+ ws_log_console_open = LOG_CONSOLE_OPEN_ALWAYS;
#endif /* DEBUG_STARTUP_TIME */
#if defined(Q_OS_MAC)
@@ -675,7 +683,7 @@ int main(int argc, char *qt_argv[])
g_free (rf_path);
}
- profile_store_persconffiles(TRUE);
+ profile_store_persconffiles(true);
recent_init();
/* Read the profile independent recent file. We have to do this here so we can */
@@ -704,7 +712,7 @@ int main(int argc, char *qt_argv[])
// https://bugreports.qt.io/browse/QTBUG-53022 - The device pixel ratio is pretty much bogus on Windows.
// https://bugreports.qt.io/browse/QTBUG-55510 - Windows have wrong size
//
- // Deprecated in Qt6.
+ // Deprecated in Qt6, which is Per-Monitor DPI Aware V2 by default.
// warning: 'Qt::AA_EnableHighDpiScaling' is deprecated: High-DPI scaling is always enabled.
// This attribute no longer has any effect.
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@@ -762,8 +770,10 @@ int main(int argc, char *qt_argv[])
GLibMainloopOnQEventLoop::setup(main_w);
// We may not need a queued connection here but it would seem to make sense
// to force the issue.
- main_w->connect(&ws_app, SIGNAL(openCaptureFile(QString,QString,unsigned int)),
- main_w, SLOT(openCaptureFile(QString,QString,unsigned int)));
+ main_w->connect(&ws_app, &WiresharkApplication::openCaptureFile,
+ main_w, [&](QString cf_path, QString display_filter, unsigned int type) {
+ main_w->openCaptureFile(cf_path, display_filter, type);
+ });
main_w->connect(&ws_app, &WiresharkApplication::openCaptureOptions,
main_w, &WiresharkMainWindow::showCaptureOptionsDialog);
@@ -793,7 +803,7 @@ int main(int argc, char *qt_argv[])
* dissection-time handlers for file-type-dependent blocks can
* register using the file type/subtype value for the file type.
*/
- wtap_init(TRUE);
+ wtap_init(true);
splash_update(RA_DISSECTORS, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
@@ -803,14 +813,14 @@ int main(int argc, char *qt_argv[])
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
case any dissectors register preferences. */
- if (!epan_init(splash_update, NULL, TRUE)) {
+ if (!epan_init(splash_update, NULL, true)) {
SimpleDialog::displayQueuedMessages(main_w);
ret_val = WS_EXIT_INIT_FAILED;
goto clean_exit;
}
#ifdef DEBUG_STARTUP_TIME
/* epan_init resets the preferences */
- prefs.gui_console_open = console_open_always;
+ ws_log_console_open = LOG_CONSOLE_OPEN_ALWAYS;
ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
#endif
@@ -847,11 +857,6 @@ int main(int argc, char *qt_argv[])
in_file_type = open_info_name_to_type(ex_opt_get_next("read_format"));
}
-#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
-#endif
- splash_update(RA_EXTCAP, NULL, NULL);
- extcap_register_preferences();
splash_update(RA_PREFERENCES, NULL, NULL);
#ifdef DEBUG_STARTUP_TIME
ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
@@ -864,7 +869,17 @@ int main(int argc, char *qt_argv[])
* line, and store them. We have to do this before applying the
* preferences to the capture options.
*/
- commandline_override_prefs(argc, argv, TRUE);
+ commandline_override_prefs(argc, argv, true);
+
+ /* Register the extcap preferences. We do this after seeing if the
+ * capture_no_extcap preference is set in the configuration file
+ * or command line. This will re-read the extcap specific preferences.
+ */
+#ifdef DEBUG_STARTUP_TIME
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
+#endif
+ splash_update(RA_EXTCAP, NULL, NULL);
+ extcap_register_preferences();
/* Some of the preferences affect the capture options. Apply those
* before getting the other command line arguments, which can also
@@ -875,7 +890,21 @@ int main(int argc, char *qt_argv[])
prefs_to_capture_opts();
/* Now get our remaining args */
- commandline_other_options(argc, argv, TRUE);
+
+ /* XXX: Processing interface options on the command line might retrieve
+ * interface list. We don't yet know if we will need to retrieve the
+ * interface capabilities as well (e.g. are we printing capabilities,
+ * or loading the interface list?) until we parse other options, like
+ * whether we have a capture file.
+ *
+ * We'd prefer to avoid firing up dumpcap twice (once for the list
+ * without the capabilities and once for capabilities), especially
+ * on Windows where that could mean two UAC prompts. However, getting
+ * the interface capabilities is a bit time-consuming so we don't want
+ * to do it if we don't need to.
+ */
+
+ commandline_other_options(argc, argv, true);
/* Convert some command-line parameters to QStrings */
if (global_commandline_info.cf_name != NULL)
@@ -890,17 +919,9 @@ int main(int argc, char *qt_argv[])
timestamp_set_seconds_type (recent.gui_seconds_format);
#ifdef HAVE_LIBPCAP
-#ifdef DEBUG_STARTUP_TIME
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
-#endif
- splash_update(RA_INTERFACES, NULL, NULL);
-
- if (!global_commandline_info.cf_name && !prefs.capture_no_interface_load)
- fill_in_local_interfaces(main_window_update);
-
- if (global_commandline_info.list_link_layer_types)
+ if (global_commandline_info.list_link_layer_types)
caps_queries |= CAPS_QUERY_LINK_TYPES;
- if (global_commandline_info.list_timestamp_types)
+ if (global_commandline_info.list_timestamp_types)
caps_queries |= CAPS_QUERY_TIMESTAMP_TYPES;
if (global_commandline_info.start_capture || caps_queries) {
@@ -919,27 +940,41 @@ int main(int argc, char *qt_argv[])
* and exit.
*/
if (caps_queries) {
- guint i;
+ unsigned i;
#ifdef _WIN32
create_console();
#endif /* _WIN32 */
/* Get the list of link-layer types for the capture devices. */
ret_val = EXIT_SUCCESS;
+ GList *if_cap_queries = NULL;
+ if_cap_query_t *if_cap_query;
+ GHashTable *capability_hash;
for (i = 0; i < global_capture_opts.ifaces->len; i++) {
interface_options *interface_opts;
- if_capabilities_t *caps;
- char *auth_str = NULL;
interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
+ if_cap_query = g_new(if_cap_query_t, 1);
+ if_cap_query->name = interface_opts->name;
+ if_cap_query->monitor_mode = interface_opts->monitor_mode;
+ if_cap_query->auth_username = NULL;
+ if_cap_query->auth_password = NULL;
#ifdef HAVE_PCAP_REMOTE
if (interface_opts->auth_type == CAPTURE_AUTH_PWD) {
- auth_str = ws_strdup_printf("%s:%s", interface_opts->auth_username, interface_opts->auth_password);
+ if_cap_query->auth_username = interface_opts->auth_username;
+ if_cap_query->auth_password = interface_opts->auth_password;
}
#endif
- caps = capture_get_if_capabilities(interface_opts->name, interface_opts->monitor_mode,
- auth_str, &err_str, &err_str_secondary, NULL);
- g_free(auth_str);
+ if_cap_queries = g_list_prepend(if_cap_queries, if_cap_query);
+ }
+ if_cap_queries = g_list_reverse(if_cap_queries);
+ capability_hash = capture_get_if_list_capabilities(if_cap_queries, &err_str, &err_str_secondary, NULL);
+ g_list_free_full(if_cap_queries, g_free);
+ for (i = 0; i < global_capture_opts.ifaces->len; i++) {
+ interface_options *interface_opts;
+ if_capabilities_t *caps;
+ interface_opts = &g_array_index(global_capture_opts.ifaces, interface_options, i);
+ caps = static_cast<if_capabilities_t*>(g_hash_table_lookup(capability_hash, interface_opts->name));
if (caps == NULL) {
cmdarg_err("%s%s%s", err_str, err_str_secondary ? "\n" : "", err_str_secondary ? err_str_secondary : "");
g_free(err_str);
@@ -949,7 +984,6 @@ int main(int argc, char *qt_argv[])
}
ret_val = capture_opts_print_if_capabilities(caps, interface_opts,
caps_queries);
- free_if_capabilities(caps);
if (ret_val != EXIT_SUCCESS) {
break;
}
@@ -957,9 +991,19 @@ int main(int argc, char *qt_argv[])
#ifdef _WIN32
destroy_console();
#endif /* _WIN32 */
+ g_hash_table_destroy(capability_hash);
goto clean_exit;
}
+#ifdef DEBUG_STARTUP_TIME
+ ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time);
+#endif
+ splash_update(RA_INTERFACES, NULL, NULL);
+
+ if (!global_commandline_info.cf_name && !prefs.capture_no_interface_load) {
+ wsApp->scanLocalInterfaces(nullptr);
+ }
+
capture_opts_trim_snaplen(&global_capture_opts, MIN_PACKET_SIZE);
capture_opts_trim_ring_num_files(&global_capture_opts);
#endif /* HAVE_LIBPCAP */
@@ -972,17 +1016,18 @@ int main(int argc, char *qt_argv[])
#endif
splash_update(RA_PREFERENCES_APPLY, NULL, NULL);
prefs_apply_all();
+ wsApp->emitAppSignal(WiresharkApplication::ColorsChanged);
wsApp->emitAppSignal(WiresharkApplication::PreferencesChanged);
#ifdef HAVE_LIBPCAP
if ((global_capture_opts.num_selected == 0) &&
(prefs.capture_device != NULL)) {
- guint i;
+ unsigned i;
interface_t *device;
for (i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device->hidden && strcmp(device->display_name, prefs.capture_device) == 0) {
- device->selected = TRUE;
+ device->selected = true;
global_capture_opts.num_selected++;
break;
}
@@ -999,7 +1044,7 @@ int main(int argc, char *qt_argv[])
goto clean_exit;
}
- build_column_format_array(&CaptureFile::globalCapFile()->cinfo, global_commandline_info.prefs_p->num_cols, TRUE);
+ build_column_format_array(&CaptureFile::globalCapFile()->cinfo, global_commandline_info.prefs_p->num_cols, true);
wsApp->emitAppSignal(WiresharkApplication::ColumnsChanged); // We read "recent" widths above.
wsApp->emitAppSignal(WiresharkApplication::RecentPreferencesRead); // Must be emitted after PreferencesChanged.
@@ -1022,7 +1067,7 @@ int main(int argc, char *qt_argv[])
* processEvents() here.
*/
wsApp->allSystemsGo();
- ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Wireshark is up and ready to go, elapsed time %.3fs", (float) (g_get_monotonic_time() - start_time) / 1000000);
+ ws_info("Wireshark is up and ready to go, elapsed time %.3fs", (float) (g_get_monotonic_time() - start_time) / 1000000);
SimpleDialog::displayQueuedMessages(main_w);
/* User could specify filename, or display filter, or both */
@@ -1043,7 +1088,7 @@ int main(int argc, char *qt_argv[])
if (global_commandline_info.go_to_packet != 0) {
/* Jump to the specified frame number, kept for backward
compatibility. */
- cf_goto_frame(CaptureFile::globalCapFile(), global_commandline_info.go_to_packet);
+ cf_goto_frame(CaptureFile::globalCapFile(), global_commandline_info.go_to_packet, false);
} else if (global_commandline_info.jfilter != NULL) {
dfilter_t *jump_to_filter = NULL;
/* try to compile given filter */
@@ -1069,7 +1114,7 @@ int main(int argc, char *qt_argv[])
if (global_capture_opts.save_file != NULL) {
/* Save the directory name for future file dialogs. */
/* (get_dirname overwrites filename) */
- gchar *s = g_strdup(global_capture_opts.save_file);
+ char *s = g_strdup(global_capture_opts.save_file);
set_last_open_dir(get_dirname(s));
g_free(s);
}
@@ -1079,6 +1124,9 @@ int main(int argc, char *qt_argv[])
/* If no user interfaces were specified on the command line,
copy the list of selected interfaces to the set of interfaces
to use for this capture. */
+ /* XXX: I don't think this can happen, because if start_capture is
+ * true then capture_opts_default_iface_if_necessary() was called
+ */
if (global_capture_opts.ifaces->len == 0)
collect_ifaces(&global_capture_opts);
CaptureFile::globalCapFile()->window = main_w;
@@ -1106,8 +1154,10 @@ int main(int argc, char *qt_argv[])
// loaded when the dialog is shown. Register them here.
profile_register_persconffile("io_graphs");
profile_register_persconffile("import_hexdump.json");
+ profile_register_persconffile("remote_hosts.json");
- profile_store_persconffiles(FALSE);
+ profile_store_persconffiles(false);
+ init_profile_list();
// If the wsApp->exec() event loop exits cleanly, we call
// WiresharkApplication::cleanup().
diff --git a/ui/qt/main_application.cpp b/ui/qt/main_application.cpp
index bc52b6cf..00b65218 100644
--- a/ui/qt/main_application.cpp
+++ b/ui/qt/main_application.cpp
@@ -31,7 +31,9 @@
#include "epan/tap.h"
#include "epan/timestamp.h"
#include "epan/decode_as.h"
+#include "epan/dfilter/dfilter-macro.h"
+#include "ui/commandline.h"
#include "ui/decode_as_utils.h"
#include "ui/preference_utils.h"
#include "ui/iface_lists.h"
@@ -110,7 +112,7 @@
#pragma warning(pop)
#endif
-MainApplication *mainApp = NULL;
+MainApplication *mainApp;
// XXX - Copied from ui/gtk/file_dlg.c
@@ -161,7 +163,7 @@ topic_action(topic_action_e action)
* https://stackoverflow.com/questions/437212/how-do-you-register-a-most-recently-used-list-with-windows-in-preparation-for-win
*/
extern "C" void
-add_menu_recent_capture_file(const gchar *cf_name) {
+add_menu_recent_capture_file(const char *cf_name, bool force) {
QString normalized_cf_name = QString::fromUtf8(cf_name);
QDir cf_path;
@@ -196,7 +198,7 @@ add_menu_recent_capture_file(const gchar *cf_name) {
*/
ri->filename.compare(normalized_cf_name) == 0 ||
#endif
- cnt >= prefs.gui_recent_files_count_max) {
+ (!force && cnt >= prefs.gui_recent_files_count_max)) {
rii.remove();
delete(ri);
cnt--;
@@ -212,12 +214,15 @@ extern "C" void menu_recent_file_write_all(FILE *rf) {
/* we have to iterate backwards through the children's list,
* so we get the latest item last in the file.
*/
- QListIterator<recent_item_status *> rii(recent_captures_);
- rii.toBack();
- while (rii.hasPrevious()) {
- QString cf_name;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ int i = qMin(recent_captures_.size(), (int)(prefs.gui_recent_files_count_max)) - 1;
+#else
+ qsizetype i = qMin(recent_captures_.size(), (qsizetype)prefs.gui_recent_files_count_max) - 1;
+#endif
+ for (; i >= 0; i--) {
+ recent_item_status *ri = recent_captures_.at(i);
/* get capture filename from the menu item label */
- cf_name = rii.previous()->filename;
+ QString cf_name = ri->filename;
if (!cf_name.isNull()) {
fprintf (rf, RECENT_KEY_CAPTURE_FILE ": %s\n", qUtf8Printable(cf_name));
}
@@ -279,7 +284,7 @@ void MainApplication::colorSchemeChanged() {
void MainApplication::updateTaps()
{
- draw_tap_listeners(FALSE);
+ draw_tap_listeners(false);
}
QDir MainApplication::openDialogInitialDir() {
@@ -288,7 +293,8 @@ QDir MainApplication::openDialogInitialDir() {
void MainApplication::setLastOpenDirFromFilename(const QString file_name)
{
- QString directory = QFileInfo(file_name).absolutePath();
+ /* XXX - Use canonicalPath() instead of absolutePath()? */
+ QString directory = QDir::toNativeSeparators(QFileInfo(file_name).absolutePath());
/* XXX - printable? */
set_last_open_dir(qUtf8Printable(directory));
}
@@ -298,7 +304,7 @@ void MainApplication::helpTopicAction(topic_action_e action)
QString url = gchar_free_to_qstring(topic_action_url(action));
if (!url.isEmpty()) {
- QDesktopServices::openUrl(QUrl(url));
+ QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(url)));
}
}
@@ -396,25 +402,21 @@ void MainApplication::setMonospaceFont(const char *font_string) {
int MainApplication::monospaceTextSize(const char *str)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
return QFontMetrics(mono_font_).horizontalAdvance(str);
-#else
- return QFontMetrics(mono_font_).width(str);
-#endif
}
-void MainApplication::setConfigurationProfile(const gchar *profile_name, bool write_recent_file)
+void MainApplication::setConfigurationProfile(const char *profile_name, bool write_recent_file)
{
char *rf_path;
int rf_open_errno;
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
- gboolean prev_capture_no_interface_load;
- gboolean prev_capture_no_extcap;
+ bool prev_capture_no_interface_load;
+ bool prev_capture_no_extcap;
/* First check if profile exists */
- if (!profile_exists(profile_name, FALSE)) {
- if (profile_exists(profile_name, TRUE)) {
+ if (!profile_exists(profile_name, false)) {
+ if (profile_exists(profile_name, true)) {
char *pf_dir_path, *pf_dir_path2, *pf_filename;
/* Copy from global profile */
if (create_persconffile_profile(profile_name, &pf_dir_path) == -1) {
@@ -425,7 +427,7 @@ void MainApplication::setConfigurationProfile(const gchar *profile_name, bool wr
g_free(pf_dir_path);
}
- if (copy_persconffile_profile(profile_name, profile_name, TRUE, &pf_filename,
+ if (copy_persconffile_profile(profile_name, profile_name, true, &pf_filename,
&pf_dir_path, &pf_dir_path2) == -1) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't copy file \"%s\" in directory\n\"%s\" to\n\"%s\":\n%s.",
@@ -452,7 +454,7 @@ void MainApplication::setConfigurationProfile(const gchar *profile_name, bool wr
/* Get the current geometry, before writing it to disk */
emit profileChanging();
- if (write_recent_file && profile_exists(get_profile_name(), FALSE))
+ if (write_recent_file && profile_exists(get_profile_name(), false))
{
/* Write recent file for profile we are leaving, if it still exists */
write_profile_recent();
@@ -465,6 +467,13 @@ void MainApplication::setConfigurationProfile(const gchar *profile_name, bool wr
/* Apply new preferences */
readConfigurationFiles(true);
+ /* Apply command-line preferences */
+ commandline_options_reapply();
+ extcap_register_preferences();
+
+ /* Switching profile requires reloading the macro list. */
+ reloadDisplayFilterMacros();
+
if (!recent_read_profile_static(&rf_path, &rf_open_errno)) {
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
"Could not open common recent file\n\"%s\": %s.",
@@ -493,6 +502,7 @@ void MainApplication::setConfigurationProfile(const gchar *profile_name, bool wr
emit freezePacketList(true);
emit columnsChanged();
+ emit colorsChanged();
emit preferencesChanged();
emit recentPreferencesRead();
emit filterExpressionsChanged();
@@ -522,7 +532,7 @@ void MainApplication::setConfigurationProfile(const gchar *profile_name, bool wr
void MainApplication::reloadLuaPluginsDelayed()
{
- QTimer::singleShot(0, this, SIGNAL(reloadLuaPlugins()));
+ QTimer::singleShot(0, this, &MainApplication::reloadLuaPlugins);
}
const QIcon &MainApplication::normalIcon()
@@ -646,6 +656,9 @@ MainApplication::MainApplication(int &argc, char **argv) :
is_reloading_lua_(false),
if_notifier_(NULL),
active_captures_(0)
+#ifdef HAVE_LIBPCAP
+ , cached_if_list_(NULL)
+#endif
{
mainApp = this;
@@ -675,15 +688,13 @@ MainApplication::MainApplication(int &argc, char **argv) :
setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
setAttribute(Qt::AA_DisableWindowContextHelpButton);
#endif
// Throw various settings at the wall with the hope that one of them will
// enable context menu shortcuts QTBUG-69452, QTBUG-109590
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
setAttribute(Qt::AA_DontShowShortcutsInContextMenus, false);
-#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
styleHints()->setShowShortcutsInContextMenus(true);
#endif
@@ -696,7 +707,7 @@ MainApplication::MainApplication(int &argc, char **argv) :
// QFileSystemWatcher should allow us to watch for files being
// removed or renamed. It uses kqueues and EVFILT_VNODE on FreeBSD,
// NetBSD, FSEvents on macOS, inotify on Linux if available, and
- // FindFirstChagneNotification() on Windows. On all other platforms,
+ // FindFirstChangeNotification() on Windows. On all other platforms,
// it just periodically polls, as we're doing now.
//
// For unmounts:
@@ -775,17 +786,17 @@ MainApplication::MainApplication(int &argc, char **argv) :
// I'm not sure what can be done on Linux.
//
recent_timer_.setParent(this);
- connect(&recent_timer_, SIGNAL(timeout()), this, SLOT(refreshRecentCaptures()));
+ connect(&recent_timer_, &QTimer::timeout, this, &MainApplication::refreshRecentCaptures);
recent_timer_.start(2000);
packet_data_timer_.setParent(this);
- connect(&packet_data_timer_, SIGNAL(timeout()), this, SLOT(refreshPacketData()));
+ connect(&packet_data_timer_, &QTimer::timeout, this, &MainApplication::refreshPacketData);
packet_data_timer_.start(1000);
tap_update_timer_.setParent(this);
tap_update_timer_.setInterval(TAP_UPDATE_DEFAULT_INTERVAL);
- connect(this, SIGNAL(appInitialized()), &tap_update_timer_, SLOT(start()));
- connect(&tap_update_timer_, SIGNAL(timeout()), this, SLOT(updateTaps()));
+ connect(this, &MainApplication::appInitialized, &tap_update_timer_, [&]() { tap_update_timer_.start(); });
+ connect(&tap_update_timer_, &QTimer::timeout, this, &MainApplication::updateTaps);
// Application-wide style sheet
QString app_style_sheet = qApp->styleSheet();
@@ -795,7 +806,7 @@ MainApplication::MainApplication(int &argc, char **argv) :
prefs_set_gui_theme_is_dark(ColorUtils::themeIsDark());
#if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
- connect(this, SIGNAL(softwareUpdateQuit()), this, SLOT(quit()), Qt::QueuedConnection);
+ connect(this, &MainApplication::softwareUpdateQuit, this, &MainApplication::quit, Qt::QueuedConnection);
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && defined(Q_OS_WIN)
@@ -803,14 +814,16 @@ MainApplication::MainApplication(int &argc, char **argv) :
connect(styleHints(), &QStyleHints::colorSchemeChanged, this, &MainApplication::colorSchemeChanged);
#endif
- connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(cleanup()));
+ connect(qApp, &QApplication::aboutToQuit, this, &MainApplication::cleanup);
}
MainApplication::~MainApplication()
{
mainApp = NULL;
+#ifdef HAVE_LIBPCAP
+ free_interface_list(cached_if_list_);
+#endif
clearDynamicMenuGroupItems();
- free_filter_lists();
}
void MainApplication::registerUpdate(register_action_e action, const char *message)
@@ -857,6 +870,9 @@ void MainApplication::emitAppSignal(AppSignal signal)
case FieldsChanged:
emit fieldsChanged();
break;
+ case ColorsChanged:
+ emit colorsChanged();
+ break;
case FreezePacketList:
emit freezePacketList(false);
break;
@@ -985,7 +1001,7 @@ static void
iface_mon_event_cb(const char *iface, int added, int up)
{
int present = 0;
- guint ifs, j;
+ unsigned ifs, j;
interface_t *device;
interface_options *interface_opts;
@@ -1014,6 +1030,27 @@ iface_mon_event_cb(const char *iface, int added, int up)
/*
* We've been told that there's a new interface or that an old
* interface is gone; reload the local interface list.
+ *
+ * XXX: We also want to reload the local interface list if [what
+ * we can retrieve about] the capabilities of the device have changed.
+ * Ideally we'd update the capabilities of just the one device in
+ * the cache and signal that the list has been updated, instead of
+ * freeing the entire cache and scanning again - but some extcaps
+ * depend on other interfaces being up; e.g. by default androiddump
+ * tries to connect to the loopback interface to look for adb running,
+ * so if the loopback interface changes so does the status of
+ * androiddump.
+ *
+ * On Linux, at least, you can't get the capabilities from a down
+ * interface, but it's still present in all_ifaces - dumpcap returns
+ * it in the list, and we show it so the user can get a status / error
+ * message when trying to capture on it instead of it vanishing.
+ * So if both present and up are true, then we still want to refresh
+ * to update the capabilities and restart the stats.
+ *
+ * We also store the address in all_ifaces and show them to the user,
+ * so we probably should monitor those events as well and update
+ * the interface list appropriately when those change.
*/
mainApp->refreshLocalInterfaces();
}
@@ -1045,21 +1082,23 @@ void MainApplication::refreshLocalInterfaces()
extcap_clear_interfaces();
#ifdef HAVE_LIBPCAP
- /*
- * Reload the local interface list.
- */
- scan_local_interfaces(main_window_update);
-
- /*
- * Now emit a signal to indicate that the list changed, so that all
- * places displaying the list will get updated.
- *
- * XXX - only if it *did* change.
- */
- emit localInterfaceListChanged();
+ emit scanLocalInterfaces(nullptr);
#endif
}
+#ifdef HAVE_LIBPCAP
+GList* MainApplication::getInterfaceList() const
+{
+ return interface_list_copy(cached_if_list_);
+}
+
+void MainApplication::setInterfaceList(GList *if_list)
+{
+ free_interface_list(cached_if_list_);
+ cached_if_list_ = interface_list_copy(if_list);
+}
+#endif
+
void MainApplication::allSystemsGo()
{
QString display_filter = NULL;
@@ -1077,7 +1116,7 @@ void MainApplication::allSystemsGo()
if (err == 0) {
if_notifier_ = new QSocketNotifier(iface_mon_get_sock(),
QSocketNotifier::Read, this);
- connect(if_notifier_, SIGNAL(activated(int)), SLOT(ifChangeEventsAvailable()));
+ connect(if_notifier_, &QSocketNotifier::activated, this, &MainApplication::ifChangeEventsAvailable);
}
#endif
}
@@ -1099,9 +1138,6 @@ _e_prefs *MainApplication::readConfigurationFiles(bool reset)
/* Load libwireshark settings from the current profile. */
prefs_p = epan_load_settings();
- /* Read the capture filter file. */
- read_filter_list(CFILTER_LIST);
-
return prefs_p;
}
@@ -1178,9 +1214,9 @@ void MainApplication::loadLanguage(const QString newLanguage)
switchTranslator(mainApp->translator,
QString("wireshark_%1.qm").arg(localeLanguage), QString(get_datafile_dir()) + QString("/languages"));
if (QFile::exists(QString("%1/wireshark_%3.qm")
- .arg(gchar_free_to_qstring(get_persconffile_path("languages", FALSE))).arg(localeLanguage)))
+ .arg(gchar_free_to_qstring(get_persconffile_path("languages", false))).arg(localeLanguage)))
switchTranslator(mainApp->translator,
- QString("wireshark_%1.qm").arg(localeLanguage), gchar_free_to_qstring(get_persconffile_path("languages", FALSE)));
+ QString("wireshark_%1.qm").arg(localeLanguage), gchar_free_to_qstring(get_persconffile_path("languages", false)));
if (QFile::exists(QString("%1/qt_%2.qm")
.arg(get_datafile_dir()).arg(localeLanguage))) {
switchTranslator(mainApp->translatorQt,
@@ -1381,3 +1417,11 @@ void MainApplication::gotoFrame(int frame)
MainWindow * mw = qobject_cast<MainWindow *>(mainWindow());
mw->gotoFrame(frame);
}
+
+void MainApplication::reloadDisplayFilterMacros()
+{
+ dfilter_macro_reload();
+ // The signal is needed when the display filter grammar changes for
+ // any reason (not just "fields".)
+ mainApp->emitAppSignal(MainApplication::FieldsChanged);
+}
diff --git a/ui/qt/main_application.h b/ui/qt/main_application.h
index dd5b0bab..de7aad0a 100644
--- a/ui/qt/main_application.h
+++ b/ui/qt/main_application.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "wsutil/feature_list.h"
#include "epan/register.h"
@@ -56,6 +54,7 @@ public:
enum AppSignal {
CaptureFilterListChanged,
+ ColorsChanged,
ColumnsChanged,
DisplayFilterListChanged,
FieldsChanged,
@@ -89,6 +88,16 @@ public:
// Emitting app signals (PacketDissectionChanged in particular) from
// dialogs on macOS can be problematic. Dialogs should call queueAppSignal
// instead.
+ // On macOS, nested event loops (e.g., calling a dialog with exec())
+ // that call processEvents (e.g., from PacketDissectionChanged, or
+ // anything with a ProgressFrame) caused issues off and on from 5.3.0
+ // until 5.7.1/5.8.0. It appears to be solved after some false starts:
+ // https://bugreports.qt.io/browse/QTBUG-53947
+ // https://bugreports.qt.io/browse/QTBUG-56746
+ // We also try to avoid exec / additional event loops as much as possible:
+ // e.g., commit f67eccedd9836e6ced1f57ae9889f57a5400a3d7
+ // (note it can show up in unexpected places, e.g. static functions like
+ // WiresharkFileDialog::getOpenFileName())
void queueAppSignal(AppSignal signal) { app_signals_ << signal; }
void emitStatCommandSignal(const QString &menu_path, const char *arg, void *userdata);
void emitTapParameterSignal(const QString cfg_abbr, const QString arg, void *userdata);
@@ -105,6 +114,13 @@ public:
void emitLocalInterfaceEvent(const char *ifname, int added, int up);
virtual void refreshLocalInterfaces();
+#ifdef HAVE_LIBPCAP
+ // This returns a deep copy of the cached interface list that must
+ // be freed with free_interface_list.
+ GList * getInterfaceList() const;
+ // This set the cached interface list to a deep copy of if_list.
+ void setInterfaceList(GList *if_list);
+#endif
struct _e_prefs * readConfigurationFiles(bool reset);
QList<recent_item_status *> recentItems() const;
@@ -116,7 +132,7 @@ public:
const QFont monospaceFont(bool zoomed = false) const;
void setMonospaceFont(const char *font_string);
int monospaceTextSize(const char *str);
- void setConfigurationProfile(const gchar *profile_name, bool write_recent_file = true);
+ void setConfigurationProfile(const char *profile_name, bool write_recent_file = true);
void reloadLuaPluginsDelayed();
bool isInitialized() { return initialized_; }
void setReloadingLua(bool is_reloading) { is_reloading_lua_ = is_reloading; }
@@ -160,6 +176,7 @@ private:
static QString window_title_separator_;
QList<AppSignal> app_signals_;
int active_captures_;
+
#if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
bool software_update_ok_;
#endif
@@ -173,10 +190,14 @@ protected:
QIcon normal_icon_;
QIcon capture_icon_;
+#ifdef HAVE_LIBPCAP
+ GList *cached_if_list_;
+#endif
signals:
void appInitialized();
void localInterfaceEvent(const char *ifname, int added, int up);
+ void scanLocalInterfaces(GList *filter_list = nullptr);
void localInterfaceListChanged();
void openCaptureFile(QString cf_path, QString display_filter, unsigned int type);
void openCaptureOptions();
@@ -184,7 +205,7 @@ signals:
void updateRecentCaptureStatus(const QString &filename, qint64 size, bool accessible);
void splashUpdate(register_action_e action, const char *message);
void profileChanging();
- void profileNameChanged(const gchar *profile_name);
+ void profileNameChanged(const char *profile_name);
void freezePacketList(bool changing_profile);
void columnsChanged(); // XXX This recreates the packet list. We might want to rename it accordingly.
@@ -192,6 +213,7 @@ signals:
void displayFilterListChanged();
void filterExpressionsChanged();
void packetDissectionChanged();
+ void colorsChanged();
void preferencesChanged();
void addressResolutionChanged();
void columnDataChanged();
@@ -223,6 +245,8 @@ public slots:
// each dialog that calls queueAppSignal closes.
void flushAppSignals();
+ void reloadDisplayFilterMacros();
+
private slots:
void updateTaps();
diff --git a/ui/qt/main_status_bar.cpp b/ui/qt/main_status_bar.cpp
index a504aa7a..3e5c6e9c 100644
--- a/ui/qt/main_status_bar.cpp
+++ b/ui/qt/main_status_bar.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include "file.h"
#include <epan/expert.h>
@@ -47,13 +45,13 @@ Q_DECLARE_METATYPE(ProfileDialog::ProfileAction)
// If we ever add support for multiple windows this will need to be replaced.
// See also: main_window.cpp
-static MainStatusBar *cur_main_status_bar_ = NULL;
+static MainStatusBar *cur_main_status_bar_;
/*
* Push a formatted temporary message onto the statusbar.
*/
void
-statusbar_push_temporary_msg(const gchar *msg_format, ...)
+statusbar_push_temporary_msg(const char *msg_format, ...)
{
va_list ap;
QString push_msg;
@@ -133,8 +131,8 @@ MainStatusBar::MainStatusBar(QWidget *parent) :
comment_button_->setToolTip(tr("Open the Capture File Properties dialog"));
comment_button_->setEnabled(false);
- connect(expert_button_, SIGNAL(clicked(bool)), this, SIGNAL(showExpertInfo()));
- connect(comment_button_, SIGNAL(clicked(bool)), this, SIGNAL(editCaptureComment()));
+ connect(expert_button_, &QToolButton::clicked, this, &MainStatusBar::showExpertInfo);
+ connect(comment_button_, &QToolButton::clicked, this, &MainStatusBar::editCaptureComment);
info_progress_hb->setContentsMargins(icon_size / 2, 0, 0, 0);
@@ -167,17 +165,13 @@ MainStatusBar::MainStatusBar(QWidget *parent) :
progress_frame_.enableTaskbarUpdates(true);
#endif
- connect(mainApp, SIGNAL(appInitialized()), splitter, SLOT(show()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(appInitialized()));
- connect(&info_status_, SIGNAL(toggleTemporaryFlash(bool)),
- this, SLOT(toggleBackground(bool)));
- connect(mainApp, SIGNAL(profileNameChanged(const gchar *)),
- this, SLOT(setProfileName()));
- connect(&profile_status_, SIGNAL(clickedAt(QPoint,Qt::MouseButton)),
- this, SLOT(showProfileMenu(QPoint,Qt::MouseButton)));
-
- connect(&progress_frame_, SIGNAL(stopLoading()),
- this, SIGNAL(stopLoading()));
+ connect(mainApp, &MainApplication::appInitialized, splitter, &QSplitter::show);
+ connect(mainApp, &MainApplication::appInitialized, this, &MainStatusBar::appInitialized);
+ connect(&info_status_, &LabelStack::toggleTemporaryFlash, this, &MainStatusBar::toggleBackground);
+ connect(mainApp, &MainApplication::profileNameChanged, this, &MainStatusBar::setProfileName);
+ connect(&profile_status_, &ClickableLabel::clickedAt, this, &MainStatusBar::showProfileMenu);
+
+ connect(&progress_frame_, &ProgressFrame::stopLoading, this, &MainStatusBar::stopLoading);
}
void MainStatusBar::showExpert() {
@@ -235,8 +229,7 @@ void MainStatusBar::setFileName(CaptureFile &cf)
if (cf.isValid()) {
popGenericStatus(STATUS_CTX_FILE);
QString msgtip = QString("%1 (%2)")
- .arg(cf.capFile()->filename)
- .arg(file_size_to_qstring(cf.capFile()->f_datalen));
+ .arg(cf.capFile()->filename, file_size_to_qstring(cf.capFile()->f_datalen));
pushGenericStatus(STATUS_CTX_FILE, cf.fileName(), msgtip);
}
}
@@ -264,8 +257,7 @@ void MainStatusBar::setStatusbarForCaptureFile()
if (cap_file_ && cap_file_->filename && (cap_file_->state != FILE_CLOSED)) {
popGenericStatus(STATUS_CTX_FILE);
QString msgtip = QString("%1 (%2)")
- .arg(cap_file_->filename)
- .arg(file_size_to_qstring(cap_file_->f_datalen));
+ .arg(cap_file_->filename, file_size_to_qstring(cap_file_->f_datalen));
pushGenericStatus(STATUS_CTX_FILE,
gchar_free_to_qstring(cf_get_display_name(cap_file_)), msgtip);
}
@@ -298,7 +290,12 @@ void MainStatusBar::selectedFieldChanged(FieldInformation * finfo)
finfo_length = finfo->position().length + finfo->appendix().length;
if (finfo_length > 0) {
- item_info.append(", " + tr("%Ln byte(s)", "", finfo_length));
+ int finfo_bits = FI_GET_BITS_SIZE(finfo->fieldInfo());
+ if (finfo_bits % 8 == 0) {
+ item_info.append(", " + tr("%Ln byte(s)", "", finfo_length));
+ } else {
+ item_info.append(", " + tr("%Ln bit(s)", "", finfo_bits));
+ }
}
}
@@ -312,16 +309,14 @@ void MainStatusBar::highlightedFieldChanged(FieldInformation * finfo)
if (finfo)
{
FieldInformation::Position pos = finfo->position();
- QString field_str;
if (pos.length < 2) {
- hint = QString(tr("Byte %1")).arg(pos.start);
+ hint = tr("Byte %1").arg(pos.start);
} else {
- hint = QString(tr("Bytes %1-%2")).arg(pos.start).arg(pos.start + pos.length - 1);
+ hint = tr("Bytes %1-%2").arg(pos.start).arg(pos.start + pos.length - 1);
}
hint += QString(": %1 (%2)")
- .arg(finfo->headerInfo().name)
- .arg(finfo->headerInfo().abbreviation);
+ .arg(finfo->headerInfo().name, finfo->headerInfo().abbreviation);
}
pushGenericStatus(STATUS_CTX_BYTE, hint);
@@ -337,9 +332,7 @@ void MainStatusBar::pushGenericStatus(StatusContext status, const QString &messa
if (message.isEmpty() && status != STATUS_CTX_FILE && status != STATUS_CTX_TEMPORARY && status != STATUS_CTX_PROGRESS)
popGenericStatus(status);
else
- stack->pushText(message, status);
-
- stack->setToolTip(messagetip);
+ stack->pushText(message, status, messagetip);
if (status == STATUS_CTX_FILTER || status == STATUS_CTX_FILE)
expertUpdate();
@@ -352,8 +345,6 @@ void MainStatusBar::popGenericStatus(StatusContext status)
if (status == STATUS_CTX_MAIN)
stack = &packet_status_;
- stack->setToolTip(QString());
-
stack->popText(status);
}
@@ -365,7 +356,7 @@ void MainStatusBar::setProfileName()
void MainStatusBar::appInitialized()
{
setProfileName();
- connect(mainApp->mainWindow(), SIGNAL(framesSelected(QList<int>)), this, SLOT(selectedFrameChanged(QList<int>)));
+ connect(qobject_cast<MainWindow *>(mainApp->mainWindow()), &MainWindow::framesSelected, this, &MainStatusBar::selectedFrameChanged);
}
void MainStatusBar::selectedFrameChanged(QList<int>)
@@ -390,48 +381,62 @@ void MainStatusBar::showCaptureStatistics()
}
if (cs_count_ > 0) {
if (prefs.gui_show_selected_packet && rows.count() == 1) {
- packets_str.append(QString(tr("Selected Packet: %1 %2 "))
- .arg(rows.at(0))
- .arg(UTF8_MIDDLE_DOT));
+ if (is_packet_configuration_namespace()) {
+ packets_str.append(tr("Selected Packet: %1 %2 ")
+ .arg(rows.at(0))
+ .arg(UTF8_MIDDLE_DOT));
+ } else {
+ packets_str.append(tr("Selected Event: %1 %2 ")
+ .arg(rows.at(0))
+ .arg(UTF8_MIDDLE_DOT));
+ }
+ }
+ if (is_packet_configuration_namespace()) {
+ packets_str.append(tr("Packets: %1")
+ .arg(cs_count_));
+ } else {
+ packets_str.append(tr("Events: %1")
+ .arg(cs_count_));
+ }
+ if (cap_file_->dfilter) {
+ packets_str.append(tr(" %1 Displayed: %2 (%3%)")
+ .arg(UTF8_MIDDLE_DOT)
+ .arg(cap_file_->displayed_count)
+ .arg((100.0*cap_file_->displayed_count)/cs_count_, 0, 'f', 1));
}
- packets_str.append(QString(tr("Packets: %1 %4 Displayed: %2 (%3%)"))
- .arg(cs_count_)
- .arg(cap_file_->displayed_count)
- .arg((100.0*cap_file_->displayed_count)/cs_count_, 0, 'f', 1)
- .arg(UTF8_MIDDLE_DOT));
if (rows.count() > 1) {
- packets_str.append(QString(tr(" %1 Selected: %2 (%3%)"))
+ packets_str.append(tr(" %1 Selected: %2 (%3%)")
.arg(UTF8_MIDDLE_DOT)
.arg(rows.count())
.arg((100.0*rows.count())/cs_count_, 0, 'f', 1));
}
if (cap_file_->marked_count > 0) {
- packets_str.append(QString(tr(" %1 Marked: %2 (%3%)"))
+ packets_str.append(tr(" %1 Marked: %2 (%3%)")
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->marked_count)
.arg((100.0*cap_file_->marked_count)/cs_count_, 0, 'f', 1));
}
if (cap_file_->drops_known) {
- packets_str.append(QString(tr(" %1 Dropped: %2 (%3%)"))
+ packets_str.append(tr(" %1 Dropped: %2 (%3%)")
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->drops)
.arg((100.0*cap_file_->drops)/cs_count_, 0, 'f', 1));
}
if (cap_file_->ignored_count > 0) {
- packets_str.append(QString(tr(" %1 Ignored: %2 (%3%)"))
+ packets_str.append(tr(" %1 Ignored: %2 (%3%)")
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->ignored_count)
.arg((100.0*cap_file_->ignored_count)/cs_count_, 0, 'f', 1));
}
if (cap_file_->packet_comment_count > 0) {
- packets_str.append(QString(tr(" %1 Comments: %2"))
+ packets_str.append(tr(" %1 Comments: %2")
.arg(UTF8_MIDDLE_DOT)
.arg(cap_file_->packet_comment_count));
}
if (prefs.gui_show_file_load_time && !cap_file_->is_tempfile) {
/* Loading an existing file */
- gulong computed_elapsed = cf_get_computed_elapsed(cap_file_);
- packets_str.append(QString(tr(" %1 Load time: %2:%3.%4"))
+ unsigned long computed_elapsed = cf_get_computed_elapsed(cap_file_);
+ packets_str.append(tr(" %1 Load time: %2:%3.%4")
.arg(UTF8_MIDDLE_DOT)
.arg(computed_elapsed/60000, 2, 10, QLatin1Char('0'))
.arg(computed_elapsed%60000/1000, 2, 10, QLatin1Char('0'))
@@ -440,18 +445,32 @@ void MainStatusBar::showCaptureStatistics()
}
} else if (cs_fixed_ && cs_count_ > 0) {
/* There shouldn't be any rows without a cap_file_ but this is benign */
- if (prefs.gui_show_selected_packet && rows.count() == 1) {
- packets_str.append(QString(tr("Selected Packet: %1 %2 "))
- .arg(rows.at(0))
- .arg(UTF8_MIDDLE_DOT));
+ if (is_packet_configuration_namespace()) {
+ if (prefs.gui_show_selected_packet && rows.count() == 1) {
+ packets_str.append(tr("Selected Packet: %1 %2 ")
+ .arg(rows.at(0))
+ .arg(UTF8_MIDDLE_DOT));
+ }
+ packets_str.append(tr("Packets: %1")
+ .arg(cs_count_));
+ } else {
+ if (prefs.gui_show_selected_packet && rows.count() == 1) {
+ packets_str.append(tr("Selected Event: %1 %2 ")
+ .arg(rows.at(0))
+ .arg(UTF8_MIDDLE_DOT));
+ }
+ packets_str.append(tr("Events: %1")
+ .arg(cs_count_));
}
- packets_str.append(QString(tr("Packets: %1"))
- .arg(cs_count_));
}
#endif // HAVE_LIBPCAP
if (packets_str.isEmpty()) {
- packets_str = tr("No Packets");
+ if (is_packet_configuration_namespace()) {
+ packets_str = tr("No Packets");
+ } else {
+ packets_str = tr("No Events");
+ }
}
popGenericStatus(STATUS_CTX_MAIN);
@@ -580,7 +599,7 @@ void MainStatusBar::showProfileMenu(const QPoint &global_pos, Qt::MouseButton bu
action->setEnabled(enable_edit);
ctx_menu_->addSeparator();
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
QMenu * importMenu = new QMenu(tr("Import"), ctx_menu_);
action = importMenu->addAction(tr("From Zip File..."), this, SLOT(manageProfile()));
action->setProperty("dialog_action_", (int)ProfileDialog::ImportZipProfile);
diff --git a/ui/qt/main_status_bar.h b/ui/qt/main_status_bar.h
index 611bc017..c53bc54a 100644
--- a/ui/qt/main_status_bar.h
+++ b/ui/qt/main_status_bar.h
@@ -65,7 +65,7 @@ private:
// Capture statistics
bool cs_fixed_;
- guint32 cs_count_;
+ uint32_t cs_count_;
void showCaptureStatistics();
void setStatusbarForCaptureFile();
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 0f54995f..5c96863a 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -9,14 +9,19 @@
#include "config.h"
-#include <glib.h>
-
#include "ui/preference_utils.h"
#include "main_window.h"
+#include "epan/dfilter/dfilter-translator.h"
+
+#include <QClipboard>
+
#include "funnel_statistics.h"
+#include "main_application.h"
#include "packet_list.h"
+#include "utils/profile_switcher.h"
+#include "utils/qt_ui_utils.h"
#include "widgets/display_filter_combo.h"
// Packet Menu actions
@@ -32,7 +37,8 @@ MainWindow::MainWindow(QWidget *parent) :
byte_view_tab_(nullptr),
packet_diagram_(nullptr),
df_combo_box_(nullptr),
- main_status_bar_(nullptr)
+ main_status_bar_(nullptr),
+ profile_switcher_(new ProfileSwitcher())
{
}
@@ -51,7 +57,7 @@ bool MainWindow::hasSelection()
/*
* As hasSelection() is not looking for one single packet
- * selection, but at least 2, this method returns TRUE in
+ * selection, but at least 2, this method returns true in
* this specific case.
*/
bool MainWindow::hasUniqueSelection()
@@ -76,9 +82,9 @@ frame_data* MainWindow::frameDataForRow(int row) const
return Q_NULLPTR;
}
-void MainWindow::insertColumn(QString name, QString abbrev, gint pos)
+void MainWindow::insertColumn(QString name, QString abbrev, int pos)
{
- gint colnr = 0;
+ int colnr = 0;
if (name.length() > 0 && abbrev.length() > 0)
{
colnr = column_prefs_add_custom(COL_CUSTOM, name.toStdString().c_str(), abbrev.toStdString().c_str(), pos);
@@ -115,10 +121,10 @@ void MainWindow::setDisplayFilter(QString filter, FilterAction::Action action, F
*
* @param funnel_action a custom packet menu action
*/
-void MainWindow::appendPacketMenu(QAction* funnel_action)
+void MainWindow::appendPacketMenu(FunnelAction* funnel_action)
{
dynamic_packet_menu_actions.append(funnel_action);
- connect(funnel_action, SIGNAL(triggered(bool)), funnel_action, SLOT(triggerPacketCallback()));
+ connect(funnel_action, &FunnelAction::triggered, funnel_action, &FunnelAction::triggerPacketCallback);
}
/*
@@ -177,7 +183,7 @@ bool MainWindow::addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array)
// Build a set of fields present for efficient lookups
QSet<QString> fieldsPresent = QSet<QString>();
- for (guint fieldInfoIndex = 0; fieldInfoIndex < finfo_array->len; fieldInfoIndex++) {
+ for (unsigned fieldInfoIndex = 0; fieldInfoIndex < finfo_array->len; fieldInfoIndex++) {
field_info *fi = (field_info *)g_ptr_array_index (finfo_array, fieldInfoIndex);
fieldsPresent.insert(QString(fi->hfinfo->abbrev));
}
@@ -203,3 +209,67 @@ bool MainWindow::addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array)
}
return insertedPacketMenu;
}
+
+const char *MainWindow::translator_ = "translator";
+const char *MainWindow::translated_filter_ = "translated filter";
+
+void MainWindow::addDisplayFilterTranslationActions(QMenu *copy_menu) {
+ if (!copy_menu) {
+ return;
+ }
+
+ char **df_translators = get_dfilter_translator_list();
+
+ if (df_translators == NULL || df_translators[0] == NULL) {
+ return;
+ }
+
+ copy_menu->addSeparator();
+
+ for (size_t idx = 0; df_translators[idx]; idx++) {
+ QString translator = df_translators[idx];
+ QString action_text;
+ if (idx == 0) {
+ action_text = tr("Display filter as %1").arg(translator);
+ } else {
+ action_text = tr(UTF8_HORIZONTAL_ELLIPSIS "as %1").arg(translator);
+ }
+ QAction *xlate_action = copy_menu->addAction(action_text);
+ xlate_action->setProperty(translator_, QVariant::fromValue(translator));
+ xlate_action->setEnabled(false);
+ connect(xlate_action, &QAction::triggered, this, &MainWindow::copyDisplayFilterTranslation);
+ df_translate_actions_ += xlate_action;
+ }
+
+ g_free(df_translators);
+}
+
+void MainWindow::updateDisplayFilterTranslationActions(const QString &df_text)
+{
+ for (QAction *xlate_action : df_translate_actions_) {
+ bool enable = false;
+ QString translated_filter;
+ if (!df_text.isEmpty()) {
+ QString translator = xlate_action->property(translator_).toString();
+ translated_filter = gchar_free_to_qstring((char *)translate_dfilter(qUtf8Printable(translator),
+ qUtf8Printable(df_text)));
+ if (!translated_filter.isEmpty()) {
+ enable = true;
+ }
+ }
+ xlate_action->setEnabled(enable);
+ xlate_action->setProperty(translated_filter_, QVariant::fromValue(translated_filter));
+ }
+}
+
+void MainWindow::copyDisplayFilterTranslation()
+{
+ QAction *xlate_action = qobject_cast<QAction *>(sender());
+ if (!xlate_action) {
+ return;
+ }
+
+ QString translated_filter = xlate_action->property(translated_filter_).toString();
+ mainApp->clipboard()->setText(translated_filter);
+}
+
diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h
index ac5ddcf4..2f78a261 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -19,18 +19,23 @@
#include "filter_action.h"
+#include "io_graph_action.h"
#include <QMainWindow>
#include <QSplitter>
+class QMenu;
class QSplitter;
class QStackedWidget;
+
class ByteViewTab;
class DisplayFilterCombo;
class FieldInformation;
+class FunnelAction;
class MainStatusBar;
class PacketDiagram;
class PacketList;
+class ProfileSwitcher;
class ProtoTree;
class WelcomePage;
@@ -45,7 +50,7 @@ public:
bool hasSelection();
bool hasUniqueSelection();
QList<int> selectedRows(bool useFrameNum = false);
- void insertColumn(QString name, QString abbrev, gint pos = -1);
+ void insertColumn(QString name, QString abbrev, int pos = -1);
void gotoFrame(int packet_num);
frame_data* frameDataForRow(int) const;
@@ -53,7 +58,7 @@ public:
MainStatusBar *statusBar();
// Used for managing custom packet menus
- void appendPacketMenu(QAction* funnel_action);
+ void appendPacketMenu(FunnelAction *funnel_action);
QList<QAction*> getPacketMenuActions();
void clearAddedPacketMenus();
bool addPacketMenus(QMenu * ctx_menu, GPtrArray *finfo_array);
@@ -62,6 +67,7 @@ public slots:
void setDisplayFilter(QString filter, FilterAction::Action action, FilterAction::ActionType filterType);
virtual void filterPackets(QString, bool) = 0;
virtual void showPreferencesDialog(QString module_name) = 0;
+ virtual void showIOGraphDialog(io_graph_item_unit_t, QString) = 0;
void layoutPanes();
void applyRecentPaneGeometry();
@@ -96,6 +102,20 @@ protected:
PacketDiagram *packet_diagram_;
DisplayFilterCombo *df_combo_box_;
MainStatusBar *main_status_bar_;
+ ProfileSwitcher *profile_switcher_;
+
+protected slots:
+ void addDisplayFilterTranslationActions(QMenu *copy_menu);
+ void updateDisplayFilterTranslationActions(const QString &df_text);
+
+private:
+ QVector<QAction *> df_translate_actions_;
+
+ static const char *translator_;
+ static const char *translated_filter_;
+
+private slots:
+ void copyDisplayFilterTranslation(void);
signals:
void setCaptureFile(capture_file *cf);
diff --git a/ui/qt/main_window_layout.cpp b/ui/qt/main_window_layout.cpp
index b65b267f..9e2b5a3c 100644
--- a/ui/qt/main_window_layout.cpp
+++ b/ui/qt/main_window_layout.cpp
@@ -88,7 +88,9 @@ void MainWindow::layoutPanes()
packet_list_->setParent(main_stack_);
proto_tree_->setParent(main_stack_);
byte_view_tab_->setParent(main_stack_);
- packet_diagram_->setParent(main_stack_);
+ if (packet_diagram_) {
+ packet_diagram_->setParent(main_stack_);
+ }
empty_pane_.setParent(main_stack_);
extra_split_.setParent(main_stack_);
@@ -163,7 +165,9 @@ void MainWindow::layoutPanes()
packet_list_->setVisible(ms_children.contains(packet_list_) && recent.packet_list_show);
proto_tree_->setVisible(ms_children.contains(proto_tree_) && recent.tree_view_show);
byte_view_tab_->setVisible(ms_children.contains(byte_view_tab_) && recent.byte_view_show);
- packet_diagram_->setVisible(ms_children.contains(packet_diagram_) && recent.packet_diagram_show);
+ if (packet_diagram_) {
+ packet_diagram_->setVisible(ms_children.contains(packet_diagram_) && recent.packet_diagram_show);
+ }
if (frozen) {
packet_list_->thaw(true);
@@ -177,59 +181,65 @@ void MainWindow::layoutPanes()
// - When the profile changes
void MainWindow::applyRecentPaneGeometry()
{
- // XXX This shrinks slightly each time the application is run. For some
- // reason the master_split_ geometry is two pixels shorter when
- // saveWindowGeometry is invoked.
-
- // This is also an awful lot of trouble to go through to reuse the GTK+
- // pane settings. We might want to add gui.geometry_main_master_sizes
- // and gui.geometry_main_extra_sizes and save QSplitter::saveState in
- // each.
-
- // Force a geometry recalculation
- QWidget *cur_w = main_stack_->currentWidget();
- showCapture();
- QRect geom = main_stack_->geometry();
- QList<int> master_sizes = master_split_.sizes();
- QList<int> extra_sizes = extra_split_.sizes();
- main_stack_->setCurrentWidget(cur_w);
-
- int master_last_size = master_split_.orientation() == Qt::Vertical ? geom.height() : geom.width();
- master_last_size -= master_split_.handleWidth() * (master_sizes.length() - 1);
-
- int extra_last_size = extra_split_.orientation() == Qt::Vertical ? geom.height() : geom.width();
- extra_last_size -= extra_split_.handleWidth();
-
- if (recent.gui_geometry_main_upper_pane > 0) {
- master_sizes[0] = recent.gui_geometry_main_upper_pane;
- master_last_size -= recent.gui_geometry_main_upper_pane;
- } else {
- master_sizes[0] = master_last_size / master_sizes.length();
- master_last_size -= master_last_size / master_sizes.length();
- }
-
- if (recent.gui_geometry_main_lower_pane > 0) {
- if (master_sizes.length() > 2) {
- master_sizes[1] = recent.gui_geometry_main_lower_pane;
- master_last_size -= recent.gui_geometry_main_lower_pane;
- } else if (extra_sizes.length() > 0) {
- extra_sizes[0] = recent.gui_geometry_main_lower_pane;
- extra_last_size -= recent.gui_geometry_main_lower_pane;
- extra_sizes.last() = extra_last_size;
+ if (recent.gui_geometry_main_master_split == nullptr ||
+ recent.gui_geometry_main_extra_split == nullptr ||
+ !master_split_.restoreState(QByteArray::fromHex(recent.gui_geometry_main_master_split)) ||
+ !extra_split_.restoreState(QByteArray::fromHex(recent.gui_geometry_main_extra_split))) {
+ // Restoring the splitter states via the savedState didn't work,
+ // so let's fall back to the older method.
+ //
+ // XXX This shrinks slightly each time the application is run. For some
+ // reason the master_split_ geometry is two pixels shorter when
+ // saveWindowGeometry is invoked.
+
+ // This is also an awful lot of trouble to go through to reuse the GTK+
+ // pane settings.
+
+ // Force a geometry recalculation
+ QWidget *cur_w = main_stack_->currentWidget();
+ showCapture();
+ QRect geom = main_stack_->geometry();
+ QList<int> master_sizes = master_split_.sizes();
+ QList<int> extra_sizes = extra_split_.sizes();
+ main_stack_->setCurrentWidget(cur_w);
+
+ int master_last_size = master_split_.orientation() == Qt::Vertical ? geom.height() : geom.width();
+ master_last_size -= master_split_.handleWidth() * (master_sizes.length() - 1);
+
+ int extra_last_size = extra_split_.orientation() == Qt::Vertical ? geom.height() : geom.width();
+ extra_last_size -= extra_split_.handleWidth();
+
+ if (recent.gui_geometry_main_upper_pane > 0) {
+ master_sizes[0] = recent.gui_geometry_main_upper_pane;
+ master_last_size -= recent.gui_geometry_main_upper_pane;
+ } else {
+ master_sizes[0] = master_last_size / master_sizes.length();
+ master_last_size -= master_last_size / master_sizes.length();
}
- } else {
- if (master_sizes.length() > 2) {
- master_sizes[1] = master_last_size / 2;
- master_last_size -= master_last_size / 2;
- } else if (extra_sizes.length() > 0) {
- extra_sizes[0] = extra_last_size / 2;
- extra_last_size -= extra_last_size / 2;
- extra_sizes.last() = extra_last_size;
+
+ if (recent.gui_geometry_main_lower_pane > 0) {
+ if (master_sizes.length() > 2) {
+ master_sizes[1] = recent.gui_geometry_main_lower_pane;
+ master_last_size -= recent.gui_geometry_main_lower_pane;
+ } else if (extra_sizes.length() > 0) {
+ extra_sizes[0] = recent.gui_geometry_main_lower_pane;
+ extra_last_size -= recent.gui_geometry_main_lower_pane;
+ extra_sizes.last() = extra_last_size;
+ }
+ } else {
+ if (master_sizes.length() > 2) {
+ master_sizes[1] = master_last_size / 2;
+ master_last_size -= master_last_size / 2;
+ } else if (extra_sizes.length() > 0) {
+ extra_sizes[0] = extra_last_size / 2;
+ extra_last_size -= extra_last_size / 2;
+ extra_sizes.last() = extra_last_size;
+ }
}
- }
- master_sizes.last() = master_last_size;
+ master_sizes.last() = master_last_size;
- master_split_.setSizes(master_sizes);
- extra_split_.setSizes(extra_sizes);
+ master_split_.setSizes(master_sizes);
+ extra_split_.setSizes(extra_sizes);
+ }
}
diff --git a/ui/qt/main_window_preferences_frame.cpp b/ui/qt/main_window_preferences_frame.cpp
index 9659c928..447540f7 100644
--- a/ui/qt/main_window_preferences_frame.cpp
+++ b/ui/qt/main_window_preferences_frame.cpp
@@ -48,6 +48,7 @@ MainWindowPreferencesFrame::MainWindowPreferencesFrame(QWidget *parent) :
).arg(ui->geometryCheckBox->style()->subElementRect(QStyle::SE_CheckBoxContents, &style_opt).left());
ui->foStyleLastOpenedRadioButton->setStyleSheet(indent_ss);
ui->foStyleSpecifiedRadioButton->setStyleSheet(indent_ss);
+ ui->foStyleCWDRadioButton->setStyleSheet(indent_ss);
ui->maxFilterLineEdit->setStyleSheet(indent_ss);
ui->maxRecentLineEdit->setStyleSheet(indent_ss);
@@ -66,7 +67,7 @@ MainWindowPreferencesFrame::MainWindowPreferencesFrame(QWidget *parent) :
ui->languageComboBox->setItemIcon(0, language_icon);
QString globalLanguagesPath(QString(get_datafile_dir()) + "/languages/");
- QString userLanguagesPath(gchar_free_to_qstring(get_persconffile_path("languages/", FALSE)));
+ QString userLanguagesPath(gchar_free_to_qstring(get_persconffile_path("languages/", false)));
QStringList filenames = QDir(":/i18n/").entryList(QStringList("wireshark_*.qm"));
filenames += QDir(globalLanguagesPath).entryList(QStringList("wireshark_*.qm"));
@@ -114,10 +115,18 @@ void MainWindowPreferencesFrame::updateWidgets()
ui->geometryCheckBox->setChecked(false);
}
- if (prefs_get_enum_value(pref_fileopen_style_, pref_stashed) == FO_STYLE_LAST_OPENED) {
+ switch (prefs_get_enum_value(pref_fileopen_style_, pref_stashed)) {
+
+ case FO_STYLE_LAST_OPENED:
ui->foStyleLastOpenedRadioButton->setChecked(true);
- } else {
+ break;
+ case FO_STYLE_CWD:
+ ui->foStyleCWDRadioButton->setChecked(true);
+ break;
+ case FO_STYLE_SPECIFIED:
+ default:
ui->foStyleSpecifiedRadioButton->setChecked(true);
+ break;
}
ui->foStyleSpecifiedLineEdit->setText(prefs_get_string_value(pref_fileopen_dir_, pref_stashed));
@@ -148,6 +157,13 @@ void MainWindowPreferencesFrame::on_geometryCheckBox_toggled(bool checked)
prefs_set_bool_value(pref_geometry_save_maximized_, checked, pref_stashed);
}
+void MainWindowPreferencesFrame::on_foStyleCWDRadioButton_toggled(bool checked)
+{
+ if (checked) {
+ prefs_set_enum_value(pref_fileopen_style_, FO_STYLE_CWD, pref_stashed);
+ }
+}
+
void MainWindowPreferencesFrame::on_foStyleLastOpenedRadioButton_toggled(bool checked)
{
if (checked) {
diff --git a/ui/qt/main_window_preferences_frame.h b/ui/qt/main_window_preferences_frame.h
index 52d01049..2ba1064d 100644
--- a/ui/qt/main_window_preferences_frame.h
+++ b/ui/qt/main_window_preferences_frame.h
@@ -48,6 +48,7 @@ private:
private slots:
void on_geometryCheckBox_toggled(bool checked);
+ void on_foStyleCWDRadioButton_toggled(bool checked);
void on_foStyleLastOpenedRadioButton_toggled(bool checked);
void on_foStyleSpecifiedRadioButton_toggled(bool checked);
void on_foStyleSpecifiedLineEdit_textEdited(const QString &new_dir);
diff --git a/ui/qt/main_window_preferences_frame.ui b/ui/qt/main_window_preferences_frame.ui
index 745e78b3..6ed803c3 100644
--- a/ui/qt/main_window_preferences_frame.ui
+++ b/ui/qt/main_window_preferences_frame.ui
@@ -84,6 +84,16 @@
</attribute>
</widget>
</item>
+ <item row="2" column="0" colspan="3">
+ <widget class="QRadioButton" name="foStyleCWDRadioButton">
+ <property name="text">
+ <string>The current working directory</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">openInButtonGroup</string>
+ </attribute>
+ </widget>
+ </item>
</layout>
</item>
<item>
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp
index a8529e26..ca7a1d9a 100644
--- a/ui/qt/manage_interfaces_dialog.cpp
+++ b/ui/qt/manage_interfaces_dialog.cpp
@@ -23,6 +23,10 @@
#include "ui/qt/remote_settings_dialog.h"
#include "capture/capture-pcap-util.h"
#include "ui/recent.h"
+#include "wsutil/filesystem.h"
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
#endif
#include "ui/iface_lists.h"
#include "ui/preference_utils.h"
@@ -72,53 +76,89 @@ enum {
};
#ifdef HAVE_PCAP_REMOTE
-static void populateExistingRemotes(gpointer key, gpointer value, gpointer user_data)
+#define REMOTE_HOSTS_FILE "remote_hosts.json"
+
+void ManageInterfacesDialog::addRemote(const QVariantMap&& remoteHostMap)
{
- ManageInterfacesDialog *dialog = (ManageInterfacesDialog*)user_data;
- const gchar *host = (const gchar *)key;
- struct remote_host *remote_host = (struct remote_host *)value;
remote_options global_remote_opts;
int err;
- gchar *err_str;
+ char* err_str;
global_remote_opts.src_type = CAPTURE_IFREMOTE;
- global_remote_opts.remote_host_opts.remote_host = g_strdup(host);
- global_remote_opts.remote_host_opts.remote_port = g_strdup(remote_host->remote_port);
- global_remote_opts.remote_host_opts.auth_type = remote_host->auth_type;
- global_remote_opts.remote_host_opts.auth_username = g_strdup(remote_host->auth_username);
- global_remote_opts.remote_host_opts.auth_password = g_strdup(remote_host->auth_password);
- global_remote_opts.remote_host_opts.datatx_udp = FALSE;
- global_remote_opts.remote_host_opts.nocap_rpcap = TRUE;
- global_remote_opts.remote_host_opts.nocap_local = FALSE;
+ global_remote_opts.remote_host_opts.remote_host = qstring_strdup(remoteHostMap["host"].toString());
+ global_remote_opts.remote_host_opts.remote_port = qstring_strdup(remoteHostMap["port"].toString());
+ global_remote_opts.remote_host_opts.auth_type = static_cast<capture_auth>(remoteHostMap["auth"].toInt());
+ global_remote_opts.remote_host_opts.auth_username = qstring_strdup(remoteHostMap["username"].toString());
+ global_remote_opts.remote_host_opts.auth_password = qstring_strdup(remoteHostMap["password"].toString());
+ global_remote_opts.remote_host_opts.datatx_udp = false;
+ global_remote_opts.remote_host_opts.nocap_rpcap = true;
+ global_remote_opts.remote_host_opts.nocap_local = false;
#ifdef HAVE_PCAP_SETSAMPLING
global_remote_opts.sampling_method = CAPTURE_SAMP_NONE;
- global_remote_opts.sampling_param = 0;
+ global_remote_opts.sampling_param = 0;
#endif
- GList *rlist = get_remote_interface_list(global_remote_opts.remote_host_opts.remote_host,
- global_remote_opts.remote_host_opts.remote_port,
- global_remote_opts.remote_host_opts.auth_type,
- global_remote_opts.remote_host_opts.auth_username,
- global_remote_opts.remote_host_opts.auth_password,
- &err, &err_str);
+
+ // This doesn't handle CAPTURE_AUTH_PWD because we don't store the password
+ // XXX: Don't these strings get leaked? I think that they're dup'ed again
+ // later. Same for in RemoteCaptureDialog::apply_remote()
+
+ GList* rlist = get_remote_interface_list(global_remote_opts.remote_host_opts.remote_host,
+ global_remote_opts.remote_host_opts.remote_port,
+ global_remote_opts.remote_host_opts.auth_type,
+ global_remote_opts.remote_host_opts.auth_username,
+ global_remote_opts.remote_host_opts.auth_password,
+ &err, &err_str);
+
if (rlist == NULL) {
switch (err) {
case 0:
- QMessageBox::warning(dialog, QObject::tr("Error"), QObject::tr("No remote interfaces found."));
+ QMessageBox::warning(this, QObject::tr("Error"), QObject::tr("No remote interfaces found."));
break;
case CANT_GET_INTERFACE_LIST:
- QMessageBox::critical(dialog, QObject::tr("Error"), err_str);
+ QMessageBox::critical(this, QObject::tr("Error"), err_str);
break;
case DONT_HAVE_PCAP:
- QMessageBox::critical(dialog, QObject::tr("Error"), QObject::tr("PCAP not found"));
+ QMessageBox::critical(this, QObject::tr("Error"), QObject::tr("PCAP not found"));
break;
default:
- QMessageBox::critical(dialog, QObject::tr("Error"), QObject::tr("Unknown error"));
+ QMessageBox::critical(this, QObject::tr("Error"), QObject::tr("Unknown error"));
break;
}
return;
}
+ // XXX: If the connection fails we won't add it, so it won't get saved to
+ // load automatically next time (but will perhaps still be in recent.)
+ // That's mostly a feature not a bug, but we might want support for
+ // currently disabled remote hosts.
+
+ emit remoteAdded(rlist, &global_remote_opts);
+}
+
+void ManageInterfacesDialog::populateExistingRemotes()
+{
+ const char* cfile = REMOTE_HOSTS_FILE;
+
+ /* Try personal config file first */
+ QString fileName = gchar_free_to_qstring(get_persconffile_path(cfile, true));
+
+ if (fileName.isEmpty() || !QFileInfo::exists(fileName)) {
+ return;
+ }
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::ReadOnly)) {
+ return;
+ }
+
+ QJsonDocument document = QJsonDocument::fromJson(file.readAll());
+ if (!document.isArray()) {
+ return;
+ }
+
+ foreach(QJsonValue value, document.array()) {
+ addRemote(value.toObject().toVariantMap());
+ }
- emit dialog->remoteAdded(rlist, &global_remote_opts);
}
#endif /* HAVE_PCAP_REMOTE */
@@ -157,10 +197,13 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
proxyModel->setRemoteDisplay(false);
#endif
proxyModel->setFilterByType(false);
+ proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
ui->localView->setModel(proxyModel);
ui->localView->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_HIDDEN));
ui->localView->resizeColumnToContents(proxyModel->mapSourceToColumn(IFTREE_COL_NAME));
+ ui->localView->header()->setSortIndicator(-1, Qt::AscendingOrder);
+ ui->localView->setSortingEnabled(true);
pipeProxyModel = new InterfaceSortFilterModel(this);
columns.clear();
@@ -176,7 +219,7 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
ui->pipeView->setModel(pipeProxyModel);
ui->delPipe->setEnabled(pipeProxyModel->rowCount() > 0);
- ui->pipeView->setItemDelegateForColumn(pipeProxyModel->mapSourceToColumn(IFTREE_COL_PIPE_PATH), new PathSelectionDelegate());
+ ui->pipeView->setItemDelegateForColumn(pipeProxyModel->mapSourceToColumn(IFTREE_COL_PIPE_PATH), new PathSelectionDelegate(this));
connect(ui->pipeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [=](const QItemSelection &sel, const QItemSelection &) {
ui->delPipe->setEnabled(sel.count() > 0);
});
@@ -200,7 +243,7 @@ ManageInterfacesDialog::ManageInterfacesDialog(QWidget *parent) :
connect(this, SIGNAL(remoteAdded(GList*, remote_options*)), this, SLOT(addRemoteInterfaces(GList*, remote_options*)));
connect(this, SIGNAL(remoteSettingsChanged(interface_t *)), this, SLOT(setRemoteSettings(interface_t *)));
connect(ui->remoteList, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(remoteSelectionChanged(QTreeWidgetItem*, int)));
- recent_remote_host_list_foreach(populateExistingRemotes, this);
+ populateExistingRemotes();
#endif
ui->tabWidget->setCurrentIndex(tab_local_);
@@ -272,8 +315,8 @@ void ManageInterfacesDialog::on_addPipe_clicked()
memset(&device, 0, sizeof(device));
device.name = qstring_strdup(tr("New Pipe"));
device.display_name = g_strdup(device.name);
- device.hidden = FALSE;
- device.selected = TRUE;
+ device.hidden = false;
+ device.selected = true;
device.pmode = global_capture_opts.default_options.promisc_mode;
device.has_snaplen = global_capture_opts.default_options.has_snaplen;
device.snaplen = global_capture_opts.default_options.snaplen;
@@ -319,20 +362,25 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
GList *if_entry, *lt_entry;
if_info_t *if_info;
char *if_string = NULL;
- gchar *descr, *auth_str;
+ char *descr, *auth_str;
if_capabilities_t *caps;
- gint linktype_count;
+ int linktype_count;
bool monitor_mode, found = false;
GSList *curr_addr;
int ips = 0;
- guint i;
+ unsigned i;
if_addr_t *addr;
data_link_info_t *data_link_info;
GString *ip_str;
link_row *linkr = NULL;
interface_t device;
- guint num_interfaces;
+ unsigned num_interfaces;
+ // Add any (remote) interface in rlist to the global list of all
+ // interfaces.
+ // Most of this is copied from scan_local_interfaces_filtered, but
+ // some of it doesn't make sense for remote interfaces (yet?) - we
+ // can't, for example, control monitor mode.
num_interfaces = global_capture_opts.all_ifaces->len;
for (if_entry = g_list_first(rlist); if_entry != NULL; if_entry = gxx_list_next(if_entry)) {
auth_str = NULL;
@@ -345,12 +393,12 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
if (device.hidden)
continue;
if (strcmp(device.name, if_info->name) == 0) {
- found = TRUE;
+ found = true;
break;
}
}
if (found) {
- found = FALSE;
+ found = false;
continue;
}
ip_str = g_string_new("");
@@ -430,11 +478,15 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
linktype_count = 0;
device.links = NULL;
if (caps != NULL) {
+ GList *lt_list = caps->data_link_types;
#ifdef HAVE_PCAP_CREATE
- device.monitor_mode_enabled = monitor_mode;
+ device.monitor_mode_enabled = monitor_mode && caps->can_set_rfmon;
device.monitor_mode_supported = caps->can_set_rfmon;
+ if (device.monitor_mode_enabled) {
+ lt_list = caps->data_link_types_rfmon;
+ }
#endif
- for (lt_entry = caps->data_link_types; lt_entry != NULL; lt_entry = gxx_list_next(lt_entry)) {
+ for (lt_entry = lt_list; lt_entry != NULL; lt_entry = gxx_list_next(lt_entry)) {
data_link_info = gxx_list_data(data_link_info_t *, lt_entry);
linkr = new link_row;
/*
@@ -459,8 +511,8 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
} /* for link_types */
} else {
#if defined(HAVE_PCAP_CREATE)
- device.monitor_mode_enabled = FALSE;
- device.monitor_mode_supported = FALSE;
+ device.monitor_mode_enabled = false;
+ device.monitor_mode_supported = false;
#endif
device.active_dlt = -1;
}
@@ -468,7 +520,7 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
device.no_addresses = ips;
device.remote_opts.src_type= roptions->src_type;
if (device.remote_opts.src_type == CAPTURE_IFREMOTE) {
- device.local = FALSE;
+ device.local = false;
}
device.remote_opts.remote_host_opts.remote_host = g_strdup(roptions->remote_host_opts.remote_host);
device.remote_opts.remote_host_opts.remote_port = g_strdup(roptions->remote_host_opts.remote_port);
@@ -482,7 +534,7 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
device.remote_opts.sampling_method = roptions->sampling_method;
device.remote_opts.sampling_param = roptions->sampling_param;
#endif
- device.selected = TRUE;
+ device.selected = true;
global_capture_opts.num_selected++;
g_array_append_val(global_capture_opts.all_ifaces, device);
g_string_free(ip_str, TRUE);
@@ -500,9 +552,17 @@ void ManageInterfacesDialog::addRemoteInterfaces(GList* rlist, remote_options *r
void ManageInterfacesDialog::remoteAccepted()
{
QTreeWidgetItemIterator it(ui->remoteList);
+ QJsonArray hostArray;
while (*it) {
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ if ((*it)->parent() == nullptr) {
+ QVariant v = (*it)->data(0, Qt::UserRole);
+ if (v.canConvert<QJsonObject>()) {
+ hostArray.append(v.toJsonValue());
+ }
+ }
+
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if ((*it)->text(col_r_host_dev_).compare(device->name))
continue;
@@ -510,6 +570,21 @@ void ManageInterfacesDialog::remoteAccepted()
}
++it;
}
+
+ const char* cfile = REMOTE_HOSTS_FILE;
+ /* Try personal config file first */
+ QString fileName = gchar_free_to_qstring(get_persconffile_path(cfile, true));
+
+ if (fileName.isEmpty()) {
+ return;
+ }
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly)) {
+ return;
+ }
+
+ file.write(QJsonDocument(hostArray).toJson(QJsonDocument::Compact));
}
void ManageInterfacesDialog::on_remoteList_currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)
@@ -523,7 +598,7 @@ void ManageInterfacesDialog::on_remoteList_itemClicked(QTreeWidgetItem *item, in
return;
}
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device->local) {
if (item->text(col_r_host_dev_).compare(device->name))
@@ -540,7 +615,7 @@ void ManageInterfacesDialog::on_delRemote_clicked()
return;
}
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (item->text(col_r_host_dev_).compare(device->remote_opts.remote_host_opts.remote_host))
continue;
@@ -559,7 +634,7 @@ void ManageInterfacesDialog::on_addRemote_clicked()
void ManageInterfacesDialog::showRemoteInterfaces()
{
- guint i;
+ unsigned i;
interface_t *device;
QTreeWidgetItem * item = nullptr;
@@ -580,6 +655,17 @@ void ManageInterfacesDialog::showRemoteInterfaces()
if (items.count() == 0) {
item = new QTreeWidgetItem(ui->remoteList);
item->setText(col_r_host_dev_, parentName);
+ QJsonObject remote_host{
+ {"host", parentName},
+ {"port", device->remote_opts.remote_host_opts.remote_port},
+ {"auth_type", device->remote_opts.remote_host_opts.auth_type},
+ {"username", device->remote_opts.remote_host_opts.auth_username},
+ // {"password", device->remote_opts.remote_host_opts.auth_password},
+ // We should find some way to store the password in a
+ // credential manager (cf. #17949 for extcap) and
+ // reference it
+ };
+ item->setData(0, Qt::UserRole, remote_host);
item->setExpanded(true);
}
else {
@@ -599,7 +685,7 @@ void ManageInterfacesDialog::showRemoteInterfaces()
void ManageInterfacesDialog::on_remoteSettings_clicked()
{
- guint i = 0;
+ unsigned i = 0;
interface_t *device;
QTreeWidgetItem* item = ui->remoteList->currentItem();
if (!item) {
@@ -622,7 +708,7 @@ void ManageInterfacesDialog::on_remoteSettings_clicked()
void ManageInterfacesDialog::setRemoteSettings(interface_t *iface)
{
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device->local) {
if (strcmp(iface->name, device->name)) {
diff --git a/ui/qt/manage_interfaces_dialog.h b/ui/qt/manage_interfaces_dialog.h
index 79e9d0d9..de8db2d4 100644
--- a/ui/qt/manage_interfaces_dialog.h
+++ b/ui/qt/manage_interfaces_dialog.h
@@ -12,7 +12,6 @@
#include <config.h>
-#include <glib.h>
#include "capture_opts.h"
#include <ui/qt/models/interface_tree_cache_model.h>
@@ -48,6 +47,10 @@ private:
InterfaceSortFilterModel * pipeProxyModel;
void showRemoteInterfaces();
+#ifdef HAVE_PCAP_REMOTE
+ void addRemote(const QVariantMap&&);
+ void populateExistingRemotes();
+#endif
signals:
void ifsChanged();
diff --git a/ui/qt/manager/wireshark_preference.cpp b/ui/qt/manager/wireshark_preference.cpp
index cca87c7b..91f8bd20 100644
--- a/ui/qt/manager/wireshark_preference.cpp
+++ b/ui/qt/manager/wireshark_preference.cpp
@@ -80,6 +80,7 @@ public:
};
REGISTER_PREFERENCE_TYPE(PREF_STRING, StringPreference)
REGISTER_PREFERENCE_TYPE(PREF_CUSTOM, StringPreference)
+REGISTER_PREFERENCE_TYPE(PREF_DISSECTOR, StringPreference)
class PasswordPreference : public StringPreference
{
@@ -101,7 +102,6 @@ public:
UIntPreference(QObject * parent = Q_NULLPTR) : StringPreference(parent) {}
};
REGISTER_PREFERENCE_TYPE(PREF_UINT, UIntPreference)
-REGISTER_PREFERENCE_TYPE(PREF_DECODE_AS_UINT, UIntPreference)
class EnumPreference : public WiresharkPreference
{
diff --git a/ui/qt/manuf_dialog.cpp b/ui/qt/manuf_dialog.cpp
index 0c383af3..d7ed9192 100644
--- a/ui/qt/manuf_dialog.cpp
+++ b/ui/qt/manuf_dialog.cpp
@@ -102,9 +102,9 @@ static QByteArray convertMacAddressToByteArray(const QString &bytesString)
{
GByteArray *bytes = g_byte_array_new();
- if (!hex_str_to_bytes(qUtf8Printable(bytesString), bytes, FALSE)
+ if (!hex_str_to_bytes(qUtf8Printable(bytesString), bytes, false)
|| bytes->len == 0 || bytes->len > 6) {
- g_byte_array_free(bytes, TRUE);
+ g_byte_array_free(bytes, true);
return QByteArray();
}
diff --git a/ui/qt/models/astringlist_list_model.cpp b/ui/qt/models/astringlist_list_model.cpp
index a0b5fc38..c3b3ec05 100644
--- a/ui/qt/models/astringlist_list_model.cpp
+++ b/ui/qt/models/astringlist_list_model.cpp
@@ -166,7 +166,6 @@ bool AStringListListSortFilterProxyModel::filterAcceptsRow(int sourceRow, const
break;
case FilterNone:
return true;
- break;
default:
compareFunc = AContainsB;
break;
diff --git a/ui/qt/models/astringlist_list_model.h b/ui/qt/models/astringlist_list_model.h
index 70acc97b..f1e396c8 100644
--- a/ui/qt/models/astringlist_list_model.h
+++ b/ui/qt/models/astringlist_list_model.h
@@ -21,6 +21,7 @@
class AStringListListModel : public QAbstractTableModel
{
+ Q_OBJECT
public:
explicit AStringListListModel(QObject * parent = Q_NULLPTR);
virtual ~AStringListListModel();
diff --git a/ui/qt/models/atap_data_model.cpp b/ui/qt/models/atap_data_model.cpp
index b7ff508d..c3a2f840 100644
--- a/ui/qt/models/atap_data_model.cpp
+++ b/ui/qt/models/atap_data_model.cpp
@@ -7,8 +7,6 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <glib.h>
-
#include <epan/tap.h>
#include <epan/conversation.h>
#include <epan/conversation_table.h>
@@ -90,10 +88,12 @@ bool ATapDataModel::hasGeoIPData()
while (!coordsFound && row < count)
{
QModelIndex idx = index(row, 0);
- if (_type == ATapDataModel::DATAMODEL_ENDPOINT)
- coordsFound = qobject_cast<EndpointDataModel *>(this)->data(idx, ATapDataModel::GEODATA_AVAILABLE).toBool();
- else if (_type == ATapDataModel::DATAMODEL_CONVERSATION)
- coordsFound = qobject_cast<ConversationDataModel *>(this)->data(idx, ATapDataModel::GEODATA_AVAILABLE).toBool();
+ if (!data(idx, ATapDataModel::ROW_IS_FILTERED).toBool()) {
+ if (_type == ATapDataModel::DATAMODEL_ENDPOINT)
+ coordsFound = qobject_cast<EndpointDataModel *>(this)->data(idx, ATapDataModel::GEODATA_AVAILABLE).toBool();
+ else if (_type == ATapDataModel::DATAMODEL_CONVERSATION)
+ coordsFound = qobject_cast<ConversationDataModel *>(this)->data(idx, ATapDataModel::GEODATA_AVAILABLE).toBool();
+ }
row++;
}
@@ -585,6 +585,9 @@ void ConversationDataModel::doDataUpdate()
int ConversationDataModel::columnCount(const QModelIndex &) const
{
+ if(tap()=="tcp")
+ return CONV_TCP_EXT_NUM_COLUMNS;
+
return CONV_NUM_COLUMNS;
}
@@ -630,6 +633,15 @@ QVariant ConversationDataModel::headerData(int section, Qt::Orientation orientat
case CONV_COLUMN_BPS_BA:
return tr("Bits/s B " UTF8_RIGHTWARDS_ARROW " A"); break;
}
+ /* Extended conversations columns, e.g. TCP */
+ if(tap()=="tcp") {
+ switch (section) {
+ case CONV_TCP_EXT_COLUMN_A:
+ return tr("Flows"); break;
+ default :
+ ws_assert_not_reached(); break;
+ }
+ }
} else if (role == Qt::TextAlignmentRole) {
if (section == CONV_COLUMN_SRC_ADDR || section == CONV_COLUMN_DST_ADDR)
return Qt::AlignLeft;
@@ -701,7 +713,10 @@ QVariant ConversationDataModel::data(const QModelIndex &idx, int role) const
return role == Qt::DisplayRole ? formatString((qlonglong)conv_item->tx_bytes + conv_item->rx_bytes) :
QVariant((qlonglong)conv_item->tx_bytes + conv_item->rx_bytes);
case CONV_COLUMN_CONV_ID:
- return (int) conv_item->conv_id;
+ if(conv_item->conv_id!=CONV_ID_UNSET) {
+ return (int) conv_item->conv_id;
+ }
+ break;
case CONV_COLUMN_PACKETS_TOTAL:
{
qlonglong packets = 0;
@@ -722,7 +737,7 @@ QVariant ConversationDataModel::data(const QModelIndex &idx, int role) const
/* Qt guarantees that this roundtrip conversion compares equally,
* so filtering with equality will work as expected.
* XXX: Perhaps the UNFORMATTED_DISPLAYDATA role shoud be split
- * into one used for raw data export and comparisions with each
+ * into one used for raw data export and comparisons with each
* other, and another for comparing with filters?
*/
return role == Qt::DisplayRole ? rounded + "%" : QVariant(rounded.toDouble());
@@ -778,6 +793,18 @@ QVariant ConversationDataModel::data(const QModelIndex &idx, int role) const
case CONV_COLUMN_BPS_BA:
return bpsCalculated ? (role == Qt::DisplayRole ? gchar_free_to_qstring(format_size((int64_t)bps_ba, FORMAT_SIZE_UNIT_BITS_S, FORMAT_SIZE_PREFIX_SI)) : QVariant((qlonglong)bps_ba)): QVariant();
}
+ /* Extended conversations columns, e.g. TCP */
+ if(tap()=="tcp") {
+ switch(idx.column()) {
+ case CONV_TCP_EXT_COLUMN_A:
+ {
+ qlonglong flows = (qlonglong)conv_item->ext_tcp.flows;
+ return role == Qt::DisplayRole ? QString("%L1").arg(flows) : (QVariant)flows; break;
+ }
+ default :
+ ws_assert_not_reached(); break;
+ }
+ }
} else if (role == Qt::ToolTipRole) {
if (idx.column() == CONV_COLUMN_START || idx.column() == CONV_COLUMN_DURATION)
return QObject::tr("Bars show the relative timeline for each conversation.");
@@ -844,7 +871,11 @@ bool ConversationDataModel::showConversationId(int row) const
return false;
conv_item_t *conv_item = (conv_item_t *)&g_array_index(storage_, conv_item_t, row);
- if (conv_item && (conv_item->ctype == CONVERSATION_TCP || conv_item->ctype == CONVERSATION_UDP))
+ if (conv_item && (conv_item->ctype == CONVERSATION_TCP ||
+ conv_item->ctype == CONVERSATION_UDP ||
+ conv_item->ctype == CONVERSATION_IP ||
+ conv_item->ctype == CONVERSATION_IPV6||
+ conv_item->ctype == CONVERSATION_ETH))
return true;
return false;
}
diff --git a/ui/qt/models/atap_data_model.h b/ui/qt/models/atap_data_model.h
index 38bdbd2f..6ba0b325 100644
--- a/ui/qt/models/atap_data_model.h
+++ b/ui/qt/models/atap_data_model.h
@@ -12,8 +12,6 @@
#include "config.h"
-#include "glib.h"
-
#include <epan/tap.h>
#include <epan/conversation.h>
#include <epan/conversation_table.h>
@@ -306,6 +304,12 @@ public:
CONV_INDEX_COLUMN = CONV_NUM_COLUMNS
} conversation_column_type_e;
+ typedef enum {
+ CONV_TCP_EXT_COLUMN_A = CONV_INDEX_COLUMN,
+ CONV_TCP_EXT_NUM_COLUMNS,
+ CONV_TCP_EXT_INDEX_COLUMN = CONV_TCP_EXT_NUM_COLUMNS
+ } conversation_tcp_ext_column_type_e;
+
explicit ConversationDataModel(int protoId, QString filter, QObject *parent = nullptr);
int columnCount(const QModelIndex &parent = QModelIndex()) const;
diff --git a/ui/qt/models/coloring_rules_delegate.cpp b/ui/qt/models/coloring_rules_delegate.cpp
index b86ffa97..58524be1 100644
--- a/ui/qt/models/coloring_rules_delegate.cpp
+++ b/ui/qt/models/coloring_rules_delegate.cpp
@@ -32,7 +32,7 @@ QWidget* ColoringRulesDelegate::createEditor(QWidget *parent, const QStyleOption
return new DisplayFilterEdit(parent);
default:
- Q_ASSERT(FALSE);
+ Q_ASSERT(false);
return 0;
}
diff --git a/ui/qt/models/coloring_rules_model.cpp b/ui/qt/models/coloring_rules_model.cpp
index dced9c37..29bb7dcf 100644
--- a/ui/qt/models/coloring_rules_model.cpp
+++ b/ui/qt/models/coloring_rules_model.cpp
@@ -72,7 +72,7 @@ ColoringRuleItem& ColoringRuleItem::operator=(ColoringRuleItem& rhs)
// Callback for color_filters_clone.
void
-color_filter_add_cb(color_filter_t *colorf, gpointer user_data)
+color_filter_add_cb(color_filter_t *colorf, void *user_data)
{
ColoringRulesModel *model = (ColoringRulesModel*)user_data;
@@ -149,7 +149,7 @@ void ColoringRulesModel::addColor(bool disabled, QString filter, QColor foregrou
bool ColoringRulesModel::importColors(QString filename, QString& err)
{
bool success = true;
- gchar* err_msg = NULL;
+ char* err_msg = NULL;
if (!color_filters_import(filename.toUtf8().constData(), this, &err_msg, color_filter_add_cb)) {
err = gchar_free_to_qstring(err_msg);
success = false;
@@ -162,8 +162,8 @@ bool ColoringRulesModel::exportColors(QString filename, QString& err)
{
GSList *cfl = createColorFilterList();
bool success = true;
- gchar* err_msg = NULL;
- if (!color_filters_export(filename.toUtf8().constData(), cfl, FALSE, &err_msg)) {
+ char* err_msg = NULL;
+ if (!color_filters_export(filename.toUtf8().constData(), cfl, false, &err_msg)) {
err = gchar_free_to_qstring(err_msg);
success = false;
}
@@ -176,7 +176,7 @@ bool ColoringRulesModel::writeColors(QString& err)
{
GSList *cfl = createColorFilterList();
bool success = true;
- gchar* err_msg = NULL;
+ char* err_msg = NULL;
if (!color_filters_apply(conversation_colors_, cfl, &err_msg)) {
err = gchar_free_to_qstring(err_msg);
success = false;
diff --git a/ui/qt/models/coloring_rules_model.h b/ui/qt/models/coloring_rules_model.h
index f51a1a30..0df532ef 100644
--- a/ui/qt/models/coloring_rules_model.h
+++ b/ui/qt/models/coloring_rules_model.h
@@ -14,7 +14,6 @@
#include <config.h>
-#include <glib.h>
#include <epan/color_filters.h>
#include <ui/qt/models/tree_model_helpers.h>
diff --git a/ui/qt/models/column_list_model.cpp b/ui/qt/models/column_list_model.cpp
index 102ffc31..7613e487 100644
--- a/ui/qt/models/column_list_model.cpp
+++ b/ui/qt/models/column_list_model.cpp
@@ -13,11 +13,11 @@
#include <ui/qt/widgets/syntax_line_edit.h>
#include <ui/qt/utils/wireshark_mime_data.h>
-#include <glib.h>
#include <epan/column.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <ui/preference_utils.h>
+#include <ui/recent.h>
#include <QLineEdit>
#include <QStringList>
@@ -31,6 +31,8 @@ struct ListElement
int type;
int originalType;
int occurrence;
+ int width;
+ char xalign;
bool displayed;
bool resolved;
};
@@ -65,6 +67,22 @@ ColumnTypeDelegate::ColumnTypeDelegate(QObject * parent) :
QStyledItemDelegate(parent)
{}
+QString ColumnTypeDelegate::alignDesc(char xalign)
+{
+ switch (xalign) {
+ case COLUMN_XALIGN_DEFAULT:
+ return QObject::tr("Default");
+ case COLUMN_XALIGN_LEFT:
+ return QObject::tr("Left");
+ case COLUMN_XALIGN_CENTER:
+ return QObject::tr("Center");
+ case COLUMN_XALIGN_RIGHT:
+ return QObject::tr("Right");
+ default:
+ return QObject::tr("Unknown");
+ }
+}
+
QWidget *ColumnTypeDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
@@ -92,13 +110,26 @@ QWidget *ColumnTypeDelegate::createEditor(QWidget *parent,
ff_editor->setText(index.data().toString());
editor = ff_editor;
}
- else if (index.column() == ColumnListModel::COL_OCCURRENCE)
+ else if (index.column() == ColumnListModel::COL_OCCURRENCE ||
+ index.column() == ColumnListModel::COL_WIDTH)
{
SyntaxLineEdit * sl_editor = new SyntaxLineEdit(parent);
connect(sl_editor, &SyntaxLineEdit::textChanged, sl_editor, &SyntaxLineEdit::checkInteger);
sl_editor->setText(index.data().toString());
editor = sl_editor;
}
+ else if (index.column() == ColumnListModel::COL_XALIGN)
+ {
+ QComboBox *cb_editor = new QComboBox(parent);
+
+ cb_editor->addItem(alignDesc(COLUMN_XALIGN_DEFAULT), QVariant(COLUMN_XALIGN_DEFAULT));
+ cb_editor->addItem(alignDesc(COLUMN_XALIGN_LEFT), QVariant(COLUMN_XALIGN_LEFT));
+ cb_editor->addItem(alignDesc(COLUMN_XALIGN_CENTER), QVariant(COLUMN_XALIGN_CENTER));
+ cb_editor->addItem(alignDesc(COLUMN_XALIGN_RIGHT), QVariant(COLUMN_XALIGN_RIGHT));
+ cb_editor->setCurrentIndex(cb_editor->findText(index.data().toString()));
+ cb_editor->setFrame(false);
+ editor = cb_editor;
+ }
if (!editor) {
editor = QStyledItemDelegate::createEditor(parent, option, index);
@@ -111,7 +142,8 @@ void ColumnTypeDelegate::setEditorData(QWidget *editor,
const QModelIndex &index) const
{
QVariant data = index.model()->data(index);
- if (index.column() == ColumnListModel::COL_TYPE)
+ if (index.column() == ColumnListModel::COL_TYPE ||
+ index.column() == ColumnListModel::COL_XALIGN)
{
QComboBox *comboBox = static_cast<QComboBox*>(editor);
comboBox->setCurrentText(data.toString());
@@ -121,7 +153,8 @@ void ColumnTypeDelegate::setEditorData(QWidget *editor,
if (qobject_cast<FieldFilterEdit *>(editor))
qobject_cast<FieldFilterEdit *>(editor)->setText(data.toString());
}
- else if (index.column() == ColumnListModel::COL_OCCURRENCE)
+ else if (index.column() == ColumnListModel::COL_OCCURRENCE ||
+ index.column() == ColumnListModel::COL_WIDTH)
{
if (qobject_cast<SyntaxLineEdit *>(editor))
qobject_cast<SyntaxLineEdit *>(editor)->setText(data.toString());
@@ -136,7 +169,8 @@ void ColumnTypeDelegate::setEditorData(QWidget *editor,
void ColumnTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
{
- if (index.column() == ColumnListModel::COL_TYPE)
+ if (index.column() == ColumnListModel::COL_TYPE ||
+ index.column() == ColumnListModel::COL_XALIGN)
{
QComboBox *comboBox = static_cast<QComboBox*>(editor);
bool ok = false;
@@ -197,6 +231,22 @@ void ColumnTypeDelegate::setModelData(QWidget *editor, QAbstractItemModel *model
}
}
+ else if (index.column() == ColumnListModel::COL_WIDTH)
+ {
+ SyntaxLineEdit * sle = qobject_cast<SyntaxLineEdit *>(editor);
+ bool ok = false;
+ if (sle)
+ {
+ sle->checkInteger(index.data().toString());
+ if (sle->syntaxState() == SyntaxLineEdit::Valid)
+ ok = true;
+ }
+
+ if (ok)
+ {
+ model->setData(index, sle->text(), Qt::EditRole);
+ }
+ }
else
QStyledItemDelegate::setModelData(editor, model, index);
}
@@ -216,7 +266,7 @@ ColumnListModel::ColumnListModel(QObject * parent):
QVariant ColumnListModel::headerData(int section, Qt::Orientation orientation, int role) const
{
- if (section > ColumnListModel::COL_RESOLVED || orientation != Qt::Horizontal ||
+ if (section > ColumnListModel::COL_XALIGN || orientation != Qt::Horizontal ||
role != Qt::DisplayRole)
return QVariant();
@@ -230,7 +280,7 @@ int ColumnListModel::rowCount(const QModelIndex &/*parent*/) const
int ColumnListModel::columnCount(const QModelIndex &/*parent*/) const
{
- return ColumnListModel::COL_RESOLVED + 1;
+ return ColumnListModel::COL_XALIGN + 1;
}
QString ColumnListModel::headerTitle(int section) const
@@ -249,6 +299,10 @@ QString ColumnListModel::headerTitle(int section) const
return tr("Field Occurrence");
case ColumnListModel::COL_RESOLVED:
return tr("Resolved");
+ case ColumnListModel::COL_WIDTH:
+ return tr("Width");
+ case ColumnListModel::COL_XALIGN:
+ return tr("Alignment");
}
return QString();
@@ -271,6 +325,9 @@ void ColumnListModel::populate()
ne.occurrence = cfmt->custom_occurrence;
ne.resolved = cfmt->resolved;
+ ne.width = recent_get_column_width(nr);
+ ne.xalign = recent_get_column_xalign(nr);
+
nr++;
store_ << ne;
}
@@ -298,6 +355,10 @@ QVariant ColumnListModel::data(const QModelIndex &index, int role) const
return ne.customFields;
case ColumnListModel::COL_OCCURRENCE:
return ne.customFields.length() > 0 ? QVariant::fromValue(ne.occurrence) : QVariant();
+ case ColumnListModel::COL_WIDTH:
+ return ne.width;
+ case ColumnListModel::COL_XALIGN:
+ return ColumnTypeDelegate::alignDesc(ne.xalign);
}
}
else if (role == Qt::CheckStateRole)
@@ -452,6 +513,20 @@ bool ColumnListModel::setData(const QModelIndex &index, const QVariant &value, i
{
store_[index.row()].resolved = value.toInt() == Qt::Checked ? true : false;
}
+ else if (index.column() == ColumnListModel::COL_WIDTH)
+ {
+ bool ok = false;
+ int val = value.toInt(&ok);
+ if (ok)
+ store_[index.row()].width = val;
+ }
+ else if (index.column() == ColumnListModel::COL_XALIGN)
+ {
+ bool ok = false;
+ int val = value.toInt(&ok);
+ if (ok)
+ store_[index.row()].xalign = static_cast<char>(val);
+ }
if (change)
emit dataChanged(index, index);
@@ -471,7 +546,7 @@ void ColumnListModel::saveColumns()
cfmt->title = qstring_strdup(elem.title);
cfmt->visible = elem.displayed;
cfmt->fmt = elem.type;
- cfmt->resolved = TRUE;
+ cfmt->resolved = true;
if (cfmt->fmt == COL_CUSTOM)
{
cfmt->custom_fields = qstring_strdup(elem.customFields);
@@ -486,6 +561,16 @@ void ColumnListModel::saveColumns()
column_prefs_remove_link(prefs.col_list);
prefs.col_list = new_col_list;
+
+ recent_free_column_width_info(&recent);
+ for (int row = 0; row < store_.count(); row++)
+ {
+ ListElement elem = store_.at(row);
+
+ recent_insert_column(row);
+ recent_set_column_width(row, elem.width);
+ recent_set_column_xalign(row, elem.xalign);
+ }
}
void ColumnListModel::addEntry()
@@ -499,6 +584,8 @@ void ColumnListModel::addEntry()
elem.occurrence = 0;
elem.customFields = QString();
elem.resolved = true;
+ elem.width = -1;
+ elem.xalign = COLUMN_XALIGN_DEFAULT;
store_ << elem;
endInsertRows();
}
diff --git a/ui/qt/models/column_list_model.h b/ui/qt/models/column_list_model.h
index c4739f96..7f59b91c 100644
--- a/ui/qt/models/column_list_model.h
+++ b/ui/qt/models/column_list_model.h
@@ -35,6 +35,8 @@ class ColumnTypeDelegate : public QStyledItemDelegate
public:
ColumnTypeDelegate(QObject * parent = Q_NULLPTR);
+ static QString alignDesc(char xalign);
+
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
@@ -59,7 +61,9 @@ public:
COL_TYPE,
COL_FIELDS,
COL_OCCURRENCE,
- COL_RESOLVED
+ COL_RESOLVED,
+ COL_WIDTH,
+ COL_XALIGN
};
enum {
diff --git a/ui/qt/models/decode_as_delegate.cpp b/ui/qt/models/decode_as_delegate.cpp
index 3c300a79..c3917928 100644
--- a/ui/qt/models/decode_as_delegate.cpp
+++ b/ui/qt/models/decode_as_delegate.cpp
@@ -46,11 +46,11 @@ void DecodeAsDelegate::cachePacketProtocols()
if (cap_file_ && cap_file_->edt) {
wmem_list_frame_t * protos = wmem_list_head(cap_file_->edt->pi.layers);
- guint8 curr_layer_num = 1;
+ uint8_t curr_layer_num = 1;
while (protos != NULL) {
int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(protos));
- const gchar * proto_name = proto_get_protocol_filter_name(proto_id);
+ const char * proto_name = proto_get_protocol_filter_name(proto_id);
for (GList *cur = decode_as_list; cur; cur = cur->next) {
decode_as_t *entry = (decode_as_t *) cur->data;
if (g_strcmp0(proto_name, entry->name) == 0) {
@@ -95,7 +95,7 @@ void DecodeAsDelegate::collectDAProtocols(QSet<QString>& all_protocols, QList<QS
//correspond to using a combo box
bool DecodeAsDelegate::isSelectorCombo(DecodeAsItem* item) const
{
- const gchar *proto_name = NULL;
+ const char *proto_name = NULL;
foreach(packet_proto_data_t proto, packet_proto_list_)
{
@@ -117,7 +117,7 @@ bool DecodeAsDelegate::isSelectorCombo(DecodeAsItem* item) const
return false;
}
-void DecodeAsDelegate::decodeAddProtocol(const gchar *, const gchar *proto_name, gpointer value, gpointer user_data)
+void DecodeAsDelegate::decodeAddProtocol(const char *, const char *proto_name, void *value, void *user_data)
{
QList<dissector_info_t*>* proto_list = (QList<dissector_info_t*>*)user_data;
@@ -178,10 +178,10 @@ QWidget* DecodeAsDelegate::createEditor(QWidget *parentWidget, const QStyleOptio
case DecodeAsModel::colSelector:
{
QComboBox *cb_editor = NULL;
- const gchar *proto_name = NULL;
+ const char *proto_name = NULL;
bool edt_present = cap_file_ && cap_file_->edt;
- gint8 curr_layer_num_saved = edt_present ? cap_file_->edt->pi.curr_layer_num : 0;
- QList<guint8> proto_layers;
+ int8_t curr_layer_num_saved = edt_present ? cap_file_->edt->pi.curr_layer_num : 0;
+ QList<uint8_t> proto_layers;
foreach(packet_proto_data_t proto, packet_proto_list_)
{
@@ -212,7 +212,7 @@ QWidget* DecodeAsDelegate::createEditor(QWidget *parentWidget, const QStyleOptio
cb_editor->addItem(current_value);
//get the value(s) from the packet
- foreach(guint8 current_layer, proto_layers) {
+ foreach(uint8_t current_layer, proto_layers) {
cap_file_->edt->pi.curr_layer_num = current_layer;
for (uint ni = 0; ni < entry->num_items; ni++) {
if (entry->values[ni].num_values == 1) { // Skip over multi-value ("both") entries
diff --git a/ui/qt/models/decode_as_delegate.h b/ui/qt/models/decode_as_delegate.h
index d0457764..d793a85a 100644
--- a/ui/qt/models/decode_as_delegate.h
+++ b/ui/qt/models/decode_as_delegate.h
@@ -13,7 +13,6 @@
#define DECODE_AS_DELEGATE_H
#include <config.h>
-#include <glib.h>
#include "cfile.h"
@@ -23,9 +22,9 @@
#include <ui/qt/models/decode_as_model.h>
typedef struct _packet_proto_data_t {
- const gchar* proto_name;
- const gchar* table_ui_name;
- guint8 curr_layer_num;
+ const char* proto_name;
+ const char* table_ui_name;
+ uint8_t curr_layer_num;
} packet_proto_data_t;
class DecodeAsDelegate : public QStyledItemDelegate
@@ -51,7 +50,7 @@ private:
void cachePacketProtocols();
bool isSelectorCombo(DecodeAsItem* item) const;
- static void decodeAddProtocol(const gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
+ static void decodeAddProtocol(const char *table_name, const char *proto_name, void *value, void *user_data);
capture_file *cap_file_;
QList<packet_proto_data_t> packet_proto_list_;
diff --git a/ui/qt/models/decode_as_model.cpp b/ui/qt/models/decode_as_model.cpp
index 67e98b75..73253c30 100644
--- a/ui/qt/models/decode_as_model.cpp
+++ b/ui/qt/models/decode_as_model.cpp
@@ -29,7 +29,7 @@
static const char *DEFAULT_TABLE = "tcp.port"; // Arbitrary
static const char *DEFAULT_UI_TABLE = "TCP port"; // Arbitrary
-DecodeAsItem::DecodeAsItem(const char* table_name, gconstpointer selector) :
+DecodeAsItem::DecodeAsItem(const char* table_name, const void *selector) :
tableName_(DEFAULT_TABLE),
tableUIName_(DEFAULT_UI_TABLE),
selectorUint_(0),
@@ -45,7 +45,7 @@ DecodeAsItem::DecodeAsItem(const char* table_name, gconstpointer selector) :
init(table_name, selector);
}
-DecodeAsItem::DecodeAsItem(const decode_as_t *entry, gconstpointer selector) :
+DecodeAsItem::DecodeAsItem(const decode_as_t *entry, const void *selector) :
tableName_(DEFAULT_TABLE),
tableUIName_(DEFAULT_UI_TABLE),
selectorUint_(0),
@@ -65,7 +65,7 @@ DecodeAsItem::~DecodeAsItem()
{
}
-void DecodeAsItem::init(const char* table_name, gconstpointer selector)
+void DecodeAsItem::init(const char* table_name, const void *selector)
{
tableName_ = table_name;
tableUIName_ = get_dissector_table_ui_name(tableName_);
@@ -74,7 +74,7 @@ void DecodeAsItem::init(const char* table_name, gconstpointer selector)
ftenum_t selector_type = get_dissector_table_selector_type(tableName_);
if (FT_IS_STRING(selector_type)) {
if (selector != NULL) {
- default_handle = dissector_get_default_string_handle(tableName_, (const gchar*)selector);
+ default_handle = dissector_get_default_string_handle(tableName_, (const char*)selector);
selectorString_ = QString((const char*)selector);
}
} else if (FT_IS_UINT(selector_type)) {
@@ -241,7 +241,7 @@ QVariant DecodeAsModel::data(const QModelIndex &index, int role) const
if (FT_IS_UINT(selector_type)) {
return entryString(item->tableName(), GUINT_TO_POINTER(item->selectorUint()));
} else if (FT_IS_STRING(selector_type)) {
- return entryString(item->tableName(), (gconstpointer)item->selectorString().toUtf8().constData());
+ return entryString(item->tableName(), (const void *)item->selectorString().toUtf8().constData());
} else if (selector_type == FT_GUID) {
if (item->selectorDCERPC() != NULL) {
return item->selectorDCERPC()->ctx_id;
@@ -410,12 +410,12 @@ bool DecodeAsModel::insertRows(int row, int count, const QModelIndex &/*parent*/
// the fields for the tables not being present at all.
wmem_list_frame_t * protos = wmem_list_tail(cap_file_->edt->pi.layers);
- gint8 curr_layer_num_saved = cap_file_->edt->pi.curr_layer_num;
- guint8 curr_layer_num = wmem_list_count(cap_file_->edt->pi.layers);
+ int8_t curr_layer_num_saved = cap_file_->edt->pi.curr_layer_num;
+ uint8_t curr_layer_num = wmem_list_count(cap_file_->edt->pi.layers);
while (protos != NULL && item == nullptr) {
int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(protos));
- const gchar * proto_name = proto_get_protocol_filter_name(proto_id);
+ const char * proto_name = proto_get_protocol_filter_name(proto_id);
for (GList *cur = decode_as_list; cur; cur = cur->next) {
decode_as_t *entry = (decode_as_t *) cur->data;
if (g_strcmp0(proto_name, entry->name) == 0) {
@@ -428,7 +428,7 @@ bool DecodeAsModel::insertRows(int row, int count, const QModelIndex &/*parent*/
// XXX: What if the Decode As table supports multiple
// values, but the first possible one is 0/NULL?
cap_file_->edt->pi.curr_layer_num = curr_layer_num;
- gpointer selector = entry->values[0].build_values[0](&cap_file_->edt->pi);
+ void *selector = entry->values[0].build_values[0](&cap_file_->edt->pi);
// FT_NONE tables don't need a value
if (selector != NULL || selector_type == FT_NONE) {
item = new DecodeAsItem(entry, selector);
@@ -499,7 +499,7 @@ bool DecodeAsModel::copyRow(int dst_row, int src_row)
return true;
}
-prefs_set_pref_e DecodeAsModel::readDecodeAsEntry(gchar *key, const gchar *value, void *private_data, gboolean)
+prefs_set_pref_e DecodeAsModel::readDecodeAsEntry(char *key, const char *value, void *private_data, bool)
{
DecodeAsModel *model = (DecodeAsModel*)private_data;
if (model == NULL)
@@ -510,7 +510,7 @@ prefs_set_pref_e DecodeAsModel::readDecodeAsEntry(gchar *key, const gchar *value
}
/* Parse into table, selector, initial, current */
- gchar **values = g_strsplit_set(value, ",", 4);
+ char **values = g_strsplit_set(value, ",", 4);
DecodeAsItem *item = nullptr;
dissector_table_t dissector_table = find_dissector_table(values[0]);
@@ -546,7 +546,7 @@ prefs_set_pref_e DecodeAsModel::readDecodeAsEntry(gchar *key, const gchar *value
return PREFS_SET_OK;
}
-bool DecodeAsModel::copyFromProfile(QString filename, const gchar **err)
+bool DecodeAsModel::copyFromProfile(QString filename, const char **err)
{
FILE *fp = ws_fopen(filename.toUtf8().constData(), "r");
@@ -564,7 +564,7 @@ bool DecodeAsModel::copyFromProfile(QString filename, const gchar **err)
return true;
}
-QString DecodeAsModel::entryString(const gchar *table_name, gconstpointer value)
+QString DecodeAsModel::entryString(const char *table_name, const void *value)
{
QString entry_str;
ftenum_t selector_type = get_dissector_table_selector_type(table_name);
@@ -654,7 +654,7 @@ void DecodeAsModel::setDissectorHandle(const QModelIndex &index, dissector_handl
item->setDissectorHandle(dissector_handle);
}
-void DecodeAsModel::buildChangedList(const gchar *table_name, ftenum_t, gpointer key, gpointer value, gpointer user_data)
+void DecodeAsModel::buildChangedList(const char *table_name, ftenum_t, void *key, void *value, void *user_data)
{
DecodeAsModel *model = (DecodeAsModel*)user_data;
if (model == NULL)
@@ -669,7 +669,7 @@ void DecodeAsModel::buildChangedList(const gchar *table_name, ftenum_t, gpointer
model->decode_as_items_ << item;
}
-void DecodeAsModel::buildDceRpcChangedList(gpointer data, gpointer user_data)
+void DecodeAsModel::buildDceRpcChangedList(void *data, void *user_data)
{
dissector_table_t sub_dissectors;
guid_key guid_val;
@@ -690,27 +690,36 @@ void DecodeAsModel::buildDceRpcChangedList(gpointer data, gpointer user_data)
model->decode_as_items_ << item;
}
-typedef QPair<const char *, guint32> UintPair;
typedef QPair<const char *, const char *> CharPtrPair;
-void DecodeAsModel::gatherChangedEntries(const gchar *table_name,
- ftenum_t selector_type, gpointer key, gpointer, gpointer user_data)
+void DecodeAsModel::gatherChangedEntries(const char *table_name,
+ ftenum_t selector_type, void *key, void *value, void *user_data)
{
DecodeAsModel *model = qobject_cast<DecodeAsModel*>((DecodeAsModel*)user_data);
if (model == NULL)
return;
+ dissector_handle_t current = dtbl_entry_get_handle((dtbl_entry_t *)value);
+
switch (selector_type) {
case FT_UINT8:
case FT_UINT16:
case FT_UINT24:
case FT_UINT32:
- model->changed_uint_entries_ << UintPair(table_name, GPOINTER_TO_UINT(key));
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ model->changed_uint_entries_.emplaceBack(table_name, GPOINTER_TO_UINT(key), dissector_handle_get_pref_suffix(current));
+#else
+ model->changed_uint_entries_ << UIntEntry(table_name, GPOINTER_TO_UINT(key), dissector_handle_get_pref_suffix(current));
+#endif
break;
case FT_NONE:
//need to reset dissector table, so this needs to be in a changed list,
//might as well be the uint one.
- model->changed_uint_entries_ << UintPair(table_name, 0);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ model->changed_uint_entries_.emplaceBack(table_name, 0, "");
+#else
+ model->changed_uint_entries_ << UIntEntry(table_name, 0, "");
+#endif
break;
case FT_STRING:
@@ -741,20 +750,20 @@ void DecodeAsModel::applyChanges()
// If dissector_all_tables_remove_changed existed we could call it
// instead.
dissector_all_tables_foreach_changed(gatherChangedEntries, this);
- foreach (UintPair uint_entry, changed_uint_entries_) {
+ foreach (const auto &uint_entry, changed_uint_entries_) {
/* Set "Decode As preferences" to default values */
- sub_dissectors = find_dissector_table(uint_entry.first);
- handle = dissector_get_uint_handle(sub_dissectors, uint_entry.second);
+ sub_dissectors = find_dissector_table(uint_entry.table);
+ handle = dissector_get_uint_handle(sub_dissectors, uint_entry.key);
if (handle != NULL) {
module = prefs_find_module(proto_get_protocol_filter_name(dissector_handle_get_protocol_index(handle)));
- pref_value = prefs_find_preference(module, uint_entry.first);
+ pref_value = prefs_find_preference(module, uint_entry.pref_name);
if (pref_value != NULL) {
module->prefs_changed_flags |= prefs_get_effect_flags(pref_value);
reset_pref(pref_value);
}
}
- dissector_reset_uint(uint_entry.first, uint_entry.second);
+ dissector_reset_uint(uint_entry.table, uint_entry.key);
}
changed_uint_entries_.clear();
foreach (CharPtrPair char_ptr_entry, changed_string_entries_) {
@@ -775,7 +784,7 @@ void DecodeAsModel::applyChanges()
if (!g_strcmp0(decode_as_entry->table_name, item->tableName())) {
ftenum_t selector_type = get_dissector_table_selector_type(item->tableName());
- gconstpointer selector_value;
+ const void * selector_value;
QByteArray byteArray;
switch (selector_type) {
@@ -791,7 +800,7 @@ void DecodeAsModel::applyChanges()
case FT_STRINGZPAD:
case FT_STRINGZTRUNC:
byteArray = item->selectorString().toUtf8();
- selector_value = (gconstpointer) byteArray.constData();
+ selector_value = (const void *) byteArray.constData();
break;
case FT_NONE:
//selector value is ignored, but dissector table needs to happen
@@ -799,7 +808,7 @@ void DecodeAsModel::applyChanges()
break;
case FT_GUID:
if (item->selectorDCERPC() != NULL) {
- selector_value = (gconstpointer)item->selectorDCERPC();
+ selector_value = (const void *)item->selectorDCERPC();
} else {
//TODO: Support normal GUID dissector tables
selector_value = NULL;
@@ -820,7 +829,7 @@ void DecodeAsModel::applyChanges()
pref_value = prefs_find_preference(module, decode_as_entry->table_name);
if (pref_value != NULL) {
module->prefs_changed_flags |= prefs_get_effect_flags(pref_value);
- prefs_remove_decode_as_value(pref_value, item->selectorUint(), TRUE);
+ prefs_remove_decode_as_value(pref_value, item->selectorUint(), true);
}
}
}
@@ -833,10 +842,10 @@ void DecodeAsModel::applyChanges()
if (item->dissectorHandle() != NULL) {
if (FT_IS_UINT(dissector_table_get_type(sub_dissectors))) {
module = prefs_find_module(proto_get_protocol_filter_name(dissector_handle_get_protocol_index(item->dissectorHandle())));
- pref_value = prefs_find_preference(module, decode_as_entry->table_name);
+ pref_value = prefs_find_preference(module, QByteArray(decode_as_entry->table_name).append(dissector_handle_get_pref_suffix(item->dissectorHandle())));
if (pref_value != NULL) {
module->prefs_changed_flags |= prefs_get_effect_flags(pref_value);
- prefs_add_decode_as_value(pref_value, item->selectorUint(), FALSE);
+ prefs_add_decode_as_value(pref_value, item->selectorUint(), false);
}
}
}
diff --git a/ui/qt/models/decode_as_model.h b/ui/qt/models/decode_as_model.h
index cf280965..273827a8 100644
--- a/ui/qt/models/decode_as_model.h
+++ b/ui/qt/models/decode_as_model.h
@@ -13,7 +13,6 @@
#define DECODE_AS_MODEL_H
#include <config.h>
-#include <glib.h>
#include <QAbstractItemModel>
#include <QList>
@@ -27,12 +26,12 @@
class DecodeAsItem
{
public:
- DecodeAsItem(const char *table_name = NULL, gconstpointer selector = NULL);
- DecodeAsItem(const decode_as_t *entry, gconstpointer selector = NULL);
+ DecodeAsItem(const char *table_name = NULL, const void *selector = NULL);
+ DecodeAsItem(const decode_as_t *entry, const void *selector = NULL);
virtual ~DecodeAsItem();
- const gchar* tableName() const { return tableName_; }
- const gchar* tableUIName() const { return tableUIName_; }
+ const char* tableName() const { return tableName_; }
+ const char* tableUIName() const { return tableUIName_; }
uint selectorUint() const { return selectorUint_; }
QString selectorString() const { return selectorString_; }
decode_dcerpc_bind_values_t* selectorDCERPC() const { return selectorDCERPC_; }
@@ -46,10 +45,10 @@ public:
void updateHandles();
private:
- void init(const char *table_name, gconstpointer selector = NULL);
+ void init(const char *table_name, const void *selector = NULL);
- const gchar* tableName_;
- const gchar* tableUIName_;
+ const char* tableName_;
+ const char* tableUIName_;
//save our sanity and not have to worry about memory management
//between (lack of) persistent data in GUI and underlying data
@@ -70,6 +69,15 @@ public:
DecodeAsModel(QObject *parent, capture_file *cf = NULL);
virtual ~DecodeAsModel();
+ struct UIntEntry {
+ QByteArray table;
+ uint32_t key;
+ QByteArray pref_name;
+
+ UIntEntry(const char* t, uint32_t k, const char* pref_suffix) :
+ table(t), key(k), pref_name(t) { pref_name.append(pref_suffix); }
+ };
+
enum DecodeAsColumn {
colTable = 0, // aka "Field" (or dissector table like "TCP Port")
colSelector, // the actual table value (e.g., port number 80)
@@ -95,25 +103,25 @@ public:
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
void clearAll();
bool copyRow(int dst_row, int src_row);
- bool copyFromProfile(QString filename, const gchar **err);
+ bool copyFromProfile(QString filename, const char **err);
- static QString entryString(const gchar *table_name, gconstpointer value);
+ static QString entryString(const char *table_name, const void *value);
void applyChanges();
protected:
- static void buildChangedList(const gchar *table_name, ftenum_t selector_type,
- gpointer key, gpointer value, gpointer user_data);
- static void buildDceRpcChangedList(gpointer data, gpointer user_data);
- static void gatherChangedEntries(const gchar *table_name, ftenum_t selector_type,
- gpointer key, gpointer value, gpointer user_data);
- static prefs_set_pref_e readDecodeAsEntry(gchar *key, const gchar *value,
- void *user_data, gboolean return_range_errors);
+ static void buildChangedList(const char *table_name, ftenum_t selector_type,
+ void *key, void *value, void *user_data);
+ static void buildDceRpcChangedList(void *data, void *user_data);
+ static void gatherChangedEntries(const char *table_name, ftenum_t selector_type,
+ void *key, void *value, void *user_data);
+ static prefs_set_pref_e readDecodeAsEntry(char *key, const char *value,
+ void *user_data, bool);
private:
capture_file *cap_file_;
QList<DecodeAsItem *> decode_as_items_;
- QList<QPair<const char *, guint32> > changed_uint_entries_;
+ QList<UIntEntry> changed_uint_entries_;
QList<QPair<const char *, const char *> > changed_string_entries_;
};
diff --git a/ui/qt/models/dissector_tables_model.cpp b/ui/qt/models/dissector_tables_model.cpp
index 73c757ec..dcf3dc72 100644
--- a/ui/qt/models/dissector_tables_model.cpp
+++ b/ui/qt/models/dissector_tables_model.cpp
@@ -179,7 +179,7 @@ QVariant DissectorTablesModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-static void gatherProtocolDecodes(const char *, ftenum_t selector_type, gpointer key, gpointer value, gpointer item_ptr)
+static void gatherProtocolDecodes(const char *, ftenum_t selector_type, void *key, void *value, void *item_ptr)
{
DissectorTablesItem* pdl_ptr = (DissectorTablesItem*)item_ptr;
if (pdl_ptr == NULL)
@@ -225,7 +225,7 @@ struct tables_root
DissectorTablesItem* string_table;
};
-static void gatherTableNames(const char *short_name, const char *table_name, gpointer model_ptr)
+static void gatherTableNames(const char *short_name, const char *table_name, void *model_ptr)
{
struct tables_root* tables = (struct tables_root*)model_ptr;
if (model_ptr == NULL)
@@ -262,7 +262,7 @@ static void gatherTableNames(const char *short_name, const char *table_name, gpo
dissector_table_foreach(short_name, gatherProtocolDecodes, dt_ti);
}
-static void gatherHeurProtocolDecodes(const char *, struct heur_dtbl_entry *dtbl_entry, gpointer list_ptr)
+static void gatherHeurProtocolDecodes(const char *, struct heur_dtbl_entry *dtbl_entry, void *list_ptr)
{
DissectorTablesItem* hdl_ptr = (DissectorTablesItem*)list_ptr;
if (hdl_ptr == NULL)
@@ -279,13 +279,18 @@ static void gatherHeurProtocolDecodes(const char *, struct heur_dtbl_entry *dtbl
}
}
-static void gatherHeurTableNames(const char *table_name, heur_dissector_list *list, gpointer heur_tables)
+static void gatherHeurTableNames(const char *table_name, heur_dissector_list *list, void *heur_tables)
{
DissectorTablesItem* table = (DissectorTablesItem*)heur_tables;
if (table == NULL)
return;
- DissectorTablesItem *heur = new DissectorTablesItem(table_name, QString(""), table);
+ QString desc_name = table_name;
+ if (list) {
+ const char *desc = heur_dissector_list_get_description(list);
+ if (desc) desc_name = desc;
+ }
+ DissectorTablesItem *heur = new DissectorTablesItem(desc_name, table_name, table);
table->prependChild(heur);
if (list) {
diff --git a/ui/qt/models/enabled_protocols_model.cpp b/ui/qt/models/enabled_protocols_model.cpp
index ecbc47a9..d923d765 100644
--- a/ui/qt/models/enabled_protocols_model.cpp
+++ b/ui/qt/models/enabled_protocols_model.cpp
@@ -31,7 +31,7 @@ public:
virtual ~ProtocolTreeItem() {}
protected:
- virtual void applyValuePrivate(gboolean value)
+ virtual void applyValuePrivate(bool value)
{
if (! proto_can_toggle_protocol(proto_get_id(proto_))) {
return;
@@ -56,7 +56,7 @@ public:
virtual ~HeuristicTreeItem() {}
protected:
- virtual void applyValuePrivate(gboolean value)
+ virtual void applyValuePrivate(bool value)
{
heuristic_table_->enabled = value;
}
@@ -239,7 +239,6 @@ QVariant EnabledProtocolsModel::data(const QModelIndex &index, int role) const
break;
case DATA_PROTOCOL_TYPE:
return QVariant::fromValue(item->type());
- break;
default:
break;
}
@@ -270,7 +269,7 @@ bool EnabledProtocolsModel::setData(const QModelIndex &index, const QVariant &va
return true;
}
-static void addHeuristicItem(gpointer data, gpointer user_data)
+static void addHeuristicItem(void *data, void *user_data)
{
heur_dtbl_entry_t* heur = (heur_dtbl_entry_t*)data;
ProtocolTreeItem* protocol_item = (ProtocolTreeItem*)user_data;
diff --git a/ui/qt/models/enabled_protocols_model.h b/ui/qt/models/enabled_protocols_model.h
index 23b2c1bb..fe6caeab 100644
--- a/ui/qt/models/enabled_protocols_model.h
+++ b/ui/qt/models/enabled_protocols_model.h
@@ -43,7 +43,7 @@ public:
bool applyValue();
protected:
- virtual void applyValuePrivate(gboolean value) = 0;
+ virtual void applyValuePrivate(bool value) = 0;
QString name_;
QString description_;
diff --git a/ui/qt/models/expert_info_model.cpp b/ui/qt/models/expert_info_model.cpp
index 017dba3d..24204612 100644
--- a/ui/qt/models/expert_info_model.cpp
+++ b/ui/qt/models/expert_info_model.cpp
@@ -118,7 +118,7 @@ ExpertPacketItem* ExpertInfoModel::createRootItem()
{
static const char* rootName = "ROOT";
DIAG_OFF_CAST_AWAY_CONST
- static expert_info_t root_expert = { 0, -1, -1, -1, rootName, (gchar*)rootName, NULL };
+ static expert_info_t root_expert = { 0, -1, -1, -1, rootName, (char*)rootName, NULL };
DIAG_ON_CAST_AWAY_CONST
return new ExpertPacketItem(root_expert, NULL, NULL);
@@ -355,8 +355,8 @@ int ExpertInfoModel::columnCount(const QModelIndex&) const
void ExpertInfoModel::addExpertInfo(const struct expert_info_s& expert_info)
{
- QString groupKey = ExpertPacketItem::groupKey(FALSE, expert_info.severity, expert_info.group, QString(expert_info.protocol), expert_info.hf_index);
- QString summaryKey = ExpertPacketItem::groupKey(TRUE, expert_info.severity, expert_info.group, QString(expert_info.protocol), expert_info.hf_index);
+ QString groupKey = ExpertPacketItem::groupKey(false, expert_info.severity, expert_info.group, QString(expert_info.protocol), expert_info.hf_index);
+ QString summaryKey = ExpertPacketItem::groupKey(true, expert_info.severity, expert_info.group, QString(expert_info.protocol), expert_info.hf_index);
ExpertPacketItem* expert_root = root_->child(groupKey);
if (expert_root == NULL) {
diff --git a/ui/qt/models/export_objects_model.cpp b/ui/qt/models/export_objects_model.cpp
index 3cf9ec63..3546db5c 100644
--- a/ui/qt/models/export_objects_model.cpp
+++ b/ui/qt/models/export_objects_model.cpp
@@ -176,7 +176,7 @@ void ExportObjectModel::saveAllEntries(QString path)
if (entry == NULL)
continue;
- guint count = 0;
+ unsigned count = 0;
QString filename;
do {
diff --git a/ui/qt/models/fileset_entry_model.cpp b/ui/qt/models/fileset_entry_model.cpp
index 8c9f504b..86979e38 100644
--- a/ui/qt/models/fileset_entry_model.cpp
+++ b/ui/qt/models/fileset_entry_model.cpp
@@ -121,14 +121,13 @@ void FilesetEntryModel::clear()
}
QString FilesetEntryModel::nameToDate(const char *name) const {
+ char *date;
QString dn;
- if (!fileset_filename_match_pattern(name))
+ if (fileset_filename_match_pattern(name, NULL, NULL, &date) == FILESET_NO_MATCH)
return NULL;
- dn = name;
- dn.remove(QRegularExpression(".*_"));
- dn.truncate(14);
+ dn = gchar_free_to_qstring(date);
dn.insert(4, '-');
dn.insert(7, '-');
dn.insert(10, ' ');
diff --git a/ui/qt/models/fileset_entry_model.h b/ui/qt/models/fileset_entry_model.h
index aa812b0c..40e6796f 100644
--- a/ui/qt/models/fileset_entry_model.h
+++ b/ui/qt/models/fileset_entry_model.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <fileset.h>
#include <QAbstractItemModel>
diff --git a/ui/qt/models/filter_list_model.cpp b/ui/qt/models/filter_list_model.cpp
index 3ed25839..c257d6af 100644
--- a/ui/qt/models/filter_list_model.cpp
+++ b/ui/qt/models/filter_list_model.cpp
@@ -8,8 +8,6 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <glib.h>
-
#include <wsutil/filesystem.h>
#include <ui/qt/utils/qt_ui_utils.h>
@@ -24,11 +22,6 @@
#include <QMimeData>
/*
- * Old filter file name.
- */
-#define FILTER_FILE_NAME "filters"
-
-/*
* Capture filter file name.
*/
#define CFILTER_FILE_NAME "cfilters"
@@ -38,6 +31,11 @@
*/
#define DFILTER_FILE_NAME "dfilters"
+/*
+ * Display filter macros file name.
+ */
+#define DMACROS_FILE_NAME "dmacros"
+
FilterListModel::FilterListModel(QObject * parent) :
QAbstractListModel(parent),
type_(FilterListModel::Display)
@@ -56,12 +54,17 @@ void FilterListModel::reload()
{
storage.clear();
- const char * cfile = (type_ == FilterListModel::Capture) ? CFILTER_FILE_NAME : DFILTER_FILE_NAME;
+ const char *cfile;
+
+ switch (type_) {
+ case FilterListModel::Capture: cfile = CFILTER_FILE_NAME; break;
+ case FilterListModel::Display: cfile = DFILTER_FILE_NAME; break;
+ case FilterListModel::DisplayMacro: cfile = DMACROS_FILE_NAME; break;
+ default: ws_assert_not_reached();
+ }
/* Try personal config file first */
- QString fileName = gchar_free_to_qstring(get_persconffile_path(cfile, TRUE));
- if (fileName.length() <= 0 || ! QFileInfo::exists(fileName))
- fileName = gchar_free_to_qstring(get_persconffile_path(FILTER_FILE_NAME, TRUE));
+ QString fileName = gchar_free_to_qstring(get_persconffile_path(cfile, true));
if (fileName.length() <= 0 || ! QFileInfo::exists(fileName))
fileName = gchar_free_to_qstring(get_datafile_path(cfile));
if (fileName.length() <= 0 || ! QFileInfo::exists(fileName))
@@ -80,7 +83,7 @@ void FilterListModel::reload()
/* Filter out lines that do not contain content:
* - Starting with # is a comment
* - Does not start with a quoted string
- */
+ */
if (data.startsWith("#") || ! data.trimmed().startsWith("\""))
continue;
@@ -125,10 +128,16 @@ QVariant FilterListModel::headerData(int section, Qt::Orientation orientation, i
{
switch (section) {
case ColumnName:
- return tr("Filter Name");
+ if (type_ == DisplayMacro)
+ return tr("Macro Name");
+ else
+ return tr("Filter Name");
break;
case ColumnExpression:
- return tr("Filter Expression");
+ if (type_ == DisplayMacro)
+ return tr("Macro Expression");
+ else
+ return tr("Filter Expression");
break;
}
}
@@ -230,9 +239,17 @@ void FilterListModel::removeFilter(QModelIndex idx)
void FilterListModel::saveList()
{
- QString filename = (type_ == FilterListModel::Capture) ? CFILTER_FILE_NAME : DFILTER_FILE_NAME;
+ const char *cfile;
+ QString filename;
+
+ switch (type_) {
+ case Capture: cfile = CFILTER_FILE_NAME; break;
+ case Display: cfile = DFILTER_FILE_NAME; break;
+ case DisplayMacro: cfile = DMACROS_FILE_NAME; break;
+ default: ws_assert_not_reached();
+ }
- filename = QString("%1%2%3").arg(ProfileModel::activeProfilePath()).arg("/").arg(filename);
+ filename = QString("%1%2%3").arg(ProfileModel::activeProfilePath()).arg("/").arg(cfile);
QFile file(filename);
if (! file.open(QIODevice::WriteOnly | QIODevice::Text))
diff --git a/ui/qt/models/filter_list_model.h b/ui/qt/models/filter_list_model.h
index 4f528d2f..4611eeb9 100644
--- a/ui/qt/models/filter_list_model.h
+++ b/ui/qt/models/filter_list_model.h
@@ -25,7 +25,8 @@ class FilterListModel : public QAbstractListModel
public:
enum FilterListType {
Display,
- Capture
+ Capture,
+ DisplayMacro,
};
explicit FilterListModel(FilterListType type = FilterListModel::Display, QObject * parent = Q_NULLPTR);
diff --git a/ui/qt/models/info_proxy_model.cpp b/ui/qt/models/info_proxy_model.cpp
index 7b256b9d..e07027c8 100644
--- a/ui/qt/models/info_proxy_model.cpp
+++ b/ui/qt/models/info_proxy_model.cpp
@@ -57,7 +57,6 @@ QVariant InfoProxyModel::data (const QModelIndex &index, int role) const
{
case Qt::DisplayRole:
return infos_.at(ifIdx);
- break;
case Qt::FontRole:
QFont font = QIdentityProxyModel::data(index, Qt::FontRole).value<QFont>();
font.setItalic(true);
diff --git a/ui/qt/models/interface_sort_filter_model.cpp b/ui/qt/models/interface_sort_filter_model.cpp
index 9d9c5dc8..f5d62074 100644
--- a/ui/qt/models/interface_sort_filter_model.cpp
+++ b/ui/qt/models/interface_sort_filter_model.cpp
@@ -12,8 +12,6 @@
#include <ui/qt/models/interface_tree_cache_model.h>
#include <ui/qt/models/interface_sort_filter_model.h>
-#include <glib.h>
-
#include <epan/prefs.h>
#include <ui/preference_utils.h>
#include <ui/qt/utils/qt_ui_utils.h>
@@ -143,10 +141,7 @@ void InterfaceSortFilterModel::resetPreferenceData()
}
}
-#if 0
- // Disabled until bug 13354 is fixed
_filterHidden = ! prefs.gui_interfaces_show_hidden;
-#endif
#ifdef HAVE_PCAP_REMOTE
_remoteDisplay = prefs.gui_interfaces_remote_display;
#endif
@@ -278,15 +273,18 @@ bool InterfaceSortFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex
int type = -1;
bool hidden = false;
- if (dynamic_cast<InterfaceTreeCacheModel*>(sourceModel()) != 0)
+ InterfaceTreeCacheModel* cacheModel = qobject_cast<InterfaceTreeCacheModel*>(sourceModel());
+ InterfaceTreeModel* treeModel = nullptr;
+
+ if (cacheModel != nullptr)
{
- type = ((InterfaceTreeCacheModel *)sourceModel())->getColumnContent(idx, IFTREE_COL_TYPE).toInt();
- hidden = ((InterfaceTreeCacheModel *)sourceModel())->getColumnContent(idx, IFTREE_COL_HIDDEN, Qt::UserRole).toBool();
+ type = cacheModel->getColumnContent(idx, IFTREE_COL_TYPE).toInt();
+ hidden = cacheModel->getColumnContent(idx, IFTREE_COL_HIDDEN, Qt::UserRole).toBool();
}
- else if (dynamic_cast<InterfaceTreeModel*>(sourceModel()) != 0)
+ else if ((treeModel = qobject_cast<InterfaceTreeModel*>(sourceModel())) != nullptr)
{
- type = ((InterfaceTreeModel *)sourceModel())->getColumnContent(idx, IFTREE_COL_TYPE).toInt();
- hidden = ((InterfaceTreeModel *)sourceModel())->getColumnContent(idx, IFTREE_COL_HIDDEN, Qt::UserRole).toBool();
+ type = treeModel->getColumnContent(idx, IFTREE_COL_TYPE).toInt();
+ hidden = treeModel->getColumnContent(idx, IFTREE_COL_HIDDEN, Qt::UserRole).toBool();
}
else
return false;
@@ -294,24 +292,31 @@ bool InterfaceSortFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex
if (hidden && _filterHidden)
return false;
+#ifdef HAVE_PCAP_REMOTE
+ bool isRemote = false;
+ if (cacheModel && cacheModel->isRemote(realIndex)) {
+ isRemote = true;
+ } else if (treeModel && treeModel->isRemote(idx)) {
+ isRemote = true;
+ }
+#endif
+
if (_filterTypes && ! isInterfaceTypeShown(type))
{
#ifdef HAVE_PCAP_REMOTE
- /* Remote interfaces have the if type IF_WIRED, therefore would be filtered, if not explicitly checked here */
- if (type != IF_WIRED || ! ((InterfaceTreeModel *)sourceModel())->isRemote(idx))
+ /* Remote interfaces have the if type IF_WIRED, therefore would be filtered if not explicitly checked here */
+ if (type != IF_WIRED || !isRemote)
#endif
return false;
}
#ifdef HAVE_PCAP_REMOTE
- if (((InterfaceTreeModel *)sourceModel())->isRemote(idx))
- {
- if (! _remoteDisplay)
+ if (isRemote && !_remoteDisplay) {
return false;
}
#endif
-#endif
+#endif /* HAVE_LIBPCAP */
return true;
}
diff --git a/ui/qt/models/interface_sort_filter_model.h b/ui/qt/models/interface_sort_filter_model.h
index 5bf69d9d..e3609a81 100644
--- a/ui/qt/models/interface_sort_filter_model.h
+++ b/ui/qt/models/interface_sort_filter_model.h
@@ -16,8 +16,6 @@
#include <ui/qt/models/interface_tree_model.h>
-#include <glib.h>
-
#include <QSortFilterProxyModel>
class InterfaceSortFilterModel : public QSortFilterProxyModel
diff --git a/ui/qt/models/interface_tree_cache_model.cpp b/ui/qt/models/interface_tree_cache_model.cpp
index 71eda509..6c21d004 100644
--- a/ui/qt/models/interface_tree_cache_model.cpp
+++ b/ui/qt/models/interface_tree_cache_model.cpp
@@ -32,7 +32,7 @@ InterfaceTreeCacheModel::InterfaceTreeCacheModel(QObject *parent) :
sourceModel = new InterfaceTreeModel(parent);
QIdentityProxyModel::setSourceModel(sourceModel);
- storage = new QMap<int, QMap<InterfaceTreeColumns, QVariant> *>();
+ storage = new QMap<int, QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > >();
checkableColumns << IFTREE_COL_HIDDEN << IFTREE_COL_PROMISCUOUSMODE;
#ifdef HAVE_PCAP_CREATE
@@ -67,8 +67,7 @@ void InterfaceTreeCacheModel::reset(int row)
{
if (row < 0)
{
- delete storage;
- storage = new QMap<int, QMap<InterfaceTreeColumns, QVariant> *>();
+ storage->clear();
}
else
{
@@ -90,7 +89,7 @@ void InterfaceTreeCacheModel::saveNewDevices()
interface_t *device = const_cast<interface_t *>(&(*it));
bool useDevice = false;
- QMap<InterfaceTreeColumns, QVariant> * dataField = storage->value(idx, 0);
+ QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > dataField = storage->value(idx, 0);
/* When devices are being added, they are added using generic values. So only devices
* whose data have been changed should be used from here on out. */
if (dataField != 0)
@@ -124,7 +123,6 @@ void InterfaceTreeCacheModel::saveNewDevices()
/* All entries of this new devices have been considered */
storage->remove(idx);
- delete dataField;
}
newDevices.clear();
@@ -140,6 +138,13 @@ void InterfaceTreeCacheModel::save()
/* No devices are hidden until checking "Show" state */
prefStorage[&prefs.capture_devices_hide] = QStringList();
+ /* Some of the columns we only add entries to the QStringList for
+ * interfaces that have a non-default value, so we need to ensure
+ * that we set the pref string to empty if no interface is set.
+ */
+ prefStorage[&prefs.capture_devices_descr] = QStringList();
+ prefStorage[&prefs.capture_devices_monitor_mode] << QStringList();
+
/* Storing new devices first including their changed values */
saveNewDevices();
@@ -152,7 +157,7 @@ void InterfaceTreeCacheModel::save()
continue;
/* Try to load a saved value row for this index */
- QMap<InterfaceTreeColumns, QVariant> * dataField = storage->value(idx, 0);
+ QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > dataField = storage->value(idx, 0);
/* Handle the storing of values for this device here */
if (dataField)
@@ -170,7 +175,8 @@ void InterfaceTreeCacheModel::save()
if (col == IFTREE_COL_HIDDEN)
{
- device->hidden = saveValue.toBool();
+ /* Hidden is de-selection, therefore inverted logic here */
+ device->hidden = (saveValue == Qt::Unchecked);
}
else if (device->if_info.type == IF_EXTCAP)
{
@@ -413,12 +419,12 @@ bool InterfaceTreeCacheModel::setData(const QModelIndex &index, const QVariant &
{
QVariant saveValue = value;
- QMap<InterfaceTreeColumns, QVariant> * dataField = 0;
+ QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > dataField = nullptr;
/* obtain the list of already stored changes for this row. If none exist
* create a new storage row for this entry */
- if ((dataField = storage->value(row, 0)) == 0)
+ if ((dataField = storage->value(row, 0)) == nullptr)
{
- dataField = new QMap<InterfaceTreeColumns, QVariant>();
+ dataField = QSharedPointer<QMap<InterfaceTreeColumns, QVariant> >(new QMap<InterfaceTreeColumns, QVariant>);
storage->insert(row, dataField);
}
@@ -445,8 +451,8 @@ QVariant InterfaceTreeCacheModel::data(const QModelIndex &index, int role) const
if (((role == Qt::DisplayRole || role == Qt::EditRole) && editableColumns.contains(col)) ||
(role == Qt::CheckStateRole && checkableColumns.contains(col)) )
{
- QMap<InterfaceTreeColumns, QVariant> * dataField = 0;
- if ((dataField = storage->value(row, 0)) != 0)
+ QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > dataField = nullptr;
+ if ((dataField = storage->value(row, 0)) != nullptr)
{
if (dataField->contains(col))
{
@@ -485,8 +491,8 @@ QVariant InterfaceTreeCacheModel::data(const QModelIndex &index, int role) const
col == IFTREE_COL_DESCRIPTION)
{
- QMap<InterfaceTreeColumns, QVariant> * dataField = 0;
- if ((dataField = storage->value(row, 0)) != 0 &&
+ QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > dataField = nullptr;
+ if ((dataField = storage->value(row, 0)) != nullptr &&
dataField->contains(IFTREE_COL_PIPE_PATH))
{
return dataField->value(IFTREE_COL_PIPE_PATH, QVariant());
@@ -518,6 +524,17 @@ QVariant InterfaceTreeCacheModel::data(const QModelIndex &index, int role) const
return QVariant();
}
+#ifdef HAVE_PCAP_REMOTE
+bool InterfaceTreeCacheModel::isRemote(const QModelIndex &index) const
+{
+ const interface_t *device = lookup(index);
+ if (device != nullptr && device->remote_opts.src_type == CAPTURE_IFREMOTE) {
+ return true;
+ }
+ return false;
+}
+#endif
+
#ifdef HAVE_LIBPCAP
QModelIndex InterfaceTreeCacheModel::index(int row, int column, const QModelIndex &parent) const
{
diff --git a/ui/qt/models/interface_tree_cache_model.h b/ui/qt/models/interface_tree_cache_model.h
index 9b51c10b..1c33081d 100644
--- a/ui/qt/models/interface_tree_cache_model.h
+++ b/ui/qt/models/interface_tree_cache_model.h
@@ -20,6 +20,8 @@
class InterfaceTreeCacheModel : public QIdentityProxyModel
{
+ Q_OBJECT
+
public:
explicit InterfaceTreeCacheModel(QObject *parent);
~InterfaceTreeCacheModel();
@@ -42,6 +44,10 @@ public:
void deleteDevice(const QModelIndex &index);
#endif
+#ifdef HAVE_PCAP_REMOTE
+ bool isRemote(const QModelIndex &index) const;
+#endif
+
private:
InterfaceTreeModel * sourceModel;
@@ -50,7 +56,7 @@ private:
void saveNewDevices();
#endif
- QMap<int, QMap<InterfaceTreeColumns, QVariant> *> * storage;
+ QMap<int, QSharedPointer<QMap<InterfaceTreeColumns, QVariant> > > * storage;
QList<InterfaceTreeColumns> editableColumns;
QList<InterfaceTreeColumns> checkableColumns;
diff --git a/ui/qt/models/interface_tree_model.cpp b/ui/qt/models/interface_tree_model.cpp
index 547b9010..696937a2 100644
--- a/ui/qt/models/interface_tree_model.cpp
+++ b/ui/qt/models/interface_tree_model.cpp
@@ -136,7 +136,7 @@ QVariant InterfaceTreeModel::data(const QModelIndex &index, int role) const
}
else if (col == IFTREE_COL_DESCRIPTION)
{
- return QString(device->friendly_name);
+ return QString(device->if_info.friendly_name);
}
else if (col == IFTREE_COL_DISPLAY_NAME)
{
@@ -370,7 +370,7 @@ void InterfaceTreeModel::interfaceListChanged()
QVariant InterfaceTreeModel::toolTipForInterface(int idx) const
{
#ifdef HAVE_LIBPCAP
- if (! global_capture_opts.all_ifaces || global_capture_opts.all_ifaces->len <= (guint) idx)
+ if (! global_capture_opts.all_ifaces || global_capture_opts.all_ifaces->len <= (unsigned) idx)
return QVariant();
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, idx);
@@ -415,6 +415,12 @@ QVariant InterfaceTreeModel::toolTipForInterface(int idx) const
}
#ifdef HAVE_LIBPCAP
+void InterfaceTreeModel::setCache(if_stat_cache_t *stat_cache)
+{
+ stopStatistic();
+ stat_cache_ = stat_cache;
+}
+
void InterfaceTreeModel::stopStatistic()
{
if (stat_cache_)
@@ -428,7 +434,7 @@ void InterfaceTreeModel::stopStatistic()
void InterfaceTreeModel::updateStatistic(unsigned int idx)
{
#ifdef HAVE_LIBPCAP
- if (! global_capture_opts.all_ifaces || global_capture_opts.all_ifaces->len <= (guint) idx)
+ if (! global_capture_opts.all_ifaces || global_capture_opts.all_ifaces->len <= (unsigned) idx)
return;
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, idx);
@@ -439,7 +445,11 @@ void InterfaceTreeModel::updateStatistic(unsigned int idx)
if (!stat_cache_)
{
// Start gathering statistics using dumpcap
- // We crash (on macOS at least) if we try to do this from ::showEvent.
+ //
+ // The stat cache will only properly configure if it has the list
+ // of interfaces in global_capture_opts->all_ifaces.
+ // We crash if we try to do this from InterfaceFrame::showEvent,
+ // because main.cpp calls mainw->show() before capture_opts_init().
stat_cache_ = capture_stat_start(&global_capture_opts);
}
@@ -530,12 +540,12 @@ bool InterfaceTreeModel::updateSelectedDevices(QItemSelection sourceSelection)
{
if (! device->selected)
selectionHasChanged = true;
- device->selected = TRUE;
+ device->selected = true;
global_capture_opts.num_selected++;
} else {
if (device->selected)
selectionHasChanged = true;
- device->selected = FALSE;
+ device->selected = false;
}
}
#else
diff --git a/ui/qt/models/interface_tree_model.h b/ui/qt/models/interface_tree_model.h
index cdf2ac89..747dc2e0 100644
--- a/ui/qt/models/interface_tree_model.h
+++ b/ui/qt/models/interface_tree_model.h
@@ -27,19 +27,28 @@
typedef QList<int> PointList;
+/*
+ * When sorting, QSortFilterProxyModel creates its own mapping instead
+ * of using the QModelIndex mapping with mapToSource to determine which
+ * column in the proxy model maps to which column in the source. Its own
+ * mapping is always done in order; this means that it's easier if all
+ * the Views of this model keep the columns in the same relative order,
+ * but can omit columns. (If you really need to change the order,
+ * QHeaderView::swapSections() can be used.)
+ */
enum InterfaceTreeColumns
{
- IFTREE_COL_EXTCAP,
+ IFTREE_COL_EXTCAP, // InterfaceFrame interfaceTree
IFTREE_COL_EXTCAP_PATH,
- IFTREE_COL_NAME,
- IFTREE_COL_DESCRIPTION,
- IFTREE_COL_DISPLAY_NAME,
- IFTREE_COL_COMMENT,
- IFTREE_COL_HIDDEN,
+ IFTREE_COL_HIDDEN, // ManageInterfaceDialog localView
+ IFTREE_COL_DISPLAY_NAME, // InterfaceFrame interfaceTree
+ IFTREE_COL_DESCRIPTION, // ManageInterfaceDialog localView
+ IFTREE_COL_NAME, // ManageInterfaceDialog localView
+ IFTREE_COL_COMMENT, // ManageInterfaceDialog localView
+ IFTREE_COL_STATS, // InterfaceFrame interfaceTree
IFTREE_COL_DLT,
IFTREE_COL_PROMISCUOUSMODE,
IFTREE_COL_TYPE,
- IFTREE_COL_STATS,
IFTREE_COL_ACTIVE,
IFTREE_COL_SNAPLEN,
#ifdef CAN_SET_CAPTURE_BUFFER_SIZE
@@ -49,7 +58,7 @@ enum InterfaceTreeColumns
IFTREE_COL_MONITOR_MODE,
#endif
IFTREE_COL_CAPTURE_FILTER,
- IFTREE_COL_PIPE_PATH,
+ IFTREE_COL_PIPE_PATH, // ManageInterfaceDialog pipeView
IFTREE_COL_MAX /* is not being displayed, it is the definition for the maximum numbers of columns */
};
@@ -68,6 +77,7 @@ public:
void updateStatistic(unsigned int row);
#ifdef HAVE_LIBPCAP
+ void setCache(if_stat_cache_t *stat_cache);
void stopStatistic();
#endif
diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp
index 8cc00691..9bb81fb5 100644
--- a/ui/qt/models/packet_list_model.cpp
+++ b/ui/qt/models/packet_list_model.cpp
@@ -8,7 +8,6 @@
*/
#include <algorithm>
-#include <glib.h>
#include <cmath>
#include <stdexcept>
@@ -55,7 +54,7 @@ class SortAbort : public std::runtime_error
static PacketListModel * glbl_plist_model = Q_NULLPTR;
static const int reserved_packets_ = 100000;
-guint
+unsigned
packet_list_append(column_info *, frame_data *fdata)
{
if (!glbl_plist_model)
@@ -143,7 +142,7 @@ int PacketListModel::packetNumberToRow(int packet_num) const
return number_to_row_.value(packet_num) - 1;
}
-guint PacketListModel::recreateVisibleRows()
+unsigned PacketListModel::recreateVisibleRows()
{
beginResetModel();
visible_rows_.resize(0);
@@ -155,7 +154,7 @@ guint PacketListModel::recreateVisibleRows()
if (fdata->passed_dfilter || fdata->ref_time) {
visible_rows_ << record;
- if (static_cast<guint32>(number_to_row_.size()) <= fdata->num) {
+ if (static_cast<uint32_t>(number_to_row_.size()) <= fdata->num) {
number_to_row_.resize(fdata->num + 10000);
}
number_to_row_[fdata->num] = static_cast<int>(visible_rows_.count());
@@ -166,7 +165,7 @@ guint PacketListModel::recreateVisibleRows()
endInsertRows();
}
idle_dissection_row_ = 0;
- return static_cast<guint>(visible_rows_.count());
+ return static_cast<unsigned>(visible_rows_.count());
}
void PacketListModel::clear() {
@@ -285,7 +284,7 @@ void PacketListModel::toggleFrameMark(const QModelIndexList &indeces)
}
}
-void PacketListModel::setDisplayedFrameMark(gboolean set)
+void PacketListModel::setDisplayedFrameMark(bool set)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
emit layoutAboutToBeChanged();
@@ -334,7 +333,7 @@ void PacketListModel::toggleFrameIgnore(const QModelIndexList &indeces)
}
}
-void PacketListModel::setDisplayedFrameIgnore(gboolean set)
+void PacketListModel::setDisplayedFrameIgnore(bool set)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
emit layoutAboutToBeChanged();
@@ -447,7 +446,7 @@ void PacketListModel::addFrameComment(const QModelIndexList &indices, const QByt
}
}
-void PacketListModel::setFrameComment(const QModelIndex &index, const QByteArray &comment, guint c_number)
+void PacketListModel::setFrameComment(const QModelIndex &index, const QByteArray &comment, unsigned c_number)
{
int sectionMax = columnCount() - 1;
frame_data *fdata;
@@ -492,10 +491,10 @@ void PacketListModel::deleteFrameComments(const QModelIndexList &indices)
fdata = record->frameData();
wtap_block_t pkt_block = cf_get_packet_block(cap_file_, fdata);
- guint n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ unsigned n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
if (n_comments) {
- for (guint i = 0; i < n_comments; i++) {
+ for (unsigned i = 0; i < n_comments; i++) {
wtap_block_remove_nth_option_instance(pkt_block, OPT_COMMENT, 0);
}
if (!cf_set_modified_block(cap_file_, fdata, pkt_block)) {
@@ -522,10 +521,10 @@ void PacketListModel::deleteAllFrameComments()
foreach (PacketListRecord *record, physical_rows_) {
frame_data *fdata = record->frameData();
wtap_block_t pkt_block = cf_get_packet_block(cap_file_, fdata);
- guint n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ unsigned n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
if (n_comments) {
- for (guint i = 0; i < n_comments; i++) {
+ for (unsigned i = 0; i < n_comments; i++) {
wtap_block_remove_nth_option_instance(pkt_block, OPT_COMMENT, 0);
}
cf_set_modified_block(cap_file_, fdata, pkt_block);
@@ -557,7 +556,7 @@ int PacketListModel::sort_column_is_numeric_;
int PacketListModel::text_sort_column_;
Qt::SortOrder PacketListModel::sort_order_;
capture_file *PacketListModel::sort_cap_file_;
-gboolean PacketListModel::stop_flag_;
+bool PacketListModel::stop_flag_;
ProgressFrame *PacketListModel::progress_frame_;
double PacketListModel::comps_;
double PacketListModel::exp_comps_;
@@ -579,7 +578,7 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
QString col_title = get_column_title(column);
- if (text_sort_column_ >= 0 && (guint)visible_rows_.count() > prefs.gui_packet_list_cached_rows_max) {
+ if (text_sort_column_ >= 0 && (unsigned)visible_rows_.count() > prefs.gui_packet_list_cached_rows_max) {
/* Column not based on frame data but by column text that requires
* dissection, so to sort in a reasonable amount of time the column
* text needs to be cached.
@@ -614,7 +613,7 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
*/
return;
}
- sort_cap_file_->read_lock = TRUE;
+ sort_cap_file_->read_lock = true;
QString busy_msg;
if (!col_title.isEmpty()) {
@@ -622,7 +621,7 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
} else {
busy_msg = tr("Sorting …");
}
- stop_flag_ = FALSE;
+ stop_flag_ = false;
comps_ = 0;
/* XXX: The expected number of comparisons is O(N log N), but this could
* be a pretty significant overestimate of the amount of time it takes,
@@ -672,7 +671,7 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
disconnect(progress_frame_, &ProgressFrame::stopLoading,
this, &PacketListModel::stopSorting);
}
- sort_cap_file_->read_lock = FALSE;
+ sort_cap_file_->read_lock = false;
if (cap_file_->current_frame) {
emit goToPacket(cap_file_->current_frame->num);
@@ -681,11 +680,14 @@ void PacketListModel::sort(int column, Qt::SortOrder order)
void PacketListModel::stopSorting()
{
- stop_flag_ = TRUE;
+ stop_flag_ = true;
}
bool PacketListModel::isNumericColumn(int column)
{
+ /* XXX - Should this and ui/packet_list_utils.c right_justify_column()
+ * be the same list of columns?
+ */
if (column < 0) {
return false;
}
@@ -720,10 +722,19 @@ bool PacketListModel::isNumericColumn(int column)
return false;
}
- guint num_fields = g_slist_length(sort_cap_file_->cinfo.columns[column].col_custom_fields_ids);
- for (guint i = 0; i < num_fields; i++) {
- guint *field_idx = (guint *) g_slist_nth_data(sort_cap_file_->cinfo.columns[column].col_custom_fields_ids, i);
- header_field_info *hfi = proto_registrar_get_nth(*field_idx);
+ unsigned num_fields = g_slist_length(sort_cap_file_->cinfo.columns[column].col_custom_fields_ids);
+ col_custom_t *col_custom;
+ for (unsigned i = 0; i < num_fields; i++) {
+ col_custom = (col_custom_t *) g_slist_nth_data(sort_cap_file_->cinfo.columns[column].col_custom_fields_ids, i);
+ if (col_custom->field_id == 0) {
+ /* XXX - We need some way to check the compiled dfilter's expected
+ * return type. Best would be to use the actual field values return
+ * and sort on those (we could skip expensive string conversions
+ * in the numeric case, see below)
+ */
+ return false;
+ }
+ header_field_info *hfi = proto_registrar_get_nth(col_custom->field_id);
/*
* Reject a field when there is no numeric field type or when:
@@ -824,7 +835,7 @@ double PacketListModel::parseNumericColumn(const QString &val, bool *ok)
{
QByteArray ba = val.toUtf8();
const char *strval = ba.constData();
- gchar *end = NULL;
+ char *end = NULL;
double num = g_ascii_strtod(strval, &end);
*ok = strval != end;
return num;
@@ -871,13 +882,10 @@ QVariant PacketListModel::data(const QModelIndex &d_index, int role) const
switch(recent_get_column_xalign(d_index.column())) {
case COLUMN_XALIGN_RIGHT:
return Qt::AlignRight;
- break;
case COLUMN_XALIGN_CENTER:
return Qt::AlignCenter;
- break;
case COLUMN_XALIGN_LEFT:
return Qt::AlignLeft;
- break;
case COLUMN_XALIGN_DEFAULT:
default:
if (right_justify_column(d_index.column(), cap_file_)) {
@@ -995,6 +1003,12 @@ void PacketListModel::dissectIdle(bool reset)
idle_dissection_timer_->restart();
+ if (!cap_file_ || cap_file_->read_lock) {
+ // File is in use (at worst, being rescanned). Try again later.
+ QTimer::singleShot(idle_dissection_interval_, this, [=]() { dissectIdle(); });
+ return;
+ }
+
int first = idle_dissection_row_;
while (idle_dissection_timer_->elapsed() < idle_dissection_interval_
&& idle_dissection_row_ < physical_rows_.count()) {
@@ -1015,7 +1029,7 @@ void PacketListModel::dissectIdle(bool reset)
// XXX Pass in cinfo from packet_list_append so that we can fill in
// line counts?
-gint PacketListModel::appendPacket(frame_data *fdata)
+int PacketListModel::appendPacket(frame_data *fdata)
{
PacketListRecord *record = new PacketListRecord(fdata);
qsizetype pos = -1;
@@ -1038,17 +1052,19 @@ gint PacketListModel::appendPacket(frame_data *fdata)
pos = static_cast<int>( visible_rows_.count() + new_visible_rows_.count() ) - 1;
}
- return static_cast<gint>(pos);
+ emit packetAppended(cap_file_, fdata, physical_rows_.size() - 1);
+
+ return static_cast<int>(pos);
}
-frame_data *PacketListModel::getRowFdata(QModelIndex idx)
+frame_data *PacketListModel::getRowFdata(QModelIndex idx) const
{
if (!idx.isValid())
return Q_NULLPTR;
return getRowFdata(idx.row());
}
-frame_data *PacketListModel::getRowFdata(int row) {
+frame_data *PacketListModel::getRowFdata(int row) const {
if (row < 0 || row >= visible_rows_.count())
return NULL;
PacketListRecord *record = visible_rows_[row];
@@ -1071,13 +1087,8 @@ void PacketListModel::ensureRowColorized(int row)
int PacketListModel::visibleIndexOf(frame_data *fdata) const
{
- int row = 0;
- foreach (PacketListRecord *record, visible_rows_) {
- if (record->frameData() == fdata) {
- return row;
- }
- row++;
+ if (fdata == nullptr) {
+ return -1;
}
-
- return -1;
+ return packetNumberToRow(fdata->num);
}
diff --git a/ui/qt/models/packet_list_model.h b/ui/qt/models/packet_list_model.h
index 807d8847..c4a4acf4 100644
--- a/ui/qt/models/packet_list_model.h
+++ b/ui/qt/models/packet_list_model.h
@@ -14,8 +14,6 @@
#include <stdio.h>
-#include <glib.h>
-
#include <epan/packet.h>
#include <QAbstractItemModel>
@@ -46,7 +44,7 @@ public:
const QModelIndex & = QModelIndex()) const;
QModelIndex parent(const QModelIndex &) const;
int packetNumberToRow(int packet_num) const;
- guint recreateVisibleRows();
+ unsigned recreateVisibleRows();
void clear();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
@@ -54,9 +52,9 @@ public:
QVariant data(const QModelIndex &d_index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
- gint appendPacket(frame_data *fdata);
- frame_data *getRowFdata(QModelIndex idx);
- frame_data *getRowFdata(int row);
+ int appendPacket(frame_data *fdata);
+ frame_data *getRowFdata(QModelIndex idx) const;
+ frame_data *getRowFdata(int row) const;
void ensureRowColorized(int row);
int visibleIndexOf(frame_data *fdata) const;
/**
@@ -69,19 +67,20 @@ public:
void resetColumns();
void resetColorized();
void toggleFrameMark(const QModelIndexList &indeces);
- void setDisplayedFrameMark(gboolean set);
+ void setDisplayedFrameMark(bool set);
void toggleFrameIgnore(const QModelIndexList &indeces);
- void setDisplayedFrameIgnore(gboolean set);
+ void setDisplayedFrameIgnore(bool set);
void toggleFrameRefTime(const QModelIndex &rt_index);
void unsetAllFrameRefTime();
void addFrameComment(const QModelIndexList &indices, const QByteArray &comment);
- void setFrameComment(const QModelIndex &index, const QByteArray &comment, guint c_number);
+ void setFrameComment(const QModelIndex &index, const QByteArray &comment, unsigned c_number);
void deleteFrameComments(const QModelIndexList &indices);
void deleteAllFrameComments();
void setMaximumRowHeight(int height);
signals:
+ void packetAppended(capture_file *cap_file, frame_data *fdata, qsizetype row);
void goToPacket(int);
void maxLineCountChanged(const QModelIndex &ih_index) const;
void itemHeightChanged(const QModelIndex &ih_index);
@@ -113,7 +112,7 @@ private:
static bool recordLessThan(PacketListRecord *r1, PacketListRecord *r2);
static double parseNumericColumn(const QString &val, bool *ok);
- static gboolean stop_flag_;
+ static bool stop_flag_;
static ProgressFrame *progress_frame_;
static double exp_comps_;
static double comps_;
diff --git a/ui/qt/models/packet_list_record.cpp b/ui/qt/models/packet_list_record.cpp
index 9c2c66d1..3cba64d5 100644
--- a/ui/qt/models/packet_list_record.cpp
+++ b/ui/qt/models/packet_list_record.cpp
@@ -24,7 +24,7 @@
#include <QStringList>
-QCache<guint32, QStringList> PacketListRecord::col_text_cache_(500);
+QCache<uint32_t, QStringList> PacketListRecord::col_text_cache_(500);
QMap<int, int> PacketListRecord::cinfo_column_;
unsigned PacketListRecord::rows_color_ver_ = 1;
@@ -112,7 +112,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_columns, boo
// packet_list_store.c:packet_list_dissect_and_cache_record
epan_dissect_t edt;
column_info *cinfo = NULL;
- gboolean create_proto_tree;
+ bool create_proto_tree;
wtap_rec rec; /* Record metadata */
Buffer buf; /* Record data */
@@ -144,7 +144,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_columns, boo
* error message.
*/
if (dissect_columns) {
- col_fill_in_error(cinfo, fdata_, FALSE, FALSE /* fill_fd_columns */);
+ col_fill_in_error(cinfo, fdata_, false, false /* fill_fd_columns */);
cacheColumnStrings(cinfo);
}
@@ -175,7 +175,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_columns, boo
epan_dissect_init(&edt, cap_file->epan,
create_proto_tree,
- FALSE /* proto_tree_visible */);
+ false /* proto_tree_visible */);
/* Re-color when the coloring rules are changed via the UI. */
if (dissect_color) {
@@ -195,7 +195,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_columns, boo
if (dissect_columns) {
/* "Stringify" non frame_data vals */
- epan_dissect_fill_in_columns(&edt, FALSE, FALSE /* fill_fd_columns */);
+ epan_dissect_fill_in_columns(&edt, false, false /* fill_fd_columns */);
cacheColumnStrings(cinfo);
}
@@ -204,7 +204,8 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_columns, boo
color_ver_ = rows_color_ver_;
}
- struct conversation * conv = find_conversation_pinfo(&edt.pi, 0);
+ struct conversation * conv = find_conversation_pinfo_ro(&edt.pi, 0);
+
conv_index_ = ! conv ? 0 : conv->conv_index;
epan_dissect_cleanup(&edt);
@@ -214,7 +215,7 @@ void PacketListRecord::dissect(capture_file *cap_file, bool dissect_columns, boo
void PacketListRecord::cacheColumnStrings(column_info *cinfo)
{
- // packet_list_store.c:packet_list_change_record(PacketList *packet_list, PacketListRecord *record, gint col, column_info *cinfo)
+ // packet_list_store.c:packet_list_change_record(PacketList *packet_list, PacketListRecord *record, int col, column_info *cinfo)
if (!cinfo) {
return;
}
@@ -230,7 +231,7 @@ void PacketListRecord::cacheColumnStrings(column_info *cinfo)
QString col_str;
int text_col = cinfo_column_.value(column, -1);
if (text_col < 0) {
- col_fill_in_frame_data(fdata_, cinfo, column, FALSE);
+ col_fill_in_frame_data(fdata_, cinfo, column, false);
}
col_str = QString(get_column_text(cinfo, column));
diff --git a/ui/qt/models/packet_list_record.h b/ui/qt/models/packet_list_record.h
index 47aa5621..7bb582fa 100644
--- a/ui/qt/models/packet_list_record.h
+++ b/ui/qt/models/packet_list_record.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include <epan/column.h>
@@ -60,7 +58,7 @@ public:
private:
/** The column text for some columns */
- static QCache<guint32, QStringList> col_text_cache_;
+ static QCache<uint32_t, QStringList> col_text_cache_;
frame_data *fdata_;
int lines_;
diff --git a/ui/qt/models/pref_delegate.cpp b/ui/qt/models/pref_delegate.cpp
index e33bb13f..313c17dc 100644
--- a/ui/qt/models/pref_delegate.cpp
+++ b/ui/qt/models/pref_delegate.cpp
@@ -66,7 +66,7 @@ void AdvancedPrefDelegate::setEditorData(QWidget *editor, const QModelIndex &ind
return;
}
- Q_ASSERT(FALSE);
+ Q_ASSERT(false);
}
void AdvancedPrefDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
@@ -81,5 +81,5 @@ void AdvancedPrefDelegate::setModelData(QWidget *editor, QAbstractItemModel *mod
return;
}
- Q_ASSERT(FALSE);
+ Q_ASSERT(false);
}
diff --git a/ui/qt/models/pref_models.cpp b/ui/qt/models/pref_models.cpp
index b86230f0..3480a8db 100644
--- a/ui/qt/models/pref_models.cpp
+++ b/ui/qt/models/pref_models.cpp
@@ -23,10 +23,10 @@
#include <QApplication>
// XXX Should we move this to ui/preference_utils?
-static GHashTable * pref_ptr_to_pref_ = NULL;
+static GHashTable * pref_ptr_to_pref_;
pref_t *prefFromPrefPtr(void *pref_ptr)
{
- return (pref_t *)g_hash_table_lookup(pref_ptr_to_pref_, (gpointer) pref_ptr);
+ return (pref_t *)g_hash_table_lookup(pref_ptr_to_pref_, (void *) pref_ptr);
}
static void prefInsertPrefPtr(void * pref_ptr, pref_t * pref)
@@ -34,8 +34,8 @@ static void prefInsertPrefPtr(void * pref_ptr, pref_t * pref)
if (! pref_ptr_to_pref_)
pref_ptr_to_pref_ = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL);
- gpointer key = (gpointer) pref_ptr;
- gpointer val = (gpointer) pref;
+ void *key = (void *) pref_ptr;
+ void *val = (void *) pref;
/* Already existing entries will be ignored */
if ((void *)g_hash_table_lookup(pref_ptr_to_pref_, key) == NULL)
@@ -47,6 +47,7 @@ PrefsItem::PrefsItem(module_t *module, pref_t *pref, PrefsItem* parent)
pref_(pref),
module_(module),
name_(module->name ? module->name : module->parent->name),
+ help_(QString()),
changed_(false)
{
if (pref_ != NULL) {
@@ -59,9 +60,19 @@ PrefsItem::PrefsItem(const QString name, PrefsItem* parent)
pref_(NULL),
module_(NULL),
name_(name),
+ help_(QString()),
changed_(false)
{
+}
+PrefsItem::PrefsItem(PrefsModel::PrefsModelType type, PrefsItem* parent)
+ : ModelHelperTreeItem<PrefsItem>(parent),
+ pref_(NULL),
+ module_(NULL),
+ name_(PrefsModel::typeToString(type)),
+ help_(PrefsModel::typeToHelp(type)),
+ changed_(false)
+{
}
PrefsItem::~PrefsItem()
@@ -113,6 +124,20 @@ QString PrefsItem::getModuleTitle() const
return QString(module_->title);
}
+QString PrefsItem::getModuleHelp() const
+{
+ if (module_ == nullptr)
+ return help_;
+
+ module_t *pref_module = module_;
+
+ while (pref_module->help == nullptr && pref_module->parent) {
+ pref_module = pref_module->parent;
+ }
+
+ return pref_module->help;
+}
+
void PrefsItem::setChanged(bool changed)
{
changed_ = changed;
@@ -232,8 +257,8 @@ QVariant PrefsModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-static guint
-fill_prefs(module_t *module, gpointer root_ptr)
+static unsigned
+fill_prefs(module_t *module, void *root_ptr)
{
PrefsItem* root_item = static_cast<PrefsItem*>(root_ptr);
@@ -275,32 +300,32 @@ fill_prefs(module_t *module, gpointer root_ptr)
void PrefsModel::populate()
{
- prefs_modules_foreach_submodules(NULL, fill_prefs, (gpointer)root_);
+ prefs_modules_foreach_submodules(NULL, fill_prefs, (void *)root_);
//Add the "specially handled" preferences
PrefsItem *appearance_item, *appearance_subitem, *special_item;
- appearance_item = new PrefsItem(typeToString(PrefsModel::Appearance), root_);
+ appearance_item = new PrefsItem(PrefsModel::Appearance, root_);
root_->prependChild(appearance_item);
- appearance_subitem = new PrefsItem(typeToString(PrefsModel::Layout), appearance_item);
+ appearance_subitem = new PrefsItem(PrefsModel::Layout, appearance_item);
appearance_item->prependChild(appearance_subitem);
- appearance_subitem = new PrefsItem(typeToString(PrefsModel::Columns), appearance_item);
+ appearance_subitem = new PrefsItem(PrefsModel::Columns, appearance_item);
appearance_item->prependChild(appearance_subitem);
- appearance_subitem = new PrefsItem(typeToString(PrefsModel::FontAndColors), appearance_item);
+ appearance_subitem = new PrefsItem(PrefsModel::FontAndColors, appearance_item);
appearance_item->prependChild(appearance_subitem);
- special_item = new PrefsItem(typeToString(PrefsModel::Capture), root_);
+ special_item = new PrefsItem(PrefsModel::Capture, root_);
root_->prependChild(special_item);
- special_item = new PrefsItem(typeToString(PrefsModel::Expert), root_);
+ special_item = new PrefsItem(PrefsModel::Expert, root_);
root_->prependChild(special_item);
- special_item = new PrefsItem(typeToString(PrefsModel::FilterButtons), root_);
+ special_item = new PrefsItem(PrefsModel::FilterButtons, root_);
root_->prependChild(special_item);
#ifdef HAVE_LIBGNUTLS
- special_item = new PrefsItem(typeToString(PrefsModel::RSAKeys), root_);
+ special_item = new PrefsItem(PrefsModel::RSAKeys, root_);
root_->prependChild(special_item);
#endif
- special_item = new PrefsItem(typeToString(PrefsModel::Advanced), root_);
+ special_item = new PrefsItem(PrefsModel::Advanced, root_);
root_->prependChild(special_item);
}
@@ -324,6 +349,44 @@ QString PrefsModel::typeToString(int type)
return typeStr;
}
+QString PrefsModel::typeToHelp(int type)
+{
+ QString helpStr;
+
+ switch(type)
+ {
+ case Appearance:
+ helpStr = QString("ChCustPreferencesSection.html#_appearance");
+ break;
+ case Columns:
+ helpStr = QString("ChCustPreferencesSection.html#_columns");
+ break;
+ case FontAndColors:
+ helpStr = QString("ChCustPreferencesSection.html#_font_and_colors");
+ break;
+ case Layout:
+ helpStr = QString("ChCustPreferencesSection.html#_layout");
+ break;
+ case Capture:
+ helpStr = QString("ChCustPreferencesSection.html#_capture");
+ break;
+ case Expert:
+ helpStr = QString("ChCustPreferencesSection.html#ChCustPrefsExpertSection");
+ break;
+ case FilterButtons:
+ helpStr = QString("ChCustPreferencesSection.html#ChCustFilterButtons");
+ break;
+ case RSAKeys:
+ helpStr = QString("ChCustPreferencesSection.html#ChCustPrefsRSASection");
+ break;
+ case Advanced:
+ helpStr = QString("ChCustPreferencesSection.html#_advanced");
+ break;
+ }
+
+ return helpStr;
+}
+
AdvancedPrefsModel::AdvancedPrefsModel(QObject * parent)
: QSortFilterProxyModel(parent),
filter_(),
@@ -470,11 +533,10 @@ bool AdvancedPrefsModel::setData(const QModelIndex &dataindex, const QVariant &v
item->setChanged(true);
switch (item->getPrefType())
{
- case PREF_DECODE_AS_UINT:
case PREF_UINT:
{
bool ok;
- guint new_val = value.toString().toUInt(&ok, prefs_get_uint_base(item->getPref()));
+ unsigned new_val = value.toString().toUInt(&ok, prefs_get_uint_base(item->getPref()));
if (ok)
prefs_set_uint_value(item->getPref(), new_val, pref_stashed);
@@ -487,6 +549,7 @@ bool AdvancedPrefsModel::setData(const QModelIndex &dataindex, const QVariant &v
prefs_set_enum_value(item->getPref(), value.toInt(), pref_stashed);
break;
case PREF_STRING:
+ case PREF_DISSECTOR:
prefs_set_string_value(item->getPref(), value.toString().toStdString().c_str(), pref_stashed);
break;
case PREF_PASSWORD:
@@ -543,7 +606,7 @@ Qt::ItemFlags AdvancedPrefsModel::flags(const QModelIndex &index) const
Qt::ItemFlags flags = QAbstractItemModel::flags(index);
if (item->getPref() == NULL) {
- /* Base modules aren't changable */
+ /* Base modules aren't changeable */
flags &= ~(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
} else {
flags |= Qt::ItemIsEditable;
@@ -683,6 +746,8 @@ QVariant ModulePrefsModel::data(const QModelIndex &dataindex, int role) const
return sourceModel()->data(modelIndex, role);
case ModuleName:
return item->getModuleName();
+ case ModuleHelp:
+ return item->getModuleHelp();
default:
break;
}
diff --git a/ui/qt/models/pref_models.h b/ui/qt/models/pref_models.h
index 775da0d0..601c7623 100644
--- a/ui/qt/models/pref_models.h
+++ b/ui/qt/models/pref_models.h
@@ -19,32 +19,7 @@
#include <QSortFilterProxyModel>
#include <QTreeView>
-class PrefsItem : public ModelHelperTreeItem<PrefsItem>
-{
-public:
- PrefsItem(module_t *module, pref_t *pref, PrefsItem* parent);
- PrefsItem(const QString name, PrefsItem* parent);
- virtual ~PrefsItem();
-
- QString getName() const {return name_;}
- pref_t* getPref() const {return pref_;}
- int getPrefType() const;
- bool isPrefDefault() const;
- QString getPrefTypeName() const;
- module_t* getModule() const {return module_;}
- QString getModuleName() const;
- QString getModuleTitle() const;
- void setChanged(bool changed = true);
-
-private:
- pref_t *pref_;
- module_t *module_;
- QString name_;
- //set to true if changed during module manipulation
- //Used to determine proper "default" for comparison
- bool changed_;
-};
-
+class PrefsItem;
class PrefsModel : public QAbstractItemModel
{
@@ -83,6 +58,7 @@ public:
int columnCount(const QModelIndex &parent = QModelIndex()) const;
static QString typeToString(int type);
+ static QString typeToHelp(int type);
private:
void populate();
@@ -90,6 +66,35 @@ private:
PrefsItem* root_;
};
+class PrefsItem : public ModelHelperTreeItem<PrefsItem>
+{
+public:
+ PrefsItem(module_t *module, pref_t *pref, PrefsItem* parent);
+ PrefsItem(const QString name, PrefsItem* parent);
+ PrefsItem(PrefsModel::PrefsModelType type, PrefsItem* parent);
+ virtual ~PrefsItem();
+
+ QString getName() const {return name_;}
+ pref_t* getPref() const {return pref_;}
+ int getPrefType() const;
+ bool isPrefDefault() const;
+ QString getPrefTypeName() const;
+ module_t* getModule() const {return module_;}
+ QString getModuleName() const;
+ QString getModuleTitle() const;
+ QString getModuleHelp() const;
+ void setChanged(bool changed = true);
+
+private:
+ pref_t *pref_;
+ module_t *module_;
+ QString name_;
+ QString help_;
+ //set to true if changed during module manipulation
+ //Used to determine proper "default" for comparison
+ bool changed_;
+};
+
class AdvancedPrefsModel : public QSortFilterProxyModel
{
Q_OBJECT
@@ -143,7 +148,8 @@ public:
};
enum ModulePrefsRoles {
- ModuleName = Qt::UserRole + 1
+ ModuleName = Qt::UserRole + 1,
+ ModuleHelp = Qt::UserRole + 2
};
QVariant data(const QModelIndex &index, int role) const;
diff --git a/ui/qt/models/profile_model.cpp b/ui/qt/models/profile_model.cpp
index 206ef389..ecbcef6b 100644
--- a/ui/qt/models/profile_model.cpp
+++ b/ui/qt/models/profile_model.cpp
@@ -11,12 +11,13 @@
#include <errno.h>
-#include "glib.h"
#include "ui/profile.h"
#include "ui/recent.h"
-#include "wsutil/filesystem.h"
#include "epan/prefs.h"
+#include "wsutil/filesystem.h"
+#include "wsutil/utf8_entities.h"
+
#include <ui/qt/models/profile_model.h>
#include <ui/qt/utils/color_utils.h>
@@ -276,6 +277,14 @@ QVariant ProfileModel::dataDisplay(const QModelIndex &index) const
return tr("Global");
else
return tr("Personal");
+ case COL_AUTO_SWITCH_FILTER:
+ {
+ if (prof->is_global) {
+ return QString(UTF8_EM_DASH);
+ }
+ return (QString(prof->auto_switch_filter));
+ }
+
default:
break;
}
@@ -426,7 +435,7 @@ QVariant ProfileModel::dataBackgroundRole(const QModelIndex &index) const
if (prof->status != PROF_STAT_DEFAULT && ! prof->is_global)
{
- /* Highlights errorneous line */
+ /* Highlights erroneous line */
if (checkInvalid(index) || checkIfDeleted(index) || checkDuplicate(index) || ! checkNameValidity(prof->name))
return ColorUtils::fromColorT(&prefs.gui_text_invalid);
@@ -438,6 +447,23 @@ QVariant ProfileModel::dataBackgroundRole(const QModelIndex &index) const
return QVariant();
}
+QVariant ProfileModel::dataForegroundRole(const QModelIndex &index) const
+{
+ if (! index.isValid() || profiles_.count() <= index.row())
+ return QVariant();
+
+ profile_def * prof = guard(index.row());
+ if (! prof) {
+ return QVariant();
+ }
+
+ if (prof->is_global && index.column() == COL_AUTO_SWITCH_FILTER) {
+ return ColorUtils::disabledForeground();
+ }
+
+ return QVariant();
+}
+
QVariant ProfileModel::dataToolTipRole(const QModelIndex &idx) const
{
if (! idx.isValid() || profiles_.count() <= idx.row())
@@ -492,7 +518,7 @@ QVariant ProfileModel::dataPath(const QModelIndex &index) const
{
case PROF_STAT_DEFAULT:
if (!reset_default_)
- return gchar_free_to_qstring(get_persconffile_path("", FALSE));
+ return gchar_free_to_qstring(get_persconffile_path("", false));
else
return tr("Resetting to default");
case PROF_STAT_EXISTS:
@@ -537,7 +563,7 @@ QVariant ProfileModel::dataPath(const QModelIndex &index) const
QString appendix;
/* A global profile is neither deleted or removed, only system provided is allowed as appendix */
- if (profile_exists(prof->reference, TRUE) && prof->from_global)
+ if (profile_exists(prof->reference, true) && prof->from_global)
appendix = tr("system provided");
/* A default model as reference can neither be deleted or renamed, so skip if the reference was one */
else if (! index.data(ProfileModel::DATA_IS_DEFAULT).toBool())
@@ -588,6 +614,8 @@ QVariant ProfileModel::data(const QModelIndex &index, int role) const
return dataFontRole(index);
case Qt::BackgroundRole:
return dataBackgroundRole(index);
+ case Qt::ForegroundRole:
+ return dataForegroundRole(index);
case Qt::ToolTipRole:
return dataToolTipRole(index);
case ProfileModel::DATA_STATUS:
@@ -612,10 +640,6 @@ QVariant ProfileModel::data(const QModelIndex &index, int role) const
}
case ProfileModel::DATA_PATH:
return dataPath(index);
- case ProfileModel::DATA_INDEX_VALUE_IS_URL:
- if (index.column() <= ProfileModel::COL_TYPE)
- return QVariant::fromValue(false);
- return QVariant::fromValue(true);
case ProfileModel::DATA_PATH_IS_NOT_DESCRIPTION:
if (prof->status == PROF_STAT_NEW || prof->status == PROF_STAT_COPY
|| (prof->status == PROF_STAT_DEFAULT && reset_default_)
@@ -641,6 +665,8 @@ QVariant ProfileModel::headerData(int section, Qt::Orientation orientation, int
return tr("Profile");
case COL_TYPE:
return tr("Type");
+ case COL_AUTO_SWITCH_FILTER:
+ return tr("Auto Switch Filter");
default:
break;
}
@@ -654,11 +680,18 @@ Qt::ItemFlags ProfileModel::flags(const QModelIndex &index) const
Qt::ItemFlags fl = QAbstractTableModel::flags(index);
profile_def * prof = guard(index);
- if (! prof)
+ if (! prof) {
return fl;
+ }
- if (index.column() == ProfileModel::COL_NAME && prof->status != PROF_STAT_DEFAULT && ! prof->is_global)
+ if (prof->is_global) {
+ return fl;
+ }
+
+ if ((index.column() == ProfileModel::COL_NAME && prof->status != PROF_STAT_DEFAULT)
+ || (index.column() == ProfileModel::COL_AUTO_SWITCH_FILTER)) {
fl |= Qt::ItemIsEditable;
+ }
return fl;
}
@@ -722,7 +755,7 @@ QModelIndex ProfileModel::addNewProfile(QString name)
cnt++;
}
- add_to_profile_list(newName.toUtf8().constData(), newName.toUtf8().constData(), PROF_STAT_NEW, FALSE, FALSE, FALSE);
+ add_to_profile_list(newName.toUtf8().constData(), newName.toUtf8().constData(), PROF_STAT_NEW, false, false, false);
loadProfiles();
return index(findByName(newName), COL_NAME);
@@ -794,7 +827,7 @@ QModelIndex ProfileModel::duplicateEntry(QModelIndex idx, int new_status)
new_status = PROF_STAT_NEW;
/* add element */
- add_to_profile_list(new_name.toUtf8().constData(), parent.toUtf8().constData(), new_status, FALSE, prof->from_global ? prof->from_global : prof->is_global, FALSE);
+ add_to_profile_list(new_name.toUtf8().constData(), parent.toUtf8().constData(), new_status, false, prof->from_global ? prof->from_global : prof->is_global, false);
/* reload profile list in model */
loadProfiles();
@@ -901,27 +934,41 @@ bool ProfileModel::setData(const QModelIndex &idx, const QVariant &value, int ro
{
last_set_row_ = -1;
- if (role != Qt::EditRole || ! value.isValid() || value.toString().isEmpty())
+ if (role != Qt::EditRole || !value.isValid()) {
return false;
+ }
+
+ if (idx.column() == COL_NAME && value.toString().isEmpty()) {
+ return false;
+ }
QString newValue = value.toString();
profile_def * prof = guard(idx);
- if (! prof || prof->status == PROF_STAT_DEFAULT)
+
+ if (!prof) {
return false;
+ }
last_set_row_ = idx.row();
- QString current(prof->name);
- if (current.compare(newValue) != 0)
- {
- g_free(prof->name);
- prof->name = qstring_strdup(newValue);
+ if (idx.column() == COL_NAME && prof->status != PROF_STAT_DEFAULT) {
+ QString current(prof->name);
+ if (current.compare(newValue) != 0)
+ {
+ g_free(prof->name);
+ prof->name = qstring_strdup(newValue);
- if (prof->reference && g_strcmp0(prof->name, prof->reference) == 0 && ! (prof->status == PROF_STAT_NEW || prof->status == PROF_STAT_COPY)) {
- prof->status = PROF_STAT_EXISTS;
- } else if (prof->status == PROF_STAT_EXISTS) {
- prof->status = PROF_STAT_CHANGED;
+ if (prof->reference && g_strcmp0(prof->name, prof->reference) == 0 && ! (prof->status == PROF_STAT_NEW || prof->status == PROF_STAT_COPY)) {
+ prof->status = PROF_STAT_EXISTS;
+ } else if (prof->status == PROF_STAT_EXISTS) {
+ prof->status = PROF_STAT_CHANGED;
+ }
+ emit itemChanged(idx);
}
+ } else if (idx.column() == COL_AUTO_SWITCH_FILTER) {
+ g_free(prof->auto_switch_filter);
+ prof->auto_switch_filter = qstring_strdup(newValue);
+ prof->prefs_changed = true;
emit itemChanged(idx);
}
@@ -1033,7 +1080,7 @@ QFileInfoList ProfileModel::filterProfilePath(QString path, QFileInfoList ent, b
return result;
}
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
QStringList ProfileModel::exportFileList(QModelIndexList items)
{
QStringList result;
@@ -1163,7 +1210,7 @@ int ProfileModel::importProfilesFromDir(QString dirname, int * skippedCnt, bool
if (success)
{
count++;
- add_to_profile_list(fentry.fileName().toUtf8().constData(), fentry.fileName().toUtf8().constData(), PROF_STAT_NEW, FALSE, FALSE, TRUE);
+ add_to_profile_list(fentry.fileName().toUtf8().constData(), fentry.fileName().toUtf8().constData(), PROF_STAT_NEW, false, false, true);
}
else if (! wasEmpty && QFile::exists(profilePath))
{
diff --git a/ui/qt/models/profile_model.h b/ui/qt/models/profile_model.h
index 16febd70..ff054752 100644
--- a/ui/qt/models/profile_model.h
+++ b/ui/qt/models/profile_model.h
@@ -11,7 +11,6 @@
#define PROFILE_MODEL_H
#include "config.h"
-#include "glib.h"
#include <ui/profile.h>
@@ -59,6 +58,7 @@ public:
enum {
COL_NAME,
COL_TYPE,
+ COL_AUTO_SWITCH_FILTER,
_LAST_ENTRY
} columns_;
@@ -69,7 +69,6 @@ public:
DATA_IS_SELECTED,
DATA_PATH,
DATA_PATH_IS_NOT_DESCRIPTION,
- DATA_INDEX_VALUE_IS_URL
} data_values_;
// QAbstractItemModel interface
@@ -101,7 +100,7 @@ public:
bool userProfilesExist() const;
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
bool exportProfiles(QString filename, QModelIndexList items, QString * err = Q_NULLPTR);
int importProfilesFromZip(QString filename, int *skippedCnt = Q_NULLPTR, QStringList *result = Q_NULLPTR);
#endif
@@ -142,7 +141,7 @@ private:
int findByNameAndVisibility(QString name, bool isGlobal = false, bool searchReference = false) const;
int findAsReference(QString reference) const;
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
static bool acceptFile(QString fileName, int fileSize);
static QString cleanName(QString fileName);
#endif
@@ -150,10 +149,11 @@ private:
QVariant dataDisplay(const QModelIndex & idx) const;
QVariant dataFontRole(const QModelIndex & idx) const;
QVariant dataBackgroundRole(const QModelIndex & idx) const;
+ QVariant dataForegroundRole(const QModelIndex & idx) const;
QVariant dataToolTipRole(const QModelIndex & idx) const;
QVariant dataPath(const QModelIndex & idx) const;
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
QStringList exportFileList(QModelIndexList items);
#endif
bool copyTempToProfile(QString tempPath, QString profilePath, bool *wasEmpty = Q_NULLPTR);
diff --git a/ui/qt/models/proto_tree_model.cpp b/ui/qt/models/proto_tree_model.cpp
index 3ededffd..fe6f7f95 100644
--- a/ui/qt/models/proto_tree_model.cpp
+++ b/ui/qt/models/proto_tree_model.cpp
@@ -188,7 +188,8 @@ struct find_hfid_ {
ProtoNode *node;
};
-bool ProtoTreeModel::foreachFindHfid(ProtoNode *node, gpointer find_hfid_ptr)
+// NOLINTNEXTLINE(misc-no-recursion)
+bool ProtoTreeModel::foreachFindHfid(ProtoNode *node, void *find_hfid_ptr)
{
struct find_hfid_ *find_hfid = (struct find_hfid_ *) find_hfid_ptr;
if (PNODE_FINFO(node->protoNode()) && PNODE_FINFO(node->protoNode())->hfinfo->id == find_hfid->hfid) {
@@ -196,6 +197,7 @@ bool ProtoTreeModel::foreachFindHfid(ProtoNode *node, gpointer find_hfid_ptr)
return true;
}
for (int i = 0; i < node->childrenCount(); i++) {
+ // We recurse here, but we're limited by tree depth checks in epan
if (foreachFindHfid(node->child(i), find_hfid)) {
return true;
}
@@ -221,7 +223,8 @@ struct find_field_info_ {
ProtoNode *node;
};
-bool ProtoTreeModel::foreachFindField(ProtoNode *node, gpointer find_finfo_ptr)
+// NOLINTNEXTLINE(misc-no-recursion)
+bool ProtoTreeModel::foreachFindField(ProtoNode *node, void *find_finfo_ptr)
{
struct find_field_info_ *find_finfo = (struct find_field_info_ *) find_finfo_ptr;
if (PNODE_FINFO(node->protoNode()) == find_finfo->fi) {
@@ -229,6 +232,7 @@ bool ProtoTreeModel::foreachFindField(ProtoNode *node, gpointer find_finfo_ptr)
return true;
}
for (int i = 0; i < node->childrenCount(); i++) {
+ // We recurse here, but we're limited by tree depth checks in epan
if (foreachFindField(node->child(i), find_finfo)) {
return true;
}
diff --git a/ui/qt/models/proto_tree_model.h b/ui/qt/models/proto_tree_model.h
index df7cbba8..12d08fc0 100644
--- a/ui/qt/models/proto_tree_model.h
+++ b/ui/qt/models/proto_tree_model.h
@@ -41,8 +41,8 @@ public:
private:
ProtoNode *root_node_;
- static bool foreachFindHfid(ProtoNode *node, gpointer find_hfid_ptr);
- static bool foreachFindField(ProtoNode *node, gpointer find_finfo_ptr);
+ static bool foreachFindHfid(ProtoNode *node, void *find_hfid_ptr);
+ static bool foreachFindField(ProtoNode *node, void *find_finfo_ptr);
};
#endif // PROTO_TREE_MODEL_H
diff --git a/ui/qt/models/related_packet_delegate.cpp b/ui/qt/models/related_packet_delegate.cpp
index 885160f4..bb001adc 100644
--- a/ui/qt/models/related_packet_delegate.cpp
+++ b/ui/qt/models/related_packet_delegate.cpp
@@ -73,7 +73,7 @@ void RelatedPacketDelegate::paint(QPainter *painter, const QStyleOptionViewItem
option_vi.decorationSize.setWidth(em_w);
QStyledItemDelegate::paint(painter, option_vi, index);
- guint32 setup_frame = 0, last_frame = 0;
+ uint32_t setup_frame = 0, last_frame = 0;
if (conv_) {
setup_frame = (int) conv_->setup_frame;
last_frame = (int) conv_->last_frame;
@@ -339,7 +339,7 @@ void RelatedPacketDelegate::clear()
conv_ = NULL;
}
-void RelatedPacketDelegate::setCurrentFrame(guint32 current_frame)
+void RelatedPacketDelegate::setCurrentFrame(uint32_t current_frame)
{
current_frame_ = current_frame;
foreach (ft_framenum_type_t framenum_type, related_frames_) {
diff --git a/ui/qt/models/related_packet_delegate.h b/ui/qt/models/related_packet_delegate.h
index 927129a0..68250119 100644
--- a/ui/qt/models/related_packet_delegate.h
+++ b/ui/qt/models/related_packet_delegate.h
@@ -26,7 +26,7 @@ class RelatedPacketDelegate : public QStyledItemDelegate
public:
RelatedPacketDelegate(QWidget *parent = 0);
void clear();
- void setCurrentFrame(guint32 current_frame);
+ void setCurrentFrame(uint32_t current_frame);
void setConversation(struct conversation *conv);
public slots:
@@ -41,7 +41,7 @@ protected:
private:
QHash<int, ft_framenum_type_t> related_frames_;
struct conversation *conv_;
- guint32 current_frame_;
+ uint32_t current_frame_;
void drawArrow(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const;
void drawChevrons(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const;
diff --git a/ui/qt/models/resolved_addresses_models.cpp b/ui/qt/models/resolved_addresses_models.cpp
index 48dd2f09..25557771 100644
--- a/ui/qt/models/resolved_addresses_models.cpp
+++ b/ui/qt/models/resolved_addresses_models.cpp
@@ -9,8 +9,6 @@
#include <ui/qt/models/resolved_addresses_models.h>
-#include <glib.h>
-
#include "file.h"
#include "epan/addr_resolv.h"
@@ -20,11 +18,11 @@ extern "C"
{
static void
-serv_port_hash_to_qstringlist(gpointer key, gpointer value, gpointer member_ptr)
+serv_port_hash_to_qstringlist(void *key, void *value, void *member_ptr)
{
PortsModel *model = static_cast<PortsModel *>(member_ptr);
serv_port_t *serv_port = (serv_port_t *)value;
- guint port = GPOINTER_TO_UINT(key);
+ unsigned port = GPOINTER_TO_UINT(key);
if (serv_port->tcp_name) {
QStringList entries;
@@ -61,69 +59,73 @@ serv_port_hash_to_qstringlist(gpointer key, gpointer value, gpointer member_ptr)
}
static void
-ipv4_hash_table_resolved_to_list(gpointer, gpointer value, gpointer sl_ptr)
+ipv4_hash_table_resolved_to_list(void *, void *value, void *sl_ptr)
{
QList<QStringList> *hosts = (QList<QStringList> *) sl_ptr;
hashipv4_t *ipv4_hash_table_entry = (hashipv4_t *) value;
- if ((ipv4_hash_table_entry->flags & NAME_RESOLVED)) {
+ if ((ipv4_hash_table_entry->flags & (USED_AND_RESOLVED_MASK)) == USED_AND_RESOLVED_MASK) {
*hosts << (QStringList() << QString(ipv4_hash_table_entry->ip) << QString(ipv4_hash_table_entry->name));
}
}
static void
-ipv6_hash_table_resolved_to_list(gpointer, gpointer value, gpointer sl_ptr)
+ipv6_hash_table_resolved_to_list(void *, void *value, void *sl_ptr)
{
QList<QStringList> *hosts = (QList<QStringList> *) sl_ptr;
hashipv6_t *ipv6_hash_table_entry = (hashipv6_t *) value;
- if ((ipv6_hash_table_entry->flags & NAME_RESOLVED)) {
+ if ((ipv6_hash_table_entry->flags & USED_AND_RESOLVED_MASK) == USED_AND_RESOLVED_MASK) {
*hosts << (QStringList() << QString(ipv6_hash_table_entry->ip6) << QString(ipv6_hash_table_entry->name));
}
}
static void
-eth_hash_to_qstringlist(gpointer, gpointer value, gpointer sl_ptr)
+eth_hash_to_qstringlist(void *, void *value, void *sl_ptr)
{
QList<QStringList> *values = (QList<QStringList> *) sl_ptr;
hashether_t* tp = (hashether_t*)value;
- *values << (QStringList() << QString(get_hash_ether_hexaddr(tp)) << QString(get_hash_ether_resolved_name(tp)));
+ if (get_hash_ether_used(tp)) {
+ *values << (QStringList() << QString(get_hash_ether_hexaddr(tp)) << QString(get_hash_ether_resolved_name(tp)));
+ }
}
static void
-manuf_hash_to_qstringlist(gpointer key, gpointer value, gpointer sl_ptr)
+manuf_hash_to_qstringlist(void *key, void *value, void *sl_ptr)
{
QList<QStringList> *values = (QList<QStringList> *) sl_ptr;
hashmanuf_t *manuf = (hashmanuf_t*)value;
- guint eth_as_guint = GPOINTER_TO_UINT(key);
+ unsigned eth_as_uint = GPOINTER_TO_UINT(key);
- QString entry = QString("%1:%2:%3")
- .arg((eth_as_guint >> 16 & 0xff), 2, 16, QChar('0'))
- .arg((eth_as_guint >> 8 & 0xff), 2, 16, QChar('0'))
- .arg((eth_as_guint & 0xff), 2, 16, QChar('0'));
+ if (get_hash_manuf_used(manuf)) {
+ QString entry = QString("%1:%2:%3")
+ .arg((eth_as_uint >> 16 & 0xff), 2, 16, QChar('0'))
+ .arg((eth_as_uint >> 8 & 0xff), 2, 16, QChar('0'))
+ .arg((eth_as_uint & 0xff), 2, 16, QChar('0'));
- *values << (QStringList() << entry << QString(get_hash_manuf_resolved_name(manuf)));
+ *values << (QStringList() << entry << QString(get_hash_manuf_resolved_name(manuf)));
+ }
}
static void
-wka_hash_to_qstringlist(gpointer key, gpointer value, gpointer sl_ptr)
+wka_hash_to_qstringlist(void *key, void *value, void *sl_ptr)
{
QList<QStringList> *values = (QList<QStringList> *) sl_ptr;
- gchar *name = (gchar *)value;
- guint8 *eth_addr = (guint8*)key;
-
- QString entry = QString("%1:%2:%3:%4:%5:%6")
- .arg(eth_addr[0], 2, 16, QChar('0'))
- .arg(eth_addr[1], 2, 16, QChar('0'))
- .arg(eth_addr[2], 2, 16, QChar('0'))
- .arg(eth_addr[3], 2, 16, QChar('0'))
- .arg(eth_addr[4], 2, 16, QChar('0'))
- .arg(eth_addr[5], 2, 16, QChar('0'));
-
- // We should filter on only those actually resolved, not display
- // everything in wka
- *values << (QStringList() << entry << QString(name));
+ hashwka_t *wkahash = (hashwka_t *)value;
+ uint8_t *eth_addr = (uint8_t*)key;
+
+ if (get_hash_wka_used(wkahash)) {
+ QString entry = QString("%1:%2:%3:%4:%5:%6")
+ .arg(eth_addr[0], 2, 16, QChar('0'))
+ .arg(eth_addr[1], 2, 16, QChar('0'))
+ .arg(eth_addr[2], 2, 16, QChar('0'))
+ .arg(eth_addr[3], 2, 16, QChar('0'))
+ .arg(eth_addr[4], 2, 16, QChar('0'))
+ .arg(eth_addr[5], 2, 16, QChar('0'));
+
+ *values << (QStringList() << entry << QString(get_hash_wka_resolved_name(wkahash)));
+ }
}
}
diff --git a/ui/qt/models/resolved_addresses_models.h b/ui/qt/models/resolved_addresses_models.h
index 32ca1b15..9a26eb6d 100644
--- a/ui/qt/models/resolved_addresses_models.h
+++ b/ui/qt/models/resolved_addresses_models.h
@@ -30,6 +30,13 @@ protected:
};
+enum PortsModelColumns
+{
+ PORTS_COL_NAME,
+ PORTS_COL_PORT,
+ PORTS_COL_PROTOCOL
+};
+
class PortsModel : public AStringListListModel
{
Q_OBJECT
diff --git a/ui/qt/models/sparkline_delegate.cpp b/ui/qt/models/sparkline_delegate.cpp
index 457c8295..121d8226 100644
--- a/ui/qt/models/sparkline_delegate.cpp
+++ b/ui/qt/models/sparkline_delegate.cpp
@@ -20,7 +20,7 @@ void SparkLineDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
QList<int> points = qvariant_cast<QList<int> >(index.data(Qt::UserRole));
int max = 1;
// We typically draw a sparkline alongside some text. Size our
- // drawing area based on an Em width. and a bit of eyballing on
+ // drawing area based on an Em width. and a bit of eyeballing on
// Linux, macOS, and Windows.
int em_w = option.fontMetrics.height();
int content_w = option.rect.width() - (em_w / 4);
diff --git a/ui/qt/models/uat_delegate.h b/ui/qt/models/uat_delegate.h
index e57e533d..f9cfa92d 100644
--- a/ui/qt/models/uat_delegate.h
+++ b/ui/qt/models/uat_delegate.h
@@ -15,7 +15,6 @@
#define UAT_DELEGATE_H
#include <config.h>
-#include <glib.h>
#include <epan/uat-int.h>
#include <QStyledItemDelegate>
diff --git a/ui/qt/models/uat_model.cpp b/ui/qt/models/uat_model.cpp
index a841ca8c..24b4423c 100644
--- a/ui/qt/models/uat_model.cpp
+++ b/ui/qt/models/uat_model.cpp
@@ -12,12 +12,23 @@
#include "uat_model.h"
#include <epan/to_str.h>
+#include <ui/qt/utils/qt_ui_utils.h>
+#include <QFont>
#include <QBrush>
#include <QDebug>
+// XXX - The model accesses the uat_t raw data, but if the raw data
+// is changed outside the model, e.g. by another model on the same UAT
+// or by changing configuration profiles, record_errors and dirty_records
+// don't have the proper length, which leads to accessing an illegal list
+// index. The preference dialog and configuration profile dialogs are modal,
+// which reduces the chance of this, but the I/O Graphs using a UAT invites
+// issues.
+
UatModel::UatModel(QObject *parent, epan_uat *uat) :
QAbstractTableModel(parent),
- uat_(0)
+ uat_(0),
+ applying_(false)
{
loadUat(uat);
}
@@ -46,7 +57,14 @@ void UatModel::loadUat(epan_uat * uat)
void UatModel::reloadUat()
{
+ // Avoid unnecessarily resetting the model if we're just making
+ // what's on disk match what we have.
+ if (applying_)
+ return;
+
beginResetModel();
+ record_errors.clear();
+ dirty_records.clear();
loadUat(uat_);
endResetModel();
}
@@ -54,16 +72,22 @@ void UatModel::reloadUat()
bool UatModel::applyChanges(QString &error)
{
if (uat_->changed) {
- gchar *err = NULL;
+ char *err = NULL;
if (!uat_save(uat_, &err)) {
error = QString("Error while saving %1: %2").arg(uat_->name).arg(err);
g_free(err);
}
+ applying_ = true;
+ // XXX - Why does this need to call post_update_cb? post_update_cb
+ // is for when the uat_t is updated, e.g. after loading a file.
+ // Saving makes the information on disk match the table records in
+ // memory, but it shouldn't change the uat_t.
if (uat_->post_update_cb) {
uat_->post_update_cb();
}
+ applying_ = false;
return true;
}
@@ -76,7 +100,7 @@ bool UatModel::revertChanges(QString &error)
// to avoid calling post_update_cb. Calling uat_clear + uat_load is a lazy
// option and might fail (e.g. when the UAT file is removed).
if (uat_->changed) {
- gchar *err = NULL;
+ char *err = NULL;
uat_clear(uat_);
if (!uat_load(uat_, NULL, &err)) {
error = QString("Error while loading %1: %2").arg(uat_->name).arg(err);
@@ -90,17 +114,19 @@ bool UatModel::revertChanges(QString &error)
Qt::ItemFlags UatModel::flags(const QModelIndex &index) const
{
+ Qt::ItemFlags flags = QAbstractTableModel::flags(index);
+ flags |= Qt::ItemIsDropEnabled;
+
if (!index.isValid())
- return Qt::ItemFlags();
+ return flags;
uat_field_t *field = &uat_->fields[index.column()];
- Qt::ItemFlags flags = QAbstractTableModel::flags(index);
if (field->mode == PT_TXTMOD_BOOL)
{
flags |= Qt::ItemIsUserCheckable;
}
- flags |= Qt::ItemIsEditable;
+ flags |= Qt::ItemIsEditable | Qt::ItemIsDragEnabled;
return flags;
}
@@ -114,13 +140,13 @@ QVariant UatModel::data(const QModelIndex &index, int role) const
uat_field_t *field = &uat_->fields[index.column()];
if (role == Qt::DisplayRole || role == Qt::EditRole) {
char *str = NULL;
- guint length = 0;
+ unsigned length = 0;
field->cb.tostr(rec, &str, &length, field->cbdata.tostr, field->fld_data);
switch (field->mode) {
case PT_TXTMOD_HEXBYTES:
{
- char* temp_str = bytes_to_str(NULL, (const guint8 *) str, length);
+ char* temp_str = bytes_to_str(NULL, (const uint8_t *) str, length);
g_free(str);
QString qstr(temp_str);
wmem_free(NULL, temp_str);
@@ -128,24 +154,24 @@ QVariant UatModel::data(const QModelIndex &index, int role) const
}
case PT_TXTMOD_BOOL:
case PT_TXTMOD_COLOR:
+ g_free(str);
return QVariant();
default:
- {
- QString qstr(str);
- g_free(str);
- return qstr;
- }
+ return gchar_free_to_qstring(str);
}
}
if ((role == Qt::CheckStateRole) && (field->mode == PT_TXTMOD_BOOL))
{
char *str = NULL;
- guint length = 0;
+ unsigned length = 0;
enum Qt::CheckState state = Qt::Unchecked;
field->cb.tostr(rec, &str, &length, field->cbdata.tostr, field->fld_data);
- if ((g_strcmp0(str, "TRUE") == 0) ||
- (g_strcmp0(str, "Enabled") == 0))
+ // "Enabled" is for backwards compatibility with pre-UAT IO Graphs:
+ // (Commit 5b3e3ee58748ac1fd9201d2d3facbed1b9b1e800)
+ if (str &&
+ ((g_ascii_strcasecmp(str, "true") == 0) ||
+ (g_strcmp0(str, "Enabled") == 0)))
state = Qt::Checked;
g_free(str);
@@ -166,12 +192,21 @@ QVariant UatModel::data(const QModelIndex &index, int role) const
return QVariant();
}
+ if (role == Qt::FontRole) {
+ if (!g_array_index(uat_->valid_data, bool, index.row())) {
+ QFont font;
+ font.setItalic(!font.italic());
+ return font;
+ }
+ return QVariant();
+ }
+
if ((role == Qt::DecorationRole) && (field->mode == PT_TXTMOD_COLOR)) {
char *str = NULL;
- guint length = 0;
+ unsigned length = 0;
field->cb.tostr(rec, &str, &length, field->cbdata.tostr, field->fld_data);
- return QColor(QString(str));
+ return QColor(gchar_free_to_qstring(str));
}
// expose error message if any.
@@ -259,9 +294,9 @@ QModelIndex UatModel::appendEntry(QVariantList rowData)
data = rowData[col].toString();
} else {
if (rowData[col].toInt() == Qt::Checked) {
- data = QString("TRUE");
+ data = QString("true");
} else {
- data = QString("FALSE");
+ data = QString("false");
}
}
}
@@ -281,7 +316,7 @@ QModelIndex UatModel::appendEntry(QVariantList rowData)
// postponed until the row (in the view) is not selected anymore
checkRow(row);
dirty_records.insert(row, true);
- uat_->changed = TRUE;
+ uat_->changed = true;
emit endInsertRows();
@@ -316,9 +351,9 @@ bool UatModel::setData(const QModelIndex &index, const QVariant &value, int role
field->cb.set(rec, bytes.constData(), (unsigned) bytes.size(), field->cbdata.set, field->fld_data);
} else {
if (value.toInt() == Qt::Checked) {
- field->cb.set(rec, "TRUE", 4, field->cbdata.set, field->fld_data);
+ field->cb.set(rec, "true", 4, field->cbdata.set, field->fld_data);
} else {
- field->cb.set(rec, "FALSE", 5, field->cbdata.set, field->fld_data);
+ field->cb.set(rec, "false", 5, field->cbdata.set, field->fld_data);
}
}
@@ -348,7 +383,7 @@ bool UatModel::setData(const QModelIndex &index, const QVariant &value, int role
}
uat_update_record(uat_, rec, record_errors[row].isEmpty());
dirty_records[row] = true;
- uat_->changed = TRUE;
+ uat_->changed = true;
if (updated_cols.size() > updated_cols.count(index.column())) {
// The validation status for other columns were also affected by
@@ -388,21 +423,24 @@ bool UatModel::insertRows(int row, int count, const QModelIndex &/*parent*/)
// postponed until the row (in the view) is not selected anymore
checkRow(row);
dirty_records.insert(row, true);
- uat_->changed = TRUE;
+ uat_->changed = true;
endInsertRows();
return true;
}
bool UatModel::removeRows(int row, int count, const QModelIndex &/*parent*/)
{
- if (count != 1 || row < 0 || row >= rowCount())
+ if (row < 0 || count < 0 || row + count > rowCount())
return false;
- beginRemoveRows(QModelIndex(), row, row);
- uat_remove_record_idx(uat_, row);
- record_errors.removeAt(row);
- dirty_records.removeAt(row);
- uat_->changed = TRUE;
+ if (count == 0)
+ return true;
+
+ beginRemoveRows(QModelIndex(), row, row + count - 1);
+ uat_remove_record_range(uat_, row, count);
+ record_errors.remove(row, count);
+ dirty_records.remove(row, count);
+ uat_->changed = true;
endRemoveRows();
return true;
}
@@ -416,7 +454,7 @@ void UatModel::clearAll()
uat_clear(uat_);
record_errors.clear();
dirty_records.clear();
- uat_->changed = TRUE;
+ uat_->changed = true;
endResetModel();
}
@@ -448,7 +486,7 @@ QModelIndex UatModel::copyRow(QModelIndex original)
checkRow(newRow);
dirty_records.insert(newRow, true);
- // the UAT record has been created, now it is filled with the infromation
+ // the UAT record has been created, now it is filled with the information
const void *src_record = UAT_INDEX_PTR(uat_, original.row());
void *dst_record = UAT_INDEX_PTR(uat_, newRow);
// insertRows always initializes the record with empty value. Before copying
@@ -462,35 +500,67 @@ QModelIndex UatModel::copyRow(QModelIndex original)
/* According to documentation of uat_copy_cb_t memcpy should be used if uat_->copy_cb is NULL */
memcpy(dst_record, src_record, uat_->record_size);
}
- gboolean src_valid = g_array_index(uat_->valid_data, gboolean, original.row());
+ bool src_valid = g_array_index(uat_->valid_data, bool, original.row());
uat_update_record(uat_, dst_record, src_valid);
record_errors[newRow] = record_errors[original.row()];
dirty_records[newRow] = true;
- uat_->changed = TRUE;
+ uat_->changed = true;
endInsertRows();
return index(newRow, 0, QModelIndex());
}
-bool UatModel::moveRow(int src_row, int dst_row)
+bool UatModel::moveRowPrivate(int src_row, int dst_row)
{
- if (src_row < 0 || src_row >= rowCount() || dst_row < 0 || dst_row >= rowCount())
- return false;
-
- int dst = src_row < dst_row ? dst_row + 1 : dst_row;
+ if (src_row == dst_row)
+ return true;
- beginMoveRows(QModelIndex(), src_row, src_row, QModelIndex(), dst);
uat_move_index(uat_, src_row, dst_row);
record_errors.move(src_row, dst_row);
dirty_records.move(src_row, dst_row);
- uat_->changed = TRUE;
- endMoveRows();
+ uat_->changed = true;
return true;
}
+bool UatModel::moveRow(int src_row, int dst_row)
+{
+ return moveRows(QModelIndex(), src_row, 1, QModelIndex(), dst_row);
+}
+
+bool UatModel::moveRows(const QModelIndex &, int sourceRow, int count, const QModelIndex &, int destinationChild)
+{
+ if (sourceRow < 0 || sourceRow >= rowCount() || destinationChild < 0 || destinationChild >= rowCount() || count < 0)
+ return false;
+
+ if (count == 0)
+ return true;
+
+ // beginMoveRows checks this
+ if (sourceRow <= destinationChild && destinationChild <= sourceRow + count - 1)
+ return false;
+
+ if (destinationChild < sourceRow) {
+ if (!beginMoveRows(QModelIndex(), sourceRow, sourceRow + count - 1, QModelIndex(), destinationChild)) {
+ return false;
+ }
+ for (int i = 0; i < count; i++) {
+ moveRowPrivate(sourceRow + i, destinationChild + i);
+ }
+ } else {
+ if (!beginMoveRows(QModelIndex(), sourceRow, sourceRow + count - 1, QModelIndex(), destinationChild + 1)) {
+ return false;
+ }
+ for (int i = 0; i < count; i++) {
+ moveRowPrivate(sourceRow, destinationChild);
+ }
+ }
+ endMoveRows();
+ return true;
+}
+
bool UatModel::hasErrors() const
{
for (int i = 0; i < rowCount(); i++) {
@@ -513,7 +583,7 @@ bool UatModel::checkField(int row, int col, char **error) const
}
char *str = NULL;
- guint length;
+ unsigned length;
field->cb.tostr(rec, &str, &length, field->cbdata.tostr, field->fld_data);
bool ok = field->cb.chk(rec, str, length, field->cbdata.chk, field->fld_data, error);
@@ -543,3 +613,20 @@ QList<int> UatModel::checkRow(int row)
}
return changed;
}
+
+Qt::DropActions UatModel::supportedDropActions() const
+{
+ return Qt::MoveAction;
+}
+
+bool UatModel::dropMimeData(const QMimeData *, Qt::DropAction, int, int, const QModelIndex &)
+{
+ // We could implement MimeData using uat_fld_tostr (or a new function
+ // that just gives the entire string) although it would be nice for
+ // uat_load_str to be able to load at a specified index, or else have
+ // a function to produce a UAT record from a string. Or we could use
+ // something else. However, for now we really just want internal moves.
+ // Supporting drop actions and rejecting drops still allows our row
+ // moving view's InternalMove to work.
+ return false;
+}
diff --git a/ui/qt/models/uat_model.h b/ui/qt/models/uat_model.h
index 5da647a5..a24c938a 100644
--- a/ui/qt/models/uat_model.h
+++ b/ui/qt/models/uat_model.h
@@ -15,7 +15,6 @@
#define UAT_MODEL_H
#include <config.h>
-#include <glib.h>
#include <QAbstractItemModel>
#include <QList>
@@ -24,6 +23,7 @@
class UatModel : public QAbstractTableModel
{
+ Q_OBJECT
public:
UatModel(QObject *parent, uat_t *uat = 0);
UatModel(QObject *parent, QString tableName);
@@ -43,9 +43,13 @@ public:
QModelIndex appendEntry(QVariantList row);
QModelIndex copyRow(QModelIndex original);
+
bool moveRow(int src_row, int dst_row);
+ bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild);
- bool moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild);
+ //Drag & drop functionality
+ Qt::DropActions supportedDropActions() const;
+ bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
void reloadUat();
bool hasErrors() const;
@@ -74,9 +78,11 @@ private:
bool checkField(int row, int col, char **error) const;
QList<int> checkRow(int row);
void loadUat(uat_t * uat = 0);
+ bool moveRowPrivate(int src_row, int dst_row);
epan_uat *uat_;
- QList<bool> dirty_records;
- QList<QMap<int, QString> > record_errors;
+ bool applying_;
+ QVector<bool> dirty_records;
+ QVector<QMap<int, QString> > record_errors;
};
#endif // UAT_MODEL_H
diff --git a/ui/qt/models/voip_calls_info_model.cpp b/ui/qt/models/voip_calls_info_model.cpp
index 23ba46f1..2f6d4f18 100644
--- a/ui/qt/models/voip_calls_info_model.cpp
+++ b/ui/qt/models/voip_calls_info_model.cpp
@@ -58,7 +58,7 @@ QVariant VoipCallsInfoModel::data(const QModelIndex &index, int role) const
call_info->protocol_name : voip_protocol_name[call_info->protocol];
case Duration:
{
- guint callDuration = nstime_to_sec(&(call_info->stop_fd->abs_ts)) - nstime_to_sec(&(call_info->start_fd->abs_ts));
+ unsigned callDuration = nstime_to_sec(&(call_info->stop_fd->abs_ts)) - nstime_to_sec(&(call_info->start_fd->abs_ts));
return QString("%1:%2:%3").arg(callDuration / 3600, 2, 10, QChar('0')).arg((callDuration % 3600) / 60, 2, 10, QChar('0')).arg(callDuration % 60, 2, 10, QChar('0'));
}
case Packets:
@@ -82,14 +82,14 @@ QVariant VoipCallsInfoModel::data(const QModelIndex &index, int role) const
case VOIP_H323:
{
h323_calls_info_t *h323_info = (h323_calls_info_t *)call_info->prot_info;
- gboolean flag = FALSE;
+ bool flag = false;
static const QString on_str = tr("On");
static const QString off_str = tr("Off");
if (call_info->call_state == VOIP_CALL_SETUP) {
flag = h323_info->is_faststart_Setup;
} else {
if ((h323_info->is_faststart_Setup) && (h323_info->is_faststart_Proc)) {
- flag = TRUE;
+ flag = true;
}
}
return tr("Tunneling: %1 Fast Start: %2")
@@ -202,7 +202,7 @@ void VoipCallsInfoModel::updateCalls(GQueue *callsinfos)
// Add new rows
cur_call = g_queue_peek_nth_link(callsinfos, rowCount());
- guint extra = g_list_length(cur_call);
+ unsigned extra = g_list_length(cur_call);
if (extra > 0) {
beginInsertRows(QModelIndex(), rowCount(), rowCount() + extra - 1);
while (cur_call && cur_call->data) {
diff --git a/ui/qt/models/voip_calls_info_model.h b/ui/qt/models/voip_calls_info_model.h
index 2f8d4007..afb7ebe3 100644
--- a/ui/qt/models/voip_calls_info_model.h
+++ b/ui/qt/models/voip_calls_info_model.h
@@ -11,7 +11,6 @@
#define VOIP_CALLS_INFO_MODEL_H
#include <config.h>
-#include <glib.h>
#include "ui/voip_calls.h"
#include <ui/qt/utils/variant_pointer.h>
diff --git a/ui/qt/module_preferences_scroll_area.cpp b/ui/qt/module_preferences_scroll_area.cpp
index 56503e0a..d6f4718d 100644
--- a/ui/qt/module_preferences_scroll_area.cpp
+++ b/ui/qt/module_preferences_scroll_area.cpp
@@ -10,6 +10,7 @@
#include "module_preferences_scroll_area.h"
#include <ui_module_preferences_scroll_area.h>
#include <ui/qt/widgets/syntax_line_edit.h>
+#include <ui/qt/widgets/dissector_syntax_line_edit.h>
#include "ui/qt/widgets/wireshark_file_dialog.h"
#include <ui/qt/utils/qt_ui_utils.h>
#include "uat_dialog.h"
@@ -56,8 +57,8 @@ extern "C" {
// Callbacks prefs routines
/* Add a single preference to the QVBoxLayout of a preference page */
-static guint
-pref_show(pref_t *pref, gpointer user_data)
+static unsigned
+pref_show(pref_t *pref, void *user_data)
{
prefSearchData * data = static_cast<prefSearchData *>(user_data);
@@ -73,7 +74,6 @@ pref_show(pref_t *pref, gpointer user_data)
switch (prefs_get_type(pref)) {
case PREF_UINT:
- case PREF_DECODE_AS_UINT:
{
QHBoxLayout *hb = new QHBoxLayout();
QLabel *label = new QLabel(prefs_get_title(pref));
@@ -171,6 +171,21 @@ pref_show(pref_t *pref, gpointer user_data)
vb->addLayout(hb);
break;
}
+ case PREF_DISSECTOR:
+ {
+ QHBoxLayout *hb = new QHBoxLayout();
+ QLabel *label = new QLabel(prefs_get_title(pref));
+ label->setToolTip(tooltip);
+ hb->addWidget(label);
+ QLineEdit *string_le = new DissectorSyntaxLineEdit();
+ string_le->setToolTip(tooltip);
+ string_le->setProperty(pref_prop_, VariantPointer<pref_t>::asQVariant(pref));
+ string_le->setMinimumWidth(string_le->fontMetrics().height() * 20);
+ hb->addWidget(string_le);
+ hb->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ vb->addLayout(hb);
+ break;
+ }
case PREF_DECODE_AS_RANGE:
case PREF_RANGE:
{
@@ -305,7 +320,7 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg
/* Show the preference's description at the top of the page */
QFont font;
- font.setBold(TRUE);
+ font.setBold(true);
QLabel *label = new QLabel(module->description);
label->setFont(font);
ui->verticalLayout->addWidget(label);
@@ -322,9 +337,6 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg
if (!pref) continue;
switch (prefs_get_type(pref)) {
- case PREF_DECODE_AS_UINT:
- connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::uintLineEditTextEdited);
- break;
case PREF_UINT:
connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::uintLineEditTextEdited);
break;
@@ -333,6 +345,7 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg
case PREF_OPEN_FILENAME:
case PREF_DIRNAME:
case PREF_PASSWORD:
+ case PREF_DISSECTOR:
connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::stringLineEditTextEdited);
break;
case PREF_RANGE:
@@ -471,11 +484,27 @@ void ModulePreferencesScrollArea::updateWidgets()
}
if (prefs_get_type(pref) == PREF_PROTO_TCP_SNDAMB_ENUM && !prefs_get_enum_radiobuttons(pref)) {
- MainWindow* topWidget = dynamic_cast<MainWindow*> (mainApp->mainWindow());
- /* Ensure there is one unique or multiple selections. See issue 18642 */
- if (topWidget->hasSelection() || topWidget->hasUniqueSelection()) {
- frame_data * fdata = topWidget->frameDataForRow((topWidget->selectedRows()).at(0));
- enum_cb->setCurrentIndex(fdata->tcp_snd_manual_analysis);
+ if (prefs_get_list_value(pref, pref_stashed) == NULL) {
+ /* We haven't added a list of frames that could have their
+ * analysis changed. Set the current value to whatever the
+ * first selected frame has for its its TCP Sequence Analysis
+ * override.
+ */
+ MainWindow* topWidget = qobject_cast<MainWindow*>(mainApp->mainWindow());
+ /* Ensure there is one unique or multiple selections. See issue 18642 */
+ if (topWidget->hasSelection() || topWidget->hasUniqueSelection()) {
+ frame_data * fdata = topWidget->frameDataForRow((topWidget->selectedRows()).at(0));
+ enum_cb->setCurrentIndex(enum_cb->findData(fdata->tcp_snd_manual_analysis));
+ QList<int> rows = topWidget->selectedRows();
+ foreach (int row, rows) {
+ frame_data * fdata = topWidget->frameDataForRow(row);
+ prefs_add_list_value(pref, fdata, pref_stashed);
+ }
+ }
+ } else {
+ /* The initial value was already set from the selected frames,
+ * use the current value from when the CB was changed. */
+ enum_cb->setCurrentIndex(enum_cb->findData(prefs_get_enum_value(pref, pref_current)));
}
}
}
@@ -640,20 +669,8 @@ void ModulePreferencesScrollArea::enumComboBoxCurrentIndexChanged_PROTO_TCP(int
pref_t *pref = VariantPointer<pref_t>::asPtr(enum_cb->property(pref_prop_));
if (!pref) return;
- MainWindow* topWidget = dynamic_cast<MainWindow*> (mainApp->mainWindow());
-
- // method 1 : apply to one single packet
- /* frame_data * fdata = topWidget->frameDataForRow((topWidget->selectedRows()).at(0));
- fdata->tcp_snd_manual_analysis = enum_cb->itemData(index).toInt();*/
-
- // method 2 : we can leverage the functionality by allowing multiple selections
- QList<int> rows = topWidget->selectedRows();
- foreach (int row, rows) {
- frame_data * fdata = topWidget->frameDataForRow(row);
- fdata->tcp_snd_manual_analysis = enum_cb->itemData(index).toInt();
- }
-
+ // Store the index value in the current value, not the stashed value.
+ // We use the stashed value to store the frame data pointers.
prefs_set_enum_value(pref, enum_cb->itemData(index).toInt(), pref_current);
//prefs_set_enum_value(pref, enum_cb->itemData(index).toInt(), pref_stashed);
- updateWidgets();
}
diff --git a/ui/qt/module_preferences_scroll_area.h b/ui/qt/module_preferences_scroll_area.h
index f3da516b..8123564d 100644
--- a/ui/qt/module_preferences_scroll_area.h
+++ b/ui/qt/module_preferences_scroll_area.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <epan/prefs.h>
#include <epan/prefs-int.h>
diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp
index e5460fd9..37fb50dc 100644
--- a/ui/qt/mtp3_summary_dialog.cpp
+++ b/ui/qt/mtp3_summary_dialog.cpp
@@ -16,8 +16,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/tap.h>
#include <epan/dissectors/packet-mtp3.h>
diff --git a/ui/qt/multicast_statistics_dialog.cpp b/ui/qt/multicast_statistics_dialog.cpp
index cca74783..30801647 100644
--- a/ui/qt/multicast_statistics_dialog.cpp
+++ b/ui/qt/multicast_statistics_dialog.cpp
@@ -153,9 +153,9 @@ public:
private:
address src_addr_;
- guint16 src_port_;
+ uint16_t src_port_;
address dst_addr_;
- guint16 dst_port_;
+ uint16_t dst_port_;
unsigned num_packets_;
double avg_pps_;
double avg_bw_;
@@ -414,7 +414,7 @@ void MulticastStatisticsDialog::updateMulticastParameters()
param = burst_measurement_interval_le_->text().toUInt(&ok);
if (ok && param > 0 && param <= 1000) {
- mcast_stream_burstint = (guint16) param;
+ mcast_stream_burstint = (uint16_t) param;
}
param = burst_alarm_threshold_le_->text().toInt(&ok);
@@ -456,7 +456,7 @@ void MulticastStatisticsDialog::fillTree()
void MulticastStatisticsDialog::rescan()
{
- gboolean was_registered = tapinfo_->is_registered;
+ bool was_registered = tapinfo_->is_registered;
if (!tapinfo_->is_registered)
register_tap_listener_mcast_stream(tapinfo_);
diff --git a/ui/qt/packet_comment_dialog.h b/ui/qt/packet_comment_dialog.h
index 114e8345..e380953d 100644
--- a/ui/qt/packet_comment_dialog.h
+++ b/ui/qt/packet_comment_dialog.h
@@ -10,8 +10,6 @@
#ifndef PACKET_COMMENT_DIALOG_H
#define PACKET_COMMENT_DIALOG_H
-#include <glib.h>
-
#include "geometry_state_dialog.h"
namespace Ui {
diff --git a/ui/qt/packet_diagram.cpp b/ui/qt/packet_diagram.cpp
index a5bbc106..4d83deb2 100644
--- a/ui/qt/packet_diagram.cpp
+++ b/ui/qt/packet_diagram.cpp
@@ -322,19 +322,11 @@ private:
QFontMetrics fm = QFontMetrics(layout_->regularFont());
painter->setFont(layout_->regularFont());
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
int label_w = fm.horizontalAdvance(label);
-#else
- int label_w = fm.width(label);
-#endif
if (label_w > label_rect.width()) {
painter->setFont(layout_->smallFont());
fm = QFontMetrics(layout_->smallFont());
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
label_w = fm.horizontalAdvance(label);
-#else
- label_w = fm.width(label);
-#endif
if (label_w > label_rect.width()) {
// XXX Use parent+ItemClipsChildrenToShape or setScale instead?
label = fm.elidedText(label, Qt::ElideRight, label_rect.width());
@@ -379,6 +371,8 @@ void PacketDiagram::setRootNode(proto_node *root_node)
// useful in our case because it gives us a cheap way to retain our
// scroll position between packets.
scene()->clear();
+ viewport()->update();
+
selected_field_ = nullptr;
y_pos_ = 0;
@@ -399,7 +393,7 @@ void PacketDiagram::setRootNode(proto_node *root_node)
kids.next();
// Exclude all ("Frame") and nothing
- if (tl_node->finfo->start == 0 && tl_node->finfo->length == (int) tvb_captured_length(cap_file_->edt->tvb)) {
+ if (tl_node == root_node->first_child) {
continue;
}
if (tl_node->finfo->length < 1) {
@@ -475,6 +469,9 @@ void PacketDiagram::contextMenuEvent(QContextMenuEvent *event)
action->setChecked(layout_->showFields());
connect(action, &QAction::toggled, this, &PacketDiagram::showFieldsToggled);
+ action = ctx_menu->addAction(tr("Refresh"));
+ connect(action, &QAction::triggered, this, &PacketDiagram::resetScene);
+
ctx_menu->addSeparator();
action = ctx_menu->addAction(tr("Save Diagram As…"));
@@ -564,11 +561,7 @@ void PacketDiagram::addDiagram(proto_node *tl_node)
qreal y_bottom = y_pos_ + bit_width;
QGraphicsItem *tl_item = scene()->addLine(x, y_bottom, x + diag_w, y_bottom);
QFontMetrics sfm = QFontMetrics(layout_->smallFont());
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
int space_w = sfm.horizontalAdvance(' ');
-#else
- int space_w = sfm.width(' ');
-#endif
#ifdef Q_OS_WIN
// t_item->boundingRect() has a pixel of space on the left on my (gcc)
// Windows VM.
diff --git a/ui/qt/packet_dialog.cpp b/ui/qt/packet_dialog.cpp
index 8bf7a3bf..8c2d0010 100644
--- a/ui/qt/packet_dialog.cpp
+++ b/ui/qt/packet_dialog.cpp
@@ -15,6 +15,7 @@
#include "epan/column.h"
#include "epan/ftypes/ftypes.h"
#include "epan/prefs.h"
+#include "epan/prefs-int.h"
#include "ui/preference_utils.h"
#include "frame_tvbuff.h"
@@ -28,6 +29,8 @@
#include <ui/qt/utils/field_information.h>
#include <QTreeWidgetItemIterator>
+Q_DECLARE_METATYPE(splitter_layout_e)
+
// To do:
// - Copy over experimental packet editing code.
// - Fix ElidedText width.
@@ -41,6 +44,8 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
ui->setupUi(this);
loadGeometry(parent.width() * 4 / 5, parent.height() * 4 / 5);
ui->hintLabel->setSmallText();
+ ui->prefsLayout->insertSpacing(1, 20);
+ ui->prefsLayout->addStretch();
wtap_rec_init(&rec_);
ws_buffer_init(&buf_, 1514);
@@ -59,13 +64,13 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
}
/* proto tree, visible. We need a proto tree if there are custom columns */
- epan_dissect_init(&edt_, cap_file_.capFile()->epan, TRUE, TRUE);
+ epan_dissect_init(&edt_, cap_file_.capFile()->epan, true, true);
col_custom_prime_edt(&edt_, &(cap_file_.capFile()->cinfo));
epan_dissect_run(&edt_, cap_file_.capFile()->cd_t, &rec_,
frame_tvbuff_new_buffer(&cap_file_.capFile()->provider, fdata, &buf_),
fdata, &(cap_file_.capFile()->cinfo));
- epan_dissect_fill_in_columns(&edt_, TRUE, TRUE);
+ epan_dissect_fill_in_columns(&edt_, true, true);
proto_tree_ = new ProtoTree(ui->packetSplitter, &edt_);
// Do not call proto_tree_->setCaptureFile, ProtoTree only needs the
@@ -76,7 +81,40 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
byte_view_tab_->setCaptureFile(cap_file_.capFile());
byte_view_tab_->selectedFrameChanged(QList<int>() << 0);
- ui->packetSplitter->setStretchFactor(1, 0);
+ // We have to load the splitter state after adding the proto tree
+ // and byte view.
+ loadSplitterState(ui->packetSplitter);
+
+ module_t *gui_module = prefs_find_module("gui");
+ if (gui_module != nullptr) {
+ pref_packet_dialog_layout_ = prefs_find_preference(gui_module, "packet_dialog_layout");
+ if (pref_packet_dialog_layout_ != nullptr) {
+ for (const enum_val_t *ev = prefs_get_enumvals(pref_packet_dialog_layout_); ev && ev->description; ev++) {
+ ui->layoutComboBox->addItem(ev->description, QVariant(ev->value));
+ }
+ }
+ }
+ ui->layoutComboBox->setCurrentIndex(ui->layoutComboBox->findData(QVariant(prefs.gui_packet_dialog_layout)));
+ Qt::Orientation pref_orientation = Qt::Vertical;
+ switch(prefs.gui_packet_dialog_layout) {
+ case(layout_vertical):
+ pref_orientation = Qt::Vertical;
+ break;
+ case(layout_horizontal):
+ pref_orientation = Qt::Horizontal;
+ break;
+ }
+
+ if (ui->packetSplitter->orientation() != pref_orientation) {
+ ui->packetSplitter->setOrientation(pref_orientation);
+ // If the orientation is different than the restore one,
+ // reset the sizes to 50-50.
+ QList<int> sizes = ui->packetSplitter->sizes();
+ int totalsize = sizes.at(0) + sizes.at(1);
+ sizes[0] = totalsize / 2;
+ sizes[1] = totalsize / 2;
+ ui->packetSplitter->setSizes(sizes);
+ }
QStringList col_parts;
for (int i = 0; i < cap_file_.capFile()->cinfo.num_cols; ++i) {
@@ -96,6 +134,7 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
byte_view_tab_->setVisible(false);
}
ui->chkShowByteView->setCheckState(state);
+ ui->layoutComboBox->setEnabled(state);
connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
proto_tree_, SLOT(setMonospaceFont(QFont)));
@@ -117,6 +156,11 @@ PacketDialog::PacketDialog(QWidget &parent, CaptureFile &cf, frame_data *fdata)
connect(proto_tree_, SIGNAL(editProtocolPreference(preference*,pref_module*)),
this, SIGNAL(editProtocolPreference(preference*,pref_module*)));
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ connect(ui->layoutComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PacketDialog::layoutChanged);
+#else
+ connect(ui->layoutComboBox, &QComboBox::currentIndexChanged, this, &PacketDialog::layoutChanged, Qt::AutoConnection);
+#endif
connect(ui->chkShowByteView, &QCheckBox::stateChanged, this, &PacketDialog::viewVisibilityStateChanged);
}
@@ -192,7 +236,12 @@ void PacketDialog::setHintTextSelected(FieldInformation* finfo)
finfo_length = finfo->position().length + finfo->appendix().length;
if (finfo_length > 0) {
- hint.append(", " + tr("%Ln byte(s)", "", finfo_length));
+ int finfo_bits = FI_GET_BITS_SIZE(finfo->fieldInfo());
+ if (finfo_bits % 8 == 0) {
+ hint.append(", " + tr("%Ln byte(s)", "", finfo_length));
+ } else {
+ hint.append(", " + tr("%Ln bit(s)", "", finfo_bits));
+ }
}
}
}
@@ -205,7 +254,22 @@ void PacketDialog::setHintTextSelected(FieldInformation* finfo)
void PacketDialog::viewVisibilityStateChanged(int state)
{
byte_view_tab_->setVisible(state == Qt::Checked);
+ ui->layoutComboBox->setEnabled(state == Qt::Checked);
- prefs.gui_packet_details_show_byteview = (state == Qt::Checked ? TRUE : FALSE);
+ prefs.gui_packet_details_show_byteview = (state == Qt::Checked ? true : false);
prefs_main_write();
}
+
+void PacketDialog::layoutChanged(int index _U_)
+{
+ splitter_layout_e layout = ui->layoutComboBox->currentData().value<splitter_layout_e>();
+ switch(layout) {
+ case(layout_vertical):
+ ui->packetSplitter->setOrientation(Qt::Vertical);
+ break;
+ case(layout_horizontal):
+ ui->packetSplitter->setOrientation(Qt::Horizontal);
+ break;
+ }
+ prefs_set_enum_value(pref_packet_dialog_layout_, layout, pref_current);
+}
diff --git a/ui/qt/packet_dialog.h b/ui/qt/packet_dialog.h
index c2119b74..927784f1 100644
--- a/ui/qt/packet_dialog.h
+++ b/ui/qt/packet_dialog.h
@@ -43,6 +43,7 @@ signals:
private slots:
void on_buttonBox_helpRequested();
void viewVisibilityStateChanged(int);
+ void layoutChanged(int);
void setHintText(FieldInformation *);
void setHintTextSelected(FieldInformation*);
@@ -50,6 +51,7 @@ private slots:
private:
Ui::PacketDialog *ui;
+ pref_t *pref_packet_dialog_layout_;
QString col_info_;
ProtoTree *proto_tree_;
ByteViewTab *byte_view_tab_;
diff --git a/ui/qt/packet_dialog.ui b/ui/qt/packet_dialog.ui
index 0473fa12..83442828 100644
--- a/ui/qt/packet_dialog.ui
+++ b/ui/qt/packet_dialog.ui
@@ -35,14 +35,29 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="chkShowByteView">
- <property name="text">
- <string>Show packet bytes</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="prefsLayout">
+ <item>
+ <widget class="QCheckBox" name="chkShowByteView">
+ <property name="text">
+ <string>Show packet bytes</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="layoutLabel">
+ <property name="text">
+ <string>Layout:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="layoutComboBox">
+ </widget>
+ </item>
+ </layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index ae6f0f51..896c66fe 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -11,8 +11,6 @@
#include "config.h"
-#include <glib.h>
-
#include "file.h"
#include <epan/epan.h>
@@ -36,6 +34,7 @@
#include "ui/util.h"
#include "wiretap/wtap_opttypes.h"
+#include "wsutil/filesystem.h"
#include "wsutil/str_util.h"
#include <wsutil/wslog.h>
@@ -49,6 +48,7 @@
#include "main_application.h"
#include <ui/qt/utils/data_printer.h>
#include <ui/qt/utils/frame_information.h>
+#include <ui/qt/utils/profile_switcher.h>
#include <ui/qt/utils/variant_pointer.h>
#include <ui/qt/models/pref_models.h>
#include <ui/qt/widgets/packet_list_header.h>
@@ -93,7 +93,7 @@
// If we ever add the ability to open multiple capture files we might be
// able to use something like QMap<capture_file *, PacketList *> to match
// capture files against packet lists and models.
-static PacketList *gbl_cur_packet_list = NULL;
+static PacketList *gbl_cur_packet_list;
const int max_comments_to_fetch_ = 20000000; // Arbitrary
const int overlay_update_interval_ = 100; // 250; // Milliseconds.
@@ -102,18 +102,18 @@ const int overlay_update_interval_ = 100; // 250; // Milliseconds.
/*
* Given a frame_data structure, scroll to and select the row in the
* packet list corresponding to that frame. If there is no such
- * row, return FALSE, otherwise return TRUE.
+ * row, return false, otherwise return true.
*/
-gboolean
+bool
packet_list_select_row_from_data(frame_data *fdata_needle)
{
if (! gbl_cur_packet_list || ! gbl_cur_packet_list->model())
- return FALSE;
+ return false;
PacketListModel * model = qobject_cast<PacketListModel *>(gbl_cur_packet_list->model());
if (! model)
- return FALSE;
+ return false;
model->flushVisibleRows();
int row = -1;
@@ -132,10 +132,32 @@ packet_list_select_row_from_data(frame_data *fdata_needle)
gbl_cur_packet_list->selectionModel()->clearSelection();
gbl_cur_packet_list->selectionModel()->setCurrentIndex(model->index(row, 0), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
gbl_cur_packet_list->scrollTo(gbl_cur_packet_list->currentIndex(), PacketList::PositionAtCenter);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
+}
+
+/*
+ * Given a field_info, select the field (which will scroll to it in
+ * the main ProtoTree, etc.) This is kind of an odd place for it,
+ * but we call this when performing Find Packet in lieu of changing the
+ * selected frame (the function above), because we found a match in the
+ * same frame as the currently selected one.
+ */
+bool
+packet_list_select_finfo(field_info *fi)
+{
+ if (! gbl_cur_packet_list || ! gbl_cur_packet_list->model())
+ return false;
+
+ if (fi) {
+ FieldInformation finfo(fi, gbl_cur_packet_list);
+ emit gbl_cur_packet_list->fieldSelected(&finfo);
+ } else {
+ emit gbl_cur_packet_list->fieldSelected(0);
+ }
+ return true;
}
void
@@ -180,21 +202,21 @@ packet_list_recent_write_all(FILE *rf) {
gbl_cur_packet_list->writeRecent(rf);
}
-gboolean
+bool
packet_list_multi_select_active(void)
{
if (gbl_cur_packet_list) {
return gbl_cur_packet_list->multiSelectActive();
}
- return FALSE;
+ return false;
}
#define MIN_COL_WIDTH_STR "MMMMMM"
PacketList::PacketList(QWidget *parent) :
QTreeView(parent),
- proto_tree_(NULL),
- cap_file_(NULL),
+ proto_tree_(nullptr),
+ cap_file_(nullptr),
ctx_column_(-1),
overlay_timer_id_(0),
create_near_overlay_(true),
@@ -209,7 +231,8 @@ PacketList::PacketList(QWidget *parent) :
frozen_selected_rows_(QModelIndexList()),
cur_history_(-1),
in_history_(false),
- finfo_array(NULL)
+ finfo_array(nullptr),
+ profile_switcher_(nullptr)
{
setItemsExpandable(false);
setRootIsDecorated(false);
@@ -227,9 +250,7 @@ PacketList::PacketList(QWidget *parent) :
connect(packet_list_header_, &PacketListHeader::columnsChanged, this, &PacketList::columnsChanged);
setHeader(packet_list_header_);
-#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
header()->setFirstSectionMovable(true);
-#endif
setSelectionMode(QAbstractItemView::ExtendedSelection);
@@ -276,10 +297,23 @@ PacketList::~PacketList()
{
if (finfo_array)
{
- g_ptr_array_free(finfo_array, TRUE);
+ g_ptr_array_free(finfo_array, true);
}
}
+void PacketList::scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint)
+{
+ /* QAbstractItemView doesn't have a way to indicate "auto scroll, but
+ * only vertically." So just restore the horizontal scroll value whenever
+ * it scrolls.
+ */
+ setUpdatesEnabled(false);
+ int horizVal = horizontalScrollBar()->value();
+ QTreeView::scrollTo(index, hint);
+ horizontalScrollBar()->setValue(horizVal);
+ setUpdatesEnabled(true);
+}
+
void PacketList::colorsChanged()
{
const QString c_active = "active";
@@ -550,7 +584,6 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
selection_history_.resize(cur_history_);
selection_history_.append(cap_file_->current_frame->num);
}
- in_history_ = false;
related_packet_delegate_.clear();
@@ -567,7 +600,7 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
if (cap_file_->edt->tree) {
packet_info *pi = &cap_file_->edt->pi;
related_packet_delegate_.setCurrentFrame(pi->num);
- conversation_t *conv = find_conversation_pinfo(pi, 0);
+ conversation_t *conv = find_conversation_pinfo_ro(pi, 0);
if (conv) {
related_packet_delegate_.setConversation(conv);
}
@@ -581,9 +614,17 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
// The tree where the target string matched one of the labels was discarded in
// match_protocol_tree() so we have to search again in the latest tree.
fi = cf_find_string_protocol_tree(cap_file_, cap_file_->edt->tree);
- } else if (cap_file_->search_pos != 0) {
+ } else if (cap_file_->search_len != 0) {
// Find the finfo that corresponds to our byte.
- fi = proto_find_field_from_offset(cap_file_->edt->tree, cap_file_->search_pos,
+ // The match can span multiple fields (and a single byte can
+ // match more than one field.) Our behavior is to find the last
+ // field in the tree (so hopefully spanning fewer bytes) that
+ // matches the last byte in the search match.
+ // (regex search can find a zero length match not at the
+ // start of the frame if lookbehind is used, but
+ // proto_find_field_from_offset doesn't match such a field
+ // and it's not clear which field we would want to match.)
+ fi = proto_find_field_from_offset(cap_file_->edt->tree, cap_file_->search_pos + cap_file_->search_len - 1,
cap_file_->edt->tvb);
}
@@ -606,16 +647,16 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
if (finfo_array)
{
- g_ptr_array_free(finfo_array, TRUE);
+ g_ptr_array_free(finfo_array, true);
finfo_array = NULL;
}
if (cap_file_ && cap_file_->edt && cap_file_->edt->tree) {
finfo_array = proto_all_finfos(cap_file_->edt->tree);
QList<QString> added_proto_prefs;
- for (guint i = 0; i < finfo_array->len; i++) {
+ for (unsigned i = 0; i < finfo_array->len; i++) {
field_info *fi = (field_info *)g_ptr_array_index (finfo_array, i);
- header_field_info *hfinfo = fi->hfinfo;
+ const header_field_info *hfinfo = fi->hfinfo;
if (prefs_is_registered_protocol(hfinfo->abbrev)) {
if (hfinfo->parent == -1) {
@@ -654,8 +695,8 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
ctx_menu->setAttribute(Qt::WA_DeleteOnClose);
// XXX We might want to reimplement setParent() and fill in the context
// menu there.
- ctx_menu->addAction(window()->findChild<QAction *>("actionEditMarkPacket"));
- ctx_menu->addAction(window()->findChild<QAction *>("actionEditIgnorePacket"));
+ ctx_menu->addAction(window()->findChild<QAction *>("actionEditMarkSelected"));
+ ctx_menu->addAction(window()->findChild<QAction *>("actionEditIgnoreSelected"));
ctx_menu->addAction(window()->findChild<QAction *>("actionEditSetTimeReference"));
ctx_menu->addAction(window()->findChild<QAction *>("actionEditTimeShift"));
ctx_menu->addMenu(window()->findChild<QMenu *>("menuPacketComment"));
@@ -728,6 +769,7 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
main_menu_item = window()->findChild<QMenu *>("menuEditCopy");
submenu = new QMenu(main_menu_item->title(), ctx_menu);
+ submenu->setToolTipsVisible(true);
ctx_menu->addMenu(submenu);
QAction * action = submenu->addAction(tr("Summary as Text"));
@@ -749,15 +791,16 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
copyEntries->setParent(submenu);
frameData->setParent(submenu);
- ctx_menu->addSeparator();
- ctx_menu->addMenu(&proto_prefs_menus_);
- action = ctx_menu->addAction(tr("Decode As…"));
- action->setProperty("create_new", QVariant(true));
- connect(action, &QAction::triggered, this, &PacketList::ctxDecodeAsDialog);
- // "Print" not ported intentionally
- action = window()->findChild<QAction *>("actionViewShowPacketInNewWindow");
- ctx_menu->addAction(action);
-
+ if (is_packet_configuration_namespace()) {
+ ctx_menu->addSeparator();
+ ctx_menu->addMenu(&proto_prefs_menus_);
+ action = ctx_menu->addAction(tr("Decode As…"));
+ action->setProperty("create_new", QVariant(true));
+ connect(action, &QAction::triggered, this, &PacketList::ctxDecodeAsDialog);
+ // "Print" not ported intentionally
+ action = window()->findChild<QAction *>("actionViewShowPacketInNewWindow");
+ ctx_menu->addAction(action);
+ }
// Set menu sensitivity for the current column and set action data.
if (frameData)
@@ -805,9 +848,7 @@ void PacketList::paintEvent(QPaintEvent *event)
void PacketList::mousePressEvent (QMouseEvent *event)
{
- setAutoScroll(false);
QTreeView::mousePressEvent(event);
- setAutoScroll(true);
QModelIndex curIndex = indexAt(event->pos());
mouse_pressed_at_ = curIndex;
@@ -918,23 +959,7 @@ void PacketList::mouseMoveEvent (QMouseEvent *event)
void PacketList::keyPressEvent(QKeyEvent *event)
{
- bool handled = false;
- // If scrolling up/down, want to preserve horizontal scroll extent.
- if (event->key() == Qt::Key_Down || event->key() == Qt::Key_Up ||
- event->key() == Qt::Key_PageDown || event->key() == Qt::Key_PageUp ||
- event->key() == Qt::Key_End || event->key() == Qt::Key_Home )
- {
- // XXX: Why allow jumping to the left if the first column is current?
- if (currentIndex().isValid() && currentIndex().column() > 0) {
- int pos = horizontalScrollBar()->value();
- QTreeView::keyPressEvent(event);
- horizontalScrollBar()->setValue(pos);
- handled = true;
- }
- }
-
- if (!handled)
- QTreeView::keyPressEvent(event);
+ QTreeView::keyPressEvent(event);
if (event->matches(QKeySequence::Copy))
{
@@ -1008,19 +1033,11 @@ void PacketList::setRecentColumnWidth(int col)
const char *long_str = get_column_width_string(fmt, col);
QFontMetrics fm = QFontMetrics(mainApp->monospaceFont());
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
if (long_str) {
col_width = fm.horizontalAdvance(long_str);
} else {
col_width = fm.horizontalAdvance(MIN_COL_WIDTH_STR);
}
-#else
- if (long_str) {
- col_width = fm.width(long_str);
- } else {
- col_width = fm.width(MIN_COL_WIDTH_STR);
- }
-#endif
// Custom delegate padding
if (itemDelegateForColumn(col)) {
QStyleOptionViewItem option;
@@ -1102,6 +1119,14 @@ bool PacketList::havePreviousHistory(bool update_cur)
return false;
}
+void PacketList::setProfileSwitcher(ProfileSwitcher *profile_switcher)
+{
+ profile_switcher_ = profile_switcher;
+ if (profile_switcher) {
+ connect(packet_list_model_, &PacketListModel::packetAppended, profile_switcher_, &ProfileSwitcher::checkPacket);
+ }
+}
+
frame_data *PacketList::getFDataForRow(int row) const
{
return packet_list_model_->getRowFdata(row);
@@ -1120,7 +1145,7 @@ void PacketList::columnsChanged()
prefs.num_cols = g_list_length(prefs.col_list);
col_cleanup(&cap_file_->cinfo);
- build_column_format_array(&cap_file_->cinfo, prefs.num_cols, FALSE);
+ build_column_format_array(&cap_file_->cinfo, prefs.num_cols, false);
create_far_overlay_ = true;
resetColumns();
applyRecentColumnWidths();
@@ -1133,7 +1158,7 @@ void PacketList::fieldsChanged(capture_file *cf)
{
prefs.num_cols = g_list_length(prefs.col_list);
col_cleanup(&cf->cinfo);
- build_column_format_array(&cf->cinfo, prefs.num_cols, FALSE);
+ build_column_format_array(&cf->cinfo, prefs.num_cols, false);
resetColumns();
}
@@ -1163,9 +1188,6 @@ void PacketList::applyRecentColumnWidths()
void PacketList::preferencesChanged()
{
- // Update color style changes
- colorsChanged();
-
// Related packet delegate
if (prefs.gui_packet_list_show_related) {
setItemDelegateForColumn(0, &related_packet_delegate_);
@@ -1329,8 +1351,8 @@ void PacketList::clear() {
}
void PacketList::writeRecent(FILE *rf) {
- gint col, width, col_fmt;
- gchar xalign;
+ int col, width, col_fmt;
+ char xalign;
fprintf (rf, "%s:\n", RECENT_KEY_COL_WIDTH);
for (col = 0; col < prefs.num_cols; col++) {
@@ -1387,7 +1409,7 @@ QString PacketList::getFilterFromRowAndColumn(QModelIndex idx)
return filter; /* error reading the record */
}
/* proto tree, visible. We need a proto tree if there's custom columns */
- epan_dissect_init(&edt, cap_file_->epan, have_custom_cols(&cap_file_->cinfo), FALSE);
+ epan_dissect_init(&edt, cap_file_->epan, have_custom_cols(&cap_file_->cinfo), false);
col_custom_prime_edt(&edt, &cap_file_->cinfo);
epan_dissect_run(&edt, cap_file_->cd_t, &rec,
@@ -1400,14 +1422,14 @@ QString PacketList::getFilterFromRowAndColumn(QModelIndex idx)
/* We don't need to fill in the custom columns, as we get their
* filters above.
*/
- col_fill_in(&edt.pi, TRUE, TRUE);
+ col_fill_in(&edt.pi, true, true);
if (strlen(cap_file_->cinfo.col_expr.col_expr[column]) != 0 &&
strlen(cap_file_->cinfo.col_expr.col_expr_val[column]) != 0) {
- gboolean is_string_value = FALSE;
+ bool is_string_value = false;
header_field_info *hfi = proto_registrar_get_byname(cap_file_->cinfo.col_expr.col_expr[column]);
- if (hfi && hfi->type == FT_STRING) {
+ if (hfi && FT_IS_STRING(hfi->type)) {
/* Could be an address type such as usb.src which must be quoted. */
- is_string_value = TRUE;
+ is_string_value = true;
}
if (filter.isEmpty()) {
@@ -1438,7 +1460,7 @@ void PacketList::resetColorized()
update();
}
-QString PacketList::getPacketComment(guint c_number)
+QString PacketList::getPacketComment(unsigned c_number)
{
int row = currentIndex().row();
const frame_data *fdata;
@@ -1487,7 +1509,7 @@ void PacketList::addPacketComment(QString new_comment)
}
}
-void PacketList::setPacketComment(guint c_number, QString new_comment)
+void PacketList::setPacketComment(unsigned c_number, QString new_comment)
{
QModelIndex curIndex = currentIndex();
@@ -1513,7 +1535,7 @@ void PacketList::setPacketComment(guint c_number, QString new_comment)
QString PacketList::allPacketComments()
{
- guint32 framenum;
+ uint32_t framenum;
frame_data *fdata;
QString buf_str;
@@ -1525,8 +1547,8 @@ QString PacketList::allPacketComments()
wtap_block_t pkt_block = cf_get_packet_block(cap_file_, fdata);
if (pkt_block) {
- guint n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
- for (guint i = 0; i < n_comments; i++) {
+ unsigned n_comments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ for (unsigned i = 0; i < n_comments; i++) {
char *comment_text;
if (WTAP_OPTTYPE_SUCCESS == wtap_block_get_nth_string_option_value(pkt_block, OPT_COMMENT, i, &comment_text)) {
buf_str.append(QString(tr("Frame %1: %2\n\n")).arg(framenum).arg(comment_text));
@@ -1584,7 +1606,12 @@ void PacketList::setCaptureFile(capture_file *cf)
void PacketList::setMonospaceFont(const QFont &mono_font)
{
setFont(mono_font);
- header()->setFont(mainApp->font());
+}
+
+void PacketList::setRegularFont(const QFont &regular_font)
+{
+ header()->setFont(regular_font);
+ header()->viewport()->setFont(regular_font);
}
void PacketList::goNextPacket(void)
@@ -1644,16 +1671,14 @@ void PacketList::goLastPacket(void) {
scrollViewChanged(false);
}
-// XXX We can jump to the wrong packet if a display filter is applied
void PacketList::goToPacket(int packet, int hf_id)
{
- if (!cf_goto_frame(cap_file_, packet))
+ if (!cf_goto_frame(cap_file_, packet, false))
return;
- int row = packet_list_model_->packetNumberToRow(packet);
- if (row >= 0) {
- selectionModel()->setCurrentIndex(packet_list_model_->index(row, 0), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
- scrollTo(currentIndex(), PositionAtCenter);
+ // cf_goto_frame only returns true if packet_list_select_row_from_data
+ // succeeds, the latter has already selected and scrolled to the frame.
+ if (hf_id > 0) {
proto_tree_->goToHfid(hf_id);
}
@@ -1810,7 +1835,7 @@ void PacketList::sectionResized(int col, int, int new_width)
// visible.
//
// Don't set column width when columns changed or setting column
- // visibility because we may get a sectionReized() from QTreeView
+ // visibility because we may get a sectionResized() from QTreeView
// with values from a old columns layout.
//
// Don't set column width when hiding a column.
@@ -1825,6 +1850,7 @@ void PacketList::sectionResized(int col, int, int new_width)
void PacketList::sectionMoved(int logicalIndex, int oldVisualIndex, int newVisualIndex)
{
GList *new_col_list = NULL;
+ GList *new_recent_col_list = NULL;
QList<int> saved_sizes;
int sort_idx;
@@ -1849,9 +1875,14 @@ void PacketList::sectionMoved(int logicalIndex, int oldVisualIndex, int newVisua
saved_sizes << header()->sectionSize(log_idx);
void *pref_data = g_list_nth_data(prefs.col_list, log_idx);
- if (!pref_data) continue;
+ if (pref_data) {
+ new_col_list = g_list_append(new_col_list, pref_data);
+ }
- new_col_list = g_list_append(new_col_list, pref_data);
+ pref_data = g_list_nth_data(recent.col_width_list, log_idx);
+ if (pref_data) {
+ new_recent_col_list = g_list_append(new_recent_col_list, pref_data);
+ }
}
// Undo move to ensure that the logical indices map to the visual indices,
@@ -1869,6 +1900,8 @@ void PacketList::sectionMoved(int logicalIndex, int oldVisualIndex, int newVisua
g_list_free(prefs.col_list);
prefs.col_list = new_col_list;
+ g_list_free(recent.col_width_list);
+ recent.col_width_list = new_recent_col_list;
thaw(true);
@@ -1988,7 +2021,7 @@ void PacketList::scrollViewChanged(bool at_end)
// out colors.
// Try 3: One packet per vertical scroll bar pixel. This seems to work best
// but has the smallest window.
-// Try 4: Use a multiple of the scroll bar heigh and scale the image down
+// Try 4: Use a multiple of the scroll bar height and scale the image down
// using Qt::SmoothTransformation. This gives us more packets per raster
// line.
diff --git a/ui/qt/packet_list.h b/ui/qt/packet_list.h
index 2b025e25..8667bf5e 100644
--- a/ui/qt/packet_list.h
+++ b/ui/qt/packet_list.h
@@ -24,6 +24,7 @@
class PacketListHeader;
class OverlayScrollBar;
+class ProfileSwitcher;
class QAction;
class QTimerEvent;
@@ -49,6 +50,7 @@ public:
};
Q_ENUM(SummaryCopyType)
+ virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint = EnsureVisible) override;
QMenu *conversationMenu() { return &conv_menu_; }
QMenu *colorizeMenu() { return &colorize_menu_; }
void setProtoTree(ProtoTree *proto_tree);
@@ -73,9 +75,9 @@ public:
bool contextMenuActive();
QString getFilterFromRowAndColumn(QModelIndex idx);
void resetColorized();
- QString getPacketComment(guint c_number);
+ QString getPacketComment(unsigned c_number);
void addPacketComment(QString new_comment);
- void setPacketComment(guint c_number, QString new_comment);
+ void setPacketComment(unsigned c_number, QString new_comment);
QString allPacketComments();
void deleteCommentsFromPackets();
void deleteAllPacketComments();
@@ -85,6 +87,7 @@ public:
void resetColumns();
bool haveNextHistory(bool update_cur = false);
bool havePreviousHistory(bool update_cur = false);
+ void setProfileSwitcher(ProfileSwitcher *profile_switcher);
frame_data * getFDataForRow(int row) const;
@@ -147,15 +150,15 @@ private:
int cur_history_;
bool in_history_;
GPtrArray *finfo_array; // Packet data from the last selected packet entry
+ ProfileSwitcher *profile_switcher_;
- void setFrameReftime(gboolean set, frame_data *fdata);
+ void setFrameReftime(bool set, frame_data *fdata);
void setColumnVisibility();
int sizeHintForColumn(int column) const override;
void setRecentColumnWidth(int column);
void drawCurrentPacket();
void applyRecentColumnWidths();
void scrollViewChanged(bool at_end);
- void colorsChanged();
QString joinSummaryRow(QStringList col_parts, int row, SummaryCopyType type);
signals:
@@ -172,6 +175,7 @@ signals:
public slots:
void setCaptureFile(capture_file *cf);
void setMonospaceFont(const QFont &mono_font);
+ void setRegularFont(const QFont &regular_font);
void goNextPacket();
void goPreviousPacket();
void goFirstPacket();
@@ -189,6 +193,7 @@ public slots:
void recolorPackets();
void redrawVisiblePackets();
void redrawVisiblePacketsDontSelectCurrent();
+ void colorsChanged();
void columnsChanged();
void fieldsChanged(capture_file *cf);
void preferencesChanged();
diff --git a/ui/qt/packet_range_group_box.cpp b/ui/qt/packet_range_group_box.cpp
index dab44333..068f36a7 100644
--- a/ui/qt/packet_range_group_box.cpp
+++ b/ui/qt/packet_range_group_box.cpp
@@ -407,7 +407,7 @@ void PacketRangeGroupBox::on_rangeButton_toggled(bool checked)
void PacketRangeGroupBox::on_capturedButton_toggled(bool checked)
{
if (checked) {
- if (range_) range_->process_filtered = FALSE;
+ if (range_) range_->process_filtered = false;
updateCounts();
}
}
@@ -415,21 +415,21 @@ void PacketRangeGroupBox::on_capturedButton_toggled(bool checked)
void PacketRangeGroupBox::on_displayedButton_toggled(bool checked)
{
if (checked) {
- if (range_) range_->process_filtered = TRUE;
+ if (range_) range_->process_filtered = true;
updateCounts();
}
}
void PacketRangeGroupBox::on_ignoredCheckBox_toggled(bool checked)
{
- if (range_) range_->remove_ignored = checked ? TRUE : FALSE;
+ if (range_) range_->remove_ignored = checked ? true : false;
updateCounts();
}
void PacketRangeGroupBox::on_dependedCheckBox_toggled(bool checked)
{
if (range_) {
- range_->include_dependents = checked ? TRUE : FALSE;
+ range_->include_dependents = checked ? true : false;
updateCounts();
}
}
diff --git a/ui/qt/packet_range_group_box.h b/ui/qt/packet_range_group_box.h
index 1912d71d..44fb1790 100644
--- a/ui/qt/packet_range_group_box.h
+++ b/ui/qt/packet_range_group_box.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <ui/packet_range.h>
#include <ui/qt/widgets/syntax_line_edit.h>
diff --git a/ui/qt/preference_editor_frame.cpp b/ui/qt/preference_editor_frame.cpp
index 4ebce5c9..eec2571a 100644
--- a/ui/qt/preference_editor_frame.cpp
+++ b/ui/qt/preference_editor_frame.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/prefs.h>
#include <epan/prefs-int.h>
#include <epan/decode_as.h>
@@ -49,6 +47,9 @@ PreferenceEditorFrame::PreferenceEditorFrame(QWidget *parent) :
#endif
connect(ui->preferenceBrowseButton, &QPushButton::clicked, this, &PreferenceEditorFrame::browsePushButtonClicked);
+
+ // Disconnect textChanged signal for DissectorSyntaxLineEdit.
+ disconnect(ui->preferenceLineEdit, &DissectorSyntaxLineEdit::textChanged, NULL, NULL);
}
PreferenceEditorFrame::~PreferenceEditorFrame()
@@ -80,14 +81,15 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module
ui->preferenceLineEdit->clear();
ui->preferenceLineEdit->setSyntaxState(SyntaxLineEdit::Empty);
- disconnect(ui->preferenceLineEdit, 0, 0, 0);
+
+ // Disconnect previous textChanged signal.
+ disconnect(ui->preferenceLineEdit, &SyntaxLineEdit::textChanged, this, NULL);
bool show = false;
bool browse_button = false;
switch (prefs_get_type(pref_)) {
case PREF_UINT:
- case PREF_DECODE_AS_UINT:
connect(ui->preferenceLineEdit, &SyntaxLineEdit::textChanged,
this, &PreferenceEditorFrame::uintLineEditTextEdited);
show = true;
@@ -99,6 +101,7 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module
// Fallthrough
case PREF_STRING:
case PREF_PASSWORD:
+ case PREF_DISSECTOR:
connect(ui->preferenceLineEdit, &SyntaxLineEdit::textChanged,
this, &PreferenceEditorFrame::stringLineEditTextEdited);
show = true;
@@ -114,6 +117,16 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module
}
if (show) {
+ // Enable completion only for display filter search.
+ if (prefs_get_type(pref_) == PREF_DISSECTOR) {
+ ui->preferenceLineEdit->allowCompletion(true);
+ ui->preferenceLineEdit->updateDissectorNames();
+ ui->preferenceLineEdit->setDefaultPlaceholderText();
+ } else {
+ ui->preferenceLineEdit->allowCompletion(false);
+ ui->preferenceLineEdit->setPlaceholderText("");
+ }
+
ui->preferenceLineEdit->setText(gchar_free_to_qstring(prefs_pref_to_str(pref_, pref_stashed)).remove(QRegularExpression("\n\t")));
ui->preferenceBrowseButton->setHidden(!browse_button);
animatedShow();
@@ -143,8 +156,15 @@ void PreferenceEditorFrame::uintLineEditTextEdited(const QString &new_str)
void PreferenceEditorFrame::stringLineEditTextEdited(const QString &new_str)
{
+ bool ok = true;
new_str_ = new_str;
- ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
+
+ if (prefs_get_type(pref_) == PREF_DISSECTOR) {
+ ui->preferenceLineEdit->checkDissectorName(new_str_);
+ ok = (ui->preferenceLineEdit->syntaxState() != SyntaxLineEdit::Invalid);
+ }
+
+ ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok);
}
void PreferenceEditorFrame::browsePushButtonClicked()
@@ -220,13 +240,13 @@ void PreferenceEditorFrame::on_buttonBox_accepted()
unsigned int apply = 0;
switch(prefs_get_type(pref_)) {
case PREF_UINT:
- case PREF_DECODE_AS_UINT:
apply = prefs_set_uint_value(pref_, new_uint_, pref_stashed);
break;
case PREF_STRING:
case PREF_SAVE_FILENAME:
case PREF_OPEN_FILENAME:
case PREF_DIRNAME:
+ case PREF_DISSECTOR:
apply = prefs_set_string_value(pref_, new_str_.toStdString().c_str(), pref_stashed);
break;
case PREF_PASSWORD:
@@ -245,13 +265,13 @@ void PreferenceEditorFrame::on_buttonBox_accepted()
pref_unstash_data_t unstashed_data;
unstashed_data.module = module_;
- unstashed_data.handle_decode_as = TRUE;
+ unstashed_data.handle_decode_as = true;
pref_unstash(pref_, &unstashed_data);
prefs_apply(module_);
prefs_main_write();
- gchar* err = NULL;
+ char* err = NULL;
if (save_decode_as_entries(&err) < 0)
{
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err);
@@ -280,7 +300,7 @@ void PreferenceEditorFrame::on_buttonBox_rejected()
void PreferenceEditorFrame::keyPressEvent(QKeyEvent *event)
{
- if (event->modifiers() == Qt::NoModifier) {
+ if (pref_ && module_ && (event->modifiers() == Qt::NoModifier)) {
if (event->key() == Qt::Key_Escape) {
on_buttonBox_rejected();
} else if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
diff --git a/ui/qt/preference_editor_frame.ui b/ui/qt/preference_editor_frame.ui
index 6b8900e2..52b11dca 100644
--- a/ui/qt/preference_editor_frame.ui
+++ b/ui/qt/preference_editor_frame.ui
@@ -54,7 +54,7 @@
</widget>
</item>
<item>
- <widget class="SyntaxLineEdit" name="preferenceLineEdit">
+ <widget class="DissectorSyntaxLineEdit" name="preferenceLineEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
@@ -106,9 +106,9 @@
<container>1</container>
</customwidget>
<customwidget>
- <class>SyntaxLineEdit</class>
- <extends>QLineEdit</extends>
- <header>widgets/syntax_line_edit.h</header>
+ <class>DissectorSyntaxLineEdit</class>
+ <extends>SyntaxLineEdit</extends>
+ <header>widgets/dissector_syntax_line_edit.h</header>
</customwidget>
</customwidgets>
<resources/>
diff --git a/ui/qt/preferences_dialog.cpp b/ui/qt/preferences_dialog.cpp
index 7f78350c..76a880e2 100644
--- a/ui/qt/preferences_dialog.cpp
+++ b/ui/qt/preferences_dialog.cpp
@@ -22,21 +22,25 @@
#include <ui/simple_dialog.h>
#include <ui/recent.h>
#include <main_window.h>
+#include <extcap.h>
#include <ui/qt/utils/qt_ui_utils.h>
#include "main_application.h"
+#include <QDesktopServices>
+#include <QUrl>
+
extern "C" {
// Callbacks prefs routines
-static guint
-module_prefs_unstash(module_t *module, gpointer data)
+static unsigned
+module_prefs_unstash(module_t *module, void *data)
{
- gboolean *must_redissect_p = static_cast<gboolean *>(data);
+ unsigned int *must_redissect_p = static_cast<unsigned int *>(data);
pref_unstash_data_t unstashed_data;
- unstashed_data.handle_decode_as = TRUE;
+ unstashed_data.handle_decode_as = true;
module->prefs_changed_flags = 0; /* assume none of them changed */
for (GList *pref_l = module->prefs; pref_l && pref_l->data; pref_l = gxx_list_next(pref_l)) {
@@ -60,8 +64,8 @@ module_prefs_unstash(module_t *module, gpointer data)
return 0; /* Keep unstashing. */
}
-static guint
-module_prefs_clean_stash(module_t *module, gpointer)
+static unsigned
+module_prefs_clean_stash(module_t *module, void *)
{
for (GList *pref_l = module->prefs; pref_l && pref_l->data; pref_l = gxx_list_next(pref_l)) {
pref_t *pref = gxx_list_data(pref_t *, pref_l);
@@ -112,6 +116,13 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
pd_ui_->splitter->setStretchFactor(0, 1);
pd_ui_->splitter->setStretchFactor(1, 5);
+
+ // The calculations done in showEvent to set the minimum size of the
+ // protocol column mean that if we load the splitter state it will become
+ // impossible to shrink the splitter below the width of the widest protocol
+ // that initially fits, so don't do this unless we change showEvent.
+ //loadSplitterState(pd_ui_->splitter);
+
pd_ui_->prefsView->sortByColumn(ModulePrefsModel::colName, Qt::AscendingOrder);
//Set the Appearance leaf to expanded
@@ -225,7 +236,7 @@ void PreferencesDialog::on_advancedSearchLineEdit_textEdited(const QString &text
* the countdown.
*/
searchLineEditText = text;
- guint gui_debounce_timer = prefs_get_uint_value("gui", "debounce.timer");
+ unsigned gui_debounce_timer = prefs_get_uint_value("gui", "debounce.timer");
searchLineEditTimer->start(gui_debounce_timer);
}
@@ -237,19 +248,25 @@ void PreferencesDialog::on_showChangedValuesCheckBox_toggled(bool checked)
pd_ui_->advancedView->expandAll();
}
-void PreferencesDialog::on_buttonBox_accepted()
+void PreferencesDialog::apply()
{
- gchar* err = NULL;
+ char* err = NULL;
unsigned int redissect_flags = 0;
// XXX - We should validate preferences as the user changes them, not here.
// XXX - We're also too enthusiastic about setting must_redissect.
- prefs_modules_foreach_submodules(NULL, module_prefs_unstash, (gpointer)&redissect_flags);
+ prefs_modules_foreach_submodules(NULL, module_prefs_unstash, (void *)&redissect_flags);
+
+ extcap_register_preferences();
if (redissect_flags & PREF_EFFECT_GUI_LAYOUT) {
// Layout type changed, reset sizes
recent.gui_geometry_main_upper_pane = 0;
recent.gui_geometry_main_lower_pane = 0;
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = NULL;
+ recent.gui_geometry_main_extra_split = NULL;
}
pd_ui_->columnFrame->unstash();
@@ -299,28 +316,41 @@ void PreferencesDialog::on_buttonBox_accepted()
mainApp->setMonospaceFont(prefs.gui_font_name);
+ if (redissect_flags & (PREF_EFFECT_GUI_COLOR)) {
+ mainApp->emitAppSignal(MainApplication::ColorsChanged);
+ }
+
if (redissect_flags & PREF_EFFECT_FIELDS) {
- mainApp->queueAppSignal(MainApplication::FieldsChanged);
+ mainApp->emitAppSignal(MainApplication::FieldsChanged);
}
if (redissect_flags & PREF_EFFECT_DISSECTION) {
// Freeze the packet list early to avoid updating column data before doing a
// full redissection. The packet list will be thawed when redissection is done.
- mainApp->queueAppSignal(MainApplication::FreezePacketList);
+ mainApp->emitAppSignal(MainApplication::FreezePacketList);
/* Redissect all the packets, and re-evaluate the display filter. */
- mainApp->queueAppSignal(MainApplication::PacketDissectionChanged);
+ mainApp->emitAppSignal(MainApplication::PacketDissectionChanged);
+ }
+
+ if (redissect_flags) {
+ mainApp->emitAppSignal(MainApplication::PreferencesChanged);
}
- mainApp->queueAppSignal(MainApplication::PreferencesChanged);
if (redissect_flags & PREF_EFFECT_GUI_LAYOUT) {
- mainApp->queueAppSignal(MainApplication::RecentPreferencesRead);
+ mainApp->emitAppSignal(MainApplication::RecentPreferencesRead);
}
if (prefs.capture_no_extcap != saved_capture_no_extcap_)
mainApp->refreshLocalInterfaces();
}
+void PreferencesDialog::on_buttonBox_accepted()
+{
+ apply();
+ accept();
+}
+
void PreferencesDialog::on_buttonBox_rejected()
{
//handle frames that don't have their own OK/Cancel "buttons"
@@ -329,9 +359,24 @@ void PreferencesDialog::on_buttonBox_rejected()
#ifdef HAVE_LIBGNUTLS
pd_ui_->rsaKeysFrame->rejectChanges();
#endif
+ reject();
+}
+
+void PreferencesDialog::on_buttonBox_clicked(QAbstractButton *button)
+{
+ if (pd_ui_->buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
+ apply();
+ }
}
void PreferencesDialog::on_buttonBox_helpRequested()
{
- mainApp->helpTopicAction(HELP_PREFERENCES_DIALOG);
+ QString help_page = modulePrefsModel_.data(pd_ui_->prefsView->currentIndex(), ModulePrefsModel::ModuleHelp).toString();
+ if (!help_page.isEmpty()) {
+ QString url = gchar_free_to_qstring(user_guide_url(help_page.toUtf8().constData()));
+ QDesktopServices::openUrl(QUrl(url));
+ } else {
+ // Generic help
+ mainApp->helpTopicAction(HELP_PREFERENCES_DIALOG);
+ }
}
diff --git a/ui/qt/preferences_dialog.h b/ui/qt/preferences_dialog.h
index 51760699..b295aeaa 100644
--- a/ui/qt/preferences_dialog.h
+++ b/ui/qt/preferences_dialog.h
@@ -20,6 +20,7 @@
#include "geometry_state_dialog.h"
class QComboBox;
+class QAbstractButton;
namespace Ui {
class PreferencesDialog;
@@ -44,6 +45,8 @@ protected:
void showEvent(QShowEvent *evt);
private:
+ void apply();
+
Ui::PreferencesDialog *pd_ui_;
QHash<QString, QWidget*> prefs_pane_to_item_;
@@ -52,7 +55,7 @@ private:
AdvancedPrefsModel advancedPrefsModel_;
AdvancedPrefDelegate advancedPrefsDelegate_;
ModulePrefsModel modulePrefsModel_;
- gboolean saved_capture_no_extcap_;
+ bool saved_capture_no_extcap_;
QTimer *searchLineEditTimer;
QString searchLineEditText;
@@ -65,6 +68,7 @@ private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
+ void on_buttonBox_clicked(QAbstractButton *button);
/**
* Update search results from the advancedSearchLineEdit field
diff --git a/ui/qt/preferences_dialog.ui b/ui/qt/preferences_dialog.ui
index e6c625bb..dc016ae0 100644
--- a/ui/qt/preferences_dialog.ui
+++ b/ui/qt/preferences_dialog.ui
@@ -111,7 +111,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::Apply</set>
</property>
</widget>
</item>
@@ -168,38 +168,4 @@
</customwidget>
</customwidgets>
<resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>PreferencesDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>PreferencesDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
</ui>
diff --git a/ui/qt/print_dialog.cpp b/ui/qt/print_dialog.cpp
index 84c2d906..413510b4 100644
--- a/ui/qt/print_dialog.cpp
+++ b/ui/qt/print_dialog.cpp
@@ -32,32 +32,32 @@ extern "C" {
// Page element callbacks
-static gboolean
-print_preamble_pd(print_stream_t *self, gchar *, const char *)
+static bool
+print_preamble_pd(print_stream_t *self, char *, const char *)
{
- if (!self) return FALSE;
+ if (!self) return false;
PrintDialog *print_dlg = static_cast<PrintDialog *>(self->data);
- if (!print_dlg) return FALSE;
+ if (!print_dlg) return false;
return print_dlg->printHeader();
}
-static gboolean
+static bool
print_line_pd(print_stream_t *self, int indent, const char *line)
{
- if (!self) return FALSE;
+ if (!self) return false;
PrintDialog *print_dlg = static_cast<PrintDialog *>(self->data);
- if (!print_dlg) return FALSE;
+ if (!print_dlg) return false;
return print_dlg->printLine(indent, line);
}
-static gboolean
+static bool
new_page_pd(print_stream_t *self)
{
- if (!self) return FALSE;
+ if (!self) return false;
PrintDialog *print_dlg = static_cast<PrintDialog *>(self->data);
- if (!print_dlg) return FALSE;
+ if (!print_dlg) return false;
return print_dlg->printHeader();
}
@@ -73,7 +73,7 @@ PrintDialog::PrintDialog(QWidget *parent, capture_file *cf, QString selRange) :
print_bt_(new QPushButton(tr("&Print…"))),
cap_file_(cf),
page_pos_(0),
- in_preview_(FALSE)
+ in_preview_(false)
{
Q_ASSERT(cf);
@@ -97,7 +97,7 @@ PrintDialog::PrintDialog(QWidget *parent, capture_file *cf, QString selRange) :
/* Init the export range */
packet_range_init(&print_args_.range, cap_file_);
/* Default to displayed packets */
- print_args_.range.process_filtered = TRUE;
+ print_args_.range.process_filtered = true;
stream_ops_.print_preamble = print_preamble_pd;
stream_ops_.print_line = print_line_pd;
@@ -107,7 +107,7 @@ PrintDialog::PrintDialog(QWidget *parent, capture_file *cf, QString selRange) :
stream_.ops = &stream_ops_;
print_args_.stream = &stream_;
- gchar *display_basename = g_filename_display_basename(cap_file_->filename);
+ char *display_basename = g_filename_display_basename(cap_file_->filename);
printer_.setDocName(display_basename);
g_free(display_basename);
@@ -136,9 +136,9 @@ PrintDialog::~PrintDialog()
delete pd_ui_;
}
-gboolean PrintDialog::printHeader()
+bool PrintDialog::printHeader()
{
- if (!cap_file_ || !cap_file_->filename || !cur_printer_ || !cur_painter_) return FALSE;
+ if (!cap_file_ || !cap_file_->filename || !cur_printer_ || !cur_painter_) return false;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
int page_top = cur_printer_->pageLayout().paintRectPixels(cur_printer_->resolution()).top();
#else
@@ -149,7 +149,7 @@ gboolean PrintDialog::printHeader()
if (in_preview_) {
// When generating a preview, only generate the first page;
// if we're past the first page, stop the printing process.
- return FALSE;
+ return false;
}
// Second and subsequent pages only
cur_printer_->newPage();
@@ -160,21 +160,21 @@ gboolean PrintDialog::printHeader()
QString banner = QString(tr("%1 %2 total packets, %3 shown"))
.arg(cap_file_->filename)
.arg(cap_file_->count)
- .arg(cap_file_->displayed_count);
+ .arg(packet_range_count(&print_args_.range));
cur_painter_->setFont(header_font_);
cur_painter_->drawText(0, page_top, banner);
}
page_pos_ += cur_painter_->fontMetrics().height();
cur_painter_->setFont(packet_font_);
- return TRUE;
+ return true;
}
-gboolean PrintDialog::printLine(int indent, const char *line)
+bool PrintDialog::printLine(int indent, const char *line)
{
QRect out_rect, page_rect;
QString out_line;
- if (!line || !cur_printer_ || !cur_painter_) return FALSE;
+ if (!line || !cur_printer_ || !cur_painter_) return false;
/* Prepare the tabs for printing, depending on tree level */
out_line.fill(' ', indent * 4);
@@ -196,13 +196,13 @@ gboolean PrintDialog::printLine(int indent, const char *line)
if (in_preview_) {
// When generating a preview, only generate the first page;
// if we're past the first page, stop the printing process.
- return FALSE;
+ return false;
}
if (*line == '\0') {
// This is an empty line, so it's a separator; no need to
// waste space printing it at the top of a page, as the
// page break suffices as a separator.
- return TRUE;
+ return true;
}
printHeader();
}
@@ -210,7 +210,7 @@ gboolean PrintDialog::printLine(int indent, const char *line)
out_rect.translate(0, page_pos_);
cur_painter_->drawText(out_rect, Qt::TextWordWrap, out_line);
page_pos_ += out_rect.height();
- return TRUE;
+ return true;
}
// Protected
@@ -287,7 +287,7 @@ void PrintDialog::printPackets(QPrinter *printer, bool in_preview)
// Don't show a progress bar if we're previewing; if it takes a
// significant amount of time to generate a preview of the first
// page, We Have A Real Problem
- cf_print_packets(cap_file_, &print_args_, in_preview ? FALSE : TRUE);
+ cf_print_packets(cap_file_, &print_args_, in_preview ? false : true);
cur_printer_ = NULL;
cur_painter_ = NULL;
painter.end();
diff --git a/ui/qt/print_dialog.h b/ui/qt/print_dialog.h
index 88bda81e..eabb0b08 100644
--- a/ui/qt/print_dialog.h
+++ b/ui/qt/print_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include <QDialog>
@@ -33,8 +31,8 @@ public:
explicit PrintDialog(QWidget *parent = 0, capture_file *cf = NULL, QString selRange = QString());
~PrintDialog();
- gboolean printHeader();
- gboolean printLine(int indent, const char *line);
+ bool printHeader();
+ bool printLine(int indent, const char *line);
protected:
virtual void keyPressEvent(QKeyEvent *event) override;
diff --git a/ui/qt/profile_dialog.cpp b/ui/qt/profile_dialog.cpp
index 5b53a2cf..9de24054 100644
--- a/ui/qt/profile_dialog.cpp
+++ b/ui/qt/profile_dialog.cpp
@@ -8,11 +8,8 @@
*/
#include "config.h"
-#include <glib.h>
#include "wsutil/filesystem.h"
-#include "wsutil/utf8_entities.h"
-#include "epan/prefs.h"
#include <ui/qt/utils/qt_ui_utils.h>
@@ -27,6 +24,7 @@
#include "main_application.h"
#include <ui/qt/utils/color_utils.h>
#include <ui/qt/simple_dialog.h>
+#include <ui/qt/widgets/wireshark_file_dialog.h>
#include <QBrush>
#include <QDir>
@@ -37,7 +35,6 @@
#include <QUrl>
#include <QComboBox>
#include <QLineEdit>
-#include <QFileDialog>
#include <QStandardPaths>
#include <QKeyEvent>
#include <QMenu>
@@ -74,9 +71,16 @@ ProfileDialog::ProfileDialog(QWidget *parent) :
pd_ui_->hintLabel->setAttribute(Qt::WA_MacSmallSize, true);
#endif
+ QString as_tooltip = pd_ui_->autoSwitchLimitLabel->toolTip();
+ pd_ui_->autoSwitchSpinBox->setToolTip(as_tooltip);
+ if (!is_packet_configuration_namespace()) {
+ pd_ui_->autoSwitchLimitLabel->setText(tr("Auto switch event limit"));
+ }
+ pd_ui_->autoSwitchSpinBox->setValue(recent.gui_profile_switch_check_count);
+
import_button_ = pd_ui_->buttonBox->addButton(tr("Import", "noun"), QDialogButtonBox::ActionRole);
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
export_button_ = pd_ui_->buttonBox->addButton(tr("Export", "noun"), QDialogButtonBox::ActionRole);
QMenu * importMenu = new QMenu(import_button_);
@@ -112,13 +116,23 @@ ProfileDialog::ProfileDialog(QWidget *parent) :
currentItemChanged();
+ connect(pd_ui_->newToolButton, &StockIconToolButton::clicked, this, &ProfileDialog::newToolButtonClicked);
+ connect(pd_ui_->deleteToolButton, &StockIconToolButton::clicked, this, &ProfileDialog::deleteToolButtonClicked);
+ connect(pd_ui_->copyToolButton, &StockIconToolButton::clicked, this, &ProfileDialog::copyToolButtonClicked);
+ connect(pd_ui_->buttonBox, &QDialogButtonBox::accepted, this, &ProfileDialog::buttonBoxAccepted);
+ connect(pd_ui_->buttonBox, &QDialogButtonBox::rejected, this, &ProfileDialog::buttonBoxRejected);
+ connect(pd_ui_->buttonBox, &QDialogButtonBox::helpRequested, this, &ProfileDialog::buttonBoxHelpRequested);
+
+ pd_ui_->profileTreeView->resizeColumnToContents(ProfileModel::COL_NAME);
+ pd_ui_->profileTreeView->resizeColumnToContents(ProfileModel::COL_TYPE);
+
pd_ui_->profileTreeView->setFocus();
}
ProfileDialog::~ProfileDialog()
{
delete pd_ui_;
- empty_profile_list (TRUE);
+ empty_profile_list (true);
}
void ProfileDialog::keyPressEvent(QKeyEvent *evt)
@@ -149,11 +163,11 @@ int ProfileDialog::execAction(ProfileDialog::ProfileAction profile_action)
ret = exec();
break;
case NewProfile:
- on_newToolButton_clicked();
+ newToolButtonClicked();
ret = exec();
break;
case ImportZipProfile:
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
importFromZip();
#endif
break;
@@ -161,12 +175,12 @@ int ProfileDialog::execAction(ProfileDialog::ProfileAction profile_action)
importFromDirectory();
break;
case ExportSingleProfile:
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
exportProfiles();
#endif
break;
case ExportAllProfiles:
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
exportProfiles(true);
#endif
break;
@@ -249,7 +263,7 @@ void ProfileDialog::updateWidgets()
import_button_->setToolTip(msg);
import_button_->setEnabled(enable_import);
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
bool contains_user = false;
bool enable_export = false;
@@ -294,7 +308,7 @@ void ProfileDialog::updateWidgets()
msg = tr("%Ln Selected Personal Profile(s)...", "", user_profiles);
pd_ui_->hintLabel->setText(msg);
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
export_selected_entry_->setText(msg);
#endif
}
@@ -314,7 +328,7 @@ void ProfileDialog::updateWidgets()
}
pd_ui_->copyToolButton->setEnabled(true);
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
export_selected_entry_->setText(msg);
#endif
}
@@ -365,9 +379,6 @@ void ProfileDialog::updateWidgets()
pd_ui_->hintLabel->setUrl(hintUrl);
- /* ensure the name column is resized to it's content */
- pd_ui_->profileTreeView->resizeColumnToContents(ProfileModel::COL_NAME);
-
pd_ui_->deleteToolButton->setEnabled(enable_del);
ok_button_->setEnabled(enable_ok);
}
@@ -377,7 +388,7 @@ void ProfileDialog::currentItemChanged(const QModelIndex &, const QModelIndex &)
updateWidgets();
}
-void ProfileDialog::on_newToolButton_clicked()
+void ProfileDialog::newToolButtonClicked()
{
pd_ui_->lineProfileFilter->setText("");
pd_ui_->cmbProfileTypes->setCurrentIndex(ProfileSortModel::AllProfiles);
@@ -395,7 +406,7 @@ void ProfileDialog::on_newToolButton_clicked()
updateWidgets();
}
-void ProfileDialog::on_deleteToolButton_clicked()
+void ProfileDialog::deleteToolButtonClicked()
{
QModelIndexList profiles = selectedProfiles();
if (profiles.count() <= 0)
@@ -417,7 +428,7 @@ void ProfileDialog::on_deleteToolButton_clicked()
updateWidgets();
}
-void ProfileDialog::on_copyToolButton_clicked()
+void ProfileDialog::copyToolButtonClicked()
{
QModelIndexList profiles = selectedProfiles();
if (profiles.count() > 1)
@@ -444,11 +455,13 @@ void ProfileDialog::on_copyToolButton_clicked()
updateWidgets();
}
-void ProfileDialog::on_buttonBox_accepted()
+void ProfileDialog::buttonBoxAccepted()
{
bool write_recent = true;
bool item_data_removed = false;
+ recent.gui_profile_switch_check_count = pd_ui_->autoSwitchSpinBox->value();
+
QModelIndex index = sort_model_->mapToSource(pd_ui_->profileTreeView->currentIndex());
pd_ui_->buttonBox->setFocus();
@@ -483,7 +496,7 @@ void ProfileDialog::on_buttonBox_accepted()
write_profile_recent();
}
- gchar * err_msg = Q_NULLPTR;
+ char * err_msg = Q_NULLPTR;
if ((err_msg = apply_profile_changes()) != Q_NULLPTR) {
QMessageBox::critical(this, tr("Profile Error"),
err_msg,
@@ -512,22 +525,22 @@ void ProfileDialog::on_buttonBox_accepted()
if (profileName.length() > 0 && model_->findByName(profileName) >= 0) {
// The new profile exists, change.
- mainApp->setConfigurationProfile (profileName.toUtf8().constData(), FALSE);
+ mainApp->setConfigurationProfile (profileName.toUtf8().constData(), false);
} else if (!model_->activeProfile().isValid()) {
// The new profile does not exist, and the previous profile has
// been deleted. Change to the default profile.
- mainApp->setConfigurationProfile (Q_NULLPTR, FALSE);
+ mainApp->setConfigurationProfile (Q_NULLPTR, false);
}
}
-void ProfileDialog::on_buttonBox_rejected()
+void ProfileDialog::buttonBoxRejected()
{
QString msg;
if (! model_->clearImported(&msg))
QMessageBox::critical(this, tr("Error"), msg);
}
-void ProfileDialog::on_buttonBox_helpRequested()
+void ProfileDialog::buttonBoxHelpRequested()
{
mainApp->helpTopicAction(HELP_CONFIG_PROFILES_DIALOG);
}
@@ -558,14 +571,12 @@ void ProfileDialog::filterChanged(const QString &text)
else if (qobject_cast<QLineEdit *>(sender()))
sort_model_->setFilterString(text);
- pd_ui_->profileTreeView->resizeColumnToContents(ProfileModel::COL_NAME);
-
QModelIndex active = sort_model_->mapFromSource(model_->activeProfile());
if (active.isValid())
pd_ui_->profileTreeView->setCurrentIndex(active);
}
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
void ProfileDialog::exportProfiles(bool exportAllPersonalProfiles)
{
QAction * action = qobject_cast<QAction *>(sender());
@@ -604,7 +615,7 @@ void ProfileDialog::exportProfiles(bool exportAllPersonalProfiles)
return;
}
- QString zipFile = QFileDialog::getSaveFileName(this, tr("Select zip file for export"), openDialogInitialDir(), tr("Zip File (*.zip)"));
+ QString zipFile = WiresharkFileDialog::getSaveFileName(this, tr("Select zip file for export"), openDialogInitialDir(), tr("Zip File (*.zip)"));
if (zipFile.length() > 0)
{
@@ -627,7 +638,7 @@ void ProfileDialog::exportProfiles(bool exportAllPersonalProfiles)
{
QString msg = tr("An error has occurred while exporting profiles");
if (err.length() > 0)
- msg.append(QString("\n\n%1: %3").arg(tr("Error")).arg(err));
+ msg.append(QString("\n\n%1: %2").arg(tr("Error"), err));
QMessageBox::critical(this, tr("Exporting profiles"), msg);
}
}
@@ -635,7 +646,7 @@ void ProfileDialog::exportProfiles(bool exportAllPersonalProfiles)
void ProfileDialog::importFromZip()
{
- QString zipFile = QFileDialog::getOpenFileName(this, tr("Select zip file for import"), openDialogInitialDir(), tr("Zip File (*.zip)"));
+ QString zipFile = WiresharkFileDialog::getOpenFileName(this, tr("Select zip file for import"), openDialogInitialDir(), tr("Zip File (*.zip)"));
QFileInfo fi(zipFile);
if (! fi.exists())
@@ -651,7 +662,7 @@ void ProfileDialog::importFromZip()
void ProfileDialog::importFromDirectory()
{
- QString importDir = QFileDialog::getExistingDirectory(this, tr("Select directory for import"), openDialogInitialDir());
+ QString importDir = WiresharkFileDialog::getExistingDirectory(this, tr("Select directory for import"), openDialogInitialDir());
QFileInfo fi(importDir);
if (! fi.isDir())
@@ -726,11 +737,8 @@ void ProfileDialog::resetTreeView()
selectionChanged();
- if (sort_model_->columnCount() <= 1)
+ if (sort_model_->columnCount() <= 1) {
pd_ui_->profileTreeView->header()->hide();
- else
- {
- pd_ui_->profileTreeView->header()->setStretchLastSection(false);
- pd_ui_->profileTreeView->header()->setSectionResizeMode(ProfileModel::COL_NAME, QHeaderView::Stretch);
}
}
+
diff --git a/ui/qt/profile_dialog.h b/ui/qt/profile_dialog.h
index d42594f0..5ffc69f7 100644
--- a/ui/qt/profile_dialog.h
+++ b/ui/qt/profile_dialog.h
@@ -40,8 +40,8 @@ public:
/**
* @brief Select the profile with the given name.
*
- * If the profile name is empty, the currently selected profile will be choosen instead.
- * If the choosen profile is invalid, the first row will be choosen.
+ * If the profile name is empty, the currently selected profile will be chosen instead.
+ * If the chosen profile is invalid, the first row will be chosen.
*
* @param profile the name of the profile to be selected
*/
@@ -54,7 +54,7 @@ private:
Ui::ProfileDialog *pd_ui_;
QPushButton *ok_button_;
QPushButton *import_button_;
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
QPushButton *export_button_;
QAction *export_selected_entry_;
#endif
@@ -68,18 +68,18 @@ private:
private slots:
void currentItemChanged(const QModelIndex & c = QModelIndex(), const QModelIndex & p = QModelIndex());
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
void exportProfiles(bool exportAllPersonalProfiles = false);
void importFromZip();
#endif
void importFromDirectory();
- void on_newToolButton_clicked();
- void on_deleteToolButton_clicked();
- void on_copyToolButton_clicked();
- void on_buttonBox_accepted();
- void on_buttonBox_rejected();
- void on_buttonBox_helpRequested();
+ void newToolButtonClicked();
+ void deleteToolButtonClicked();
+ void copyToolButtonClicked();
+ void buttonBoxAccepted();
+ void buttonBoxRejected();
+ void buttonBoxHelpRequested();
void dataChanged(const QModelIndex &);
void filterChanged(const QString &);
diff --git a/ui/qt/profile_dialog.ui b/ui/qt/profile_dialog.ui
index fcc7591f..5f5bdf38 100644
--- a/ui/qt/profile_dialog.ui
+++ b/ui/qt/profile_dialog.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>570</width>
+ <width>600</width>
<height>400</height>
</rect>
</property>
@@ -54,7 +54,7 @@
</widget>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0">
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,0,0,0,0">
<item>
<widget class="StockIconToolButton" name="newToolButton">
<property name="toolTip">
@@ -95,6 +95,42 @@
</widget>
</item>
<item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>5</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="autoSwitchLimitLabel">
+ <property name="toolTip">
+ <string>The number of packets or events to check for automatic profile switching.</string>
+ </property>
+ <property name="text">
+ <string>Auto switch packet limit</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="autoSwitchSpinBox">
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::NoButtons</enum>
+ </property>
+ <property name="maximum">
+ <number>10000000</number>
+ </property>
+ <property name="singleStep">
+ <number>1000</number>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
diff --git a/ui/qt/progress_frame.cpp b/ui/qt/progress_frame.cpp
index 2e40ac80..33306ebc 100644
--- a/ui/qt/progress_frame.cpp
+++ b/ui/qt/progress_frame.cpp
@@ -28,8 +28,8 @@
// - Don't complain so loudly when the user stops a capture.
progdlg_t *
-create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title,
- gboolean terminate_is_stop, gboolean *stop_flag) {
+create_progress_dlg(void *top_level_window, const char *task_title, const char *item_title,
+ bool terminate_is_stop, bool *stop_flag) {
ProgressFrame *pf;
QWidget *main_window;
@@ -57,9 +57,9 @@ create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gc
}
progdlg_t *
-delayed_create_progress_dlg(gpointer top_level_window, const gchar *task_title, const gchar *item_title,
- gboolean terminate_is_stop, gboolean *stop_flag,
- gfloat progress)
+delayed_create_progress_dlg(void *top_level_window, const char *task_title, const char *item_title,
+ bool terminate_is_stop, bool *stop_flag,
+ float progress)
{
progdlg_t *progress_dialog = create_progress_dlg(top_level_window, task_title, item_title, terminate_is_stop, stop_flag);
update_progress_dlg(progress_dialog, progress, item_title);
@@ -70,7 +70,7 @@ delayed_create_progress_dlg(gpointer top_level_window, const gchar *task_title,
* Update the progress information of the progress bar box.
*/
void
-update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *)
+update_progress_dlg(progdlg_t *dlg, float percentage, const char *)
{
if (!dlg) return;
@@ -145,8 +145,8 @@ ProgressFrame::ProgressFrame(QWidget *parent) :
effect_ = new QGraphicsOpacityEffect(this);
animation_ = new QPropertyAnimation(effect_, "opacity", this);
- connect(this, SIGNAL(showRequested(bool,bool,gboolean*)),
- this, SLOT(show(bool,bool,gboolean*)));
+ connect(this, SIGNAL(showRequested(bool,bool,bool*)),
+ this, SLOT(show(bool,bool,bool*)));
hide();
}
@@ -155,17 +155,13 @@ ProgressFrame::~ProgressFrame()
delete ui;
}
-struct progdlg *ProgressFrame::showProgress(const QString &title, bool animate, bool terminate_is_stop, gboolean *stop_flag, int value)
+struct progdlg *ProgressFrame::showProgress(const QString &title, bool animate, bool terminate_is_stop, bool *stop_flag, int value)
{
setMaximumValue(100);
ui->progressBar->setValue(value);
QString elided_title = title;
int max_w = fontMetrics().height() * 20; // em-widths, arbitrary
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
int title_w = fontMetrics().horizontalAdvance(title);
-#else
- int title_w = fontMetrics().width(title);
-#endif
if (title_w > max_w) {
elided_title = fontMetrics().elidedText(title, Qt::ElideRight, max_w);
}
@@ -175,7 +171,7 @@ struct progdlg *ProgressFrame::showProgress(const QString &title, bool animate,
return &progress_dialog_;
}
-progdlg *ProgressFrame::showBusy(bool animate, bool terminate_is_stop, gboolean *stop_flag)
+progdlg *ProgressFrame::showBusy(bool animate, bool terminate_is_stop, bool *stop_flag)
{
setMaximumValue(0);
emit showRequested(animate, terminate_is_stop, stop_flag);
@@ -209,8 +205,8 @@ void ProgressFrame::addToButtonBox(QDialogButtonBox *button_box, QObject *main_w
int one_em = progress_frame->fontMetrics().height();
progress_frame->setMaximumWidth(one_em * 8);
- connect(main_progress_frame, SIGNAL(showRequested(bool,bool,gboolean*)),
- progress_frame, SLOT(show(bool,bool,gboolean*)));
+ connect(main_progress_frame, SIGNAL(showRequested(bool,bool,bool*)),
+ progress_frame, SLOT(show(bool,bool,bool*)));
connect(main_progress_frame, SIGNAL(maximumValueChanged(int)),
progress_frame, SLOT(setMaximumValue(int)));
connect(main_progress_frame, SIGNAL(valueChanged(int)),
@@ -226,12 +222,12 @@ void ProgressFrame::captureFileClosing()
{
// Hide any paired ProgressFrames and disconnect from them.
emit setHidden();
- disconnect(SIGNAL(showRequested(bool,bool,gboolean*)));
+ disconnect(SIGNAL(showRequested(bool,bool,bool*)));
disconnect(SIGNAL(maximumValueChanged(int)));
disconnect(SIGNAL(valueChanged(int)));
- connect(this, SIGNAL(showRequested(bool,bool,gboolean*)),
- this, SLOT(show(bool,bool,gboolean*)));
+ connect(this, SIGNAL(showRequested(bool,bool,bool*)),
+ this, SLOT(show(bool,bool,bool*)));
}
void ProgressFrame::setValue(int value)
@@ -281,7 +277,7 @@ void ProgressFrame::on_stopButton_clicked()
const int show_delay_ = 150; // ms
-void ProgressFrame::show(bool animate, bool terminate_is_stop, gboolean *stop_flag)
+void ProgressFrame::show(bool animate, bool terminate_is_stop, bool *stop_flag)
{
terminate_is_stop_ = terminate_is_stop;
stop_flag_ = stop_flag;
diff --git a/ui/qt/progress_frame.h b/ui/qt/progress_frame.h
index 241afab8..368e519a 100644
--- a/ui/qt/progress_frame.h
+++ b/ui/qt/progress_frame.h
@@ -10,8 +10,6 @@
#ifndef PROGRESS_FRAME_H
#define PROGRESS_FRAME_H
-#include <glib.h>
-
#include <QFrame>
namespace Ui {
@@ -50,13 +48,13 @@ public:
void captureFileClosing();
public slots:
- struct progdlg *showProgress(const QString &title, bool animate, bool terminate_is_stop, gboolean *stop_flag, int value = 0);
- struct progdlg *showBusy(bool animate, bool terminate_is_stop, gboolean *stop_flag);
+ struct progdlg *showProgress(const QString &title, bool animate, bool terminate_is_stop, bool *stop_flag, int value = 0);
+ struct progdlg *showBusy(bool animate, bool terminate_is_stop, bool *stop_flag);
void setValue(int value);
void hide();
signals:
- void showRequested(bool animate, bool terminate_is_stop, gboolean *stop_flag);
+ void showRequested(bool animate, bool terminate_is_stop, bool *stop_flag);
void valueChanged(int value);
void maximumValueChanged(int value);
void setHidden();
@@ -72,7 +70,7 @@ private:
QString message_;
QString status_;
bool terminate_is_stop_;
- gboolean *stop_flag_;
+ bool *stop_flag_;
int show_timer_;
QGraphicsOpacityEffect *effect_;
QPropertyAnimation *animation_;
@@ -84,7 +82,7 @@ private:
private slots:
void on_stopButton_clicked();
- void show(bool animate, bool terminate_is_stop, gboolean *stop_flag);
+ void show(bool animate, bool terminate_is_stop, bool *stop_flag);
void setMaximumValue(int value);
};
diff --git a/ui/qt/proto_tree.cpp b/ui/qt/proto_tree.cpp
index 77af8d22..0db9eaa5 100644
--- a/ui/qt/proto_tree.cpp
+++ b/ui/qt/proto_tree.cpp
@@ -26,6 +26,7 @@
#include <ui/qt/show_packet_bytes_dialog.h>
#include <ui/qt/filter_action.h>
#include <ui/qt/follow_stream_action.h>
+#include <ui/qt/io_graph_action.h>
#include <ui/all_files_wildcard.h>
#include <ui/alert_box.h>
#include <ui/urls.h>
@@ -174,7 +175,7 @@ void ProtoTree::ctxCopySelectedInfo()
case ProtoTree::Value:
{
epan_dissect_t *edt = cap_file_ ? cap_file_->edt : edt_;
- gchar* field_str = get_node_field_value(finfo.fieldInfo(), edt);
+ char* field_str = get_node_field_value(finfo.fieldInfo(), edt);
clip.append(field_str);
g_free(field_str);
}
@@ -216,7 +217,7 @@ void ProtoTree::ctxOpenUrlWiki()
if (ret != QMessageBox::Yes) return;
- url = QString(WS_WIKI_URL("%1")).arg(proto_abbrev);
+ url = QString(WS_WIKI_URL("Protocols/%1")).arg(proto_abbrev);
}
else
{
@@ -334,7 +335,10 @@ void ProtoTree::contextMenuEvent(QContextMenuEvent *event)
ctx_menu->addSeparator();
}
+ ctx_menu->addMenu(IOGraphAction::createMenu(finfo->headerInfo(), ctx_menu));
+
submenu = ctx_menu->addMenu(tr("Copy"));
+ submenu->setToolTipsVisible(true);
submenu->addAction(tr("All Visible Items"), this, SLOT(ctxCopyVisibleItems()));
action = submenu->addAction(tr("All Visible Selected Tree Items"), this, SLOT(ctxCopyVisibleItems()));
action->setProperty("selected_tree", QVariant::fromValue(true));
@@ -356,7 +360,9 @@ void ProtoTree::contextMenuEvent(QContextMenuEvent *event)
action = window()->findChild<QAction *>("actionAnalyzeShowPacketBytes");
ctx_menu->addAction(action);
action = window()->findChild<QAction *>("actionFileExportPacketBytes");
- ctx_menu->addAction(action);
+ if (action) {
+ ctx_menu->addAction(action);
+ }
ctx_menu->addSeparator();
}
@@ -395,12 +401,14 @@ void ProtoTree::contextMenuEvent(QContextMenuEvent *event)
if (! buildForDialog)
{
- QAction *decode_as_ = window()->findChild<QAction *>("actionAnalyzeDecodeAs");
- ctx_menu->addAction(decode_as_);
- decode_as_->setProperty("create_new", QVariant::fromValue(true));
+ QAction *decode_as = window()->findChild<QAction *>("actionAnalyzeDecodeAs");
+ if (decode_as) {
+ ctx_menu->addAction(decode_as);
+ decode_as->setProperty("create_new", QVariant::fromValue(true));
- ctx_menu->addAction(window()->findChild<QAction *>("actionGoGoToLinkedPacket"));
- ctx_menu->addAction(window()->findChild<QAction *>("actionContextShowLinkedPacketInNewWindow"));
+ ctx_menu->addAction(window()->findChild<QAction *>("actionGoGoToLinkedPacket"));
+ ctx_menu->addAction(window()->findChild<QAction *>("actionContextShowLinkedPacketInNewWindow"));
+ }
}
// The "text only" header field will not give preferences for the selected protocol.
@@ -460,7 +468,7 @@ void ProtoTree::setMonospaceFont(const QFont &mono_font)
update();
}
-void ProtoTree::foreachTreeNode(proto_node *node, gpointer proto_tree_ptr)
+void ProtoTree::foreachTreeNode(proto_node *node, void *proto_tree_ptr)
{
ProtoTree *tree_view = static_cast<ProtoTree *>(proto_tree_ptr);
ProtoTreeModel *model = qobject_cast<ProtoTreeModel *>(tree_view->model());
@@ -478,6 +486,7 @@ void ProtoTree::foreachTreeNode(proto_node *node, gpointer proto_tree_ptr)
proto_tree_children_foreach(node, foreachTreeNode, proto_tree_ptr);
}
+// NOLINTNEXTLINE(misc-no-recursion)
void ProtoTree::foreachExpand(const QModelIndex &index = QModelIndex()) {
// Restore expanded state. (Note QModelIndex() refers to the root node)
@@ -490,6 +499,7 @@ void ProtoTree::foreachExpand(const QModelIndex &index = QModelIndex()) {
if (node && node->isValid() && tree_expanded(node->protoNode()->finfo->tree_type)) {
expand(childIndex);
}
+ // We recurse here, but we're limited by tree depth checks in epan
foreachExpand(childIndex);
}
}
@@ -571,7 +581,7 @@ void ProtoTree::syncExpanded(const QModelIndex &index) {
* are thus presumably leaf nodes and cannot be expanded.
*/
if (finfo.treeType() != -1) {
- tree_expanded_set(finfo.treeType(), TRUE);
+ tree_expanded_set(finfo.treeType(), true);
}
}
@@ -584,7 +594,7 @@ void ProtoTree::syncCollapsed(const QModelIndex &index) {
* are thus presumably leaf nodes and cannot be collapsed.
*/
if (finfo.treeType() != -1) {
- tree_expanded_set(finfo.treeType(), FALSE);
+ tree_expanded_set(finfo.treeType(), false);
}
}
@@ -635,7 +645,7 @@ void ProtoTree::collapseSubtrees()
void ProtoTree::expandAll()
{
for (int i = 0; i < num_tree_types; i++) {
- tree_expanded_set(i, TRUE);
+ tree_expanded_set(i, true);
}
QTreeView::expandAll();
updateContentWidth();
@@ -644,7 +654,7 @@ void ProtoTree::expandAll()
void ProtoTree::collapseAll()
{
for (int i = 0; i < num_tree_types; i++) {
- tree_expanded_set(i, FALSE);
+ tree_expanded_set(i, false);
}
QTreeView::collapseAll();
updateContentWidth();
@@ -776,6 +786,7 @@ void ProtoTree::restoreSelectedField()
autoScrollTo(cur_index);
}
+// NOLINTNEXTLINE(misc-no-recursion)
QString ProtoTree::traverseTree(const QModelIndex & travTree, int identLevel) const
{
QString result = "";
@@ -792,6 +803,7 @@ QString ProtoTree::traverseTree(const QModelIndex & travTree, int identLevel) co
int children = proto_tree_model_->rowCount(travTree);
identLevel++;
for (int child = 0; child < children; child++)
+ // We recurse here, but we're limited by tree depth checks in epan
result += traverseTree(proto_tree_model_->index(child, 0, travTree), identLevel);
}
}
diff --git a/ui/qt/proto_tree.h b/ui/qt/proto_tree.h
index 511063e9..ca08668b 100644
--- a/ui/qt/proto_tree.h
+++ b/ui/qt/proto_tree.h
@@ -70,7 +70,7 @@ private:
epan_dissect_t *edt_;
void saveSelectedField(QModelIndex &index);
- static void foreachTreeNode(proto_node *node, gpointer proto_tree_ptr);
+ static void foreachTreeNode(proto_node *node, void *proto_tree_ptr);
void foreachExpand(const QModelIndex &index);
signals:
diff --git a/ui/qt/protocol_hierarchy_dialog.cpp b/ui/qt/protocol_hierarchy_dialog.cpp
index a97f37b7..fefb0b5c 100644
--- a/ui/qt/protocol_hierarchy_dialog.cpp
+++ b/ui/qt/protocol_hierarchy_dialog.cpp
@@ -305,7 +305,7 @@ void ProtocolHierarchyDialog::filterActionTriggered()
emit filterAction(filter_name, fa->action(), fa->actionType());
}
-void ProtocolHierarchyDialog::addTreeNode(GNode *node, gpointer data)
+void ProtocolHierarchyDialog::addTreeNode(GNode *node, void *data)
{
ph_stats_node_t *stats = (ph_stats_node_t *)node->data;
if (!stats) return;
diff --git a/ui/qt/protocol_hierarchy_dialog.h b/ui/qt/protocol_hierarchy_dialog.h
index 08f3dfd2..33191d1e 100644
--- a/ui/qt/protocol_hierarchy_dialog.h
+++ b/ui/qt/protocol_hierarchy_dialog.h
@@ -55,7 +55,7 @@ private:
QSet<QString> used_protos_;
// Callback for g_node_children_foreach
- static void addTreeNode(GNode *node, gpointer data);
+ static void addTreeNode(GNode *node, void *data);
void updateWidgets();
QList<QVariant> protoHierRowData(QTreeWidgetItem *item) const;
};
diff --git a/ui/qt/protocol_preferences_menu.cpp b/ui/qt/protocol_preferences_menu.cpp
index 75c3515c..4beff2fd 100644
--- a/ui/qt/protocol_preferences_menu.cpp
+++ b/ui/qt/protocol_preferences_menu.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/prefs.h>
#include <epan/prefs-int.h>
#include <epan/proto.h>
@@ -118,7 +116,7 @@ public:
}
void showUatDialog() {
- UatDialog *uat_dlg = new UatDialog(qobject_cast<QWidget*>(parent()), prefs_get_uat_value(pref_));
+ UatDialog *uat_dlg = new UatDialog(mainApp->mainWindow(), prefs_get_uat_value(pref_));
connect(uat_dlg, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
uat_dlg->setWindowModality(Qt::ApplicationModal);
uat_dlg->setAttribute(Qt::WA_DeleteOnClose);
@@ -154,8 +152,8 @@ private:
extern "C" {
// Preference callback
-static guint
-add_prefs_menu_item(pref_t *pref, gpointer menu_ptr)
+static unsigned
+add_prefs_menu_item(pref_t *pref, void *menu_ptr)
{
ProtocolPreferencesMenu *pp_menu = static_cast<ProtocolPreferencesMenu *>(menu_ptr);
if (!pp_menu) return 1;
@@ -267,9 +265,9 @@ void ProtocolPreferencesMenu::addMenuItem(preference *pref)
case PREF_OPEN_FILENAME:
case PREF_DIRNAME:
case PREF_RANGE:
- case PREF_DECODE_AS_UINT:
case PREF_DECODE_AS_RANGE:
case PREF_PASSWORD:
+ case PREF_DISSECTOR:
{
EditorPreferenceAction *epa = new EditorPreferenceAction(pref, this);
addAction(epa);
diff --git a/ui/qt/remote_capture_dialog.cpp b/ui/qt/remote_capture_dialog.cpp
index dff16527..f9a183b2 100644
--- a/ui/qt/remote_capture_dialog.cpp
+++ b/ui/qt/remote_capture_dialog.cpp
@@ -11,8 +11,8 @@
#include "config.h"
#ifdef HAVE_PCAP_REMOTE
-#include <glib.h>
#include <ui/qt/utils/qt_ui_utils.h>
+#include <ui/qt/utils/variant_pointer.h>
#include "ui/capture_globals.h"
#include "remote_capture_dialog.h"
#include <ui_remote_capture_dialog.h>
@@ -49,7 +49,11 @@ void RemoteCaptureDialog::hostChanged(const QString host)
recent_free_remote_host_list();
ui->hostCombo->clear();
} else {
- struct remote_host *rh = recent_get_remote_host(host.toUtf8().constData());
+ const struct remote_host *rh = nullptr;
+ int index = ui->hostCombo->findText(host);
+ if (index != -1) {
+ rh = VariantPointer<const struct remote_host>::asPtr(ui->hostCombo->itemData(index));
+ }
if (rh) {
ui->portText->setText(QString(rh->remote_port));
if (rh->auth_type == CAPTURE_AUTH_NULL) {
@@ -62,10 +66,11 @@ void RemoteCaptureDialog::hostChanged(const QString host)
}
-static void fillBox(gpointer key, gpointer, gpointer user_data)
+static void fillBox(void *value, void *user_data)
{
QComboBox *cb = (QComboBox *)user_data;
- cb->addItem(QString((gchar*)key));
+ struct remote_host* rh = (struct remote_host*)value;
+ cb->addItem(QString((char*)rh->r_host), VariantPointer<const struct remote_host>::asQVariant(rh));
}
void RemoteCaptureDialog::fillComboBox()
@@ -84,10 +89,13 @@ void RemoteCaptureDialog::fillComboBox()
void RemoteCaptureDialog::apply_remote()
{
int err;
- gchar *err_str;
+ char *err_str;
remote_options global_remote_opts;
QString host = ui->hostCombo->currentText();
+ if (host.isEmpty()) {
+ return;
+ }
global_remote_opts.src_type = CAPTURE_IFREMOTE;
global_remote_opts.remote_host_opts.remote_host = qstring_strdup(host);
QString port = ui->portText->text();
@@ -101,9 +109,9 @@ void RemoteCaptureDialog::apply_remote()
global_remote_opts.remote_host_opts.auth_username = qstring_strdup(user);
QString pw = ui->pwText->text();
global_remote_opts.remote_host_opts.auth_password = qstring_strdup(pw);
- global_remote_opts.remote_host_opts.datatx_udp = FALSE;
- global_remote_opts.remote_host_opts.nocap_rpcap = TRUE;
- global_remote_opts.remote_host_opts.nocap_local = FALSE;
+ global_remote_opts.remote_host_opts.datatx_udp = false;
+ global_remote_opts.remote_host_opts.nocap_rpcap = true;
+ global_remote_opts.remote_host_opts.nocap_local = false;
#ifdef HAVE_PCAP_SETSAMPLING
global_remote_opts.sampling_method = CAPTURE_SAMP_NONE;
global_remote_opts.sampling_param = 0;
@@ -126,24 +134,28 @@ void RemoteCaptureDialog::apply_remote()
QMessageBox::critical(this, tr("Error"), "Unknown error");
return;
}
- if (ui->hostCombo->count() == 0) {
- ui->hostCombo->addItem("");
- ui->hostCombo->addItem(host);
- ui->hostCombo->insertSeparator(2);
- ui->hostCombo->addItem(QString(tr("Clear list")));
- } else {
- ui->hostCombo->insertItem(0, host);
- }
- struct remote_host *rh = recent_get_remote_host(host.toUtf8().constData());
- if (!rh) {
- rh = (struct remote_host *)g_malloc (sizeof (*rh));
- rh->r_host = qstring_strdup(host);
- rh->remote_port = qstring_strdup(port);
- rh->auth_type = global_remote_opts.remote_host_opts.auth_type;
- rh->auth_password = g_strdup("");
- rh->auth_username = g_strdup("");
- recent_add_remote_host(global_remote_opts.remote_host_opts.remote_host, rh);
- }
+
+ // Add the remote host even if it already exists, to update the port and
+ // auth type and move it to the front.
+ struct remote_host* rh;
+ rh = (struct remote_host *)g_malloc (sizeof (*rh));
+ rh->r_host = qstring_strdup(host);
+ rh->remote_port = qstring_strdup(port);
+ rh->auth_type = global_remote_opts.remote_host_opts.auth_type;
+ rh->auth_password = g_strdup("");
+ rh->auth_username = g_strdup("");
+ recent_add_remote_host(global_remote_opts.remote_host_opts.remote_host, rh);
+
+ // We don't need to add the new entry to hostCombo since we only call
+ // this when accepting the dialog.
+
+ // Tell the parent ManageInterfacesDialog we added this.
+ // XXX: If the remote hostname already exists in ManageInterfacesDialog,
+ // this doesn't remove it. Most of the time it won't, but there is the
+ // corner case of a host existing with empty (hence default, 2002) port,
+ // and then adding it a second time explicitly starting port 2002.
+ // Someone could bind rpcapd to multiple ports on the same host for
+ // some reason too, I suppose.
emit remoteAdded(rlist, &global_remote_opts);
}
diff --git a/ui/qt/remote_capture_dialog.h b/ui/qt/remote_capture_dialog.h
index 86ef0740..fee75d89 100644
--- a/ui/qt/remote_capture_dialog.h
+++ b/ui/qt/remote_capture_dialog.h
@@ -14,10 +14,8 @@
#ifdef HAVE_PCAP_REMOTE
#include <QDialog>
-#include <glib.h>
#include "capture_opts.h"
-
namespace Ui {
class RemoteCaptureDialog;
}
diff --git a/ui/qt/resolved_addresses_dialog.cpp b/ui/qt/resolved_addresses_dialog.cpp
index dfe51c84..e4507294 100644
--- a/ui/qt/resolved_addresses_dialog.cpp
+++ b/ui/qt/resolved_addresses_dialog.cpp
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include "file.h"
#include "epan/addr_resolv.h"
@@ -43,6 +41,11 @@ ResolvedAddressesDialog::ResolvedAddressesDialog(QWidget *parent, QString captur
QStringList title_parts = QStringList() << tr("Resolved Addresses");
+ copy_bt_ = ui->buttonBox->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
+
+ save_bt_ = ui->buttonBox->addButton(tr("Save as…"), QDialogButtonBox::ActionRole);
+ connect(save_bt_, &QPushButton::clicked, this, &ResolvedAddressesDialog::saveAs);
+
if (!captureFile.isEmpty()) {
file_name_ = captureFile;
title_parts << file_name_;
@@ -86,7 +89,6 @@ ResolvedAddressesDialog::ResolvedAddressesDialog(QWidget *parent, QString captur
ethTypeModel->setColumnToHide(0);
ui->tblAddresses->setModel(ethTypeModel);
ui->tblAddresses->resizeColumnsToContents();
- ui->tblAddresses->horizontalHeader()->setStretchLastSection(true);
ui->tblAddresses->sortByColumn(1, Qt::AscendingOrder);
ui->cmbDataType->addItems(ethModel->filterValues());
@@ -94,17 +96,19 @@ ResolvedAddressesDialog::ResolvedAddressesDialog(QWidget *parent, QString captur
portTypeModel = new AStringListListSortFilterProxyModel(this);
PortsModel * portModel = new PortsModel(this);
portSortModel->setSourceModel(portModel);
- portSortModel->setColumnAsNumeric(1);
- portSortModel->setColumnsToFilter(QList<int>() << 0 << 1);
+ portSortModel->setColumnAsNumeric(PORTS_COL_PORT);
+ portSortModel->setColumnsToFilter(QList<int>() << PORTS_COL_NAME << PORTS_COL_PROTOCOL);
portSortModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
portTypeModel->setSourceModel(portSortModel);
- portTypeModel->setColumnToFilter(2);
- portTypeModel->setColumnAsNumeric(1);
+ portTypeModel->setColumnToFilter(PORTS_COL_PROTOCOL);
+ portTypeModel->setColumnAsNumeric(PORTS_COL_PORT);
ui->tblPorts->setModel(portTypeModel);
ui->tblPorts->resizeColumnsToContents();
- ui->tblPorts->horizontalHeader()->setStretchLastSection(true);
- ui->tblPorts->sortByColumn(1, Qt::AscendingOrder);
+ ui->tblPorts->sortByColumn(PORTS_COL_PORT, Qt::AscendingOrder);
ui->cmbPortFilterType->addItems(portModel->filterValues());
+
+ tabChanged(ui->tabWidget->currentIndex());
+ connect(ui->tabWidget, &QTabWidget::currentChanged, this, &ResolvedAddressesDialog::tabChanged);
}
ResolvedAddressesDialog::~ResolvedAddressesDialog()
@@ -112,6 +116,27 @@ ResolvedAddressesDialog::~ResolvedAddressesDialog()
delete ui;
}
+void ResolvedAddressesDialog::tabChanged(int index)
+{
+ QWidget *currentTab = ui->tabWidget->widget(index);
+ ResolvedAddressesView *addressView = nullptr;
+ if (currentTab != nullptr) {
+ addressView = currentTab->findChild<ResolvedAddressesView*>();
+ if (addressView != nullptr) {
+ QMenu* oldMenu = copy_bt_->menu();
+ copy_bt_->setMenu(addressView->createCopyMenu(false, copy_bt_));
+ if (oldMenu != nullptr) {
+ delete oldMenu;
+ }
+ }
+ }
+ foreach (QAbstractButton *button, ui->buttonBox->buttons()) {
+ if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::ActionRole) {
+ button->setEnabled(addressView != nullptr);
+ }
+ }
+}
+
void ResolvedAddressesDialog::on_cmbDataType_currentIndexChanged(int index)
{
if (! ethSortModel)
@@ -146,10 +171,10 @@ void ResolvedAddressesDialog::on_cmbPortFilterType_currentIndexChanged(int index
if (index == 0)
{
filter.clear();
- portTypeModel->setFilterType(AStringListListSortFilterProxyModel::FilterNone, 2);
+ portTypeModel->setFilterType(AStringListListSortFilterProxyModel::FilterNone, PORTS_COL_PROTOCOL);
}
else
- portTypeModel->setFilterType(AStringListListSortFilterProxyModel::FilterByEquivalent, 2);
+ portTypeModel->setFilterType(AStringListListSortFilterProxyModel::FilterByEquivalent, PORTS_COL_PROTOCOL);
portTypeModel->setFilter(filter);
}
@@ -202,3 +227,18 @@ void ResolvedAddressesDialog::fillBlocks()
ui->plainTextEdit->moveCursor(QTextCursor::Start);
setUpdatesEnabled(true);
}
+
+void ResolvedAddressesDialog::saveAs()
+{
+ QWidget *currentTab = ui->tabWidget->currentWidget();
+ if (currentTab == nullptr) {
+ return;
+ }
+
+ ResolvedAddressesView *addressView = currentTab->findChild<ResolvedAddressesView*>();
+ if (addressView == nullptr) {
+ return;
+ }
+
+ addressView->saveAs();
+}
diff --git a/ui/qt/resolved_addresses_dialog.h b/ui/qt/resolved_addresses_dialog.h
index dc6a9b64..3ce4698e 100644
--- a/ui/qt/resolved_addresses_dialog.h
+++ b/ui/qt/resolved_addresses_dialog.h
@@ -12,6 +12,8 @@
#include "geometry_state_dialog.h"
+#include <QMenu>
+
#include <wiretap/wtap.h>
class CaptureFile;
@@ -41,6 +43,8 @@ private:
Ui::ResolvedAddressesDialog *ui;
QString file_name_;
QString comment_;
+ QPushButton *copy_bt_;
+ QPushButton *save_bt_;
AStringListListSortFilterProxyModel * ethSortModel;
AStringListListSortFilterProxyModel * ethTypeModel;
@@ -48,6 +52,10 @@ private:
AStringListListSortFilterProxyModel * portTypeModel;
void fillBlocks();
+
+private slots:
+ void tabChanged(int index);
+ void saveAs();
};
#endif // RESOLVED_ADDRESSES_DIALOG_H
diff --git a/ui/qt/resolved_addresses_dialog.ui b/ui/qt/resolved_addresses_dialog.ui
index c77c5cc1..8cbbdc7f 100644
--- a/ui/qt/resolved_addresses_dialog.ui
+++ b/ui/qt/resolved_addresses_dialog.ui
@@ -39,19 +39,7 @@
</layout>
</item>
<item>
- <widget class="QTableView" name="tblAddresses">
- <property name="editTriggers">
- <set>QAbstractItemView::NoEditTriggers</set>
- </property>
- <property name="sortingEnabled">
- <bool>true</bool>
- </property>
- <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
- <bool>true</bool>
- </attribute>
- <attribute name="verticalHeaderVisible">
- <bool>false</bool>
- </attribute>
+ <widget class="ResolvedAddressesView" name="tblAddresses">
</widget>
</item>
</layout>
@@ -76,13 +64,7 @@
</layout>
</item>
<item>
- <widget class="QTableView" name="tblPorts">
- <property name="sortingEnabled">
- <bool>true</bool>
- </property>
- <attribute name="verticalHeaderVisible">
- <bool>false</bool>
- </attribute>
+ <widget class="ResolvedAddressesView" name="tblPorts">
</widget>
</item>
</layout>
@@ -233,6 +215,13 @@
</property>
</action>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>ResolvedAddressesView</class>
+ <extends>QTableVew</extends>
+ <header>ui/qt/widgets/resolved_addresses_view.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections>
<connection>
diff --git a/ui/qt/response_time_delay_dialog.cpp b/ui/qt/response_time_delay_dialog.cpp
index f656525e..8943d579 100644
--- a/ui/qt/response_time_delay_dialog.cpp
+++ b/ui/qt/response_time_delay_dialog.cpp
@@ -50,7 +50,7 @@ bool register_response_time_delay_tables(const void *, void *value, void*)
rtd_init,
ResponseTimeDelayDialog::createRtdDialog);
g_free(cfg_abbr);
- return FALSE;
+ return false;
}
enum {
diff --git a/ui/qt/rpc_service_response_time_dialog.cpp b/ui/qt/rpc_service_response_time_dialog.cpp
index 7c7f70b3..fa5caf30 100644
--- a/ui/qt/rpc_service_response_time_dialog.cpp
+++ b/ui/qt/rpc_service_response_time_dialog.cpp
@@ -44,7 +44,7 @@
extern "C" {
static void
-dce_rpc_add_program(gpointer key_ptr, gpointer value_ptr, gpointer rsrtd_ptr)
+dce_rpc_add_program(void *key_ptr, void *value_ptr, void *rsrtd_ptr)
{
RpcServiceResponseTimeDialog *rsrt_dlg = dynamic_cast<RpcServiceResponseTimeDialog *>((RpcServiceResponseTimeDialog *)rsrtd_ptr);
if (!rsrt_dlg) return;
@@ -56,7 +56,7 @@ dce_rpc_add_program(gpointer key_ptr, gpointer value_ptr, gpointer rsrtd_ptr)
}
static void
-dce_rpc_find_versions(gpointer key_ptr, gpointer, gpointer rsrtd_ptr)
+dce_rpc_find_versions(void *key_ptr, void *, void *rsrtd_ptr)
{
RpcServiceResponseTimeDialog *rsrt_dlg = dynamic_cast<RpcServiceResponseTimeDialog *>((RpcServiceResponseTimeDialog *)rsrtd_ptr);
if (!rsrt_dlg) return;
@@ -66,19 +66,19 @@ dce_rpc_find_versions(gpointer key_ptr, gpointer, gpointer rsrtd_ptr)
}
static void
-onc_rpc_add_program(gpointer prog_ptr, gpointer value_ptr, gpointer rsrtd_ptr)
+onc_rpc_add_program(void *prog_ptr, void *value_ptr, void *rsrtd_ptr)
{
RpcServiceResponseTimeDialog *rsrt_dlg = dynamic_cast<RpcServiceResponseTimeDialog *>((RpcServiceResponseTimeDialog *)rsrtd_ptr);
if (!rsrt_dlg) return;
- guint32 program = GPOINTER_TO_UINT(prog_ptr);
+ uint32_t program = GPOINTER_TO_UINT(prog_ptr);
rpc_prog_info_value *value = (rpc_prog_info_value *) value_ptr;
rsrt_dlg->addOncRpcProgram(program, value);
}
static void
-onc_rpc_find_versions(const gchar *, ftenum_t , gpointer rpik_ptr, gpointer, gpointer rsrtd_ptr)
+onc_rpc_find_versions(const char *, ftenum_t , void *rpik_ptr, void *, void *rsrtd_ptr)
{
RpcServiceResponseTimeDialog *rsrt_dlg = dynamic_cast<RpcServiceResponseTimeDialog *>((RpcServiceResponseTimeDialog *)rsrtd_ptr);
if (!rsrt_dlg) return;
@@ -89,7 +89,7 @@ onc_rpc_find_versions(const gchar *, ftenum_t , gpointer rpik_ptr, gpointer, gpo
}
static void
-onc_rpc_count_procedures(const gchar *, ftenum_t , gpointer rpik_ptr, gpointer, gpointer rsrtd_ptr)
+onc_rpc_count_procedures(const char *, ftenum_t , void *rpik_ptr, void *, void *rsrtd_ptr)
{
RpcServiceResponseTimeDialog *rsrt_dlg = dynamic_cast<RpcServiceResponseTimeDialog *>((RpcServiceResponseTimeDialog *)rsrtd_ptr);
if (!rsrt_dlg) return;
@@ -241,12 +241,12 @@ void RpcServiceResponseTimeDialog::addDceRpcProgramVersion(_guid_key *key)
std::sort(versions_.begin(), versions_.end());
}
-void RpcServiceResponseTimeDialog::addOncRpcProgram(guint32 program, _rpc_prog_info_value *value)
+void RpcServiceResponseTimeDialog::addOncRpcProgram(uint32_t program, _rpc_prog_info_value *value)
{
onc_name_to_program_.insert(value->progname, program);
}
-void RpcServiceResponseTimeDialog::addOncRpcProgramVersion(guint32 program, guint32 version)
+void RpcServiceResponseTimeDialog::addOncRpcProgramVersion(uint32_t program, uint32_t version)
{
if (onc_name_to_program_[program_combo_->currentText()] != program) return;
@@ -262,7 +262,7 @@ void RpcServiceResponseTimeDialog::addOncRpcProgramVersion(guint32 program, guin
}
}
-void RpcServiceResponseTimeDialog::updateOncRpcProcedureCount(guint32 program, guint32 version, int procedure)
+void RpcServiceResponseTimeDialog::updateOncRpcProcedureCount(uint32_t program, uint32_t version, int procedure)
{
if (onc_name_to_program_[program_combo_->currentText()] != program) return;
if (version_combo_->itemData(version_combo_->currentIndex()).toUInt() != version) return;
@@ -374,7 +374,7 @@ void RpcServiceResponseTimeDialog::provideParameterData()
{
void *tap_data = NULL;
const QString program_name = program_combo_->currentText();
- guint32 max_procs = 0;
+ uint32_t max_procs = 0;
switch (dlg_type_) {
case DceRpc:
@@ -382,8 +382,8 @@ void RpcServiceResponseTimeDialog::provideParameterData()
if (!dce_name_to_uuid_key_.contains(program_name)) return;
guid_key *dkey = dce_name_to_uuid_key_[program_name];
- guint16 version = (guint16) version_combo_->itemData(version_combo_->currentIndex()).toUInt();
- dcerpc_sub_dissector *procs = dcerpc_get_proto_sub_dissector(&(dkey->guid), version);
+ uint16_t version = (uint16_t) version_combo_->itemData(version_combo_->currentIndex()).toUInt();
+ const dcerpc_sub_dissector *procs = dcerpc_get_proto_sub_dissector(&(dkey->guid), version);
if (!procs) return;
dcerpcstat_tap_data_t *dtap_data = g_new0(dcerpcstat_tap_data_t, 1);
@@ -406,7 +406,7 @@ void RpcServiceResponseTimeDialog::provideParameterData()
rpcstat_tap_data_t *otap_data = g_new0(rpcstat_tap_data_t, 1);
otap_data->program = onc_name_to_program_[program_name];
otap_data->prog = rpc_prog_name(otap_data->program);
- otap_data->version = (guint32) version_combo_->itemData(version_combo_->currentIndex()).toUInt();
+ otap_data->version = (uint32_t) version_combo_->itemData(version_combo_->currentIndex()).toUInt();
onc_rpc_num_procedures_ = -1;
dissector_table_foreach ("rpc.call", onc_rpc_count_procedures, this);
diff --git a/ui/qt/rpc_service_response_time_dialog.h b/ui/qt/rpc_service_response_time_dialog.h
index d8f2ca53..4fa7306a 100644
--- a/ui/qt/rpc_service_response_time_dialog.h
+++ b/ui/qt/rpc_service_response_time_dialog.h
@@ -35,9 +35,9 @@ public:
void addDceRpcProgram(_guid_key *key, struct _dcerpc_uuid_value *value);
void addDceRpcProgramVersion(_guid_key *key);
- void addOncRpcProgram(guint32 program, struct _rpc_prog_info_value *value);
- void addOncRpcProgramVersion(guint32 program, guint32 version);
- void updateOncRpcProcedureCount(guint32 program, guint32 version, int procedure);
+ void addOncRpcProgram(uint32_t program, struct _rpc_prog_info_value *value);
+ void addOncRpcProgramVersion(uint32_t program, uint32_t version);
+ void updateOncRpcProcedureCount(uint32_t program, uint32_t version, int procedure);
void setDceRpcUuidAndVersion(struct _e_guid_t *uuid, int version);
void setOncRpcProgramAndVersion(int program, int version);
@@ -60,7 +60,7 @@ private:
QMap<QString, struct _guid_key *> dce_name_to_uuid_key_;
// ONC-RPC
- QMap<QString, guint32> onc_name_to_program_;
+ QMap<QString, uint32_t> onc_name_to_program_;
int onc_rpc_num_procedures_;
void clearVersionCombo();
diff --git a/ui/qt/rsa_keys_frame.cpp b/ui/qt/rsa_keys_frame.cpp
index c784ab9c..429b3aaa 100644
--- a/ui/qt/rsa_keys_frame.cpp
+++ b/ui/qt/rsa_keys_frame.cpp
@@ -63,10 +63,10 @@ RsaKeysFrame::~RsaKeysFrame()
delete ui;
}
-gboolean RsaKeysFrame::verifyKey(const char *uri, const char *password, gboolean *need_password, QString &error)
+bool RsaKeysFrame::verifyKey(const char *uri, const char *password, bool *need_password, QString &error)
{
char *error_c = NULL;
- gboolean key_ok = secrets_verify_key(qPrintable(uri), qPrintable(password), need_password, &error_c);
+ bool key_ok = secrets_verify_key(qPrintable(uri), qPrintable(password), need_password, &error_c);
error = error_c ? error_c : "";
g_free(error_c);
return key_ok;
@@ -120,7 +120,7 @@ void RsaKeysFrame::on_addItemButton_clicked()
}
// Validate the token, is a PIN needed?
- gboolean key_ok = false, needs_pin = true;
+ bool key_ok = false, needs_pin = true;
QString error;
if (!item.startsWith("pkcs11:")) {
// For keys other than pkcs11, try to verify the key without password.
@@ -168,7 +168,7 @@ void RsaKeysFrame::on_addFileButton_clicked()
// Try to load the key as unencrypted key file. If any errors occur, assume
// an encrypted key file and prompt for a password.
QString password, error;
- gboolean key_ok = secrets_verify_key(qPrintable(file), NULL, NULL, NULL);
+ bool key_ok = secrets_verify_key(qPrintable(file), NULL, NULL, NULL);
while (!key_ok) {
QString msg;
if (!error.isEmpty()) {
diff --git a/ui/qt/rsa_keys_frame.h b/ui/qt/rsa_keys_frame.h
index fae40e2f..c2dbccd2 100644
--- a/ui/qt/rsa_keys_frame.h
+++ b/ui/qt/rsa_keys_frame.h
@@ -40,7 +40,7 @@ private:
UatModel *rsa_keys_model_;
UatModel *pkcs11_libs_model_;
- gboolean verifyKey(const char *uri, const char *password, gboolean *need_password, QString &error);
+ bool verifyKey(const char *uri, const char *password, bool *need_password, QString &error);
void addKey(const QString &uri, const QString &password);
private slots:
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index d4eafd6c..9dcb910c 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -193,22 +193,16 @@ public:
switch (treeWidget()->sortColumn()) {
case (packet_col_):
return frame_num_ < other_row->frame_num_;
- break;
case (sequence_col_):
return sequence_num_ < other_row->sequence_num_;
- break;
case (delta_col_):
return delta_ < other_row->delta_;
- break;
case (jitter_col_):
return jitter_ < other_row->jitter_;
- break;
case (skew_col_):
return skew_ < other_row->skew_;
- break;
case (bandwidth_col_):
return bandwidth_ < other_row->bandwidth_;
- break;
default:
break;
}
@@ -278,6 +272,10 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
graph_ctx_menu_.addAction(ui->actionSaveGraph);
+ ui->streamGraph->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(ui->streamGraph, &QCustomPlot::customContextMenuRequested, this,
+ &RtpAnalysisDialog::showGraphMenu);
+
ui->streamGraph->xAxis->setLabel("Arrival Time");
ui->streamGraph->yAxis->setLabel("Value (ms)");
@@ -967,16 +965,14 @@ bool RtpAnalysisDialog::eventFilter(QObject *, QEvent *event)
return false;
}
-void RtpAnalysisDialog::graphClicked(QMouseEvent *event)
+void RtpAnalysisDialog::showGraphMenu(const QPoint &pos)
+{
+ graph_ctx_menu_.popup(ui->streamGraph->mapToGlobal(pos));
+}
+
+void RtpAnalysisDialog::graphClicked(QMouseEvent*)
{
updateWidgets();
- if (event->button() == Qt::RightButton) {
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- graph_ctx_menu_.popup(event->globalPosition().toPoint());
-#else
- graph_ctx_menu_.popup(event->globalPos());
-#endif
- }
}
void RtpAnalysisDialog::clearLayout(QLayout *layout)
diff --git a/ui/qt/rtp_analysis_dialog.h b/ui/qt/rtp_analysis_dialog.h
index a7fcfced..b16eccd3 100644
--- a/ui/qt/rtp_analysis_dialog.h
+++ b/ui/qt/rtp_analysis_dialog.h
@@ -12,7 +12,6 @@
#include <config.h>
-#include <glib.h>
#include <mutex>
#include "epan/address.h"
@@ -118,6 +117,7 @@ private slots:
void on_actionSaveGraph_triggered();
void on_buttonBox_helpRequested();
void showStreamMenu(QPoint pos);
+ void showGraphMenu(const QPoint &pos);
void graphClicked(QMouseEvent *event);
void closeTab(int index);
void rowCheckboxChanged(int checked);
@@ -135,7 +135,7 @@ private:
int tab_seq;
QVector<tab_info_t *> tabs_;
- QMultiHash<guint, tab_info_t *> tab_hash_;
+ QMultiHash<unsigned, tab_info_t *> tab_hash_;
QToolButton *player_button_;
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index 5ceb809f..8950c8df 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -128,7 +128,7 @@ void RtpAudioStream::addRtpPacket(const struct _packet_info *pinfo, const struct
rtp_packet_t *rtp_packet = g_new0(rtp_packet_t, 1);
rtp_packet->info = (struct _rtp_info *) g_memdup2(rtp_info, sizeof(struct _rtp_info));
if (rtp_info->info_all_data_present && (rtp_info->info_payload_len != 0)) {
- rtp_packet->payload_data = (guint8 *) g_memdup2(&(rtp_info->info_data[rtp_info->info_payload_offset]),
+ rtp_packet->payload_data = (uint8_t *) g_memdup2(&(rtp_info->info_data[rtp_info->info_payload_offset]),
rtp_info->info_payload_len);
}
@@ -258,21 +258,21 @@ void RtpAudioStream::decodeAudio(QAudioDeviceInfo out_device)
{
// XXX This is more messy than it should be.
- gint32 resample_buff_bytes = 0x1000;
+ int32_t resample_buff_bytes = 0x1000;
SAMPLE *resample_buff = (SAMPLE *) g_malloc(resample_buff_bytes);
char *write_buff = NULL;
qint64 write_bytes = 0;
unsigned int channels = 0;
unsigned int sample_rate = 0;
- guint32 last_sequence = 0;
- guint32 last_sequence_w = 0; // Last sequence number we wrote data
+ uint32_t last_sequence = 0;
+ uint32_t last_sequence_w = 0; // Last sequence number we wrote data
double rtp_time_prev = 0.0;
double arrive_time_prev = 0.0;
double pack_period = 0.0;
double start_time = 0.0;
double start_rtp_time = 0.0;
- guint64 start_timestamp = 0;
+ uint64_t start_timestamp = 0;
size_t decoded_bytes_prev = 0;
unsigned int audio_resampler_input_rate = 0;
@@ -430,7 +430,7 @@ void RtpAudioStream::decodeAudio(QAudioDeviceInfo out_device)
// Buffer is in SAMPLEs
spx_uint32_t in_len = (spx_uint32_t) (write_bytes / SAMPLE_BYTES);
// Output is audio_out_rate_/sample_rate bigger than input
- spx_uint32_t out_len = (spx_uint32_t) ((guint64)in_len * audio_out_rate_ / sample_rate);
+ spx_uint32_t out_len = (spx_uint32_t) ((uint64_t)in_len * audio_out_rate_ / sample_rate);
resample_buff = resizeBufferIfNeeded(resample_buff, &resample_buff_bytes, out_len * SAMPLE_BYTES);
if (audio_resampler &&
@@ -472,13 +472,13 @@ void RtpAudioStream::decodeAudio(QAudioDeviceInfo out_device)
void RtpAudioStream::decodeVisual()
{
spx_uint32_t read_len = 0;
- gint32 read_buff_bytes = VISUAL_BUFF_BYTES;
+ int32_t read_buff_bytes = VISUAL_BUFF_BYTES;
SAMPLE *read_buff = (SAMPLE *) g_malloc(read_buff_bytes);
- gint32 resample_buff_bytes = VISUAL_BUFF_BYTES;
+ int32_t resample_buff_bytes = VISUAL_BUFF_BYTES;
SAMPLE *resample_buff = (SAMPLE *) g_malloc(resample_buff_bytes);
unsigned int sample_no = 0;
spx_uint32_t out_len;
- guint32 frame_num;
+ uint32_t frame_num;
rtp_frame_type type;
speex_resampler_set_rate(visual_resampler_, audio_out_rate_, visual_sample_rate_);
@@ -486,7 +486,7 @@ void RtpAudioStream::decodeVisual()
// Loop over every frame record
// readFrameSamples() maintains size of buffer for us
while (audio_file_->readFrameSamples(&read_buff_bytes, &read_buff, &read_len, &frame_num, &type)) {
- out_len = (spx_uint32_t)(((guint64)read_len * visual_sample_rate_ ) / audio_out_rate_);
+ out_len = (spx_uint32_t)(((uint64_t)read_len * visual_sample_rate_ ) / audio_out_rate_);
if (type == RTP_FRAME_AUDIO) {
// We resample only audio samples
@@ -538,14 +538,14 @@ const QVector<double> RtpAudioStream::visualTimestamps(bool relative)
// Scale the height of the waveform to global scale (max_sample_val_used_)
// and adjust its Y offset so that they overlap slightly (stack_offset_).
-static const double stack_offset_ = G_MAXINT16 / 3;
+static const double stack_offset_ = INT16_MAX / 3;
const QVector<double> RtpAudioStream::visualSamples(int y_offset)
{
QVector<double> adj_samples;
double scaled_offset = y_offset * stack_offset_;
for (int i = 0; i < visual_samples_.size(); i++) {
if (SAMPLE_NaN != visual_samples_[i]) {
- adj_samples.append(((double)visual_samples_[i] * G_MAXINT16 / max_sample_val_used_) + scaled_offset);
+ adj_samples.append(((double)visual_samples_[i] * INT16_MAX / max_sample_val_used_) + scaled_offset);
} else {
// Convert to break in graph line
adj_samples.append(qQNaN());
@@ -701,8 +701,8 @@ const QString RtpAudioStream::formatDescription(const QAudioFormat &format)
QString RtpAudioStream::getIDAsQString()
{
- gchar *src_addr_str = address_to_display(NULL, &id_.src_addr);
- gchar *dst_addr_str = address_to_display(NULL, &id_.dst_addr);
+ char *src_addr_str = address_to_display(NULL, &id_.src_addr);
+ char *dst_addr_str = address_to_display(NULL, &id_.dst_addr);
QString str = QString("%1:%2 - %3:%4 %5")
.arg(src_addr_str)
.arg(id_.src_port)
@@ -843,7 +843,7 @@ void RtpAudioStream::stopPlaying()
if (audio_output_) {
if (audio_output_->state() == QAudio::StoppedState) {
// Looks like "delayed" QTBUG-6548
- // It may happen that stream is stopped, but no signal emited
+ // It may happen that stream is stopped, but no signal emitted
// Probably triggered by some issue in sound system which is not
// handled by Qt correctly
outputStateChanged(QAudio::StoppedState);
@@ -905,7 +905,7 @@ void RtpAudioStream::delayedStopStream()
audio_output_->stop();
}
-SAMPLE *RtpAudioStream::resizeBufferIfNeeded(SAMPLE *buff, gint32 *buff_bytes, qint64 requested_size)
+SAMPLE *RtpAudioStream::resizeBufferIfNeeded(SAMPLE *buff, int32_t *buff_bytes, qint64 requested_size)
{
if (requested_size > *buff_bytes) {
while ((requested_size > *buff_bytes))
diff --git a/ui/qt/rtp_audio_stream.h b/ui/qt/rtp_audio_stream.h
index 1ddeaacd..e7fd78d5 100644
--- a/ui/qt/rtp_audio_stream.h
+++ b/ui/qt/rtp_audio_stream.h
@@ -14,8 +14,6 @@
#ifdef QT_MULTIMEDIA_LIB
-#include <glib.h>
-
#include <epan/address.h>
#include <ui/rtp_stream.h>
#include <ui/qt/utils/rtp_audio_routing.h>
@@ -154,7 +152,7 @@ public:
void seekPlaying(qint64 samples);
void setStereoRequired(bool stereo_required) { stereo_required_ = stereo_required; }
qint16 getMaxSampleValue() { return max_sample_val_; }
- void setMaxSampleValue(gint16 max_sample_val) { max_sample_val_used_ = max_sample_val; }
+ void setMaxSampleValue(int16_t max_sample_val) { max_sample_val_used_ = max_sample_val; }
void seekSample(qint64 samples);
qint64 readSample(SAMPLE *sample);
qint64 getLeadSilenceSamples() { return prepend_samples_; }
@@ -163,7 +161,7 @@ public:
double getEndOfSilenceTime() { return (double)getEndOfSilenceSample() / (double)playRate(); }
qint64 convertTimeToSamples(double time) { return (qint64)(time * playRate()); }
bool savePayload(QIODevice *file);
- guint getHash() { return rtpstream_id_to_hash(&(id_)); }
+ unsigned getHash() { return rtpstream_id_to_hash(&(id_)); }
rtpstream_id_t *getID() { return &(id_); }
QString getIDAsQString();
rtpstream_info_t *getStreamInfo() { return &rtpstream_; }
@@ -223,7 +221,7 @@ private:
quint32 calculateAudioOutRate(QAudioDeviceInfo out_device, unsigned int sample_rate, unsigned int requested_out_rate);
#endif
void decodeVisual();
- SAMPLE *resizeBufferIfNeeded(SAMPLE *buff, gint32 *buff_bytes, qint64 requested_size);
+ SAMPLE *resizeBufferIfNeeded(SAMPLE *buff, int32_t *buff_bytes, qint64 requested_size);
private slots:
void outputStateChanged(QAudio::State new_state);
diff --git a/ui/qt/rtp_player_dialog.cpp b/ui/qt/rtp_player_dialog.cpp
index 60418cc8..889dde2a 100644
--- a/ui/qt/rtp_player_dialog.cpp
+++ b/ui/qt/rtp_player_dialog.cpp
@@ -135,7 +135,6 @@ public:
default:
// Fall back to string comparison
return QTreeWidgetItem::operator <(other);
- break;
}
}
};
@@ -206,7 +205,15 @@ RtpPlayerDialog::RtpPlayerDialog(QWidget &parent, CaptureFile &cf, bool capture_
graph_ctx_menu_->addAction(ui->actionGoToSetupPacketPlot);
set_action_shortcuts_visible_in_context_menu(graph_ctx_menu_->actions());
+ ui->audioPlot->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(ui->audioPlot, &QCustomPlot::customContextMenuRequested, this, &RtpPlayerDialog::showGraphContextMenu);
+
ui->streamTreeWidget->setMouseTracking(true);
+ mouse_update_timer_ = new QTimer(this);
+ mouse_update_timer_->setSingleShot(true);
+ mouse_update_timer_->setInterval(10);
+ connect(mouse_update_timer_, &QTimer::timeout, this, &RtpPlayerDialog::mouseMoveUpdate);
+
connect(ui->streamTreeWidget, &QTreeWidget::itemEntered, this, &RtpPlayerDialog::itemEntered);
connect(ui->audioPlot, &QCustomPlot::mouseMove, this, &RtpPlayerDialog::mouseMovePlot);
@@ -533,7 +540,7 @@ void RtpPlayerDialog::createPlot(bool rescale_axes)
bool legend_inserted_silences = false;
bool relative_timestamps = !ui->todCheckBox->isChecked();
int row_count = ui->streamTreeWidget->topLevelItemCount();
- gint16 total_max_sample_value = 1;
+ int16_t total_max_sample_value = 1;
ui->audioPlot->clearGraphs();
@@ -547,7 +554,7 @@ void RtpPlayerDialog::createPlot(bool rescale_axes)
for (int row = 0; row < row_count; row++) {
QTreeWidgetItem *ti = ui->streamTreeWidget->topLevelItem(row);
RtpAudioStream *audio_stream = ti->data(stream_data_col_, Qt::UserRole).value<RtpAudioStream*>();
- gint16 max_sample_value = audio_stream->getMaxSampleValue();
+ int16_t max_sample_value = audio_stream->getMaxSampleValue();
if (max_sample_value > total_max_sample_value) {
total_max_sample_value = max_sample_value;
@@ -673,7 +680,7 @@ void RtpPlayerDialog::fillTappedColumns()
// true just for first stream
bool is_first = true;
- // Get all rows, immutable list. Later changes in rows migth reorder them
+ // Get all rows, immutable list. Later changes in rows might reorder them
QList<QTreeWidgetItem *> items = ui->streamTreeWidget->findItems(
QString("*"), Qt::MatchWrap | Qt::MatchWildcard | Qt::MatchRecursive);
@@ -887,6 +894,8 @@ void RtpPlayerDialog::setMarkers()
void RtpPlayerDialog::showEvent(QShowEvent *)
{
+ // We could use loadSplitterState(ui->splitter) instead of always
+ // resetting the plot size to 75%
QList<int> split_sizes = ui->splitter->sizes();
int tot_size = split_sizes[0] + split_sizes[1];
int plot_size = tot_size * 3 / 4;
@@ -1130,22 +1139,34 @@ void RtpPlayerDialog::itemEntered(QTreeWidgetItem *item, int column _U_)
void RtpPlayerDialog::mouseMovePlot(QMouseEvent *event)
{
+ // The calculations are expensive, so just store the position and
+ // calculate no more than once per some interval. (On Linux the
+ // QMouseEvents can be sent absurdly often, every 25 microseconds!)
+ mouse_pos_ = event->pos();
+ if (!mouse_update_timer_->isActive()) {
+ mouse_update_timer_->start();
+ }
+}
+
+void RtpPlayerDialog::mouseMoveUpdate()
+{
+ // findItemByCoords is expensive (because of calling pointDistance),
+ // and updateHintLabel calls it as well via getHoveredPacket. Some
+ // way to only perform the distance calculations once would be better.
updateHintLabel();
- QTreeWidgetItem *ti = findItemByCoords(event->pos());
+ QTreeWidgetItem *ti = findItemByCoords(mouse_pos_);
handleItemHighlight(ti, true);
}
-void RtpPlayerDialog::graphClicked(QMouseEvent *event)
+void RtpPlayerDialog::showGraphContextMenu(const QPoint &pos)
+{
+ graph_ctx_menu_->popup(ui->audioPlot->mapToGlobal(pos));
+}
+
+void RtpPlayerDialog::graphClicked(QMouseEvent*)
{
updateWidgets();
- if (event->button() == Qt::RightButton) {
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- graph_ctx_menu_->popup(event->globalPosition().toPoint());
-#else
- graph_ctx_menu_->popup(event->globalPos());
-#endif
- }
}
void RtpPlayerDialog::graphDoubleClicked(QMouseEvent *event)
@@ -1429,7 +1450,7 @@ void RtpPlayerDialog::on_playButton_clicked()
#endif
marker_stream_->start(new AudioSilenceGenerator(marker_stream_));
// It may happen that stream play is finished before all others are started
- // therefore we do not use playing_streams_ there, but separate temporarly
+ // therefore we do not use playing_streams_ there, but separate temporarily
// list. It avoids access element/remove element race condition.
streams_to_start = playing_streams_;
for( int i = 0; i<streams_to_start.count(); ++i ) {
@@ -2282,11 +2303,11 @@ qint64 RtpPlayerDialog::saveAudioHeaderWAV(QFile *save_file, quint32 channels, u
{
uint8_t pd[4];
int64_t nchars;
- gint32 subchunk2Size;
- gint32 data32;
- gint16 data16;
+ int32_t subchunk2Size;
+ int32_t data32;
+ int16_t data16;
- subchunk2Size = sizeof(SAMPLE) * channels * (gint32)samples;
+ subchunk2Size = sizeof(SAMPLE) * channels * (int32_t)samples;
/* http://soundfile.sapp.org/doc/WaveFormat/ */
@@ -2354,14 +2375,14 @@ qint64 RtpPlayerDialog::saveAudioHeaderWAV(QFile *save_file, quint32 channels, u
}
/* WAVE fmt header, BlockAlign */
- data16 = channels * (gint16)sizeof(SAMPLE);
+ data16 = channels * (int16_t)sizeof(SAMPLE);
nchars = save_file->write((const char *)&data16, 2);
if (nchars != 2) {
return -1;
}
/* WAVE fmt header, BitsPerSample */
- data16 = (gint16)sizeof(SAMPLE) * 8;
+ data16 = (int16_t)sizeof(SAMPLE) * 8;
nchars = save_file->write((const char *)&data16, 2);
if (nchars != 2) {
return -1;
@@ -2418,12 +2439,12 @@ bool RtpPlayerDialog::writeAudioStreamsSamples(QFile *out_file, QVector<RtpAudio
if (swap_bytes) {
// same as phton16(), but more clear in compare
// to else branch
- pd[0] = (guint8)(sample >> 8);
- pd[1] = (guint8)(sample >> 0);
+ pd[0] = (uint8_t)(sample >> 8);
+ pd[1] = (uint8_t)(sample >> 0);
} else {
// just copy
- pd[1] = (guint8)(sample >> 8);
- pd[0] = (guint8)(sample >> 0);
+ pd[1] = (uint8_t)(sample >> 8);
+ pd[0] = (uint8_t)(sample >> 0);
}
read = true;
} else {
diff --git a/ui/qt/rtp_player_dialog.h b/ui/qt/rtp_player_dialog.h
index 5fba67db..0180e78f 100644
--- a/ui/qt/rtp_player_dialog.h
+++ b/ui/qt/rtp_player_dialog.h
@@ -12,7 +12,6 @@
#include "config.h"
-#include <glib.h>
#include <mutex>
#include "ui/rtp_stream.h"
@@ -146,6 +145,8 @@ private slots:
void updateWidgets();
void itemEntered(QTreeWidgetItem *item, int column);
void mouseMovePlot(QMouseEvent *event);
+ void mouseMoveUpdate();
+ void showGraphContextMenu(const QPoint &pos);
void graphClicked(QMouseEvent *event);
void graphDoubleClicked(QMouseEvent *event);
void plotClicked(QCPAbstractPlottable *plottable, int dataIndex, QMouseEvent *event);
@@ -245,11 +246,13 @@ private:
QToolButton *analyze_btn_;
QPushButton *prepare_btn_;
QPushButton *export_btn_;
- QMultiHash<guint, RtpAudioStream *> stream_hash_;
+ QMultiHash<unsigned, RtpAudioStream *> stream_hash_;
bool block_redraw_;
int lock_ui_;
bool read_capture_enabled_;
double silence_skipped_time_;
+ QTimer *mouse_update_timer_;
+ QPoint mouse_pos_;
// const QString streamKey(const rtpstream_info_t *rtpstream);
// const QString streamKey(const packet_info *pinfo, const struct _rtp_info *rtpinfo);
diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp
index 6b28a837..3d3a1c70 100644
--- a/ui/qt/rtp_stream_dialog.cpp
+++ b/ui/qt/rtp_stream_dialog.cpp
@@ -269,7 +269,6 @@ public:
rtpstream_info_calc_free(&calc1);
rtpstream_info_calc_free(&calc2);
return ret;
- break;
case min_delta_col_:
return stream_info_->rtp_stats.min_delta < other_rstwi.stream_info_->rtp_stats.min_delta;
case mean_delta_col_:
@@ -290,14 +289,14 @@ public:
return QTreeWidgetItem::operator <(other);
}
- void setTOD(gboolean tod)
+ void setTOD(bool tod)
{
tod_ = tod;
}
private:
rtpstream_info_t *stream_info_;
- gboolean tod_;
+ bool tod_;
};
@@ -586,9 +585,9 @@ void RtpStreamDialog::updateStreams()
// string_list is reverse ordered, so we must add
// just first "to_insert_count" of streams
GList *cur_stream = g_list_first(tapinfo_.strinfo_list);
- guint tap_len = g_list_length(tapinfo_.strinfo_list);
- guint tree_len = static_cast<guint>(ui->streamTreeWidget->topLevelItemCount());
- guint to_insert_count = tap_len - tree_len;
+ unsigned tap_len = g_list_length(tapinfo_.strinfo_list);
+ unsigned tree_len = static_cast<unsigned>(ui->streamTreeWidget->topLevelItemCount());
+ unsigned to_insert_count = tap_len - tree_len;
// Add any missing items
while (cur_stream && cur_stream->data && to_insert_count) {
@@ -797,8 +796,8 @@ void RtpStreamDialog::on_actionExportAsRtpDump_triggered()
save_file, "RTPDump Format (*.rtp)", &extension);
if (file_name.length() > 0) {
- gchar *dest_file = qstring_strdup(file_name);
- gboolean save_ok = rtpstream_save(&tapinfo_, cap_file_.capFile(), stream_info, dest_file);
+ char *dest_file = qstring_strdup(file_name);
+ bool save_ok = rtpstream_save(&tapinfo_, cap_file_.capFile(), stream_info, dest_file);
g_free(dest_file);
// else error dialog?
if (save_ok) {
diff --git a/ui/qt/sctp_all_assocs_dialog.cpp b/ui/qt/sctp_all_assocs_dialog.cpp
index c8208d66..2d04e69f 100644
--- a/ui/qt/sctp_all_assocs_dialog.cpp
+++ b/ui/qt/sctp_all_assocs_dialog.cpp
@@ -49,13 +49,9 @@ void SCTPAllAssocsDialog::fillTable()
int numAssocs;
ui->assocList->setColumnHidden(0, true);
- ui->assocList->setColumnWidth(1, 85);
- ui->assocList->setColumnWidth(2, 85);
- ui->assocList->setColumnWidth(3, 150);
- ui->assocList->setColumnWidth(4, 150);
sctp_assocs = sctp_stat_get_info();
- if (sctp_assocs->is_registered == FALSE) {
+ if (sctp_assocs->is_registered == false) {
register_tap_listener_sctp_stat();
/* (redissect all packets) */
cf_retap_packets(cap_file_);
@@ -63,19 +59,43 @@ void SCTPAllAssocsDialog::fillTable()
numAssocs = 0;
ui->assocList->setRowCount(static_cast<int>(g_list_length(sctp_assocs->assoc_info_list)));
+ /* https://doc.qt.io/qt-6/qtablewidget.html#setItem suggests turning
+ * off sorting before setting several items of a row in a loop.
+ */
+ bool sorting = ui->assocList->isSortingEnabled();
+ if (sorting) {
+ ui->assocList->setSortingEnabled(false);
+ }
list = g_list_first(sctp_assocs->assoc_info_list);
+ QTableWidgetItem *item;
while (list) {
assinfo = gxx_list_data(const sctp_assoc_info_t*, list);
- ui->assocList->setItem(numAssocs, 0, new QTableWidgetItem(QString("%1").arg(assinfo->assoc_id)));
- ui->assocList->setItem(numAssocs, 1, new QTableWidgetItem(QString("%1").arg(assinfo->port1)));
- ui->assocList->setItem(numAssocs, 2, new QTableWidgetItem(QString("%1").arg(assinfo->port2)));
- ui->assocList->setItem(numAssocs, 3, new QTableWidgetItem(QString("%1").arg(assinfo->n_packets)));
- ui->assocList->setItem(numAssocs, 4, new QTableWidgetItem(QString("%1").arg(assinfo->n_data_chunks)));
- ui->assocList->setItem(numAssocs, 5, new QTableWidgetItem(QString("%1").arg(assinfo->n_data_bytes)));
+ item = new QTableWidgetItem();
+ item->setData(Qt::DisplayRole, assinfo->assoc_id);
+ ui->assocList->setItem(numAssocs, 0, item);
+ item = new QTableWidgetItem();
+ item->setData(Qt::DisplayRole, assinfo->port1);
+ ui->assocList->setItem(numAssocs, 1, item);
+ item = new QTableWidgetItem();
+ item->setData(Qt::DisplayRole, assinfo->port2);
+ ui->assocList->setItem(numAssocs, 2, item);
+ item = new QTableWidgetItem();
+ item->setData(Qt::DisplayRole, assinfo->n_packets);
+ ui->assocList->setItem(numAssocs, 3, item);
+ item = new QTableWidgetItem();
+ item->setData(Qt::DisplayRole, assinfo->n_data_chunks);
+ ui->assocList->setItem(numAssocs, 4, item);
+ item = new QTableWidgetItem();
+ item->setData(Qt::DisplayRole, assinfo->n_data_bytes);
+ ui->assocList->setItem(numAssocs, 5, item);
list = gxx_list_next(list);
numAssocs++;
}
+ if (sorting) {
+ ui->assocList->setSortingEnabled(true);
+ }
+ ui->assocList->resizeColumnsToContents();
ui->analyseButton->setEnabled(false);
ui->setFilterButton->setEnabled(false);
connect(ui->assocList, SIGNAL(itemSelectionChanged()), this, SLOT(getSelectedItem()));
diff --git a/ui/qt/sctp_all_assocs_dialog.h b/ui/qt/sctp_all_assocs_dialog.h
index c29c8e9b..93ebf3f9 100644
--- a/ui/qt/sctp_all_assocs_dialog.h
+++ b/ui/qt/sctp_all_assocs_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <file.h>
#include <epan/dissectors/packet-sctp.h>
@@ -48,7 +46,7 @@ private slots:
private:
Ui::SCTPAllAssocsDialog *ui;
capture_file *cap_file_;
- guint16 selected_assoc_id;
+ uint16_t selected_assoc_id;
signals:
diff --git a/ui/qt/sctp_assoc_analyse_dialog.cpp b/ui/qt/sctp_assoc_analyse_dialog.cpp
index c6b4b11a..89a3d603 100644
--- a/ui/qt/sctp_assoc_analyse_dialog.cpp
+++ b/ui/qt/sctp_assoc_analyse_dialog.cpp
@@ -54,7 +54,7 @@ const sctp_assoc_info_t* SCTPAssocAnalyseDialog::findAssocForPacket(capture_file
bool frame_found = false;
fdata = cf->current_frame;
- if (sctp_stat_get_info()->is_registered == FALSE) {
+ if (sctp_stat_get_info()->is_registered == false) {
register_tap_listener_sctp_stat();
/* (redissect all packets) */
cf_retap_packets(cf);
@@ -65,11 +65,11 @@ const sctp_assoc_info_t* SCTPAssocAnalyseDialog::findAssocForPacket(capture_file
assoc = gxx_list_data(const sctp_assoc_info_t*, list);
framelist = g_list_first(assoc->frame_numbers);
- guint32 fn;
+ uint32_t fn;
while (framelist) {
fn = GPOINTER_TO_UINT(framelist->data);
if (fn == fdata->num) {
- frame_found = TRUE;
+ frame_found = true;
break;
}
framelist = gxx_list_next(framelist);
@@ -89,7 +89,7 @@ const sctp_assoc_info_t* SCTPAssocAnalyseDialog::findAssocForPacket(capture_file
return Q_NULLPTR;
}
-const _sctp_assoc_info* SCTPAssocAnalyseDialog::findAssoc(QWidget *parent, guint16 assoc_id)
+const _sctp_assoc_info* SCTPAssocAnalyseDialog::findAssoc(QWidget *parent, uint16_t assoc_id)
{
const sctp_assoc_info_t* result = get_sctp_assoc_info(assoc_id);
if (result) return result;
diff --git a/ui/qt/sctp_assoc_analyse_dialog.h b/ui/qt/sctp_assoc_analyse_dialog.h
index ec361f4c..335abfbf 100644
--- a/ui/qt/sctp_assoc_analyse_dialog.h
+++ b/ui/qt/sctp_assoc_analyse_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <file.h>
#include <epan/dissectors/packet-sctp.h>
@@ -44,7 +42,7 @@ public:
void fillTabs(const _sctp_assoc_info* selected_assoc);
static const _sctp_assoc_info* findAssocForPacket(capture_file* cf);
- static const _sctp_assoc_info* findAssoc(QWidget *parent, guint16 assoc_id);
+ static const _sctp_assoc_info* findAssoc(QWidget *parent, uint16_t assoc_id);
public slots:
void setCaptureFile(capture_file *cf) { cap_file_ = cf; }
@@ -63,7 +61,7 @@ private slots:
private:
Ui::SCTPAssocAnalyseDialog *ui;
- guint16 selected_assoc_id;
+ uint16_t selected_assoc_id;
capture_file *cap_file_;
void openGraphDialog(int direction);
void openGraphByteDialog(int direction);
diff --git a/ui/qt/sctp_chunk_statistics_dialog.cpp b/ui/qt/sctp_chunk_statistics_dialog.cpp
index f77c2edd..20098a7b 100644
--- a/ui/qt/sctp_chunk_statistics_dialog.cpp
+++ b/ui/qt/sctp_chunk_statistics_dialog.cpp
@@ -62,7 +62,7 @@ SCTPChunkStatisticsDialog::~SCTPChunkStatisticsDialog()
void SCTPChunkStatisticsDialog::initializeChunkMap()
{
struct chunkTypes temp;
- gchar buf[16];
+ char buf[16];
for (int i = 0; i < 256; i++) {
temp.id = i;
@@ -94,7 +94,7 @@ void SCTPChunkStatisticsDialog::fillTable(bool all, const sctp_assoc_info_t *sel
return;
}
uat_t *uat = prefs_get_uat_value(pref);
- gchar* fname = uat_get_actual_filename(uat,TRUE);
+ char* fname = uat_get_actual_filename(uat,true);
bool init = false;
if (!fname) {
@@ -220,7 +220,7 @@ void SCTPChunkStatisticsDialog::on_pushButton_clicked()
uat_t *uat = prefs_get_uat_value(pref);
- gchar* fname = uat_get_actual_filename(uat,TRUE);
+ char* fname = uat_get_actual_filename(uat,true);
if (!fname) {
return;
@@ -228,7 +228,7 @@ void SCTPChunkStatisticsDialog::on_pushButton_clicked()
fp = ws_fopen(fname,"w");
if (!fp && errno == ENOENT) {
- gchar *pf_dir_path = NULL;
+ char *pf_dir_path = NULL;
if (create_persconffile_dir(&pf_dir_path) != 0) {
g_free (pf_dir_path);
return;
@@ -251,7 +251,7 @@ void SCTPChunkStatisticsDialog::on_pushButton_clicked()
snprintf(str, sizeof str, "\"%d\",\"%s\",\"%s\"\n", tempChunk.id, tempChunk.name, tempChunk.hide==0?"Show":"Hide");
fputs(str, fp);
void *rec = g_malloc0(uat->record_size);
- uat_add_record(uat, rec, TRUE);
+ uat_add_record(uat, rec, true);
if (uat->free_cb) {
uat->free_cb(rec);
}
@@ -287,7 +287,7 @@ void SCTPChunkStatisticsDialog::on_actionHideChunkType_triggered()
void SCTPChunkStatisticsDialog::on_actionChunkTypePreferences_triggered()
{
- gchar* err = NULL;
+ char* err = NULL;
pref_t *pref = prefs_find_preference(prefs_find_module("sctp"),"statistics_chunk_types");
if (!pref) {
diff --git a/ui/qt/sctp_chunk_statistics_dialog.h b/ui/qt/sctp_chunk_statistics_dialog.h
index aa45f752..1c18dad9 100644
--- a/ui/qt/sctp_chunk_statistics_dialog.h
+++ b/ui/qt/sctp_chunk_statistics_dialog.h
@@ -11,7 +11,6 @@
#define SCTP_CHUNK_STATISTICS_DIALOG_H
#include <config.h>
-#include <glib.h>
#include <file.h>
#include <wsutil/file_util.h>
@@ -62,7 +61,7 @@ signals:
private:
Ui::SCTPChunkStatisticsDialog *ui;
- guint16 selected_assoc_id;
+ uint16_t selected_assoc_id;
capture_file *cap_file_;
QMenu ctx_menu_;
QPoint selected_point;
diff --git a/ui/qt/sctp_graph_arwnd_dialog.cpp b/ui/qt/sctp_graph_arwnd_dialog.cpp
index 2734f28a..92c254fe 100644
--- a/ui/qt/sctp_graph_arwnd_dialog.cpp
+++ b/ui/qt/sctp_graph_arwnd_dialog.cpp
@@ -63,8 +63,8 @@ void SCTPGraphArwndDialog::drawArwndGraph(const sctp_assoc_info_t *selected_asso
struct sack_chunk_header *sack_header;
struct nr_sack_chunk_header *nr_sack_header;
tsn_t *tsn;
- guint8 type;
- guint32 arwnd=0;
+ uint8_t type;
+ uint32_t arwnd=0;
if (direction == 1) {
listSACK = g_list_last(selected_assoc->sack1);
@@ -161,7 +161,7 @@ void SCTPGraphArwndDialog::graphClicked(QCPAbstractPlottable* plottable, int, QM
}
}
if (cap_file_ && frame_num > 0) {
- cf_goto_frame(cap_file_, frame_num);
+ cf_goto_frame(cap_file_, frame_num, false);
}
ui->hintLabel->setText(QString(tr("<small><i>Graph %1: a_rwnd=%2 Time=%3 secs </i></small>"))
diff --git a/ui/qt/sctp_graph_arwnd_dialog.h b/ui/qt/sctp_graph_arwnd_dialog.h
index c74d43d3..7c30b84d 100644
--- a/ui/qt/sctp_graph_arwnd_dialog.h
+++ b/ui/qt/sctp_graph_arwnd_dialog.h
@@ -11,7 +11,6 @@
#define SCTP_GRAPH_ARWND_DIALOG_H
#include <config.h>
-#include <glib.h>
#include "cfile.h"
@@ -46,13 +45,13 @@ private slots:
private:
Ui::SCTPGraphArwndDialog *ui;
- guint16 selected_assoc_id;
+ uint16_t selected_assoc_id;
capture_file *cap_file_;
int frame_num;
int direction;
- guint32 startArwnd;
+ uint32_t startArwnd;
QVector<double> xa, ya;
- QVector<guint32> fa;
+ QVector<uint32_t> fa;
// QVector<QString> typeStrings;
void drawGraph(const _sctp_assoc_info *selected_assoc);
diff --git a/ui/qt/sctp_graph_byte_dialog.cpp b/ui/qt/sctp_graph_byte_dialog.cpp
index bd91c088..660a70d1 100644
--- a/ui/qt/sctp_graph_byte_dialog.cpp
+++ b/ui/qt/sctp_graph_byte_dialog.cpp
@@ -61,9 +61,9 @@ void SCTPGraphByteDialog::drawBytesGraph(const sctp_assoc_info_t *selected_assoc
{
GList *listTSN = Q_NULLPTR, *tlist = Q_NULLPTR;
tsn_t *tsn = Q_NULLPTR;
- guint8 type;
- guint32 maxBytes;
- guint64 sumBytes = 0;
+ uint8_t type;
+ uint32_t maxBytes;
+ uint64_t sumBytes = 0;
if (direction == 1) {
maxBytes = selected_assoc->n_data_bytes_ep1;
@@ -77,7 +77,7 @@ void SCTPGraphByteDialog::drawBytesGraph(const sctp_assoc_info_t *selected_assoc
while (listTSN) {
tsn = gxx_list_data(tsn_t*, listTSN);
tlist = g_list_first(tsn->tsns);
- guint16 length;
+ uint16_t length;
while (tlist)
{
type = gxx_list_data(struct chunk_header *, tlist)->type;
@@ -164,7 +164,7 @@ void SCTPGraphByteDialog::graphClicked(QCPAbstractPlottable* plottable, int, QMo
}
}
if (cap_file_ && frame_num > 0) {
- cf_goto_frame(cap_file_, frame_num);
+ cf_goto_frame(cap_file_, frame_num, false);
}
ui->hintLabel->setText(QString(tr("<small><i>Graph %1: Received bytes=%2 Time=%3 secs </i></small>"))
diff --git a/ui/qt/sctp_graph_byte_dialog.h b/ui/qt/sctp_graph_byte_dialog.h
index e6785da9..b331ad9f 100644
--- a/ui/qt/sctp_graph_byte_dialog.h
+++ b/ui/qt/sctp_graph_byte_dialog.h
@@ -11,7 +11,6 @@
#define SCTP_GRAPH_BYTE_DIALOG_H
#include <config.h>
-#include <glib.h>
#include "cfile.h"
@@ -46,12 +45,12 @@ private slots:
private:
Ui::SCTPGraphByteDialog *ui;
- guint16 selected_assoc_id;
+ uint16_t selected_assoc_id;
capture_file *cap_file_;
int frame_num;
int direction;
QVector<double> xb, yb;
- QVector<guint32> fb;
+ QVector<uint32_t> fb;
void drawGraph();
void drawBytesGraph(const _sctp_assoc_info *selected_assoc);
diff --git a/ui/qt/sctp_graph_dialog.cpp b/ui/qt/sctp_graph_dialog.cpp
index a26f0d11..e0e69faf 100644
--- a/ui/qt/sctp_graph_dialog.cpp
+++ b/ui/qt/sctp_graph_dialog.cpp
@@ -67,13 +67,13 @@ void SCTPGraphDialog::drawNRSACKGraph(const sctp_assoc_info_t* selected_assoc)
{
tsn_t *sack = Q_NULLPTR;
GList *list = Q_NULLPTR, *tlist = Q_NULLPTR;
- guint16 gap_start=0, gap_end=0, i, numberOf_gaps, numberOf_nr_gaps;
- guint8 type;
- guint32 tsnumber, j = 0, min_tsn, rel = 0;
+ uint16_t gap_start=0, gap_end=0, i, numberOf_gaps, numberOf_nr_gaps;
+ uint8_t type;
+ uint32_t tsnumber, j = 0, min_tsn, rel = 0;
struct nr_sack_chunk_header *nr_sack_header = Q_NULLPTR;
struct gaps *nr_gap = Q_NULLPTR;
/* This holds the sum of gap acks and nr gap acks */
- guint16 total_gaps = 0;
+ uint16_t total_gaps = 0;
if (direction == 1) {
list = g_list_last(selected_assoc->sack1);
@@ -133,14 +133,14 @@ void SCTPGraphDialog::drawNRSACKGraph(const sctp_assoc_info_t* selected_assoc)
void SCTPGraphDialog::drawSACKGraph(const sctp_assoc_info_t* selected_assoc)
{
GList *listSACK = Q_NULLPTR, *tlist = Q_NULLPTR;
- guint16 gap_start=0, gap_end=0, nr, dup_nr;
+ uint16_t gap_start=0, gap_end=0, nr, dup_nr;
struct sack_chunk_header *sack_header = Q_NULLPTR;
struct gaps *gap = Q_NULLPTR;
tsn_t *tsn = Q_NULLPTR;
- guint8 type;
- guint32 tsnumber=0, rel = 0;
- guint32 minTSN;
- guint32 *dup_list = Q_NULLPTR;
+ uint8_t type;
+ uint32_t tsnumber=0, rel = 0;
+ uint32_t minTSN;
+ uint32_t *dup_list = Q_NULLPTR;
int i, j;
if (direction == 1) {
@@ -262,8 +262,8 @@ void SCTPGraphDialog::drawTSNGraph(const sctp_assoc_info_t* selected_assoc)
{
GList *listTSN = Q_NULLPTR,*tlist = Q_NULLPTR;
tsn_t *tsn = Q_NULLPTR;
- guint8 type;
- guint32 tsnumber=0, rel = 0, minTSN;
+ uint8_t type;
+ uint32_t tsnumber=0, rel = 0, minTSN;
if (direction == 1) {
listTSN = g_list_last(selected_assoc->tsn1);
@@ -321,7 +321,7 @@ void SCTPGraphDialog::drawGraph(const sctp_assoc_info_t* selected_assoc)
if (!selected_assoc) return;
}
- guint32 maxTSN, minTSN;
+ uint32_t maxTSN, minTSN;
if (direction == 1) {
maxTSN = selected_assoc->max_tsn1;
@@ -467,7 +467,7 @@ void SCTPGraphDialog::graphClicked(QCPAbstractPlottable* plottable, int, QMouseE
}
}
if (cap_file_ && frame_num > 0) {
- cf_goto_frame(cap_file_, frame_num);
+ cf_goto_frame(cap_file_, frame_num, false);
}
ui->hintLabel->setText(QString(tr("<small><i>%1: %2 Time: %3 secs </i></small>"))
.arg(plottable->name())
diff --git a/ui/qt/sctp_graph_dialog.h b/ui/qt/sctp_graph_dialog.h
index 28aeccb0..06cfdd94 100644
--- a/ui/qt/sctp_graph_dialog.h
+++ b/ui/qt/sctp_graph_dialog.h
@@ -11,7 +11,6 @@
#define SCTP_GRAPH_DIALOG_H
#include <config.h>
-#include <glib.h>
#include "cfile.h"
@@ -27,47 +26,47 @@ class QCustomPlot;
struct _sctp_assoc_info;
struct chunk_header {
- guint8 type;
- guint8 flags;
- guint16 length;
+ uint8_t type;
+ uint8_t flags;
+ uint16_t length;
};
struct data_chunk_header {
- guint8 type;
- guint8 flags;
- guint16 length;
- guint32 tsn;
- guint16 sid;
- guint16 ssn;
- guint32 ppi;
+ uint8_t type;
+ uint8_t flags;
+ uint16_t length;
+ uint32_t tsn;
+ uint16_t sid;
+ uint16_t ssn;
+ uint32_t ppi;
};
struct gaps {
- guint16 start;
- guint16 end;
+ uint16_t start;
+ uint16_t end;
};
struct sack_chunk_header {
- guint8 type;
- guint8 flags;
- guint16 length;
- guint32 cum_tsn_ack;
- guint32 a_rwnd;
- guint16 nr_of_gaps;
- guint16 nr_of_dups;
+ uint8_t type;
+ uint8_t flags;
+ uint16_t length;
+ uint32_t cum_tsn_ack;
+ uint32_t a_rwnd;
+ uint16_t nr_of_gaps;
+ uint16_t nr_of_dups;
struct gaps gaps[1];
};
struct nr_sack_chunk_header {
- guint8 type;
- guint8 flags;
- guint16 length;
- guint32 cum_tsn_ack;
- guint32 a_rwnd;
- guint16 nr_of_gaps;
- guint16 nr_of_nr_gaps;
- guint16 nr_of_dups;
- guint16 reserved;
+ uint8_t type;
+ uint8_t flags;
+ uint16_t length;
+ uint32_t cum_tsn_ack;
+ uint32_t a_rwnd;
+ uint16_t nr_of_gaps;
+ uint16_t nr_of_nr_gaps;
+ uint16_t nr_of_dups;
+ uint16_t reserved;
struct gaps gaps[1];
};
@@ -102,12 +101,12 @@ private slots:
private:
Ui::SCTPGraphDialog *ui;
- guint16 selected_assoc_id;
+ uint16_t selected_assoc_id;
capture_file *cap_file_;
int frame_num;
int direction;
QVector<double> xt, yt, xs, ys, xg, yg, xd, yd, xn, yn;
- QVector<guint32> ft, fs, fg, fd, fn;
+ QVector<uint32_t> ft, fs, fg, fd, fn;
QVector<QString> typeStrings;
bool relative;
int type;
diff --git a/ui/qt/search_frame.cpp b/ui/qt/search_frame.cpp
index 95a5b8e8..d4a332d8 100644
--- a/ui/qt/search_frame.cpp
+++ b/ui/qt/search_frame.cpp
@@ -16,10 +16,13 @@
#include <epan/proto.h>
#include <epan/strutil.h>
+#include <wsutil/filesystem.h>
#include <wsutil/utf8_entities.h>
#include <wsutil/regex.h>
#include "main_application.h"
+#include "utils/qt_ui_utils.h"
+
#include <QKeyEvent>
#include <QCheckBox>
@@ -56,6 +59,18 @@ SearchFrame::SearchFrame(QWidget *parent) :
}
#endif
+ if (!is_packet_configuration_namespace()) {
+ sf_ui_->searchInComboBox->setItemText(0, tr("Event List"));
+ sf_ui_->searchInComboBox->setItemText(1, tr("Event Details"));
+ sf_ui_->searchInComboBox->setItemText(2, tr("Event Bytes"));
+ sf_ui_->searchInComboBox->setToolTip(tr("<html><head/><body>"
+ "<p>Search the Info column of the event list (summary pane), "
+ "decoded event display labels (tree view pane) or the "
+ "ASCII-converted event data (hex view pane).</p>"
+ "</body></html>"));
+ }
+
+
applyRecentSearchSettings();
updateWidgets();
@@ -80,7 +95,7 @@ void SearchFrame::findNext()
{
if (!cap_file_) return;
- cap_file_->dir = SD_FORWARD;
+ sf_ui_->dirCheckBox->setChecked(false);
if (isHidden()) {
animatedShow();
return;
@@ -92,7 +107,7 @@ void SearchFrame::findPrevious()
{
if (!cap_file_) return;
- cap_file_->dir = SD_BACKWARD;
+ sf_ui_->dirCheckBox->setChecked(true);
if (isHidden()) {
animatedShow();
return;
@@ -104,7 +119,6 @@ void SearchFrame::setFocus()
{
sf_ui_->searchLineEdit->setFocus();
sf_ui_->searchLineEdit->selectAll();
- cap_file_->dir = SD_FORWARD;
}
void SearchFrame::setCaptureFile(capture_file *cf)
@@ -145,6 +159,9 @@ bool SearchFrame::regexCompile()
if (!sf_ui_->caseCheckBox->isChecked()) {
flags |= WS_REGEX_CASELESS;
}
+ if (sf_ui_->dirCheckBox->isChecked()) {
+ flags |= WS_REGEX_ANCHORED;
+ }
if (regex_) {
ws_regex_free(regex_);
@@ -221,6 +238,8 @@ void SearchFrame::applyRecentSearchSettings()
sf_ui_->charEncodingComboBox->setCurrentIndex(char_encoding_idx);
sf_ui_->caseCheckBox->setChecked(recent.gui_search_case_sensitive);
sf_ui_->searchTypeComboBox->setCurrentIndex(search_type_idx);
+ sf_ui_->dirCheckBox->setChecked(recent.gui_search_reverse_dir);
+ sf_ui_->multipleCheckBox->setChecked(recent.gui_search_multiple_occurs);
}
void SearchFrame::updateWidgets()
@@ -235,7 +254,15 @@ void SearchFrame::updateWidgets()
int search_type = sf_ui_->searchTypeComboBox->currentIndex();
sf_ui_->searchInComboBox->setEnabled(search_type == string_search_ || search_type == regex_search_);
sf_ui_->caseCheckBox->setEnabled(search_type == string_search_ || search_type == regex_search_);
- sf_ui_->charEncodingComboBox->setEnabled(search_type == string_search_);
+ // The encoding only is used when searching the raw Packet Bytes
+ // (otherwise all strings have already been converted to UTF-8)
+ sf_ui_->charEncodingComboBox->setEnabled(search_type == string_search_ && sf_ui_->searchInComboBox->currentIndex() == in_bytes_);
+
+ // We can search for multiple matches in the same frame if we're doing
+ // a Proto Tree search or a Frame Bytes search, but not a string/regex
+ // search in the Packet List, or a display filter search (since those
+ // don't highlight what fields / offsets caused the match.)
+ sf_ui_->multipleCheckBox->setEnabled((sf_ui_->searchInComboBox->isEnabled() && sf_ui_->searchInComboBox->currentIndex() != in_packet_list_) || search_type == hex_search_);
switch (search_type) {
case df_search_:
@@ -245,7 +272,7 @@ void SearchFrame::updateWidgets()
if (sf_ui_->searchLineEdit->text().isEmpty()) {
sf_ui_->searchLineEdit->setSyntaxState(SyntaxLineEdit::Invalid);
} else {
- guint8 *bytes;
+ uint8_t *bytes;
size_t nbytes;
bytes = convert_string_to_hex(sf_ui_->searchLineEdit->text().toUtf8().constData(), &nbytes);
if (bytes == nullptr)
@@ -297,6 +324,9 @@ void SearchFrame::on_searchInComboBox_currentIndexChanged(int idx)
default:
break;
}
+
+ // We only search for multiple occurrences in packet list and bytes
+ updateWidgets();
}
void SearchFrame::on_charEncodingComboBox_currentIndexChanged(int idx)
@@ -359,27 +389,39 @@ void SearchFrame::on_searchLineEdit_textChanged(const QString &)
updateWidgets();
}
+void SearchFrame::on_dirCheckBox_toggled(bool checked)
+{
+ recent.gui_search_reverse_dir = checked;
+}
+
+void SearchFrame::on_multipleCheckBox_toggled(bool checked)
+{
+ recent.gui_search_multiple_occurs = checked;
+}
+
void SearchFrame::on_findButton_clicked()
{
- guint8 *bytes = nullptr;
+ uint8_t *bytes = nullptr;
size_t nbytes = 0;
char *string = nullptr;
dfilter_t *dfp = nullptr;
- gboolean found_packet = FALSE;
+ bool found_packet = false;
QString err_string;
if (!cap_file_) {
return;
}
- cap_file_->hex = FALSE;
- cap_file_->string = FALSE;
- cap_file_->case_type = FALSE;
+ cap_file_->hex = false;
+ cap_file_->string = false;
+ cap_file_->case_type = false;
cap_file_->regex = nullptr;
- cap_file_->packet_data = FALSE;
- cap_file_->decode_data = FALSE;
- cap_file_->summary_data = FALSE;
+ cap_file_->packet_data = false;
+ cap_file_->decode_data = false;
+ cap_file_->summary_data = false;
cap_file_->scs_type = SCS_NARROW_AND_WIDE;
+ cap_file_->dir = sf_ui_->dirCheckBox->isChecked() ? SD_BACKWARD : SD_FORWARD;
+ bool multiple_occurrences = sf_ui_->multipleCheckBox->isChecked();
int search_type = sf_ui_->searchTypeComboBox->currentIndex();
switch (search_type) {
@@ -400,7 +442,7 @@ void SearchFrame::on_findButton_clicked()
err_string = tr("That's not a valid hex string.");
goto search_done;
}
- cap_file_->hex = TRUE;
+ cap_file_->hex = true;
break;
case string_search_:
case regex_search_:
@@ -408,8 +450,8 @@ void SearchFrame::on_findButton_clicked()
err_string = tr("You didn't specify any text for which to search.");
goto search_done;
}
- cap_file_->string = TRUE;
- cap_file_->case_type = sf_ui_->caseCheckBox->isChecked() ? FALSE : TRUE;
+ cap_file_->string = true;
+ cap_file_->case_type = sf_ui_->caseCheckBox->isChecked() ? false : true;
cap_file_->regex = (search_type == regex_search_ ? regex_ : nullptr);
switch (sf_ui_->charEncodingComboBox->currentIndex()) {
case narrow_and_wide_chars_:
@@ -434,13 +476,13 @@ void SearchFrame::on_findButton_clicked()
switch (sf_ui_->searchInComboBox->currentIndex()) {
case in_packet_list_:
- cap_file_->summary_data = TRUE;
+ cap_file_->summary_data = true;
break;
case in_proto_tree_:
- cap_file_->decode_data = TRUE;
+ cap_file_->decode_data = true;
break;
case in_bytes_:
- cap_file_->packet_data = TRUE;
+ cap_file_->packet_data = true;
break;
default:
err_string = tr("No valid search area selected. Please report this to the development team.");
@@ -448,13 +490,13 @@ void SearchFrame::on_findButton_clicked()
}
g_free(cap_file_->sfilter);
- cap_file_->sfilter = g_strdup(sf_ui_->searchLineEdit->text().toUtf8().constData());
+ cap_file_->sfilter = qstring_strdup(sf_ui_->searchLineEdit->text());
mainApp->popStatus(MainApplication::FileStatus);
mainApp->pushStatus(MainApplication::FileStatus, tr("Searching for %1…").arg(sf_ui_->searchLineEdit->text()));
if (cap_file_->hex) {
/* Hex value in packet data */
- found_packet = cf_find_packet_data(cap_file_, bytes, nbytes, cap_file_->dir);
+ found_packet = cf_find_packet_data(cap_file_, bytes, nbytes, cap_file_->dir, multiple_occurrences);
g_free(bytes);
if (!found_packet) {
/* We didn't find a packet */
@@ -476,7 +518,7 @@ void SearchFrame::on_findButton_clicked()
}
} else if (cap_file_->decode_data) {
/* String in the protocol tree headings */
- found_packet = cf_find_packet_protocol_tree(cap_file_, string, cap_file_->dir);
+ found_packet = cf_find_packet_protocol_tree(cap_file_, string, cap_file_->dir, multiple_occurrences);
g_free(string);
if (!found_packet) {
err_string = tr("No packet contained that string in its dissected display.");
@@ -484,7 +526,7 @@ void SearchFrame::on_findButton_clicked()
}
} else if (cap_file_->packet_data && string) {
/* String in the ASCII-converted packet data */
- found_packet = cf_find_packet_data(cap_file_, (guint8 *) string, strlen(string), cap_file_->dir);
+ found_packet = cf_find_packet_data(cap_file_, (uint8_t *) string, strlen(string), cap_file_->dir, multiple_occurrences);
g_free(string);
if (!found_packet) {
err_string = tr("No packet contained that string in its converted data.");
diff --git a/ui/qt/search_frame.h b/ui/qt/search_frame.h
index 7ea0946a..52a2a489 100644
--- a/ui/qt/search_frame.h
+++ b/ui/qt/search_frame.h
@@ -56,6 +56,8 @@ private slots:
void on_caseCheckBox_toggled(bool checked);
void on_searchTypeComboBox_currentIndexChanged(int idx);
void on_searchLineEdit_textChanged(const QString &);
+ void on_dirCheckBox_toggled(bool checked);
+ void on_multipleCheckBox_toggled(bool checked);
void on_findButton_clicked();
void on_cancelButton_clicked();
};
diff --git a/ui/qt/search_frame.ui b/ui/qt/search_frame.ui
index c3bb9908..0229d6f9 100644
--- a/ui/qt/search_frame.ui
+++ b/ui/qt/search_frame.ui
@@ -19,7 +19,18 @@
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout" stretch="3,0,0,0,0,0,0,1,0,0">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" stretch="3,0,0,0,1,0,0">
<property name="topMargin">
<number>0</number>
</property>
@@ -78,114 +89,179 @@
</spacer>
</item>
<item>
- <widget class="QComboBox" name="charEncodingComboBox">
+ <widget class="QComboBox" name="searchTypeComboBox">
<property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
- <string>Narrow &amp; Wide</string>
+ <string>Display filter</string>
</property>
</item>
<item>
<property name="text">
- <string>Narrow (UTF-8 / ASCII)</string>
+ <string>Hex value</string>
</property>
</item>
<item>
<property name="text">
- <string>Wide (UTF-16)</string>
+ <string>String</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Regular Expression</string>
</property>
</item>
</widget>
</item>
<item>
- <widget class="QCheckBox" name="caseCheckBox">
+ <widget class="DisplayFilterEdit" name="searchLineEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="findButton">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>27</height>
+ </size>
+ </property>
<property name="text">
- <string>Case sensitive</string>
+ <string>Find</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton">
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>27</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
</property>
</widget>
</item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="3,0,0,0,0,0,0,1">
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
<item>
- <spacer name="horizontalSpacer">
+ <spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
<property name="sizeHint" stdset="0">
<size>
- <width>20</width>
- <height>10</height>
+ <width>40</width>
+ <height>20</height>
</size>
</property>
</spacer>
</item>
<item>
- <widget class="QComboBox" name="searchTypeComboBox">
+ <widget class="QLabel" name="optionLabel">
+ <property name="text">
+ <string>&lt;b&gt;Options:&lt;/b&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="charEncodingComboBox">
<property name="toolTip">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
- <string>Display filter</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Hex value</string>
+ <string>Narrow &amp; Wide</string>
</property>
</item>
<item>
<property name="text">
- <string>String</string>
+ <string>Narrow (UTF-8 / ASCII)</string>
</property>
</item>
<item>
<property name="text">
- <string>Regular Expression</string>
+ <string>Wide (UTF-16)</string>
</property>
</item>
</widget>
</item>
<item>
- <widget class="DisplayFilterEdit" name="searchLineEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <widget class="QCheckBox" name="caseCheckBox">
+ <property name="text">
+ <string>Case sensitive</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="findButton">
- <property name="maximumSize">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
<size>
- <width>16777215</width>
- <height>27</height>
+ <width>20</width>
+ <height>10</height>
</size>
</property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="dirCheckBox">
<property name="text">
- <string>Find</string>
- </property>
- <property name="default">
- <bool>true</bool>
+ <string>Backwards</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="cancelButton">
- <property name="maximumSize">
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
<size>
- <width>16777215</width>
- <height>27</height>
+ <width>20</width>
+ <height>10</height>
</size>
</property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="multipleCheckBox">
+ <property name="toolTip">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
<property name="text">
- <string>Cancel</string>
+ <string>Multiple occurrences</string>
</property>
</widget>
</item>
</layout>
+ </item>
+ </layout>
</widget>
<customwidgets>
<customwidget>
diff --git a/ui/qt/sequence_diagram.cpp b/ui/qt/sequence_diagram.cpp
index 4628915b..fd28a1e1 100644
--- a/ui/qt/sequence_diagram.cpp
+++ b/ui/qt/sequence_diagram.cpp
@@ -11,9 +11,11 @@
#include "epan/addr_resolv.h"
#include "epan/sequence_analysis.h"
+#include "epan/column.h"
#include <ui/qt/utils/color_utils.h>
#include <ui/qt/utils/qt_ui_utils.h>
+#include <ui/qt/widgets/qcp_axis_ticker_elided.h>
#include "ui/recent.h"
#include <QFont>
@@ -66,9 +68,12 @@ SequenceDiagram::SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *
axis->setTicker(ticker);
axis->setSubTickPen(no_pen);
axis->setTickPen(no_pen);
- axis->setBasePen(no_pen);
+ axis->setSelectedTickPen(no_pen);
}
+ QSharedPointer<QCPAxisTicker> ticker(new QCPAxisTickerElided(comment_axis_));
+ comment_axis_->setTicker(ticker);
+
value_axis_->grid()->setVisible(false);
key_axis_->setRangeReversed(true);
@@ -82,6 +87,14 @@ SequenceDiagram::SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *
smooth_font_size(comment_font);
comment_axis_->setTickLabelFont(comment_font);
comment_axis_->setSelectedTickLabelFont(QFont(comment_font.family(), comment_font.pointSizeF(), QFont::Bold));
+
+ // By default QCPAxisRect auto resizes, which creates some slight but
+ // noticeable horizontal movement when scrolling vertically. Prevent that.
+ key_axis_->axisRect()->setAutoMargins(QCP::msTop | QCP::msBottom);
+ int time_margin = QFontMetrics(key_axis_->tickLabelFont()).horizontalAdvance(get_column_longest_string(COL_CLS_TIME));
+ int comment_margin = QFontMetrics(comment_font).height() * (max_comment_em_width_ + 1); // Add 1 as using the exact elided width is slightly too narrow
+ key_axis_->axisRect()->setMargins(QMargins(time_margin, 0, comment_margin, 0));
+
// frame_label
// port_src -----------------> port_dst
@@ -127,7 +140,7 @@ int SequenceDiagram::adjacentPacket(bool next)
it = data_->constEnd();
--it;
while (it != data_->constBegin()) {
- guint32 prev_frame = it.value().value->frame_number;
+ uint32_t prev_frame = it.value().value->frame_number;
--it;
if (prev_frame == selected_packet_) {
adjacent_packet = it.value().value->frame_number;
@@ -149,8 +162,6 @@ void SequenceDiagram::setData(_seq_analysis_info *sainfo)
double cur_key = 0.0;
QVector<double> key_ticks, val_ticks;
QVector<QString> key_labels, val_labels, com_labels;
- QFontMetrics com_fm(comment_axis_->tickLabelFont());
- int elide_w = com_fm.height() * max_comment_em_width_;
char* addr_str;
for (GList *cur = g_queue_peek_nth_link(sainfo->items, 0); cur; cur = gxx_list_next(cur)) {
@@ -165,7 +176,7 @@ void SequenceDiagram::setData(_seq_analysis_info *sainfo)
key_ticks.append(cur_key);
key_labels.append(sai->time_str);
- com_labels.append(com_fm.elidedText(sai->comment, Qt::ElideRight, elide_w));
+ com_labels.append(sai->comment);
cur_key++;
}
@@ -211,6 +222,20 @@ _seq_analysis_item *SequenceDiagram::itemForPosY(int ypos)
return NULL;
}
+bool SequenceDiagram::inComment(QPoint pos) const
+{
+ return pos.x() >= (comment_axis_->axisRect()->right()
+ + comment_axis_->padding()
+ + comment_axis_->tickLabelPadding()
+ + comment_axis_->offset());
+}
+
+QString SequenceDiagram::elidedComment(const QString &text) const
+{
+ QSharedPointer<QCPAxisTickerElided> comment_ticker = qSharedPointerCast<QCPAxisTickerElided>(comment_axis_->ticker());
+ return comment_ticker->elidedText(text);
+}
+
double SequenceDiagram::selectTest(const QPointF &pos, bool, QVariant *) const
{
double key_pos = qRound(key_axis_->pixelToCoord(pos.y()));
@@ -327,11 +352,7 @@ void SequenceDiagram::draw(QCPPainter *painter)
double arrow_width = (arrow_end.x() - arrow_start.x()) * dir_mul;
QString arrow_label = cfm.elidedText(sai->frame_label, Qt::ElideRight, arrow_width);
int arrow_label_width = 0;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
arrow_label_width = cfm.horizontalAdvance(arrow_label);
-#else
- arrow_label_width = cfm.width(arrow_label);
-#endif
QPoint text_pt(comment_start + ((arrow_width - arrow_label_width) / 2),
arrow_start.y() - (en_w / 2));
@@ -344,11 +365,7 @@ void SequenceDiagram::draw(QCPPainter *painter)
QString port_left = QString::number(dir_mul > 0 ? sai->port_src : sai->port_dst);
QString port_right = QString::number(dir_mul > 0 ? sai->port_dst : sai->port_src);
int port_left_width = 0;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
port_left_width = cfm.horizontalAdvance(port_left);
-#else
- port_left_width = cfm.width(port_left);
-#endif
text_pt = QPoint(left_x - en_w - port_left_width, arrow_start.y() + (en_w / 2));
painter->drawText(text_pt, port_left);
diff --git a/ui/qt/sequence_diagram.h b/ui/qt/sequence_diagram.h
index aa9a377a..a3c1327d 100644
--- a/ui/qt/sequence_diagram.h
+++ b/ui/qt/sequence_diagram.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <epan/address.h>
#include <QObject>
@@ -53,6 +51,8 @@ public:
// non-property methods:
struct _seq_analysis_item *itemForPosY(int ypos);
+ bool inComment(QPoint pos) const;
+ QString elidedComment(const QString &text) const;
// reimplemented virtual methods:
virtual void clearData() { data_->clear(); }
@@ -73,7 +73,7 @@ private:
QCPAxis *comment_axis_;
WSCPSeqDataMap *data_;
struct _seq_analysis_info *sainfo_;
- guint32 selected_packet_;
+ uint32_t selected_packet_;
double selected_key_;
};
diff --git a/ui/qt/sequence_dialog.cpp b/ui/qt/sequence_dialog.cpp
index e5fb7b87..8a541979 100644
--- a/ui/qt/sequence_dialog.cpp
+++ b/ui/qt/sequence_dialog.cpp
@@ -35,27 +35,20 @@
#include <QPoint>
// To do:
-// - Resize or show + hide the Time and Comment axes, possibly via one of
-// the following:
-// - Split the time, diagram, and comment sections into three separate
-// widgets inside a QSplitter. This would resemble the GTK+ UI, but we'd
-// have to coordinate between the three and we'd lose time and comment
-// values in PDF and PNG exports.
-// - Add separate controls for the width and/or visibility of the Time and
-// Comment columns.
-// - Fake a splitter widget by catching mouse events in the plot area.
-// Drawing a QCPItemLine or QCPItemPixmap over each Y axis might make
-// this easier.
+// - Resize the Time and Comment axis as well?
// - For general flows, let the user show columns other than COL_INFO.
+// (#12549)
// - Add UTF8 to text dump
// - Save to XMI? https://www.spinellis.gr/umlgraph/
-// - Time: abs vs delta
+// - Save to SVG? https://www.qcustomplot.com/index.php/support/forum/1677
+// - Time: abs vs delta (XXX - This is currently achieved by changing
+// View->Time Display Format before opening the dialog.)
// - Hide nodes
-// - Clickable time + comments?
+// - Clickable time + comments? (XXX - Clicking on them selects the item for
+// the row, is there anything else?)
// - Incorporate packet comments?
// - Change line_style to seq_type (i.e. draw ACKs dashed)
// - Create WSGraph subclasses with common behavior.
-// - Help button and text
static const double min_top_ = -1.0;
static const double min_left_ = -0.5;
@@ -73,6 +66,8 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i
num_items_(0),
packet_num_(0),
sequence_w_(1),
+ axis_pressed_(false),
+ current_rtp_sai_hovered_(nullptr),
voipFeaturesEnabled(voipFeatures)
{
QAction *action;
@@ -86,6 +81,7 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i
if (!info_) {
info_ = new SequenceInfo(sequence_analysis_info_new());
info_->sainfo()->name = "any";
+ info_->sainfo()->any_addr = true;
} else {
info_->ref();
sequence_analysis_free_nodes(info_->sainfo());
@@ -99,16 +95,33 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i
//sp->axisRect()->setRangeDragAxes(sp->xAxis2, sp->yAxis);
//sp->setInteractions(QCP::iRangeDrag);
+ sp->setInteraction(QCP::iSelectAxes, true);
+ sp->xAxis->setSelectableParts(QCPAxis::spNone);
+ sp->xAxis2->setSelectableParts(QCPAxis::spNone);
+ sp->yAxis->setSelectableParts(QCPAxis::spNone);
+ sp->yAxis2->setSelectableParts(QCPAxis::spAxis);
+
sp->xAxis->setVisible(false);
sp->xAxis->setPadding(0);
sp->xAxis->setLabelPadding(0);
sp->xAxis->setTickLabelPadding(0);
+ // Light border for the diagram
QPen base_pen(ColorUtils::alphaBlend(palette().text(), palette().base(), 0.25));
base_pen.setWidthF(0.5);
sp->xAxis2->setBasePen(base_pen);
sp->yAxis->setBasePen(base_pen);
sp->yAxis2->setBasePen(base_pen);
+ // Keep the border the same if/when the axis is selected, instead of blue
+ sp->xAxis2->setSelectedBasePen(base_pen);
+ sp->yAxis->setSelectedBasePen(base_pen);
+ sp->yAxis2->setSelectedBasePen(base_pen);
+
+ /* QCP documentation for setTicks() says "setting show to false does not imply
+ * that tick labels are invisible, too." In practice it seems to make them
+ * invisible, though, so set the length to 0.
+ */
+ sp->yAxis2->setTickLength(0);
sp->xAxis2->setVisible(true);
sp->yAxis2->setVisible(true);
@@ -162,7 +175,18 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i
action->setEnabled(false);
set_action_shortcuts_visible_in_context_menu(ctx_menu_.actions());
- ui->addressComboBox->setCurrentIndex(0);
+ sp->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(sp, &QCustomPlot::customContextMenuRequested, this, &SequenceDialog::showContextMenu);
+
+ ui->addressComboBox->addItem(tr("Any"), QVariant(true));
+ ui->addressComboBox->addItem(tr("Network"), QVariant(false));
+ ui->addressComboBox->setCurrentIndex(ui->addressComboBox->findData(QVariant(true)));
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ connect(ui->addressComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SequenceDialog::addressChanged);
+#else
+ connect(ui->addressComboBox, &QComboBox::currentIndexChanged, this, &SequenceDialog::addressChanged);
+#endif
sequence_items_t item_data;
@@ -198,13 +222,20 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i
loadGeometry(parent.width(), parent.height() * 4 / 5);
+ if (cf.isValid() && cf.displayFilter().length() > 0) {
+ ui->displayFilterCheckBox->setChecked(true);
+ }
+
+ connect(ui->displayFilterCheckBox, &QCheckBox::toggled, this, &SequenceDialog::displayFilterCheckBoxToggled);
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(hScrollBarChanged(int)));
connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(vScrollBarChanged(int)));
connect(sp->xAxis2, SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
connect(sp->yAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChanged(QCPRange)));
- connect(sp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(diagramClicked(QMouseEvent*)));
- connect(sp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*)));
- connect(sp, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheeled(QWheelEvent*)));
+ connect(sp, &QCustomPlot::mousePress, this, &SequenceDialog::diagramClicked);
+ connect(sp, &QCustomPlot::mouseRelease, this, &SequenceDialog::mouseReleased);
+ connect(sp, &QCustomPlot::mouseMove, this, &SequenceDialog::mouseMoved);
+ connect(sp, &QCustomPlot::mouseWheel, this, &SequenceDialog::mouseWheeled);
+ connect(sp, &QCustomPlot::axisDoubleClick, this, &SequenceDialog::axisDoubleClicked);
connect(sp, &QCustomPlot::afterLayout, this, &SequenceDialog::layoutAxisLabels);
}
@@ -227,6 +258,23 @@ void SequenceDialog::updateWidgets()
WiresharkDialog::updateWidgets();
}
+bool SequenceDialog::event(QEvent *event)
+{
+ if (event->type() == QEvent::ToolTip) {
+ QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
+ seq_analysis_item_t *sai = seq_diagram_->itemForPosY(helpEvent->pos().y());
+ if (sai && seq_diagram_->inComment(helpEvent->pos()) && (sai->comment != seq_diagram_->elidedComment(sai->comment))) {
+ QToolTip::showText(helpEvent->globalPos(), sai->comment);
+ } else {
+ QToolTip::hideText();
+ event->ignore();
+ }
+
+ return true;
+ }
+ return QWidget::event(event);
+}
+
void SequenceDialog::showEvent(QShowEvent *)
{
QTimer::singleShot(0, this, SLOT(fillDiagram()));
@@ -314,7 +362,7 @@ void SequenceDialog::hScrollBarChanged(int value)
{
if (qAbs(ui->sequencePlot->xAxis2->range().center()-value/100.0) > 0.01) {
ui->sequencePlot->xAxis2->setRange(value/100.0, ui->sequencePlot->xAxis2->range().size(), Qt::AlignCenter);
- ui->sequencePlot->replot();
+ ui->sequencePlot->replot(QCustomPlot::rpQueuedReplot);
}
}
@@ -322,7 +370,7 @@ void SequenceDialog::vScrollBarChanged(int value)
{
if (qAbs(ui->sequencePlot->yAxis->range().center()-value/100.0) > 0.01) {
ui->sequencePlot->yAxis->setRange(value/100.0, ui->sequencePlot->yAxis->range().size(), Qt::AlignCenter);
- ui->sequencePlot->replot();
+ ui->sequencePlot->replot(QCustomPlot::rpQueuedReplot);
}
}
@@ -338,10 +386,20 @@ void SequenceDialog::yAxisChanged(QCPRange range)
ui->verticalScrollBar->setPageStep(qRound(qreal(range.size()*100.0)));
}
+void SequenceDialog::showContextMenu(const QPoint &pos)
+{
+ ctx_menu_.popup(ui->sequencePlot->mapToGlobal(pos));
+}
+
void SequenceDialog::diagramClicked(QMouseEvent *event)
{
current_rtp_sai_selected_ = NULL;
if (event) {
+ QCPAxis *yAxis2 = ui->sequencePlot->yAxis2;
+ if (std::abs(event->pos().x() - yAxis2->axisRect()->right()) < 5) {
+ yAxis2->setSelectedParts(QCPAxis::spAxis);
+ axis_pressed_ = true;
+ }
seq_analysis_item_t *sai = seq_diagram_->itemForPosY(event->pos().y());
if (voipFeaturesEnabled) {
ui->actionSelectRtpStreams->setEnabled(false);
@@ -361,13 +419,6 @@ void SequenceDialog::diagramClicked(QMouseEvent *event)
case Qt::LeftButton:
on_actionGoToPacket_triggered();
break;
- case Qt::RightButton:
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- ctx_menu_.popup(event->globalPosition().toPoint());
-#else
- ctx_menu_.popup(event->globalPos());
-#endif
- break;
default:
break;
}
@@ -375,12 +426,47 @@ void SequenceDialog::diagramClicked(QMouseEvent *event)
}
+void SequenceDialog::axisDoubleClicked(QCPAxis *axis, QCPAxis::SelectablePart, QMouseEvent*)
+{
+ if (axis == ui->sequencePlot->yAxis2) {
+ QCP::MarginSides autoMargins = axis->axisRect()->autoMargins();
+ axis->axisRect()->setAutoMargins(autoMargins | QCP::msRight);
+ ui->sequencePlot->replot();
+ axis->axisRect()->setAutoMargins(autoMargins);
+ ui->sequencePlot->replot();
+ }
+}
+
+void SequenceDialog::mouseReleased(QMouseEvent*)
+{
+ QCustomPlot *sp = ui->sequencePlot;
+ sp->yAxis2->setSelectedParts(QCPAxis::spNone);
+ axis_pressed_ = false;
+ sp->replot(QCustomPlot::rpQueuedReplot);
+}
+
void SequenceDialog::mouseMoved(QMouseEvent *event)
{
current_rtp_sai_hovered_ = NULL;
packet_num_ = 0;
QString hint;
+ Qt::CursorShape shape = Qt::ArrowCursor;
if (event) {
+ QCPAxis *yAxis2 = ui->sequencePlot->yAxis2;
+ // For some reason we need this extra bool and can't rely just on
+ // yAxis2->selectedParts().testFlag(QCPAxis::spAxis)
+ if (axis_pressed_) {
+ int x = qMax(event->pos().x(), yAxis2->axisRect()->left());
+ QMargins margins = yAxis2->axisRect()->margins();
+ margins += QMargins(0, 0, yAxis2->axisRect()->right() - x, 0);
+ yAxis2->axisRect()->setMargins(margins);
+ shape = Qt::SplitHCursor;
+ ui->sequencePlot->replot(QCustomPlot::rpQueuedReplot);
+ } else {
+ if (std::abs(event->pos().x() - yAxis2->axisRect()->right()) < 5) {
+ shape = Qt::SplitHCursor;
+ }
+ }
seq_analysis_item_t *sai = seq_diagram_->itemForPosY(event->pos().y());
if (sai) {
if (GA_INFO_TYPE_RTP == sai->info_type) {
@@ -393,6 +479,10 @@ void SequenceDialog::mouseMoved(QMouseEvent *event)
}
}
+ if (ui->sequencePlot->cursor().shape() != shape) {
+ ui->sequencePlot->setCursor(QCursor(shape));
+ }
+
if (hint.isEmpty()) {
if (!info_->sainfo()) {
hint += tr("No data");
@@ -456,14 +546,55 @@ void SequenceDialog::exportDiagram()
if (file_name.length() > 0) {
bool save_ok = false;
+ // The QCustomPlot save functions take a width and a height, measured
+ // in pixels (for the entire viewport).
+ // In order to display the whole graph, we have to change the axes
+ // and scale up the width and height appropriately so that the text
+ // has the proper spacing. (Using the scale factor in some of the
+ // image writing functions makes the text illegible.)
+ // If we set the axes back to their old value without replotting,
+ // there's no visual effects from doing this.
+ QCustomPlot *sp = ui->sequencePlot;
+ QCPRange old_yrange = sp->yAxis->range();
+ QCPRange old_xrange = sp->xAxis2->range();
+ // For the horizontal aspect, we'll display all the nodes.
+ // Nodes can excluded by filtering (hiding nodes is in the todo list.)
+ // Use the current width of a node as determined by the user zooming
+ // with Key_Plus and Key_Minus, multiply that by the number of nodes,
+ // and add in the margin from the Time and Comment columns.
+ // MAX_NUM_NODES is 40, which results in a manageable 8802 pixel width
+ // at the default zoom level on my Linux box.
+ // (If the user has zoomed in unreasonably, that's on the user.)
+ int hmargin = sp->axisRect()->outerRect().width() - sp->axisRect()->width();
+ double nodeSize = (sp->axisRect()->width()) / old_xrange.size();
+ // For the vertical aspect, we need to put a bound on the number of
+ // pixels or items we'll put in an image, as it can get far too large.
+ // (JPEG only supports 16 bit aspect sizes, PNG supports 31 bit but
+ // many viewers don't.)
+ int vmargin = sp->axisRect()->outerRect().height() - sp->axisRect()->height();
+ // 1000 items is a little over 27000 pixels in height on my machine.
+ // XXX - Should this pref be pixels instead of items?
+ //int max_pixel = 24576;
+ //double range_span = ((max_pixel - vmargin) / (one_em_ * 1.5));
+ double range_span = prefs.flow_graph_max_export_items;
+ // Start at the current top item, and QCPRange::bounded does what
+ // we want, with margins of 1.0 on top and bottom.
+ QCPRange new_yrange(old_yrange.lower, old_yrange.lower + range_span);
+ new_yrange = new_yrange.bounded(min_top_, num_items_);
+ sp->yAxis->setRange(new_yrange);
+ // margins of 0.5 on left and right for port number, etc.
+ sp->xAxis2->setRange(min_left_, info_->sainfo()->num_nodes - 0.5);
+ // As seen in resetAxes(), we have an item take ~ 1.5*one_em_ pixels.
+ int ySize = new_yrange.size() * (one_em_ * 1.5) + vmargin;
+ int xSize = (nodeSize * info_->sainfo()->num_nodes) + hmargin;
if (extension.compare(pdf_filter) == 0) {
- save_ok = ui->sequencePlot->savePdf(file_name);
+ save_ok = ui->sequencePlot->savePdf(file_name, xSize, ySize);
} else if (extension.compare(png_filter) == 0) {
- save_ok = ui->sequencePlot->savePng(file_name);
+ save_ok = ui->sequencePlot->savePng(file_name, xSize, ySize);
} else if (extension.compare(bmp_filter) == 0) {
- save_ok = ui->sequencePlot->saveBmp(file_name);
+ save_ok = ui->sequencePlot->saveBmp(file_name, xSize, ySize);
} else if (extension.compare(jpeg_filter) == 0) {
- save_ok = ui->sequencePlot->saveJpg(file_name);
+ save_ok = ui->sequencePlot->saveJpg(file_name, xSize, ySize);
} else if (extension.compare(ascii_filter) == 0 && !file_closed_ && info_->sainfo()) {
FILE *outfile = ws_fopen(file_name.toUtf8().constData(), "w");
if (outfile != NULL) {
@@ -474,11 +605,13 @@ void SequenceDialog::exportDiagram()
save_ok = false;
}
}
+ sp->yAxis->setRange(old_yrange);
+ sp->xAxis2->setRange(old_xrange);
// else error dialog?
if (save_ok) {
mainApp->setLastOpenDirFromFilename(file_name);
} else {
- open_failure_alert_box(file_name.toUtf8().constData(), errno, TRUE);
+ open_failure_alert_box(file_name.toUtf8().constData(), errno, true);
}
}
}
@@ -547,7 +680,7 @@ void SequenceDialog::panAxes(int x_pixels, int y_pixels)
}
if (sp->yAxis->rangeReversed()) {
- // For reversed axes, lower still references the mathemathetically
+ // For reversed axes, lower still references the mathematically
// smaller number than upper, so reverse the direction.
y_pixels = -y_pixels;
}
@@ -560,11 +693,11 @@ void SequenceDialog::panAxes(int x_pixels, int y_pixels)
if (h_pan && !(sp->xAxis2->range().contains(min_left_) && sp->xAxis2->range().contains(info_->sainfo()->num_nodes - 0.5))) {
sp->xAxis2->moveRange(h_pan);
- sp->replot();
+ sp->replot(QCustomPlot::rpQueuedReplot);
}
if (v_pan && !(sp->yAxis->range().contains(min_top_) && sp->yAxis->range().contains(num_items_))) {
sp->yAxis->moveRange(v_pan);
- sp->replot();
+ sp->replot(QCustomPlot::rpQueuedReplot);
}
}
@@ -588,12 +721,12 @@ void SequenceDialog::resetAxes(bool keep_lower)
sp->yAxis->setRange(top_pos, range_span + top_pos);
double rmin = sp->xAxis2->range().size() / 2;
- ui->horizontalScrollBar->setRange((rmin - 0.5) * 100, (info_->sainfo()->num_nodes - 0.5 - rmin) * 100);
+ ui->horizontalScrollBar->setRange((rmin + min_left_) * 100, (info_->sainfo()->num_nodes - 0.5 - rmin) * 100);
xAxisChanged(sp->xAxis2->range());
ui->horizontalScrollBar->setValue(ui->horizontalScrollBar->minimum()); // Shouldn't be needed.
rmin = (sp->yAxis->range().size() / 2);
- ui->verticalScrollBar->setRange((rmin - 1.0) * 100, (num_items_ - 0.5 - rmin) * 100);
+ ui->verticalScrollBar->setRange((rmin + min_top_) * 100, (num_items_ - 0.5 - rmin) * 100);
yAxisChanged(sp->yAxis->range());
sp->replot(QCustomPlot::rpQueuedReplot);
@@ -634,7 +767,7 @@ void SequenceDialog::resetView()
void SequenceDialog::on_actionGoToPacket_triggered()
{
if (!file_closed_ && packet_num_ > 0) {
- cf_goto_frame(cap_file_.capFile(), packet_num_);
+ cf_goto_frame(cap_file_.capFile(), packet_num_, false);
seq_diagram_->setSelectedPacket(packet_num_);
}
}
@@ -685,12 +818,12 @@ void SequenceDialog::goToAdjacentPacket(bool next)
}
sp->yAxis->moveRange(range_offset);
}
- cf_goto_frame(cap_file_.capFile(), adjacent_packet);
+ cf_goto_frame(cap_file_.capFile(), adjacent_packet, false);
seq_diagram_->setSelectedPacket(adjacent_packet);
}
}
-void SequenceDialog::on_displayFilterCheckBox_toggled(bool)
+void SequenceDialog::displayFilterCheckBoxToggled(bool)
{
fillDiagram();
}
@@ -706,16 +839,15 @@ void SequenceDialog::on_flowComboBox_activated(int index)
fillDiagram();
}
-void SequenceDialog::on_addressComboBox_activated(int index)
+void SequenceDialog::addressChanged(int)
{
if (!info_->sainfo()) return;
- if (index == 0) {
- info_->sainfo()->any_addr = TRUE;
- } else {
- info_->sainfo()->any_addr = FALSE;
+ QVariant data = ui->addressComboBox->currentData();
+ if (data.isValid()) {
+ info_->sainfo()->any_addr = data.toBool();
+ fillDiagram();
}
- fillDiagram();
}
void SequenceDialog::on_actionMoveRight10_triggered()
@@ -825,7 +957,7 @@ bool SequenceDialog::addFlowSequenceItem(const void* key, void *value, void *use
/* XXX - Although "voip" isn't a registered name yet, it appears to have special
handling that will be done outside of registered data */
if (strcmp(name, "voip") == 0)
- return FALSE;
+ return false;
item_data->flow->addItem(sequence_analysis_get_ui_name(analysis), VariantPointer<register_analysis_t>::asQVariant(analysis));
@@ -834,7 +966,7 @@ bool SequenceDialog::addFlowSequenceItem(const void* key, void *value, void *use
item_data->curr_index++;
- return FALSE;
+ return false;
}
QVector<rtpstream_id_t *>SequenceDialog::getSelectedRtpIds()
diff --git a/ui/qt/sequence_dialog.h b/ui/qt/sequence_dialog.h
index f9935d5b..6bbc3d00 100644
--- a/ui/qt/sequence_dialog.h
+++ b/ui/qt/sequence_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include "epan/packet.h"
@@ -53,6 +51,7 @@ public:
~SequenceDialog();
protected:
+ bool event(QEvent *event);
void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event);
void keyPressEvent(QKeyEvent *event);
@@ -70,7 +69,10 @@ private slots:
void vScrollBarChanged(int value);
void xAxisChanged(QCPRange range);
void yAxisChanged(QCPRange range);
+ void showContextMenu(const QPoint &pos);
void diagramClicked(QMouseEvent *event);
+ void axisDoubleClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
+ void mouseReleased(QMouseEvent *event);
void mouseMoved(QMouseEvent *event);
void mouseWheeled(QWheelEvent *event);
@@ -79,13 +81,14 @@ private slots:
void exportDiagram();
void layoutAxisLabels();
+ void addressChanged(int index);
+ void displayFilterCheckBoxToggled(bool checked);
+
void on_buttonBox_clicked(QAbstractButton *button);
void on_actionGoToPacket_triggered();
void on_actionGoToNextPacket_triggered() { goToAdjacentPacket(true); }
void on_actionGoToPreviousPacket_triggered() { goToAdjacentPacket(false); }
- void on_displayFilterCheckBox_toggled(bool checked);
void on_flowComboBox_activated(int index);
- void on_addressComboBox_activated(int index);
void on_actionMoveRight10_triggered();
void on_actionMoveLeft10_triggered();
void on_actionMoveUp10_triggered();
@@ -109,9 +112,10 @@ private:
SequenceDiagram *seq_diagram_;
SequenceInfo *info_;
int num_items_;
- guint32 packet_num_;
+ uint32_t packet_num_;
double one_em_;
int sequence_w_;
+ bool axis_pressed_;
QPushButton *reset_button_;
QToolButton *player_button_;
QPushButton *export_button_;
diff --git a/ui/qt/sequence_dialog.ui b/ui/qt/sequence_dialog.ui
index a62e76e0..d116952e 100644
--- a/ui/qt/sequence_dialog.ui
+++ b/ui/qt/sequence_dialog.ui
@@ -156,16 +156,6 @@
</item>
<item>
<widget class="QComboBox" name="addressComboBox">
- <item>
- <property name="text">
- <string>Any</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Network</string>
- </property>
- </item>
</widget>
</item>
</layout>
diff --git a/ui/qt/service_response_time_dialog.cpp b/ui/qt/service_response_time_dialog.cpp
index 95bd4801..31c86d58 100644
--- a/ui/qt/service_response_time_dialog.cpp
+++ b/ui/qt/service_response_time_dialog.cpp
@@ -66,7 +66,7 @@ bool register_service_response_tables(const void *, void *value, void*)
srt_init,
tpd_creator);
g_free(cfg_abbr);
- return FALSE;
+ return false;
}
enum {
@@ -205,7 +205,7 @@ ServiceResponseTimeDialog::~ServiceResponseTimeDialog()
{
if (srt_data_.srt_array) {
free_srt_table(srt_, srt_data_.srt_array);
- g_array_free(srt_data_.srt_array, TRUE);
+ g_array_free(srt_data_.srt_array, true);
}
}
@@ -259,7 +259,7 @@ void ServiceResponseTimeDialog::tapDraw(void *srtd_ptr)
void ServiceResponseTimeDialog::endRetapPackets()
{
- for (guint i = 0; i < srt_data_.srt_array->len; i++) {
+ for (unsigned i = 0; i < srt_data_.srt_array->len; i++) {
srt_stat_table *srt_table = g_array_index(srt_data_.srt_array, srt_stat_table*, i);
addSrtTable(srt_table);
}
@@ -270,9 +270,9 @@ void ServiceResponseTimeDialog::fillTree()
{
if (srt_data_.srt_array) {
free_srt_table(srt_, srt_data_.srt_array);
- g_array_free(srt_data_.srt_array, TRUE);
+ g_array_free(srt_data_.srt_array, true);
}
- srt_data_.srt_array = g_array_new(FALSE, TRUE, sizeof(srt_stat_table*));
+ srt_data_.srt_array = g_array_new(false, true, sizeof(srt_stat_table*));
srt_data_.user_data = this;
provideParameterData();
diff --git a/ui/qt/show_packet_bytes_dialog.cpp b/ui/qt/show_packet_bytes_dialog.cpp
index d85a1ea5..62a19649 100644
--- a/ui/qt/show_packet_bytes_dialog.cpp
+++ b/ui/qt/show_packet_bytes_dialog.cpp
@@ -182,10 +182,14 @@ void ShowPacketBytesDialog::updateHintLabel()
if (start_ > 0 || end_ < (finfo_->length - 1)) {
hint.append(" <span style=\"color: red\">" +
- tr("Displaying %Ln byte(s).", "", end_ - start_ + 1) +
+ tr("Using %Ln byte(s).", "", end_ - start_ + 1) +
"</span>");
}
+ if (!decode_as_name_.isEmpty()) {
+ hint.append(" " + tr("Decoded as %1.").arg(decode_as_name_));
+ }
+
ui->hintLabel->setText("<small><i>" + hint + "</i></small>");
}
@@ -194,7 +198,6 @@ void ShowPacketBytesDialog::on_sbStart_valueChanged(int value)
start_ = value;
ui->sbEnd->setMinimum(value);
- updateHintLabel();
updateFieldBytes();
}
@@ -203,7 +206,6 @@ void ShowPacketBytesDialog::on_sbEnd_valueChanged(int value)
end_ = value;
ui->sbStart->setMaximum(value);
- updateHintLabel();
updateFieldBytes();
}
@@ -242,20 +244,40 @@ void ShowPacketBytesDialog::useRegexFind(bool use_regex)
ui->lFind->setText(tr("Find:"));
}
+// This only calls itself with go_back false, so never recurses more than once.
+// NOLINTNEXTLINE(misc-no-recursion)
void ShowPacketBytesDialog::findText(bool go_back)
{
if (ui->leFind->text().isEmpty()) return;
bool found;
+
+ QTextDocument::FindFlags options;
+ if (ui->caseCheckBox->isChecked()) {
+ options |= QTextDocument::FindCaseSensitively;
+ }
if (use_regex_find_) {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
+ // https://bugreports.qt.io/browse/QTBUG-88721
+ // QPlainTextEdit::find() searches case-insensitively unless
+ // QTextDocument::FindCaseSensitively is explicitly given.
+ // This *does* apply to QRegularExpression (overriding
+ // CaseInsensitiveOption), but not QRegExp.
+ //
+ // QRegularExpression and QRegExp do not support Perl's /i, but
+ // the former at least does support the mode modifiers (?i) and
+ // (?-i), which can override QTextDocument::FindCaseSensitively.
+ //
+ // To make matters worse, while the QTextDocument::find() documentation
+ // is correct, QPlainTextEdit::find() claims that QRegularExpression
+ // works like QRegExp, which is incorrect.
QRegularExpression regex(ui->leFind->text(), QRegularExpression::UseUnicodePropertiesOption);
#else
- QRegExp regex(ui->leFind->text());
+ QRegExp regex(ui->leFind->text(), (options & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);
#endif
- found = ui->tePacketBytes->find(regex);
+ found = ui->tePacketBytes->find(regex, std::move(options));
} else {
- found = ui->tePacketBytes->find(ui->leFind->text());
+ found = ui->tePacketBytes->find(ui->leFind->text(), std::move(options));
}
if (found) {
@@ -514,7 +536,7 @@ void ShowPacketBytesDialog::symbolizeBuffer(QByteArray &ba)
ba.replace((char)0x7f, symbol); // DEL
}
-QByteArray ShowPacketBytesDialog::decodeQuotedPrintable(const guint8 *bytes, int length)
+QByteArray ShowPacketBytesDialog::decodeQuotedPrintable(const uint8_t *bytes, int length)
{
QByteArray ba;
@@ -542,7 +564,7 @@ QByteArray ShowPacketBytesDialog::decodeQuotedPrintable(const guint8 *bytes, int
void ShowPacketBytesDialog::rot13(QByteArray &ba)
{
for (int i = 0; i < ba.length(); i++) {
- gchar upper = g_ascii_toupper(ba[i]);
+ char upper = g_ascii_toupper(ba[i]);
if (upper >= 'A' && upper <= 'M') ba[i] = ba[i] + 13;
else if (upper >= 'N' && upper <= 'Z') ba[i] = ba[i] - 13;
}
@@ -552,12 +574,13 @@ void ShowPacketBytesDialog::updateFieldBytes(bool initialization)
{
int start = finfo_->start + start_;
int length = end_ - start_ + 1;
- const guint8 *bytes;
- gsize new_length = 0;
+ const uint8_t *bytes;
if (!finfo_->ds_tvb)
return;
+ decode_as_name_.clear();
+
switch (recent.gui_show_bytes_decode) {
case DecodeAsNone:
@@ -568,22 +591,40 @@ void ShowPacketBytesDialog::updateFieldBytes(bool initialization)
case DecodeAsBASE64:
{
bytes = tvb_get_ptr(finfo_->ds_tvb, start, -1);
- field_bytes_ = QByteArray((const char *)bytes, length);
- if (field_bytes_.size() > 1) {
- g_base64_decode_inplace(field_bytes_.data(), &new_length);
+ QByteArray ba = QByteArray::fromRawData((const char *)bytes, length);
+ if (ba.contains('-') || ba.contains('_')) {
+ field_bytes_ = QByteArray::fromBase64(ba, QByteArray::Base64UrlEncoding);
+ decode_as_name_ = "base64url";
+ } else {
+ field_bytes_ = QByteArray::fromBase64(ba, QByteArray::Base64Encoding);
+ decode_as_name_ = "base64";
}
- field_bytes_.resize((int)new_length);
break;
}
case DecodeAsCompressed:
{
- tvbuff *uncompr_tvb = tvb_uncompress(finfo_->ds_tvb, start, length);
- if (uncompr_tvb) {
- bytes = tvb_get_ptr(uncompr_tvb, 0, -1);
- field_bytes_ = QByteArray((const char *)bytes, tvb_reported_length(uncompr_tvb));
- tvb_free(uncompr_tvb);
- } else {
+ static const QList<uncompress_list_t> tvb_uncompress_list = {
+ { "lz77", tvb_uncompress_lz77 },
+ { "lz77huff", tvb_uncompress_lz77huff },
+ { "lznt1", tvb_uncompress_lznt1 },
+ { "snappy", tvb_uncompress_snappy },
+ { "zlib", tvb_uncompress_zlib },
+ { "zstd", tvb_uncompress_zstd },
+ };
+ tvbuff_t *uncompr_tvb = NULL;
+
+ for (auto &tvb_uncompress : tvb_uncompress_list) {
+ uncompr_tvb = tvb_uncompress.function(finfo_->ds_tvb, start, length);
+ if (uncompr_tvb && tvb_reported_length(uncompr_tvb) > 0) {
+ bytes = tvb_get_ptr(uncompr_tvb, 0, -1);
+ field_bytes_ = QByteArray((const char *)bytes, tvb_reported_length(uncompr_tvb));
+ decode_as_name_ = tr("compressed %1").arg(tvb_uncompress.name);
+ tvb_free(uncompr_tvb);
+ break;
+ }
+ }
+ if (!uncompr_tvb) {
field_bytes_.clear();
}
break;
@@ -600,7 +641,7 @@ void ShowPacketBytesDialog::updateFieldBytes(bool initialization)
#if GLIB_CHECK_VERSION(2, 66, 0)
GBytes *ba = g_uri_unescape_bytes((const char*)bytes, length, NULL, NULL);
if (ba != NULL) {
- gsize size;
+ size_t size;
const char* data = (const char *)g_bytes_unref_to_data(ba, &size);
field_bytes_ = QByteArray(data, (int)size);
}
@@ -609,7 +650,7 @@ void ShowPacketBytesDialog::updateFieldBytes(bool initialization)
if (uri_to_bytes((const char*)bytes, ba, length)) {
field_bytes_ = QByteArray((const char *)ba->data, ba->len);
}
- g_byte_array_free(ba, TRUE);
+ g_byte_array_free(ba, true);
#endif
break;
}
@@ -635,11 +676,12 @@ void ShowPacketBytesDialog::updateFieldBytes(bool initialization)
}
updatePacketBytes();
+ updateHintLabel();
}
void ShowPacketBytesDialog::updatePacketBytes(void)
{
- static const gchar hexchars[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+ static const char hexchars[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
ui->tePacketBytes->clear();
ui->tePacketBytes->setCurrentFont(mainApp->monospaceFont());
@@ -670,7 +712,7 @@ void ShowPacketBytesDialog::updatePacketBytes(void)
QString text("char packet_bytes[] = {\n");
while (pos < len) {
- gchar hexbuf[256];
+ char hexbuf[256];
char *cur = hexbuf;
int i;
@@ -707,7 +749,7 @@ void ShowPacketBytesDialog::updatePacketBytes(void)
QString text("let packet_bytes: [u8; _] = [\n");
while (pos < len) {
- gchar hexbuf[256];
+ char hexbuf[256];
char *cur = hexbuf;
int i;
@@ -755,7 +797,7 @@ void ShowPacketBytesDialog::updatePacketBytes(void)
case SHOW_EBCDIC:
{
QByteArray ba(field_bytes_);
- EBCDIC_to_ASCII((guint8*)ba.data(), static_cast<int>(ba.length()));
+ EBCDIC_to_ASCII((uint8_t*)ba.data(), static_cast<int>(ba.length()));
sanitizeBuffer(ba, false);
ui->tePacketBytes->setLineWrapMode(QTextEdit::WidgetWidth);
ui->tePacketBytes->setPlainText(ba);
diff --git a/ui/qt/show_packet_bytes_dialog.h b/ui/qt/show_packet_bytes_dialog.h
index 80201c81..1f6183fa 100644
--- a/ui/qt/show_packet_bytes_dialog.h
+++ b/ui/qt/show_packet_bytes_dialog.h
@@ -11,7 +11,6 @@
#define SHOW_PACKET_BYTES_DIALOG_H
#include <config.h>
-#include <glib.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
@@ -31,6 +30,11 @@ class ShowPacketBytesDialog;
class ShowPacketBytesTextEdit;
}
+struct uncompress_list_t {
+ QString name;
+ tvbuff_t *(*function)(tvbuff_t *, int, int);
+};
+
class ShowPacketBytesDialog : public WiresharkDialog
{
Q_OBJECT
@@ -71,7 +75,7 @@ private:
void updateHintLabel();
void sanitizeBuffer(QByteArray &ba, bool handle_CR);
void symbolizeBuffer(QByteArray &ba);
- QByteArray decodeQuotedPrintable(const guint8 *bytes, int length);
+ QByteArray decodeQuotedPrintable(const uint8_t *bytes, int length);
void rot13(QByteArray &ba);
void updateFieldBytes(bool initialization = false);
void updatePacketBytes();
@@ -81,6 +85,7 @@ private:
const field_info *finfo_;
QByteArray field_bytes_;
QString hint_label_;
+ QString decode_as_name_;
QPushButton *print_button_;
QPushButton *copy_button_;
QPushButton *save_as_button_;
diff --git a/ui/qt/show_packet_bytes_dialog.ui b/ui/qt/show_packet_bytes_dialog.ui
index f60e625d..dfe03757 100644
--- a/ui/qt/show_packet_bytes_dialog.ui
+++ b/ui/qt/show_packet_bytes_dialog.ui
@@ -117,6 +117,13 @@
<widget class="FindLineEdit" name="leFind"/>
</item>
<item>
+ <widget class="QCheckBox" name="caseCheckBox">
+ <property name="text">
+ <string>Case sensitive</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QPushButton" name="bFind">
<property name="text">
<string>Find &amp;Next</string>
diff --git a/ui/qt/simple_dialog.cpp b/ui/qt/simple_dialog.cpp
index b45c7a19..c5a57d4d 100644
--- a/ui/qt/simple_dialog.cpp
+++ b/ui/qt/simple_dialog.cpp
@@ -90,8 +90,8 @@ simple_dialog_format_message(const char *msg)
return g_strdup(msg);
}
-gpointer
-simple_dialog(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format, ...)
+void *
+simple_dialog(ESD_TYPE_E type, int btn_mask, const char *msg_format, ...)
{
va_list ap;
@@ -103,8 +103,8 @@ simple_dialog(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format, ...)
return NULL;
}
-gpointer
-simple_dialog_async(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format, ...)
+void *
+simple_dialog_async(ESD_TYPE_E type, int btn_mask, const char *msg_format, ...)
{
va_list ap;
@@ -121,7 +121,7 @@ simple_dialog_async(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format, ...
* and checkbox, and optional secondary text.
*/
void
-simple_message_box(ESD_TYPE_E type, gboolean *notagain,
+simple_message_box(ESD_TYPE_E type, bool *notagain,
const char *secondary_msg, const char *msg_format, ...)
{
if (notagain && *notagain) {
@@ -202,7 +202,7 @@ SimpleDialog::SimpleDialog(QWidget *parent, ESD_TYPE_E type, int btn_mask, const
check_box_(0),
message_box_(0)
{
- gchar *vmessage;
+ char *vmessage;
QString message;
vmessage = ws_strdup_vprintf(msg_format, ap);
diff --git a/ui/qt/simple_dialog.h b/ui/qt/simple_dialog.h
index 2afda98d..32163e09 100644
--- a/ui/qt/simple_dialog.h
+++ b/ui/qt/simple_dialog.h
@@ -14,8 +14,6 @@
#include <stdio.h>
-#include <glib.h>
-
#include "ui/simple_dialog.h"
#include <QPair>
diff --git a/ui/qt/simple_statistics_dialog.cpp b/ui/qt/simple_statistics_dialog.cpp
index ae715603..c03d6bef 100644
--- a/ui/qt/simple_statistics_dialog.cpp
+++ b/ui/qt/simple_statistics_dialog.cpp
@@ -47,7 +47,7 @@ bool register_simple_stat_tables(const void *key, void *value, void*) {
stu->group,
simple_stat_init,
SimpleStatisticsDialog::createSimpleStatisticsDialog);
- return FALSE;
+ return false;
}
enum {
@@ -188,7 +188,7 @@ void SimpleStatisticsDialog::addMissingRows(struct _stat_data_t *stat_data)
// the top-level tree item text set to the column labels for that table.
// Add any missing tables and rows.
- for (guint table_idx = 0; table_idx < stat_data->stat_tap_data->tables->len; table_idx++) {
+ for (unsigned table_idx = 0; table_idx < stat_data->stat_tap_data->tables->len; table_idx++) {
stat_tap_table* st_table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, table_idx);
QTreeWidgetItem *ti = NULL;
@@ -200,7 +200,7 @@ void SimpleStatisticsDialog::addMissingRows(struct _stat_data_t *stat_data)
} else {
ti = statsTreeWidget()->topLevelItem(table_idx);
}
- for (guint element = ti->childCount(); element < st_table->num_elements; element++) {
+ for (unsigned element = ti->childCount(); element < st_table->num_elements; element++) {
stat_tap_table_item_type* fields = stat_tap_get_field_data(st_table, element, 0);
if (stu_->nfields > 0) {
SimpleStatisticsTreeWidgetItem *ss_ti = new SimpleStatisticsTreeWidgetItem(ti, st_table->num_fields, fields);
diff --git a/ui/qt/stats_tree_dialog.cpp b/ui/qt/stats_tree_dialog.cpp
index 1ec66b7e..f51e252a 100644
--- a/ui/qt/stats_tree_dialog.cpp
+++ b/ui/qt/stats_tree_dialog.cpp
@@ -97,18 +97,15 @@ void StatsTreeDialog::setupNode(stat_node* node)
} else {
st_dlg->statsTreeWidget()->addTopLevelItem(ti);
}
- st_dlg->statsTreeWidget()->resizeColumnToContents(item_col_);
}
void StatsTreeDialog::fillTree()
{
if (!st_cfg_ || file_closed_) return;
- QString display_name = gchar_free_to_qstring(stats_tree_get_displayname(st_cfg_->name));
-
- // The GTK+ UI appends "Stats Tree" to the window title. If we do the same
+ // The GTK+ UI appended "Stats Tree" to the window title. If we do the same
// here we should expand the name completely, e.g. to "Statistics Tree".
- setWindowSubtitle(display_name);
+ setWindowSubtitle(st_cfg_->title);
st_cfg_->pr = &cfg_pr_;
cfg_pr_.st_dlg = this;
@@ -122,7 +119,7 @@ void StatsTreeDialog::fillTree()
// Add number of columns for this stats_tree
QStringList header_labels;
for (int count = 0; count<st_->num_columns; count++) {
- header_labels.push_back(stats_tree_get_column_name(count));
+ header_labels.push_back(stats_tree_get_column_name(st_cfg_, count));
}
statsTreeWidget()->setColumnCount(static_cast<int>(header_labels.count()));
statsTreeWidget()->setHeaderLabels(header_labels);
@@ -142,10 +139,11 @@ void StatsTreeDialog::fillTree()
cap_file_.retapPackets();
drawTreeItems(st_);
- statsTreeWidget()->setSortingEnabled(true);
removeTapListeners();
-
st_cfg_->pr = NULL;
+
+ statsTreeWidget()->setSortingEnabled(true);
+ statsTreeWidget()->resizeColumnToContents(item_col_);
}
void StatsTreeDialog::resetTap(void *st_ptr)
@@ -167,7 +165,7 @@ void StatsTreeDialog::drawTreeItems(void *st_ptr)
while (*iter) {
stat_node *node = VariantPointer<stat_node>::asPtr((*iter)->data(item_col_, Qt::UserRole));
if (node) {
- gchar **valstrs = stats_tree_get_values_from_node(node);
+ char **valstrs = stats_tree_get_values_from_node(node);
for (int count = 0; count<st->num_columns; count++) {
(*iter)->setText(count,valstrs[count]);
g_free(valstrs[count]);
diff --git a/ui/qt/stats_tree_dialog.h b/ui/qt/stats_tree_dialog.h
index de040811..a5f0a236 100644
--- a/ui/qt/stats_tree_dialog.h
+++ b/ui/qt/stats_tree_dialog.h
@@ -14,8 +14,6 @@
#include <config.h>
-#include <glib.h>
-
#include "epan/stats_tree_priv.h"
struct _tree_cfg_pres {
diff --git a/ui/qt/strip_headers_dialog.cpp b/ui/qt/strip_headers_dialog.cpp
index 73775ddf..35f6fa13 100644
--- a/ui/qt/strip_headers_dialog.cpp
+++ b/ui/qt/strip_headers_dialog.cpp
@@ -20,6 +20,8 @@
#include "ui/export_pdu_ui_utils.h"
#include "ui/capture_globals.h"
+#include "main_application.h"
+
StripHeadersDialog::StripHeadersDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::StripHeadersDialog)
@@ -28,12 +30,15 @@ StripHeadersDialog::StripHeadersDialog(QWidget *parent) :
ui->setupUi(this);
+ setWindowTitle(mainApp->windowTitleString(tr("Strip Headers")));
+
for (tap_name_list = get_export_pdu_tap_list(); tap_name_list; tap_name_list = g_slist_next(tap_name_list)) {
if (export_pdu_tap_get_encap((const char*)tap_name_list->data) != WTAP_ENCAP_WIRESHARK_UPPER_PDU) {
ui->comboBox->addItem((const char*)(tap_name_list->data));
}
}
}
+
void StripHeadersDialog::on_buttonBox_accepted()
{
const QByteArray& filter = ui->displayFilterLineEdit->text().toUtf8();
@@ -41,6 +46,12 @@ void StripHeadersDialog::on_buttonBox_accepted()
do_export_pdu(filter.constData(), global_capture_opts.temp_dir, tap_name.constData());
}
+
+void StripHeadersDialog::on_buttonBox_helpRequested()
+{
+ mainApp->helpTopicAction(HELP_STRIP_HEADERS_DIALOG);
+}
+
StripHeadersDialog::~StripHeadersDialog()
{
delete ui;
diff --git a/ui/qt/strip_headers_dialog.h b/ui/qt/strip_headers_dialog.h
index bce54784..d048293b 100644
--- a/ui/qt/strip_headers_dialog.h
+++ b/ui/qt/strip_headers_dialog.h
@@ -30,6 +30,7 @@ private:
private slots:
void on_buttonBox_accepted();
+ void on_buttonBox_helpRequested();
};
#endif // STRIP_HEADERS_DIALOG_H
diff --git a/ui/qt/strip_headers_dialog.ui b/ui/qt/strip_headers_dialog.ui
index cc40162a..3ea44b4c 100644
--- a/ui/qt/strip_headers_dialog.ui
+++ b/ui/qt/strip_headers_dialog.ui
@@ -26,7 +26,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Help</set>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
@@ -75,32 +75,12 @@
<signal>accepted()</signal>
<receiver>StripHeadersDialog</receiver>
<slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>StripHeadersDialog</receiver>
<slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
</connection>
</connections>
</ui>
diff --git a/ui/qt/supported_protocols_dialog.cpp b/ui/qt/supported_protocols_dialog.cpp
index eea2d738..10457f23 100644
--- a/ui/qt/supported_protocols_dialog.cpp
+++ b/ui/qt/supported_protocols_dialog.cpp
@@ -93,6 +93,6 @@ void SupportedProtocolsDialog::on_searchLineEdit_textChanged(const QString &sear
* the countdown.
*/
searchLineEditText = search_re;
- guint gui_debounce_timer = prefs_get_uint_value("gui", "debounce.timer");
+ unsigned gui_debounce_timer = prefs_get_uint_value("gui", "debounce.timer");
searchLineEditTimer->start(gui_debounce_timer);
}
diff --git a/ui/qt/tap_parameter_dialog.cpp b/ui/qt/tap_parameter_dialog.cpp
index 4652b672..eeb838dd 100644
--- a/ui/qt/tap_parameter_dialog.cpp
+++ b/ui/qt/tap_parameter_dialog.cpp
@@ -43,10 +43,11 @@
#include <ui/qt/utils/qt_ui_utils.h>
#include "main_application.h"
+#include <ui/qt/widgets/wireshark_file_dialog.h>
+
#include <QClipboard>
#include <QContextMenuEvent>
#include <QMessageBox>
-#include <QFileDialog>
// The GTK+ counterpart uses tap_param_dlg, which we don't use. If we
// need tap parameters we should probably create a TapParameterDialog
@@ -97,6 +98,7 @@ TapParameterDialog::TapParameterDialog(QWidget &parent, CaptureFile &cf, int hel
QString filter = ui->displayFilterLineEdit->text();
emit updateFilter(filter);
}
+ updateWidgets();
show_timer_ = new QTimer(this);
setRetapOnShow(true);
}
@@ -496,7 +498,7 @@ void TapParameterDialog::updateWidgets()
bool edit_enable = true;
bool apply_enable = true;
- if (file_closed_) {
+ if (file_closed_ || !cap_file_.isValid()) {
edit_enable = false;
apply_enable = false;
} else if (!ui->displayFilterLineEdit->checkFilter()) {
@@ -511,9 +513,9 @@ void TapParameterDialog::updateWidgets()
void TapParameterDialog::on_applyFilterButton_clicked()
{
- beginRetapPackets();
- if (!ui->displayFilterLineEdit->checkFilter())
+ if (!ui->displayFilterLineEdit->checkFilter()) {
return;
+ }
QString filter = ui->displayFilterLineEdit->text();
emit updateFilter(filter);
@@ -528,7 +530,6 @@ void TapParameterDialog::on_applyFilterButton_clicked()
fillTree();
ui->applyFilterButton->setEnabled(af_enabled);
ui->displayFilterLineEdit->setEnabled(df_enabled);
- endRetapPackets();
}
void TapParameterDialog::on_actionCopyToClipboard_triggered()
@@ -548,7 +549,7 @@ void TapParameterDialog::on_actionSaveAs_triggered()
#ifdef Q_OS_WIN
HANDLE da_ctx = set_thread_per_monitor_v2_awareness();
#endif
- QFileDialog SaveAsDialog(this, mainApp->windowTitleString(tr("Save Statistics As…")),
+ WiresharkFileDialog SaveAsDialog(this, mainApp->windowTitleString(tr("Save Statistics As…")),
get_open_dialog_initial_dir());
SaveAsDialog.setNameFilter(tr("Plain text file (*.txt);;"
"Comma separated values (*.csv);;"
@@ -582,7 +583,7 @@ void TapParameterDialog::on_actionSaveAs_triggered()
}
// Get selected filename and add extension of necessary
- QString file_name = SaveAsDialog.selectedFiles()[0];
+ QString file_name = SaveAsDialog.selectedNativePath();
if (!file_name.endsWith(file_ext, Qt::CaseInsensitive)) {
file_name.append(file_ext);
}
diff --git a/ui/qt/tap_parameter_dialog.h b/ui/qt/tap_parameter_dialog.h
index 1ed9db78..84a6f69e 100644
--- a/ui/qt/tap_parameter_dialog.h
+++ b/ui/qt/tap_parameter_dialog.h
@@ -18,8 +18,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/stat_groups.h>
#include <epan/stat_tap_ui.h>
diff --git a/ui/qt/tcp_stream_dialog.cpp b/ui/qt/tcp_stream_dialog.cpp
index 8d668f62..881ee455 100644
--- a/ui/qt/tcp_stream_dialog.cpp
+++ b/ui/qt/tcp_stream_dialog.cpp
@@ -136,8 +136,8 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty
ui->streamNumberSpinBox->setStyleSheet("QSpinBox { min-width: 2em; }");
- guint32 th_stream = select_tcpip_session(cap_file_);
- if (th_stream == G_MAXUINT32) {
+ uint32_t th_stream = select_tcpip_session(cap_file_);
+ if (th_stream == UINT32_MAX) {
done(QDialog::Rejected);
return;
}
@@ -184,6 +184,7 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty
ctx_menu_.addAction(ui->actionToggleSequenceNumbers);
ctx_menu_.addAction(ui->actionToggleTimeOrigin);
ctx_menu_.addAction(ui->actionCrosshairs);
+ connect(ui->actionCrosshairs, &QAction::triggered, this, &TCPStreamDialog::toggleTracerStyle);
ctx_menu_.addSeparator();
ctx_menu_.addAction(ui->actionRoundTripTime);
ctx_menu_.addAction(ui->actionThroughput);
@@ -192,6 +193,11 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty
ctx_menu_.addAction(ui->actionWindowScaling);
set_action_shortcuts_visible_in_context_menu(ctx_menu_.actions());
+ QCustomPlot *sp = ui->streamPlot;
+
+ sp->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(sp, &QCustomPlot::customContextMenuRequested, this, &TCPStreamDialog::showContextMenu);
+
graph_.type = graph_type;
graph_.stream = th_stream;
findStream();
@@ -229,7 +235,6 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty
ui->showBytesOutCheckBox->setChecked(true);
ui->showBytesOutCheckBox->blockSignals(false);
- QCustomPlot *sp = ui->streamPlot;
QCPTextElement *file_title = new QCPTextElement(sp, gchar_free_to_qstring(cf_get_display_name(cap_file_)));
file_title->setFont(sp->xAxis->labelFont());
title_ = new QCPTextElement(sp);
@@ -295,7 +300,7 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty
sack2_eb_->setDataPlottable(sack2_graph_);
// RWin graph - displays upper extent of RWIN advertised on reverse packets
- rwin_graph_ = sp->addGraph(sp->xAxis, sp->yAxis2);
+ rwin_graph_ = sp->addGraph();
rwin_graph_->setPen(QPen(QBrush(graph_color_3), pen_width));
rwin_graph_->setLineStyle(QCPGraph::lsStepLeft);
@@ -554,6 +559,9 @@ void TCPStreamDialog::fillGraph(bool reset_axes, bool set_focus)
sp->yAxis2->setVisible(false);
sp->yAxis2->setLabel(QString());
+ /* For graphs other than receive window, the axes are not in sync. */
+ disconnect(sp->yAxis, QOverload<const QCPRange&>::of(&QCPAxis::rangeChanged), sp->yAxis2, QOverload<const QCPRange&>::of(&QCPAxis::setRange));
+
if (!cap_file_) {
QString dlg_title = QString(tr("No Capture Data"));
setWindowTitle(dlg_title);
@@ -566,9 +574,13 @@ void TCPStreamDialog::fillGraph(bool reset_axes, bool set_focus)
ts_offset_ = 0;
seq_offset_ = 0;
- bool first = true;
- guint64 bytes_fwd = 0;
- guint64 bytes_rev = 0;
+ bool ts_unset = ts_origin_conn_;
+ // seq_origin_zero_ defaults to true. It really means something like
+ // "use relative or absolute depending on the TCP dissector preferences".
+ // If it's false, then calculate the offset to convert to the other.
+ bool seq_unset = !seq_origin_zero_;
+ uint64_t bytes_fwd = 0;
+ uint64_t bytes_rev = 0;
int pkts_fwd = 0;
int pkts_rev = 0;
@@ -588,15 +600,37 @@ void TCPStreamDialog::fillGraph(bool reset_axes, bool set_focus)
pkts_fwd++;
}
double ts = seg->rel_secs + seg->rel_usecs / 1000000.0;
- if (first) {
- if (ts_origin_conn_) ts_offset_ = ts;
- if (seq_origin_zero_) {
- if (compareHeaders(seg))
- seq_offset_ = seg->th_seq;
- else
- seq_offset_ = seg->th_ack;
+ if (ts_unset) {
+ ts_offset_ = ts;
+ ts_unset = false;
+ }
+ if (seq_unset) {
+ if (compareHeaders(seg)) {
+ if (seg->th_seq != seg->th_rawseq) {
+ seq_offset_ = seg->th_seq - seg->th_rawseq;
+ } else {
+ // As with the TCP dissector, if this isn't the SYN or SYN-ACK,
+ // start the relative sequence numbers at 1.
+ if (seg->th_flags & TH_SYN) {
+ seq_offset_ = seg->th_seq;
+ } else {
+ seq_offset_ = seg->th_seq - 1;
+ }
+ }
+ seq_unset = false;
+ } else {
+ // A SYN in the reverse direction does not tell us the base
+ // sequence number, but for other segments (including SYN-ACK)
+ // start the offset at 1, like the TCP dissector.
+ if ((seg->th_flags & TH_SYN) != TH_SYN) {
+ if (seg->th_seq != seg->th_rawseq) {
+ seq_offset_ = seg->th_seq - seg->th_rawseq;
+ } else {
+ seq_offset_ -= seg->th_ack - 1;
+ }
+ seq_unset = false;
+ }
}
- first = false;
}
if (insert) {
time_stamp_map_.insert(ts - ts_offset_, seg);
@@ -762,7 +796,8 @@ void TCPStreamDialog::resetAxes()
// }
double axis_pixels = sp->xAxis->axisRect()->width();
- sp->xAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, sp->xAxis->range().center());
+ sp->xAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels,
+ sp->xAxis->range().center());
if (sp->yAxis2->visible()) {
double ratio = sp->yAxis2->range().size() / sp->yAxis->range().size();
@@ -771,7 +806,8 @@ void TCPStreamDialog::resetAxes()
}
axis_pixels = sp->yAxis->axisRect()->height();
- sp->yAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels, sp->yAxis->range().center());
+ sp->yAxis->scaleRange((axis_pixels + (pixel_pad * 2)) / axis_pixels,
+ sp->yAxis->range().center());
sp->replot();
}
@@ -905,6 +941,7 @@ void TCPStreamDialog::fillTcptrace()
sack_eb_->setData(sack_span);
sack2_graph_->setData(sack2_time, sack2_center, true);
sack2_eb_->setData(sack2_span);
+ rwin_graph_->setValueAxis(sp->yAxis);
rwin_graph_->setData(ackrwin_time, rwin, true);
dup_ack_graph_->setData(dup_ack_time, dup_ack, true);
zero_win_graph_->setData(zero_win_time, zero_win, true);
@@ -921,7 +958,7 @@ void TCPStreamDialog::fillTcptrace()
// I expect this to be _relatively_ small, so using vector to store
// them. If this performs badly, it can be refactored with std::list
// or std::map.
-typedef std::pair<guint32, guint32> sack_t;
+typedef std::pair<uint32_t, uint32_t> sack_t;
typedef std::vector<sack_t> sack_list_t;
static inline bool compare_sack(const sack_t& s1, const sack_t& s2) {
return tcp_seq_before(s1.first, s2.first);
@@ -931,8 +968,8 @@ static inline bool compare_sack(const sack_t& s1, const sack_t& s2) {
// - removes previously sacked ranges from seglen (and from old_sacks),
// - adds newly sacked ranges to seglen (and to old_sacks)
static void
-goodput_adjust_for_sacks(guint32 *seglen, guint32 last_ack,
- sack_list_t& new_sacks, guint8 num_sack_ranges,
+goodput_adjust_for_sacks(uint32_t *seglen, uint32_t last_ack,
+ sack_list_t& new_sacks, uint8_t num_sack_ranges,
sack_list_t& old_sacks) {
// Step 1 - For any old_sacks acked by last_ack,
@@ -1201,8 +1238,8 @@ void TCPStreamDialog::fillThroughput()
QVector<double> tput_times, gput_times;
QVector<double> tputs, gputs;
int oldest_seg = 0, oldest_ack = 0;
- guint64 seg_sum = 0, ack_sum = 0;
- guint32 seglen = 0;
+ uint64_t seg_sum = 0, ack_sum = 0;
+ uint32_t seglen = 0;
#ifdef USE_SACKS_IN_GOODPUT_CALC
// to incorporate SACKED segments into goodput calculation,
@@ -1220,7 +1257,7 @@ void TCPStreamDialog::fillThroughput()
// need first acked sequence number to jump-start
// computation of acked bytes per packet
- guint32 last_ack = 0;
+ uint32_t last_ack = 0;
for (struct segment *seg = graph_.segments; seg != NULL; seg = seg->next) {
// first reverse packet with ACK flag tells us first acked sequence #
if (!compareHeaders(seg) && (seg->th_flags & TH_ACK)) {
@@ -1249,7 +1286,7 @@ void TCPStreamDialog::fillThroughput()
QVector<double>& r_Xput_times = is_forward_seg ? tput_times : gput_times;
QVector<double>& r_Xputs = is_forward_seg ? tputs : gputs;
int& r_oldest = is_forward_seg ? oldest_seg : oldest_ack;
- guint64& r_sum = is_forward_seg ? seg_sum : ack_sum;
+ uint64_t& r_sum = is_forward_seg ? seg_sum : ack_sum;
double ts = (seg->rel_secs + seg->rel_usecs / 1000000.0) - ts_offset_;
@@ -1459,9 +1496,15 @@ void TCPStreamDialog::fillRoundTripTime()
base_graph_->setLineStyle(QCPGraph::lsLine);
QVector<double> x_vals, rtt;
- guint32 seq_base = 0;
+ uint32_t seq_base = 0;
struct rtt_unack *unack_list = NULL, *u = NULL;
for (struct segment *seg = graph_.segments; seg != NULL; seg = seg->next) {
+ // XXX - Should this just use seq_offset_? Our comparisons are
+ // wraparound now and should be fine without computing a base
+ // (we're not doing anything to extend sequence numbers to handle
+ // connections longer than 4 GiB), and that would let the user swap.
+ // (We should make clicking the X axis swap seq_origin_zero_ if
+ // bySeqNumber is checked.)
if (compareHeaders(seg)) {
seq_base = seg->th_seq;
break;
@@ -1469,7 +1512,7 @@ void TCPStreamDialog::fillRoundTripTime()
}
for (struct segment *seg = graph_.segments; seg != NULL; seg = seg->next) {
if (compareHeaders(seg)) {
- guint32 seqno = seg->th_seq - seq_base;
+ uint32_t seqno = seg->th_seq - seq_base;
if (seg->th_seglen && !rtt_is_retrans(unack_list, seqno)) {
double rt_val = seg->rel_secs + seg->rel_usecs / 1000000.0;
rt_val -= ts_offset_;
@@ -1482,7 +1525,7 @@ void TCPStreamDialog::fillRoundTripTime()
rtt_put_unack_on_list(&unack_list, u);
}
} else {
- guint32 ack_no = seg->th_ack - seq_base;
+ uint32_t ack_no = seg->th_ack - seq_base;
double rt_val = seg->rel_secs + seg->rel_usecs / 1000000.0;
rt_val -= ts_offset_;
struct rtt_unack *v;
@@ -1515,8 +1558,8 @@ void TCPStreamDialog::fillRoundTripTime()
// If we link those back into the list between u and v,
// then each subsequent SACK selectively ACKs that range.
for (int i = 0; i < seg->num_sack_ranges; ++i) {
- guint32 left = seg->sack_left_edge[i] - seq_base;
- guint32 right = seg->sack_right_edge[i] - seq_base;
+ uint32_t left = seg->sack_left_edge[i] - seq_base;
+ uint32_t right = seg->sack_right_edge[i] - seq_base;
u = rtt_selectively_ack_range(x_vals, bySeqNumber, rtt,
&unack_list, u, v,
left, right, rt_val);
@@ -1549,7 +1592,11 @@ void TCPStreamDialog::fillWindowScale()
QVector<double> rel_time, win_size;
QVector<double> cwnd_time, cwnd_size;
- guint32 last_ack = 0;
+ uint32_t last_ack = 0;
+
+ /* highest expected SEQ seen so far */
+ uint32_t max_next_seq = 0;
+
bool found_first_ack = false;
for (struct segment *seg = graph_.segments; seg != NULL; seg = seg->next) {
double ts = seg->rel_secs + seg->rel_usecs / 1000000.0;
@@ -1557,16 +1604,21 @@ void TCPStreamDialog::fillWindowScale()
// The receive window that applies to this flow comes
// from packets in the opposite direction
if (compareHeaders(seg)) {
- // compute bytes_in_flight for cwnd graph
- guint32 end_seq = seg->th_seq + seg->th_seglen;
+ /* compute bytes_in_flight for cwnd graph,
+ * by comparing the highest next SEQ to the latest ACK
+ */
+ uint32_t end_seq = seg->th_seq + seg->th_seglen;
+ if(end_seq > max_next_seq) {
+ max_next_seq = end_seq;
+ }
if (found_first_ack &&
tcp_seq_eq_or_after(end_seq, last_ack)) {
cwnd_time.append(ts - ts_offset_);
- cwnd_size.append((double)(end_seq - last_ack));
+ cwnd_size.append((double)(max_next_seq - last_ack));
}
} else {
// packet in opposite direction - has advertised rwin
- guint16 flags = seg->th_flags;
+ uint16_t flags = seg->th_flags;
if ((flags & (TH_SYN|TH_RST)) == 0) {
rel_time.append(ts - ts_offset_);
@@ -1585,15 +1637,24 @@ void TCPStreamDialog::fillWindowScale()
/* base_graph_ is the one that the tracer is on and allows selecting
* segments. XXX - Is the congestion window more interesting to see
* the exact value and select?
+ *
+ * We'll put the graphs on the same axis so they'll use the same scale.
*/
base_graph_->setData(cwnd_time, cwnd_size);
+ rwin_graph_->setValueAxis(sp->yAxis);
rwin_graph_->setData(rel_time, win_size);
- sp->yAxis->setLabel(cwnd_label_);
+ /* The left axis has the color and label for the unacked bytes,
+ * and the right axis will have the color and label for the window size.
+ */
+ sp->yAxis->setLabel(cwnd_label_);
sp->yAxis2->setLabel(window_size_label_);
sp->yAxis2->setLabelColor(QColor(graph_color_3));
sp->yAxis2->setTickLabelColor(QColor(graph_color_3));
sp->yAxis2->setVisible(true);
+
+ /* Keep the ticks on the two axes in sync. */
+ connect(sp->yAxis, QOverload<const QCPRange&>::of(&QCPAxis::rangeChanged), sp->yAxis2, QOverload<const QCPRange&>::of(&QCPAxis::setRange));
}
QString TCPStreamDialog::streamDescription()
@@ -1666,6 +1727,11 @@ QRectF TCPStreamDialog::getZoomRanges(QRect zoom_rect)
return zoom_ranges;
}
+void TCPStreamDialog::showContextMenu(const QPoint& pos)
+{
+ ctx_menu_.popup(ui->streamPlot->mapToGlobal(pos));
+}
+
void TCPStreamDialog::graphClicked(QMouseEvent *event)
{
QCustomPlot *sp = ui->streamPlot;
@@ -1673,15 +1739,7 @@ void TCPStreamDialog::graphClicked(QMouseEvent *event)
// mouse press on graph should reset focus to graph
sp->setFocus();
- if (event->button() == Qt::RightButton) {
- // XXX We should find some way to get streamPlot to handle a
- // contextMenuEvent instead.
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0 ,0)
- ctx_menu_.popup(event->globalPosition().toPoint());
-#else
- ctx_menu_.popup(event->globalPos());
-#endif
- } else if (mouse_drags_) {
+ if (mouse_drags_) {
if (sp->axisRect()->rect().contains(event->pos())) {
sp->setCursor(QCursor(Qt::ClosedHandCursor));
}
@@ -1789,12 +1847,16 @@ void TCPStreamDialog::mouseMoved(QMouseEvent *event)
tracer_->setVisible(true);
packet_num_ = packet_seg->num;
+ // XXX - We should probably change the sequence number displayed by
+ // seq_offset_ but in that case we should also store a base sequence
+ // number for the other direction so the th_ack can also be adjusted
+ // to a relative sequence number.
hint += tr("%1 %2 (%3s len %4 seq %5 ack %6 win %7)")
.arg(cap_file_ ? tr("Click to select packet") : tr("Packet"))
.arg(packet_num_)
.arg(QString::number(packet_seg->rel_secs + packet_seg->rel_usecs / 1000000.0, 'g', 4))
.arg(packet_seg->th_seglen)
- .arg(packet_seg->th_seq)
+ .arg(packet_seg->th_seq) // - seq_offset_)
.arg(packet_seg->th_ack)
.arg(packet_seg->th_win);
tracer_->setGraphKey(ui->streamPlot->xAxis->pixelToCoord(event->pos().x()));
@@ -2117,7 +2179,7 @@ void TCPStreamDialog::on_actionPreviousStream_triggered()
void TCPStreamDialog::on_actionSwitchDirection_triggered()
{
address tmp_addr;
- guint16 tmp_port;
+ uint16_t tmp_port;
copy_address(&tmp_addr, &graph_.src_address);
tmp_port = graph_.src_port;
diff --git a/ui/qt/tcp_stream_dialog.h b/ui/qt/tcp_stream_dialog.h
index c5b97de0..4281538b 100644
--- a/ui/qt/tcp_stream_dialog.h
+++ b/ui/qt/tcp_stream_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <file.h>
#include <epan/dissectors/packet-tcp.h>
@@ -71,7 +69,7 @@ private:
double ts_offset_;
bool ts_origin_conn_;
QMap<double, struct segment *> sequence_num_map_;
- double seq_offset_;
+ uint32_t seq_offset_;
bool seq_origin_zero_;
struct tcp_graph graph_;
QCPTextElement *title_;
@@ -91,7 +89,7 @@ private:
QCPGraph *zero_win_graph_;
QCPItemTracer *tracer_;
QRectF axis_bounds_;
- guint32 packet_num_;
+ uint32_t packet_num_;
QTransform y_axis_xfrm_;
bool mouse_drags_;
QRubberBand *rubber_band_;
@@ -141,6 +139,7 @@ private:
QRectF getZoomRanges(QRect zoom_rect);
private slots:
+ void showContextMenu(const QPoint &pos);
void graphClicked(QMouseEvent *event);
void axisClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event);
void mouseMoved(QMouseEvent *event);
diff --git a/ui/qt/time_shift_dialog.cpp b/ui/qt/time_shift_dialog.cpp
index f1b325f0..5dab7618 100644
--- a/ui/qt/time_shift_dialog.cpp
+++ b/ui/qt/time_shift_dialog.cpp
@@ -116,7 +116,7 @@ void TimeShiftDialog::enableWidgets()
void TimeShiftDialog::checkFrameNumber(SyntaxLineEdit &frame_le)
{
bool frame_valid;
- guint frame_num = frame_le.text().toUInt(&frame_valid);
+ unsigned frame_num = frame_le.text().toUInt(&frame_valid);
syntax_err_.clear();
if (frame_le.text().isEmpty()) {
@@ -137,7 +137,7 @@ void TimeShiftDialog::checkDateTime(SyntaxLineEdit &time_le)
{
int Y, M, D, h, m;
long double s;
- const gchar *err_str;
+ const char *err_str;
syntax_err_.clear();
if (time_le.text().isEmpty()) {
@@ -175,8 +175,8 @@ void TimeShiftDialog::on_shiftAllTimeLineEdit_textChanged(const QString &sa_text
{
int h, m;
long double s;
- gboolean neg;
- const gchar *err_str;
+ bool neg;
+ const char *err_str;
syntax_err_.clear();
if (sa_text.isEmpty()) {
@@ -223,7 +223,7 @@ void TimeShiftDialog::on_setTwoTimeLineEdit_textChanged(const QString &)
void TimeShiftDialog::applyTimeShift()
{
- const gchar *err_str = NULL;
+ const char *err_str = NULL;
if (!cap_file_ || cap_file_->state == FILE_CLOSED || cap_file_->state == FILE_READ_PENDING) return;
diff --git a/ui/qt/time_shift_dialog.h b/ui/qt/time_shift_dialog.h
index 65164946..4e218ba4 100644
--- a/ui/qt/time_shift_dialog.h
+++ b/ui/qt/time_shift_dialog.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "cfile.h"
#include <ui/qt/widgets/syntax_line_edit.h>
diff --git a/ui/qt/uat_dialog.cpp b/ui/qt/uat_dialog.cpp
index 6f9d2a7c..bf518888 100644
--- a/ui/qt/uat_dialog.cpp
+++ b/ui/qt/uat_dialog.cpp
@@ -70,10 +70,6 @@ UatDialog::UatDialog(QWidget *parent, epan_uat *uat) :
ui->uatTreeView->setEditTriggers(ui->uatTreeView->editTriggers() |
QAbstractItemView::CurrentChanged | QAbstractItemView::AnyKeyPressed);
- // Need to add uat_move or uat_insert to the UAT API.
- ui->uatTreeView->setDragEnabled(false);
-// qDebug() << "FIX Add drag reordering to UAT dialog";
-
// Do NOT start editing the first column for the first item
ui->uatTreeView->setCurrentIndex(QModelIndex());
}
@@ -106,7 +102,7 @@ void UatDialog::setUat(epan_uat *uat)
connect(copy_button, &CopyFromProfileButton::copyProfile, this, &UatDialog::copyFromProfile);
}
- QString abs_path = gchar_free_to_qstring(uat_get_actual_filename(uat_, FALSE));
+ QString abs_path = gchar_free_to_qstring(uat_get_actual_filename(uat_, false));
if (abs_path.length() > 0) {
ui->pathLabel->setText(abs_path);
ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
@@ -120,6 +116,7 @@ void UatDialog::setUat(epan_uat *uat)
uat_delegate_ = new UatDelegate;
ui->uatTreeView->setModel(uat_model_);
ui->uatTreeView->setItemDelegate(uat_delegate_);
+ ui->uatTreeView->setSelectionMode(QAbstractItemView::ContiguousSelection);
resizeColumns();
ui->clearToolButton->setEnabled(uat_model_->rowCount() != 0);
@@ -129,6 +126,9 @@ void UatDialog::setUat(epan_uat *uat)
this, SLOT(modelRowsRemoved()));
connect(uat_model_, SIGNAL(modelReset()), this, SLOT(modelRowsReset()));
+ connect(ui->uatTreeView->selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &UatDialog::uatTreeViewSelectionChanged);
+
ok_button_->setEnabled(!uat_model_->hasErrors());
if (uat_->help && strlen(uat_->help) > 0) {
@@ -144,9 +144,9 @@ void UatDialog::setUat(epan_uat *uat)
void UatDialog::copyFromProfile(QString filename)
{
- gchar *err = NULL;
+ char *err = NULL;
if (uat_load(uat_, filename.toUtf8().constData(), &err)) {
- uat_->changed = TRUE;
+ uat_->changed = true;
uat_model_->reloadUat();
} else {
report_failure("Error while loading %s: %s", uat_->name, err);
@@ -176,6 +176,7 @@ void UatDialog::modelRowsRemoved()
ui->moveUpToolButton->setEnabled(false);
ui->moveDownToolButton->setEnabled(false);
}
+ ui->clearToolButton->setEnabled(uat_model_->rowCount() != 0);
checkForErrorHint(current, QModelIndex());
ok_button_->setEnabled(!uat_model_->hasErrors());
@@ -190,23 +191,32 @@ void UatDialog::modelRowsReset()
ui->moveDownToolButton->setEnabled(false);
}
+void UatDialog::uatTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&)
+{
+ QModelIndexList selectedRows = ui->uatTreeView->selectionModel()->selectedRows();
+ qsizetype num_selected = selectedRows.size();
+ if (num_selected > 0) {
+ std::sort(selectedRows.begin(), selectedRows.end());
+ ui->deleteToolButton->setEnabled(true);
+ ui->copyToolButton->setEnabled(true);
+ ui->moveUpToolButton->setEnabled(selectedRows.first().row() > 0);
+ ui->moveDownToolButton->setEnabled(selectedRows.last().row() < uat_model_->rowCount() - 1);
+ } else {
+ ui->deleteToolButton->setEnabled(false);
+ ui->copyToolButton->setEnabled(false);
+ ui->moveUpToolButton->setEnabled(false);
+ ui->moveDownToolButton->setEnabled(false);
+ }
+}
// Invoked when a different field is selected. Note: when selecting a different
// field after editing, this event is triggered after modelDataChanged.
void UatDialog::on_uatTreeView_currentItemChanged(const QModelIndex &current, const QModelIndex &previous)
{
if (current.isValid()) {
- ui->deleteToolButton->setEnabled(true);
ui->clearToolButton->setEnabled(true);
- ui->copyToolButton->setEnabled(true);
- ui->moveUpToolButton->setEnabled(current.row() != 0);
- ui->moveDownToolButton->setEnabled(current.row() != (uat_model_->rowCount() - 1));
} else {
- ui->deleteToolButton->setEnabled(false);
ui->clearToolButton->setEnabled(false);
- ui->copyToolButton->setEnabled(false);
- ui->moveUpToolButton->setEnabled(false);
- ui->moveDownToolButton->setEnabled(false);
}
checkForErrorHint(current, previous);
@@ -289,46 +299,86 @@ void UatDialog::on_newToolButton_clicked()
void UatDialog::on_deleteToolButton_clicked()
{
- const QModelIndex &current = ui->uatTreeView->currentIndex();
- if (uat_model_ && current.isValid()) {
- if (!uat_model_->removeRows(current.row(), 1)) {
- qDebug() << "Failed to remove row";
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ for (const auto &range : ui->uatTreeView->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty()) {
+ if (!uat_model_->removeRows(range.top(), range.bottom() - range.top() + 1)) {
+ qDebug() << "Failed to remove rows" << range.top() << "to" << range.bottom();
+ }
}
}
}
void UatDialog::on_copyToolButton_clicked()
{
- addRecord(true);
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ QModelIndexList selectedRows = ui->uatTreeView->selectionModel()->selectedRows();
+ if (selectedRows.size() > 0) {
+ std::sort(selectedRows.begin(), selectedRows.end());
+
+ QModelIndex copyIdx;
+
+ for (const auto &idx : selectedRows) {
+ copyIdx = uat_model_->copyRow(idx);
+ if (!copyIdx.isValid())
+ {
+ qDebug() << "Failed to copy row" << idx.row();
+ }
+ // trigger updating error messages and the OK button state.
+ modelDataChanged(copyIdx);
+ }
+ // due to an EditTrigger, this will also start editing.
+ ui->uatTreeView->setCurrentIndex(copyIdx);
+ }
+
}
void UatDialog::on_moveUpToolButton_clicked()
{
- const QModelIndex &current = ui->uatTreeView->currentIndex();
- int current_row = current.row();
- if (uat_model_ && current.isValid() && current_row > 0) {
- if (!uat_model_->moveRow(current_row, current_row - 1)) {
- qDebug() << "Failed to move row up";
- return;
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ for (const auto &range : ui->uatTreeView->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty() && range.top() > 0) {
+ // Swap range of rows with the row above the top
+ if (! uat_model_->moveRows(QModelIndex(), range.top(), range.bottom() - range.top() + 1, QModelIndex(), range.top() - 1)) {
+ qDebug() << "Failed to move up rows" << range.top() << "to" << range.bottom();
+ }
+ // Our moveRows implementation calls begin/endMoveRows(), so
+ // range.top() already has the new row number.
+ ui->moveUpToolButton->setEnabled(range.top() > 0);
+ ui->moveDownToolButton->setEnabled(true);
}
- current_row--;
- ui->moveUpToolButton->setEnabled(current_row > 0);
- ui->moveDownToolButton->setEnabled(current_row < (uat_model_->rowCount() - 1));
}
}
void UatDialog::on_moveDownToolButton_clicked()
{
- const QModelIndex &current = ui->uatTreeView->currentIndex();
- int current_row = current.row();
- if (uat_model_ && current.isValid() && current_row < (uat_model_->rowCount() - 1)) {
- if (!uat_model_->moveRow(current_row, current_row + 1)) {
- qDebug() << "Failed to move row down";
- return;
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ for (const auto &range : ui->uatTreeView->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty() && range.bottom() + 1 < uat_model_->rowCount()) {
+ // Swap range of rows with the row below the top
+ if (! uat_model_->moveRows(QModelIndex(), range.top(), range.bottom() - range.top() + 1, QModelIndex(), range.bottom() + 1)) {
+ qDebug() << "Failed to move down rows" << range.top() << "to" << range.bottom();
+ }
+ // Our moveRows implementation calls begin/endMoveRows, so
+ // range.bottom() already has the new row number.
+ ui->moveUpToolButton->setEnabled(true);
+ ui->moveDownToolButton->setEnabled(range.bottom() < uat_model_->rowCount() - 1);
}
- current_row++;
- ui->moveUpToolButton->setEnabled(current_row > 0);
- ui->moveDownToolButton->setEnabled(current_row < (uat_model_->rowCount() - 1));
}
}
diff --git a/ui/qt/uat_dialog.h b/ui/qt/uat_dialog.h
index 92d7d21b..6316198a 100644
--- a/ui/qt/uat_dialog.h
+++ b/ui/qt/uat_dialog.h
@@ -12,14 +12,13 @@
#include <config.h>
-#include <glib.h>
-
#include "geometry_state_dialog.h"
#include <ui/qt/models/uat_model.h>
#include <ui/qt/models/uat_delegate.h>
class QComboBox;
class QPushButton;
+class QItemSelection;
struct epan_uat;
@@ -42,6 +41,7 @@ private slots:
void modelDataChanged(const QModelIndex &topLeft);
void modelRowsRemoved();
void modelRowsReset();
+ void uatTreeViewSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void on_uatTreeView_currentItemChanged(const QModelIndex &current, const QModelIndex &previous);
void acceptChanges();
void rejectChanges();
diff --git a/ui/qt/uat_dialog.ui b/ui/qt/uat_dialog.ui
index cdc8fbe6..3f373948 100644
--- a/ui/qt/uat_dialog.ui
+++ b/ui/qt/uat_dialog.ui
@@ -12,7 +12,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="TabnavTreeView" name="uatTreeView"/>
+ <widget class="RowMoveTreeView" name="uatTreeView"/>
</item>
<item>
<widget class="QLabel" name="hintLabel">
@@ -48,7 +48,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Remove this entry.</string>
+ <string>Remove the selected entry(ies).</string>
</property>
</widget>
</item>
@@ -58,7 +58,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Copy this entry.</string>
+ <string>Copy the selected entry(ies).</string>
</property>
<property name="text">
<string/>
@@ -71,7 +71,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Move entry up.</string>
+ <string>Move the selected entry(ies) up.</string>
</property>
<property name="text">
<string/>
@@ -84,7 +84,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Move entry down.</string>
+ <string>Move the selected entry(ies) down.</string>
</property>
<property name="text">
<string/>
@@ -144,9 +144,9 @@
<header>widgets/elided_label.h</header>
</customwidget>
<customwidget>
- <class>TabnavTreeView</class>
+ <class>RowMoveTreeView</class>
<extends>QTreeView</extends>
- <header>widgets/tabnav_tree_view.h</header>
+ <header>widgets/rowmove_tree_view.h</header>
</customwidget>
<customwidget>
<class>StockIconToolButton</class>
diff --git a/ui/qt/uat_frame.cpp b/ui/qt/uat_frame.cpp
index c48cf4c2..1a099feb 100644
--- a/ui/qt/uat_frame.cpp
+++ b/ui/qt/uat_frame.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/filter_expressions.h>
#include "uat_frame.h"
@@ -65,8 +63,6 @@ UatFrame::UatFrame(QWidget *parent) :
// start editing as soon as the field is selected or when typing starts
ui->uatTreeView->setEditTriggers(ui->uatTreeView->editTriggers() |
QAbstractItemView::CurrentChanged | QAbstractItemView::AnyKeyPressed);
-
- // XXX - Need to add uat_move or uat_insert to the UAT API for drag/drop
}
UatFrame::~UatFrame()
@@ -95,7 +91,7 @@ void UatFrame::setUat(epan_uat *uat)
connect(ui->copyFromProfileButton, &CopyFromProfileButton::copyProfile, this, &UatFrame::copyFromProfile);
}
- QString abs_path = gchar_free_to_qstring(uat_get_actual_filename(uat_, FALSE));
+ QString abs_path = gchar_free_to_qstring(uat_get_actual_filename(uat_, false));
if (abs_path.length() > 0) {
ui->pathLabel->setText(abs_path);
ui->pathLabel->setUrl(QUrl::fromLocalFile(abs_path).toString());
@@ -109,6 +105,7 @@ void UatFrame::setUat(epan_uat *uat)
uat_delegate_ = new UatDelegate;
ui->uatTreeView->setModel(uat_model_);
ui->uatTreeView->setItemDelegate(uat_delegate_);
+ ui->uatTreeView->setSelectionMode(QAbstractItemView::ContiguousSelection);
resizeColumns();
ui->clearToolButton->setEnabled(uat_model_->rowCount() != 0);
@@ -117,6 +114,9 @@ void UatFrame::setUat(epan_uat *uat)
connect(uat_model_, SIGNAL(rowsRemoved(QModelIndex, int, int)),
this, SLOT(modelRowsRemoved()));
connect(uat_model_, SIGNAL(modelReset()), this, SLOT(modelRowsReset()));
+
+ connect(ui->uatTreeView->selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &UatFrame::uatTreeViewSelectionChanged);
}
setWindowTitle(title);
@@ -124,9 +124,9 @@ void UatFrame::setUat(epan_uat *uat)
void UatFrame::copyFromProfile(QString filename)
{
- gchar *err = NULL;
+ char *err = NULL;
if (uat_load(uat_, filename.toUtf8().constData(), &err)) {
- uat_->changed = TRUE;
+ uat_->changed = true;
uat_model_->reloadUat();
} else {
report_failure("Error while loading %s: %s", uat_->name, err);
@@ -205,23 +205,33 @@ void UatFrame::addRecord(bool copy_from_current)
modelDataChanged(new_index);
}
-// Invoked when a different field is selected. Note: when selecting a different
-// field after editing, this event is triggered after modelDataChanged.
-void UatFrame::on_uatTreeView_currentItemChanged(const QModelIndex &current, const QModelIndex &previous)
+void UatFrame::uatTreeViewSelectionChanged(const QItemSelection&, const QItemSelection&)
{
- if (current.isValid()) {
+ QModelIndexList selectedRows = ui->uatTreeView->selectionModel()->selectedRows();
+ qsizetype num_selected = selectedRows.size();
+ if (num_selected > 0) {
+ std::sort(selectedRows.begin(), selectedRows.end());
ui->deleteToolButton->setEnabled(true);
- ui->clearToolButton->setEnabled(true);
ui->copyToolButton->setEnabled(true);
- ui->moveUpToolButton->setEnabled(current.row() != 0);
- ui->moveDownToolButton->setEnabled(current.row() != (uat_model_->rowCount() - 1));
+ ui->moveUpToolButton->setEnabled(selectedRows.first().row() > 0);
+ ui->moveDownToolButton->setEnabled(selectedRows.last().row() < uat_model_->rowCount() - 1);
} else {
ui->deleteToolButton->setEnabled(false);
- ui->clearToolButton->setEnabled(false);
ui->copyToolButton->setEnabled(false);
ui->moveUpToolButton->setEnabled(false);
ui->moveDownToolButton->setEnabled(false);
}
+}
+
+// Invoked when a different field is selected. Note: when selecting a different
+// field after editing, this event is triggered after modelDataChanged.
+void UatFrame::on_uatTreeView_currentItemChanged(const QModelIndex &current, const QModelIndex &previous)
+{
+ if (current.isValid()) {
+ ui->clearToolButton->setEnabled(true);
+ } else {
+ ui->clearToolButton->setEnabled(false);
+ }
checkForErrorHint(current, previous);
}
@@ -247,6 +257,7 @@ void UatFrame::modelRowsRemoved()
ui->moveUpToolButton->setEnabled(false);
ui->moveDownToolButton->setEnabled(false);
}
+ ui->clearToolButton->setEnabled(uat_model_->rowCount() != 0);
checkForErrorHint(current, QModelIndex());
}
@@ -311,46 +322,86 @@ void UatFrame::on_newToolButton_clicked()
void UatFrame::on_deleteToolButton_clicked()
{
- const QModelIndex &current = ui->uatTreeView->currentIndex();
- if (uat_model_ && current.isValid()) {
- if (!uat_model_->removeRows(current.row(), 1)) {
- qDebug() << "Failed to remove row";
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ for (const auto &range : ui->uatTreeView->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty()) {
+ if (!uat_model_->removeRows(range.top(), range.bottom() - range.top() + 1)) {
+ qDebug() << "Failed to remove rows" << range.top() << "to" << range.bottom();
+ }
}
}
}
void UatFrame::on_copyToolButton_clicked()
{
- addRecord(true);
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ QModelIndexList selectedRows = ui->uatTreeView->selectionModel()->selectedRows();
+ if (selectedRows.size() > 0) {
+ std::sort(selectedRows.begin(), selectedRows.end());
+
+ QModelIndex copyIdx;
+
+ for (const auto &idx : selectedRows) {
+ copyIdx = uat_model_->copyRow(idx);
+ if (!copyIdx.isValid())
+ {
+ qDebug() << "Failed to copy row" << idx.row();
+ }
+ // trigger updating error messages and the OK button state.
+ modelDataChanged(copyIdx);
+ }
+ // due to an EditTrigger, this will also start editing.
+ ui->uatTreeView->setCurrentIndex(copyIdx);
+ }
+
}
void UatFrame::on_moveUpToolButton_clicked()
{
- const QModelIndex &current = ui->uatTreeView->currentIndex();
- int current_row = current.row();
- if (uat_model_ && current.isValid() && current_row > 0) {
- if (!uat_model_->moveRow(current_row, current_row - 1)) {
- qDebug() << "Failed to move row up";
- return;
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ for (const auto &range : ui->uatTreeView->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty() && range.top() > 0) {
+ // Swap range of rows with the row above the top
+ if (! uat_model_->moveRows(QModelIndex(), range.top(), range.bottom() - range.top() + 1, QModelIndex(), range.top() - 1)) {
+ qDebug() << "Failed to move up rows" << range.top() << "to" << range.bottom();
+ }
+ // Our moveRows implementation calls begin/endMoveRows(), so
+ // range.top() already has the new row number.
+ ui->moveUpToolButton->setEnabled(range.top() > 0);
+ ui->moveDownToolButton->setEnabled(true);
}
- current_row--;
- ui->moveUpToolButton->setEnabled(current_row > 0);
- ui->moveDownToolButton->setEnabled(current_row < (uat_model_->rowCount() - 1));
}
}
void UatFrame::on_moveDownToolButton_clicked()
{
- const QModelIndex &current = ui->uatTreeView->currentIndex();
- int current_row = current.row();
- if (uat_model_ && current.isValid() && current_row < (uat_model_->rowCount() - 1)) {
- if (!uat_model_->moveRow(current_row, current_row + 1)) {
- qDebug() << "Failed to move row down";
- return;
+ if (uat_model_ == nullptr) {
+ return;
+ }
+
+ for (const auto &range : ui->uatTreeView->selectionModel()->selection()) {
+ // Each QItemSelectionRange is contiguous
+ if (!range.isEmpty() && range.bottom() + 1 < uat_model_->rowCount()) {
+ // Swap range of rows with the row below the top
+ if (! uat_model_->moveRows(QModelIndex(), range.top(), range.bottom() - range.top() + 1, QModelIndex(), range.bottom() + 1)) {
+ qDebug() << "Failed to move down rows" << range.top() << "to" << range.bottom();
+ }
+ // Our moveRows implementation calls begin/endMoveRows, so
+ // range.bottom() already has the new row number.
+ ui->moveUpToolButton->setEnabled(true);
+ ui->moveDownToolButton->setEnabled(range.bottom() < uat_model_->rowCount() - 1);
}
- current_row++;
- ui->moveUpToolButton->setEnabled(current_row > 0);
- ui->moveDownToolButton->setEnabled(current_row < (uat_model_->rowCount() - 1));
}
}
diff --git a/ui/qt/uat_frame.h b/ui/qt/uat_frame.h
index 870bba9c..f20c10ce 100644
--- a/ui/qt/uat_frame.h
+++ b/ui/qt/uat_frame.h
@@ -16,6 +16,8 @@
#include <ui/qt/models/uat_model.h>
#include <ui/qt/models/uat_delegate.h>
+class QItemSelection;
+
namespace Ui {
class UatFrame;
}
@@ -54,6 +56,7 @@ private slots:
void modelDataChanged(const QModelIndex &topLeft);
void modelRowsRemoved();
void modelRowsReset();
+ void uatTreeViewSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void on_uatTreeView_currentItemChanged(const QModelIndex &current, const QModelIndex &previous);
void on_newToolButton_clicked();
void on_deleteToolButton_clicked();
diff --git a/ui/qt/uat_frame.ui b/ui/qt/uat_frame.ui
index 452ae65d..a49fc29c 100644
--- a/ui/qt/uat_frame.ui
+++ b/ui/qt/uat_frame.ui
@@ -18,7 +18,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="TabnavTreeView" name="uatTreeView"/>
+ <widget class="RowMoveTreeView" name="uatTreeView"/>
</item>
<item>
<widget class="QLabel" name="hintLabel">
@@ -54,7 +54,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Remove this entry.</string>
+ <string>Remove the selected entry(ies).</string>
</property>
</widget>
</item>
@@ -64,7 +64,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
- <string>Copy this entry.</string>
+ <string>Copy the selected entry(ies).</string>
</property>
<property name="text">
<string/>
@@ -74,7 +74,7 @@
<item>
<widget class="StockIconToolButton" name="moveUpToolButton">
<property name="toolTip">
- <string>Move entry up.</string>
+ <string>Move the selected entry(ies) up.</string>
</property>
<property name="text">
<string/>
@@ -84,7 +84,7 @@
<item>
<widget class="StockIconToolButton" name="moveDownToolButton">
<property name="toolTip">
- <string>Move entry down.</string>
+ <string>Move the selected entry(ies) down.</string>
</property>
<property name="text">
<string/>
@@ -141,9 +141,9 @@
<header>widgets/elided_label.h</header>
</customwidget>
<customwidget>
- <class>TabnavTreeView</class>
+ <class>RowMoveTreeView</class>
<extends>QTreeView</extends>
- <header>widgets/tabnav_tree_view.h</header>
+ <header>widgets/rowmove_tree_view.h</header>
</customwidget>
<customwidget>
<class>StockIconToolButton</class>
diff --git a/ui/qt/utils/color_utils.cpp b/ui/qt/utils/color_utils.cpp
index e7d7c6c5..6024fdb8 100644
--- a/ui/qt/utils/color_utils.cpp
+++ b/ui/qt/utils/color_utils.cpp
@@ -148,10 +148,16 @@ QRgb ColorUtils::sequenceColor(int item)
bool ColorUtils::themeIsDark()
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
- return qApp->styleHints()->colorScheme() == Qt::ColorScheme::Dark;
-#else
- return qApp->palette().windowText().color().lightness() > qApp->palette().window().color().lightness();
+ switch (qApp->styleHints()->colorScheme()) {
+ case Qt::ColorScheme::Dark:
+ return true;
+ case Qt::ColorScheme::Light:
+ return false;
+ case Qt::ColorScheme::Unknown:
+ break;
+ }
#endif
+ return qApp->palette().windowText().color().lightness() > qApp->palette().window().color().lightness();
}
// Qt < 5.12.6 on macOS always uses Qt::blue for the link color, which is
@@ -191,8 +197,10 @@ const QColor ColorUtils::contrastingTextColor(const QColor color)
{
bool background_is_light = color.lightness() > 127;
if ( (background_is_light && !ColorUtils::themeIsDark()) || (!background_is_light && ColorUtils::themeIsDark()) ) {
+ // usually black/darker color in light mode and white/lighter color in dark mode
return QApplication::palette().text().color();
}
+ // usually white/lighter color in light mode and black/darker color in dark mode
return QApplication::palette().base().color();
}
@@ -214,3 +222,8 @@ const QColor ColorUtils::warningBackground()
}
return QColor(tango_butter_2);
}
+
+const QColor ColorUtils::disabledForeground()
+{
+ return alphaBlend(QApplication::palette().windowText(), QApplication::palette().window(), 0.65);
+}
diff --git a/ui/qt/utils/color_utils.h b/ui/qt/utils/color_utils.h
index a205cccc..ac5ed02e 100644
--- a/ui/qt/utils/color_utils.h
+++ b/ui/qt/utils/color_utils.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include <epan/color_filters.h>
#include <QBrush>
@@ -82,11 +80,17 @@ public:
*/
static const QColor warningBackground();
+ /**
+ * Returns an appropriate foreground color for disabled text.
+ * @return The foreground color.
+ */
+ static const QColor disabledForeground();
+
private:
static QList<QRgb> graph_colors_;
static QList<QRgb> sequence_colors_;
};
-void color_filter_qt_add_cb(color_filter_t *colorf, gpointer user_data);
+void color_filter_qt_add_cb(color_filter_t *colorf, void *user_data);
#endif // COLOR_UTILS_H
diff --git a/ui/qt/utils/data_printer.cpp b/ui/qt/utils/data_printer.cpp
index 3c3e910a..f3635ee4 100644
--- a/ui/qt/utils/data_printer.cpp
+++ b/ui/qt/utils/data_printer.cpp
@@ -34,6 +34,22 @@ void DataPrinter::toClipboard(DataPrinter::DumpType type, IDataPrintable * print
switch(type)
{
+ case DP_GoLiteral:
+ clipboard_text += QString("[]byte{");
+ for (int i = 0; i < printData.length(); i++) {
+ if (i>0) clipboard_text += ", ";
+ clipboard_text += QString("0x%1").arg((uint8_t) printData[i], 1, 16, QChar('0'));
+ }
+ clipboard_text += QString("}");
+ break;
+ case DP_CArray:
+ clipboard_text += QString("unsigned char bytes[] = {");
+ for (int i = 0; i < printData.length(); i++) {
+ if (i>0) clipboard_text += ", ";
+ clipboard_text += QString("0x%1").arg((uint8_t) printData[i], 1, 16, QChar('0'));
+ }
+ clipboard_text += QString("};");
+ break;
case DP_CString:
// Beginning quote
clipboard_text += QString("\"");
@@ -86,12 +102,21 @@ void DataPrinter::toClipboard(DataPrinter::DumpType type, IDataPrintable * print
for (int i = 0; i < printData.length(); i++)
clipboard_text += QString("%1").arg((uint8_t) printData[i], 2, 16, QChar('0'));
break;
- case DP_PrintableText:
+ case DP_UTF8Text:
+ // This automatically compensates for invalid UTF-8 in the input
+#if WS_IS_AT_LEAST_GNUC_VERSION(12,1)
+DIAG_OFF(stringop-overread)
+#endif
+ clipboard_text += QString::fromUtf8(printData);
+#if WS_IS_AT_LEAST_GNUC_VERSION(12,1)
+DIAG_ON(stringop-overread)
+#endif
+ break;
+ case DP_ASCIIText:
+ // Copy valid 7-bit printable ASCII bytes, skip the rest
for (int i = 0; i < printData.length(); i++) {
QChar ch(printData[i]);
- // This interprets ch as Latin-1. We might want to use ASCII
- // printable only.
- if (ch.isSpace() || ch.isPrint()) {
+ if (ch.isSpace() || (ch > (char)0x20 && ch < (char)0x7F)) {
clipboard_text += ch;
}
}
@@ -261,9 +286,14 @@ QActionGroup * DataPrinter::copyActions(QObject * copyClass, QObject * data)
action->setProperty("printertype", DataPrinter::DP_HexOnly);
connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes);
- action = new QAction(tr("…as Printable Text"), actions);
- action->setToolTip(tr("Copy only the printable text in the packet."));
- action->setProperty("printertype", DataPrinter::DP_PrintableText);
+ action = new QAction(tr("…as UTF-8 Text"), actions);
+ action->setToolTip(tr("Copy packet bytes as text, treating as UTF-8."));
+ action->setProperty("printertype", DataPrinter::DP_UTF8Text);
+ connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes);
+
+ action = new QAction(tr("…as ASCII Text"), actions);
+ action->setToolTip(tr("Copy packet bytes as text, treating as ASCII."));
+ action->setProperty("printertype", DataPrinter::DP_ASCIIText);
connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes);
action = new QAction(tr("…as a Hex Stream"), actions);
@@ -286,6 +316,16 @@ QActionGroup * DataPrinter::copyActions(QObject * copyClass, QObject * data)
action->setProperty("printertype", DataPrinter::DP_CString);
connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes);
+ action = new QAction(tr("…as Go literal"), actions);
+ action->setToolTip(tr("Copy packet bytes as Go literal."));
+ action->setProperty("printertype", DataPrinter::DP_GoLiteral);
+ connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes);
+
+ action = new QAction(tr("…as C Array"), actions);
+ action->setToolTip(tr("Copy packet bytes as C Array."));
+ action->setProperty("printertype", DataPrinter::DP_CArray);
+ connect(action, &QAction::triggered, dpi, &DataPrinter::copyIDataBytes);
+
return actions;
}
diff --git a/ui/qt/utils/data_printer.h b/ui/qt/utils/data_printer.h
index 882b5752..52c259f8 100644
--- a/ui/qt/utils/data_printer.h
+++ b/ui/qt/utils/data_printer.h
@@ -30,8 +30,11 @@ public:
DP_HexDump,
DP_HexOnly,
DP_HexStream,
- DP_PrintableText,
+ DP_UTF8Text,
+ DP_ASCIIText,
DP_CString,
+ DP_GoLiteral,
+ DP_CArray,
DP_MimeData,
DP_Base64
};
diff --git a/ui/qt/utils/frame_information.cpp b/ui/qt/utils/frame_information.cpp
index d344bc04..facd368d 100644
--- a/ui/qt/utils/frame_information.cpp
+++ b/ui/qt/utils/frame_information.cpp
@@ -48,13 +48,13 @@ void FrameInformation::loadFrameTree()
edt_ = g_new0(epan_dissect_t, 1);
/* proto tree, visible. We need a proto tree if there's custom columns */
- epan_dissect_init(edt_, cap_file_->capFile()->epan, TRUE, TRUE);
+ epan_dissect_init(edt_, cap_file_->capFile()->epan, true, true);
col_custom_prime_edt(edt_, &(cap_file_->capFile()->cinfo));
epan_dissect_run(edt_, cap_file_->capFile()->cd_t, &rec_,
frame_tvbuff_new_buffer(&cap_file_->capFile()->provider, fi_, &buf_),
fi_, &(cap_file_->capFile()->cinfo));
- epan_dissect_fill_in_columns(edt_, TRUE, TRUE);
+ epan_dissect_fill_in_columns(edt_, true, true);
}
FrameInformation::~FrameInformation()
diff --git a/ui/qt/utils/profile_switcher.cpp b/ui/qt/utils/profile_switcher.cpp
new file mode 100644
index 00000000..ded1b1f5
--- /dev/null
+++ b/ui/qt/utils/profile_switcher.cpp
@@ -0,0 +1,140 @@
+/* profile_switcher.cpp
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+// #include <capture_file.h>
+#include <main_application.h>
+
+#include <ui/profile.h>
+#include <ui/recent.h>
+
+#include <ui/qt/capture_file.h>
+#include <ui/qt/models/packet_list_model.h>
+
+#include "profile_switcher.h"
+
+#include "file.h"
+
+#include <epan/epan.h>
+#include <epan/epan_dissect.h>
+#include <epan/prefs.h>
+#include "frame_tvbuff.h"
+
+// Enable switching iff:
+// - We're opening a new capture file via the UI.
+// - We haven't changed our profile, either manually or automatically.
+
+ProfileSwitcher::ProfileSwitcher(QObject *parent) :
+ QObject(parent),
+ capture_file_changed_(true),
+ profile_changed_(false)
+{
+ if (g_list_length(current_profile_list()) == 0) {
+ init_profile_list();
+ }
+ connect(mainApp, &MainApplication::profileChanging, this, &ProfileSwitcher::disableSwitching);
+}
+
+void ProfileSwitcher::captureEventHandler(CaptureEvent ev)
+{
+ if (ev.captureContext() != CaptureEvent::File) {
+ return;
+ }
+
+ CaptureFile *capture_file = qobject_cast<CaptureFile *>(sender());
+ if (!capture_file) {
+ return;
+ }
+
+ // CaptureEvent doesn't have a "this is the same file" flag, so
+ // track that via the filename.
+ switch (ev.eventType()) {
+ case CaptureEvent::Opened:
+ if (previous_cap_file_ != capture_file->filePath()) {
+ capture_file_changed_ = true;
+ profile_changed_ = false;
+ }
+ break;
+ case CaptureEvent::Closing:
+ previous_cap_file_ = capture_file->filePath();
+ break;
+ default:
+ break;
+ }
+}
+
+void ProfileSwitcher::checkPacket(capture_file *cap_file, frame_data *fdata, qsizetype row)
+{
+ if (profile_changed_ || !capture_file_changed_ || row >= recent.gui_profile_switch_check_count) {
+ return;
+ }
+
+ if (row == 0) {
+ clearProfileFilters();
+ for (GList *cur = current_profile_list() ; cur; cur = cur->next) {
+ profile_def *profile = static_cast<profile_def *>(cur->data);
+ if (!profile->auto_switch_filter) {
+ continue;
+ }
+ dfilter_t *dfcode;
+ if (dfilter_compile(profile->auto_switch_filter, &dfcode, NULL) && dfcode) {
+ profile_filters_.append({profile->name, dfcode});
+ }
+ }
+ }
+
+ if (profile_filters_.empty()) {
+ return;
+ }
+
+ QString new_profile;
+ wtap_rec rec;
+ Buffer buf;
+ wtap_rec_init(&rec);
+ ws_buffer_init(&buf, 1514);
+ epan_dissect_t edt;
+
+ for (auto &cur_filter : profile_filters_) {
+ if (!cf_read_record(cap_file, fdata, &rec, &buf)) {
+ continue;
+ }
+ epan_dissect_init(&edt, cap_file->epan, TRUE, FALSE);
+ epan_dissect_prime_with_dfilter(&edt, cur_filter.dfcode);
+ epan_dissect_run(&edt, cap_file->cd_t, &rec,
+ frame_tvbuff_new_buffer(&cap_file->provider, fdata, &buf),
+ fdata, NULL);
+ bool matched = dfilter_apply_edt(cur_filter.dfcode, &edt);
+ epan_dissect_cleanup(&edt);
+ if (matched) {
+ new_profile = cur_filter.name;
+ break;
+ }
+ }
+
+ wtap_rec_cleanup(&rec);
+ ws_buffer_free(&buf);
+
+ if (!new_profile.isEmpty()) {
+ clearProfileFilters();
+ previous_cap_file_ = cap_file->filename;
+ mainApp->setConfigurationProfile(qUtf8Printable(new_profile), false);
+ }
+}
+
+void ProfileSwitcher::clearProfileFilters()
+{
+ for (auto &cur_filter : profile_filters_) {
+ dfilter_free(cur_filter.dfcode);
+ }
+ profile_filters_.clear();
+}
+
+void ProfileSwitcher::disableSwitching()
+{
+ profile_changed_ = true;
+}
diff --git a/ui/qt/utils/profile_switcher.h b/ui/qt/utils/profile_switcher.h
new file mode 100644
index 00000000..57dfd255
--- /dev/null
+++ b/ui/qt/utils/profile_switcher.h
@@ -0,0 +1,48 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#pragma once
+
+#include <config.h>
+
+#include "capture_event.h"
+#include "cfile.h"
+
+#include <QObject>
+#include <QVector>
+
+struct profile_switch_filter {
+ QString name;
+ dfilter_t *dfcode;
+};
+
+class PacketListModel;
+
+class ProfileSwitcher : public QObject
+{
+ Q_OBJECT
+public:
+ explicit ProfileSwitcher(QObject *parent = nullptr);
+
+public slots:
+ void captureEventHandler(CaptureEvent ev);
+ void checkPacket(capture_file *cap_file, frame_data *fdata, qsizetype row);
+
+private:
+ PacketListModel *packet_list_model_;
+ QVector<struct profile_switch_filter> profile_filters_;
+ bool capture_file_changed_;
+ bool profile_changed_;
+ QString previous_cap_file_;
+
+ void clearProfileFilters();
+
+private slots:
+ void disableSwitching();
+};
diff --git a/ui/qt/utils/proto_node.cpp b/ui/qt/utils/proto_node.cpp
index 68d1f4c7..222b2d5e 100644
--- a/ui/qt/utils/proto_node.cpp
+++ b/ui/qt/utils/proto_node.cpp
@@ -12,6 +12,7 @@
#include <epan/prefs.h>
+// NOLINTNEXTLINE(misc-no-recursion)
ProtoNode::ProtoNode(proto_node *node, ProtoNode *parent) :
node_(node), parent_(parent)
{
@@ -28,6 +29,7 @@ ProtoNode::ProtoNode(proto_node *node, ProtoNode *parent) :
for (proto_node *child = node_->first_child; child; child = child->next) {
if (!isHidden(child)) {
+ // We recurse here, but we're limited by tree depth checks in epan
m_children.append(new ProtoNode(child, this));
}
}
@@ -70,7 +72,7 @@ QString ProtoNode::labelText() const
label = fi->rep->representation;
}
else { /* no, make a generic label */
- gchar label_str[ITEM_LABEL_LENGTH];
+ char label_str[ITEM_LABEL_LENGTH];
proto_item_fill_label(fi, label_str);
label = label_str;
}
diff --git a/ui/qt/utils/qt_ui_utils.cpp b/ui/qt/utils/qt_ui_utils.cpp
index 9dad9dd9..addfe208 100644
--- a/ui/qt/utils/qt_ui_utils.cpp
+++ b/ui/qt/utils/qt_ui_utils.cpp
@@ -17,15 +17,13 @@
#include <epan/range.h>
#include <epan/to_str.h>
#include <epan/value_string.h>
-#include <epan/prefs.h>
#include <ui/recent.h>
#include <ui/util.h>
#include "ui/ws_ui_util.h"
#include <wsutil/str_util.h>
-
-#include <ui/qt/main_application.h>
+#include <wsutil/file_util.h>
#include <QAction>
#include <QApplication>
@@ -36,24 +34,31 @@
#include <QFontDatabase>
#include <QProcess>
#include <QUrl>
-#include <QUuid>
#include <QScreen>
+#if defined(Q_OS_MAC)
+#include <ui/macosx/cocoa_bridge.h>
+#elif !defined(Q_OS_WIN) && defined(QT_DBUS_LIB)
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusMessage>
+#include <QtDBus/QDBusUnixFileDescriptor>
+#endif
+
/*
* We might want to create our own "wsstring" class with convenience
* methods for handling g_malloc()ed strings, GStrings, and a shortcut
* to .toUtf8().constData().
*/
-gchar *qstring_strdup(QString q_string) {
- return g_strdup(q_string.toUtf8().constData());
+char *qstring_strdup(QString q_string) {
+ return g_strdup(qUtf8Printable(q_string));
}
-QString gchar_free_to_qstring(gchar *glib_string) {
+QString gchar_free_to_qstring(char *glib_string) {
return QString(gchar_free_to_qbytearray(glib_string));
}
-QByteArray gchar_free_to_qbytearray(gchar *glib_string)
+QByteArray gchar_free_to_qbytearray(char *glib_string)
{
QByteArray qt_bytearray(glib_string);
g_free(glib_string);
@@ -70,7 +75,7 @@ QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array)
{
QByteArray qt_ba(reinterpret_cast<char *>(glib_array->data), glib_array->len);
- g_byte_array_free(glib_array, TRUE);
+ g_byte_array_free(glib_array, true);
return qt_ba;
}
@@ -101,7 +106,7 @@ const QString address_to_qstring(const _address *address, bool enclose)
QString address_qstr = QString();
if (address) {
if (enclose && address->type == AT_IPv6) address_qstr += "[";
- gchar *address_gchar_p = address_to_str(NULL, address);
+ char *address_gchar_p = address_to_str(NULL, address);
address_qstr += address_gchar_p;
wmem_free(NULL, address_gchar_p);
if (enclose && address->type == AT_IPv6) address_qstr += "]";
@@ -113,27 +118,27 @@ const QString address_to_display_qstring(const _address *address)
{
QString address_qstr = QString();
if (address) {
- gchar *address_gchar_p = address_to_display(NULL, address);
+ char *address_gchar_p = address_to_display(NULL, address);
address_qstr = address_gchar_p;
wmem_free(NULL, address_gchar_p);
}
return address_qstr;
}
-const QString val_to_qstring(const guint32 val, const value_string *vs, const char *fmt)
+const QString val_to_qstring(const uint32_t val, const value_string *vs, const char *fmt)
{
QString val_qstr;
- gchar* gchar_p = val_to_str_wmem(NULL, val, vs, fmt);
+ char* gchar_p = val_to_str_wmem(NULL, val, vs, fmt);
val_qstr = gchar_p;
wmem_free(NULL, gchar_p);
return val_qstr;
}
-const QString val_ext_to_qstring(const guint32 val, value_string_ext *vse, const char *fmt)
+const QString val_ext_to_qstring(const uint32_t val, value_string_ext *vse, const char *fmt)
{
QString val_qstr;
- gchar* gchar_p = val_to_str_ext_wmem(NULL, val, vse, fmt);
+ char* gchar_p = val_to_str_ext_wmem(NULL, val, vse, fmt);
val_qstr = gchar_p;
wmem_free(NULL, gchar_p);
@@ -155,7 +160,7 @@ const QString bits_s_to_qstring(const double bits_s)
format_size(bits_s, FORMAT_SIZE_UNIT_NONE, FORMAT_SIZE_PREFIX_SI));
}
-const QString file_size_to_qstring(const gint64 size)
+const QString file_size_to_qstring(const int64_t size)
{
return gchar_free_to_qstring(
format_size(size, FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_SI));
@@ -209,28 +214,55 @@ void desktop_show_in_folder(const QString file_path)
// https://stackoverflow.com/questions/3490336/how-to-reveal-in-finder-or-show-in-explorer-with-qt
#if defined(Q_OS_WIN)
+ //
+ // See
+ //
+ // https://stackoverflow.com/questions/13680415/how-to-open-explorer-with-a-specific-file-selected
+ //
+ // for a way to do this using Windows Shell APIs, rather than having
+ // to fire up a separate instance of Windows Explorer.
+ //
QString command = "explorer.exe";
QStringList arguments;
QString path = QDir::toNativeSeparators(file_path);
arguments << "/select," << path + "";
success = QProcess::startDetached(command, arguments);
#elif defined(Q_OS_MAC)
- QStringList script_args;
- QString escaped_path = file_path;
-
- escaped_path.replace('"', "\\\"");
- script_args << "-e"
- << QString("tell application \"Finder\" to reveal POSIX file \"%1\"")
- .arg(escaped_path);
- if (QProcess::execute("/usr/bin/osascript", script_args) == 0) {
- success = true;
- script_args.clear();
- script_args << "-e"
- << "tell application \"Finder\" to activate";
- QProcess::execute("/usr/bin/osascript", script_args);
+ CocoaBridge::showInFinder(file_path.toUtf8());
+ success = true;
+#elif defined(QT_DBUS_LIB)
+ // First, try the FileManager1 DBus interface's "ShowItems" method.
+ // https://www.freedesktop.org/wiki/Specifications/file-manager-interface/
+ QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.FileManager1"),
+ QLatin1String("/org/freedesktop/FileManager1"),
+ QLatin1String("org.freedesktop.FileManager1"),
+ QLatin1String("ShowItems"));
+ QStringList uris(QUrl::fromLocalFile(file_path).toString());
+ message << uris << QString();
+
+ message = QDBusConnection::sessionBus().call(message);
+ success = message.type() == QDBusMessage::ReplyMessage;
+
+ // If that failed, perhaps we are sandboxed. Try using Portal Services.
+ // https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.OpenURI.html
+ if (!success) {
+ const int fd = ws_open(QFile::encodeName(file_path), O_CLOEXEC | O_PATH, 0000);
+ if (fd != -1) {
+ QDBusUnixFileDescriptor descriptor;
+ descriptor.giveFileDescriptor(fd);
+ QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.portal.Desktop"),
+ QLatin1String("/org/freedesktop/portal/desktop"),
+ QLatin1String("org.freedesktop.portal.OpenURI"),
+ QLatin1String("OpenDirectory"));
+ message << QString() << QVariant::fromValue(descriptor) << QVariantMap();
+
+ message = QDBusConnection::sessionBus().call(message);
+ success = message.type() == QDBusMessage::ReplyMessage;
+ ws_close(fd);
+ }
}
#else
- // Is there a way to highlight the file using xdg-open?
+ // Any other possibilities to highlight the file before falling back to showing the folder?
#endif
if (!success) {
QFileInfo file_info(file_path);
@@ -251,7 +283,7 @@ bool rect_on_screen(const QRect &rect)
void set_action_shortcuts_visible_in_context_menu(QList<QAction *> actions)
{
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) && QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
+#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
// For QT_VERSION >= 5.13.0 we call styleHints()->setShowShortcutsInContextMenus(true)
// in WiresharkApplication.
// QTBUG-71471
@@ -310,27 +342,7 @@ QString openDialogInitialDir()
{
QString result;
- switch (prefs.gui_fileopen_style) {
-
- case FO_STYLE_LAST_OPENED:
- /* The user has specified that we should start out in the last directory
- we looked in. If we've already opened a file, use its containing
- directory, if we could determine it, as the directory, otherwise
- use the "last opened" directory saved in the preferences file if
- there was one. */
- /* This is now the default behaviour in file_selection_new() */
- result = QString(get_open_dialog_initial_dir());
- break;
-
- case FO_STYLE_SPECIFIED:
- /* The user has specified that we should always start out in a
- specified directory; if they've specified that directory,
- start out by showing the files in that dir. */
- if (prefs.gui_fileopen_dir[0] != '\0')
- result = QString(prefs.gui_fileopen_dir);
- break;
- }
-
+ result = QString(get_open_dialog_initial_dir());
QDir ld(result);
if (ld.exists())
return result;
diff --git a/ui/qt/utils/qt_ui_utils.h b/ui/qt/utils/qt_ui_utils.h
index 60ccf31d..24888b03 100644
--- a/ui/qt/utils/qt_ui_utils.h
+++ b/ui/qt/utils/qt_ui_utils.h
@@ -61,7 +61,7 @@ struct epan_range;
*
* @return A copy of the QString. UTF-8 allocated with g_malloc().
*/
-gchar *qstring_strdup(QString q_string);
+char *qstring_strdup(QString q_string);
/** Transfer ownership of a GLib character string to a newly constructed QString
*
@@ -70,7 +70,7 @@ gchar *qstring_strdup(QString q_string);
*
* @return A QString instance created from the input string.
*/
-QString gchar_free_to_qstring(gchar *glib_string);
+QString gchar_free_to_qstring(char *glib_string);
/** Transfer ownership of a GLib character string to a newly constructed QString
*
@@ -79,7 +79,7 @@ QString gchar_free_to_qstring(gchar *glib_string);
*
* @return A QByteArray instance created from the input string.
*/
-QByteArray gchar_free_to_qbytearray(gchar *glib_string);
+QByteArray gchar_free_to_qbytearray(char *glib_string);
/** Transfer ownership of a GLib character string to a newly constructed QByteArray
*
@@ -133,7 +133,7 @@ const QString address_to_display_qstring(const struct _address *address);
*
* @return A QString representation of the value_string.
*/
-const QString val_to_qstring(const guint32 val, const struct _value_string *vs, const char *fmt)
+const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt)
G_GNUC_PRINTF(3, 0);
/** Convert a value_string_ext to a QString using val_to_str_ext_wmem().
@@ -144,7 +144,7 @@ G_GNUC_PRINTF(3, 0);
*
* @return A QString representation of the value_string_ext.
*/
-const QString val_ext_to_qstring(const guint32 val, struct _value_string_ext *vse, const char *fmt)
+const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt)
G_GNUC_PRINTF(3, 0);
/** Convert a range to a QString using range_convert_range().
@@ -169,7 +169,7 @@ const QString bits_s_to_qstring(const double bits_s);
*
* @return A QString representation of the file size in SI units.
*/
-const QString file_size_to_qstring(const gint64 size);
+const QString file_size_to_qstring(const int64_t size);
/** Convert a time_t value to a human-readable QString using QDateTime.
*
diff --git a/ui/qt/utils/rtp_audio_file.cpp b/ui/qt/utils/rtp_audio_file.cpp
index 591a63bb..8b349182 100644
--- a/ui/qt/utils/rtp_audio_file.cpp
+++ b/ui/qt/utils/rtp_audio_file.cpp
@@ -14,7 +14,7 @@
* File uses Frame as piece of information. One Frame match audio of one
* decoded packet or audio silence in between them. Frame holds information
* about frame type (audio/silence), its length and realtime position and
- * sample possition (where decoded audio is really stored, with gaps omitted).
+ * sample position (where decoded audio is really stored, with gaps omitted).
*
* There are three stages of the object use
* - writing data by frames during decoding of the stream
@@ -124,7 +124,7 @@ void RtpAudioFile::frameUpdateSampleCounters(qint64 written_bytes)
sample_pos_ += written_bytes;
}
-qint64 RtpAudioFile::frameWriteFrame(guint32 frame_num, qint64 real_pos, qint64 sample_pos, qint64 len, rtp_frame_type type)
+qint64 RtpAudioFile::frameWriteFrame(uint32_t frame_num, qint64 real_pos, qint64 sample_pos, qint64 len, rtp_frame_type type)
{
rtp_frame_info frame_info;
@@ -137,7 +137,7 @@ qint64 RtpAudioFile::frameWriteFrame(guint32 frame_num, qint64 real_pos, qint64
return sample_file_frame_->write((char *)&frame_info, sizeof(frame_info));
}
-void RtpAudioFile::frameWriteSilence(guint32 frame_num, qint64 samples)
+void RtpAudioFile::frameWriteSilence(uint32_t frame_num, qint64 samples)
{
if (samples < 1) return;
@@ -147,9 +147,9 @@ void RtpAudioFile::frameWriteSilence(guint32 frame_num, qint64 samples)
frameUpdateRealCounters(silence_bytes);
}
-qint64 RtpAudioFile::frameWriteSamples(guint32 frame_num, const char *data, qint64 max_size)
+qint64 RtpAudioFile::frameWriteSamples(uint32_t frame_num, const char *data, qint64 max_size)
{
- gint64 written;
+ int64_t written;
written = sample_file_->write(data, max_size);
@@ -170,15 +170,15 @@ void RtpAudioFile::setFrameReadStage(qint64 prepend_samples)
{
sample_file_frame_->seek(0);
if (prepend_samples > 0) {
- // Skip first frame which contains openning silence
+ // Skip first frame which contains opening silence
sample_file_frame_->read((char *)&cur_frame_, sizeof(cur_frame_));
}
}
-bool RtpAudioFile::readFrameSamples(gint32 *read_buff_bytes, SAMPLE **read_buff, spx_uint32_t *read_len, guint32 *frame_num, rtp_frame_type *type)
+bool RtpAudioFile::readFrameSamples(int32_t *read_buff_bytes, SAMPLE **read_buff, spx_uint32_t *read_len, uint32_t *frame_num, rtp_frame_type *type)
{
rtp_frame_info frame_info;
- guint64 read_bytes = 0;
+ uint64_t read_bytes = 0;
if (!sample_file_frame_->read((char *)&frame_info, sizeof(frame_info))) {
// Can't read frame, some error occurred
diff --git a/ui/qt/utils/rtp_audio_file.h b/ui/qt/utils/rtp_audio_file.h
index addc3015..b8c53b30 100644
--- a/ui/qt/utils/rtp_audio_file.h
+++ b/ui/qt/utils/rtp_audio_file.h
@@ -33,7 +33,7 @@ typedef struct {
qint64 real_pos;
qint64 sample_pos;
qint64 len;
- guint32 frame_num;
+ uint32_t frame_num;
rtp_frame_type type;
} rtp_frame_info;
@@ -46,12 +46,12 @@ public:
// Functions for writing Frames
void setFrameWriteStage();
- void frameWriteSilence(guint32 frame_num, qint64 samples);
- qint64 frameWriteSamples(guint32 frame_num, const char *data, qint64 max_size);
+ void frameWriteSilence(uint32_t frame_num, qint64 samples);
+ qint64 frameWriteSamples(uint32_t frame_num, const char *data, qint64 max_size);
// Functions for reading Frames
void setFrameReadStage(qint64 prepend_samples);
- bool readFrameSamples(gint32 *read_buff_bytes, SAMPLE **read_buff, spx_uint32_t *read_len, guint32 *frame_num, rtp_frame_type *type);
+ bool readFrameSamples(int32_t *read_buff_bytes, SAMPLE **read_buff, spx_uint32_t *read_len, uint32_t *frame_num, rtp_frame_type *type);
// Functions for reading data during play
void setDataReadStage();
@@ -80,7 +80,7 @@ private:
rtp_frame_info cur_frame_;
// Functions for writing Frames
- qint64 frameWriteFrame(guint32 frame_num, qint64 real_pos, qint64 sample_pos, qint64 len, rtp_frame_type type);
+ qint64 frameWriteFrame(uint32_t frame_num, qint64 real_pos, qint64 sample_pos, qint64 len, rtp_frame_type type);
void frameUpdateRealCounters(qint64 written_bytes);
void frameUpdateSampleCounters(qint64 written_bytes);
diff --git a/ui/qt/utils/rtp_audio_routing_filter.cpp b/ui/qt/utils/rtp_audio_routing_filter.cpp
index 8362d3f9..fd2b48d7 100644
--- a/ui/qt/utils/rtp_audio_routing_filter.cpp
+++ b/ui/qt/utils/rtp_audio_routing_filter.cpp
@@ -64,7 +64,7 @@ qint64 AudioRoutingFilter::readData(char *data, qint64 maxSize)
return input_->read(data, maxSize);
} else {
// For stereo
- gint64 silence = 0;
+ int64_t silence = 0;
// Read half of data
qint64 readBytes = input_->read(data, maxSize/SAMPLE_BYTES);
diff --git a/ui/qt/utils/wireshark_zip_helper.cpp b/ui/qt/utils/wireshark_zip_helper.cpp
index 7bfa0101..bcf670ad 100644
--- a/ui/qt/utils/wireshark_zip_helper.cpp
+++ b/ui/qt/utils/wireshark_zip_helper.cpp
@@ -11,17 +11,18 @@
#include <ui/qt/utils/wireshark_zip_helper.h>
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
#include "config.h"
-#include "glib.h"
-
#include <iosfwd>
#include <iostream>
#include <zlib.h> // For Z_DEFLATED, etc.
+#ifdef HAVE_MINIZIP
#include <minizip/unzip.h>
#include <minizip/zip.h>
-
+#else
+#include <minizip-ng/mz_compat.h>
+#endif
#include "epan/prefs.h"
#include "wsutil/file_util.h"
diff --git a/ui/qt/utils/wireshark_zip_helper.h b/ui/qt/utils/wireshark_zip_helper.h
index 2f8e39f8..7845f70a 100644
--- a/ui/qt/utils/wireshark_zip_helper.h
+++ b/ui/qt/utils/wireshark_zip_helper.h
@@ -16,9 +16,13 @@
#include <QDir>
-#ifdef HAVE_MINIZIP
+#if defined(HAVE_MINIZIP) || defined(HAVE_MINIZIPNG)
+#ifdef HAVE_MINIZIP
#include "minizip/zip.h"
+#else
+#include "minizip-ng/mz_compat.h"
+#endif
class WiresharkZipHelper
{
diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp
index dd5910f8..a76b8222 100644
--- a/ui/qt/voip_calls_dialog.cpp
+++ b/ui/qt/voip_calls_dialog.cpp
@@ -378,7 +378,7 @@ void VoipCallsDialog::tapDraw(void *tapinfo_ptr)
}
}
-gint VoipCallsDialog::compareCallNums(gconstpointer a, gconstpointer b)
+int VoipCallsDialog::compareCallNums(const void *a, const void *b)
{
const voip_calls_info_t *call_a = (const voip_calls_info_t *)a;
const voip_calls_info_t *call_b = (const voip_calls_info_t *)b;
@@ -459,7 +459,7 @@ void VoipCallsDialog::prepareFilter()
}
QString filter_str;
- QSet<guint16> selected_calls;
+ QSet<uint16_t> selected_calls;
QString frame_numbers;
QList<int> rows;
@@ -509,7 +509,7 @@ void VoipCallsDialog::prepareFilter()
filter_string_fwd = g_string_new(filter_prepend);
g_string_append_printf(filter_string_fwd, "(");
- is_first = TRUE;
+ is_first = true;
/* Build a new filter based on protocol fields */
lista = g_queue_peek_nth_link(voip_calls_get_info()->callsinfos, 0);
while (lista) {
@@ -542,10 +542,10 @@ void VoipCallsDialog::prepareFilter()
g_string_append_printf(filter_string_fwd,
"((h225.guid == %s || q931.call_ref == %x:%x || q931.call_ref == %x:%x)",
guid_str,
- (guint8) (h323info->q931_crv & 0x00ff),
- (guint8)((h323info->q931_crv & 0xff00)>>8),
- (guint8) (h323info->q931_crv2 & 0x00ff),
- (guint8)((h323info->q931_crv2 & 0xff00)>>8));
+ (uint8_t) (h323info->q931_crv & 0x00ff),
+ (uint8_t)((h323info->q931_crv & 0xff00)>>8),
+ (uint8_t) (h323info->q931_crv2 & 0x00ff),
+ (uint8_t)((h323info->q931_crv2 & 0xff00)>>8));
listb = g_list_first(h323info->h245_list);
wmem_free(NULL, guid_str);
while (listb) {
@@ -569,7 +569,7 @@ void VoipCallsDialog::prepareFilter()
"(frame)");
break;
}
- is_first = FALSE;
+ is_first = false;
}
lista = gxx_list_next(lista);
}
@@ -586,7 +586,7 @@ void VoipCallsDialog::showSequence()
{
if (file_closed_) return;
- QSet<guint16> selected_calls;
+ QSet<uint16_t> selected_calls;
foreach (QModelIndex index, ui->callTreeView->selectionModel()->selectedIndexes()) {
voip_calls_info_t *call_info = VoipCallsInfoModel::indexToCallInfo(index);
if (!call_info) {
@@ -629,7 +629,7 @@ QVector<rtpstream_id_t *>VoipCallsDialog::getSelectedRtpIds()
//VOIP_CALLS_DEBUG("checking call %u, start frame %u == stream call %u, start frame %u, setup frame %u",
// vci->call_num, vci->start_fd->num,
// rsi->call_num, rsi->start_fd->num, rsi->setup_frame_number);
- if (vci->call_num == static_cast<guint>(rsi->call_num)) {
+ if (vci->call_num == static_cast<unsigned>(rsi->call_num)) {
//VOIP_CALLS_DEBUG("adding call number %u", vci->call_num);
if (-1 == stream_ids.indexOf(&(rsi->id))) {
// Add only new stream
diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h
index 0386dfa7..542fab9d 100644
--- a/ui/qt/voip_calls_dialog.h
+++ b/ui/qt/voip_calls_dialog.h
@@ -12,7 +12,6 @@
#include <config.h>
-#include <glib.h>
#include <mutex>
#include "cfile.h"
@@ -110,7 +109,7 @@ private:
static void tapReset(void *tapinfo_ptr);
static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data, tap_flags_t flags);
static void tapDraw(void *tapinfo_ptr);
- static gint compareCallNums(gconstpointer a, gconstpointer b);
+ static int compareCallNums(const void *a, const void *b);
void updateCalls();
void prepareFilter();
diff --git a/ui/qt/welcome_page.cpp b/ui/qt/welcome_page.cpp
index ac37a6d9..1297944c 100644
--- a/ui/qt/welcome_page.cpp
+++ b/ui/qt/welcome_page.cpp
@@ -9,13 +9,12 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/prefs.h>
#include "ui/capture_globals.h"
#include "ui/urls.h"
+#include "wsutil/filesystem.h"
#include "wsutil/version_info.h"
#include "welcome_page.h"
@@ -72,24 +71,28 @@ WelcomePage::WelcomePage(QWidget *parent) :
recent_files_->setTextElideMode(Qt::ElideLeft);
welcome_ui_->recentList->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(recent_files_, SIGNAL(customContextMenuRequested(QPoint)),
- this, SLOT(showRecentContextMenu(QPoint)));
-
- connect(mainApp, SIGNAL(updateRecentCaptureStatus(const QString &, qint64, bool)), this, SLOT(updateRecentCaptures()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(appInitialized()));
- connect(mainApp, SIGNAL(localInterfaceListChanged()), this, SLOT(interfaceListChanged()));
- connect(welcome_ui_->interfaceFrame, SIGNAL(itemSelectionChanged()),
- welcome_ui_->captureFilterComboBox, SIGNAL(interfacesChanged()));
- connect(welcome_ui_->interfaceFrame, SIGNAL(typeSelectionChanged()),
- this, SLOT(interfaceListChanged()));
- connect(welcome_ui_->interfaceFrame, SIGNAL(itemSelectionChanged()), this, SLOT(interfaceSelected()));
- connect(welcome_ui_->captureFilterComboBox->lineEdit(), SIGNAL(textEdited(QString)),
- this, SLOT(captureFilterTextEdited(QString)));
- connect(welcome_ui_->captureFilterComboBox, SIGNAL(captureFilterSyntaxChanged(bool)),
- this, SIGNAL(captureFilterSyntaxChanged(bool)));
- connect(welcome_ui_->captureFilterComboBox, SIGNAL(startCapture()),
- this, SLOT(captureStarting()));
- connect(recent_files_, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(openRecentItem(QListWidgetItem *)));
+ connect(recent_files_, &QListWidget::customContextMenuRequested, this, &WelcomePage::showRecentContextMenu);
+
+ connect(mainApp, &MainApplication::updateRecentCaptureStatus, this, &WelcomePage::updateRecentCaptures);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WelcomePage::updateRecentCaptures);
+ connect(mainApp, &MainApplication::appInitialized, this, &WelcomePage::appInitialized);
+ connect(mainApp, &MainApplication::localInterfaceListChanged, this, &WelcomePage::interfaceListChanged);
+#ifdef HAVE_LIBPCAP
+ connect(mainApp, &MainApplication::scanLocalInterfaces,
+ welcome_ui_->interfaceFrame, &InterfaceFrame::scanLocalInterfaces);
+#endif
+ connect(welcome_ui_->interfaceFrame, &InterfaceFrame::itemSelectionChanged,
+ welcome_ui_->captureFilterComboBox, &CaptureFilterCombo::interfacesChanged);
+ connect(welcome_ui_->interfaceFrame, &InterfaceFrame::typeSelectionChanged,
+ this, &WelcomePage::interfaceListChanged);
+ connect(welcome_ui_->interfaceFrame, &InterfaceFrame::itemSelectionChanged, this, &WelcomePage::interfaceSelected);
+ connect(welcome_ui_->captureFilterComboBox->lineEdit(), &QLineEdit::textEdited,
+ this, &WelcomePage::captureFilterTextEdited);
+ connect(welcome_ui_->captureFilterComboBox, &CaptureFilterCombo::captureFilterSyntaxChanged,
+ this, &WelcomePage::captureFilterSyntaxChanged);
+ connect(welcome_ui_->captureFilterComboBox, &CaptureFilterCombo::startCapture,
+ this, &WelcomePage::captureStarting);
+ connect(recent_files_, &QListWidget::itemActivated, this, &WelcomePage::openRecentItem);
updateRecentCaptures();
splash_overlay_ = new SplashOverlay(this);
@@ -136,11 +139,19 @@ void WelcomePage::setReleaseLabel()
QString full_release;
QDate today = QDate::currentDate();
if ((today.month() == 4 && today.day() == 1) || (today.month() == 7 && today.day() == 14)) {
- full_release = tr("You are sniffing the glue that holds the Internet together using Wireshark ");
+ if (is_packet_configuration_namespace()) {
+ full_release = tr("You are sniffing the glue that holds the Internet together using Wireshark ");
+ } else {
+ full_release = tr("You are sniffing the glue that holds your system together using Logray ");
+ }
} else {
- full_release = tr("You are running Wireshark ");
+ if (is_packet_configuration_namespace()) {
+ full_release = tr("You are running Wireshark ");
+ } else {
+ full_release = tr("You are running Logray ");
+ }
}
- full_release += get_ws_vcs_version_info();
+ full_release += is_packet_configuration_namespace() ? get_ws_vcs_version_info() : get_lr_vcs_version_info();
full_release += ".";
#ifdef HAVE_SOFTWARE_UPDATE
if (prefs.gui_update_enabled) {
@@ -184,7 +195,7 @@ void WelcomePage::captureFilterTextEdited(const QString capture_filter)
if (global_capture_opts.num_selected > 0) {
interface_t *device;
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (!device->selected) {
continue;
@@ -272,7 +283,7 @@ void WelcomePage::updateRecentCaptures() {
selectedFilename = rfItem->data(Qt::UserRole).toString();
}
- if (mainApp->recentItems().count() == 0) {
+ if (mainApp->recentItems().count() == 0 || prefs.gui_welcome_page_show_recent) {
// Recent menu has been cleared, remove all recent files.
while (recent_files_->count()) {
delete recent_files_->item(0);
@@ -280,39 +291,41 @@ void WelcomePage::updateRecentCaptures() {
}
int rfRow = 0;
- foreach (recent_item_status *ri, mainApp->recentItems()) {
- itemLabel = ri->filename;
+ if(prefs.gui_welcome_page_show_recent) {
+ foreach (recent_item_status *ri, mainApp->recentItems()) {
+ itemLabel = ri->filename;
- if (rfRow >= recent_files_->count()) {
- recent_files_->addItem(itemLabel);
- }
+ if (rfRow >= recent_files_->count()) {
+ recent_files_->addItem(itemLabel);
+ }
- itemLabel.append(" (");
- if (ri->accessible) {
- if (ri->size/1024/1024/1024 > 10) {
- itemLabel.append(QString("%1 GB").arg(ri->size/1024/1024/1024));
- } else if (ri->size/1024/1024 > 10) {
- itemLabel.append(QString("%1 MB").arg(ri->size/1024/1024));
- } else if (ri->size/1024 > 10) {
- itemLabel.append(QString("%1 KB").arg(ri->size/1024));
+ itemLabel.append(" (");
+ if (ri->accessible) {
+ if (ri->size/1024/1024/1024 > 10) {
+ itemLabel.append(QString("%1 GB").arg(ri->size/1024/1024/1024));
+ } else if (ri->size/1024/1024 > 10) {
+ itemLabel.append(QString("%1 MB").arg(ri->size/1024/1024));
+ } else if (ri->size/1024 > 10) {
+ itemLabel.append(QString("%1 KB").arg(ri->size/1024));
+ } else {
+ itemLabel.append(QString("%1 Bytes").arg(ri->size));
+ }
} else {
- itemLabel.append(QString("%1 Bytes").arg(ri->size));
+ itemLabel.append(tr("not found"));
}
- } else {
- itemLabel.append(tr("not found"));
- }
- itemLabel.append(")");
- rfFont.setItalic(!ri->accessible);
- rfItem = recent_files_->item(rfRow);
- rfItem->setText(itemLabel);
- rfItem->setData(Qt::AccessibleTextRole, itemLabel);
- rfItem->setData(Qt::UserRole, ri->filename);
- rfItem->setFlags(ri->accessible ? Qt::ItemIsSelectable | Qt::ItemIsEnabled : Qt::NoItemFlags);
- rfItem->setFont(rfFont);
- if (ri->filename == selectedFilename) {
- rfItem->setSelected(true);
+ itemLabel.append(")");
+ rfFont.setItalic(!ri->accessible);
+ rfItem = recent_files_->item(rfRow);
+ rfItem->setText(itemLabel);
+ rfItem->setData(Qt::AccessibleTextRole, itemLabel);
+ rfItem->setData(Qt::UserRole, ri->filename);
+ rfItem->setFlags(ri->accessible ? Qt::ItemIsSelectable | Qt::ItemIsEnabled : Qt::NoItemFlags);
+ rfItem->setFont(rfFont);
+ if (ri->filename == selectedFilename) {
+ rfItem->setSelected(true);
+ }
+ rfRow++;
}
- rfRow++;
}
int row = recent_files_->count();
@@ -378,17 +391,17 @@ void WelcomePage::showRecentContextMenu(QPoint pos)
QAction *show_action = recent_ctx_menu->addAction(show_in_str_);
show_action->setData(cf_path);
- connect(show_action, SIGNAL(triggered(bool)), this, SLOT(showRecentFolder()));
+ connect(show_action, &QAction::triggered, this, &WelcomePage::showRecentFolder);
QAction *copy_action = recent_ctx_menu->addAction(tr("Copy file path"));
copy_action->setData(cf_path);
- connect(copy_action, SIGNAL(triggered(bool)), this, SLOT(copyRecentPath()));
+ connect(copy_action, &QAction::triggered, this, &WelcomePage::copyRecentPath);
recent_ctx_menu->addSeparator();
QAction *remove_action = recent_ctx_menu->addAction(tr("Remove from list"));
remove_action->setData(cf_path);
- connect(remove_action, SIGNAL(triggered(bool)), this, SLOT(removeRecentPath()));
+ connect(remove_action, &QAction::triggered, this, &WelcomePage::removeRecentPath);
recent_ctx_menu->popup(recent_files_->mapToGlobal(pos));
}
diff --git a/ui/qt/welcome_page.h b/ui/qt/welcome_page.h
index d6243d1a..382d4aa4 100644
--- a/ui/qt/welcome_page.h
+++ b/ui/qt/welcome_page.h
@@ -58,7 +58,7 @@ private:
QListWidget *recent_files_;
signals:
- void startCapture(QStringList);
+ void startCapture(QStringList ifaces);
void recentFileActivated(QString cfile);
void captureFilterSyntaxChanged(bool valid);
void showExtcapOptions(QString &device_name, bool startCaptureOnClose);
diff --git a/ui/qt/welcome_page.ui b/ui/qt/welcome_page.ui
index afc50f5e..d1a0c4f7 100644
--- a/ui/qt/welcome_page.ui
+++ b/ui/qt/welcome_page.ui
@@ -304,6 +304,9 @@ a:hover {
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item>
diff --git a/ui/qt/widgets/additional_toolbar.cpp b/ui/qt/widgets/additional_toolbar.cpp
index c023d149..43eab273 100644
--- a/ui/qt/widgets/additional_toolbar.cpp
+++ b/ui/qt/widgets/additional_toolbar.cpp
@@ -9,8 +9,6 @@
#include <config.h>
-#include <glib.h>
-
#include <ui/qt/widgets/additional_toolbar.h>
#include <ui/qt/widgets/apply_line_edit.h>
#include <ui/qt/utils/qt_ui_utils.h>
@@ -159,7 +157,7 @@ QWidget * AdditionalToolbarWidgetAction::createWidget(QWidget * parent)
}
static void
-toolbar_button_cb(gpointer item, gpointer item_data, gpointer user_data)
+toolbar_button_cb(void *item, void *item_data, void *user_data)
{
if (! item || ! item_data || ! user_data)
return;
@@ -170,7 +168,7 @@ toolbar_button_cb(gpointer item, gpointer item_data, gpointer user_data)
if (widget)
{
if (update_entry->type == EXT_TOOLBAR_UPDATE_VALUE)
- widget->setText((gchar *)update_entry->user_data);
+ widget->setText((char *)update_entry->user_data);
else if (update_entry->type == EXT_TOOLBAR_SET_ACTIVE)
{
bool enableState = GPOINTER_TO_INT(update_entry->user_data) == 1;
@@ -195,7 +193,7 @@ QWidget * AdditionalToolbarWidgetAction::createButton(ext_toolbar_t * item, QWid
}
static void
-toolbar_boolean_cb(gpointer item, gpointer item_data, gpointer user_data)
+toolbar_boolean_cb(void *item, void *item_data, void *user_data)
{
if (! item || ! item_data || ! user_data)
return;
@@ -267,7 +265,7 @@ QWidget * AdditionalToolbarWidgetAction::createLabelFrame(ext_toolbar_t * item,
}
static void
-toolbar_string_cb(gpointer item, gpointer item_data, gpointer user_data)
+toolbar_string_cb(void *item, void *item_data, void *user_data)
{
if (! item || ! item_data || ! user_data)
return;
@@ -282,7 +280,7 @@ toolbar_string_cb(gpointer item, gpointer item_data, gpointer user_data)
if (update_entry->silent)
oldState = edit->blockSignals(true);
- edit->setText((gchar *)update_entry->user_data);
+ edit->setText((char *)update_entry->user_data);
if (update_entry->silent)
edit->blockSignals(oldState);
@@ -321,7 +319,7 @@ QWidget * AdditionalToolbarWidgetAction::createTextEditor(ext_toolbar_t * item,
}
static void
-toolbar_selector_cb(gpointer item, gpointer item_data, gpointer user_data)
+toolbar_selector_cb(void *item, void *item_data, void *user_data)
{
if (! item || ! item_data || ! user_data)
return;
@@ -346,7 +344,7 @@ toolbar_selector_cb(gpointer item, gpointer item_data, gpointer user_data)
if (update_entry->type == EXT_TOOLBAR_UPDATE_VALUE)
{
- QString data = QString((gchar *)update_entry->user_data);
+ QString data = QString((char *)update_entry->user_data);
for (int i = 0; i < sourceModel->rowCount(); i++)
{
@@ -385,8 +383,8 @@ toolbar_selector_cb(gpointer item, gpointer item_data, gpointer user_data)
if (! update_entry->data_index)
return;
- gchar * idx = (gchar *)update_entry->data_index;
- gchar * display = (gchar *)update_entry->user_data;
+ char * idx = (char *)update_entry->data_index;
+ char * display = (char *)update_entry->user_data;
if (update_entry->type == EXT_TOOLBAR_UPDATE_DATABYINDEX)
{
@@ -522,7 +520,7 @@ void AdditionalToolbarWidgetAction::onCheckBoxChecked(int checkState)
if (! item)
return;
- gboolean value = checkState == Qt::Checked ? true : false;
+ bool value = checkState == Qt::Checked ? true : false;
item->callback(item, &value, item->user_data);
}
@@ -539,7 +537,7 @@ void AdditionalToolbarWidgetAction::sendTextToCallback()
ApplyLineEdit * editor = dynamic_cast<ApplyLineEdit *>(sender());
if (! editor)
{
- /* Called from button, searching for acompanying line edit */
+ /* Called from button, searching for accompanying line edit */
QWidget * parent = dynamic_cast<QWidget *>(sender()->parent());
if (parent)
{
diff --git a/ui/qt/widgets/byte_view_text.cpp b/ui/qt/widgets/byte_view_text.cpp
index e81dc0ac..ee1e0195 100644
--- a/ui/qt/widgets/byte_view_text.cpp
+++ b/ui/qt/widgets/byte_view_text.cpp
@@ -70,6 +70,7 @@ ByteViewText::ByteViewText(const QByteArray &data, packet_char_enc encoding, QWi
offset_normal_fg_ = ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.35);
offset_field_fg_ = ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.65);
+ ctx_menu_.setToolTipsVisible(true);
window()->winId(); // Required for screenChanged? https://phabricator.kde.org/D20171
connect(window()->windowHandle(), &QWindow::screenChanged, viewport(), [=](const QScreen *) { viewport()->update(); });
@@ -407,11 +408,7 @@ void ByteViewText::updateLayoutMetrics()
int ByteViewText::stringWidth(const QString &line)
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
return viewport()->fontMetrics().horizontalAdvance(line);
-#else
- return viewport()->fontMetrics().boundingRect(line).width();
-#endif
}
// Draw a line of byte view text for a given offset.
diff --git a/ui/qt/widgets/capture_filter_combo.cpp b/ui/qt/widgets/capture_filter_combo.cpp
index 70635cef..95766310 100644
--- a/ui/qt/widgets/capture_filter_combo.cpp
+++ b/ui/qt/widgets/capture_filter_combo.cpp
@@ -126,7 +126,7 @@ void CaptureFilterCombo::rebuildFilterList()
QString cur_filter = currentText();
clear();
for (GList *li = g_list_first(cfilter_list); li != NULL; li = gxx_list_next(li)) {
- addItem(gxx_list_data(const gchar *, li));
+ addItem(gxx_list_data(const char *, li));
}
lineEdit()->setText(cur_filter);
lineEdit()->blockSignals(false);
diff --git a/ui/qt/widgets/capture_filter_edit.cpp b/ui/qt/widgets/capture_filter_edit.cpp
index 3c72fe41..50793143 100644
--- a/ui/qt/widgets/capture_filter_edit.cpp
+++ b/ui/qt/widgets/capture_filter_edit.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/proto.h>
#include "capture_opts.h"
@@ -308,7 +306,7 @@ QPair<const QString, bool> CaptureFilterEdit::getSelectedFilter()
#ifdef HAVE_LIBPCAP
int selected_devices = 0;
- for (guint i = 0; i < global_capture_opts.all_ifaces->len; i++) {
+ for (unsigned i = 0; i < global_capture_opts.all_ifaces->len; i++) {
interface_t *device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (device->selected) {
selected_devices++;
diff --git a/ui/qt/widgets/compression_group_box.cpp b/ui/qt/widgets/compression_group_box.cpp
new file mode 100644
index 00000000..08a74dae
--- /dev/null
+++ b/ui/qt/widgets/compression_group_box.cpp
@@ -0,0 +1,69 @@
+/* @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "compression_group_box.h"
+
+#include <QRadioButton>
+#include <QButtonGroup>
+#include <QVBoxLayout>
+
+CompressionGroupBox::CompressionGroupBox(QWidget *parent) :
+ QGroupBox(parent)
+{
+ setTitle(tr("Compression options"));
+ setFlat(true);
+
+
+ bg_ = new QButtonGroup(this);
+ QVBoxLayout *vbox = new QVBoxLayout();
+
+ QRadioButton *radio1 = new QRadioButton(tr("&Uncompressed"));
+ bg_->addButton(radio1, WTAP_UNCOMPRESSED);
+ vbox->addWidget(radio1);
+
+#if defined (HAVE_ZLIB) || defined (HAVE_ZLIBNG)
+ QRadioButton *radio2 = new QRadioButton(tr("Compress with g&zip"));
+ bg_->addButton(radio2, WTAP_GZIP_COMPRESSED);
+ vbox->addWidget(radio2);
+#endif
+#ifdef HAVE_LZ4FRAME_H
+ QRadioButton *radio3 = new QRadioButton(tr("Compress with &LZ4"));
+ bg_->addButton(radio3, WTAP_LZ4_COMPRESSED);
+ vbox->addWidget(radio3);
+#endif
+
+ radio1->setChecked(true);
+
+ setLayout(vbox);
+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+ connect(bg_, &QButtonGroup::idToggled, [=] { emit stateChanged(); });
+#else
+ connect(bg_, QOverload<int, bool>::of(&QButtonGroup::buttonToggled), [=] { emit stateChanged(); });
+#endif
+
+}
+
+CompressionGroupBox::~CompressionGroupBox()
+{
+}
+
+wtap_compression_type CompressionGroupBox::compressionType() const
+{
+ return static_cast<wtap_compression_type>(bg_->checkedId());
+}
+
+void CompressionGroupBox::setCompressionType(wtap_compression_type type)
+{
+ QAbstractButton *button = bg_->button(type);
+ if (button != nullptr) {
+ button->setChecked(true);
+ }
+}
+
diff --git a/ui/qt/widgets/compression_group_box.h b/ui/qt/widgets/compression_group_box.h
new file mode 100644
index 00000000..4e70ca2d
--- /dev/null
+++ b/ui/qt/widgets/compression_group_box.h
@@ -0,0 +1,41 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef COMPRESSION_GROUP_BOX_H
+#define COMPRESSION_GROUP_BOX_H
+
+#include <config.h>
+
+#include <QGroupBox>
+
+#include <wiretap/wtap.h>
+
+class QButtonGroup;
+
+/**
+ * UI element for selecting compression type from among those supported.
+ */
+class CompressionGroupBox : public QGroupBox
+{
+ Q_OBJECT
+
+public:
+ explicit CompressionGroupBox(QWidget *parent = 0);
+ ~CompressionGroupBox();
+ wtap_compression_type compressionType() const;
+ void setCompressionType(wtap_compression_type type);
+
+signals:
+ void stateChanged();
+
+private:
+ QButtonGroup *bg_;
+};
+
+#endif // COMPRESSION_GROUP_BOX_H
diff --git a/ui/qt/widgets/copy_from_profile_button.h b/ui/qt/widgets/copy_from_profile_button.h
index f074bdb8..ea6df816 100644
--- a/ui/qt/widgets/copy_from_profile_button.h
+++ b/ui/qt/widgets/copy_from_profile_button.h
@@ -11,7 +11,6 @@
#define COPY_FROM_PROFILE_BUTTON_H
#include <config.h>
-#include <glib.h>
#include <QMenu>
#include <QPushButton>
diff --git a/ui/qt/widgets/display_filter_combo.cpp b/ui/qt/widgets/display_filter_combo.cpp
index c28afb91..674da765 100644
--- a/ui/qt/widgets/display_filter_combo.cpp
+++ b/ui/qt/widgets/display_filter_combo.cpp
@@ -25,8 +25,31 @@
#include <ui/qt/utils/color_utils.h>
#include "main_application.h"
-// If we ever add support for multiple windows this will need to be replaced.
-static DisplayFilterCombo *cur_display_filter_combo = NULL;
+static QStandardItemModel *cur_model;
+
+extern "C" void dfilter_recent_combo_write_all(FILE *rf) {
+ if (cur_model == nullptr)
+ return;
+
+ for (int i = 0; i < cur_model->rowCount(); i++ ) {
+ const QByteArray& filter = cur_model->item(i)->text().toUtf8();
+ if (!filter.isEmpty()) {
+ fprintf(rf, RECENT_KEY_DISPLAY_FILTER ": %s\n", filter.constData());
+ }
+ }
+}
+
+extern "C" bool dfilter_combo_add_recent(const char *filter) {
+ if (cur_model == nullptr) {
+ cur_model = new QStandardItemModel();
+ cur_model->setSortRole(Qt::UserRole);
+ }
+
+ QStandardItem *new_item = new QStandardItem(filter);
+ new_item->setData(QVariant(QDateTime::currentMSecsSinceEpoch()), Qt::UserRole);
+ cur_model->appendRow(new_item);
+ return true;
+}
DisplayFilterCombo::DisplayFilterCombo(QWidget *parent) :
QComboBox(parent)
@@ -46,36 +69,51 @@ DisplayFilterCombo::DisplayFilterCombo(QWidget *parent) :
// Default is Preferred.
setSizePolicy(QSizePolicy::MinimumExpanding, sizePolicy().verticalPolicy());
setAccessibleName(tr("Display filter selector"));
- cur_display_filter_combo = this;
updateStyleSheet();
setToolTip(tr("Select from previously used filters."));
- QStandardItemModel *model = qobject_cast<QStandardItemModel*>(this->model());
- model->setSortRole(Qt::UserRole);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
+ // Setting the placeholderText keeps newly added items from being the
+ // current item. It only works for the placeholderText of the QComboBox,
+ // not the lineEdit (even though the lineEdit's placeholderText is shown
+ // instead.) This only matters for any combobox created before the recent
+ // display filter list is read (i.e., the main window one.)
+ setPlaceholderText(lineEdit()->placeholderText());
+#endif
+
+ if (cur_model == nullptr) {
+ cur_model = new QStandardItemModel();
+ cur_model->setSortRole(Qt::UserRole);
+ }
+ setModel(cur_model);
connect(mainApp, &MainApplication::preferencesChanged, this, &DisplayFilterCombo::updateMaxCount);
// Ugly cast required (?)
// https://stackoverflow.com/questions/16794695/connecting-overloaded-signals-and-slots-in-qt-5
connect(this, static_cast<void (DisplayFilterCombo::*)(int)>(&DisplayFilterCombo::activated), this, &DisplayFilterCombo::onActivated);
-}
-
-extern "C" void dfilter_recent_combo_write_all(FILE *rf) {
- if (!cur_display_filter_combo)
- return;
- cur_display_filter_combo->writeRecent(rf);
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ connect(cur_model, &QAbstractItemModel::rowsAboutToBeInserted, this, &DisplayFilterCombo::rowsAboutToBeInserted);
+ connect(cur_model, &QAbstractItemModel::rowsInserted, this, &DisplayFilterCombo::rowsInserted);
+#endif
}
-void DisplayFilterCombo::writeRecent(FILE *rf) {
- int i;
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+void DisplayFilterCombo::rowsAboutToBeInserted(const QModelIndex&, int, int)
+{
+ // If the current text is blank but we're inserting a row, that means
+ // it is being added programmatically from the model, and we want to
+ // clear it afterwards and show the placeholder text instead.
+ clear_state_ = (currentText() == QString());
+}
- for (i = 0; i < count(); i++) {
- const QByteArray& filter = itemText(i).toUtf8();
- if (!filter.isEmpty()) {
- fprintf(rf, RECENT_KEY_DISPLAY_FILTER ": %s\n", filter.constData());
- }
+void DisplayFilterCombo::rowsInserted(const QModelIndex&, int, int)
+{
+ if (clear_state_) {
+ clearEditText();
}
}
+#endif
void DisplayFilterCombo::onActivated(int row)
{
@@ -172,18 +210,3 @@ void DisplayFilterCombo::updateMaxCount()
{
setMaxCount(prefs.gui_recent_df_entries_max);
}
-
-extern "C" gboolean dfilter_combo_add_recent(const gchar *filter) {
- if (!cur_display_filter_combo)
- return FALSE;
-
- // Adding an item to a QComboBox also sets its lineEdit. In our case
- // that means we might trigger a temporary status message so we block
- // the lineEdit's signals.
- // Another approach would be to update QComboBox->model directly.
- bool block_state = cur_display_filter_combo->lineEdit()->blockSignals(true);
- cur_display_filter_combo->addItem(filter, QVariant(QDateTime::currentMSecsSinceEpoch()));
- cur_display_filter_combo->clearEditText();
- cur_display_filter_combo->lineEdit()->blockSignals(block_state);
- return TRUE;
-}
diff --git a/ui/qt/widgets/display_filter_combo.h b/ui/qt/widgets/display_filter_combo.h
index 81fa11ba..d53bfca4 100644
--- a/ui/qt/widgets/display_filter_combo.h
+++ b/ui/qt/widgets/display_filter_combo.h
@@ -23,9 +23,16 @@ public:
void updateStyleSheet();
protected:
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ void rowsAboutToBeInserted(const QModelIndex&, int, int);
+ void rowsInserted(const QModelIndex&, int, int);
+#endif
virtual bool event(QEvent *event);
private:
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ bool clear_state_;
+#endif
public slots:
bool checkDisplayFilter();
diff --git a/ui/qt/widgets/display_filter_edit.cpp b/ui/qt/widgets/display_filter_edit.cpp
index 839b14fd..09113da7 100644
--- a/ui/qt/widgets/display_filter_edit.cpp
+++ b/ui/qt/widgets/display_filter_edit.cpp
@@ -9,9 +9,8 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/dfilter/dfilter.h>
+#include <epan/dfilter/dfunctions.h>
#include <ui/recent.h>
@@ -58,8 +57,16 @@
#define DEFAULT_MODIFIER "Ctrl-"
#endif
-// proto.c:fld_abbrev_chars
-static const QString fld_abbrev_chars_ = "-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
+// ':' is not a legal field character, but it appears inside literals and
+// having it as a token character will keep field completion from being
+// offered in a place where it is syntactically impossible.
+//
+// The other place ':' is used in the grammar is to separate display filter
+// macros from their argument lists in the ${macro:arg;arg} format. Adding
+// ':' here means that the first argument of the list won't have a completion
+// pop-up. (We don't do completion for the macro names, maybe we should?)
+// ${macro;arg;arg} is allowed now, though.
+static const QString fld_abbrev_chars_ = ":-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, DisplayFilterEditType type) :
SyntaxLineEdit(parent),
@@ -121,6 +128,8 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, DisplayFilterEditType type
connect(this, &DisplayFilterEdit::returnPressed, this, &DisplayFilterEdit::applyDisplayFilter);
}
+ setDefaultPlaceholderText();
+
connect(this, &DisplayFilterEdit::textChanged, this,
static_cast<void (DisplayFilterEdit::*)(const QString &)>(&DisplayFilterEdit::checkFilter));
@@ -578,16 +587,24 @@ void DisplayFilterEdit::buildCompletionList(const QString &field_word, const QSt
void *field_cookie;
const QByteArray fw_ba = field_word.toUtf8(); // or toLatin1 or toStdString?
const char *fw_utf8 = fw_ba.constData();
- gsize fw_len = (gsize) strlen(fw_utf8);
+ size_t fw_len = (size_t) strlen(fw_utf8);
for (header_field_info *hfinfo = proto_get_first_protocol_field(proto_id, &field_cookie); hfinfo; hfinfo = proto_get_next_protocol_field(proto_id, &field_cookie)) {
if (hfinfo->same_name_prev_id != -1) continue; // Ignore duplicate names.
if (!g_ascii_strncasecmp(fw_utf8, hfinfo->abbrev, fw_len)) {
- if ((gsize) strlen(hfinfo->abbrev) != fw_len) field_list << hfinfo->abbrev;
+ if ((size_t) strlen(hfinfo->abbrev) != fw_len) field_list << hfinfo->abbrev;
}
}
}
}
+
+ // Add display filter functions to the completion list
+ GPtrArray *func_list = df_func_name_list();
+ for (unsigned i = 0; i < func_list->len; i++) {
+ field_list << QString::fromUtf8(static_cast<const char *>(func_list->pdata[i])).append("(");
+ }
+ g_ptr_array_unref(func_list);
+
field_list.sort();
}
@@ -614,19 +631,42 @@ void DisplayFilterEdit::clearFilter()
void DisplayFilterEdit::applyDisplayFilter()
{
if (completer()->popup()->currentIndex().isValid()) {
- // If the popup (not the QCompleter itself) has a currently
- // valid QModelIndex, that means that the popup's
- // QAbstractItemView::activated() signal has not yet
- // been handled, which means that text() has the old value,
- // not the one from the completer.
- return;
+ // If the popup (not the QCompleter itself) has a currently valid
+ // QModelIndex, check to see if text() matches the text from the popup.
+ // If it does, then all is well, go ahead and filter (this happens
+ // if the popup entry is selected via mouse.)
+ //
+ // If it doesn't match, then it has the old value. There are two
+ // possibilities:
+ // 1) The user clicked away from the popup *without* selecting
+ // anything (making the popup disappear), and then hit Enter, in
+ // which case the user wants to filter with text() and doesn't care
+ // about what's in the popup. However, the QModelIndex for the popup
+ // is still valid until some time after this signal is handled.
+ //
+ // 2) The user pressed Return on an entry in the popup, in which
+ // case the user wants to filter with the new value in the popup,
+ // not the value in text(), but for some reason the popup's
+ // activated() signal gets handled *after* returnPressed on the
+ // LineEdit, unfortunately (#19323).
+ //
+ // We haven't figured out how to distinguish case 1 from case 2 yet,
+ // so ignore this force the user to press Enter again, and which
+ // point everything will have reconciled.
+ //
+ // Note that the currentCompletion() / currentIndex.data() of
+ // the completer() itself is "what would be the first completion
+ // of the text currently displayed in the line edit" and has naught
+ // to do with what was selected in the popup.
+ if (text() != completer()->popup()->currentIndex().data()) {
+ return;
+ }
}
if (syntaxState() == Invalid)
return;
- if (text().length() > 0)
- last_applied_ = text();
+ last_applied_ = text();
updateClearButton();
@@ -712,9 +752,7 @@ void DisplayFilterEdit::applyOrPrepareFilter()
if (! pa || pa->property("display_filter").toString().isEmpty())
return;
- QString filterText = pa->property("display_filter").toString();
- last_applied_ = filterText;
- setText(filterText);
+ setText(pa->property("display_filter").toString());
// Holding down the Shift key will only prepare filter.
if (!(QApplication::keyboardModifiers() & Qt::ShiftModifier)) {
@@ -802,7 +840,6 @@ void DisplayFilterEdit::dropEvent(QDropEvent *event)
return;
}
- last_applied_ = filterText;
setText(filterText);
// Holding down the Shift key will only prepare filter.
diff --git a/ui/qt/widgets/dissector_syntax_line_edit.cpp b/ui/qt/widgets/dissector_syntax_line_edit.cpp
index ae8a2247..4f228ce4 100644
--- a/ui/qt/widgets/dissector_syntax_line_edit.cpp
+++ b/ui/qt/widgets/dissector_syntax_line_edit.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/packet.h>
#include <wsutil/utf8_entities.h>
@@ -38,6 +36,15 @@ DissectorSyntaxLineEdit::DissectorSyntaxLineEdit(QWidget *parent) :
setCompleter(new QCompleter(completion_model_, this));
setCompletionTokenChars(fld_abbrev_chars_);
+ updateDissectorNames();
+ setDefaultPlaceholderText();
+
+ connect(this, &DissectorSyntaxLineEdit::textChanged, this,
+ static_cast<void (DissectorSyntaxLineEdit::*)(const QString &)>(&DissectorSyntaxLineEdit::checkDissectorName));
+}
+
+void DissectorSyntaxLineEdit::updateDissectorNames()
+{
GList *dissector_names = get_dissector_names();
QStringList dissector_list;
for (GList* l = dissector_names; l != NULL; l = l->next) {
@@ -46,10 +53,6 @@ DissectorSyntaxLineEdit::DissectorSyntaxLineEdit(QWidget *parent) :
g_list_free(dissector_names);
dissector_list.sort();
completion_model_->setStringList(dissector_list);
- setDefaultPlaceholderText();
-
- connect(this, &DissectorSyntaxLineEdit::textChanged, this,
- static_cast<void (DissectorSyntaxLineEdit::*)(const QString &)>(&DissectorSyntaxLineEdit::checkDissectorName));
}
void DissectorSyntaxLineEdit::setDefaultPlaceholderText()
diff --git a/ui/qt/widgets/dissector_syntax_line_edit.h b/ui/qt/widgets/dissector_syntax_line_edit.h
index adcee8c7..a99442b7 100644
--- a/ui/qt/widgets/dissector_syntax_line_edit.h
+++ b/ui/qt/widgets/dissector_syntax_line_edit.h
@@ -20,19 +20,22 @@ class DissectorSyntaxLineEdit : public SyntaxLineEdit
Q_OBJECT
public:
explicit DissectorSyntaxLineEdit(QWidget *parent = 0);
+ void updateDissectorNames();
+ void setDefaultPlaceholderText();
protected:
void keyPressEvent(QKeyEvent *event) { completionKeyPressEvent(event); }
void focusInEvent(QFocusEvent *event) { completionFocusInEvent(event); }
-private slots:
+public slots:
void checkDissectorName(const QString &dissector);
+
+private slots:
void changeEvent(QEvent* event);
private:
QString placeholder_text_;
- void setDefaultPlaceholderText();
void buildCompletionList(const QString &field_word, const QString &preamble);
};
diff --git a/ui/qt/widgets/field_filter_edit.cpp b/ui/qt/widgets/field_filter_edit.cpp
index 7aebf051..b2452c30 100644
--- a/ui/qt/widgets/field_filter_edit.cpp
+++ b/ui/qt/widgets/field_filter_edit.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/dfilter/dfilter.h>
#include <wsutil/filter_files.h>
@@ -160,12 +158,12 @@ void FieldFilterEdit::buildCompletionList(const QString &field_word, const QStri
void *field_cookie;
const QByteArray fw_ba = field_word.toUtf8(); // or toLatin1 or toStdString?
const char *fw_utf8 = fw_ba.constData();
- gsize fw_len = (gsize) strlen(fw_utf8);
+ size_t fw_len = (size_t) strlen(fw_utf8);
for (header_field_info *hfinfo = proto_get_first_protocol_field(proto_id, &field_cookie); hfinfo; hfinfo = proto_get_next_protocol_field(proto_id, &field_cookie)) {
if (hfinfo->same_name_prev_id != -1) continue; // Ignore duplicate names.
if (!g_ascii_strncasecmp(fw_utf8, hfinfo->abbrev, fw_len)) {
- if ((gsize) strlen(hfinfo->abbrev) != fw_len) field_list << hfinfo->abbrev;
+ if ((size_t) strlen(hfinfo->abbrev) != fw_len) field_list << hfinfo->abbrev;
}
}
}
diff --git a/ui/qt/widgets/filter_expression_toolbar.cpp b/ui/qt/widgets/filter_expression_toolbar.cpp
index 84dabc47..c17f7aee 100644
--- a/ui/qt/widgets/filter_expression_toolbar.cpp
+++ b/ui/qt/widgets/filter_expression_toolbar.cpp
@@ -181,7 +181,7 @@ WiresharkMimeData * FilterExpressionToolBar::createMimeData(QString name, int po
void FilterExpressionToolBar::onActionMoved(QAction* action, int oldPos, int newPos)
{
- gchar* err = NULL;
+ char* err = NULL;
if (oldPos == newPos)
return;
@@ -237,7 +237,7 @@ void FilterExpressionToolBar::onFilterDropped(QString description, QString filte
return;
filter_expression_new(qUtf8Printable(description),
- qUtf8Printable(filter), qUtf8Printable(description), TRUE);
+ qUtf8Printable(filter), qUtf8Printable(description), true);
save_migrated_uat("Display expressions", &prefs.filter_expressions_old);
filterExpressionsChanged();
@@ -356,16 +356,14 @@ QMenu * FilterExpressionToolBar::findParentMenu(const QStringList tree, void *fe
/* Searching existing main menus */
foreach(QAction * entry, data->toolbar->actions())
{
- QWidget * widget = data->toolbar->widgetForAction(entry);
- QToolButton * tb = qobject_cast<QToolButton *>(widget);
- if (tb && tb->menu() && tb->text().compare(tree.at(0).trimmed()) == 0)
- return findParentMenu(tree.mid(1), fed_data, tb->menu());
+ if (entry->text().compare(tree.at(0).trimmed()) == 0)
+ return findParentMenu(tree.mid(1), fed_data, entry->menu());
}
}
else if (parent)
{
QString menuName = tree.at(0).trimmed();
- /* Iterate to see, if we next have to jump into another submenu */
+ /* Iterate to see if we next have to jump into another submenu */
foreach(QAction *entry, parent->actions())
{
if (entry->menu() && entry->text().compare(menuName) == 0)
@@ -382,16 +380,18 @@ QMenu * FilterExpressionToolBar::findParentMenu(const QStringList tree, void *fe
/* No menu has been found, create one */
QString parentName = tree.at(0).trimmed();
- QToolButton * menuButton = new QToolButton();
- menuButton->setText(parentName);
- menuButton->setPopupMode(QToolButton::MenuButtonPopup);
- QMenu * parentMenu = new QMenu(menuButton);
+ QMenu * parentMenu = new QMenu(data->toolbar);
parentMenu->installEventFilter(data->toolbar);
parentMenu->setProperty(dfe_menu_, QVariant::fromValue(true));
- menuButton->setMenu(parentMenu);
- // Required for QToolButton::MenuButtonPopup.
- connect(menuButton, &QToolButton::pressed, menuButton, &QToolButton::showMenu);
- data->toolbar->addWidget(menuButton);
+ QAction *menuAction = new QAction(data->toolbar);
+ menuAction->setText(parentName);
+ menuAction->setMenu(parentMenu);
+ // QToolButton::MenuButtonPopup means that pressing the button text
+ // itself doesn't open the menu, only pressing the downwards pointing
+ // triangle does. This is difficult to change for the auto created
+ // QToolButton inside the QToolBar. But only auto created tool buttons
+ // will show up in the extension menu at narrow widths (#19887.)
+ data->toolbar->addAction(menuAction);
return findParentMenu(tree.mid(1), fed_data, parentMenu);
}
@@ -407,7 +407,7 @@ bool FilterExpressionToolBar::filter_expression_add_action(const void *key _U_,
struct filter_expression_data* data = (filter_expression_data*)user_data;
if (!fe->enabled)
- return FALSE;
+ return false;
QString label = QString(fe->label);
@@ -449,7 +449,7 @@ bool FilterExpressionToolBar::filter_expression_add_action(const void *key _U_,
connect(dfb_action, &QAction::triggered, data->toolbar, &FilterExpressionToolBar::filterClicked);
data->actions_added = true;
- return FALSE;
+ return false;
}
void FilterExpressionToolBar::filterClicked()
diff --git a/ui/qt/widgets/filter_expression_toolbar.h b/ui/qt/widgets/filter_expression_toolbar.h
index 80724a27..174d927b 100644
--- a/ui/qt/widgets/filter_expression_toolbar.h
+++ b/ui/qt/widgets/filter_expression_toolbar.h
@@ -9,8 +9,6 @@
#include <ui/qt/widgets/drag_drop_toolbar.h>
-#include <glib.h>
-
#include <QMenu>
#ifndef FILTER_EXPRESSION_TOOLBAR_H
diff --git a/ui/qt/widgets/follow_stream_text.cpp b/ui/qt/widgets/follow_stream_text.cpp
index a8e0f2b9..b2492c0b 100644
--- a/ui/qt/widgets/follow_stream_text.cpp
+++ b/ui/qt/widgets/follow_stream_text.cpp
@@ -9,10 +9,16 @@
#include <ui/qt/widgets/follow_stream_text.h>
+#include "epan/prefs.h"
+
+#include <ui/qt/utils/color_utils.h>
+
#include <main_application.h>
+#include <QMap>
#include <QMouseEvent>
#include <QTextCursor>
+#include <QScrollBar>
// To do:
// - Draw text by hand similar to ByteViewText. This would let us add
@@ -20,17 +26,96 @@
// max_document_length_ in FollowStreamDialog.
FollowStreamText::FollowStreamText(QWidget *parent) :
- QPlainTextEdit(parent)
+ QPlainTextEdit(parent), truncated_(false)
{
setMouseTracking(true);
// setMaximumBlockCount(1);
QTextDocument *text_doc = document();
text_doc->setDefaultFont(mainApp->monospaceFont());
+
+ metainfo_fg_ = ColorUtils::alphaBlend(palette().windowText(), palette().window(), 0.35);
+}
+
+const int FollowStreamText::max_document_length_ = 500 * 1000 * 1000; // Just a guess
+
+void FollowStreamText::addTruncated(int cur_pos)
+{
+ if (truncated_) {
+ QTextCharFormat tcf = currentCharFormat();
+ tcf.setBackground(palette().base().color());
+ tcf.setForeground(metainfo_fg_);
+ insertPlainText("\n" + tr("[Stream output truncated]"));
+ moveCursor(QTextCursor::End);
+ } else {
+ verticalScrollBar()->setValue(cur_pos);
+ }
+}
+
+void FollowStreamText::addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize)
+{
+ if (truncated_) {
+ return;
+ }
+
+ int char_count = document()->characterCount();
+ if (char_count + text.length() > max_document_length_) {
+ text.truncate(max_document_length_ - char_count);
+ truncated_ = true;
+ }
+
+ setUpdatesEnabled(false);
+ int cur_pos = verticalScrollBar()->value();
+ moveCursor(QTextCursor::End);
+
+ QTextCharFormat tcf = currentCharFormat();
+ if (!colorize) {
+ tcf.setBackground(palette().base().color());
+ tcf.setForeground(palette().text().color());
+ } else if (is_from_server) {
+ tcf.setForeground(ColorUtils::fromColorT(prefs.st_server_fg));
+ tcf.setBackground(ColorUtils::fromColorT(prefs.st_server_bg));
+ } else {
+ tcf.setForeground(ColorUtils::fromColorT(prefs.st_client_fg));
+ tcf.setBackground(ColorUtils::fromColorT(prefs.st_client_bg));
+ }
+ setCurrentCharFormat(tcf);
+
+ insertPlainText(text);
+ text_pos_to_packet_[textCursor().anchor()] = packet_num;
+
+ addTruncated(cur_pos);
+ setUpdatesEnabled(true);
+}
+
+void FollowStreamText::addDeltaTime(double delta)
+{
+ QString delta_str = QString("\n%1s").arg(QString::number(delta, 'f', 6));
+ if (truncated_) {
+ return;
+ }
+
+ if (document()->characterCount() + delta_str.length() > max_document_length_) {
+ truncated_ = true;
+ }
+
+ setUpdatesEnabled(false);
+ int cur_pos = verticalScrollBar()->value();
+ moveCursor(QTextCursor::End);
+
+ QTextCharFormat tcf = currentCharFormat();
+ tcf.setBackground(palette().base().color());
+ tcf.setForeground(metainfo_fg_);
+ setCurrentCharFormat(tcf);
+
+ insertPlainText(delta_str);
+
+ addTruncated(cur_pos);
+ setUpdatesEnabled(true);
}
void FollowStreamText::mouseMoveEvent(QMouseEvent *event)
{
- emit mouseMovedToTextCursorPosition(cursorForPosition(event->pos()).position());
+ emit mouseMovedToPacket(textPosToPacket(cursorForPosition(event->pos()).position()));
// Don't send the mouseMoveEvents with no buttons pushed to the base
// class, effectively turning off mouse tracking for the base class.
// It causes a lot of useless calculations that hurt scroll performance.
@@ -41,12 +126,37 @@ void FollowStreamText::mouseMoveEvent(QMouseEvent *event)
void FollowStreamText::mousePressEvent(QMouseEvent *event)
{
- emit mouseClickedOnTextCursorPosition(cursorForPosition(event->pos()).position());
+ emit mouseClickedOnPacket(textPosToPacket(cursorForPosition(event->pos()).position()));
QPlainTextEdit::mousePressEvent(event);
}
void FollowStreamText::leaveEvent(QEvent *event)
{
- emit mouseMovedToTextCursorPosition(-1);
+ emit mouseMovedToPacket(0);
QPlainTextEdit::leaveEvent(event);
}
+
+void FollowStreamText::clear()
+{
+ truncated_ = false;
+ text_pos_to_packet_.clear();
+ QPlainTextEdit::clear();
+}
+
+int FollowStreamText::currentPacket() const
+{
+ return textPosToPacket(textCursor().position());
+}
+
+int FollowStreamText::textPosToPacket(int text_pos) const
+{
+ int pkt = 0;
+ if (text_pos >= 0) {
+ QMap<int, uint32_t>::const_iterator it = text_pos_to_packet_.upperBound(text_pos);
+ if (it != text_pos_to_packet_.end()) {
+ pkt = it.value();
+ }
+ }
+
+ return pkt;
+}
diff --git a/ui/qt/widgets/follow_stream_text.h b/ui/qt/widgets/follow_stream_text.h
index 0dd8dca5..0276c872 100644
--- a/ui/qt/widgets/follow_stream_text.h
+++ b/ui/qt/widgets/follow_stream_text.h
@@ -17,6 +17,10 @@ class FollowStreamText : public QPlainTextEdit
Q_OBJECT
public:
explicit FollowStreamText(QWidget *parent = 0);
+ bool isTruncated() const { return truncated_; }
+ void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize);
+ void addDeltaTime(double delta);
+ int currentPacket() const;
protected:
void mouseMoveEvent(QMouseEvent *event);
@@ -24,12 +28,20 @@ protected:
void leaveEvent(QEvent *event);
signals:
- // Perhaps this is not descriptive enough. We should add more words.
- void mouseMovedToTextCursorPosition(int);
- void mouseClickedOnTextCursorPosition(int);
+ void mouseMovedToPacket(int);
+ void mouseClickedOnPacket(int);
public slots:
+ void clear();
+private:
+ int textPosToPacket(int text_pos) const;
+ void addTruncated(int cur_pos);
+
+ static const int max_document_length_;
+ bool truncated_;
+ QMap<int, uint32_t> text_pos_to_packet_;
+ QColor metainfo_fg_;
};
#endif // FOLLOW_STREAM_TEXT_H
diff --git a/ui/qt/widgets/label_stack.cpp b/ui/qt/widgets/label_stack.cpp
index 4cac15b7..8deedaec 100644
--- a/ui/qt/widgets/label_stack.cpp
+++ b/ui/qt/widgets/label_stack.cpp
@@ -68,9 +68,10 @@ void LabelStack::fillLabel() {
setStyleSheet(style_sheet);
}
setText(si.text);
+ setToolTip(si.tooltip);
}
-void LabelStack::pushText(const QString &text, int ctx) {
+void LabelStack::pushText(const QString &text, int ctx, const QString &tooltip) {
popText(ctx);
if (ctx == temporary_ctx_) {
@@ -83,6 +84,7 @@ void LabelStack::pushText(const QString &text, int ctx) {
StackItem si;
si.text = text;
+ si.tooltip = tooltip;
si.ctx = ctx;
labels_.prepend(si);
fillLabel();
diff --git a/ui/qt/widgets/label_stack.h b/ui/qt/widgets/label_stack.h
index 63657b74..27e41be1 100644
--- a/ui/qt/widgets/label_stack.h
+++ b/ui/qt/widgets/label_stack.h
@@ -21,7 +21,7 @@ class LabelStack : public QLabel
public:
explicit LabelStack(QWidget *parent = 0);
void setTemporaryContext(const int ctx);
- void pushText(const QString &text, int ctx);
+ void pushText(const QString &text, int ctx, const QString &tooltip = QString());
void setShrinkable(bool shrinkable = true);
protected:
@@ -35,6 +35,7 @@ protected:
private:
typedef struct _StackItem {
QString text;
+ QString tooltip;
int ctx;
} StackItem;
diff --git a/ui/qt/widgets/path_selection_edit.cpp b/ui/qt/widgets/path_selection_edit.cpp
index eb30f1d0..660a6f53 100644
--- a/ui/qt/widgets/path_selection_edit.cpp
+++ b/ui/qt/widgets/path_selection_edit.cpp
@@ -10,18 +10,18 @@
#include "config.h"
-#include "epan/prefs.h"
#include "ui/util.h"
#include <ui/qt/widgets/path_selection_edit.h>
#include "ui/qt/widgets/wireshark_file_dialog.h"
+#include "ui/qt/utils/qt_ui_utils.h"
#include <QHBoxLayout>
#include <QToolButton>
#include <QWidget>
#include <QLineEdit>
-PathSelectionEdit::PathSelectionEdit(QString title, QString path, bool selectFile, QWidget *parent) :
+PathSelectionEdit::PathSelectionEdit(QString title, QString path, bool selectFile, QWidget *parent) :
QWidget(parent)
{
_title = title;
@@ -49,7 +49,7 @@ PathSelectionEdit::PathSelectionEdit(QString title, QString path, bool selectFil
setFocusPolicy(_edit->focusPolicy());
}
-PathSelectionEdit::PathSelectionEdit(QWidget *parent) :
+PathSelectionEdit::PathSelectionEdit(QWidget *parent) :
PathSelectionEdit(tr("Select a path"), QString(), true, parent)
{}
@@ -75,11 +75,7 @@ void PathSelectionEdit::browseForPath()
QString openDir = _path;
if (openDir.isEmpty()) {
- if (prefs.gui_fileopen_style == FO_STYLE_LAST_OPENED) {
- openDir = QString(get_open_dialog_initial_dir());
- } else if (prefs.gui_fileopen_style == FO_STYLE_SPECIFIED) {
- openDir = QString(prefs.gui_fileopen_dir);
- }
+ openDir = openDialogInitialDir();
}
QString newPath;
diff --git a/ui/qt/widgets/profile_tree_view.cpp b/ui/qt/widgets/profile_tree_view.cpp
index afa86d71..ebac67c7 100644
--- a/ui/qt/widgets/profile_tree_view.cpp
+++ b/ui/qt/widgets/profile_tree_view.cpp
@@ -7,31 +7,28 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
-#include <ui/qt/models/url_link_delegate.h>
#include <ui/qt/models/profile_model.h>
#include <ui/qt/utils/qt_ui_utils.h>
+#include <ui/qt/widgets/display_filter_edit.h>
#include <ui/qt/widgets/profile_tree_view.h>
#include <QDesktopServices>
#include <QDir>
+#include <QHeaderView>
#include <QItemDelegate>
#include <QLineEdit>
-#include <QUrl>
-ProfileUrlLinkDelegate::ProfileUrlLinkDelegate(QObject *parent) : UrlLinkDelegate (parent) {}
+ProfileTreeEditDelegate::ProfileTreeEditDelegate(QWidget *parent) : QItemDelegate(parent), editor_(Q_NULLPTR) {}
-void ProfileUrlLinkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+QWidget *ProfileTreeEditDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const
{
- /* Only paint links for valid paths */
- if (index.data(ProfileModel::DATA_PATH_IS_NOT_DESCRIPTION).toBool())
- UrlLinkDelegate::paint(painter, option, index);
- else
- QStyledItemDelegate::paint(painter, option, index);
-
+ if (index.column() == ProfileModel::COL_AUTO_SWITCH_FILTER) {
+ return new DisplayFilterEdit(parent);
+ }
+ return QItemDelegate::createEditor(parent, option, index);
}
-ProfileTreeEditDelegate::ProfileTreeEditDelegate(QWidget *parent) : QItemDelegate(parent), editor_(Q_NULLPTR) {}
-
void ProfileTreeEditDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
{
if (qobject_cast<QLineEdit *>(editor))
@@ -46,8 +43,8 @@ ProfileTreeView::ProfileTreeView(QWidget *parent) :
{
delegate_ = new ProfileTreeEditDelegate();
setItemDelegateForColumn(ProfileModel::COL_NAME, delegate_);
+ setItemDelegateForColumn(ProfileModel::COL_AUTO_SWITCH_FILTER, delegate_);
- connect(this, &QAbstractItemView::clicked, this, &ProfileTreeView::clicked);
connect(delegate_, &ProfileTreeEditDelegate::commitData, this, &ProfileTreeView::itemUpdated);
}
@@ -80,19 +77,6 @@ void ProfileTreeView::selectionChanged(const QItemSelection &selected, const QIt
}
}
-void ProfileTreeView::clicked(const QModelIndex &index)
-{
- if (!index.isValid())
- return;
-
- /* Only paint links for valid paths */
- if (index.data(ProfileModel::DATA_INDEX_VALUE_IS_URL).toBool())
- {
- QString path = QDir::toNativeSeparators(index.data().toString());
- QDesktopServices::openUrl(QUrl::fromLocalFile(path));
- }
-}
-
void ProfileTreeView::selectRow(int row)
{
if (row < 0)
@@ -117,3 +101,30 @@ bool ProfileTreeView::activeEdit()
{
return (state() == QAbstractItemView::EditingState);
}
+
+// If our auto switch filters are shorter than the filter column title,
+// stretch the name column.
+void ProfileTreeView::showEvent(QShowEvent *)
+{
+ bool have_wide_filter = false;
+ int auto_switch_title_width = fontMetrics().horizontalAdvance(model()->headerData(ProfileModel::COL_AUTO_SWITCH_FILTER, Qt::Horizontal).toString());
+ for (int row = 0; row < model()->rowCount(); row++) {
+ QString filter = model()->data(model()->index(row, ProfileModel::COL_AUTO_SWITCH_FILTER)).toString();
+ if (fontMetrics().horizontalAdvance(filter) > auto_switch_title_width) {
+ have_wide_filter = true;
+ break;
+ }
+ }
+
+ if (have_wide_filter) {
+ return;
+ }
+
+ int col_name_size_hint = sizeHintForColumn(ProfileModel::COL_NAME);
+ int col_asf_size_hint = qMax(header()->sectionSizeHint(ProfileModel::COL_AUTO_SWITCH_FILTER), sizeHintForColumn(ProfileModel::COL_AUTO_SWITCH_FILTER));
+ int extra = columnWidth(ProfileModel::COL_AUTO_SWITCH_FILTER) - col_asf_size_hint;
+ if (extra > 0) {
+ setColumnWidth(ProfileModel::COL_NAME, col_name_size_hint + extra);
+ }
+
+}
diff --git a/ui/qt/widgets/profile_tree_view.h b/ui/qt/widgets/profile_tree_view.h
index 9684811e..02492e4b 100644
--- a/ui/qt/widgets/profile_tree_view.h
+++ b/ui/qt/widgets/profile_tree_view.h
@@ -15,16 +15,6 @@
#include <QTreeView>
#include <QItemDelegate>
-class ProfileUrlLinkDelegate : public UrlLinkDelegate
-{
- Q_OBJECT
-
-public:
- explicit ProfileUrlLinkDelegate(QObject *parent = Q_NULLPTR);
-
- virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
-};
-
class ProfileTreeEditDelegate : public QItemDelegate
{
Q_OBJECT
@@ -32,6 +22,7 @@ public:
ProfileTreeEditDelegate(QWidget *parent = Q_NULLPTR);
// QAbstractItemDelegate interface
+ QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
private:
@@ -54,12 +45,12 @@ signals:
// QWidget interface
protected:
+ virtual void showEvent(QShowEvent *);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
// QAbstractItemView interface
protected slots:
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
- virtual void clicked(const QModelIndex &index);
private:
ProfileTreeEditDelegate *delegate_;
diff --git a/ui/qt/widgets/qcp_axis_ticker_elided.cpp b/ui/qt/widgets/qcp_axis_ticker_elided.cpp
new file mode 100644
index 00000000..154a750a
--- /dev/null
+++ b/ui/qt/widgets/qcp_axis_ticker_elided.cpp
@@ -0,0 +1,74 @@
+/** @file
+ *
+ * QCustomPlot QCPAxisTickerText subclass that elides labels to the
+ * width of the parent QCPAxis's QCPAxisRect's margin for the appropriate
+ * side, for use when the margin is fixed.
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <ui/qt/widgets/qcp_axis_ticker_elided.h>
+
+#include <QFontMetrics>
+
+QCPAxisTickerElided::QCPAxisTickerElided(QCPAxis *parent) :
+ mParent(parent)
+{
+}
+
+QCP::MarginSide QCPAxisTickerElided::axisTypeToMarginSide(const QCPAxis::AxisType axis)
+{
+ switch (axis) {
+ case QCPAxis::atLeft:
+ return QCP::msLeft;
+ case QCPAxis::atRight:
+ return QCP::msRight;
+ case QCPAxis::atTop:
+ return QCP::msTop;
+ case QCPAxis::atBottom:
+ return QCP::msBottom;
+ }
+ return QCP::msNone;
+}
+
+QString QCPAxisTickerElided::elidedText(const QString& text)
+{
+ QCP::MarginSides autoMargins = mParent->axisRect()->autoMargins();
+ if (autoMargins & axisTypeToMarginSide(mParent->axisType())) {
+ return text;
+ }
+ int elide_w;
+ QMargins margins = mParent->axisRect()->margins();
+ switch (mParent->axisType()) {
+ case QCPAxis::atLeft:
+ elide_w = margins.left();
+ break;
+ case QCPAxis::atRight:
+ elide_w = margins.right();
+ break;
+ case QCPAxis::atTop:
+ elide_w = margins.top();
+ break;
+ case QCPAxis::atBottom:
+ elide_w = margins.bottom();
+ break;
+ default:
+ // ??
+ elide_w = margins.left();
+ }
+
+ return QFontMetrics(mParent->tickLabelFont()).elidedText(text,
+ Qt::ElideRight,
+ elide_w);
+}
+
+QString QCPAxisTickerElided::getTickLabel(double tick, const QLocale& , QChar , int)
+{
+ return elidedText(mTicks.value(tick));
+}
diff --git a/ui/qt/widgets/qcp_axis_ticker_elided.h b/ui/qt/widgets/qcp_axis_ticker_elided.h
new file mode 100644
index 00000000..b542d9a9
--- /dev/null
+++ b/ui/qt/widgets/qcp_axis_ticker_elided.h
@@ -0,0 +1,38 @@
+/** @file
+ *
+ * QCustomPlot QCPAxisTickerText subclass that elides labels to the
+ * width of the parent QCPAxis's QCPAxisRect's margin for the appropriate
+ * side, for use when the margin is fixed.
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QCP_AXIS_TICKER_ELIDED_H
+#define QCP_AXIS_TICKER_ELIDED_H
+
+#include <ui/qt/widgets/qcustomplot.h>
+
+class QCPAxisTickerElided : public QCPAxisTickerText
+{
+public:
+ explicit QCPAxisTickerElided(QCPAxis *parent);
+
+ // QCP has marginSideToAxisType but not the inverse
+ static QCP::MarginSide axisTypeToMarginSide(const QCPAxis::AxisType);
+
+ QString elidedText(const QString& text);
+
+protected:
+ virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) override;
+
+private:
+ QCPAxis *mParent;
+};
+
+#endif
diff --git a/ui/qt/widgets/qcp_axis_ticker_si.cpp b/ui/qt/widgets/qcp_axis_ticker_si.cpp
new file mode 100644
index 00000000..be6d35a6
--- /dev/null
+++ b/ui/qt/widgets/qcp_axis_ticker_si.cpp
@@ -0,0 +1,74 @@
+/** @file
+ *
+ * QCustomPlot QCPAxisTicker subclass that creates human-readable
+ * SI unit labels, optionally supporting log scale.
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <cmath>
+
+#include <ui/qt/widgets/qcp_axis_ticker_si.h>
+#include <ui/qt/utils/qt_ui_utils.h>
+
+#include <wsutil/str_util.h>
+
+QCPAxisTickerSi::QCPAxisTickerSi(format_size_units_e unit, QString customUnit, bool log) :
+ mUnit(unit), mCustomUnit(customUnit), mLog(log)
+{
+}
+
+QString QCPAxisTickerSi::getTickLabel(double tick, const QLocale& , QChar , int precision)
+{
+ QString label = gchar_free_to_qstring(format_units(nullptr, tick, mUnit, FORMAT_SIZE_PREFIX_SI, precision));
+
+ // XXX - format_units isn't consistent about whether we need to
+ // add a space or not
+ if (mUnit == FORMAT_SIZE_UNIT_NONE && !mCustomUnit.isEmpty()) {
+ label += mCustomUnit;
+ }
+ // XXX - "Beautiful typeset powers" for exponentials is handled by QCPAxis,
+ // not QCPAxisTicker and its subclasses, and its detection of exponentials
+ // doesn't handle having a unit or other suffix, so that won't work.
+ // In practical use we'll be within our prefix range, though.
+ return label;
+}
+
+int QCPAxisTickerSi::getSubTickCount(double tickStep)
+{
+ if (mLog) {
+ return QCPAxisTickerLog::getSubTickCount(tickStep);
+ } else {
+ return QCPAxisTicker::getSubTickCount(tickStep);
+ }
+}
+
+QVector<double> QCPAxisTickerSi::createTickVector(double tickStep, const QCPRange &range)
+{
+ if (mLog) {
+ return QCPAxisTickerLog::createTickVector(tickStep, range);
+ } else {
+ return QCPAxisTicker::createTickVector(tickStep, range);
+ }
+}
+
+void QCPAxisTickerSi::setUnit(format_size_units_e unit)
+{
+ mUnit = unit;
+}
+
+void QCPAxisTickerSi::setCustomUnit(QString unit)
+{
+ mCustomUnit = unit;
+}
+
+void QCPAxisTickerSi::setLog(bool log)
+{
+ mLog = log;
+}
diff --git a/ui/qt/widgets/qcp_axis_ticker_si.h b/ui/qt/widgets/qcp_axis_ticker_si.h
new file mode 100644
index 00000000..a9fa51cc
--- /dev/null
+++ b/ui/qt/widgets/qcp_axis_ticker_si.h
@@ -0,0 +1,42 @@
+/** @file
+ *
+ * QCustomPlot QCPAxisTicker subclass that creates human-readable
+ * SI unit labels, optionally supporting log scale.
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QCP_AXIS_TICKER_SI_H
+#define QCP_AXIS_TICKER_SI_H
+
+#include <ui/qt/widgets/qcustomplot.h>
+
+#include <wsutil/str_util.h>
+
+class QCPAxisTickerSi : public QCPAxisTickerLog
+{
+public:
+ explicit QCPAxisTickerSi(format_size_units_e unit = FORMAT_SIZE_UNIT_PACKETS, QString customUnit = QString(), bool log = false);
+
+ format_size_units_e getUnit() const { return mUnit; }
+ void setUnit(format_size_units_e unit);
+ void setCustomUnit(QString unit);
+ void setLog(bool log);
+
+protected:
+ virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) override;
+ virtual int getSubTickCount(double tickStep) override;
+ virtual QVector<double> createTickVector(double tickStep, const QCPRange &range) override;
+
+ format_size_units_e mUnit;
+ QString mCustomUnit;
+ bool mLog;
+};
+
+#endif
diff --git a/ui/qt/widgets/qcp_string_legend_item.cpp b/ui/qt/widgets/qcp_string_legend_item.cpp
new file mode 100644
index 00000000..62596895
--- /dev/null
+++ b/ui/qt/widgets/qcp_string_legend_item.cpp
@@ -0,0 +1,46 @@
+/** @file
+ *
+ * QCustomPlot QCPAbstractLegendItem subclass containing a string.
+ * This is used to add a title to a QCPLegend.
+ *
+ * This file is from https://www.qcustomplot.com/index.php/support/forum/443
+ * where the author David said "I thought I would share in case any one else
+ * is needing the same functionality." Accordingly, this file is in the
+ * public domain.
+ */
+
+#include <ui/qt/widgets/qcp_string_legend_item.h>
+
+QCPStringLegendItem::QCPStringLegendItem(QCPLegend *pParent, const QString& strText)
+ : QCPAbstractLegendItem(pParent)
+ , m_strText(strText)
+{
+}
+
+QString QCPStringLegendItem::text() const
+{
+ return m_strText;
+}
+
+void QCPStringLegendItem::setText(const QString& strText)
+{
+ m_strText = strText;
+}
+
+void QCPStringLegendItem::draw(QCPPainter *pPainter)
+{
+ pPainter->setFont(mFont);
+ pPainter->setPen(QPen(mTextColor));
+ QRectF textRect = pPainter->fontMetrics().boundingRect(0, 0, 0, 0, Qt::TextDontClip, m_strText);
+ pPainter->drawText(mRect.x() + mMargins.left(), mRect.y(), textRect.width(), textRect.height(), Qt::TextDontClip | Qt::AlignHCenter, m_strText);
+}
+
+QSize QCPStringLegendItem::minimumOuterSizeHint() const
+{
+ QSize cSize(0, 0);
+ QFontMetrics fontMetrics(mFont);
+ QRect textRect = fontMetrics.boundingRect(0, 0, 0, 0, Qt::TextDontClip, m_strText);
+ cSize.setWidth(textRect.width() + mMargins.left() + mMargins.right());
+ cSize.setHeight(textRect.height() + mMargins.top() + mMargins.bottom());
+ return cSize;
+}
diff --git a/ui/qt/widgets/qcp_string_legend_item.h b/ui/qt/widgets/qcp_string_legend_item.h
new file mode 100644
index 00000000..d32631ad
--- /dev/null
+++ b/ui/qt/widgets/qcp_string_legend_item.h
@@ -0,0 +1,35 @@
+/** @file
+ *
+ * QCustomPlot QCPAbstractLegendItem subclass containing a string.
+ * This is used to add a title to a QCPLegend.
+ *
+ * This file is from https://www.qcustomplot.com/index.php/support/forum/443
+ * where the author David said "I thought I would share in case any one else
+ * is needing the same functionality." Accordingly, this file is in the
+ * public domain.
+ */
+
+#ifndef QCP_STRING_LEGEND_ITEM_H
+#define QCP_STRING_LEGEND_ITEM_H
+
+#include <ui/qt/widgets/qcustomplot.h>
+
+class QCPStringLegendItem : public QCPAbstractLegendItem
+{
+ Q_OBJECT
+
+public:
+ explicit QCPStringLegendItem(QCPLegend *pParent, const QString& strText);
+
+ QString text() const;
+ void setText(const QString& strText);
+
+protected:
+ virtual void draw(QCPPainter *painter) override;
+ virtual QSize minimumOuterSizeHint() const override;
+
+private:
+ QString m_strText;
+};
+
+#endif
diff --git a/ui/qt/widgets/resize_header_view.cpp b/ui/qt/widgets/resize_header_view.cpp
new file mode 100644
index 00000000..7335265f
--- /dev/null
+++ b/ui/qt/widgets/resize_header_view.cpp
@@ -0,0 +1,45 @@
+/** @file
+ *
+ * Header view with a context menu to resize all sections to contents
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "resize_header_view.h"
+
+#include <QMenu>
+#include <QContextMenuEvent>
+
+ResizeHeaderView::ResizeHeaderView(Qt::Orientation orientation, QWidget *parent) : QHeaderView(orientation, parent)
+{
+ setStretchLastSection(true);
+ setSectionsMovable(true);
+ // setFirstSectionMovable(true) ?
+}
+
+/*!
+ \fn void ResizeHeaderView::contextMenuEvent(QContextMenuEvent *e)
+
+ Shows a context menu which resizes all sections to their contents.
+ */
+
+void ResizeHeaderView::contextMenuEvent(QContextMenuEvent *e)
+{
+ if (e == nullptr)
+ return;
+
+ QMenu *ctxMenu = new QMenu(this);
+ ctxMenu->setAttribute(Qt::WA_DeleteOnClose);
+
+ QString text = tr("Resize all %1 to contents").arg((orientation() == Qt::Horizontal) ? "columns" : "rows");
+ QAction *act = ctxMenu->addAction(std::move(text));
+ connect(act, &QAction::triggered, this, [&]() { resizeSections(QHeaderView::ResizeToContents); });
+
+ ctxMenu->popup(e->globalPos());
+}
diff --git a/ui/qt/widgets/resize_header_view.h b/ui/qt/widgets/resize_header_view.h
new file mode 100644
index 00000000..a8aa57f3
--- /dev/null
+++ b/ui/qt/widgets/resize_header_view.h
@@ -0,0 +1,31 @@
+/** @file
+ *
+ * Header view with a context menu to resize all sections to contents
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef RESIZE_HEADER_VIEW_H
+#define RESIZE_HEADER_VIEW_H
+
+#include <config.h>
+#include <QHeaderView>
+
+class ResizeHeaderView : public QHeaderView
+{
+ Q_OBJECT
+
+public:
+ ResizeHeaderView(Qt::Orientation orientation, QWidget *parent = nullptr);
+
+protected:
+ void contextMenuEvent(QContextMenuEvent *e) override;
+
+};
+#endif // RESIZE_HEADER_VIEW_H
diff --git a/ui/qt/widgets/resolved_addresses_view.cpp b/ui/qt/widgets/resolved_addresses_view.cpp
new file mode 100644
index 00000000..82b2a299
--- /dev/null
+++ b/ui/qt/widgets/resolved_addresses_view.cpp
@@ -0,0 +1,261 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <config.h>
+#define WS_LOG_DOMAIN LOG_DOMAIN_QTUI
+
+#include <ui/qt/widgets/resolved_addresses_view.h>
+#include <ui/qt/models/resolved_addresses_models.h>
+#include <ui/qt/widgets/wireshark_file_dialog.h>
+
+#include <QHeaderView>
+#include <QMessageBox>
+#include <QClipboard>
+#include <QTextStream>
+#include <QJsonArray>
+#include <QJsonObject>
+#include <QJsonDocument>
+#include <QContextMenuEvent>
+
+#include "main_application.h"
+
+#include <wsutil/wslog.h>
+
+ResolvedAddressesView::ResolvedAddressesView(QWidget *parent) : QTableView(parent)
+{
+ setEditTriggers(QAbstractItemView::NoEditTriggers);
+ setSortingEnabled(true);
+ setSelectionBehavior(QAbstractItemView::SelectRows);
+ horizontalHeader()->setStretchLastSection(true);
+ verticalHeader()->setVisible(false);
+
+ // creating this action is mostly to override the default Ctrl-C handling
+ // (which could also be done by overriding KeyPressEvent) and to make the
+ // keyboard shortcut show up in the context menu.
+#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)
+ clip_action_ = new QAction(tr("as Plain Text"), this);
+ clip_action_->setShortcut(QKeySequence(QKeySequence::Copy));
+ connect(clip_action_, &QAction::triggered, this, &ResolvedAddressesView::clipboardAction);
+ addAction(clip_action_);
+#else
+ clip_action_ = addAction(tr("as Plain Text"), QKeySequence(QKeySequence::Copy), this, &ResolvedAddressesView::clipboardAction);
+#endif
+ clip_action_->setProperty("copy_as", ResolvedAddressesView::EXPORT_TEXT);
+ clip_action_->setProperty("selected", true);
+}
+
+QMenu* ResolvedAddressesView::createCopyMenu(bool selected, QWidget *parent)
+{
+ QMenu *copy_menu;
+ if (selected) {
+ copy_menu = new QMenu(tr("Copy selected rows"), parent);
+ } else {
+ copy_menu = new QMenu(tr("Copy table"), parent);
+ }
+ copy_menu->setIcon(QIcon::fromTheme(QStringLiteral("edit-copy")));
+ QAction *ca;
+ if (selected) {
+ copy_menu->addAction(clip_action_);
+ } else {
+ ca = copy_menu->addAction(tr("as Plain Text"), this, &ResolvedAddressesView::clipboardAction);
+ ca->setProperty("copy_as", ResolvedAddressesView::EXPORT_TEXT);
+ ca->setProperty("selected", selected);
+ }
+ ca = copy_menu->addAction(tr("as CSV"), this, &ResolvedAddressesView::clipboardAction);
+ ca->setProperty("copy_as", ResolvedAddressesView::EXPORT_CSV);
+ ca->setProperty("selected", selected);
+ ca = copy_menu->addAction(tr("as JSON"), this, &ResolvedAddressesView::clipboardAction);
+ ca->setProperty("copy_as", ResolvedAddressesView::EXPORT_JSON);
+ ca->setProperty("selected", selected);
+
+ return copy_menu;
+}
+
+void ResolvedAddressesView::contextMenuEvent(QContextMenuEvent *e)
+{
+ if (!e)
+ return;
+
+ QMenu *ctxMenu = new QMenu(this);
+ ctxMenu->setAttribute(Qt::WA_DeleteOnClose);
+ ctxMenu->addMenu(createCopyMenu(true, ctxMenu));
+ QAction *act = ctxMenu->addAction(tr("Save selected rows as…"));
+ act->setIcon(QIcon::fromTheme(QStringLiteral("document-save-as")));
+ act->setProperty("selected", true);
+ connect(act, &QAction::triggered, this, &ResolvedAddressesView::saveAs);
+ ctxMenu->addSeparator();
+ ctxMenu->addMenu(createCopyMenu(false, ctxMenu));
+ act = ctxMenu->addAction(QIcon::fromTheme(QStringLiteral("document-save-as")), tr("Save table as…"), this, &ResolvedAddressesView::saveAs);
+ act->setProperty("selected", false);
+
+ ctxMenu->popup(e->globalPos());
+}
+
+AStringListListModel* ResolvedAddressesView::dataModel() const
+{
+ QSortFilterProxyModel *proxy = qobject_cast<QSortFilterProxyModel *>(model());
+
+ if (proxy) {
+ QAbstractItemModel *source = proxy->sourceModel();
+ while (qobject_cast<QSortFilterProxyModel *>(source) != nullptr) {
+ proxy = qobject_cast<QSortFilterProxyModel *>(source);
+ source = proxy->sourceModel();
+ }
+ return qobject_cast<AStringListListModel *>(source);
+ }
+ return nullptr;
+}
+
+void ResolvedAddressesView::clipboardAction()
+{
+ QAction *ca = qobject_cast<QAction *>(sender());
+ if (ca && ca->property("copy_as").isValid()) {
+ copyToClipboard(static_cast<eResolvedAddressesExport>(ca->property("copy_as").toInt()),
+ ca->property("selected").toBool());
+ }
+}
+
+void ResolvedAddressesView::copyToClipboard(eResolvedAddressesExport format, bool selected)
+{
+ QString clipText;
+ QTextStream stream(&clipText, QIODevice::Text);
+ toTextStream(stream, format, selected);
+ mainApp->clipboard()->setText(stream.readAll());
+}
+
+void ResolvedAddressesView::saveAs()
+{
+ bool selected = false;
+ QAction *ca = qobject_cast<QAction *>(sender());
+ if (ca && ca->property("selected").isValid()) {
+ selected = true;
+ }
+ QString caption(mainApp->windowTitleString(tr("Save Resolved Addresses As…")));
+ QString txtFilter = tr("Plain text (*.txt)");
+ QString csvFilter = tr("CSV Document (*.csv)");
+ QString jsonFilter = tr("JSON Document (*.json)");
+ QString selectedFilter;
+ QString fileName = WiresharkFileDialog::getSaveFileName(this, caption,
+ mainApp->openDialogInitialDir().canonicalPath(),
+ QString("%1;;%2;;%3").arg(txtFilter).arg(csvFilter).arg(jsonFilter),
+ &selectedFilter);
+ if (fileName.isEmpty()) {
+ return;
+ }
+
+ eResolvedAddressesExport format(EXPORT_TEXT);
+ if (selectedFilter.compare(csvFilter) == 0) {
+ format = EXPORT_CSV;
+ } else if (selectedFilter.compare(jsonFilter) == 0) {
+ format = EXPORT_JSON;
+ }
+
+ // macOS and Windows use the native file dialog, which enforces file
+ // extensions. UN*X dialogs generally don't. That's ok here, at
+ // least for the text format, because hosts and ethers and services
+ // files don't have an extension.
+ QFile saveFile(fileName);
+ if (saveFile.open(QFile::WriteOnly | QFile::Text)) {
+ QTextStream stream(&saveFile);
+ toTextStream(stream, format, selected);
+ saveFile.close();
+ } else {
+ QMessageBox::warning(this, tr("Warning").arg(saveFile.fileName()),
+ tr("Unable to save %1: %2").arg(saveFile.fileName().arg(saveFile.errorString())));
+ }
+}
+
+
+void ResolvedAddressesView::toTextStream(QTextStream& stream,
+ eResolvedAddressesExport format, bool selected) const
+{
+ if (model() == nullptr) {
+ return;
+ }
+
+ // XXX: TrafficTree and TapParameterDialog have similar
+ // "export a QAbstractItemModel to a QTextStream in TEXT, CSV or JSON"
+ // functions that could be made into common code.
+ QStringList rowText;
+ if (format == EXPORT_TEXT) {
+ if (qobject_cast<PortsModel*>(dataModel()) != nullptr) {
+ // Format of services(5)
+ if (!selected) {
+ stream << "# service-name\tport/protocol\n";
+ }
+ for (int row = 0; row < model()->rowCount(); row++) {
+ if (selected && !selectionModel()->isRowSelected(row, QModelIndex())) continue;
+ rowText.clear();
+ rowText << model()->data(model()->index(row, PORTS_COL_NAME)).toString();
+ rowText << QString("%1/%2")
+ .arg(model()->data(model()->index(row, PORTS_COL_PORT)).toString())
+ .arg(model()->data(model()->index(row, PORTS_COL_PROTOCOL)).toString());
+ stream << rowText.join("\t") << "\n";
+ }
+ } else {
+ // Format as hosts(5) and ethers(5)
+ if (!selected) {
+ for (int col = 0; col < model()->columnCount(); col++) {
+ rowText << model()->headerData(col, Qt::Horizontal).toString();
+ }
+ stream << "# " << rowText.join("\t") << "\n";
+ }
+ for (int row = 0; row < model()->rowCount(); row++) {
+ if (selected && !selectionModel()->isRowSelected(row, QModelIndex())) continue;
+ rowText.clear();
+ for (int col = 0; col < model()->columnCount(); col++) {
+ rowText << model()->data(model()->index(row, col)).toString();
+ }
+ stream << rowText.join("\t") << "\n";
+ }
+ }
+ } else if (format == EXPORT_CSV) {
+ for (int col = 0; col < model()->columnCount(); col++) {
+ rowText << model()->headerData(col, Qt::Horizontal).toString();
+ }
+ if (!selected) {
+ stream << rowText.join(",") << "\n";
+ }
+ for (int row = 0; row < model()->rowCount(); row++) {
+ if (selected && !selectionModel()->isRowSelected(row, QModelIndex())) continue;
+ rowText.clear();
+ for (int col = 0; col < model()->columnCount(); col++) {
+ QVariant v = model()->data(model()->index(row, col));
+ if (!v.isValid()) {
+ rowText << QStringLiteral("\"\"");
+ } else if (v.userType() == QMetaType::QString) {
+ rowText << QString("\"%1\"").arg(v.toString().replace('\"', "\"\""));
+ } else {
+ rowText << v.toString();
+ }
+ }
+ stream << rowText.join(",") << "\n";
+ }
+ } else if (format == EXPORT_JSON) {
+ QMap<int, QString> headers;
+ for (int col = 0; col < model()->columnCount(); col++)
+ headers.insert(col, model()->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString());
+
+ QJsonArray records;
+
+ for (int row = 0; row < model()->rowCount(); row++) {
+ if (selected && !selectionModel()->isRowSelected(row, QModelIndex())) continue;
+ QJsonObject rowData;
+ foreach(int col, headers.keys()) {
+ QModelIndex idx = model()->index(row, col);
+ rowData.insert(headers[col], model()->data(idx).toString());
+ }
+ records.push_back(rowData);
+ }
+
+ QJsonDocument json;
+ json.setArray(records);
+ stream << json.toJson();
+ }
+}
diff --git a/ui/qt/widgets/resolved_addresses_view.h b/ui/qt/widgets/resolved_addresses_view.h
new file mode 100644
index 00000000..23fb707f
--- /dev/null
+++ b/ui/qt/widgets/resolved_addresses_view.h
@@ -0,0 +1,50 @@
+/** @file
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef RESOLVED_ADDRESSES_VIEW_H
+#define RESOLVED_ADDRESSES_VIEW_H
+
+#include <ui/qt/models/resolved_addresses_models.h>
+
+#include <QTableView>
+#include <QMenu>
+
+class ResolvedAddressesView : public QTableView
+{
+ Q_OBJECT
+
+public:
+ typedef enum {
+ EXPORT_TEXT,
+ EXPORT_CSV,
+ EXPORT_JSON
+ } eResolvedAddressesExport;
+
+ ResolvedAddressesView(QWidget *parent = nullptr);
+
+ QMenu* createCopyMenu(bool selected = false, QWidget *parent = nullptr);
+
+public slots:
+ void saveAs();
+
+protected:
+ void contextMenuEvent(QContextMenuEvent *e) override;
+
+private:
+ QAction *clip_action_;
+
+ AStringListListModel* dataModel() const;
+ void copyToClipboard(eResolvedAddressesExport format, bool selected);
+
+private slots:
+ void clipboardAction();
+ void toTextStream(QTextStream &stream, eResolvedAddressesExport format, bool selected = false) const;
+};
+
+#endif // RESOLVED_ADDRESSES_VIEW_H
diff --git a/ui/qt/widgets/rowmove_tree_view.cpp b/ui/qt/widgets/rowmove_tree_view.cpp
new file mode 100644
index 00000000..fa91b28e
--- /dev/null
+++ b/ui/qt/widgets/rowmove_tree_view.cpp
@@ -0,0 +1,98 @@
+/* @file
+ * Tree view that uses the model's moveRows(), if implemented, to
+ * support internalMoves. The model must also have Qt::MoveAction
+ * among the supportedDropActions, and its item flags must allow drag
+ * and drop.
+ *
+ * The normal Qt Drag and Drop approach for moves involves inserting a
+ * new row and removing the original row. That has greater generality,
+ * but works poorly for views like the I/O Graphs Dialog where a newly
+ * inserted row would require an expensive retap.
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "rowmove_tree_view.h"
+
+#include <QDropEvent>
+
+RowMoveTreeView::RowMoveTreeView(QWidget *parent) : TabnavTreeView(parent)
+{
+ // QTreeViews default to row selection.
+ // setSelectionMode(QAbstractItemView::ContiguousSelection);
+ // ContiguousSelection works, but we probably want to make sure
+ // that the models we use this for can handle removing multiple
+ // rows (and that the dialogs support doing that.)
+ setDropIndicatorShown(true);
+ // We could override dragMoveEvent to have the dropIndicator cover
+ // the entire row.
+ setDragDropMode(QAbstractItemView::InternalMove);
+ // Classes can change this if they also support other drag and drop
+ // modes.
+}
+
+void RowMoveTreeView::dropEvent(QDropEvent *event)
+{
+ if (event->source() == this && (event->possibleActions() & Qt::MoveAction) && !event->isAccepted()) {
+
+ const QModelIndexList sourceIndices = selectionModel()->selectedRows();
+
+ if (sourceIndices.empty()) {
+ TabnavTreeView::dropEvent(event);
+ return;
+ }
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QModelIndex destIndex = indexAt(event->position().toPoint());
+#else
+ QModelIndex destIndex = indexAt(event->pos());
+#endif
+ if (!destIndex.isValid() || destIndex.row() == -1) {
+ destIndex = model()->index(model()->rowCount() - 1, 0);
+ }
+ // dropIndicatorPosition() can be used to determine if we're slightly
+ // above the item, slightly below the item, on top, or elsewhere in
+ // the viewPort. We will just use the row number, table-like.
+ // Note that if we setDragDropOverwriteMode(true) then there wouldn't
+ // be graphical hints in between rows, but that could cause issues
+ // if we added non internalMove handling; overriding dragMoveEvent
+ // could also change it.
+
+ const auto minmaxIndex = std::minmax_element(sourceIndices.begin(), sourceIndices.end(),
+ [](const QModelIndex &a, const QModelIndex &b)
+ { return a.row() < b.row(); }
+ );
+
+ // Only allow a contiguous selection. (This check is unnecessary
+ // if the selectionMode is SingleSelection or ContiguousSelection.)
+ // We could handle multiple ranges with multiple moveRows() calls
+ // and QPersistentModelIndexes in place of the QModelIndexes, but
+ // it gets a little confusing, especially if some indices are above
+ // the target row and some are below (the default behavior would be
+ // to move all the indices above to immediately below, and vice versa.)
+ // Microsoft Excel doesn't allow row moves unless the selected
+ // rows are contiguous, and has an alert.
+ //
+ // Note that selectionModel()->selection()->size() is *not*
+ // guaranteed to be the minimal merged number of possible ranges
+ // if the selection order was unusual, so we can't just use it.
+ if ((minmaxIndex.second->row() - minmaxIndex.first->row() + 1) == sourceIndices.size()) {
+ if (model()->moveRows(QModelIndex(), minmaxIndex.first->row(), static_cast<int>(sourceIndices.size()), QModelIndex(), destIndex.row())) {
+ // Prevent QAbstractItemView from removing the sourceIndices
+ // There's an element in the private class (dropEventMoved)
+ // that QTreeWidget and QTableWidget use via the d-pointer,
+ // but as long as the action is no longer a MoveAction when
+ // it returns it won't get removed.
+ event->setDropAction(Qt::IgnoreAction);
+ event->accept();
+ }
+ }
+ }
+ TabnavTreeView::dropEvent(event);
+}
diff --git a/ui/qt/widgets/rowmove_tree_view.h b/ui/qt/widgets/rowmove_tree_view.h
new file mode 100644
index 00000000..ac415c41
--- /dev/null
+++ b/ui/qt/widgets/rowmove_tree_view.h
@@ -0,0 +1,35 @@
+/** @file
+ *
+ * Tree view that uses a model's moveRows(), if implemented, to support
+ * internalMoves.
+ *
+ * Copyright 2024 John Thacker <johnthacker@gmail.com>
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef ROWMOVE_TREE_VIEW_H
+#define ROWMOVE_TREE_VIEW_H
+
+#include <config.h>
+#include <ui/qt/widgets/tabnav_tree_view.h>
+
+/**
+ * Like QTreeView, but instead of changing to the next row (same column) when
+ * pressing Tab while editing, change to the next column (same row).
+ */
+class RowMoveTreeView : public TabnavTreeView
+{
+ Q_OBJECT
+
+public:
+ RowMoveTreeView(QWidget *parent = nullptr);
+
+protected:
+ void dropEvent(QDropEvent *event) override;
+};
+#endif // ROWMOVE_TREE_VIEW_H
diff --git a/ui/qt/widgets/rtp_audio_graph.cpp b/ui/qt/widgets/rtp_audio_graph.cpp
index 1340658b..58ff2f1f 100644
--- a/ui/qt/widgets/rtp_audio_graph.cpp
+++ b/ui/qt/widgets/rtp_audio_graph.cpp
@@ -9,8 +9,6 @@
#include "rtp_audio_graph.h"
-#include <glib.h>
-
#include <epan/prefs.h>
#include <ui/qt/utils/color_utils.h>
diff --git a/ui/qt/widgets/splash_overlay.h b/ui/qt/widgets/splash_overlay.h
index b15d98c4..3f5625fc 100644
--- a/ui/qt/widgets/splash_overlay.h
+++ b/ui/qt/widgets/splash_overlay.h
@@ -12,8 +12,6 @@
#include <config.h>
-#include <glib.h>
-
#include "epan/register.h"
#include <QWidget>
diff --git a/ui/qt/widgets/syntax_line_edit.cpp b/ui/qt/widgets/syntax_line_edit.cpp
index f2c32142..3e1abe96 100644
--- a/ui/qt/widgets/syntax_line_edit.cpp
+++ b/ui/qt/widgets/syntax_line_edit.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/dfilter/dfilter.h>
@@ -86,7 +84,7 @@ void SyntaxLineEdit::setSyntaxState(SyntaxState state) {
QColor deprecated_bg = ColorUtils::fromColorT(&prefs.gui_text_deprecated);
QColor deprecated_fg = ColorUtils::contrastingTextColor(deprecated_bg);
- // Try to matche QLineEdit's placeholder text color (which sets the
+ // Try to match QLineEdit's placeholder text color (which sets the
// alpha channel to 50%, which doesn't work in style sheets).
// Setting the foreground color lets us avoid yet another background
// color preference and should hopefully make things easier to
@@ -212,7 +210,7 @@ bool SyntaxLineEdit::checkDisplayFilter(QString filter)
* We're being lazy and only printing the first warning.
* Would it be better to print all of them?
*/
- syntax_error_message_ = QString(static_cast<gchar *>(warn->data));
+ syntax_error_message_ = QString(static_cast<char *>(warn->data));
} else if (dfp != NULL && (depr = dfilter_deprecated_tokens(dfp)) != NULL) {
// You keep using that word. I do not think it means what you think it means.
// Possible alternatives: ::Troubled, or ::Problematic maybe?
@@ -222,7 +220,7 @@ bool SyntaxLineEdit::checkDisplayFilter(QString filter)
* Would it be better to print all of them?
*/
QString token((const char *)g_ptr_array_index(depr, 0));
- gchar *token_str = qstring_strdup(token.section('.', 0, 0));
+ char *token_str = qstring_strdup(token.section('.', 0, 0));
header_field_info *hfi = proto_registrar_get_byalias(token_str);
if (hfi)
syntax_error_message_ = tr("\"%1\" is deprecated in favour of \"%2\". "
@@ -267,10 +265,23 @@ void SyntaxLineEdit::checkCustomColumn(QString fields)
return;
}
- gchar **splitted_fields = g_regex_split_simple(COL_CUSTOM_PRIME_REGEX,
- fields.toUtf8().constData(), G_REGEX_ANCHORED, G_REGEX_MATCH_ANCHORED);
-
- for (guint i = 0; i < g_strv_length(splitted_fields); i++) {
+#if 0
+ // XXX - Eventually, if the operator we split on is something not supported
+ // in the filter expression syntax (so that we can distinguish multifield
+ // concatenation of column strings from a logical OR), we would split and
+ // then check each split result as a valid display filter.
+ // For now, any expression that is a valid display filter should work.
+ //
+ // We also, for the custom columns, want some of the extra completion
+ // information from DisplayFilterEdit (like the display filter functions),
+ // without all of its integration into the main app, but not every user
+ // of FieldFilterEdit wants that, so perhaps we eventually should have
+ // another class.
+ char **splitted_fields = g_regex_split_simple(COL_CUSTOM_PRIME_REGEX,
+ fields.toUtf8().constData(), (GRegexCompileFlags) G_REGEX_RAW,
+ (GRegexMatchFlags) 0);
+
+ for (unsigned i = 0; i < g_strv_length(splitted_fields); i++) {
if (splitted_fields[i] && *splitted_fields[i]) {
if (proto_check_field_name(splitted_fields[i]) != 0) {
setSyntaxState(SyntaxLineEdit::Invalid);
@@ -280,6 +291,7 @@ void SyntaxLineEdit::checkCustomColumn(QString fields)
}
}
g_strfreev(splitted_fields);
+#endif
checkDisplayFilter(fields);
}
diff --git a/ui/qt/widgets/traffic_tab.cpp b/ui/qt/widgets/traffic_tab.cpp
index 9913acaa..6233d60d 100644
--- a/ui/qt/widgets/traffic_tab.cpp
+++ b/ui/qt/widgets/traffic_tab.cpp
@@ -78,7 +78,7 @@ TrafficTab::TrafficTab(QWidget * parent) :
TrafficTab::~TrafficTab()
{}
-void TrafficTab::setProtocolInfo(QString tableName, TrafficTypesList * trafficList, GList ** recentColumnList, ATapModelCallback createModel)
+void TrafficTab::setProtocolInfo(QString tableName, TrafficTypesList * trafficList, GList ** recentList, GList ** recentColumnList, ATapModelCallback createModel)
{
setTabBasename(tableName);
@@ -86,6 +86,7 @@ void TrafficTab::setProtocolInfo(QString tableName, TrafficTypesList * trafficLi
if (createModel)
_createModel = createModel;
+ _recentList = recentList;
_recentColumnList = recentColumnList;
setOpenTabs(trafficList->protocols(true));
@@ -159,7 +160,7 @@ void TrafficTab::useAbsoluteTime(bool absolute)
{
for(int idx = 0; idx < count(); idx++)
{
- ATapDataModel * atdm = modelForTabIndex(idx);
+ ATapDataModel * atdm = dataModelForTabIndex(idx);
if (atdm)
atdm->useAbsoluteTime(absolute);
}
@@ -169,7 +170,7 @@ void TrafficTab::useNanosecondTimestamps(bool nanoseconds)
{
for(int idx = 0; idx < count(); idx++)
{
- ATapDataModel * atdm = modelForTabIndex(idx);
+ ATapDataModel * atdm = dataModelForTabIndex(idx);
if (atdm)
atdm->useNanosecondTimestamps(nanoseconds);
}
@@ -179,7 +180,7 @@ void TrafficTab::disableTap()
{
for(int idx = 0; idx < count(); idx++)
{
- ATapDataModel * atdm = modelForTabIndex(idx);
+ ATapDataModel * atdm = dataModelForTabIndex(idx);
if (atdm)
atdm->disableTap();
}
@@ -260,6 +261,12 @@ void TrafficTab::insertProtoTab(int protoId, bool emitSignals)
if (tabId >= 0)
tabBar()->setTabData(tabId, storage);
+ // Identify the last known opened tab
+ int lastOpened_protoId = -1;
+ GList *selected_tab = g_list_first(*_recentList);
+ if (selected_tab != nullptr) {
+ lastOpened_protoId = proto_get_id_by_short_name((const char *)selected_tab->data);
+ }
/* We reset the correct tab idxs. That operations is costly, but it is only
* called during this operation and ensures, that other operations do not
@@ -270,6 +277,11 @@ void TrafficTab::insertProtoTab(int protoId, bool emitSignals)
_tabs.insert(tabData.protoId(), idx);
}
+ // Restore the last known opened tab
+ if(lastOpened_protoId == protoId) {
+ setCurrentIndex(tabId);
+ }
+
if (emitSignals) {
emit tabsChanged(_tabs.keys());
emit retapRequired();
@@ -329,7 +341,7 @@ QVariant TrafficTab::currentItemData(int role)
* to ensure proper handling. Especially ConversationDialog depends on this
* method always returning data */
if (!idx.isValid()) {
- ATapDataModel * model = modelForTabIndex(currentIndex());
+ TrafficDataFilterProxy * model = modelForTabIndex(currentIndex());
idx = model->index(0, 0);
}
return idx.data(role);
@@ -365,7 +377,7 @@ void TrafficTab::modelReset()
emit tabDataChanged(tabIdx);
}
-ATapDataModel * TrafficTab::modelForTabIndex(int tabIdx)
+TrafficDataFilterProxy * TrafficTab::modelForTabIndex(int tabIdx)
{
if (tabIdx == -1)
tabIdx = currentIndex();
@@ -373,26 +385,40 @@ ATapDataModel * TrafficTab::modelForTabIndex(int tabIdx)
return modelForWidget(widget(tabIdx));
}
-ATapDataModel * TrafficTab::modelForWidget(QWidget * searchWidget)
+TrafficDataFilterProxy * TrafficTab::modelForWidget(QWidget * searchWidget)
{
if (qobject_cast<QTreeView *>(searchWidget)) {
QTreeView * tree = qobject_cast<QTreeView *>(searchWidget);
if (qobject_cast<TrafficDataFilterProxy *>(tree->model())) {
- TrafficDataFilterProxy * qsfpm = qobject_cast<TrafficDataFilterProxy *>(tree->model());
- if (qsfpm && qobject_cast<ATapDataModel *>(qsfpm->sourceModel())) {
- return qobject_cast<ATapDataModel *>(qsfpm->sourceModel());
- }
+ return qobject_cast<TrafficDataFilterProxy *>(tree->model());
}
}
return nullptr;
}
+ATapDataModel * TrafficTab::dataModelForTabIndex(int tabIdx)
+{
+ if (tabIdx == -1)
+ tabIdx = currentIndex();
+
+ return dataModelForWidget(widget(tabIdx));
+}
+
+ATapDataModel * TrafficTab::dataModelForWidget(QWidget * searchWidget)
+{
+ TrafficDataFilterProxy * qsfpm = modelForWidget(searchWidget);
+ if (qsfpm && qobject_cast<ATapDataModel *>(qsfpm->sourceModel())) {
+ return qobject_cast<ATapDataModel *>(qsfpm->sourceModel());
+ }
+ return nullptr;
+}
+
void TrafficTab::setFilter(QString filter)
{
for (int idx = 0; idx < count(); idx++ )
{
- ATapDataModel * atdm = modelForTabIndex(idx);
+ ATapDataModel * atdm = dataModelForTabIndex(idx);
if (! atdm)
continue;
atdm->setFilter(filter);
@@ -406,7 +432,7 @@ void TrafficTab::setNameResolution(bool checked)
for (int idx = 0; idx < count(); idx++ )
{
- ATapDataModel * atdm = modelForTabIndex(idx);
+ ATapDataModel * atdm = dataModelForTabIndex(idx);
if (! atdm)
continue;
atdm->setResolveNames(checked);
@@ -422,7 +448,7 @@ void TrafficTab::setNameResolution(bool checked)
bool TrafficTab::hasNameResolution(int tabIdx)
{
int tab = tabIdx == -1 || tabIdx >= count() ? currentIndex() : tabIdx;
- ATapDataModel * dataModel = modelForTabIndex(tab);
+ ATapDataModel * dataModel = dataModelForTabIndex(tab);
if (! dataModel)
return false;
@@ -443,12 +469,12 @@ bool TrafficTab::hasGeoIPData(int tabIdx)
{
int tab = tabIdx == -1 || tabIdx >= count() ? currentIndex() : tabIdx;
- ATapDataModel * dataModel = modelForTabIndex(tab);
+ ATapDataModel * dataModel = dataModelForTabIndex(tab);
return dataModel->hasGeoIPData();
}
bool
-TrafficTab::writeGeoIPMapFile(QFile * fp, bool json_only, ATapDataModel * dataModel)
+TrafficTab::writeGeoIPMapFile(QFile * fp, bool json_only, TrafficDataFilterProxy * model)
{
QTextStream out(fp);
@@ -508,14 +534,15 @@ TrafficTab::writeGeoIPMapFile(QFile * fp, bool json_only, ATapDataModel * dataMo
QJsonArray features;
/* Append map data. */
- for(int row = 0; row < dataModel->rowCount(QModelIndex()); row++)
+ for(int row = 0; row < model->rowCount(QModelIndex()); row++)
{
- QModelIndex index = dataModel->index(row, 0);
+ QModelIndex index = model->mapToSource(model->index(row, 0));
+ ATapDataModel *dataModel = qobject_cast<ATapDataModel *>(model->sourceModel());
const mmdb_lookup_t * result = VariantPointer<const mmdb_lookup_t>::asPtr(dataModel->data(index, ATapDataModel::GEODATA_LOOKUPTABLE));
if (!maxmind_db_has_coords(result)) {
// result could be NULL if the caller did not trigger a lookup
- // before. result->found could be FALSE if no MMDB entry exists.
+ // before. result->found could be false if no MMDB entry exists.
continue;
}
@@ -545,8 +572,8 @@ TrafficTab::writeGeoIPMapFile(QFile * fp, bool json_only, ATapDataModel * dataMo
if (qobject_cast<EndpointDataModel *>(dataModel)) {
EndpointDataModel * endpointModel = qobject_cast<EndpointDataModel *>(dataModel);
- property["packets"] = endpointModel->data(endpointModel->index(row, EndpointDataModel::ENDP_COLUMN_PACKETS)).toString();
- property["bytes"] = endpointModel->data(endpointModel->index(row, EndpointDataModel::ENDP_COLUMN_BYTES)).toString();
+ property["packets"] = endpointModel->data(index.siblingAtColumn(EndpointDataModel::ENDP_COLUMN_PACKETS)).toString();
+ property["bytes"] = endpointModel->data(index.siblingAtColumn(EndpointDataModel::ENDP_COLUMN_BYTES)).toString();
}
arrEntry["properties"] = property;
features.append(arrEntry);
@@ -568,7 +595,7 @@ TrafficTab::writeGeoIPMapFile(QFile * fp, bool json_only, ATapDataModel * dataMo
QUrl TrafficTab::createGeoIPMap(bool json_only, int tabIdx)
{
int tab = tabIdx == -1 || tabIdx >= count() ? currentIndex() : tabIdx;
- ATapDataModel * dataModel = modelForTabIndex(tab);
+ ATapDataModel * dataModel = dataModelForTabIndex(tab);
if (! (dataModel && dataModel->hasGeoIPData())) {
QMessageBox::warning(this, tr("Map file error"), tr("No endpoints available to map"));
return QUrl();
@@ -581,7 +608,7 @@ QUrl TrafficTab::createGeoIPMap(bool json_only, int tabIdx)
return QUrl();
}
- if (!writeGeoIPMapFile(&tf, json_only, dataModel)) {
+ if (!writeGeoIPMapFile(&tf, json_only, modelForTabIndex(tab))) {
tf.close();
return QUrl();
}
@@ -592,7 +619,7 @@ QUrl TrafficTab::createGeoIPMap(bool json_only, int tabIdx)
#endif
void TrafficTab::detachTab(int tabIdx, QPoint pos) {
- ATapDataModel * model = modelForTabIndex(tabIdx);
+ ATapDataModel * model = dataModelForTabIndex(tabIdx);
if (!model)
return;
@@ -608,7 +635,7 @@ void TrafficTab::detachTab(int tabIdx, QPoint pos) {
void TrafficTab::attachTab(QWidget * content, QString name)
{
- ATapDataModel * model = modelForWidget(content);
+ ATapDataModel * model = dataModelForWidget(content);
if (!model) {
attachTab(content, name);
return;
diff --git a/ui/qt/widgets/traffic_tab.h b/ui/qt/widgets/traffic_tab.h
index 71c48ae5..ff0bacc5 100644
--- a/ui/qt/widgets/traffic_tab.h
+++ b/ui/qt/widgets/traffic_tab.h
@@ -12,10 +12,9 @@
#include "config.h"
-#include <glib.h>
-
#include <ui/qt/models/atap_data_model.h>
#include <ui/qt/filter_action.h>
+#include <ui/qt/widgets/traffic_tree.h>
#include <ui/qt/widgets/detachable_tabwidget.h>
#include <ui/qt/widgets/traffic_types_list.h>
@@ -94,7 +93,7 @@ public:
*
* @see ATapModelCallback
*/
- void setProtocolInfo(QString tableName, TrafficTypesList * trafficList, GList ** recentColumnList, ATapModelCallback createModel);
+ void setProtocolInfo(QString tableName, TrafficTypesList * trafficList, GList ** recentList, GList ** recentColumnList, ATapModelCallback createModel);
/**
* @brief Set the Delegate object for the tab. It will apply for all
@@ -221,20 +220,23 @@ private:
QMap<int, int> _tabs;
ATapModelCallback _createModel;
ATapCreateDelegate _createDelegate;
+ GList ** _recentList;
GList ** _recentColumnList;
bool _disableTaps;
bool _nameResolution;
QTreeView * createTree(int protoId);
- ATapDataModel * modelForTabIndex(int tabIdx = -1);
- ATapDataModel * modelForWidget(QWidget * widget);
+ TrafficDataFilterProxy * modelForTabIndex(int tabIdx = -1);
+ TrafficDataFilterProxy * modelForWidget(QWidget * widget);
+ ATapDataModel * dataModelForTabIndex(int tabIdx = -1);
+ ATapDataModel * dataModelForWidget(QWidget * widget);
void insertProtoTab(int protoId, bool emitSignals = true);
void removeProtoTab(int protoId, bool emitSignals = true);
#ifdef HAVE_MAXMINDDB
- bool writeGeoIPMapFile(QFile * fp, bool json_only, ATapDataModel * dataModel);
+ bool writeGeoIPMapFile(QFile * fp, bool json_only, TrafficDataFilterProxy * model);
#endif
private slots:
diff --git a/ui/qt/widgets/traffic_tree.cpp b/ui/qt/widgets/traffic_tree.cpp
index be154d7d..4325e556 100644
--- a/ui/qt/widgets/traffic_tree.cpp
+++ b/ui/qt/widgets/traffic_tree.cpp
@@ -204,7 +204,7 @@ void TrafficTreeHeaderView::columnTriggered(bool checked)
for (int col = 0; col < tree->dataModel()->columnCount(); col++) {
if (proxy->columnVisible(col)) {
visible << col;
- gchar *nr = qstring_strdup(QString::number(col));
+ char *nr = qstring_strdup(QString::number(col));
*_recentColumnList = g_list_append(*_recentColumnList, nr);
}
}
@@ -473,7 +473,35 @@ bool TrafficDataFilterProxy::lessThan(const QModelIndex &source_left, const QMod
int addressTypeA = model->data(source_left, ATapDataModel::DATA_ADDRESS_TYPE).toInt();
int addressTypeB = model->data(source_right, ATapDataModel::DATA_ADDRESS_TYPE).toInt();
if (addressTypeA != 0 && addressTypeB != 0 && addressTypeA != addressTypeB) {
- result = addressTypeA < addressTypeB;
+
+ /* Handle subnets when they are compared to IP addresses */
+ if ( (addressTypeA == AT_STRINGZ) && (addressTypeB == AT_IPv4) ) {
+ QString subnet = datA.toString();
+ qint64 lpart = subnet.indexOf("/");
+ ws_in4_addr ip4addr;
+
+ if(ws_inet_pton4(subnet.left(lpart).toUtf8().data(), &ip4addr)) {
+ quint32 valA = g_ntohl(ip4addr);
+ quint32 valB = model->data(source_right, ATapDataModel::DATA_IPV4_INTEGER).value<quint32>();
+ result = valA < valB;
+ identical = valA == valB;
+ }
+ // else: never supposed to happen
+ } else if ( (addressTypeA == AT_IPv4) && (addressTypeB == AT_STRINGZ) ) {
+ QString subnet = datB.toString();
+ qint64 lpart = subnet.indexOf("/");
+ ws_in4_addr ip4addr;
+ if(ws_inet_pton4(subnet.left(lpart).toUtf8().data(), &ip4addr)) {
+ quint32 valA = model->data(source_left, ATapDataModel::DATA_IPV4_INTEGER).value<quint32>();
+ quint32 valB = g_ntohl(ip4addr);
+ result = valA < valB;
+ identical = valA == valB;
+ }
+ // else: never supposed to happen
+ } else {
+ result = addressTypeA < addressTypeB;
+ }
+
} else if (addressTypeA != 0 && addressTypeA == addressTypeB) {
if (addressTypeA == AT_IPv4) {
@@ -693,8 +721,28 @@ QMenu * TrafficTree::createActionSubMenu(FilterAction::Action cur_action, QModel
foreach (FilterAction::ActionType at, FilterAction::actionTypes()) {
if (isConversation && conv_item) {
QMenu *subsubmenu = subMenu->addMenu(FilterAction::actionTypeName(at));
- if (hasConvId && (cur_action == FilterAction::ActionApply || cur_action == FilterAction::ActionPrepare)) {
- QString filter = QString("%1.stream eq %2").arg(conv_item->ctype == CONVERSATION_TCP ? "tcp" : "udp").arg(conv_item->conv_id);
+
+ /* For IP, ensure subnets-like conversations won't enable Stream ID filters (!CONV_ID_UNSET) */
+ if (hasConvId && (conv_item->conv_id!=CONV_ID_UNSET) && (cur_action == FilterAction::ActionApply || cur_action == FilterAction::ActionPrepare)) {
+ QString filter;
+ switch (conv_item->ctype) {
+ case CONVERSATION_TCP:
+ filter = QString("%1.stream eq %2").arg("tcp").arg(conv_item->conv_id);
+ break;
+ case CONVERSATION_UDP:
+ filter = QString("%1.stream eq %2").arg("udp").arg(conv_item->conv_id);
+ break;
+ case CONVERSATION_IP:
+ filter = QString("%1.stream eq %2").arg("ip").arg(conv_item->conv_id);
+ break;
+ case CONVERSATION_IPV6:
+ filter = QString("%1.stream eq %2").arg("ipv6").arg(conv_item->conv_id);
+ break;
+ case CONVERSATION_ETH:
+ default:
+ filter = QString("%1.stream eq %2").arg("eth").arg(conv_item->conv_id);
+ break;
+ }
FilterAction * act = new FilterAction(subsubmenu, cur_action, at, tr("Filter on stream id"));
act->setProperty("filter", filter);
subsubmenu->addAction(act);
diff --git a/ui/qt/widgets/traffic_tree.h b/ui/qt/widgets/traffic_tree.h
index 5bc87e91..00d91783 100644
--- a/ui/qt/widgets/traffic_tree.h
+++ b/ui/qt/widgets/traffic_tree.h
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include <ui/recent.h>
#include <ui/qt/models/atap_data_model.h>
diff --git a/ui/qt/widgets/traffic_types_list.cpp b/ui/qt/widgets/traffic_types_list.cpp
index 30126ef9..ddbe34a3 100644
--- a/ui/qt/widgets/traffic_types_list.cpp
+++ b/ui/qt/widgets/traffic_types_list.cpp
@@ -9,9 +9,8 @@
#include "config.h"
-#include <glib.h>
-
#include <epan/conversation_table.h>
+#include <epan/prefs.h>
#include <ui/qt/widgets/traffic_types_list.h>
@@ -48,12 +47,12 @@ static bool iterateProtocols(const void *key, void *value, void *userdata)
QList<TrafficTypesRowData> * protocols = (QList<TrafficTypesRowData> *)userdata;
register_ct_t* ct = (register_ct_t*)value;
- const QString title = (const gchar*)key;
+ const QString title = (const char*)key;
int proto_id = get_conversation_proto_id(ct);
TrafficTypesRowData entry(proto_id, title);
protocols->append(entry);
- return FALSE;
+ return false;
}
TrafficTypesModel::TrafficTypesModel(GList ** recentList, QObject *parent) :
@@ -152,6 +151,26 @@ bool TrafficTypesModel::setData(const QModelIndex &idx, const QVariant &value, i
if (_allTaps.count() <= idx.row())
return false;
+ // When updating the tabs, save the current selection, it will be restored below
+ GList *selected_tab = g_list_first(*_recentList);
+ int rct_protoId = -1;
+ if (selected_tab != nullptr) {
+ rct_protoId = proto_get_id_by_short_name((const char *)selected_tab->data);
+
+ // Did the user just uncheck the current selection?
+ if (_allTaps[idx.row()].protocol() == rct_protoId && value.toInt() == Qt::Unchecked) {
+ // Yes. The code below will restore it. Rather than removing it,
+ // resetting the model, and then adding it back, just return.
+ // The user might want to uncheck the current selection, in which
+ // case the code needs to changed to handle that.
+ //
+ // Note that not allowing the current first tab to be unselected does
+ // have the advantage of preventing a crash from having no tabs
+ // selected in the Endpoint dialog (#18250).
+ return false;
+ }
+ }
+
_allTaps[idx.row()].setChecked(value.toInt() == Qt::Checked);
QList<int> selected;
@@ -161,12 +180,21 @@ bool TrafficTypesModel::setData(const QModelIndex &idx, const QVariant &value, i
for (int cnt = 0; cnt < _allTaps.count(); cnt++) {
if (_allTaps[cnt].checked()) {
int protoId = _allTaps[cnt].protocol();
- selected.append(protoId);
- char *title = g_strdup(proto_get_protocol_short_name(find_protocol_by_id(protoId)));
- *_recentList = g_list_append(*_recentList, title);
+ if(protoId != rct_protoId) {
+ selected.append(protoId);
+ char *title = g_strdup(proto_get_protocol_short_name(find_protocol_by_id(protoId)));
+ *_recentList = g_list_append(*_recentList, title);
+ }
}
}
+ if (rct_protoId != -1) {
+ // restore the selection by prepending it to the recent list
+ char *rct_title = g_strdup(proto_get_protocol_short_name(find_protocol_by_id(rct_protoId)));
+ selected.prepend(rct_protoId);
+ *_recentList = g_list_prepend(*_recentList, rct_title);
+ }
+
emit protocolsChanged(selected);
emit dataChanged(idx, idx);
diff --git a/ui/qt/widgets/traffic_types_list.h b/ui/qt/widgets/traffic_types_list.h
index 00798c50..2666eb78 100644
--- a/ui/qt/widgets/traffic_types_list.h
+++ b/ui/qt/widgets/traffic_types_list.h
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include <QTreeView>
#include <QAbstractListModel>
#include <QMap>
@@ -122,4 +120,4 @@ private:
TrafficListSortModel * _sortModel;
};
-#endif // TRAFFIC_TYPES_LIST_H \ No newline at end of file
+#endif // TRAFFIC_TYPES_LIST_H
diff --git a/ui/qt/widgets/wireless_timeline.cpp b/ui/qt/widgets/wireless_timeline.cpp
index dcdcd4f8..87eb1079 100644
--- a/ui/qt/widgets/wireless_timeline.cpp
+++ b/ui/qt/widgets/wireless_timeline.cpp
@@ -75,7 +75,7 @@ static void reset_rgb(float rgb[TIMELINE_HEIGHT][3])
rgb[i][0] = rgb[i][1] = rgb[i][2] = 1.0;
}
-static void render_pixels(QPainter &p, gint x, gint width, float rgb[TIMELINE_HEIGHT][3], float ratio)
+static void render_pixels(QPainter &p, int x, int width, float rgb[TIMELINE_HEIGHT][3], float ratio)
{
int previous = 0, i;
for (i = 1; i <= TIMELINE_HEIGHT; i++) {
@@ -92,7 +92,7 @@ static void render_pixels(QPainter &p, gint x, gint width, float rgb[TIMELINE_HE
reset_rgb(rgb);
}
-static void render_rectangle(QPainter &p, gint x, gint width, guint height, int dfilter, float r, float g, float b, float ratio)
+static void render_rectangle(QPainter &p, int x, int width, unsigned height, int dfilter, float r, float g, float b, float ratio)
{
p.fillRect(QRectF(x/ratio, TIMELINE_HEIGHT/2-height, width/ratio, dfilter ? height * 2 : height), pcolor(r,g,b));
}
@@ -157,29 +157,25 @@ void WirelessTimeline::mouseReleaseEvent(QMouseEvent *event)
return;
/* this was a click */
- guint num = find_packet(localPos.x());
+ unsigned num = find_packet(localPos.x());
if (num == 0)
return;
- frame_data *fdata = frame_data_sequence_find(cfile.provider.frames, num);
- if (!fdata->passed_dfilter && fdata->prev_dis_num > 0)
- num = fdata->prev_dis_num;
-
- cf_goto_frame(&cfile, num);
+ cf_goto_frame(&cfile, num, false);
}
void WirelessTimeline::clip_tsf()
{
// did we go past the start of the file?
- if (((gint64) start_tsf) < ((gint64) first->start_tsf)) {
+ if (((int64_t) start_tsf) < ((int64_t) first->start_tsf)) {
// align the start of the file at the left edge
- guint64 shift = first->start_tsf - start_tsf;
+ uint64_t shift = first->start_tsf - start_tsf;
start_tsf += shift;
end_tsf += shift;
}
if (end_tsf > last->end_tsf) {
- guint64 shift = end_tsf - last->end_tsf;
+ uint64_t shift = end_tsf - last->end_tsf;
start_tsf -= shift;
end_tsf -= shift;
}
@@ -194,32 +190,32 @@ void WirelessTimeline::selectedFrameChanged(QList<int>)
if (cfile.current_frame) {
struct wlan_radio *wr = get_wlan_radio(cfile.current_frame->num);
- guint left_margin = 0.9 * start_tsf + 0.1 * end_tsf;
- guint right_margin = 0.1 * start_tsf + 0.9 * end_tsf;
- guint64 half_window = (end_tsf - start_tsf)/2;
+ unsigned left_margin = 0.9 * start_tsf + 0.1 * end_tsf;
+ unsigned right_margin = 0.1 * start_tsf + 0.9 * end_tsf;
+ uint64_t half_window = (end_tsf - start_tsf)/2;
if (wr) {
// are we to the left of the left margin?
if (wr->start_tsf < left_margin) {
// scroll the left edge back to the left margin
- guint64 offset = left_margin - wr->start_tsf;
+ uint64_t offset = left_margin - wr->start_tsf;
if (offset < half_window) {
// small movement; keep packet to margin
start_tsf -= offset;
end_tsf -= offset;
} else {
// large movement; move packet to center of window
- guint64 center = (wr->start_tsf + wr->end_tsf)/2;
+ uint64_t center = (wr->start_tsf + wr->end_tsf)/2;
start_tsf = center - half_window;
end_tsf = center + half_window;
}
} else if (wr->end_tsf > right_margin) {
- guint64 offset = wr->end_tsf - right_margin;
+ uint64_t offset = wr->end_tsf - right_margin;
if (offset < half_window) {
start_tsf += offset;
end_tsf += offset;
} else {
- guint64 center = (wr->start_tsf + wr->end_tsf)/2;
+ uint64_t center = (wr->start_tsf + wr->end_tsf)/2;
start_tsf = center - half_window;
end_tsf = center + half_window;
}
@@ -234,10 +230,10 @@ void WirelessTimeline::selectedFrameChanged(QList<int>)
/* given an x position find which packet that corresponds to.
* if it's inter frame space the subsequent packet is returned */
-guint
+unsigned
WirelessTimeline::find_packet(qreal x_position)
{
- guint64 x_time = start_tsf + (x_position/width() * (end_tsf - start_tsf));
+ uint64_t x_time = start_tsf + (x_position/width() * (end_tsf - start_tsf));
return find_packet_tsf(x_time);
}
@@ -267,7 +263,7 @@ void WirelessTimeline::captureFileReadFinished()
*/
/* TODO: update GUI to handle captures with occasional frames missing TSF data */
/* TODO: indicate error message to the user */
- for (guint32 n = 1; n < cfile.count; n++) {
+ for (uint32_t n = 1; n < cfile.count; n++) {
struct wlan_radio *w = get_wlan_radio(n);
if (w->start_tsf == 0 || w->end_tsf == 0) {
QString err = tr("Packet number %1 does not include TSF timestamp, not showing timeline.").arg(n);
@@ -315,11 +311,11 @@ void WirelessTimeline::resizeEvent(QResizeEvent*)
// Calculate the x position on the GUI from the timestamp
-int WirelessTimeline::position(guint64 tsf, float ratio)
+int WirelessTimeline::position(uint64_t tsf, float ratio)
{
int position = -100;
- if (tsf != G_MAXUINT64) {
+ if (tsf != UINT64_MAX) {
position = ((double) tsf - start_tsf)*width()*ratio/(end_tsf-start_tsf);
}
return position;
@@ -378,11 +374,11 @@ tap_packet_status WirelessTimeline::tap_timeline_packet(void *tapdata, packet_in
const struct wlan_radio *wlan_radio_info = (const struct wlan_radio *)data;
/* Save the radio information in our own (GUI) hashtable */
- g_hash_table_insert(timeline->radio_packet_list, GUINT_TO_POINTER(pinfo->num), (gpointer)wlan_radio_info);
+ g_hash_table_insert(timeline->radio_packet_list, GUINT_TO_POINTER(pinfo->num), (void *)wlan_radio_info);
return TAP_PACKET_DONT_REDRAW;
}
-struct wlan_radio* WirelessTimeline::get_wlan_radio(guint32 packet_num)
+struct wlan_radio* WirelessTimeline::get_wlan_radio(uint32_t packet_num)
{
return (struct wlan_radio*)g_hash_table_lookup(radio_packet_list, GUINT_TO_POINTER(packet_num));
}
@@ -402,7 +398,7 @@ bool WirelessTimeline::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip) {
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
- guint packet = find_packet(helpEvent->pos().x());
+ unsigned packet = find_packet(helpEvent->pos().x());
if (packet) {
doToolTip(get_wlan_radio(packet), helpEvent->globalPos(), helpEvent->x());
} else {
@@ -452,16 +448,16 @@ void WirelessTimeline::bgColorizationProgress(int first, int last)
void WirelessTimeline::zoom(double x_fraction)
{
/* adjust the zoom around the selected packet */
- guint64 file_range = last->end_tsf - first->start_tsf;
- guint64 center = start_tsf + x_fraction * (end_tsf - start_tsf);
- guint64 span = pow(file_range, 1.0 - zoom_level / TIMELINE_MAX_ZOOM);
+ uint64_t file_range = last->end_tsf - first->start_tsf;
+ uint64_t center = start_tsf + x_fraction * (end_tsf - start_tsf);
+ uint64_t span = pow(file_range, 1.0 - zoom_level / TIMELINE_MAX_ZOOM);
start_tsf = center - span * x_fraction;
end_tsf = center + span * (1.0 - x_fraction);
clip_tsf();
update();
}
-int WirelessTimeline::find_packet_tsf(guint64 tsf)
+int WirelessTimeline::find_packet_tsf(uint64_t tsf)
{
if (cfile.count < 1)
return 0;
@@ -469,11 +465,11 @@ int WirelessTimeline::find_packet_tsf(guint64 tsf)
if (cfile.count < 2)
return 1;
- guint32 min_count = 1;
- guint32 max_count = cfile.count-1;
+ uint32_t min_count = 1;
+ uint32_t max_count = cfile.count-1;
- guint64 min_tsf = get_wlan_radio(min_count)->end_tsf;
- guint64 max_tsf = get_wlan_radio(max_count)->end_tsf;
+ uint64_t min_tsf = get_wlan_radio(min_count)->end_tsf;
+ uint64_t max_tsf = get_wlan_radio(max_count)->end_tsf;
for (;;) {
if (tsf >= max_tsf)
@@ -482,11 +478,11 @@ int WirelessTimeline::find_packet_tsf(guint64 tsf)
if (tsf < min_tsf)
return min_count;
- guint32 middle = (min_count + max_count)/2;
+ uint32_t middle = (min_count + max_count)/2;
if (middle == min_count)
return middle+1;
- guint64 middle_tsf = get_wlan_radio(middle)->end_tsf;
+ uint64_t middle_tsf = get_wlan_radio(middle)->end_tsf;
if (tsf >= middle_tsf) {
min_count = middle;
@@ -550,9 +546,9 @@ WirelessTimeline::paintEvent(QPaintEvent *qpe)
if (ri == NULL) continue;
- gint8 rssi = ri->aggregate ? ri->aggregate->rssi : ri->rssi;
- guint height = (rssi+100)/2;
- gint end_nav;
+ int8_t rssi = ri->aggregate ? ri->aggregate->rssi : ri->rssi;
+ unsigned height = (rssi+100)/2;
+ int end_nav;
/* leave a margin above the packets so the selected packet can be seen */
if (height > TIMELINE_HEIGHT/2-6)
@@ -567,7 +563,7 @@ WirelessTimeline::paintEvent(QPaintEvent *qpe)
if (ri->start_tsf == 0 || ri->end_tsf == 0)
continue;
- x = ((gint64) (ri->start_tsf - start_tsf))*zoom;
+ x = ((int64_t) (ri->start_tsf - start_tsf))*zoom;
/* is there a previous anti-aliased pixel to output */
if (last_x >= 0 && ((int) x) != last_x) {
/* write it out now */
@@ -606,7 +602,7 @@ WirelessTimeline::paintEvent(QPaintEvent *qpe)
/* record NAV field at higher magnifications */
end_nav = x + width + ri->nav*zoom;
if (zoom >= 0.01 && ri->nav && end_nav > 0) {
- gint y = 2*(packet % (TIMELINE_HEIGHT/2));
+ int y = 2*(packet % (TIMELINE_HEIGHT/2));
qs.addLine(QLineF((x+width)/ratio, y, end_nav/ratio, y), QPen(pcolor(red,green,blue)));
}
diff --git a/ui/qt/widgets/wireless_timeline.h b/ui/qt/widgets/wireless_timeline.h
index de43d123..cf67ff4e 100644
--- a/ui/qt/widgets/wireless_timeline.h
+++ b/ui/qt/widgets/wireless_timeline.h
@@ -21,8 +21,6 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include "ui/ws_ui_util.h"
@@ -75,21 +73,21 @@ protected:
static void tap_timeline_reset(void* tapdata);
static tap_packet_status tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt, const void *data, tap_flags_t flags);
- struct wlan_radio* get_wlan_radio(guint32 packet_num);
+ struct wlan_radio* get_wlan_radio(uint32_t packet_num);
void clip_tsf();
- int position(guint64 tsf, float ratio);
- int find_packet_tsf(guint64 tsf);
+ int position(uint64_t tsf, float ratio);
+ int find_packet_tsf(uint64_t tsf);
void doToolTip(struct wlan_radio *wr, QPoint pos, int x);
void zoom(double x_fraction);
double zoom_level;
qreal start_x, last_x;
PacketList *packet_list;
- guint find_packet(qreal x);
+ unsigned find_packet(qreal x);
float rgb[TIMELINE_HEIGHT][3];
- guint64 start_tsf;
- guint64 end_tsf;
+ uint64_t start_tsf;
+ uint64_t end_tsf;
int first_packet; /* first packet displayed */
struct wlan_radio *first, *last;
capture_file *capfile;
diff --git a/ui/qt/widgets/wireshark_file_dialog.cpp b/ui/qt/widgets/wireshark_file_dialog.cpp
index acf9c7db..3c5b8d3e 100644
--- a/ui/qt/widgets/wireshark_file_dialog.cpp
+++ b/ui/qt/widgets/wireshark_file_dialog.cpp
@@ -43,6 +43,15 @@ WiresharkFileDialog::WiresharkFileDialog(QWidget *parent, const QString &caption
#endif
}
+QString WiresharkFileDialog::selectedNativePath() const
+{
+ if (selectedFiles().isEmpty()) {
+ // The API implies this can't happen
+ return QString();
+ }
+ return QDir::toNativeSeparators(selectedFiles().at(0));
+}
+
QString WiresharkFileDialog::getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir, Options options)
{
#ifdef Q_OS_WIN
@@ -52,7 +61,7 @@ QString WiresharkFileDialog::getExistingDirectory(QWidget *parent, const QString
#ifdef Q_OS_WIN
revert_thread_per_monitor_v2_awareness(da_ctx);
#endif
- return ed;
+ return QDir::toNativeSeparators(ed);
}
QString WiresharkFileDialog::getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, Options options)
@@ -64,7 +73,7 @@ QString WiresharkFileDialog::getOpenFileName(QWidget *parent, const QString &cap
#ifdef Q_OS_WIN
revert_thread_per_monitor_v2_awareness(da_ctx);
#endif
- return ofn;
+ return QDir::toNativeSeparators(ofn);
}
QString WiresharkFileDialog::getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, Options options)
@@ -76,5 +85,5 @@ QString WiresharkFileDialog::getSaveFileName(QWidget *parent, const QString &cap
#ifdef Q_OS_WIN
revert_thread_per_monitor_v2_awareness(da_ctx);
#endif
- return sfn;
+ return QDir::toNativeSeparators(sfn);
}
diff --git a/ui/qt/widgets/wireshark_file_dialog.h b/ui/qt/widgets/wireshark_file_dialog.h
index 43ac67a6..7d452b3d 100644
--- a/ui/qt/widgets/wireshark_file_dialog.h
+++ b/ui/qt/widgets/wireshark_file_dialog.h
@@ -15,6 +15,11 @@
/**
* @brief The WiresharkFileDialog class
*
+ * Qt uses '/' as a universal path separator and converts to native path
+ * separators, i.e., '\' on Windows, only immediately before displaying a
+ * path to a user. This class can return the path with native path
+ * separators.
+ *
* Qt <= 5.9 supports setting old (Windows 8.1) per-monitor DPI awareness
* via Qt:AA_EnableHighDpiScaling. We do this in main.cpp. In order for
* native dialogs to be rendered correctly we need to set per-monitor
@@ -23,13 +28,15 @@
* we need to revert our thread context when we're done.
* The class functions below are simple wrappers around their QFileDialog
* equivalents that set PMv2 awareness before showing native dialogs on
- * Windows and resets it afterward.
+ * Windows and resets it afterward. They also return the result with native
+ * directory separators on Windows.
*/
class WiresharkFileDialog : public QFileDialog
{
public:
WiresharkFileDialog(QWidget *parent = nullptr, const QString &caption = QString(), const QString &directory = QString(), const QString &filter = QString());
+ QString selectedNativePath() const;
static QString getExistingDirectory(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), Options options = ShowDirsOnly);
static QString getOpenFileName(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = Q_NULLPTR, Options options = Options());
static QString getSaveFileName(QWidget *parent = Q_NULLPTR, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = Q_NULLPTR, Options options = Options());
diff --git a/ui/qt/wireless_frame.cpp b/ui/qt/wireless_frame.cpp
index 2247b113..4b5e14c2 100644
--- a/ui/qt/wireless_frame.cpp
+++ b/ui/qt/wireless_frame.cpp
@@ -12,8 +12,6 @@
#include "config.h"
-#include <glib.h>
-
#include <capture/capture_session.h>
#include <capture/capture_sync.h>
@@ -23,6 +21,7 @@
#include <wsutil/utf8_entities.h>
#include <wsutil/802_11-utils.h>
#include "main_application.h"
+#include "utils/qt_ui_utils.h"
#include <QProcess>
#include <QAbstractItemView>
@@ -129,7 +128,7 @@ void WirelessFrame::updateInterfaceList()
ws80211_free_interfaces(interfaces_);
interfaces_ = ws80211_find_interfaces();
const QString old_iface = ui->interfaceComboBox->currentText();
- guint iface_count = 0;
+ unsigned iface_count = 0;
bool list_changed = false;
// Don't interfere with user activity.
@@ -148,7 +147,7 @@ void WirelessFrame::updateInterfaceList()
if ((int) iface_count != ui->interfaceComboBox->count()) {
list_changed = true;
} else {
- for (guint i = 0; i < iface_count; i++) {
+ for (unsigned i = 0; i < iface_count; i++) {
struct ws80211_interface *iface = g_array_index(interfaces_, struct ws80211_interface *, i);
if (ui->interfaceComboBox->itemText(i).compare(iface->ifname) != 0) {
list_changed = true;
@@ -159,7 +158,7 @@ void WirelessFrame::updateInterfaceList()
if (list_changed) {
ui->interfaceComboBox->clear();
- for (guint i = 0; i < iface_count; i++) {
+ for (unsigned i = 0; i < iface_count; i++) {
struct ws80211_interface *iface = g_array_index(interfaces_, struct ws80211_interface *, i);
ui->interfaceComboBox->addItem(iface->ifname);
if (old_iface.compare(iface->ifname) == 0) {
@@ -226,7 +225,7 @@ void WirelessFrame::getInterfaceInfo()
return;
}
- for (guint i = 0; i < interfaces_->len; i++) {
+ for (unsigned i = 0; i < interfaces_->len; i++) {
struct ws80211_interface *iface = g_array_index(interfaces_, struct ws80211_interface *, i);
if (cur_iface.compare(iface->ifname) == 0) {
struct ws80211_iface_info iface_info;
@@ -234,8 +233,8 @@ void WirelessFrame::getInterfaceInfo()
ws80211_get_iface_info(iface->ifname, &iface_info);
- for (guint j = 0; j < iface->frequencies->len; j++) {
- guint32 frequency = g_array_index(iface->frequencies, guint32, j);
+ for (unsigned j = 0; j < iface->frequencies->len; j++) {
+ uint32_t frequency = g_array_index(iface->frequencies, uint32_t, j);
double ghz = frequency / 1000.0;
QString chan_str = QString("%1 " UTF8_MIDDLE_DOT " %2%3")
.arg(ieee80211_mhz_to_chan(frequency))
@@ -304,15 +303,15 @@ void WirelessFrame::setInterfaceInfo()
int chan_type = ui->channelTypeComboBox->itemData(cur_type_idx).toInt();
int bandwidth = getBandwidthFromChanType(chan_type);
int center_freq = getCenterFrequency(frequency, bandwidth);
- const gchar *chan_type_s = ws80211_chan_type_to_str(chan_type);
- gchar *center_freq_s = NULL;
- gchar *data, *primary_msg, *secondary_msg;
+ const char *chan_type_s = ws80211_chan_type_to_str(chan_type);
+ char *center_freq_s = NULL;
+ char *data, *primary_msg, *secondary_msg;
int ret;
if (frequency < 0 || chan_type < 0) return;
if (center_freq != -1) {
- center_freq_s = g_strdup(QString::number(center_freq).toUtf8().constData());
+ center_freq_s = qstring_strdup(QString::number(center_freq));
}
ret = sync_interface_set_80211_chan(cur_iface.toUtf8().constData(),
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index 7b37dabc..40f9443c 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -9,7 +9,7 @@
#include "wireshark_application.h"
-WiresharkApplication *wsApp = NULL;
+WiresharkApplication *wsApp;
WiresharkApplication::WiresharkApplication(int &argc, char **argv) :
MainApplication(argc, argv)
diff --git a/ui/qt/wireshark_de.ts b/ui/qt/wireshark_de.ts
index a42e3c32..35255910 100644
--- a/ui/qt/wireshark_de.ts
+++ b/ui/qt/wireshark_de.ts
@@ -44,8 +44,8 @@
<translation>Ordner</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Nach Pfad filtern</translation>
+ <source>Search Folders</source>
+ <translation>Ordner suchen</translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Lizenzen</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>Über Logray</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Das Verzeichnis existiert nicht</translation>
</message>
@@ -755,6 +763,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>Aufzeichnungskommentare bearbeiten</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>Kommentar hinzufügen</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>Bereich %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>Kommentar %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -863,10 +893,6 @@
<translation>Lesefilter:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Mit g&amp;zip komprimieren</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Mitschnittdatei öffnen</translation>
@@ -948,8 +974,8 @@
<translation>Details</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Mitschnittdateikommentare</translation>
+ <source>Edit Comments</source>
+ <translation>Kommentare bearbeiten</translation>
</message>
<message>
<source>Refresh</source>
@@ -960,10 +986,6 @@
<translation>In die Zwischenablage kopieren</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Kommentar speichern</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Mitschnittdateieigenschaften</translation>
</message>
@@ -1012,10 +1034,18 @@
<translation>Erstes Paket</translation>
</message>
<message>
+ <source>First event</source>
+ <translation>Erstes Ereignis</translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Letztes Paket</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation>Letztes Ereignis</translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Zeitspanne</translation>
</message>
@@ -1052,6 +1082,10 @@
<translation>Verworfene Pakete</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation>Verworfene Ereignisse</translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Mitschnittfilter</translation>
</message>
@@ -1064,6 +1098,10 @@
<translation>Paketgrößenlimit (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation>Max. Ereignisgröße (snaplen)</translation>
+ </message>
+ <message>
<source>none</source>
<translation>keine</translation>
</message>
@@ -1072,6 +1110,26 @@
<translation>%1 Byte</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>Kommentare</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>Kommentar %1:</translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation>Entschlüsselungs-Secrets</translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>Typ</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>Größe</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Statistik</translation>
</message>
@@ -1096,6 +1154,10 @@
<translation>Pakete</translation>
</message>
<message>
+ <source>Events</source>
+ <translation>Ereignisse</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Zeitspanne, s</translation>
</message>
@@ -1105,7 +1167,11 @@
</message>
<message>
<source>Average packet size, B</source>
- <translation>Durschnittliche Paketgröße, B</translation>
+ <translation>Durchschnittliche Paketgröße, B</translation>
+ </message>
+ <message>
+ <source>Average event size, B</source>
+ <translation>Durchschnittliche Ereignisgröße, B</translation>
</message>
<message>
<source>Bytes</source>
@@ -1113,21 +1179,21 @@
</message>
<message>
<source>Average bytes/s</source>
- <translation>Durschnittliche Byte/s</translation>
+ <translation>Durchschnittliche Byte/s</translation>
</message>
<message>
<source>Average bits/s</source>
- <translation>Durschnittliche Bit/s</translation>
- </message>
- <message>
- <source>Section Comment</source>
- <translation>Kommentar Bereich</translation>
+ <translation>Durchschnittliche Bit/s</translation>
</message>
<message>
<source>Packet Comments</source>
<translation>Paketkommentar</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation>Ereigniskommentare</translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Frame %1:</translation>
</message>
@@ -1139,6 +1205,14 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Erstellt von Logray %1
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1366,6 +1440,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angeben.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Normalerweise erfasst eine WLAN-Netzwerkkarte nur Verkehr, der zu oder von ihrer Netzwerkadresse gesendet wird. Zudem wird nur &lt;em&gt;user data&lt;/em&gt;-Verkehr mit &amp;quot;fake&amp;quot; Ethernet-Headern aufgezeichnet. Wenn Sie den gesamten Datenverkehr, den die Netzwerkkarte &amp;quot;sehen&amp;quot; kann, aufzeichnen möchten, an 802.11 Management-/Kontrollpaketen oder Radio-Layer-Infos interessiert sind, wählen Sie diese Option an. Monitor-Mode-Verfügbarkeit hängt von der Netzwerkkarte und den Treibern ab. Schauen Sie für mehr Informationen zum Mitschneiden in WLAN-Netzwerken ins Wiki.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>Monitor Modus für alle 802.11 Schnittstellen aktivieren</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>Komprimierung</translation>
</message>
@@ -1378,6 +1460,30 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation>Datei Infix Muster</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Beim Erzeugen mehrerer Dateien werden Datum und Uhrzeit sowie die Datei-Indexnummer zwischen dem Dateinamen und Suffix eingefügt. Wählen Sie deren Sortierungsart.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation>YYYYmmDDHHMMSS_NNNNN</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Datum und Uhrzeit vor der Datei-Indexnummer. Dies führt zur Sortierung nach Erstellungszeit und hält Dateien vom gleichen Stapel in der Sortierung eng zusammen.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation>NNNNN_YYYYmmDDHHMMSS</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Datei-Indexnummer vor Datum und Uhrzeit. Dies ist die alte Wireshark Sortierung.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Nachdem die Aufzeichnung in die nächste Datei gewechselt hat und die angegebene Anzahl an Dateien erreicht wurde, wird die älteste Datei entfernt.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1466,6 +1572,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Mitschneiden beenden, nachdem die angegebene Anzahl an Paketen mitgeschnitten wurde.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation>Mitschneiden beenden, nachdem die angegebene Anzahl an Dateien erstellt wurde.</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Mitschneiden beenden, nachdem die angegebene Datenmenge mitgeschnitten wurde.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1526,8 +1636,8 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Fehler</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Dateisatz: Angeforderte Dateigröße zu groß. Die Dateigröße kann nicht größer als 2 GiB sein.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation>Dateisatz: Angeforderte Dateigröße zu groß. Die Dateigröße kann nicht größer als 2 TB sein.</translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1557,6 +1667,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Pakete im promiskuitiven Modus mitschneiden</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Normalerweise erfasst eine WLAN-Netzwerkkarte nur Verkehr, der zu oder von ihrer Netzwerkadresse gesendet wird. Zudem wird nur &lt;em&gt;user data&lt;/em&gt; -Verkehr mit &amp;quot;fake&amp;quot; Ethernet-Headern aufgezeichnet. Wenn Sie den gesamten Datenverkehr, den die Netzwerkkarte &amp;quot;sehen&amp;quot; kann, aufzeichnen möchten, an 802.11 Management-/Kontrollpaketen oder Radio-Layer-Infos interessiert sind, wählen Sie diese Option an. Monitor-Mode-Verfügbarkeit hängt von der Netzwerkkarte und den Treibern ab. Schauen Sie für mehr Informationen zum Mitschneiden in WLAN-Netzwerken ins Wiki.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>Pakete im Monitor Modus der 802.11 Schnittstelle mitschneiden</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pakete im pcapng Dateiformat aufzeichnen.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1784,6 +1902,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Aufgelöst</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>Breite</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>Ausrichtung</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;In Feldern menschenleserliche Zeichenketten anstatt Rohwerte anzeigen. Nur auf benutzerdefinierte Spalten mit Zeichenketten anwendbar.&lt;/html&gt;</translation>
</message>
@@ -1831,6 +1957,25 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation>Komprimierungsoptionen</translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation>&amp;Unkomprimiert</translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation>Mit g&amp;zip komprimieren</translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation>Mit &amp;LZ4 komprimieren</translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1897,6 +2042,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Bits/s B </translation>
</message>
<message>
+ <source>Flows</source>
+ <translation>Flows</translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Pakete gesamt</translation>
</message>
@@ -2011,14 +2160,6 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Paketbytes als Hex Dump kopieren</translation>
</message>
<message>
- <source>…as Printable Text</source>
- <translation>…als druckbarer Text</translation>
- </message>
- <message>
- <source>Copy only the printable text in the packet.</source>
- <translation>Nur den druckbaren Text im Paket kopieren.</translation>
- </message>
- <message>
<source>…as MIME Data</source>
<translation>...als MIME Daten</translation>
</message>
@@ -2031,10 +2172,42 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Paket-Bytes als druckbare ASCII-Zeichen und Escape-Sequenzen kopieren.</translation>
</message>
<message>
+ <source>…as Go literal</source>
+ <translation>als Go Literal</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation>Paketbytes als Go Literal kopieren</translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation>…als C Array</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
+ <translation>Paketbytes als C Array kopieren.</translation>
+ </message>
+ <message>
<source>…as a Hex Stream</source>
<translation>...als Hex Stream</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation>…als UTF-8 Text</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation>Paketbytes als Text kopieren (als UTF-8 behandeln).</translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation>…als ASCII Text</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation>Paketbytes als Text kopieren (als ASCII behandeln).</translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>Paketbytes als Hexstream kopieren.</translation>
</message>
@@ -2830,6 +3003,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<source>Display filter:</source>
<translation>Anzeigefilter:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation>PDUs exportieren</translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2869,10 +3046,6 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Start</translation>
</message>
<message>
- <source>Save</source>
- <translation>Speichern</translation>
- </message>
- <message>
<source>Default</source>
<translation>Standard</translation>
</message>
@@ -3014,6 +3187,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Anzeigefilter</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation>Anzeigefilter Makros</translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>Neues Makro</translation>
+ </message>
+ <message>
<source>Open </source>
<translation>Öffnen</translation>
</message>
@@ -3097,10 +3278,18 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>Makroname</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Filtername</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation>Makroausdruck</translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Filterausdruck</translation>
</message>
@@ -3186,22 +3375,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>&quot;Datei&quot; Dialoge</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>Mitschnittdateien</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Temp</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>Unbenannte Mitschnittdateien</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Benutzerspezifische Konfiguration</translation>
</message>
@@ -3210,14 +3387,6 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Globale Konfiguration</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfilters, preferences, ethers, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>dfilters, preferences, manuf, …</translation>
- </message>
- <message>
<source>System</source>
<translation>System</translation>
</message>
@@ -3230,18 +3399,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Programm</translation>
</message>
<message>
- <source>program files</source>
- <translation>program files</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Benutzerspezifische Plugins</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>binary plugins</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Globale Plugins</translation>
</message>
@@ -3258,11 +3419,35 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Lua Skripte</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation>&quot;Datei&quot; Dialog Pfad</translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation>Mitschnittdateien</translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation>Unbenannte Mitschnittdateien</translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation>Einstellungen, Profile, manuf, …</translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation>Programmdateien</translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation>Binary Plug-Ins</translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>Benutzerspezifischer Extcap Pfad</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation>Externe Aufzeichnungs-Plug-Ins (extcap)</translation>
</message>
<message>
@@ -3299,7 +3484,7 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
<message>
<source>Location</source>
- <translation>Lokation</translation>
+ <translation>Pfad</translation>
</message>
<message>
<source>Typical Files</source>
@@ -3400,6 +3585,24 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation>Ereignis %1.</translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;Lesevorgang&lt;/span&gt;, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;Lesevorgänge&lt;/span&gt;, </numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;Schreibvorgang&lt;/span&gt;, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;Schreibvorgänge&lt;/span&gt;, </numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation> Zur Auswahl anklicken.</translation>
</message>
@@ -3432,6 +3635,18 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>%1 Stream in ausgewähltem Paket nicht gefunden.</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>Leseaktivität(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>Schreibaktivität(%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>Gesamte E/A Aktivität (%1)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>Gesamte Verbindung (%1)</translation>
</message>
@@ -3447,10 +3662,6 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<source>Save Stream Content As…</source>
<translation>Stream Inhalt speichern als…</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[Streamausgabe gekürzt]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation>
@@ -3478,9 +3689,20 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Hinweis.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Daten anzeigen als</translation>
+ <source>Show as</source>
+ <translation>Anzeigen als</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation>Keine Delta-Zeiten</translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation>Delta-Zeiten umdrehen</translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation>Alle Delta-Zeiten</translation>
</message>
<message>
<source>Stream</source>
@@ -3495,11 +3717,22 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Suchen:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Groß- / Kleinschreibung beachten</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>&amp;Nächstes suchen</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[Streamausgabe gekürzt]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3835,29 +4068,28 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Diesen Graph entfernen.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Einen neuen Graph hinzufügen.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Diesen Graph duplizieren.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Alle Graphen löschen.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>Graphen nach oben verschieben.</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation>Ausgewählte(n) Graphen entfernen.</translation>
+ </message>
+ <message>
+ <source>Duplicate the selected graph(s).</source>
+ <translation>Ausgewählte(n) Graphen duplizieren.</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation>Ausgewählte(n) Graphen nach oben verschieben.</translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation>Graphen nach unten verschieben.</translation>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation>Ausgewählte(n) Graphen nach unten verschieben.</translation>
</message>
<message>
<source>Mouse</source>
@@ -3900,10 +4132,6 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Legende einschalten</translation>
</message>
<message>
- <source>Reset</source>
- <translation>Zurücksetzen</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Graph zurücksetzen</translation>
</message>
@@ -4117,6 +4345,42 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Graph von einem anderen Profil kopieren.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation>1 μs</translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation>2 μs</translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation>5 μs</translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation>10 μs</translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation>20 μs</translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation>50 μs</translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation>100 μs</translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation>200 μs</translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation>500 μs</translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4161,6 +4425,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>5 Sek.</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation>2 min</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation>5 min</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Wireshark I/O Graphen: %1</translation>
</message>
@@ -4173,6 +4445,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Gefilterte Ereignisse</translation>
</message>
<message>
+ <source>All packets</source>
+ <translation>Alle Pakete</translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation>Alle Ereignisse</translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Alle Pakete</translation>
</message>
@@ -4185,8 +4465,8 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Alle Ereignisse</translation>
</message>
<message>
- <source>Access Denied</source>
- <translation>Zugriff verboten</translation>
+ <source>All Execs</source>
+ <translation>Alle Ausführungen</translation>
</message>
<message>
<source>Hover over the graph for details.</source>
@@ -4233,6 +4513,34 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Klicken um einen Teil des Graphen auszuwählen.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation>%1 Intervalle </translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation>Nach oben links verschieben</translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation>Nach oben mittig verschieben</translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation>Nach oben rechts verschieben</translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation>Nach unten links verschieben</translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation>Nach unten mittig verschieben</translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation>Nach unten rechts verschieben</translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Portable Document Format (*.pdf)</translation>
</message>
@@ -4985,6 +5293,13 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation>Standard</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5961,8 +6276,8 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>LTE Mac Statistiken</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation>LTE/NR Mac Statistiken</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6266,12 +6581,12 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Sequenznummer</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>LTE RLC Graph (UE=%1 Kanal=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation>%1 RLC Graph (UE=%2 Kanal=%3%4 %5 - %6)</translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>LTE RLC Graph - Kein Kanal ausgewählt</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation>3GPP RLC Graph - kein Kanal ausgewählt</translation>
</message>
<message>
<source>Save As…</source>
@@ -6325,8 +6640,8 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>LTE RLC Statistiken</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation>3GPP RLC Statistiken</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6412,6 +6727,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Profil: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation> %1 Angezeigt: %2 (%3%)</translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Profile verwalten…</translation>
</message>
@@ -6473,6 +6792,13 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<numerusform>%Ln Bytes</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln Bit</numerusform>
+ <numerusform>%Ln Bits</numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>Byte %1</translation>
@@ -6486,9 +6812,12 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Ausgewähltes Paket: %1 %2</translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Pakete: %1 %4 Angezeigt: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation>Ausgewählte Ereignisse: %1 %2 </translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation>Ereignisse: %1</translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6520,6 +6849,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Keine Pakete</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation>Keine Ereignisse</translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>Aus ZIP Datei...</translation>
</message>
@@ -6552,6 +6885,13 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation>Filter anzeigen als %1</translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6583,6 +6923,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Zuletzt genutztem Ordner</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation>Das aktuelle Arbeitsverzeichnis</translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Anzeigen von maximal</translation>
</message>
@@ -7013,6 +7357,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Zeige Feldwerte</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation>Aktualisieren</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Diagramm speichern als…</translation>
</message>
@@ -7060,6 +7408,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Paketbytes anzeigen</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation>Ansicht:</translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Paket %1</translation>
</message>
@@ -7082,6 +7434,13 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<numerusform>%Ln Bytes</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln Bit</numerusform>
+ <numerusform>%Ln Bits</numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7541,10 +7900,22 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Dieses Profil kopieren.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation>Die für den automatischen Profilwechsel geprüfte Anzahl von Paketen oder Ereignissen.</translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation>Autoswitch Paketlimit</translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Profile konfigurieren</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation>Autoswitch Ereignislimit</translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Importieren</translation>
@@ -7727,6 +8098,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>gelöscht</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation>Autoswitch Filter</translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>Kopie</translation>
@@ -8087,7 +8462,7 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
<message>
<source>Unacked (Outstanding) Bytes (B)</source>
- <translation type="unfinished"></translation>
+ <translation>Nicht-ACK-bestätigte (ausstehende) Bytes (B)</translation>
</message>
<message>
<source>[no capture file]</source>
@@ -8250,6 +8625,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Marker fehlt?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation>LTE</translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation>NR</translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8270,6 +8653,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation>RAT</translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL Frames</translation>
</message>
@@ -8493,9 +8880,69 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<source>Browse…</source>
<translation>Öffnen…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation>PAKETE</translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation>EREIGNISSE</translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation>BYTES</translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation>BITS</translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation>ANZAHL FRAMES</translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation>ANZAHL FELDER</translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation>SUMME</translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation>MAX</translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation>MIN</translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation>DURCHSCHNITT</translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation>DURCHSATZ</translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation>LAST</translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation>Links</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation>Zentriert</translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation>Rechts</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation>CCCH</translation>
@@ -8596,6 +9043,13 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation>Alle %1 an Inhalt anpassen</translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8711,6 +9165,14 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Aufgelöste Adressen</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation>Kopieren</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>Speichern als...</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Resolved addresses found in %1 </translation>
</message>
@@ -8724,6 +9186,61 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation>als reiner Text</translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation>Ausgewählte Reihen kopieren</translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>Tabelle kopieren</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation>als CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation>als JSON</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation>Ausgewählte Reihen speichern...</translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation>Tabelle speichern als...</translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation>Aufgelöste Adressen speichern als...</translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation>Reiner Text (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation>CSV Dokument (*.csv)</translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation>JSON Dokument (*.json)</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>Warnung</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation>Speichern von %1 nicht möglich: %2</translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10398,6 +10915,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Paket Bytes</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Optionen:&lt;/b&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zeichenketten suchen, die schmale (UTF-8 oder ASCII) or breite (UTF-16) Zeichen enthalten.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10418,6 +10939,18 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Groß- / Kleinschreibung beachten</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation>Rückwärts</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Nach weiterem Vorkommen im aktuellen Paket suchen bevor mit dem nächsten Paket fortgefahren wird.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation>Mehreres Vorkommen</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Nach Daten suchen, durch Angabe eines Anzeigefilters (z.B. ip.addr==10.1.1.1), oder mit einer Hexadezimalen Zeichenkette (z.B. fffffda5) oder einer einfachen Zeichenkette (z.B. Meine Zeichenkette), oder eines regulären Ausdrucks (z.B. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10455,6 +10988,22 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Ungültiger Filter.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation>Ereignisliste</translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation>Ereignisdetails</translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation>Ereignis-Bytes</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Durchsuchen der Informationsspalte der Ereignisliste (Übersichtsfenster), der dekodierten Ereignisanzeigebeschriftungen (Baumansicht) oder der ASCII-konvertierten Ereignisdaten (Hex-Ansicht).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Dieser Filter hat keine Auswirkung.</translation>
</message>
@@ -10898,6 +11447,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Suchen:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Groß- / Kleinschreibung beachten</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>&amp;Nächstes suchen</translation>
</message>
@@ -10993,14 +11546,22 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Speichern als…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation>Dekodiert als %1.</translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Ausgewählte Paketbytes speichern als…</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation>%1 komprimiert</translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation>
- <numerusform>Zeige %Ln Byte an.</numerusform>
- <numerusform>Zeige %Ln Bytes an.</numerusform>
+ <numerusform>Verwende %Ln Byte.</numerusform>
+ <numerusform>Verwende %Ln Bytes.</numerusform>
</translation>
</message>
<message>
@@ -11100,6 +11661,10 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<source>Display filter:</source>
<translation>Anzeigefilter:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation>Kopfdaten entfernen</translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -12073,22 +12638,20 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Einen neuen Eintrag erstellen.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Diesen Eintrag entfernen.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Ausgewählte(n) Eintrag(e) entfernen.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Diesen Eintrag kopieren.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Ausgewählte(n) Eintrag(e) kopieren.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Eintrag nach oben verschieben.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Ausgewählte(n) Eintrag(e) nach oben verschieben.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Eintrag nach unten verschieben.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Ausgewählte(n) Eintrag(e) nach unten verschieben.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12114,20 +12677,20 @@ Um zum Beispiel eine neue Datei zu jeder vollen Stunde zu haben, 1 Stunde angebe
<translation>Einen neuen Eintrag erstellen.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Diesen Eintrag entfernen.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Ausgewählte(n) Eintrag(e) entfernen.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Diesen Eintrag kopieren.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Ausgewählte(n) Eintrag(e) kopieren.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Eintrag nach oben verschieben.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Ausgewählte(n) Eintrag(e) nach oben verschieben.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Eintrag nach unten verschieben.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Ausgewählte(n) Eintrag(e) nach unten verschieben.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12498,10 +13061,18 @@ a:hover {
<translation>Mit Wireshark den Kleber schnüffeln, der das Internet zusammenhält.</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation>Mit Logray den Kleber schnüffeln, der Ihr System zusammenhält.</translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Sie nutzen Wireshark </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation>Sie nutzen Logray</translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation>Updates werden automatisch heruntergeladen.</translation>
</message>
@@ -12778,14 +13349,6 @@ a:hover {
<translation>Keine Dateien gefunden</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Inhalt</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Wireshark Filter</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -13051,10 +13614,6 @@ a:hover {
<translation>Wireless Toolbar</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Hilfe Inhalt</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>Häufige Fragen (en)</translation>
</message>
@@ -13175,11 +13734,6 @@ a:hover {
<translation>Vorheriges Paket finden</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>Paket &amp;markieren</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Alle angezeigte Pakete markieren</translation>
</message>
@@ -13208,11 +13762,6 @@ a:hover {
<translation>Zum vorherigen markierten Paket gehen</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>Paket &amp;ignorieren bzw. zurücksetzen</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Alle angezeigten Pakete ignorieren</translation>
</message>
@@ -13653,10 +14202,6 @@ a:hover {
<translation>Ansicht zurücksetzen</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Anzeige auf Ausgangsgröße zurücksetzen</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>Sekunden seit erstem aufgezeichneten Paket</translation>
</message>
@@ -13666,19 +14211,19 @@ a:hover {
</message>
<message>
<source>Tenths of a millisecond</source>
- <translation>Zehntelmillisekunde</translation>
+ <translation>Zehntelmillisekunden</translation>
</message>
<message>
<source>Hundredths of a millisecond</source>
- <translation>Hundertstelmillisekunde</translation>
+ <translation>Hundertstelmillisekunden</translation>
</message>
<message>
<source>Tenths of a microsecond</source>
- <translation>Zehntelmikrosekunde</translation>
+ <translation>Zehntelmikrosekunden</translation>
</message>
<message>
<source>Hundredths of a microsecond</source>
- <translation>Hundertstelmikrosekunde</translation>
+ <translation>Hundertstelmikrosekunden</translation>
</message>
<message>
<source>Packet &amp;Diagram</source>
@@ -13817,22 +14362,30 @@ a:hover {
<translation>MAC Adressblöcke</translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
- <translation>TLS Keylog Launcher</translation>
- </message>
- <message>
- <source>Release Notes</source>
- <translation>Veröffentlichungshinweise</translation>
- </message>
- <message>
<source>&amp;Options…</source>
<translation>&amp;Optionen...</translation>
</message>
<message>
+ <source>&amp;3GPP Uu</source>
+ <translation>&amp;3GPP Uu</translation>
+ </message>
+ <message>
<source>&amp;Wireless</source>
<translation>&amp;Wireless</translation>
</message>
<message>
+ <source>&amp;User&apos;s Guide</source>
+ <translation>Ben&amp;utzerhandbuch (en)</translation>
+ </message>
+ <message>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation>Wireshark Benutzerhandbuch (en)</translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
+ <translation>Anzeigefilter</translation>
+ </message>
+ <message>
<source>Capture &amp;Filters…</source>
<translation>Mitschnitt&amp;filter...</translation>
</message>
@@ -13877,10 +14430,18 @@ a:hover {
<translation>Vorheriges finden</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation>Ausgewählte &amp;markieren</translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Jedes ausgewählte Paket markieren bzw. Markierung rückgängig machen</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation>Ausgewählte &amp;ignorieren</translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Jedes ausgewählte Paket ignorieren bzw. Ignorieren zurücksetzen</translation>
</message>
@@ -13921,6 +14482,18 @@ a:hover {
<translation>TCP Durchsatz</translation>
</message>
<message>
+ <source>General</source>
+ <translation>Allgemein</translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation>Query-Response</translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation>DNS Query-Response Statistiken</translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>Anfrage Sequenzen</translation>
</message>
@@ -13929,6 +14502,14 @@ a:hover {
<translation>HTTP Anfrage Sequenzen</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation>E2AP</translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation>E2AP Nachrichten</translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Dekodieren &amp;als...</translation>
</message>
@@ -13989,6 +14570,10 @@ a:hover {
<translation>Normale Größe</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation>Anzeige auf Standardgröße zurücksetzen</translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Spaltengröße anpassen</translation>
</message>
@@ -14078,11 +14663,11 @@ a:hover {
</message>
<message>
<source>Tenths of a second</source>
- <translation>Zehntelsekunde</translation>
+ <translation>Zehntelsekunden</translation>
</message>
<message>
<source>Hundredths of a second</source>
- <translation>Hundertstel</translation>
+ <translation>Hundertstelsekunden</translation>
</message>
<message>
<source>Milliseconds</source>
@@ -14247,6 +14832,14 @@ a:hover {
<translation>Zum Paket gehen auf das das ausgewählte Feld referenziert.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation>TLS Keylog Launcher</translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>Release Notes</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;VoIP Anrufe</translation>
</message>
@@ -14279,10 +14872,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14567,6 +15156,10 @@ a:hover {
<translation>&amp;Ohne Speichern beenden</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation>USB CDC-Daten</translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>In dieser Wireshark-Version ist kein &quot;rtp.ssrc&quot; Feld vorhanden.</translation>
</message>
diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp
index 4045868f..ae8fc73c 100644
--- a/ui/qt/wireshark_dialog.cpp
+++ b/ui/qt/wireshark_dialog.cpp
@@ -9,8 +9,6 @@
#include "config.h"
-#include <glib.h>
-
#include "cfile.h"
#include <epan/packet.h>
@@ -95,7 +93,7 @@ void WiresharkDialog::updateWidgets()
setWindowSubtitle(subtitle_);
}
-bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, tap_reset_cb tap_reset, tap_packet_cb tap_packet, tap_draw_cb tap_draw)
+bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, unsigned flags, tap_reset_cb tap_reset, tap_packet_cb tap_packet, tap_draw_cb tap_draw)
{
GString *error_string = register_tap_listener(tap_name, tap_data, filter, flags,
tap_reset, tap_packet, tap_draw, NULL);
diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h
index ad557ebc..20fd7113 100644
--- a/ui/qt/wireshark_dialog.h
+++ b/ui/qt/wireshark_dialog.h
@@ -39,6 +39,11 @@ public:
// XXX Unlike the entire QWidget API, parent is mandatory here.
explicit WiresharkDialog(QWidget &parent, CaptureFile &capture_file);
+ /**
+ * @brief true if the file has been closed, false otherwise.
+ */
+ bool fileClosed() const { return file_closed_; }
+
protected:
virtual void keyPressEvent(QKeyEvent *event) { QDialog::keyPressEvent(event); }
virtual void accept();
@@ -93,7 +98,7 @@ protected:
* @param tap_draw Draw callback.
*/
bool registerTapListener(const char *tap_name, void *tap_data,
- const char *filter, guint flags,
+ const char *filter, unsigned flags,
tap_reset_cb tap_reset,
tap_packet_cb tap_packet,
tap_draw_cb tap_draw);
@@ -103,17 +108,21 @@ protected:
*/
virtual void removeTapListeners();
- /**
- * @brief true if the file has been closed, false otherwise.
- */
- // XXX Needs a getter?
+ // XXX - Move this to private, have subclasses use the getter?
bool file_closed_;
/**
* @brief Check to see if the user has closed (and not minimized) the dialog.
* @return true if the dialog has been closed, false otherwise.
*/
- bool dialogClosed() { return dialog_closed_; }
+ bool dialogClosed() const { return dialog_closed_; }
+
+ /**
+ * @brief Check to see if we're currently retapping. If this is positive,
+ * tapping will fail in process_specified_records.
+ * @return The current retap depth. (In current implementation, 0 or 1.)
+ */
+ int retapDepth() const { return retap_depth_; }
/**
* @brief Called when the capture file is about to close. This can be
diff --git a/ui/qt/wireshark_en.ts b/ui/qt/wireshark_en.ts
index 4478363c..5f343152 100644
--- a/ui/qt/wireshark_en.ts
+++ b/ui/qt/wireshark_en.ts
@@ -44,7 +44,7 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Filter by path</source>
+ <source>Search Folders</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -80,6 +80,14 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation type="unfinished"></translation>
</message>
@@ -755,6 +763,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -863,10 +893,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation type="unfinished"></translation>
@@ -948,7 +974,7 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Capture file comments</source>
+ <source>Edit Comments</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -960,10 +986,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Save Comments</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation type="unfinished"></translation>
</message>
@@ -1012,10 +1034,18 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation type="unfinished"></translation>
</message>
@@ -1052,6 +1082,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation type="unfinished"></translation>
</message>
@@ -1064,6 +1098,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation type="unfinished"></translation>
</message>
@@ -1072,6 +1110,26 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation type="unfinished"></translation>
</message>
@@ -1096,6 +1154,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation type="unfinished"></translation>
</message>
@@ -1108,6 +1170,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation type="unfinished"></translation>
</message>
@@ -1120,11 +1186,11 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Section Comment</source>
+ <source>Packet Comments</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Packet Comments</source>
+ <source>Event Comments</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1137,6 +1203,12 @@
</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1363,6 +1435,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>compression</source>
<translation type="unfinished"></translation>
</message>
@@ -1375,6 +1455,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1463,6 +1567,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1523,7 +1631,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1554,6 +1662,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1781,6 +1897,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1828,6 +1952,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1894,6 +2037,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation type="unfinished"></translation>
</message>
@@ -2008,23 +2155,31 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>…as C String</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>…as Go literal</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -2032,6 +2187,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation type="unfinished"></translation>
</message>
@@ -2825,6 +2996,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2864,10 +3039,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Save</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Default</source>
<translation type="unfinished"></translation>
</message>
@@ -3009,6 +3180,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Open </source>
<translation type="unfinished"></translation>
</message>
@@ -3092,10 +3271,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation type="unfinished"></translation>
</message>
@@ -3181,75 +3368,71 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>capture files</source>
+ <source>Temp</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Temp</source>
+ <source>Personal configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>untitled capture files</source>
+ <source>Global configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Personal configuration</source>
+ <source>System</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Global configuration</source>
+ <source>ethers, ipxnets</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
+ <source>Program</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>dfilters, preferences, manuf, …</source>
+ <source>Personal Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>System</source>
+ <source>Global Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>ethers, ipxnets</source>
+ <source>Personal Lua Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Program</source>
+ <source>Global Lua Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>program files</source>
+ <source>Lua scripts</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Personal Plugins</source>
+ <source>&quot;File&quot; dialog location</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>binary plugins</source>
+ <source>Capture files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Global Plugins</source>
+ <source>Untitled capture files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Personal Lua Plugins</source>
+ <source>Preferences, profiles, manuf, …</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Global Lua Plugins</source>
+ <source>Program files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Lua scripts</source>
+ <source>Binary plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3257,7 +3440,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3395,6 +3578,24 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation type="unfinished"></translation>
</message>
@@ -3427,6 +3628,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation type="unfinished"></translation>
</message>
@@ -3442,10 +3655,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation type="unfinished"></translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation type="unfinished">
@@ -3473,8 +3682,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
+ <source>Show as</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3490,11 +3710,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3801,28 +4032,27 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
+ <source>Add a new graph.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Add a new graph.</source>
+ <source>Clear all graphs.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Duplicate this graph.</source>
+ <source>Remove the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Clear all graphs.</source>
+ <source>Duplicate the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph upwards.</source>
+ <source>Move the selected graph(s) upwards.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
+ <source>Move the selected graph(s) downwards.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3866,10 +4096,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation type="unfinished"></translation>
</message>
@@ -4083,6 +4309,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation type="unfinished"></translation>
</message>
@@ -4127,6 +4389,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation type="unfinished"></translation>
</message>
@@ -4139,6 +4409,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation type="unfinished"></translation>
</message>
@@ -4151,7 +4429,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4199,6 +4477,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation type="unfinished"></translation>
</message>
@@ -4951,6 +5257,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5927,7 +6240,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
+ <source>LTE/NR Mac Statistics</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6207,11 +6520,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
+ <source>3GPP RLC Graph - no channel selected</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6266,7 +6579,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
+ <source>3GPP RLC Statistics</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6353,6 +6666,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation type="unfinished"></translation>
</message>
@@ -6414,6 +6731,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform>%Ln bytes</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln bit</numerusform>
+ <numerusform>%Ln bits</numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation type="unfinished"></translation>
@@ -6427,8 +6751,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6461,6 +6788,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>No Events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation type="unfinished"></translation>
</message>
@@ -6493,6 +6824,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6524,6 +6862,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation type="unfinished"></translation>
</message>
@@ -6954,6 +7296,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation type="unfinished"></translation>
</message>
@@ -7001,6 +7347,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation type="unfinished"></translation>
</message>
@@ -7023,6 +7373,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform>%Ln bytes</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln bit</numerusform>
+ <numerusform>%Ln bits</numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7480,10 +7837,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation type="unfinished"></translation>
@@ -7666,6 +8035,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation type="unfinished"></translation>
@@ -8189,6 +8562,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation type="unfinished"></translation>
</message>
@@ -8209,6 +8590,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation type="unfinished"></translation>
</message>
@@ -8432,9 +8817,69 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation type="unfinished"></translation>
@@ -8535,6 +8980,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8650,6 +9102,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation type="unfinished"></translation>
</message>
@@ -8661,6 +9121,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10331,6 +10846,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -10351,6 +10870,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation type="unfinished"></translation>
@@ -10388,6 +10919,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation type="unfinished"></translation>
</message>
@@ -10808,6 +11355,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation type="unfinished"></translation>
</message>
@@ -10903,14 +11454,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation type="unfinished">
- <numerusform>Displaying %Ln byte.</numerusform>
- <numerusform>Displaying %Ln bytes.</numerusform>
+ <numerusform>Using %Ln byte.</numerusform>
+ <numerusform>Using %Ln bytes.</numerusform>
</translation>
</message>
<message>
@@ -11010,6 +11569,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11944,21 +12507,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
+ <source>Remove the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
+ <source>Copy the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
+ <source>Move the selected entry(ies) up.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
+ <source>Move the selected entry(ies) down.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -11985,19 +12546,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Remove this entry.</source>
+ <source>Remove the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
+ <source>Copy the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
+ <source>Move the selected entry(ies) up.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
+ <source>Move the selected entry(ies) down.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -12327,10 +12888,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation type="unfinished"></translation>
</message>
@@ -12607,14 +13176,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>TShark</source>
<translation type="unfinished"></translation>
</message>
@@ -12880,10 +13441,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>Help contents</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>FAQs</source>
<translation type="unfinished"></translation>
</message>
@@ -13006,7 +13563,7 @@ a:hover {
<message>
<source>&amp;Mark/Unmark Packet(s)</source>
<oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation type="unfinished">&amp;Mark/Unmark Packet</translation>
+ <translation type="obsolete">&amp;Mark/Unmark Packet</translation>
</message>
<message>
<source>Mark All Displayed</source>
@@ -13039,7 +13596,7 @@ a:hover {
<message>
<source>&amp;Ignore/Unignore Packet(s)</source>
<oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation type="unfinished">&amp;Ignore/Unignore Packet</translation>
+ <translation type="obsolete">&amp;Ignore/Unignore Packet</translation>
</message>
<message>
<source>Ignore All Displayed</source>
@@ -13482,10 +14039,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13646,19 +14199,27 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
+ <source>&amp;Wireless</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
+ <source>&amp;User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13706,10 +14267,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13750,6 +14319,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation type="unfinished"></translation>
</message>
@@ -13758,6 +14339,14 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation type="unfinished"></translation>
</message>
@@ -13818,6 +14407,10 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation type="unfinished"></translation>
</message>
@@ -14076,6 +14669,14 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation type="unfinished"></translation>
</message>
@@ -14108,10 +14709,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation type="unfinished"></translation>
</message>
@@ -14396,6 +14993,10 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/ui/qt/wireshark_es.ts b/ui/qt/wireshark_es.ts
index dc082029..acd75cb1 100644
--- a/ui/qt/wireshark_es.ts
+++ b/ui/qt/wireshark_es.ts
@@ -44,8 +44,8 @@
<translation>Carpetas</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Filtrar por ruta</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Licencia</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>El directorio no existe</translation>
</message>
@@ -755,6 +763,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -840,10 +870,6 @@
<translation>Filtro de lectura:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Comprimir con g&amp;zip</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Abrir archivo de captura</translation>
@@ -925,8 +951,8 @@
<translation>Detalles</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Comentarios de archivo de captura</translation>
+ <source>Edit Comments</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
@@ -937,10 +963,6 @@
<translation>Copiar al portapapeles</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Guardar comentarios</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Propiedades de archivo de captura</translation>
</message>
@@ -989,10 +1011,18 @@
<translation>Primer paquete</translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Último paquete</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Transcurrido</translation>
</message>
@@ -1029,6 +1059,10 @@
<translation>Paquetes perdidos</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Filtro de captura</translation>
</message>
@@ -1041,6 +1075,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>ninguno</translation>
</message>
@@ -1049,6 +1087,26 @@
<translation>%1 bytes</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation type="unfinished">Comentarios</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation type="unfinished">Tipo</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation type="unfinished">Tamaño</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Estadísticas</translation>
</message>
@@ -1073,6 +1131,10 @@
<translation>Paquetes</translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished">Eventos</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Espacio de tiempo, s</translation>
</message>
@@ -1085,6 +1147,10 @@
<translation>Promedio de tamaño de paquete, B</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Bytes</translation>
</message>
@@ -1097,14 +1163,14 @@
<translation>Promedio de bits/s</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Sección de comentarios</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Comentarios de paquete</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Trama %1:</translation>
</message>
@@ -1114,6 +1180,12 @@
</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1341,6 +1413,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>compression</source>
<translation>compresión</translation>
</message>
@@ -1353,6 +1433,30 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Después de que la captura haya cambiado al siguiente archivo y el número proporcionado haya excedido, se eliminará el archivo más antiguo.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1441,6 +1545,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Detiene la captura después de haber sido creado el número especificado de archivos.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Detiene la captura después de haber sido capturada la cantidad de datos especificada.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1501,8 +1609,8 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Error</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Varios archivos: El tamaño de archivo solicitado es demasiado grande. El tamaño de archivo no puede ser mayor de 2 GiB. </translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1532,6 +1640,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Capturar paquetes en modo promiscuo</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Captura paquetes en formato de archivo de captura de próxima generación.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1759,6 +1875,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1806,6 +1930,25 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1872,6 +2015,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Bits/s B </translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Paquetes totales</translation>
</message>
@@ -1986,23 +2133,31 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>…as C String</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>…as Go literal</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -2010,6 +2165,22 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation type="unfinished"></translation>
</message>
@@ -2805,6 +2976,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<source>Display filter:</source>
<translation>Filtro de visualización:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2844,10 +3019,6 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
- <source>Save</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Default</source>
<translation type="unfinished">Predeterminado</translation>
</message>
@@ -2989,6 +3160,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Filtros de visualización</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Open </source>
<translation type="unfinished">Abrir</translation>
</message>
@@ -3072,10 +3251,18 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Nombre de filtro</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Expresión de filtro</translation>
</message>
@@ -3161,22 +3348,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>Diálogos de &quot;Archivo&quot;</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>archivos de captura</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Temporal</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>archivos de captura sin título</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Configuración personal</translation>
</message>
@@ -3185,14 +3360,6 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Configuración global</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>System</source>
<translation>Sistema</translation>
</message>
@@ -3205,18 +3372,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Programa</translation>
</message>
<message>
- <source>program files</source>
- <translation>archivos de programa</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Complementos personales</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>complementos binarios</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Complementos globales</translation>
</message>
@@ -3233,11 +3392,35 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>Ruta personal de Extcap</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3361,6 +3544,24 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation>Clic para seleccionar.</translation>
</message>
@@ -3393,6 +3594,18 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>Conversación completa (%1)</translation>
</message>
@@ -3408,10 +3621,6 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<source>Save Stream Content As…</source>
<translation>Guardar contenido de secuencia como…</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation type="unfinished"></translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation type="unfinished">
@@ -3439,9 +3648,20 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Hint.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Mostrar datos como</translation>
+ <source>Show as</source>
+ <translation type="unfinished">Mostrar como</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Stream</source>
@@ -3456,11 +3676,22 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Buscar:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Mayúsculas y minúsculas</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Buscar &amp;siguiente</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3796,28 +4027,27 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Elimina esta gráfica.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Añade una nueva gráfica.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Duplica esta gráfica.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Vacía todas las gráficas.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
+ <source>Remove the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
+ <source>Duplicate the selected graph(s).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3861,10 +4091,6 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation>Restablecer</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Restablecer gráfica</translation>
</message>
@@ -3967,7 +4193,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Go to packet currently under the cursor</source>
- <translation type="unfinished"></translation>
+ <translation>Va al paquete actualmente debajo del cursor</translation>
</message>
<message>
<source>G</source>
@@ -4078,6 +4304,42 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Copia gráficas desde otro perfil.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4122,6 +4384,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>5 sec</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10 min {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10 min {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Gráficas E/S de Wireshark: %1</translation>
</message>
@@ -4134,6 +4404,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Todos los paquetes</translation>
</message>
@@ -4146,7 +4424,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4183,7 +4461,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Release to zoom, x = %1 to %2, y = %3 to %4</source>
- <translation>Soltar para zoom, x = %1 a %2, y = %3 a %4</translation>
+ <translation>Suelte para zoom, x = %1 a %2, y = %3 a %4</translation>
</message>
<message>
<source>Unable to select range.</source>
@@ -4194,6 +4472,34 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Clic para seleccionar una parte de la gráfica.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Formato de documento portable (*.pdf)</translation>
</message>
@@ -4946,6 +5252,13 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5922,7 +6235,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
+ <source>LTE/NR Mac Statistics</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6147,7 +6460,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Go to packet currently under the cursor</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Va al paquete actualmente debajo del cursor</translation>
</message>
<message>
<source>G</source>
@@ -6202,11 +6515,11 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
+ <source>3GPP RLC Graph - no channel selected</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6227,7 +6540,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Release to zoom, x = %1 to %2, y = %3 to %4</source>
- <translation type="unfinished">Soltar para zoom, x = %1 a %2, y = %3 a %4</translation>
+ <translation type="unfinished">Suelte para zoom, x = %1 a %2, y = %3 a %4</translation>
</message>
<message>
<source>Unable to select range.</source>
@@ -6261,7 +6574,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
+ <source>3GPP RLC Statistics</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6348,6 +6661,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Perfil: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Administrar perfiles…</translation>
</message>
@@ -6409,6 +6726,13 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>Byte %1</translation>
@@ -6422,9 +6746,12 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Paquete seleccionado: %1 %2</translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Paquetes: %1 %4 Mostrado: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6456,6 +6783,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>No hay paquetes</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation type="unfinished"></translation>
</message>
@@ -6488,6 +6819,13 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6519,6 +6857,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>La carpeta usada más recientemente</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Mostrar hasta</translation>
</message>
@@ -6949,6 +7291,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">Actualizar</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation type="unfinished"></translation>
</message>
@@ -6996,6 +7342,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Mostrar bytes de paquete</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Paquete %1</translation>
</message>
@@ -7018,6 +7368,13 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7475,10 +7832,22 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Copia este perfil.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Configuración de perfiles</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Importar</translation>
@@ -7647,6 +8016,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation type="unfinished"></translation>
@@ -8170,6 +8543,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished"></translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation type="unfinished"></translation>
</message>
@@ -8190,6 +8571,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>Tramas UL</translation>
</message>
@@ -8413,12 +8798,72 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<source>Browse…</source>
<translation type="unfinished">Explorar…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
- <translation>CCCH</translation>
+ <translation type="unfinished">CCCH</translation>
</message>
</context>
<context>
@@ -8516,6 +8961,13 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8631,6 +9083,14 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Direcciones resueltas</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished">Copiar</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation type="unfinished">Guardar como…</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Direcciones resultas encontradas en %1</translation>
</message>
@@ -8644,6 +9104,61 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished">como CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished">Texto plano (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished">Advertencia</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -8981,11 +9496,11 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Preparar &amp;filtro</translation>
</message>
<message>
<source>Prepare a filter matching the selected stream(s).</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Prepara un filtro que coincide con los flujo(s) seleccionado(s).</translation>
</message>
<message>
<source>&amp;Current Tab</source>
@@ -9288,7 +9803,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Invert selection</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Invierte la selección</translation>
</message>
<message>
<source>Play/Pause</source>
@@ -9336,11 +9851,11 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Preparar &amp;filtro</translation>
</message>
<message>
<source>Prepare a filter matching the selected stream(s).</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Prepara un filtro que coincide con los flujo(s) seleccionado(s).</translation>
</message>
<message>
<source>R&amp;efresh streams</source>
@@ -9396,7 +9911,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Go to packet currently under the cursor</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Va al paquete actualmente debajo del cursor</translation>
</message>
<message>
<source>Play the stream</source>
@@ -9424,7 +9939,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Select</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Seleccionar</translation>
</message>
<message>
<source>Audio Routing</source>
@@ -9615,7 +10130,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Start Time</source>
- <translation type="unfinished"></translation>
+ <translation>Hora de inicio</translation>
</message>
<message>
<source>Duration</source>
@@ -9671,7 +10186,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation type="unfinished"></translation>
+ <translation>Preparar &amp;filtro</translation>
</message>
<message>
<source>&amp;Export</source>
@@ -9767,7 +10282,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Invert selection</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Invierte la selección</translation>
</message>
<message>
<source>Go To Setup</source>
@@ -9783,7 +10298,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Prepare a filter matching the selected stream(s).</source>
- <translation type="unfinished"></translation>
+ <translation>Prepara un filtro que coincide con los flujo(s) seleccionado(s).</translation>
</message>
<message>
<source>P</source>
@@ -9815,7 +10330,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Copy stream list as CSV.</source>
- <translation type="unfinished">Copia el listado de secuencias como CSV.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Copy as YAML</source>
@@ -9823,7 +10338,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Copy stream list as YAML.</source>
- <translation type="unfinished">Copia el listado de secuencias como YAML.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>RTP Streams</source>
@@ -9831,7 +10346,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Select</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Seleccionar</translation>
</message>
<message>
<source>as CSV</source>
@@ -10314,6 +10829,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Bytes de paquete</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Busca cadenas que contienen caracteres reducidos (UTF-8 y ASCII) o ampliados (UTF-16).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10334,6 +10853,18 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Mayúsculas y minúsculas</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Busca datos usando sintaxis de filtro de visualización (e.j. ip.addr==10.1.1.1), una cadena hexadecimal (e.j. fffffda5), una cadena simple (e.j. mi cadena) o una expresión regular (e.j. colo?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10371,6 +10902,22 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Filtro no valido.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Este filtro no comprueba nada.</translation>
</message>
@@ -10670,7 +11217,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Go to packet currently under the cursor</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Va al paquete actualmente debajo del cursor</translation>
</message>
<message>
<source>G</source>
@@ -10791,6 +11338,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Buscar:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Mayúsculas y minúsculas</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Buscar &amp;siguiente</translation>
</message>
@@ -10886,11 +11437,19 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation type="unfinished">Guardar como…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
@@ -10993,6 +11552,10 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<source>Display filter:</source>
<translation type="unfinished">Filtro de visualización:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11375,7 +11938,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Go to packet currently under the cursor</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Va al paquete actualmente debajo del cursor</translation>
</message>
<message>
<source>G</source>
@@ -11571,7 +12134,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Release to zoom, x = %1 to %2, y = %3 to %4</source>
- <translation type="unfinished">Soltar para zoom, x = %1 a %2, y = %3 a %4</translation>
+ <translation>Suelte para zoom, x = %1 a %2, y = %3 a %4</translation>
</message>
<message>
<source>Unable to select range.</source>
@@ -11927,22 +12490,20 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Crea una nueva entrada.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Elimina esta entrada.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Copia esta entrada.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Mueve entrada hacia arriba.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Mueve entrada hacia abajo.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -11968,20 +12529,20 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
<translation>Crea una nueva entrada.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Elimina esta entrada.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Copia esta entrada.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Mueve entrada hacia arriba.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Mueve entrada hacia abajo.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12024,19 +12585,19 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Flow &amp;Sequence</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;Secuencia de flujo</translation>
</message>
<message>
<source>Show flow sequence for selected call(s).</source>
- <translation type="unfinished"></translation>
+ <translation>Muestra la secuencia de flujo para la(s) llamada(s) seleccionada(s).</translation>
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation type="unfinished"></translation>
+ <translation>Preparar &amp;filtro</translation>
</message>
<message>
<source>Prepare a filter matching the selected calls(s).</source>
- <translation type="unfinished"></translation>
+ <translation>Prepara un filtro que coincide con la(s) llamada(s) seleccionada(s).</translation>
</message>
<message>
<source>Cop&amp;y</source>
@@ -12048,11 +12609,11 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>All</source>
- <translation type="unfinished"></translation>
+ <translation>Todo</translation>
</message>
<message>
<source>Select all</source>
- <translation type="unfinished">Selecciona todo</translation>
+ <translation>Selecciona todo</translation>
</message>
<message>
<source>None</source>
@@ -12060,11 +12621,11 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Invert</source>
- <translation type="unfinished">Invertir</translation>
+ <translation>Invertir</translation>
</message>
<message>
<source>Invert selection</source>
- <translation type="unfinished"></translation>
+ <translation>Invierte la selección</translation>
</message>
<message>
<source>Select related RTP streams</source>
@@ -12092,23 +12653,23 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Display time as time of day</source>
- <translation type="unfinished"></translation>
+ <translation>Mostrar hora como hora de día</translation>
</message>
<message>
<source>Copy as CSV</source>
- <translation type="unfinished">Copiar como CSV</translation>
+ <translation>Copiar como CSV</translation>
</message>
<message>
<source>Copy stream list as CSV.</source>
- <translation type="unfinished">Copia el listado de secuencias como CSV.</translation>
+ <translation>Copia la lista de secuencias como CSV.</translation>
</message>
<message>
<source>Copy as YAML</source>
- <translation type="unfinished">Copiar como YAML</translation>
+ <translation>Copiar como YAML</translation>
</message>
<message>
<source>Copy stream list as YAML.</source>
- <translation type="unfinished">Copia el listado de secuencias como YAML.</translation>
+ <translation>Copia la lista de secuencias como YAML.</translation>
</message>
<message>
<source>SIP Flows</source>
@@ -12116,7 +12677,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>VoIP Calls</source>
- <translation type="unfinished"></translation>
+ <translation>Llamadas VoIP</translation>
</message>
<message>
<source>as CSV</source>
@@ -12128,7 +12689,7 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Select</source>
- <translation type="unfinished"></translation>
+ <translation>Seleccionar</translation>
</message>
</context>
<context>
@@ -12147,11 +12708,11 @@ Por ejemplo, use 1 hora para tener creado un nuevo archivo cada hora en punto.</
</message>
<message>
<source>Start Time</source>
- <translation type="unfinished"></translation>
+ <translation>Hora de inicio</translation>
</message>
<message>
<source>Stop Time</source>
- <translation type="unfinished"></translation>
+ <translation>Hora de finalización</translation>
</message>
<message>
<source>Initial Speaker</source>
@@ -12352,10 +12913,18 @@ a:hover {
<translation>Está absorbiendo el pegamento que mantiene unido internet usando Wireshark</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Está ejecutando Wireshark</translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation>Recibe actualizaciones automáticas.</translation>
</message>
@@ -12632,14 +13201,6 @@ a:hover {
<translation>No se encontraron archivos</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Contenidos</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Filtro de Wireshark</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12905,10 +13466,6 @@ a:hover {
<translation>Barra de herramientas de wireless</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Contenidos de ayuda</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>FAQs</translation>
</message>
@@ -13029,11 +13586,6 @@ a:hover {
<translation>Busca el paquete anterior</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Marcar/Desmarcar paquete</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Marcar todos los mostrados</translation>
</message>
@@ -13062,11 +13614,6 @@ a:hover {
<translation>Va al paquete marcado anterior</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Ignorar/No ignorar paquete</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Ignorar todos los mostrados</translation>
</message>
@@ -13216,7 +13763,7 @@ a:hover {
</message>
<message>
<source>Flow sequence diagram</source>
- <translation>Diagrama de flujo de secuencia</translation>
+ <translation>Diagrama de secuencia de flujo</translation>
</message>
<message>
<source>ANCP</source>
@@ -13507,10 +14054,6 @@ a:hover {
<translation>Restablecer diseño</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Restablece el diseño de apariencia al tamaño por defecto</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>Segundos desde primer paquete capturado</translation>
</message>
@@ -13671,20 +14214,28 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>&amp;Opciones…</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;Wireless</source>
+ <translation>&amp;Wireless</translation>
+ </message>
+ <message>
+ <source>&amp;User&apos;s Guide</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>&amp;Opciones…</translation>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
- <translation>&amp;Wireless</translation>
+ <source>Display Filters</source>
+ <translation type="unfinished">Filtros de visualización</translation>
</message>
<message>
<source>Capture &amp;Filters…</source>
@@ -13731,10 +14282,18 @@ a:hover {
<translation>Buscar ant&amp;erior</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Marca o desmarca cada paquete seleccionado</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Ignora o no ignora cada paquete seleccionado</translation>
</message>
@@ -13775,6 +14334,18 @@ a:hover {
<translation>Rendimiento TCP</translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>Secuencias de petición</translation>
</message>
@@ -13783,6 +14354,14 @@ a:hover {
<translation>Secuencias de solicitud HTTP</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Decodificar &amp;como…</translation>
</message>
@@ -13843,6 +14422,10 @@ a:hover {
<translation>Tamaño normal</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Cambiar tamaño de columnas</translation>
</message>
@@ -14101,6 +14684,14 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;Llamadas VoIP</translation>
</message>
@@ -14133,10 +14724,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14421,6 +15008,10 @@ a:hover {
<translation>Salir &amp;sin guardar</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/ui/qt/wireshark_fr.ts b/ui/qt/wireshark_fr.ts
index 7c63477f..b16a4c38 100644
--- a/ui/qt/wireshark_fr.ts
+++ b/ui/qt/wireshark_fr.ts
@@ -29,7 +29,7 @@
</message>
<message>
<source>Copy to Clipboard</source>
- <translation type="unfinished"></translation>
+ <translation>Copier dans le Presse-papiers</translation>
</message>
<message>
<source>Authors</source>
@@ -44,8 +44,8 @@
<translation>Dossiers</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Filtrer par chemin</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Licence</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Le dossier n&apos;existe pas</translation>
</message>
@@ -731,11 +739,11 @@
</message>
<message>
<source>…as decimal</source>
- <translation type="unfinished"></translation>
+ <translation>...en décimal</translation>
</message>
<message>
<source>…as octal</source>
- <translation type="unfinished"></translation>
+ <translation>...en octal</translation>
</message>
<message>
<source>…as bits</source>
@@ -755,6 +763,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>Ajouter un commentaire</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>Section %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -840,10 +870,6 @@
<translation>Filtre de lecture :</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Compresser avec g&amp;zip</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Ouvrir un fichier de capture</translation>
@@ -925,8 +951,8 @@
<translation>Détails</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Commentaires du fichier de capture</translation>
+ <source>Edit Comments</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
@@ -937,10 +963,6 @@
<translation>Copier dans le Presse-papiers</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Enregister les commentaires</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Propriétés du fichier de capture</translation>
</message>
@@ -989,10 +1011,18 @@
<translation>Premier paquet</translation>
</message>
<message>
+ <source>First event</source>
+ <translation>Premier événement</translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Dernier paquet</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation>Dernier événement</translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Temps écoulé</translation>
</message>
@@ -1029,6 +1059,10 @@
<translation>Paquets rejetés</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation>Événements rejetés</translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Filtre de capture</translation>
</message>
@@ -1041,6 +1075,10 @@
<translation>Limite de taille de paquet (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>aucun</translation>
</message>
@@ -1049,6 +1087,26 @@
<translation>%1 octets</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation type="unfinished">Commentaires</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation type="unfinished">Type</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>Taille</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Statistiques</translation>
</message>
@@ -1073,6 +1131,10 @@
<translation>Paquets</translation>
</message>
<message>
+ <source>Events</source>
+ <translation>Événements</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Temps, s</translation>
</message>
@@ -1085,6 +1147,10 @@
<translation>Taille des paquets moyenne, O</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Octets</translation>
</message>
@@ -1097,14 +1163,14 @@
<translation>Débit moyen (bits/s)</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Commentaire de la Section</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Commentaires du Paquet</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Trame %1 : </translation>
</message>
@@ -1116,6 +1182,12 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1343,6 +1415,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les heures à l&apos;heure.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Habituellement, une carte réseau sans-fil ne capture que le trafic émis vers et depuis sa propre adresse réseau, et capture seulement le trafic de &lt;em&gt;données utilisateur&lt;/em&gt; avec un &amp;quot;faux&amp;quot; en-tête Ethernet. Si vous voulez capturer tout le trafic que la carte réseau sans-fil peut &amp;quot;voir&amp;quot;, ou êtes intéressés par les paquets de gestion ou de contrôle 802.11, ou les informations de niveau radio, cochez cette option. La disponibilité du mode Moniteur dépend de la carte sans-fil et de son pilote. Consultez le Wiki pour de plus amples détails concernant la capture de paquets sur un réseau WLAN.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>Activer le mode Moniteur sur toutes les interfaces 802.11</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>compression</translation>
</message>
@@ -1355,6 +1435,30 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Dans le mode fichiers multiples, date et heure ainsi que le numéro d&apos;index du fichier sont insérés entre le nom de fichier et le suffixe. Sélectionnez leur ordre.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date et heure avant le numéro d&apos;index du fichier. Ceci force le tri des fichiers par ordre de leur heure de création et garde les fichiers d&apos;un même batch proches.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Numéro d&apos;index de fichier avant la date et heure. Ceci est l&apos;ordre utilisé historiquement par Wireshark.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Après basculement de la capture vers le fichier suivant, si le nombre de fichiers indiqué est dépassé, le fichier le plus ancien sera supprimé.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1443,6 +1547,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Arrête la capture après avoir créé le nombre de fichiers indiqués.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation>Arrête la capture après avoir créé le nombre de fichiers indiqués.</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Arrêter la capture après avoir capturé le volume de données indiqué.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1503,8 +1611,8 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Erreur</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Fichiers multiples : la taille demandée est trop élevée. La taille d&apos;un fichier ne doit pas dépasser 2 Gio.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation>Fichier multiples : la taille demandée est trop élevée, elle ne doit pas être supérieure à 2 To.</translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1534,6 +1642,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Capture de Paquets en mode promiscuous</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Habituellement, une carte réseau sans-fil ne capture que le trafic émis vers et depuis sa propre adresse réseau, et capture seulement le trafic de &lt;em&gt;données utilisateur&lt;/em&gt; avec un &amp;quot;faux&amp;quot; en-tête Ethernet. Si vous voulez capturer tout le trafic que la carte réseau sans-fil peut &amp;quot;voir&amp;quot;, ou êtes intéressés par les paquets de gestion ou de contrôle 802.11, ou les informations de niveau radio, cochez cette option. La disponibilité du mode Moniteur dépend de la carte sans-fil et de son pilote. Consultez le Wiki pour de plus amples détails concernant la capture de paquets sur un réseau WLAN.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Paquets de capture dans le nouveau format (pcap-ng) de fichier de capture.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1551,15 +1667,15 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Interval between updates (ms)</source>
- <translation type="unfinished"></translation>
+ <translation>Intervalle entre les mises à jour (ms)</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;How often the capture notifies the GUI of new packets. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;A quelle fréquence la capture informe l&apos;interface graphique pour de nouveaux paquets. Ceci affecte la fréquence de mise à jour de l&apos;interface graphique et la granularité des chronomètres.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The interval between new packet updates. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;L&apos;intervalle entre les mises à jours des nouveaux paquets. Ceci affecte la fréquence de mises à jour de l&apos;interface graphique et la granularité des chronomètres.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Don&apos;t load interfaces on startup</source>
@@ -1761,6 +1877,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Résolu</translation>
</message>
<message>
+ <source>Width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;Afficher des chaînes lisibles par l&apos;homme au lieu de valeurs brutes pour les champs. Applicable uniquement aux colonnes personnalisées avec des champs contenant des chaînes de valeur.</translation>
</message>
@@ -1808,6 +1932,25 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1874,6 +2017,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Bits/s B</translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Paquets totaux</translation>
</message>
@@ -1988,23 +2135,31 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Copier les octets du paquet sous forme de vidage Hex.</translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C String</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>…as Go literal</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>Copy packet bytes as Go literal.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -2012,6 +2167,22 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>…sous forme de flux Hex</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>Copier les octets du paquet sous forme de flux Hex.</translation>
</message>
@@ -2226,11 +2397,11 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>By default order comparisons and contains/matches/in relations are true if any value matches. The quantifier &quot;all&quot; can be used to apply the test to all values in a frame.</source>
- <translation type="unfinished"></translation>
+ <translation>Par défaut, les comparaisons d&apos;ordre et les relations contains/matches/in sont vraies si l&apos;une des valeurs correspond. Le quantificateur &quot;all&quot; peut être utilisé pour appliquer le test à toutes les valeur de la trame.</translation>
</message>
<message>
<source>Quantifier</source>
- <translation type="unfinished"></translation>
+ <translation>Quantificateur</translation>
</message>
<message>
<source>Any</source>
@@ -2468,11 +2639,11 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Latitude</source>
- <translation type="unfinished"></translation>
+ <translation>Latitude</translation>
</message>
<message>
<source>Longitude</source>
- <translation type="unfinished"></translation>
+ <translation>Longitude</translation>
</message>
<message>
<source>AS Number</source>
@@ -2805,6 +2976,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<source>Display filter:</source>
<translation>Filtre d&apos;affichage :</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2844,10 +3019,6 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Démarrer</translation>
</message>
<message>
- <source>Save</source>
- <translation>Sauvegarder</translation>
- </message>
- <message>
<source>Default</source>
<translation>Défaut</translation>
</message>
@@ -2989,6 +3160,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Filtres d&apos;affichage</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Open </source>
<translation>Ouvrir</translation>
</message>
@@ -3072,10 +3251,18 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Nom du filtre</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Expression de filtre</translation>
</message>
@@ -3161,22 +3348,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>&quot;Fichier&quot; dialogues</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>capturer des fichiers</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Temp</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>fichiers de capture sans titre</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Paramétrage personnel</translation>
</message>
@@ -3185,14 +3360,6 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Configuration globale</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfiltres, préférences, éthers, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>filtres, préférences, fabrication, …</translation>
- </message>
- <message>
<source>System</source>
<translation>Système</translation>
</message>
@@ -3205,18 +3372,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Programme</translation>
</message>
<message>
- <source>program files</source>
- <translation>fichiers de programme</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Plugins personnels</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>plugins binaires</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Plugins globaux</translation>
</message>
@@ -3233,11 +3392,35 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>Chemin d&apos;accès Extcap personnel</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3361,6 +3544,24 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation>Cliquez pour sélectionner</translation>
</message>
@@ -3393,6 +3594,18 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>Conversation entière (%1)</translation>
</message>
@@ -3408,10 +3621,6 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<source>Save Stream Content As…</source>
<translation>Enregistrer le contenu du flux sous…</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[Sortie du flux tronquée]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation type="unfinished">
@@ -3439,9 +3648,20 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Astuce.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Afficher les données comme</translation>
+ <source>Show as</source>
+ <translation type="unfinished">Montrer comme</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Stream</source>
@@ -3456,11 +3676,22 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Trouver :</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Sensible à la casse</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Trouver Suiva&amp;nt</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3798,29 +4029,28 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Enlever ce graphique.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Ajouter un nouveau graphique.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Dupliquer ce graphique.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Effacer tous les graphiques.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation type="unfinished"></translation>
+ <source>Remove the selected graph(s).</source>
+ <translation>Supprimer le(s) graphe(s) sélectionné(s).</translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation type="unfinished"></translation>
+ <source>Duplicate the selected graph(s).</source>
+ <translation>Dupliquer le(s) graphe(s) sélectionné(s).</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation>Déplacer le(s) graphe(s) sélectionné(s) vers le haut.</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation>Déplacer le(s) graphe(s) sélectionné(s) vers le bas.</translation>
</message>
<message>
<source>Mouse</source>
@@ -3856,17 +4086,13 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Automatic update</source>
- <translation type="unfinished"></translation>
+ <translation>Mise à jour automatique</translation>
</message>
<message>
<source>Enable legend</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation>Réinitialiser</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Réinitialiser le Graphique</translation>
</message>
@@ -4080,6 +4306,42 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Copier les graphiques d&apos;un autre profil.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4124,6 +4386,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>5 s</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10 min {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10 min {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Graphiques E/S Wireshark : %1</translation>
</message>
@@ -4136,6 +4406,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Tous les paquets</translation>
</message>
@@ -4148,7 +4426,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4161,7 +4439,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>No events in interval</source>
- <translation type="unfinished"></translation>
+ <translation>Aucun événement dans l’intervalle</translation>
</message>
<message>
<source>Click to select packet</source>
@@ -4177,7 +4455,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Event</source>
- <translation type="unfinished">Évènement</translation>
+ <translation>Événement</translation>
</message>
<message>
<source>%1 (%2s%3).</source>
@@ -4196,6 +4474,34 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Cliquez pour sélectionner une partie du graphique.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Portable Document Format (*.pdf)</translation>
</message>
@@ -4948,6 +5254,13 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished">défaut</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5902,7 +6215,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If more than this many rows are displayed, then sorting by columns that require packet dissection will be disabled. Increasing this number increases memory consumption by caching column values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;S&apos;il y a plus de ce nombre de colonnes affichées, alors les tris par colonnes qui requièrent la dissection des paquets sera désactivée. Augmenter ce nombre augmente la mémoire utilisée par le cache de valeurs de colonnes..&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Enable mouse-over colorization</source>
@@ -5924,8 +6237,8 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>Statistiques LTE Mac</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6228,12 +6541,12 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Numéro de Séquence</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>Graphique LTE RLC (UE=%1 chan=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>Graphique LTE RLC - aucun canal sélectionné </translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Save As…</source>
@@ -6287,8 +6600,8 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>Statistiques LTE RLC</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6374,6 +6687,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Profil : %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Gérer les profils…</translation>
</message>
@@ -6435,6 +6752,13 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>Octet %1</translation>
@@ -6448,9 +6772,12 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Paquet sélectionné : %1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Paquets : %1 %4 Affichés : %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6482,12 +6809,16 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Pas de paquets</translation>
</message>
<message>
- <source>From Zip File...</source>
+ <source>No Events</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>From Zip File...</source>
+ <translation type="unfinished">à partir d&apos;un fichier Zip...</translation>
+ </message>
+ <message>
<source>From Directory...</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">à partir d&apos;un répertoire</translation>
</message>
<message>
<source>Selected Personal Profile...</source>
@@ -6514,6 +6845,13 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6545,6 +6883,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Le dernier dossier utilisé</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation>Le répertoire de travail courant</translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Afficher</translation>
</message>
@@ -6696,7 +7038,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>MAC Address</source>
- <translation type="unfinished"></translation>
+ <translation>Adresse MAC</translation>
</message>
<message>
<source>Search vendor name using a case-insentitive regular expression.</source>
@@ -6975,6 +7317,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Afficher les valeurs de champ</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">Rafraîchir</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Enregistrer le diagramme sous…</translation>
</message>
@@ -7022,6 +7368,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Afficher les octets du paquet</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Paquet %1</translation>
</message>
@@ -7044,6 +7394,13 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7503,10 +7860,22 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Copier ce profil.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Profils de configuration</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Importer</translation>
@@ -7518,11 +7887,11 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>From Zip File...</source>
- <translation type="unfinished"></translation>
+ <translation>à partir d&apos;un fichier Zip...</translation>
</message>
<message>
<source>From Directory...</source>
- <translation type="unfinished"></translation>
+ <translation>à partir d&apos;un répertoire</translation>
</message>
<message numerus="yes">
<source>%Ln Selected Personal Profile(s)...</source>
@@ -7675,6 +8044,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>supprimé</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>copier</translation>
@@ -7921,7 +8294,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Disable unused protocols</source>
- <translation type="unfinished"></translation>
+ <translation>Désactiver les protocoles non utilisés</translation>
</message>
<message>
<source>Disable all protocols but those listed.</source>
@@ -7957,7 +8330,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Protocols</source>
- <translation type="unfinished"></translation>
+ <translation>Protocoles</translation>
</message>
<message>
<source>Disable unused</source>
@@ -7977,7 +8350,7 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
<message>
<source>Unused protocols have been disabled.</source>
- <translation type="unfinished"></translation>
+ <translation>Les protocoles non utilisés ont été désactivés.</translation>
</message>
<message>
<source>Protocol changes have been reverted.</source>
@@ -8198,6 +8571,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Marqueur manquant?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8218,6 +8599,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL Trames</translation>
</message>
@@ -8441,12 +8826,72 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<source>Browse…</source>
<translation>Parcourir…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished">Gauche</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished">Droite</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
- <translation>CCCH</translation>
+ <translation type="unfinished">CCCH</translation>
</message>
</context>
<context>
@@ -8544,6 +8989,13 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8659,6 +9111,14 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Adresses résolues</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>Enregistrer sous…</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Adresses résolues trouvées dans %1</translation>
</message>
@@ -8672,6 +9132,61 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>Copier la table</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished">comme JSON</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished">Texte (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished">Avertissement</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10346,6 +10861,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Taille du paquet</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Recherche les chaines contenant UTF-8 / ASCII ou UTF-16 caractères.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10366,6 +10885,18 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Sensible à la casse</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Chercher une autre occurrence dans le paquet courant avant de passer au prochain paquet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Rechercher des données à l&apos;aide de la syntaxe du filtre d&apos;affichage (par exemple, ip.addr==10.1.1.1), une chaîne hexadécimale (par exemple, fffffda5), une chaîne simple (par exemple, My String) ou une expression régulière (par exemple, colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10403,6 +10934,22 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Filtre Invalide.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Ce filtre ne teste rien.</translation>
</message>
@@ -10844,6 +11391,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Trouver :</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Sensible à la casse</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Rechercher le &amp;suivant</translation>
</message>
@@ -10939,11 +11490,19 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<translation>Enregistrer sous…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Enregistrer les octets de paquet sélectionnés sous…</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
@@ -11046,6 +11605,10 @@ Pas exemple, inquiquez 1 heure pour avoir un nouveau fichier créé toutes les h
<source>Display filter:</source>
<translation>Filtre d&apos;affichage :</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation>Retirer les en-têtes</translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11699,23 +12262,23 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
<name>TLSKeylogDialog</name>
<message>
<source>Dialog</source>
- <translation type="unfinished">Dialogue</translation>
+ <translation>Dialogue</translation>
</message>
<message>
<source>Browse…</source>
- <translation type="unfinished"></translation>
+ <translation>Parcourir…</translation>
</message>
<message>
<source>Command line</source>
- <translation type="unfinished"></translation>
+ <translation>Ligne de commande</translation>
</message>
<message>
<source>Run an application with the SSLKEYLOGFILE environment variable set to the file specified by the TLS key log filename preference. This enables TLS decryption in Wireshark. Set the key log file and start the capture before launching the application to ensure that the initial TLS handshakes are captured.</source>
- <translation type="unfinished"></translation>
+ <translation>Exécutez une application avec la variable d&apos;environnement SSLKEYLOGFILE définie avec le fichier spécifié dans la préférence nom de fichier journal de clé TLS. Cela permet le déchiffrement TLS dans Wireshark. Définissez le fichier d&apos;enregistrement des clés et démarrez la capture avant de lancer l&apos;application afin de vous assurer que les poignées de main TLS initiales sont capturées.</translation>
</message>
<message>
<source>&lt;span style=&quot; font-size:small;&quot;&gt;Firefox and Chrome are known to work. If your desired browser is currently running, close it first before launching it below. Command line options are supported.&lt;/span&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;span style=&quot; font-size:small;&quot;&gt;Firefox et Chrome sont connus pour fonctionner correctement. Si le navigateur de votre choix est actuellement en cours d’exécution, fermez-le d’abord avant de le lancer ci-dessous. Les options de ligne de commande sont prises en charge.&lt;/span&gt;</translation>
</message>
<message>
<source>TLS (Pre)-Master-Secret log file path (tls.keylog_file)</source>
@@ -11723,11 +12286,11 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
</message>
<message>
<source>&lt;span style=&quot; font-size:small;&quot;&gt;TLS session secrets will be logged to this file. If you change this field, hit the Save button to update the TLS protocol preferences.&lt;/span&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;span style=&quot; font-size:small;&quot;&gt;Les secrets de session TLS seront enregistrés dans ce fichier. Si vous changez ce champ, cliquez sur le bouton Sauvegarder pour mettre à jour les préférences du protocole TLS.&lt;/span&gt;</translation>
</message>
<message>
<source>Launch application with SSLKEYLOGFILE</source>
- <translation type="unfinished"></translation>
+ <translation>Démarrez l&apos;application avec SSLKEYLOGFILE</translation>
</message>
<message>
<source>Launch</source>
@@ -11735,7 +12298,7 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
</message>
<message>
<source>Save</source>
- <translation type="unfinished">Sauvegarder</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>TLS Keylog file</source>
@@ -11743,7 +12306,7 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
</message>
<message>
<source>Program to start with SSLKEYLOGFILE</source>
- <translation type="unfinished"></translation>
+ <translation>Programme à démarrer avec SSLKEYLOGFILE</translation>
</message>
</context>
<context>
@@ -11863,7 +12426,7 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
</message>
<message>
<source>Time shifting is not available while capturing packets.</source>
- <translation type="unfinished"></translation>
+ <translation>Le décalage de temps n&apos;est pas disponible pendant la capture de paquet.</translation>
</message>
</context>
<context>
@@ -12020,22 +12583,20 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
<translation>Créer une nouvelle entrée</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Supprimer cette entrée.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Supprimer les entrées sélectionnées.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Copier cette entrée.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Copier les entrées sélectionnées.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Déplacer l&apos;entrée vers le haut.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Déplacer les entrées sélectionnées vers le haut.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Déplacer l&apos;entrée vers le bas.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Déplacer les entrées sélectionnées vers le bas.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12061,20 +12622,20 @@ Changer la direction de la connexion (voir le flux inverse).&lt;/p&gt;&lt;/body&
<translation>Créer une nouvelle entrée.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Supprimer cette entrée.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Supprimer les entrées sélectionnées.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Copier cette entrée.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Copier les entrées sélectionnées.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Déplacer l&apos;entrée vers le haut.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Déplacer les entrées sélectionnées vers le haut.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Déplacer l&apos;entrée vers le bas.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Déplacer les entrées sélectionnées vers le bas.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12403,10 +12964,18 @@ a:hover {
<translation>Vous reniflez la colle qui maintient Internet ensemble à l&apos;aide de Wireshark </translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Vous exécutez Wireshark </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation> Vous recevez les mises à jour automatiques.</translation>
</message>
@@ -12683,14 +13252,6 @@ a:hover {
<translation>Pas de fichier trouvé</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Aide</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Filtre Wireshark</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12956,10 +13517,6 @@ a:hover {
<translation>Barre d&apos;outils Wireless</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Contenu de l&apos;aide</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>FAQ</translation>
</message>
@@ -13080,11 +13637,6 @@ a:hover {
<translation>Trouver le paquet précédent</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Marquer/Démarquer le(s) paquet(s)</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Marquer tout comme Affichées</translation>
</message>
@@ -13113,11 +13665,6 @@ a:hover {
<translation>Aller au paquet précédent marqué</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Ignorer/Annuler le(s) paquet(s)</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Ignorer tous les affichés</translation>
</message>
@@ -13558,32 +14105,28 @@ a:hover {
<translation>Réinitialiser la mise en page</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Réinitialiser la disposition de l&apos;apparence à la taille par défaut</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>Secondes depuis le premier paquet capturé</translation>
</message>
<message>
<source>Show packet times as the seconds since the first captured packet.</source>
- <translation type="unfinished"></translation>
+ <translation>Afficher les temps paquets en secondes depuis le premier paquet capturé.</translation>
</message>
<message>
<source>Tenths of a millisecond</source>
- <translation type="unfinished"></translation>
+ <translation>Dixièmes de millisecondes</translation>
</message>
<message>
<source>Hundredths of a millisecond</source>
- <translation type="unfinished"></translation>
+ <translation>Centièmes de millisecondes</translation>
</message>
<message>
<source>Tenths of a microsecond</source>
- <translation type="unfinished"></translation>
+ <translation>Dixièmes de microsecondes</translation>
</message>
<message>
<source>Hundredths of a microsecond</source>
- <translation type="unfinished"></translation>
+ <translation>Centièmes de microsecondes</translation>
</message>
<message>
<source>Packet &amp;Diagram</source>
@@ -13722,20 +14265,28 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>&amp;Options...</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;Wireless</source>
+ <translation>&amp;Wireless</translation>
+ </message>
+ <message>
+ <source>&amp;User&apos;s Guide</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>&amp;Options...</translation>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation>Manuel utilisateur Wireshark</translation>
</message>
<message>
- <source>&amp;Wireless</source>
- <translation>&amp;Wireless</translation>
+ <source>Display Filters</source>
+ <translation>Filtres d&apos;affichage</translation>
</message>
<message>
<source>Capture &amp;Filters…</source>
@@ -13782,10 +14333,18 @@ a:hover {
<translation>Trouver Pré&amp;cédent</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Marquer ou décocher chaque paquet sélectionné</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Ignorer ou désignorer chaque paquet sélectionné</translation>
</message>
@@ -13826,6 +14385,18 @@ a:hover {
<translation>Débit TCP</translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>Séquences de requêtes</translation>
</message>
@@ -13834,6 +14405,14 @@ a:hover {
<translation>Séquences de requête HTTP</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Décoder &amp;Comme...</translation>
</message>
@@ -13894,6 +14473,10 @@ a:hover {
<translation>Taille Normale</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Redimensionner les Colonnes</translation>
</message>
@@ -14152,6 +14735,14 @@ a:hover {
<translation>Aller au paquet référencé par le champ sélectionné.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>Notes de version</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;Appels VoIP</translation>
</message>
@@ -14184,10 +14775,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14472,6 +15059,10 @@ a:hover {
<translation>Quitter &amp;sans enregistrer</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>Il n&apos;y a pas de &quot;rtp.ssrc&quot; champ dans cette version de Wireshark.</translation>
</message>
@@ -14621,7 +15212,7 @@ a:hover {
</message>
<message>
<source> before updating</source>
- <translation type="unfinished"></translation>
+ <translation>avant de mettre à jour</translation>
</message>
<message>
<source>There are no TLS Session Keys to save.</source>
@@ -14644,11 +15235,11 @@ a:hover {
</message>
<message>
<source>There are no available secrets used to decrypt TLS traffic in the capture file. Would you like to view information about how to decrypt TLS traffic on the wiki?</source>
- <translation type="unfinished"></translation>
+ <translation>Il n’existe aucun secret disponible utilisé pour déchiffrer le trafic TLS dans le fichier de capture. Souhaitez-vous consulter des informations sur la façon de déchiffrer le trafic TLS sur le wiki ?</translation>
</message>
<message>
<source>Are you sure you want to discard all decryption secrets?</source>
- <translation type="unfinished"></translation>
+ <translation>Voulez-vous vraiment supprimer tous les secrets pour le déchiffrement ?</translation>
</message>
<message>
<source>No filter available. Try another %1.</source>
diff --git a/ui/qt/wireshark_it.ts b/ui/qt/wireshark_it.ts
index 18daca04..3a84fd06 100644
--- a/ui/qt/wireshark_it.ts
+++ b/ui/qt/wireshark_it.ts
@@ -44,8 +44,8 @@
<translation>Cartelle</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Filtro per percorso</translation>
+ <source>Search Folders</source>
+ <translation>Cerca cartelle</translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Licenza</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>Informazioni su Logray</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>La cartella non esiste</translation>
</message>
@@ -755,6 +763,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>Modifica commento della cattura</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>Aggiungi commento</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>Sezione %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>Commento %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -863,10 +893,6 @@
<translation>Filtro di lettura:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Comprimi con g&amp;zip</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Apri un file di cattura</translation>
@@ -948,8 +974,8 @@
<translation>Dettagli</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Commenti del file di cattura</translation>
+ <source>Edit Comments</source>
+ <translation>Modifica commenti</translation>
</message>
<message>
<source>Refresh</source>
@@ -960,10 +986,6 @@
<translation>Copia negli appunti</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Salva i commenti</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Proprietà del file di cattura</translation>
</message>
@@ -1012,10 +1034,18 @@
<translation>Primo pacchetto</translation>
</message>
<message>
+ <source>First event</source>
+ <translation>Primo evento</translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Ultimo pacchetto</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation>Ultimo evento</translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Trascorso</translation>
</message>
@@ -1052,6 +1082,10 @@
<translation>Pacchetti persi</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation>Eventi scartati</translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Filtro di cattura</translation>
</message>
@@ -1064,6 +1098,10 @@
<translation>Dimensione limite del pacchetto (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation>Limite dimensione degli eventi (snaplen)</translation>
+ </message>
+ <message>
<source>none</source>
<translation>nessuno</translation>
</message>
@@ -1072,6 +1110,26 @@
<translation>%1 byte</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>Commenti</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>Commento %1:</translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation>Segreti di decifratura</translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>Tipo</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>Dimensione</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Statistiche</translation>
</message>
@@ -1096,6 +1154,10 @@
<translation>Pacchetti</translation>
</message>
<message>
+ <source>Events</source>
+ <translation>Eventi</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Tempo, s</translation>
</message>
@@ -1108,6 +1170,10 @@
<translation>Dimensione media dei pacchetti, B</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation>Dimensione media degli eventi, B</translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Byte</translation>
</message>
@@ -1120,14 +1186,14 @@
<translation>Bit/s medi</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Commento sezione</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Commenti pacchetto</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation>Commenti evento</translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Frame %1: </translation>
</message>
@@ -1139,6 +1205,14 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Creato da Logray %1
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1366,6 +1440,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Di solito una scheda di rete wireless catturerà solo il traffico inviato e ricevuto dal suo indirizzo di rete e catturerà solo il traffico &lt;em&gt;dati dell&apos;utente&lt;/em&gt; con intestazioni Ethernet &amp;quot;fittizie&amp;quot;. Se desideri catturare tutto il traffico che transita sulle schede di rete wireless o sei interessato ai pacchetti di gestione o di controllo 802.11, o alle informazioni del livello radio, seleziona questa opzione. La disponibilità della modalità di monitoraggio dipende dalla scheda di rete wireless e dal driver. Consulta il Wiki per ulteriori dettagli sulla cattura dei pacchetti nelle reti WLAN.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>Abilita la modalità monitor su tutte le interfacce 802.11</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>compressione</translation>
</message>
@@ -1378,6 +1460,30 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation>Modello di infisso dei file</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In modalità file multipli, la data e l&apos;ora e il numero di indice del file sono inseriti tra il modello del nome del file e qualsiasi suffisso. Seleziona il loro ordine.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation>AAAAmmGGHHMMSS_NNNNN</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Data e ora prima del numero di indice del file. Ciò fa sì che i file vengano ordinati in base all&apos;ora di creazione e mantiene i file dello stesso lotto ordinati in modo stretto.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation>NNNNN_AAAAmmGGHHMMSS</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Numero di indice del file prima della data e dell&apos;ora. Questo è l&apos;ordinamento storico di Wireshark.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Dopo che la cattura è passata al file successivo e il numero di file prescelto è stato superato, il file più vecchio sarà rimosso.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1459,23 +1565,27 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>Stop capturing after the specified number of packets have been captured.</source>
- <translation>Ferma la cattura dopo che un certo numero di pacchetti è stato catturato.</translation>
+ <translation>Ferma la cattura dopo che il numero di pacchetti specificato è stato catturato.</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified number of files have been created.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ferma la cattura dopo che il numero di file specificato è stato creato.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation>Ferma la cattura dopo che il numero di file specificato è stato creato.</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ferma la cattura dopo che una certa quantità di dati è stata catturata.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ferma la cattura dopo che la quantità di dati specificata è stata catturata.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Stop capturing after the specified amount of data has been captured.</source>
- <translation>Ferma la cattura dopo che una certa quantità di dati è stata catturata.</translation>
+ <translation>Ferma la cattura dopo che la quantità di dati specificata è stata catturata.</translation>
</message>
<message>
<source>Stop capturing after the specified amount of time has passed.</source>
- <translation>Ferma la cattura dopo che la quantità di tempo specificato è trascorsa.</translation>
+ <translation>Ferma la cattura dopo che la quantità di tempo specificata è trascorsa.</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Optionally specify a temporary directory for unnamed capture files.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
@@ -1526,8 +1636,8 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Errore</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>File multipli: la dimensione del file richiesta è troppo grande. La dimensione del file non può essere superiore a 2 GiB.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation>File multipli: la dimensione del file richiesta è troppo grande. La dimensione del file non può essere superiore a 2 TB.</translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1557,6 +1667,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Cattura i pacchetti in modalità promiscua</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Di solito una scheda di rete wireless catturerà solo il traffico inviato e ricevuto dal suo indirizzo di rete e catturerà solo il traffico &lt;em&gt;dati dell&apos;utente&lt;/em&gt; con intestazioni Ethernet &amp;quot;fittizie&amp;quot;. Se desideri catturare tutto il traffico che transita sulle schede di rete wireless o sei interessato ai pacchetti di gestione o di controllo 802.11, o alle informazioni del livello radio, seleziona questa opzione. La disponibilità della modalità di monitoraggio dipende dalla scheda di rete wireless e dal driver. Consulta il Wiki per ulteriori dettagli sulla cattura dei pacchetti nelle reti WLAN.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>Cattura i pacchetti in modalità monitor sui dispositivi 802.11</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Cattura i pacchetti nel formato di file di nuova generazione.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1578,11 +1696,11 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;How often the capture notifies the GUI of new packets. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;La frequenza con cui l&apos;acquisizione notifica alla GUI i nuovi pacchetti. Influisce sulla frequenza degli aggiornamenti della GUI e sulla granularità dei timer.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;La frequenza con cui l&apos;acquisizione notifica all&apos;interfaccia grafica i nuovi pacchetti. Influisce sulla frequenza degli aggiornamenti dell&apos;interfaccia e sulla granularità dei timer.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The interval between new packet updates. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;L&apos;intervallo tra gli aggiornamenti dei nuovi pacchetti. Influisce sulla frequenza degli aggiornamenti della GUI e sulla granularità dei timer.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;L&apos;intervallo tra gli aggiornamenti dei nuovi pacchetti. Influisce sulla frequenza degli aggiornamenti dell&apos;interfaccia grafica e sulla granularità dei timer.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Don&apos;t load interfaces on startup</source>
@@ -1784,6 +1902,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Risolto</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>Larghezza</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>Allineamento</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;Mostra stringhe comprensibili invece che i valori grezzi dei campi. Applicabile solo alle colonne personalizzate con campi che hanno stringhe con valori.&lt;/html&gt;</translation>
</message>
@@ -1831,6 +1957,25 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation>Opzioni di compressione</translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation>&amp;Non compresso</translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation>Comprimi con g&amp;zip</translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation>Comprimi con &amp;LZ4</translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1897,6 +2042,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Bit/s B</translation>
</message>
<message>
+ <source>Flows</source>
+ <translation>Flussi</translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Pacchetti totali</translation>
</message>
@@ -2011,14 +2160,6 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Copia i byte del pacchetto come un dump esadecimale.</translation>
</message>
<message>
- <source>…as Printable Text</source>
- <translation>...come testo stampabile</translation>
- </message>
- <message>
- <source>Copy only the printable text in the packet.</source>
- <translation>Copia solo il testo stampabile nel pacchetto.</translation>
- </message>
- <message>
<source>…as MIME Data</source>
<translation>…come dati MIME</translation>
</message>
@@ -2031,10 +2172,42 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Copia i byte dei pacchetti come caratteri ASCII stampabili e sequenze di escape.</translation>
</message>
<message>
+ <source>…as Go literal</source>
+ <translation>…come Go letterale</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation>Copia i byte del pacchetto come Go letterale.</translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation>...come Array C</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
+ <translation>Copia i byte del pacchetto come Array C.</translation>
+ </message>
+ <message>
<source>…as a Hex Stream</source>
<translation>...come un flusso esadecimale</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation>…come testo UTF-8</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation>Copia i byte del pacchetto come testo, trattandolo come UTF-8.</translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation>…come testo ASCII</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation>Copia i byte del pacchetto come testo, trattandolo come ASCII.</translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>Copia i byte del pacchetto come un flusso esadecimale.</translation>
</message>
@@ -2830,6 +3003,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<source>Display filter:</source>
<translation>Filtro di visualizzazione:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation>Esporta PDU</translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2869,10 +3046,6 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Avvia</translation>
</message>
<message>
- <source>Save</source>
- <translation>Salva</translation>
- </message>
- <message>
<source>Default</source>
<translation>Predefinito</translation>
</message>
@@ -3014,6 +3187,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Filtri di visualizzazione</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation>Visualizza macro dei filtri</translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>Nuova macro</translation>
+ </message>
+ <message>
<source>Open </source>
<translation>Apri </translation>
</message>
@@ -3097,10 +3278,18 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>Nome macro</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Nome filtro</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation>Espressione macro</translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Espressione del filtro</translation>
</message>
@@ -3186,22 +3375,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>Finestre &quot;File&quot;</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>file di cattura</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Temporanei</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>file di cattura senza titolo</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Configurazione personale</translation>
</message>
@@ -3210,14 +3387,6 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Configurazione globale</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfilters, preferences, ethers, </translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>dfilters, preferences, manuf, </translation>
- </message>
- <message>
<source>System</source>
<translation>Sistema</translation>
</message>
@@ -3230,18 +3399,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Programma</translation>
</message>
<message>
- <source>program files</source>
- <translation>file di programma</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Plugin personali</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>plugin binari</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Plugin globali</translation>
</message>
@@ -3258,12 +3419,36 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Script Lua</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation>Posizione finestra &quot;File&quot;</translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation>File di cattura</translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation>File di cattura senza titolo</translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation>Preferenze, profili, prod, …</translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation>File di programma</translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation>Plugin binari</translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>Percorso Extcap personale</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
- <translation>estensioni di cattura esterna (extcap)</translation>
+ <source>External capture (extcap) plugins</source>
+ <translation>Plugin di cattura esterna (extcap)</translation>
</message>
<message>
<source>Global Extcap path</source>
@@ -3400,6 +3585,24 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation>Evento %1.</translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;scrittura&lt;/span&gt;,</numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;scritture&lt;/span&gt;,</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;scritture&lt;/span&gt;,</numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;scritture&lt;/span&gt;,</numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation> Fai clic per selezionare.</translation>
</message>
@@ -3432,6 +3635,18 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Flussi %1 non trovati nel pacchetto selezionato.</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>Attività di lettura(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>Attività di scrittura(%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>Intera attività I/O (%1)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>Conversazione intera (%1)</translation>
</message>
@@ -3447,10 +3662,6 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<source>Save Stream Content As…</source>
<translation>Salva il contenuto del flusso come...</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[Flusso di output troncato]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation>
@@ -3478,9 +3689,20 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Suggerimento.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Mostra dati come</translation>
+ <source>Show as</source>
+ <translation>Mostra come</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation>Nessun delta dei tempi</translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation>Attiva i delta dei tempi</translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation>Tutti i delta dei tempi</translation>
</message>
<message>
<source>Stream</source>
@@ -3495,11 +3717,22 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Trova:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Distingui maiuscole</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Trova &amp;successivo</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[Flusso di uscita troncato]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3835,28 +4068,27 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Rimuovi questo grafico.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Aggiungi un nuovo grafico.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Duplica questo grafico.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Cancella tutti i grafici.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>Sposta questo grafico verso l&apos;alto.</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation>Rimuovi i grafici selezionati.</translation>
</message>
<message>
- <source>Move this graph downwards.</source>
+ <source>Duplicate the selected graph(s).</source>
+ <translation>Duplica i grafici selezionati.</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation>Sposta i grafici selezionati in alto.</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
<translation>Sposta questo grafico verso il basso.</translation>
</message>
<message>
@@ -3869,7 +4101,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>drags</source>
- <translation>trascinamenti</translation>
+ <translation>trascina</translation>
</message>
<message>
<source>Select using the mouse button.</source>
@@ -3877,7 +4109,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>zooms</source>
- <translation>zoom</translation>
+ <translation>ingrandisce</translation>
</message>
<message>
<source>Interval</source>
@@ -3900,10 +4132,6 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Abilita la legenda</translation>
</message>
<message>
- <source>Reset</source>
- <translation>Ripristina</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Ripristina il grafico</translation>
</message>
@@ -4117,6 +4345,42 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Copia grafici da un altro profilo.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation>1 μs</translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation>2 μs</translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation>5 μs</translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation>10 μs</translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation>20 μs</translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation>50 μs</translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation>100 μs</translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation>200 μs</translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation>500 μs</translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4161,6 +4425,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>5 sec</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation>2 min</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation>5 min</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Grafici di I/O di Wireshark: %1</translation>
</message>
@@ -4173,6 +4445,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Eventi filtrati</translation>
</message>
<message>
+ <source>All packets</source>
+ <translation>Tutti i pacchetti</translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation>Tutti gli eventi</translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Tutti i pacchetti</translation>
</message>
@@ -4185,8 +4465,8 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Tutti gli eventi</translation>
</message>
<message>
- <source>Access Denied</source>
- <translation>Accesso negato</translation>
+ <source>All Execs</source>
+ <translation>Tutti gli eseguibili</translation>
</message>
<message>
<source>Hover over the graph for details.</source>
@@ -4233,6 +4513,34 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Fai clic per selezionare una porzione del grafico.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation>%1 intervalli</translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation>Sposta in alto a sinistra</translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation>Sposta in alto al centro</translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation>Sposta in alto a destra</translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation>Sposta in basso a sinistra</translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation>Sposta in basso al centro</translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation>Sposta in basso a destra</translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Portable Document Format (*.pdf)</translation>
</message>
@@ -4985,6 +5293,13 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation>predefinito</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5919,7 +6234,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>Packet List settings:</source>
- <translation>Impostazioni elenco dei pacchetti:</translation>
+ <translation>Impostazioni elenco pacchetti:</translation>
</message>
<message>
<source>Show packet separator</source>
@@ -5961,8 +6276,8 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>Statistiche Mac LTE</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation>Statistiche Mac LTE/NR</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6047,7 +6362,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>drags</source>
- <translation>trascinamenti</translation>
+ <translation>trascina</translation>
</message>
<message>
<source>Select using the mouse button.</source>
@@ -6055,7 +6370,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>zooms</source>
- <translation>ingrandimenti</translation>
+ <translation>ingrandisce</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Reset the graph to its initial state.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
@@ -6266,12 +6581,12 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Numero di sequenza</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>Grafico RLC LTE (UE=%1 can=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation>Grafico RLC %1 (UE=%2 can=%3%4 %5 - %6)</translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>Grafico RLC LTE - nessun canale selezionato</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation>Grafico 3GPP RLC LTE - nessun canale selezionato</translation>
</message>
<message>
<source>Save As…</source>
@@ -6325,8 +6640,8 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>Statistiche RLC LTE</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation>Statistiche 3GPP RLC</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6412,6 +6727,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Profilo: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation>%1 visualizzati: %2 (%3%)</translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Gestisci i profili...</translation>
</message>
@@ -6473,6 +6792,13 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<numerusform>%Ln byte</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln bit</numerusform>
+ <numerusform>%Ln bit</numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>Byte %1</translation>
@@ -6486,9 +6812,12 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Pacchetto selezionato: %1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Pacchetti: %1 %4 visualizzati: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation>Evento selezionato: %1 %2</translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation>Eventi: %1</translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6520,6 +6849,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Nessun pacchetto</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation>Nessun evento</translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>Da file Zip...</translation>
</message>
@@ -6552,6 +6885,13 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation>Filtro di visualizzazione come %1</translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6583,6 +6923,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>La cartella usata più di recente</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation>La cartella di lavoro attuale</translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Mostra fino a</translation>
</message>
@@ -6738,7 +7082,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>Search vendor name using a case-insentitive regular expression.</source>
- <translation>Cerca il nome del fornitore utilizzando un&apos;espressione regolare senza distinzione tra maiuscole e minuscole.</translation>
+ <translation>Cerca il nome del produttore utilizzando un&apos;espressione regolare senza distinzione tra maiuscole e minuscole.</translation>
</message>
<message>
<source>Vendor Name</source>
@@ -7013,6 +7357,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Mostra i valori dei campi</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation>Aggiorna</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Salva diagramma come...</translation>
</message>
@@ -7060,6 +7408,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Mostra byte del pacchetto</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation>Disposizione:</translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Pacchetto %1</translation>
</message>
@@ -7082,6 +7434,13 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<numerusform>%Ln byte</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln bit</numerusform>
+ <numerusform>%Ln bit</numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7291,7 +7650,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>Also include packets depended upon, such as those used to reassemble displayed packets</source>
- <translation>Includi anche i pacchetti di dipendenza, come quelli utilizzati per riassemblare i pacchetti visualizzati</translation>
+ <translation>Includi anche i pacchetti di dipendenza, come quelli utilizzati per ri-assemblare i pacchetti visualizzati</translation>
</message>
<message>
<source>First &amp;to last marked</source>
@@ -7541,10 +7900,22 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Copia questo profilo.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation>Il numero di pacchetti o eventi da verificare per la commutazione automatica del profilo.</translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation>Limite pacchetti per commutazione automatica</translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Profili di configurazione</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation>Limite eventi per commutazione automatica</translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Importa</translation>
@@ -7727,6 +8098,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>eliminato</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation>Cambio automatico del filtro</translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>copia</translation>
@@ -8250,6 +8625,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Marcatore mancante?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation>LTE</translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation>NR</translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8270,6 +8653,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation>RAT</translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL Frame</translation>
</message>
@@ -8493,9 +8880,69 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<source>Browse…</source>
<translation>Sfoglia...</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation>PACCHETTI</translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation>EVENTI</translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation>BYTE</translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation>BIT</translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation>NUMERO FRAME</translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation>NUMERO CAMPI</translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation>SOMMA</translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation>MAX</translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation>MIN</translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation>MEDIA</translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation>THROUGHPUT</translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation>CARICO</translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation>Sinistra</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation>Centro</translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation>Destra</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation>CCCH</translation>
@@ -8596,6 +9043,13 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation>Ridimensiona tutte le %1 al contenuto</translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8711,6 +9165,14 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Indirizzi risolti</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation>Copia</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>Salva come...</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Trovati indirizzi risolti in %1</translation>
</message>
@@ -8724,6 +9186,61 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation>come testo semplice</translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation>Copia le righe selezionate</translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>Copia la tabella</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation>come CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation>come JSON</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation>Salva le righe selezionate come...</translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation>Salva la tabella come...</translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation>Salva gli indirizzi risolti come...</translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation>Testo semplice (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation>Documento CSV (*.csv)</translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation>Documento JSON (*.json)</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>Avviso</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation>Impossibile salvare %1: %2</translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10398,6 +10915,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Byte del pacchetto</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Opzioni:&lt;/b&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Cerca le stringhe che contengono i caratteri ridotti (UTF-8 e ASCII) o allargati (UTF-16).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10418,6 +10939,18 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Distingui maiuscole</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation>Indietro</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Cerca un&apos;occorrenza successiva nel pacchetto corrente prima di passare al pacchetto successivo.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation>Occorrenze multiple</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Cerca nei dati utilizzando la sintassi dei filtri di visualizzazione (ad es. ip.addr==10.1.1.1), una stringa esadecimale (ad es. fffffda5) o una stringa semplice (ad es. Mia Stringa) o un&apos;espressione regolare (ad es. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10455,6 +10988,22 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Filtro non valido.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation>Elenco eventi</translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation>Dettagli evento</translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation>Byte evento</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt; Cerca nella colonna Info dell&apos;elenco degli eventi (pannello di riepilogo), etichette di visualizzazione degli eventi decodificati (pannello della vista ad albero) o i dati dell&apos;evento convertiti in ASCII (pannello della vista esadecimale).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Il filtro non verifica niente.</translation>
</message>
@@ -10898,6 +11447,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Trova:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Distingui maiuscole</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Trova &amp;successivo</translation>
</message>
@@ -10993,14 +11546,22 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Salva come...</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation>Decodificato come %1.</translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Salva byte del pacchetto selezionato come...</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation>compressi %1</translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation>
- <numerusform>Visualizzazione di %Ln byte.</numerusform>
- <numerusform>Visualizzazione di %Ln byte.</numerusform>
+ <numerusform>Utilizzo di %Ln byte.</numerusform>
+ <numerusform>Utilizzo di %Ln byte.</numerusform>
</translation>
</message>
<message>
@@ -11100,6 +11661,10 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<source>Display filter:</source>
<translation>Filtro di visualizzazione:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation>Rimuovi intestazioni</translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11324,7 +11889,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>drags</source>
- <translation>trascinamenti</translation>
+ <translation>trascina</translation>
</message>
<message>
<source>Select using the mouse button.</source>
@@ -11332,7 +11897,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>zooms</source>
- <translation>zoom</translation>
+ <translation>ingrandisce</translation>
</message>
<message>
<source>Display Round Trip Time vs Sequence Number</source>
@@ -11911,7 +12476,7 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
</message>
<message>
<source>Time shifting is not available while capturing packets.</source>
- <translation>Il spostamento temporale non è disponibile durante l&apos;acquisizione dei pacchetti.</translation>
+ <translation>Lo spostamento temporale non è disponibile durante la cattura dei pacchetti.</translation>
</message>
</context>
<context>
@@ -12068,22 +12633,20 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Crea una nuova voce.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Rimuovi questa voce.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Rimuovi le voci selezionate.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Copia questa voce.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Copia le voci selezionate.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Sposta su la voce.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Sposta le voci selezionate in alto.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Sposta giù la voce.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Sposta le voci selezionate in basso.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12109,20 +12672,20 @@ Ad esempio, usa 1 ora per fare in modo che un nuovo file sia creato ogni ora.</t
<translation>Crea una nuova voce.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Rimuovi questa voce.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Rimuovi le voci selezionate.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Copia questa voce.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Copia le voci selezionate.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Sposta su la voce.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Sposta le voci selezionate in alto.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Sposta giù la voce.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Sposta le voci selezionate in basso.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12493,10 +13056,18 @@ a:hover {
<translation>Stai annusando la colla che tiene insieme Internet con Wireshark</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation>Questo è il collante che tiene insieme il tuo sistema usando Logray</translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Stai eseguendo Wireshark </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation>Stai eseguendo Logray</translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation> Ricevi aggiornamenti automatici.</translation>
</message>
@@ -12773,14 +13344,6 @@ a:hover {
<translation>File non trovati</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Contenuti</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Filtro di Wireshark</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12910,7 +13473,7 @@ a:hover {
</message>
<message>
<source>Export TLS Session Keys…</source>
- <translation>Esporta chiavi di sessione SSL...</translation>
+ <translation>Esporta chiavi di sessione TLS...</translation>
</message>
<message>
<source>List Files</source>
@@ -13046,10 +13609,6 @@ a:hover {
<translation>Barra degli strumenti wireless</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Contenuti della guida</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>FAQ</translation>
</message>
@@ -13170,11 +13729,6 @@ a:hover {
<translation>Vai al pacchetto precedente</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Marca/Deseleziona pacchetto</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Marca tutti i visualizzati</translation>
</message>
@@ -13203,11 +13757,6 @@ a:hover {
<translation>Val al prossimo pacchetto marchiato</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Ignora/Considera pacchetto</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Ignora tutti i visualizzati</translation>
</message>
@@ -13648,10 +14197,6 @@ a:hover {
<translation>Ripristina disposizione</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Ripristina la disposizione dell&apos;aspetto alla dimensione predefinita</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>Secondi dal primo pacchetto catturato</translation>
</message>
@@ -13777,7 +14322,7 @@ a:hover {
</message>
<message>
<source>Show UTP multicast stream statistics.</source>
- <translation>Mostra le statistiche del flusso multicast UDP.</translation>
+ <translation>Mostra le statistiche del flusso multicast UTP.</translation>
</message>
<message>
<source>WLAN Traffic</source>
@@ -13812,22 +14357,30 @@ a:hover {
<translation>Blocchi di indirizzi MAC</translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
- <translation>Esecutore Keylog TLS</translation>
- </message>
- <message>
- <source>Release Notes</source>
- <translation>Note di rilascio</translation>
- </message>
- <message>
<source>&amp;Options…</source>
<translation>&amp;Opzioni...</translation>
</message>
<message>
+ <source>&amp;3GPP Uu</source>
+ <translation>&amp;3GPP Uu</translation>
+ </message>
+ <message>
<source>&amp;Wireless</source>
<translation>&amp;Wireless</translation>
</message>
<message>
+ <source>&amp;User&apos;s Guide</source>
+ <translation>Manuale &amp;utente</translation>
+ </message>
+ <message>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation>Manuale utente di Wireshark</translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
+ <translation>Filtri di visualizzazione</translation>
+ </message>
+ <message>
<source>Capture &amp;Filters…</source>
<translation>&amp;Filtri di cattura...</translation>
</message>
@@ -13872,10 +14425,18 @@ a:hover {
<translation>Tro&amp;va precedente</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation>&amp;Marca/Deseleziona selezionati</translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Marca o rimuovi ogni pacchetto selezionato</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation>&amp;Ignora/considera selezionati</translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Ignora o considera ogni pacchetto selezionato</translation>
</message>
@@ -13916,6 +14477,18 @@ a:hover {
<translation>Throughput TCP</translation>
</message>
<message>
+ <source>General</source>
+ <translation>Generale</translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation>Query-Risposta</translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation>Statistiche Query-Risposta DNS</translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>Sequenze richiesta</translation>
</message>
@@ -13924,6 +14497,14 @@ a:hover {
<translation>Sequenze richiesta HTTP</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation>E2AP</translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation>Messaggi E2AP</translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Decodific&amp;a come...</translation>
</message>
@@ -13984,6 +14565,10 @@ a:hover {
<translation>Dimensione normale</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation>Ripristina la disposizione alla dimensione predefinita </translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Ridimensiona colonne</translation>
</message>
@@ -14242,6 +14827,14 @@ a:hover {
<translation>Vai al pacchetto referenziato dal campo selezionato.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation>Esecutore Keylog TLS</translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>Note di rilascio</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>Chiamate &amp;VoIP</translation>
</message>
@@ -14274,10 +14867,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14562,6 +15151,10 @@ a:hover {
<translation>Esci senza sal&amp;vare</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation>Dati USB CDC</translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>Non c&apos;è alcun campo &quot;rtp.ssrc&quot; in questa versione di Wireshark.</translation>
</message>
@@ -14723,7 +15316,7 @@ a:hover {
</message>
<message>
<source>There are no TLS Session Keys to save.</source>
- <translation>Non ci sono chiavi di sessione SSL da salvare.</translation>
+ <translation>Non ci sono chiavi di sessione TLS da salvare.</translation>
</message>
<message numerus="yes">
<source>Export TLS Session Keys (%Ln key(s))</source>
diff --git a/ui/qt/wireshark_ja_JP.ts b/ui/qt/wireshark_ja_JP.ts
index 610d74df..013ad12c 100644
--- a/ui/qt/wireshark_ja_JP.ts
+++ b/ui/qt/wireshark_ja_JP.ts
@@ -44,8 +44,8 @@
<translation>フォルダ</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>パスでフィルタ</translation>
+ <source>Search Folders</source>
+ <translation>フォルダを検索</translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>ライセンス</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>Lograyについて</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>ディレクトリがありません</translation>
</message>
@@ -754,6 +762,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>キャプチャコメントを編集</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>コメントを追加</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>セクション %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>コメント %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -859,10 +889,6 @@
<translation>読込フィルタ:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>gzip形式で圧縮(&amp;z)</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>キャプチャファイルを開く</translation>
@@ -941,8 +967,8 @@
<translation>詳細</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>キャプチャファイルコメント</translation>
+ <source>Edit Comments</source>
+ <translation>コメントを編集</translation>
</message>
<message>
<source>Refresh</source>
@@ -953,10 +979,6 @@
<translation>クリップボードにコピー</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>コメントを保存</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>キャプチャファイルプロパティ</translation>
</message>
@@ -1005,10 +1027,18 @@
<translation>最初のパケット</translation>
</message>
<message>
+ <source>First event</source>
+ <translation>最初のイベント</translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>最後のパケット</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation>最後のイベント</translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>経過時間</translation>
</message>
@@ -1045,6 +1075,10 @@
<translation>欠落したパケット</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation>欠落したイベント</translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>キャプチャフィルタ</translation>
</message>
@@ -1057,6 +1091,10 @@
<translation>パケットサイズ制限(snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation>イベントサイズ制限(snaplen)</translation>
+ </message>
+ <message>
<source>none</source>
<translation>なし</translation>
</message>
@@ -1065,6 +1103,26 @@
<translation>%1 バイト</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>コメント</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>コメント %1:</translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation>復号化シークレット</translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>種別</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>サイズ</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>統計</translation>
</message>
@@ -1089,6 +1147,10 @@
<translation>パケット数</translation>
</message>
<message>
+ <source>Events</source>
+ <translation>イベント</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>時間間隔,秒</translation>
</message>
@@ -1101,6 +1163,10 @@
<translation>平均パケットサイズ,バイト</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation>平均イベントサイズ,バイト</translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>バイト数</translation>
</message>
@@ -1113,14 +1179,14 @@
<translation>平均ビット数毎秒</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>セクション コメント</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>パケットコメント</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation>イベント コメント</translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;フレーム %1: </translation>
</message>
@@ -1132,6 +1198,14 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Logray %1 によって作成されました
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1358,6 +1432,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>(時計の)時刻が特定の間隔になったら次のファイルに切り替えます。例えば、1時間に設定すると毎時1時間ごとに新しいファイルが作成されます</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;通常、無線 ネットワークカードは自身のネットワークアドレスに送受信されるトラフィックのみキャプチャして、&amp;quot;偽の&amp;quot; Ethernetヘッダで &lt;em&gt;ユーザデータ&lt;/em&gt; トラフィックのみ取得します。もし無線ネットワークカードが&amp;quot;見える&amp;quot;すべてのトラフィックをキャプチャしたい、802.11管理や制御パケットや無線の物理層のヘッダ情報に興味がある場合にはこのオプションをマークしてください。モニターモードが利用できるかは無線カードとドライバに依存します。無線ネットワークに関してのパケットキャプチャのさらなる詳細についてはWikiを参照ください。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>すべての802.11インターフェースにおいてモニターモードを有効化します</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>圧縮</translation>
</message>
@@ -1370,6 +1452,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation>ファイルinfixパターン</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;複数ファイルモードにおいては、日付、時間とファイルインデックス番号がファイル名テンプレートとサフィックスの間に挿入されます。順番を選択してください。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation>YYYYmmDDHHMMSS_NNNNN</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;ファイルインデックス番号の前に日付と時刻を示します。これによりファイルは作成時fの順序でソートされ、同じバッチのファイルが近くに配置されます。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation>NNNNN_YYYYmmDDHHMMSS</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;日付と時刻の前にファイルインデックスを示します。これは歴史的なWiresharkの順序です。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;キャプチャが次のファイルに切り替えられた後、与えられたファイル数を超過したら、最も古いファイルが消されます&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1458,6 +1564,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;指定した数のファイルを作成した後キャプチャを停止します&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation>指定したファイル数が作成された後にキャプチャを停止します</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;指定した量のデータがキャプチャされたらキャプチャを停止します&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1518,8 +1628,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>エラー</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>複数ファイル:要求されたファイルサイズが大きすぎます。ファイルサイズは2GBより大きくできません</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation>複数ファイル:要求されたファイルサイズが大きすぎます。ファイルサイズは2テラバイトより大きくできません</translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1549,6 +1659,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>プロミスキャスモードでパケットをキャプチャ</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;通常、無線 ネットワークカードは自身のネットワークアドレスに送受信されるトラフィックのみキャプチャして、&amp;quot;偽の&amp;quot; Ethernetヘッダで &lt;em&gt;ユーザデータ&lt;/em&gt; トラフィックのみ取得します。もし無線ネットワークカードが&amp;quot;見える&amp;quot;すべてのトラフィックをキャプチャしたい、802.11管理や制御パケットや無線の物理層のヘッダ情報に興味がある場合にはこのオプションをマークしてください。モニターモードが利用できるかは無線カードとドライバに依存します。無線ネットワークに関してのパケットキャプチャのさらなる詳細についてはWikiを参照ください。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>802.11デバイスにおいてモニターモードでパケットをキャプチャします</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;次世代のキャプチャファイル形式でパケットをキャプチャします&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1776,6 +1894,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>解決済</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>幅</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>揃え</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;123raw(無加工)のフィールド値の代わりに人が読むことのできる文字列を表示します。有効な文字列を含むフィールドを持つカスタム列へ適用する場合にのみ適用できます。&lt;/html&gt;</translation>
</message>
@@ -1823,6 +1949,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation>圧縮オプション</translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation>非圧縮(&amp;U)</translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation>gzip形式で圧縮(&amp;z)</translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation>LZ4形式で圧縮(&amp;L)</translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1889,6 +2034,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>ビット毎秒 B</translation>
</message>
<message>
+ <source>Flows</source>
+ <translation>フロー</translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>全パケット</translation>
</message>
@@ -2003,14 +2152,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>16進数ダンプとしてパケットバイト列をコピー</translation>
</message>
<message>
- <source>…as Printable Text</source>
- <translation>印刷可能なテキストとして…</translation>
- </message>
- <message>
- <source>Copy only the printable text in the packet.</source>
- <translation>パケット内の印刷可能なテキストだけをコピー</translation>
- </message>
- <message>
<source>…as MIME Data</source>
<translation>MIMEデータとして...</translation>
</message>
@@ -2023,10 +2164,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>印刷可能なASCII文字とエスケープシーケンスとしてパケットバイト列をコピー</translation>
</message>
<message>
+ <source>…as Go literal</source>
+ <translation>…Go 言語のリテラルとして</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation>Go言語のリテラルとしてパケットバイト列をコピーします。</translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation>…C言語配列として</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
+ <translation>C言語配列としてパケットバイト列をコピーします。</translation>
+ </message>
+ <message>
<source>…as a Hex Stream</source>
<translation>16進数ストリームとして…</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation>…UTF-8テキストとして</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation>UTF-8として扱ってパケットバイト列をテキストとしてコピーします</translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation>ASCII形式テキストとして…</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation>ASCII形式として扱ってパケットバイト列をテキストとしてコピーします</translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>16進数ストリームとしてパケットバイト列をコピー</translation>
</message>
@@ -2822,6 +2995,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>表示フィルタ:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation>PDUをエクスポート</translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2861,10 +3038,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>開始</translation>
</message>
<message>
- <source>Save</source>
- <translation>保存</translation>
- </message>
- <message>
<source>Default</source>
<translation>デフォルト</translation>
</message>
@@ -3005,6 +3178,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>表示フィルタ</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation>表示フィルタマクロ</translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>新規マクロ</translation>
+ </message>
+ <message>
<source>Open </source>
<translation>開く </translation>
</message>
@@ -3088,10 +3269,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>マクロ名</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>フィルタ名</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation>マクロ式</translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>フィルタ式</translation>
</message>
@@ -3177,22 +3366,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>&quot;ファイル&quot; ダイアログ</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>キャプチャファイル</translation>
- </message>
- <message>
<source>Temp</source>
<translation>一時的</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>名称未設定キャプチャファイル</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>個人設定</translation>
</message>
@@ -3201,14 +3378,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>グローバル設定</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfilters, preferences, ethers, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>dfilters, preferences, manuf, …</translation>
- </message>
- <message>
<source>System</source>
<translation>システム</translation>
</message>
@@ -3221,18 +3390,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>プログラム</translation>
</message>
<message>
- <source>program files</source>
- <translation>プログラムファイル</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>個人プラグイン</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>バイナリプラグイン</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>グローバルプラグイン</translation>
</message>
@@ -3249,11 +3410,35 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Luaスクリプト</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation>&quot;ファイル&quot; ダイアログの場所</translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation>キャプチャファイル</translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation>名称未設定キャプチャファイル</translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation>設定, プロファイル, manuf, …</translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation>プログラムファイル</translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation>バイナリプラグイン</translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>個人Extcapパス</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation>外部キャプチャ(extcap)プラグイン</translation>
</message>
<message>
@@ -3386,6 +3571,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation>イベント %1 </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;読み取り&lt;/span&gt;, </numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;書き込み&lt;/span&gt;, </numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation>クリックして選択します</translation>
</message>
@@ -3418,6 +3619,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>選択したパケットに %1 ストリームは見つかりませんでした</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>読み取りアクティビティ(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>書き込みアクティビティ(%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>全体のI/Oアクティビティ(%1)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>全体の対話 (%1)</translation>
</message>
@@ -3433,10 +3646,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation>…としてストリーム内容を保存</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[ストリーム出力が切り詰められました]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation>
@@ -3462,9 +3671,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>ヒント</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>としてデータを表示</translation>
+ <source>Show as</source>
+ <translation>として表示</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation>デルタ時間なし</translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation>ターンデルタ時間</translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation>全デルタ時間</translation>
</message>
<message>
<source>Stream</source>
@@ -3479,11 +3699,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>検索:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>大文字小文字を区別</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>次を検索(&amp;N)</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[ストリーム出力が切り詰められました]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3819,29 +4050,28 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>このグラフを削除します</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>新規グラフを追加します</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>このグラフを複製します</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>すべてのグラフをクリア</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>このグラフを上に移動します</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation>選択したグラフを削除します</translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation>このグラフを下に移動します</translation>
+ <source>Duplicate the selected graph(s).</source>
+ <translation>選択したグラフを複製します</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation>選択したグラフを上に移動します</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation>選択したグラフを下に移動します</translation>
</message>
<message>
<source>Mouse</source>
@@ -3884,10 +4114,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>凡例を有効化</translation>
</message>
<message>
- <source>Reset</source>
- <translation>リセット</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>グラフをリセット</translation>
</message>
@@ -4101,6 +4327,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>別のプロファイルからグラフをコピーします</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation>1マイクロ秒</translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation>2マイクロ秒</translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation>5マイクロ秒</translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation>10マイクロ秒</translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation>20マイクロ秒</translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation>50マイクロ秒</translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation>100マイクロ秒</translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation>200マイクロ秒</translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation>500マイクロ秒</translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1ミリ秒</translation>
</message>
@@ -4145,6 +4407,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>5 秒</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation>2分</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation>5分</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Wireshark入出力グラフ: %1</translation>
</message>
@@ -4157,6 +4427,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>フィルタされたイベント</translation>
</message>
<message>
+ <source>All packets</source>
+ <translation>すべてのパケット</translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation>すべてのイベント</translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>すべてのパケット</translation>
</message>
@@ -4169,8 +4447,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>すべてのイベント</translation>
</message>
<message>
- <source>Access Denied</source>
- <translation>アクセス拒否</translation>
+ <source>All Execs</source>
+ <translation>全ての Execs</translation>
</message>
<message>
<source>Hover over the graph for details.</source>
@@ -4217,6 +4495,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>クリックしてグラフの割合を選びます</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation>%1 インターバル</translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation>左上に移動</translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation>中央上に移動</translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation>右上に移動</translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation>左下に移動</translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation>中央下に移動</translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation>右下に移動</translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>PDF形式 (*.pdf)</translation>
</message>
@@ -4912,7 +5218,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>&lt;p&gt;Local interfaces are unavailable because the packet capture driver isn&apos;t loaded.&lt;/p&gt;&lt;p&gt;You can fix this by running &lt;pre&gt;net start npcap&lt;/pre&gt; if you have Npcap installed or &lt;pre&gt;net start npf&lt;/pre&gt; if you have WinPcap installed. Both commands must be run as Administrator.&lt;/p&gt;</source>
- <translation>&lt;p&gt;キャプチャドライバが読み込まれていないためローカル印ーフェースは利用できません。&lt;/p&gt;&lt;p&gt;以下を実行することで修正することができます。 もしNpcapをインストールした場合、&lt;pre&gt;net start npcap&lt;/pre&gt; もしWinPcapをインストールした場合、&lt;pre&gt;net start npf&lt;/pre&gt; 両方のコマンドは管理者権限として実行する必要があります。&lt;/p&gt;</translation>
+ <translation>&lt;p&gt;キャプチャドライバが読み込まれていないためローカルインターフェースは利用できません。&lt;/p&gt;&lt;p&gt;以下を実行することで修正することができます。 もしNpcapをインストールした場合、&lt;pre&gt;net start npcap&lt;/pre&gt; もしWinPcapをインストールした場合、&lt;pre&gt;net start npf&lt;/pre&gt; 両方のコマンドは管理者権限として実行する必要があります。&lt;/p&gt;</translation>
</message>
<message>
<source>&lt;p&gt;You don&apos;t have permission to capture on local interfaces.&lt;/p&gt;&lt;p&gt;You can fix this by &lt;a href=&quot;file://%1&quot;&gt;installing ChmodBPF&lt;/a&gt;.&lt;/p&gt;</source>
@@ -4969,6 +5275,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation>デフォルト</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5943,8 +6256,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>LTE MAC統計</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation>LTE/NR Mac 統計</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6252,12 +6565,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>シーケンス番号</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>LTE RLCグラフ (UE=%1 chan=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation>%1 RLC グラフ (UE=%2 chan=%3%4 %5 - %6)</translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>LTE RLCグラフ - チャンネルが選択されていません</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation>3GPP RLC グラフ - チャンネルが選択されていません</translation>
</message>
<message>
<source>Save As…</source>
@@ -6311,8 +6624,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>LTE RLC統計</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation>3GPP RLC 統計</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6398,6 +6711,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>プロファイル: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation> %1 表示: %2 (%3%)</translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>プロファイルの管理...</translation>
</message>
@@ -6458,6 +6775,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform>%Ln バイト</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln ビット</numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>%1 バイト</translation>
@@ -6471,9 +6794,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>選択されたパケット: %1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>パケット数: %1 %4 表示: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation>選択したイベント: %1 %2 </translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation>イベント: %1</translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6505,6 +6831,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>パケットなし</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation>イベントなし</translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>Zipファイルより...</translation>
</message>
@@ -6536,6 +6866,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation>%1 として表示フィルタ</translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6567,6 +6904,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>一番最近に使ったフォルダ</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation>現在の稼働ディレクトリ</translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>ここまで表示</translation>
</message>
@@ -6997,6 +7338,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>フィールド値を表示</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation>更新</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>…としてダイアグラムを保存</translation>
</message>
@@ -7044,6 +7389,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>パケットバイト列を表示</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation>レイアウト:</translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>パケット %1</translation>
</message>
@@ -7065,6 +7414,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform>%Ln バイト</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln ビット</numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7524,10 +7879,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>このプロファイルをコピーします</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation>自動プロファイルスイッチのためのパケットやイベントの数</translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation>自動スイッチパケット限度</translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>設定プロファイル</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation>自動スイッチイベント限度</translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>インポート</translation>
@@ -7703,6 +8070,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>削除済</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation>自動スイッチフィルタ</translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>コピー</translation>
@@ -8226,6 +8597,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>マーカー欠如?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation>LTE</translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation>NR</translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8246,6 +8625,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation>RAT</translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL フレーム</translation>
</message>
@@ -8469,9 +8852,69 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation>参照…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation>パケット</translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation>イベント</translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation>バイト</translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation>ビット</translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation>フレーム数</translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation>フィールド数</translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation>合計</translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation>最大</translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation>最小</translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation>平均</translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation>スループット</translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation>読込</translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation>左</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation>中央</translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation>右</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation>CCCH</translation>
@@ -8572,6 +9015,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation>全ての %1 を内容に合わせてリサイズします</translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8687,6 +9137,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>解決したアドレス</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation>コピー</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>…として保存</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># %1 に解決したアドレスが見つかりました</translation>
</message>
@@ -8700,6 +9158,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation>プレインテキストとして</translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation>選択した行をコピー</translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>表をコピー</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation>CSVとして</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation>JSONとして</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation>選択した行を…として保存</translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation>…として表を保存</translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation>…として解決したアドレスを保存</translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation>プレインテキスト (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation>CSV書類 (*.csv)</translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation>JSON書類 (*.json)</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>警告</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation>%1を保存できません: %2</translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10374,6 +10887,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>パケットバイト列</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;オプション:&lt;/b&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;ナロー文字列 (UTF-8とASCII)もしくはワイド(UTF-16)文字を検索&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10394,6 +10911,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>大文字小文字を区別</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation>戻る</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;次のパケットへ進む前に現在のパケットの中で続いて起こるフィールド値を検索します。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation>複数発生するフィールド値</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;表示フィルタ構文(例 ip.addr==10.1.1.1),16数文字列(例 ffffda5),平文文字列(例 My String)もしくは正規表現(例 colou?r)を用いてデータを検索しますt;/body&gt;&lt;/html&gt;</translation>
@@ -10431,6 +10960,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>無効なフィルタです</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation>イベントリスト</translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation>イベント詳細</translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation>イベントバイト数</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;イベント一覧(概要部分)やデコードされたイベント表示ラベル(ツリー表示部分)やアスキー変換されたイベントデータ(16進数表示部分)を検索します&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>そのフィルタは何も検査しません</translation>
</message>
@@ -10853,7 +11398,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Decode as</source>
- <translation>としてでコード</translation>
+ <translation>としてデコード</translation>
</message>
<message>
<source>Show as</source>
@@ -10872,6 +11417,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>検索:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>大文字小文字を区別</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>次を検索</translation>
</message>
@@ -10966,13 +11515,21 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>…として保存</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation>%1 としてデコードされました</translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>…として選択したパケットバイト列を保存</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation>%1 を圧縮しました</translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation>
- <numerusform>%Ln バイトを表示中</numerusform>
+ <numerusform>%Ln バイトを利用</numerusform>
</translation>
</message>
<message>
@@ -11072,6 +11629,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>表示フィルタ:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation>ヘッダーを除去</translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -12045,22 +12606,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>新規エントリを作成します</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>このエントリを削除します</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>選択したエントリを削除します</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>このエントリをコピーします</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>選択したエントリをコピーします</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>エントリを上に移動します</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>選択したエントリを上に移動します</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>エントリを下に移動します</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>選択したエントリを下に移動します</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12086,20 +12645,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>新規エントリを作成します</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>このエントリを削除します</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>選択したエントリを削除します</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>このエントリをコピーします</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>選択したエントリをコピーします</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>エントリを上に移動します</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>選択したエントリを上に移動します</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>エントリを下に移動します</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>選択したエントリを下に移動します</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12469,10 +13028,18 @@ a:hover {
<translation>あなたはWiresharkを使ってインターネットを互いにつなぐ膠をキャプチャしています</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation>あなたはLograyを使ってシステムを互いに繋ぐ膠をキャプチャしています</translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Wiresharkを起動中</translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation>Lograyを起動中です </translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation>自動アップデートを受信します</translation>
</message>
@@ -12749,14 +13316,6 @@ a:hover {
<translation>ファイルが見つかりませんでした</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>目次(&amp;C)</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Wiresharkフィルタ</translation>
- </message>
- <message>
<source>TShark</source>
<translation>Tshark</translation>
</message>
@@ -13022,10 +13581,6 @@ a:hover {
<translation>無線ツールバー</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>ヘルプ目次</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>FAQ&apos;s</translation>
</message>
@@ -13146,11 +13701,6 @@ a:hover {
<translation>前のパケットを検索します</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>パケットをマーク/マーク解除(&amp;M)</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>表示されているものをすべてマークします</translation>
</message>
@@ -13179,11 +13729,6 @@ a:hover {
<translation>前にマークされたパケットに移動します</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>パケットを無視/無視を解除(&amp;I)</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>表示されているものすべてを無視します</translation>
</message>
@@ -13624,10 +14169,6 @@ a:hover {
<translation>レイアウトをリセット</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>外観のレイアウトをデフォルトのサイズにリセットします</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>最初にキャプチャしたパケットからの経過時間</translation>
</message>
@@ -13788,22 +14329,30 @@ a:hover {
<translation>MACアドレスブロック</translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
- <translation>TLSキーログランチャー</translation>
- </message>
- <message>
- <source>Release Notes</source>
- <translation>リリースノート</translation>
- </message>
- <message>
<source>&amp;Options…</source>
<translation>オプション…(&amp;O)</translation>
</message>
<message>
+ <source>&amp;3GPP Uu</source>
+ <translation>&amp;3GPP Uu</translation>
+ </message>
+ <message>
<source>&amp;Wireless</source>
<translation>無線(&amp;W)</translation>
</message>
<message>
+ <source>&amp;User&apos;s Guide</source>
+ <translation>&amp;ユーザーズガイド</translation>
+ </message>
+ <message>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation>ワイヤーシャークユーザーズガイド</translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
+ <translation>表示フィルタ</translation>
+ </message>
+ <message>
<source>Capture &amp;Filters…</source>
<translation>キャプチャフィルタ…(&amp;F)</translation>
</message>
@@ -13848,10 +14397,18 @@ a:hover {
<translation>前を検索(&amp;v)</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation>選択をマーク/マーク解除(&amp;M)</translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>各々の選択されたパケットをマーク/マーク解除します</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation>選択を無視/無視を解除(&amp;I)</translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>各々の選択されたパケットを無視/無視を解除します</translation>
</message>
@@ -13892,6 +14449,18 @@ a:hover {
<translation>TCP スループット</translation>
</message>
<message>
+ <source>General</source>
+ <translation>一般</translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation>クエリ-応答</translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation>DNSクエリ-応答統計</translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>リクエストシーケンス</translation>
</message>
@@ -13900,6 +14469,14 @@ a:hover {
<translation>HTTPリクエストシーケンス</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation>E2AP</translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation>E2AP メッセージ</translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>…としてデコード(&amp;A)</translation>
</message>
@@ -13960,6 +14537,10 @@ a:hover {
<translation>標準サイズ</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation>デフォルトサイズにレイアウトをリセット</translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>列幅を再調整</translation>
</message>
@@ -14218,6 +14799,14 @@ a:hover {
<translation>選択されたフィールドによって参照されたパケットへ移動します</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation>TLSキーログランチャー</translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>リリースノート</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>VoIP通話(&amp;V)</translation>
</message>
@@ -14250,10 +14839,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14538,6 +15123,10 @@ a:hover {
<translation>保存しないで終了(&amp;w)</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation>USB CDC データ</translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>このバージョンのWiresharkには &quot;rtp.ssrc&quot; フィールドはありません</translation>
</message>
diff --git a/ui/qt/wireshark_ko.ts b/ui/qt/wireshark_ko.ts
index 8a2f795f..e95bea54 100644
--- a/ui/qt/wireshark_ko.ts
+++ b/ui/qt/wireshark_ko.ts
@@ -44,8 +44,8 @@
<translation>폴더</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>경로로 필터</translation>
+ <source>Search Folders</source>
+ <translation>폴더 검색</translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>라이선스</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>Logray 정보</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>디렉터리가 존재하지 않음</translation>
</message>
@@ -754,6 +762,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>캡처 주석 편집</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>주석 추가</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>부분 %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>주석 %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -821,7 +851,7 @@
<source>%1, timed out at %Ln packet(s)</source>
<oldsource>%1, timed out at %2 packets</oldsource>
<translation type="vanished">
- <numerusform>%1, 패킷 %Ln개 이후 시간 초과됨</numerusform>
+ <numerusform>%1, 패킷 %Ln개 이후 시간 초과</numerusform>
</translation>
</message>
<message numerus="yes">
@@ -859,10 +889,6 @@
<translation>읽기 필터:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>gzip 형식으로 압축(&amp;Z)</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>캡처 파일 열기</translation>
@@ -941,8 +967,8 @@
<translation>자세한 정보</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>캡처 파일 주석</translation>
+ <source>Edit Comments</source>
+ <translation>주석 편집</translation>
</message>
<message>
<source>Refresh</source>
@@ -953,10 +979,6 @@
<translation>클립보드에 복사</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>주석 저장</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>캡처 파일 속성</translation>
</message>
@@ -1005,10 +1027,18 @@
<translation>처음 패킷</translation>
</message>
<message>
+ <source>First event</source>
+ <translation>첫 이벤트</translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>마지막 패킷</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation>마지막 이벤트</translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>경과 시간</translation>
</message>
@@ -1045,6 +1075,10 @@
<translation>누락된 패킷</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation>누락된 이벤트</translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>캡처 필터</translation>
</message>
@@ -1057,6 +1091,10 @@
<translation>패킷 크기 제한(snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation>이벤트 크기 제한(snaplen)</translation>
+ </message>
+ <message>
<source>none</source>
<translation>없음</translation>
</message>
@@ -1065,6 +1103,26 @@
<translation>%1바이트</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>주석</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>주석 %1</translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation>복호화 비밀 정보</translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>유형</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>크기</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>통계</translation>
</message>
@@ -1089,6 +1147,10 @@
<translation>패킷 수</translation>
</message>
<message>
+ <source>Events</source>
+ <translation>이벤트</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>시간 간격, 초</translation>
</message>
@@ -1101,6 +1163,10 @@
<translation>평균 패킷 크기, 바이트</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation>평균 이벤트 크기, 바이트</translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>바이트</translation>
</message>
@@ -1113,14 +1179,14 @@
<translation>초당 평균 비트 수</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>부분 주석</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>패킷 주석</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation>이벤트 주석</translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;프레임 %1: </translation>
</message>
@@ -1132,6 +1198,14 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Logray %1에서 생성됨
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1359,6 +1433,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
예를 들어 1시간으로 설정하면 매시간마다 새로운 파일을 만듭니다.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;일반적으로 무선 네트워크 카드는 수신이나 발신 네트워크 주소가 자기 자신인 트래픽만 캡처하며, &lt;em&gt;사용자 데이터&lt;/em&gt; 트래픽에는 &amp;quot;가짜&amp;quot; 이더넷 헤더를 추가하여 캡처합니다. 무선 네트워크 카드가 &amp;quot;볼 수&amp;quot; 있는 모든 트래픽을 캡처하거나, 802.11 관리 및 제어 패킷 또는 라디오 계층 정보를 보려면 이 옵션을 선택하십시오. 무선 네트워크 카드와 드라이버에 따라서 모니터 모드 사용 가능 여부가 달라집니다. Wi-Fi 네트워크에서 패킷을 캡처하는 과정에 대한 자세한 정보를 보려면 위키 페이지를 참조하십시오.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>모든 802.11 인터페이스에서 모니터 모드 활성화</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>압축</translation>
</message>
@@ -1371,6 +1453,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation>파일 중위 표기 패턴</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;여러 파일 모드에서는 파일 이름과 접두사 사이에 날짜, 시간, 파일 순서 번호가 추가됩니다. 이들의 순서를 선택하십시오.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation>YYYYmmDDHHMMSS_NNNNN</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;파일 순서 번호 이전에 날짜와 시간을 배치합니다. 파일을 이름 순으로 정렬했을 때 생성 시간 순서를 따르며, 같은 배치에서 생성된 파일이 인접하게 배치됩니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation>NNNNN_YYYYmmDDHHMMSS</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;날짜와 시간 이전에 파일 순서 번호를 배치합니다. Wireshark에서 역사적으로 사용했던 방식입니다..&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;다음 파일로 캡처를 전환한 후 생성하기로 지정한 파일 개수를 초과하면 가장 오래된 파일을 지울 것입니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1444,7 +1550,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Stop capture automatically after…</source>
- <translation>다음 이후 자동으로 캡처 정지</translation>
+ <translation>다음 이후 자동으로 캡처 정지…</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified number of packets have been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
@@ -1459,6 +1565,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;지정한 개수의 파일을 생성한 후 캡처를 정지합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation>지정한 개수의 파일을 생성한 후 캡처를 정지합니다.</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;지정한 분량의 데이터를 캡처한 후 캡처를 정지합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1468,7 +1578,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Stop capturing after the specified amount of time has passed.</source>
- <translation>지정한 시간이 지난 뒤 캡처를 정지합니다.</translation>
+ <translation>지정한 시간이 지난 후 캡처를 정지합니다.</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Optionally specify a temporary directory for unnamed capture files.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
@@ -1519,8 +1629,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>오류</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>여러 파일: 요청한 파일 크기가 너무 큽니다. 파일 최대 크기는 2 GiB입니다.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation>여러 파일: 요청한 파일 크기가 너무 큽니다. 파일 크기는 2 TB를 초과할 수 없습니다.</translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1550,6 +1660,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>무작위 모드로 패킷 캡처</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;일반적으로 무선 네트워크 카드는 수신이나 발신 네트워크 주소가 자기 자신인 트래픽만 캡처하며, &lt;em&gt;사용자 데이터&lt;/em&gt; 트래픽에는 &amp;quot;가짜&amp;quot; 이더넷 헤더를 추가하여 캡처합니다. 무선 네트워크 카드가 &amp;quot;볼 수&amp;quot; 있는 모든 트래픽을 캡처하거나, 802.11 관리 및 제어 패킷 또는 라디오 계층 정보를 보려면 이 옵션을 선택하십시오. 무선 네트워크 카드와 드라이버에 따라서 모니터 모드 사용 가능 여부가 달라집니다. Wi-Fi 네트워크에서 패킷을 캡처하는 과정에 대한 자세한 정보를 보려면 위키 페이지를 참조하십시오.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>802.11 인터페이스에서 모니터 모드 활성화</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;다음 세대(Next Generation)의 캡처 파일 형식으로 패킷을 캡처합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1777,6 +1895,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>해석됨</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>폭</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>정렬</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;필드의 원시값 대신 사람이 읽을 수 있는 문자열로 보여 줍니다. 문자열 값을 갖는 필드를 가진 사용자 지정 칼럼에 대해서만 적용 가능합니다.&lt;/html&gt;</translation>
</message>
@@ -1824,6 +1950,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation>압축 옵션</translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation>압축하지 않음(&amp;U)</translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation>gzip으로 압축(&amp;Z)</translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation>LZ4로 압축(&amp;L)</translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1890,6 +2035,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>비트/초 B</translation>
</message>
<message>
+ <source>Flows</source>
+ <translation>플로</translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>전체 패킷</translation>
</message>
@@ -2004,14 +2153,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>16진수 덤프 형식으로 패킷 바이트를 복사합니다.</translation>
</message>
<message>
- <source>…as Printable Text</source>
- <translation>출력 가능한 문자열로 복사</translation>
- </message>
- <message>
- <source>Copy only the printable text in the packet.</source>
- <translation>패킷 내의 출력 가능한 문자열만 복사합니다.</translation>
- </message>
- <message>
<source>…as MIME Data</source>
<translation>MIME 데이터로 복사</translation>
</message>
@@ -2024,10 +2165,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>출력 가능한 ASCII 문자와 탈출 시퀀스로 패킷 바이트를 복사합니다.</translation>
</message>
<message>
+ <source>…as Go literal</source>
+ <translation>Go 리터럴로 복사</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation>Go 리터럴 형식으로 패킷 바이트를 복사합니다.</translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation>C 언어 배열로 복사</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
+ <translation>C 언어 배열 형식으로 패킷 바이트를 복사합니다.</translation>
+ </message>
+ <message>
<source>…as a Hex Stream</source>
<translation>16진수 스트림으로 복사</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation>UTF-8 텍스트로 복사</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation>패킷 바이트를 UTF-8 텍스트로 취급하여 복사합니다.</translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation>ASCII 텍스트로 복사</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation>패킷 바이트를 ASCII 텍스트로 취급하여 복사합니다.</translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>16진수 스트림으로 패킷 바이트를 복사합니다.</translation>
</message>
@@ -2823,6 +2996,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>표시 필터:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation>PDU 내보내기</translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2862,10 +3039,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>시작</translation>
</message>
<message>
- <source>Save</source>
- <translation>저장</translation>
- </message>
- <message>
<source>Default</source>
<translation>기본값</translation>
</message>
@@ -3006,6 +3179,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>표시 필터</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation>표시 필터 매크로</translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>새 매크로</translation>
+ </message>
+ <message>
<source>Open </source>
<translation>열기: </translation>
</message>
@@ -3089,10 +3270,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>매크로 이름</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>필터 이름</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation>매크로 표현식</translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>필터 표현식</translation>
</message>
@@ -3178,22 +3367,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>&quot;파일&quot; 대화 상자</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>캡처 파일</translation>
- </message>
- <message>
<source>Temp</source>
<translation>임시</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>이름 없는 캡처 파일</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>개인 환경 설정</translation>
</message>
@@ -3202,14 +3379,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>전역 설정</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfilters, 설정, ethers, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>dfilters, 설정, manuf, …</translation>
- </message>
- <message>
<source>System</source>
<translation>시스템</translation>
</message>
@@ -3222,18 +3391,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>프로그램</translation>
</message>
<message>
- <source>program files</source>
- <translation>프로그램 파일</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>사용자 플러그인</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>바이너리 플러그인</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>전역 플러그인</translation>
</message>
@@ -3250,12 +3411,36 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Lua 스크립트</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation>&quot;파일&quot; 대화 상자 위치</translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation>캡처 파일</translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation>제목 없는 캡처 파일</translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation>설정, 프로필, 제조사, …</translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation>프로그램 파일</translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation>바이너리 플러그인</translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>사용자 Extcap 경로</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
- <translation>외부 캡처(Extcap) 플러그인</translation>
+ <source>External capture (extcap) plugins</source>
+ <translation>외부 캡처(extcap) 플러그인</translation>
</message>
<message>
<source>Global Extcap path</source>
@@ -3325,7 +3510,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message numerus="yes">
<source>%Ln server pkt(s), </source>
<translation type="vanished">
- <numerusform>서버 패킷 %Ln개, </numerusform>
+ <numerusform>서버 패킷 %Ln개,</numerusform>
</translation>
</message>
<message>
@@ -3387,6 +3572,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation>이벤트 %1개. </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>&lt;span style=&quot;color: %1; background-color:%2&quot;&gt;읽기&lt;/span&gt; %Ln개, </numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>&lt;span style=&quot;color: %1; background-color:%2&quot;&gt;쓰기&lt;/span&gt; %Ln개, </numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation> 클릭하면 선택합니다.</translation>
</message>
@@ -3419,6 +3620,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>선택한 패킷에서 %1 스트림을 찾을 수 없습니다.</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>읽기 활동(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>쓰기 활동(%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>전체 I/O 활동(%M)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>전체 대화(%1)</translation>
</message>
@@ -3434,10 +3647,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation>다른 이름으로 스트림 내용 저장…</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[스트림 출력이 잘림]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation>
@@ -3463,9 +3672,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>필터 힌트.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>다음 형식으로 표시:</translation>
+ <source>Show as</source>
+ <translation>다른 형식으로 표시</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation>델타 시간 없음</translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation>턴 델타 시간</translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation>모든 델타 시간</translation>
</message>
<message>
<source>Stream</source>
@@ -3480,11 +3700,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>찾기:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>대소문자 구분</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>다음 찾기(&amp;N)</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[스트림 출력 잘림]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3820,29 +4051,28 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>이 그래프를 삭제합니다.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>새로운 그래프를 추가합니다.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>이 그래프를 복제합니다.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>모든 그래프를 지웁니다.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>이 그래프를 위로 이동합니다.</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation>선택한 그래프를 삭제합니다.</translation>
+ </message>
+ <message>
+ <source>Duplicate the selected graph(s).</source>
+ <translation>선택한 그래프를 복제합니다.</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation>선택한 그래프를 위로 이동합니다.</translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation>이 그래프를 아래로 이동합니다.</translation>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation>선택한 그래프를 아래로 이동합니다.</translation>
</message>
<message>
<source>Mouse</source>
@@ -3885,10 +4115,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>범례 활성화</translation>
</message>
<message>
- <source>Reset</source>
- <translation>초기화</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>그래프 초기화</translation>
</message>
@@ -4102,6 +4328,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>다른 프로필에서 그래프를 복사합니다.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation>1 μs</translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation>2 μs</translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation>5 μs</translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation>10 μs</translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation>20 μs</translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation>50 μs</translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation>100 μs</translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation>200 μs</translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation>500 μs</translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4146,6 +4408,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>5초</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation>2분</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation>5분</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Wireshark I/O 그래프: %1</translation>
</message>
@@ -4158,6 +4428,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>필터된 이벤트</translation>
</message>
<message>
+ <source>All packets</source>
+ <translation>모든 패킷</translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation>모든 이벤트</translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>모든 패킷</translation>
</message>
@@ -4170,8 +4448,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>모든 이벤트</translation>
</message>
<message>
- <source>Access Denied</source>
- <translation>접근 거부됨</translation>
+ <source>All Execs</source>
+ <translation>모든 실행</translation>
</message>
<message>
<source>Hover over the graph for details.</source>
@@ -4218,6 +4496,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>클릭하여 그래프의 부분을 선택하십시오.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation>간격 %1</translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation>왼쪽 위로 이동</translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation>가운데 위로 이동</translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation>오른쪽 위로 이동</translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation>왼쪽 아래로 이동</translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation>가운데 아래로 이동</translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation>오른쪽 아래로 이동</translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>PDF 형식 (*.pdf)</translation>
</message>
@@ -4970,6 +5276,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation>기본값</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5469,7 +5782,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>details for transport</source>
- <translation>전송 상세 정보</translation>
+ <translation>전송 자세한 정보</translation>
</message>
<message>
<source>XXXXX:XXX.XXX.XXX.XXX:XXXXX:XXXXXXXX:XXX.XXX.XXX.XXX:XXXXX</source>
@@ -5878,7 +6191,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Packet Details</source>
- <translation>패킷 상세 정보</translation>
+ <translation>패킷 자세한 정보</translation>
</message>
<message>
<source>Packet Bytes</source>
@@ -5944,8 +6257,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>LTE MAC 통계</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation>LTE/NR MAC 통계</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6249,12 +6562,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>시퀀스 번호</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>LTE RLC 그래프(UE=%1 chan=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation>%1 RLC 그래프 (UE=%2 chan=%3%4 %5 - %6)</translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>LTE RLC 그래프 - 선택한 채널 없음</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation>3GPP RLC 그래프 - 선택한 채널 없음</translation>
</message>
<message>
<source>Save As…</source>
@@ -6308,8 +6621,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>LTE RLC 통계</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation>3GPP RLC 통계</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6395,6 +6708,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>프로필: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation> %1개 표시됨: %2(%3%)</translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>프로필 관리…</translation>
</message>
@@ -6455,6 +6772,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform>%Ln바이트</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln비트</numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>바이트 %1</translation>
@@ -6468,9 +6791,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>선택된 패킷: %1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>패킷 수: %1 %4 표시됨: %2(%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation>선택된 이벤트: %1 %2 </translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation>이벤트: %1</translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6502,6 +6828,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>패킷 없음</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation>이벤트 없음</translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>ZIP 파일에서...</translation>
</message>
@@ -6533,6 +6863,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation>%1(으)로 표시 필터</translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6564,6 +6901,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>가장 최근에 사용한 폴더</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation>현재 작업 디렉터리</translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>최대 표시 개수</translation>
</message>
@@ -6994,6 +7335,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>필드 값 표시</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation>새로 고침</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>다른 이름으로 다이어그램 저장…</translation>
</message>
@@ -7041,6 +7386,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>패킷 바이트 표시</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation>레이아웃:</translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>패킷 %1</translation>
</message>
@@ -7062,6 +7411,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform>%Ln바이트</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln비트</numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7521,10 +7876,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>이 프로필을 복사합니다.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation>자동 프로필 전환 시 점검할 패킷이나 이벤트 개수입니다.</translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation>자동 전환 패킷 제한</translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>설정 프로필</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation>자동 전환 이벤트 제한</translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>가져오기</translation>
@@ -7700,6 +8067,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>삭제됨</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation>자동 전환 필터</translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>복사</translation>
@@ -8060,7 +8431,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Unacked (Outstanding) Bytes (B)</source>
- <translation type="unfinished"></translation>
+ <translation>ACK되지 않은(대기 중) 바이트(바이트)</translation>
</message>
<message>
<source>[no capture file]</source>
@@ -8223,6 +8594,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>마커 없음?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation>LTE</translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation>NR</translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8243,6 +8622,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation>RAT</translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL 프레임</translation>
</message>
@@ -8466,9 +8849,69 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation>찾아보기...</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation>패킷</translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation>이벤트</translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation>바이트</translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation>비트</translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation>프레임 개수</translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation>필드 개수</translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation>합계</translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation>최댓값</translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation>최솟값</translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation>평균</translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation>처리량</translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation>부하</translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation>왼쪽</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation>가운데</translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation>오른쪽</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation>CCCH</translation>
@@ -8569,6 +9012,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation>모든 %1을(를) 내용에 맞게 조정</translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8684,6 +9134,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>해석된 주소</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation>복사</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>다른 이름으로 저장…</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># %1에서 발견된 해석된 주소</translation>
</message>
@@ -8697,6 +9155,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation>일반 텍스트로</translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation>선택한 행 복사</translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>표 복사</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation>CSV로</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation>JSON으로</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation>선택한 행을 다른 이름으로 저장…</translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation>표를 다른 이름으로 저장…</translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation>해석된 주소를 다른 이름으로 저장…</translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation>일반 텍스트 (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation>CSV 문서 (*.csv)</translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation>JSON 문서 (*.json)</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>경고</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation>%1을(를) 저장할 수 없음: %2</translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10371,6 +10884,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>패킷 바이트</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;옵션:&lt;/b&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;좁은 문자(UTF-8과 ASCII) 또는 넓은 문자(UTF-16)를 포함하는 문자열을 검색합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10391,6 +10908,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>대소문자 구분</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation>역방향</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;다음 패킷으로 진행하기 전에 현재 패킷에서 일치 여부를 계속 검색합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation>여러 번 발견됨</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;표시 필터 문법(예: ip.addr==10.1.1.1), 16진수 문자열(예: ffffda5), 일반 문자열(예: My String) 또는 정규 표현식(예: colou?r)을 사용하여 데이터를 검색합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10428,6 +10957,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>잘못된 필터입니다.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation>이벤트 목록</translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation>이벤트 자세한 정보</translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation>이벤트 바이트</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;이벤트 목록의 정보 열(요약 패널), 디코드된 이벤트 표시 이름표(트리 보기 패널), ASCII로 변환된 이벤트 데이터(16진수 보기 패널) 중에서 검색합니다.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>필터에서 아무것도 시험하지 않습니다.</translation>
</message>
@@ -10869,6 +11414,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>찾기:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>대소문자 구분</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>다음 찾기(&amp;N)</translation>
</message>
@@ -10963,13 +11512,21 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>다른 이름으로 저장…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation>%1(으)로 디코드했습니다.</translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>선택한 패킷 바이트를 다른 이름으로 저장…</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation>%1 압축됨</translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation>
- <numerusform>%Ln바이트를 표시하고 있습니다.</numerusform>
+ <numerusform>%Ln바이트를 사용합니다.</numerusform>
</translation>
</message>
<message>
@@ -11069,6 +11626,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>표시 필터:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation>헤더 잘라내기</translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -12042,22 +12603,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>새 항목을 만듭니다.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>이 항목을 삭제합니다.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>선택한 항목을 삭제합니다.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>이 항목을 복사합니다.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>선택한 항목을 복사합니다.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>항목을 위로 이동합니다.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>선택한 항목을 위로 이동합니다.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>항목을 아래로 이동합니다.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>선택한 항목을 아래로 이동합니다.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12083,20 +12642,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>새 항목을 만듭니다.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>이 항목을 삭제합니다.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>선택한 항목을 삭제합니다.</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>이 항목을 복사합니다.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>선택한 항목을 복사합니다.</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>항목을 위로 이동합니다.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>선택한 항목을 위로 이동합니다.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>항목을 아래로 이동합니다.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>선택한 항목을 아래로 이동합니다.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12466,10 +13025,18 @@ a:hover {
<translation>Wireshark를 사용하여 인터넷을 고정하는 접착제의 냄새를 맡고(스니핑) 있습니다 </translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation>Logray를 사용하여 시스템을 고정하는 접착제의 냄새를 맡고(스니핑) 있습니다 </translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>실행 중인 Wireshark 버전: </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation>실행 중인 Logray 버전: </translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation> 자동 업데이트를 받고 있습니다.</translation>
</message>
@@ -12746,14 +13313,6 @@ a:hover {
<translation>찾은 파일 없음</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>내용(&amp;C)</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Wireshark 필터</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -13019,10 +13578,6 @@ a:hover {
<translation>무선 도구 모음</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>도움말 내용</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>자주 묻는 질문</translation>
</message>
@@ -13143,11 +13698,6 @@ a:hover {
<translation>이전 패킷 찾기</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>패킷 마크/해제(&amp;M)</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>표시된 모든 패킷 마크</translation>
</message>
@@ -13176,11 +13726,6 @@ a:hover {
<translation>이전 마크한 패킷으로 이동</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>패킷 무시/해제(&amp;I)</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>표시된 모든 패킷 무시</translation>
</message>
@@ -13621,10 +14166,6 @@ a:hover {
<translation>레이아웃 초기화</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>외관 레이아웃을 기본 크기로 초기화</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>최초로 캡처된 패킷부터 지난 초 단위 시간</translation>
</message>
@@ -13785,22 +14326,30 @@ a:hover {
<translation>MAC 주소 블록</translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
- <translation>TLS 키로그 실행기</translation>
- </message>
- <message>
- <source>Release Notes</source>
- <translation>릴리스 노트</translation>
- </message>
- <message>
<source>&amp;Options…</source>
<translation>옵션(&amp;O)…</translation>
</message>
<message>
+ <source>&amp;3GPP Uu</source>
+ <translation>3GPP Uu(&amp;3)</translation>
+ </message>
+ <message>
<source>&amp;Wireless</source>
<translation>무선(&amp;W)</translation>
</message>
<message>
+ <source>&amp;User&apos;s Guide</source>
+ <translation>사용자 설명서(&amp;U)</translation>
+ </message>
+ <message>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation>Wireshark 사용자 설명서</translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
+ <translation>표시 필터</translation>
+ </message>
+ <message>
<source>Capture &amp;Filters…</source>
<translation>캡처 필터(&amp;F)…</translation>
</message>
@@ -13845,10 +14394,18 @@ a:hover {
<translation>이전 찾기(&amp;V)</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation>선택 항목 마크/해제(&amp;M)</translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>각 선택된 패킷 마크/해제</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation>선택 항목 무시/해제(&amp;I)</translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>각 선택된 패킷 무시/해제</translation>
</message>
@@ -13889,6 +14446,18 @@ a:hover {
<translation>TCP 처리량</translation>
</message>
<message>
+ <source>General</source>
+ <translation>일반</translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation>질의-응답</translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation>DNS 질의-응답 통계</translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>요청 시퀀스</translation>
</message>
@@ -13897,6 +14466,14 @@ a:hover {
<translation>HTTP 요청 시퀀스</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation>E2AP</translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation>E2AP 메시지</translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>다른 형식으로 디코드(&amp;A)…</translation>
</message>
@@ -13957,6 +14534,10 @@ a:hover {
<translation>보통 크기</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation>레이아웃을 기본값으로 초기화</translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>열 크기 조정</translation>
</message>
@@ -14215,6 +14796,14 @@ a:hover {
<translation>선택한 필드에서 참조하는 패킷으로 이동합니다.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation>TLS 키로그 실행기</translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>릴리스 노트</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>VoIP 호(&amp;V)</translation>
</message>
@@ -14247,10 +14836,6 @@ a:hover {
<translation>GSM(&amp;G)</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>LTE(&amp;L)</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>MTP3(&amp;M)</translation>
</message>
@@ -14535,6 +15120,10 @@ a:hover {
<translation>저장하지 않고 끝내기(&amp;W)</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation>USB CDC 데이터</translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>이 버전의 Wireshark에는 &quot;rtp.ssrc&quot; 필드가 없습니다.</translation>
</message>
diff --git a/ui/qt/wireshark_main_window.cpp b/ui/qt/wireshark_main_window.cpp
index 040c45ba..d1f7dcd0 100644
--- a/ui/qt/wireshark_main_window.cpp
+++ b/ui/qt/wireshark_main_window.cpp
@@ -12,7 +12,7 @@
/*
* The generated Ui_WiresharkMainWindow::setupUi() can grow larger than our configured limit,
- * so turn off -Wframe-larger-than= for ui_main_window.h.
+ * so turn off -Wframe-larger-than= for ui_wireshark_main_window.h.
*/
DIAG_OFF(frame-larger-than=)
#include <ui_wireshark_main_window.h>
@@ -32,6 +32,7 @@ DIAG_ON(frame-larger-than=)
#include <frame_tvbuff.h>
#include "ui/iface_toolbar.h"
+#include "ui/commandline.h"
#ifdef HAVE_LIBPCAP
#include "ui/capture.h"
@@ -75,6 +76,7 @@ DIAG_ON(frame-larger-than=)
#include <ui/qt/widgets/filter_expression_toolbar.h>
#include <ui/qt/utils/color_utils.h>
+#include <ui/qt/utils/profile_switcher.h>
#include <ui/qt/utils/qt_ui_utils.h>
#include <ui/qt/utils/stock_icon.h>
#include <ui/qt/utils/variant_pointer.h>
@@ -96,7 +98,7 @@ DIAG_ON(frame-larger-than=)
//menu_recent_file_write_all
// If we ever add support for multiple windows this will need to be replaced.
-static WiresharkMainWindow *gbl_cur_main_window_ = NULL;
+static WiresharkMainWindow *gbl_cur_main_window_;
static void plugin_if_mainwindow_apply_filter(GHashTable * data_set)
{
@@ -119,9 +121,9 @@ static void plugin_if_mainwindow_preference(GHashTable * data_set)
const char * pref_value;
DIAG_OFF_CAST_AWAY_CONST
- if (g_hash_table_lookup_extended(data_set, "pref_module", NULL, (gpointer *)&module_name) &&
- g_hash_table_lookup_extended(data_set, "pref_key", NULL, (gpointer *)&pref_name) &&
- g_hash_table_lookup_extended(data_set, "pref_value", NULL, (gpointer *)&pref_value))
+ if (g_hash_table_lookup_extended(data_set, "pref_module", NULL, (void * *)&module_name) &&
+ g_hash_table_lookup_extended(data_set, "pref_key", NULL, (void * *)&pref_name) &&
+ g_hash_table_lookup_extended(data_set, "pref_value", NULL, (void * *)&pref_value))
{
unsigned int changed_flags = prefs_store_ext(module_name, pref_name, pref_value);
if (changed_flags) {
@@ -137,7 +139,7 @@ static void plugin_if_mainwindow_gotoframe(GHashTable * data_set)
if (!gbl_cur_main_window_ || !data_set)
return;
- gpointer framenr;
+ void *framenr;
if (g_hash_table_lookup_extended(data_set, "frame_nr", NULL, &framenr)) {
if (GPOINTER_TO_UINT(framenr) != 0)
@@ -215,7 +217,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
}
else {
ws_info->cf_framenr = 0;
- ws_info->frame_passed_dfilter = FALSE;
+ ws_info->frame_passed_dfilter = false;
}
}
else
@@ -223,7 +225,7 @@ static void plugin_if_mainwindow_get_ws_info(GHashTable * data_set)
/* Initialise the other ws_info structure values */
ws_info->cf_count = 0;
ws_info->cf_framenr = 0;
- ws_info->frame_passed_dfilter = FALSE;
+ ws_info->frame_passed_dfilter = false;
}
}
@@ -293,7 +295,7 @@ static void mainwindow_add_toolbar(const iface_toolbar *toolbar_entry)
}
}
-static void mainwindow_remove_toolbar(const gchar *menu_title)
+static void mainwindow_remove_toolbar(const char *menu_title)
{
if (gbl_cur_main_window_ && menu_title)
{
@@ -301,16 +303,22 @@ static void mainwindow_remove_toolbar(const gchar *menu_title)
}
}
-QMenu* WiresharkMainWindow::findOrAddMenu(QMenu *parent_menu, QString& menu_text) {
- QList<QAction *> actions = parent_menu->actions();
- QList<QAction *>::const_iterator i;
- for (i = actions.constBegin(); i != actions.constEnd(); ++i) {
- if ((*i)->text()==menu_text) {
- return (*i)->menu();
+QMenu* WiresharkMainWindow::findOrAddMenu(QMenu *parent_menu, const QStringList& menu_parts) {
+ for (auto const & menu_text : menu_parts) {
+ bool found = false;
+ for (auto const & action : parent_menu->actions()) {
+ if (action->text() == menu_text.trimmed()) {
+ parent_menu = action->menu();
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ // If we get here the menu entry was not found, add a sub menu
+ parent_menu = parent_menu->addMenu(menu_text.trimmed());
}
}
- // If we get here there menu entry was not found, add a sub menu
- return parent_menu->addMenu(menu_text);
+ return parent_menu;
}
WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
@@ -325,7 +333,8 @@ WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
freeze_focus_(NULL),
was_maximized_(false),
capture_stopping_(false),
- capture_filter_valid_(false)
+ capture_filter_valid_(false),
+ use_capturing_title_(false)
#ifdef HAVE_LIBPCAP
, capture_options_dialog_(NULL)
, info_data_()
@@ -335,10 +344,9 @@ WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
#endif
{
if (!gbl_cur_main_window_) {
- connect(mainApp, SIGNAL(openStatCommandDialog(QString, const char*, void*)),
- this, SLOT(openStatCommandDialog(QString, const char*, void*)));
- connect(mainApp, SIGNAL(openTapParameterDialog(QString, const QString, void*)),
- this, SLOT(openTapParameterDialog(QString, const QString, void*)));
+ connect(mainApp, &MainApplication::openStatCommandDialog, this, &WiresharkMainWindow::openStatCommandDialog);
+ connect(mainApp, &MainApplication::openTapParameterDialog,
+ this, [=](const QString cfg_str, const QString arg, void *userdata) {openTapParameterDialog(cfg_str, arg, userdata);});
}
gbl_cur_main_window_ = this;
#ifdef HAVE_LIBPCAP
@@ -363,23 +371,20 @@ WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
menu_groups_ = QList<register_stat_group_t>()
<< REGISTER_PACKET_ANALYZE_GROUP_UNSORTED
- << REGISTER_ANALYZE_GROUP_CONVERSATION_FILTER
<< REGISTER_PACKET_STAT_GROUP_UNSORTED
<< REGISTER_STAT_GROUP_GENERIC
- << REGISTER_STAT_GROUP_CONVERSATION_LIST
- << REGISTER_STAT_GROUP_ENDPOINT_LIST
<< REGISTER_STAT_GROUP_RESPONSE_TIME
<< REGISTER_STAT_GROUP_RSERPOOL
- << REGISTER_STAT_GROUP_TELEPHONY
- << REGISTER_STAT_GROUP_TELEPHONY_ANSI
- << REGISTER_STAT_GROUP_TELEPHONY_GSM
- << REGISTER_STAT_GROUP_TELEPHONY_LTE
- << REGISTER_STAT_GROUP_TELEPHONY_MTP3
- << REGISTER_STAT_GROUP_TELEPHONY_SCTP
+ << REGISTER_TELEPHONY_GROUP_UNSORTED
+ << REGISTER_TELEPHONY_GROUP_ANSI
+ << REGISTER_TELEPHONY_GROUP_GSM
+ << REGISTER_TELEPHONY_GROUP_3GPP_UU
+ << REGISTER_TELEPHONY_GROUP_MTP3
+ << REGISTER_TELEPHONY_GROUP_SCTP
<< REGISTER_TOOLS_GROUP_UNSORTED;
setWindowIcon(mainApp->normalIcon());
- setTitlebarForCaptureFile();
+ updateTitlebar();
setMenusForCaptureFile();
setForCapturedPackets(false);
setMenusForFileSet(false);
@@ -392,36 +397,37 @@ WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
qRegisterMetaType<FilterAction::Action>("FilterAction::Action");
qRegisterMetaType<FilterAction::ActionType>("FilterAction::ActionType");
- connect(this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SLOT(queuedFilterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- Qt::QueuedConnection);
+ connect(this, &WiresharkMainWindow::filterAction, this, &WiresharkMainWindow::queuedFilterAction, Qt::QueuedConnection);
//To prevent users use features before initialization complete
//Otherwise unexpected problems may occur
setFeaturesEnabled(false);
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(setFeaturesEnabled()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(applyGlobalCommandLineOptions()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(zoomText()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initViewColorizeMenu()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addStatsPluginsToMenu()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addDynamicMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(addPluginIFStructures()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initConversationMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initExportObjectsMenus()));
- connect(mainApp, SIGNAL(appInitialized()), this, SLOT(initFollowStreamMenus()));
-
- connect(mainApp, SIGNAL(profileChanging()), this, SLOT(saveWindowGeometry()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(layoutPanes()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(layoutToolbars()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(updatePreferenceActions()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(zoomText()));
- connect(mainApp, SIGNAL(preferencesChanged()), this, SLOT(setTitlebarForCaptureFile()));
-
- connect(mainApp, SIGNAL(updateRecentCaptureStatus(const QString &, qint64, bool)), this, SLOT(updateRecentCaptures()));
+ connect(mainApp, &MainApplication::appInitialized, this, [this]() { setFeaturesEnabled(); });
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::applyGlobalCommandLineOptions);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::zoomText);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::initViewColorizeMenu);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::addStatsPluginsToMenu);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::addDynamicMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::addPluginIFStructures);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::initConversationMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::initExportObjectsMenus);
+ connect(mainApp, &MainApplication::appInitialized, this, &WiresharkMainWindow::initFollowStreamMenus);
+ connect(mainApp, &MainApplication::appInitialized, this,
+ [=]() { addDisplayFilterTranslationActions(main_ui_->menuEditCopy); });
+
+ connect(mainApp, &MainApplication::profileChanging, this, &WiresharkMainWindow::saveWindowGeometry);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WiresharkMainWindow::layoutPanes);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WiresharkMainWindow::layoutToolbars);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WiresharkMainWindow::updatePreferenceActions);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WiresharkMainWindow::zoomText);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WiresharkMainWindow::updateTitlebar);
+
+ connect(mainApp, &MainApplication::updateRecentCaptureStatus, this, &WiresharkMainWindow::updateRecentCaptures);
+ connect(mainApp, &MainApplication::preferencesChanged, this, &WiresharkMainWindow::updateRecentCaptures);
updateRecentCaptures();
#if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
- connect(mainApp, SIGNAL(softwareUpdateRequested()), this, SLOT(softwareUpdateRequested()),
+ connect(mainApp, &MainApplication::softwareUpdateRequested, this, &WiresharkMainWindow::softwareUpdateRequested,
Qt::BlockingQueuedConnection);
#endif
@@ -430,12 +436,13 @@ WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
funnel_statistics_ = new FunnelStatistics(this, capture_file_);
connect(df_combo_box_, &QComboBox::editTextChanged, funnel_statistics_, &FunnelStatistics::displayFilterTextChanged);
connect(funnel_statistics_, &FunnelStatistics::setDisplayFilter, this, &WiresharkMainWindow::setDisplayFilter);
- connect(funnel_statistics_, SIGNAL(openCaptureFile(QString, QString)),
- this, SLOT(openCaptureFile(QString, QString)));
+ connect(funnel_statistics_, &FunnelStatistics::openCaptureFile, this,
+ [=](QString cf_path, QString filter) { openCaptureFile(cf_path, filter); });
+
+ connect(df_combo_box_, &QComboBox::editTextChanged, this, &WiresharkMainWindow::updateDisplayFilterTranslationActions);
file_set_dialog_ = new FileSetDialog(this);
- connect(file_set_dialog_, SIGNAL(fileSetOpenCaptureFile(QString)),
- this, SLOT(openCaptureFile(QString)));
+ connect(file_set_dialog_, &FileSetDialog::fileSetOpenCaptureFile, this, [=](QString cf_path) { openCaptureFile(cf_path); });
initMainToolbarIcons();
@@ -452,20 +459,17 @@ WiresharkMainWindow::WiresharkMainWindow(QWidget *parent) :
main_ui_->displayFilterToolBar->addWidget(filter_expression_toolbar_);
#if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
- connect(wireless_frame_, SIGNAL(showWirelessPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(wireless_frame_, &WirelessFrame::showWirelessPreferences, this, &WiresharkMainWindow::showPreferencesDialog);
#endif
main_ui_->goToFrame->hide();
- connect(main_ui_->goToFrame, SIGNAL(visibilityChanged(bool)),
- main_ui_->actionGoGoToPacket, SLOT(setChecked(bool)));
+ connect(main_ui_->goToFrame, &AccordionFrame::visibilityChanged, main_ui_->actionGoGoToPacket, &QAction::setChecked);
// XXX For some reason the cursor is drawn funny with an input mask set
// https://bugreports.qt-project.org/browse/QTBUG-7174
main_ui_->searchFrame->hide();
- connect(main_ui_->searchFrame, SIGNAL(visibilityChanged(bool)),
- main_ui_->actionEditFindPacket, SLOT(setChecked(bool)));
+ connect(main_ui_->searchFrame, &SearchFrame::visibilityChanged, main_ui_->actionEditFindPacket, &QAction::setChecked);
main_ui_->addressEditorFrame->hide();
main_ui_->columnEditorFrame->hide();
@@ -512,7 +516,7 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
#ifdef HAVE_SOFTWARE_UPDATE
QAction *update_sep = main_ui_->menuHelp->insertSeparator(main_ui_->actionHelpAbout);
main_ui_->menuHelp->insertAction(update_sep, update_action_);
- connect(update_action_, SIGNAL(triggered()), this, SLOT(checkForUpdates()));
+ connect(update_action_, &QAction::triggered, this, &WiresharkMainWindow::checkForUpdates);
#endif
master_split_.setObjectName("splitterMaster");
extra_split_.setObjectName("splitterExtra");
@@ -525,18 +529,19 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
packet_list_ = new PacketList(&master_split_);
main_ui_->wirelessTimelineWidget->setPacketList(packet_list_);
- connect(packet_list_, SIGNAL(framesSelected(QList<int>)), this, SLOT(setMenusForSelectedPacket()));
- connect(packet_list_, SIGNAL(framesSelected(QList<int>)), this, SIGNAL(framesSelected(QList<int>)));
+ connect(packet_list_, &PacketList::framesSelected, this, &WiresharkMainWindow::setMenusForSelectedPacket);
+ connect(packet_list_, &PacketList::framesSelected, this, &WiresharkMainWindow::framesSelected);
QAction *action = main_ui_->menuPacketComment->addAction(tr("Add New Comment…"));
connect(action, &QAction::triggered, this, &WiresharkMainWindow::addPacketComment);
action->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_C));
- connect(main_ui_->menuPacketComment, SIGNAL(aboutToShow()), this, SLOT(setEditCommentsMenu()));
+ connect(main_ui_->menuPacketComment, &QMenu::aboutToShow, this, &WiresharkMainWindow::setEditCommentsMenu);
proto_tree_ = new ProtoTree(&master_split_);
proto_tree_->installEventFilter(this);
packet_list_->setProtoTree(proto_tree_);
+ packet_list_->setProfileSwitcher(profile_switcher_);
packet_list_->installEventFilter(this);
packet_diagram_ = new PacketDiagram(&master_split_);
@@ -576,40 +581,27 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
setTabOrder(df_combo_box_->lineEdit(), packet_list_);
setTabOrder(packet_list_, proto_tree_);
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- this, SLOT(captureEventHandler(CaptureEvent)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- mainApp, SLOT(captureEventHandler(CaptureEvent)));
- connect(&capture_file_, SIGNAL(captureEvent(CaptureEvent)),
- main_ui_->statusBar, SLOT(captureEventHandler(CaptureEvent)));
-
- connect(mainApp, SIGNAL(freezePacketList(bool)),
- packet_list_, SLOT(freezePacketList(bool)));
- connect(mainApp, SIGNAL(columnsChanged()),
- packet_list_, SLOT(columnsChanged()));
- connect(mainApp, SIGNAL(preferencesChanged()),
- packet_list_, SLOT(preferencesChanged()));
- connect(mainApp, SIGNAL(recentPreferencesRead()),
- this, SLOT(applyRecentPaneGeometry()));
- connect(mainApp, SIGNAL(recentPreferencesRead()),
- this, SLOT(updateRecentActions()));
- connect(mainApp, SIGNAL(packetDissectionChanged()),
- this, SLOT(redissectPackets()), Qt::QueuedConnection);
-
- connect(mainApp, SIGNAL(checkDisplayFilter()),
- this, SLOT(checkDisplayFilter()));
- connect(mainApp, SIGNAL(fieldsChanged()),
- this, SLOT(fieldsChanged()));
- connect(mainApp, SIGNAL(reloadLuaPlugins()),
- this, SLOT(reloadLuaPlugins()));
-
- connect(main_ui_->mainStack, SIGNAL(currentChanged(int)),
- this, SLOT(mainStackChanged(int)));
-
- connect(welcome_page_, SIGNAL(startCapture(QStringList)),
- this, SLOT(startCapture(QStringList)));
- connect(welcome_page_, SIGNAL(recentFileActivated(QString)),
- this, SLOT(openCaptureFile(QString)));
+ connect(&capture_file_, &CaptureFile::captureEvent, this, &WiresharkMainWindow::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, mainApp, &WiresharkApplication::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, main_ui_->statusBar, &MainStatusBar::captureEventHandler);
+ connect(&capture_file_, &CaptureFile::captureEvent, profile_switcher_, &ProfileSwitcher::captureEventHandler);
+
+ connect(mainApp, &MainApplication::freezePacketList, packet_list_, &PacketList::freezePacketList);
+ connect(mainApp, &MainApplication::columnsChanged, packet_list_, &PacketList::columnsChanged);
+ connect(mainApp, &MainApplication::colorsChanged, packet_list_, &PacketList::colorsChanged);
+ connect(mainApp, &MainApplication::preferencesChanged, packet_list_, &PacketList::preferencesChanged);
+ connect(mainApp, &MainApplication::recentPreferencesRead, this, &WiresharkMainWindow::applyRecentPaneGeometry);
+ connect(mainApp, &MainApplication::recentPreferencesRead, this, &WiresharkMainWindow::updateRecentActions);
+ connect(mainApp, &MainApplication::packetDissectionChanged, this, &WiresharkMainWindow::redissectPackets, Qt::QueuedConnection);
+
+ connect(mainApp, &MainApplication::checkDisplayFilter, this, &WiresharkMainWindow::checkDisplayFilter);
+ connect(mainApp, &MainApplication::fieldsChanged, this, &WiresharkMainWindow::fieldsChanged);
+ connect(mainApp, &MainApplication::reloadLuaPlugins, this, &WiresharkMainWindow::reloadLuaPlugins);
+
+ connect(main_ui_->mainStack, &QStackedWidget::currentChanged, this, &WiresharkMainWindow::mainStackChanged);
+
+ connect(welcome_page_, &WelcomePage::startCapture, this, [this](QStringList interfaces) { startCapture(interfaces); });
+ connect(welcome_page_, &WelcomePage::recentFileActivated, this, [this](QString cfile) { openCaptureFile(cfile); });
connect(main_ui_->addressEditorFrame, &AddressEditorFrame::redissectPackets,
this, &WiresharkMainWindow::redissectPackets);
@@ -632,10 +624,9 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
connect(this, &WiresharkMainWindow::setCaptureFile,
proto_tree_, &ProtoTree::setCaptureFile);
- connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
- packet_list_, SLOT(setMonospaceFont(QFont)));
- connect(mainApp, SIGNAL(zoomMonospaceFont(QFont)),
- proto_tree_, SLOT(setMonospaceFont(QFont)));
+ connect(mainApp, &MainApplication::zoomMonospaceFont, packet_list_, &PacketList::setMonospaceFont);
+ connect(mainApp, &MainApplication::zoomRegularFont, packet_list_, &PacketList::setRegularFont);
+ connect(mainApp, &MainApplication::zoomMonospaceFont, proto_tree_, &ProtoTree::setMonospaceFont);
connectFileMenuActions();
connectEditMenuActions();
@@ -649,26 +640,18 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
connectToolsMenuActions();
connectHelpMenuActions();
- connect(packet_list_, SIGNAL(packetDissectionChanged()),
- this, SLOT(redissectPackets()));
- connect(packet_list_, SIGNAL(showColumnPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
- connect(packet_list_, SIGNAL(showProtocolPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(packet_list_, &PacketList::packetDissectionChanged, this, &WiresharkMainWindow::redissectPackets);
+ connect(packet_list_, &PacketList::showColumnPreferences, this, &WiresharkMainWindow::showPreferencesDialog);
+ connect(packet_list_, &PacketList::showProtocolPreferences, this, &WiresharkMainWindow::showPreferencesDialog);
connect(packet_list_, SIGNAL(editProtocolPreference(preference*, pref_module*)),
main_ui_->preferenceEditorFrame, SLOT(editPreference(preference*, pref_module*)));
- connect(packet_list_, SIGNAL(editColumn(int)), this, SLOT(showColumnEditor(int)));
- connect(main_ui_->columnEditorFrame, SIGNAL(columnEdited()),
- packet_list_, SLOT(columnsChanged()));
- connect(packet_list_, SIGNAL(doubleClicked(QModelIndex)),
- this, SLOT(openPacketDialog()));
- connect(packet_list_, SIGNAL(packetListScrolled(bool)),
- main_ui_->actionGoAutoScroll, SLOT(setChecked(bool)));
-
- connect(proto_tree_, SIGNAL(openPacketInNewWindow(bool)),
- this, SLOT(openPacketDialog(bool)));
- connect(proto_tree_, SIGNAL(showProtocolPreferences(QString)),
- this, SLOT(showPreferencesDialog(QString)));
+ connect(packet_list_, &PacketList::editColumn, this, &WiresharkMainWindow::showColumnEditor);
+ connect(main_ui_->columnEditorFrame, &ColumnEditorFrame::columnEdited, packet_list_, &PacketList::columnsChanged);
+ connect(packet_list_, &QAbstractItemView::doubleClicked, this, [=](const QModelIndex &){ openPacketDialog(); });
+ connect(packet_list_, &PacketList::packetListScrolled, main_ui_->actionGoAutoScroll, &QAction::setChecked);
+
+ connect(proto_tree_, &ProtoTree::openPacketInNewWindow, this, &WiresharkMainWindow::openPacketDialog);
+ connect(proto_tree_, &ProtoTree::showProtocolPreferences, this, &WiresharkMainWindow::showPreferencesDialog);
connect(proto_tree_, SIGNAL(editProtocolPreference(preference*, pref_module*)),
main_ui_->preferenceEditorFrame, SLOT(editPreference(preference*, pref_module*)));
@@ -690,16 +673,13 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
#ifdef HAVE_LIBPCAP
QTreeWidget *iface_tree = findChild<QTreeWidget *>("interfaceTree");
if (iface_tree) {
- connect(iface_tree, SIGNAL(itemSelectionChanged()),
- this, SLOT(interfaceSelectionChanged()));
+ connect(iface_tree, &QTreeWidget::itemSelectionChanged, this, &WiresharkMainWindow::interfaceSelectionChanged);
}
- connect(main_ui_->welcomePage, SIGNAL(captureFilterSyntaxChanged(bool)),
- this, SLOT(captureFilterSyntaxChanged(bool)));
+ connect(main_ui_->welcomePage, &WelcomePage::captureFilterSyntaxChanged,
+ this, &WiresharkMainWindow::captureFilterSyntaxChanged);
- connect(this, SIGNAL(showExtcapOptions(QString&, bool)),
- this, SLOT(showExtcapOptionsDialog(QString&, bool)));
- connect(this->welcome_page_, SIGNAL(showExtcapOptions(QString&, bool)),
- this, SLOT(showExtcapOptionsDialog(QString&, bool)));
+ connect(this, &WiresharkMainWindow::showExtcapOptions, this, &WiresharkMainWindow::showExtcapOptionsDialog);
+ connect(this->welcome_page_, &WelcomePage::showExtcapOptions, this, &WiresharkMainWindow::showExtcapOptionsDialog);
#endif // HAVE_LIBPCAP
@@ -730,7 +710,7 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
main_ui_->actionHelpMPText2pcap->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TEXT2PCAP)));
main_ui_->actionHelpMPTShark->setToolTip(gchar_free_to_qstring(topic_action_url(LOCALPAGE_MAN_TSHARK)));
- main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_USERGUIDE)));
+ main_ui_->actionHelpContents->setToolTip(gchar_free_to_qstring(topic_action_url(HELP_CONTENT)));
main_ui_->actionHelpWebsite->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_HOME)));
main_ui_->actionHelpFAQ->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_FAQ)));
main_ui_->actionHelpAsk->setToolTip(gchar_free_to_qstring(topic_action_url(ONLINEPAGE_ASK)));
@@ -744,11 +724,14 @@ main_ui_->goToLineEdit->setValidator(goToLineQiv);
WiresharkMainWindow::~WiresharkMainWindow()
{
disconnect(main_ui_->mainStack, 0, 0, 0);
+ if (previous_focus_ != nullptr) {
+ disconnect(previous_focus_, &QWidget::destroyed, this, &WiresharkMainWindow::resetPreviousFocus);
+ }
#ifndef Q_OS_MAC
// Below dialogs inherit GeometryStateDialog
// For reasons described in geometry_state_dialog.h no parent is set when
- // instantiating the dialogs and as a resul objects are not automatically
+ // instantiating the dialogs and as a result objects are not automatically
// freed by its parent. Free then here explicitly to avoid leak and numerous
// Valgrind complaints.
delete file_set_dialog_;
@@ -816,8 +799,8 @@ void WiresharkMainWindow::addInterfaceToolbar(const iface_toolbar *toolbar_entry
menu->insertAction(before, action);
InterfaceToolbar *interface_toolbar = new InterfaceToolbar(this, toolbar_entry);
- connect(mainApp, SIGNAL(appInitialized()), interface_toolbar, SLOT(interfaceListChanged()));
- connect(mainApp, SIGNAL(localInterfaceListChanged()), interface_toolbar, SLOT(interfaceListChanged()));
+ connect(mainApp, &MainApplication::appInitialized, interface_toolbar, &InterfaceToolbar::interfaceListChanged);
+ connect(mainApp, &MainApplication::localInterfaceListChanged, interface_toolbar, &InterfaceToolbar::interfaceListChanged);
QToolBar *toolbar = new QToolBar(this);
toolbar->addWidget(interface_toolbar);
@@ -836,7 +819,7 @@ void WiresharkMainWindow::addInterfaceToolbar(const iface_toolbar *toolbar_entry
menu->menuAction()->setVisible(true);
}
-void WiresharkMainWindow::removeInterfaceToolbar(const gchar *menu_title)
+void WiresharkMainWindow::removeInterfaceToolbar(const char *menu_title)
{
QMenu *menu = main_ui_->menuInterfaceToolbars;
QAction *action = NULL;
@@ -945,13 +928,6 @@ void WiresharkMainWindow::keyPressEvent(QKeyEvent *event) {
}
void WiresharkMainWindow::closeEvent(QCloseEvent *event) {
- if (main_ui_->actionCaptureStop->isEnabled()) {
- // Capture is running, we should stop it before close and ignore the event
- stopCapture();
- event->ignore();
- return;
- }
-
saveWindowGeometry();
/* If we're in the middle of stopping a capture, don't do anything;
@@ -1069,10 +1045,10 @@ void WiresharkMainWindow::dropEvent(QDropEvent *event)
if (cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, static_cast<int>(local_files.size()),
in_filenames,
wtap_pcapng_file_type_subtype(),
- FALSE) == CF_OK) {
+ false) == CF_OK) {
/* Merge succeeded; close the currently-open file and try
to open the merged capture file. */
- openCaptureFile(tmpname, QString(), WTAP_TYPE_AUTO, TRUE);
+ openCaptureFile(tmpname, QString(), WTAP_TYPE_AUTO, true);
}
g_free(tmpname);
@@ -1091,7 +1067,23 @@ void WiresharkMainWindow::loadWindowGeometry()
#ifndef Q_OS_MAC
if (recent.gui_geometry_main_maximized) {
- setWindowState(Qt::WindowMaximized);
+ // [save|restore]Geometry does a better job (on Linux and Windows)
+ // of restoring to the original monitor because it saves
+ // QGuiApplication::screens().indexOf(screen())
+ // (it also saves Qt::WindowFullScreen, restores the non-maximized
+ // size even when starting out maximized, etc.)
+ // Monitors of different DPI might still be tricky:
+ // https://bugreports.qt.io/browse/QTBUG-70721
+ // https://bugreports.qt.io/browse/QTBUG-77385
+ //
+ // We might eventually want to always use restoreGeometry, but
+ // for now at least use it just for maximized because it's better
+ // then what we've been doing.
+ if (recent.gui_geometry_main == nullptr ||
+ !restoreGeometry(QByteArray::fromHex(recent.gui_geometry_main))) {
+
+ setWindowState(Qt::WindowMaximized);
+ }
} else
#endif
{
@@ -1122,6 +1114,13 @@ void WiresharkMainWindow::loadWindowGeometry()
void WiresharkMainWindow::saveWindowGeometry()
{
+ if (prefs.gui_geometry_save_position ||
+ prefs.gui_geometry_save_size ||
+ prefs.gui_geometry_save_maximized) {
+ g_free(recent.gui_geometry_main);
+ recent.gui_geometry_main = g_strdup(saveGeometry().toHex().constData());
+ }
+
if (prefs.gui_geometry_save_position) {
recent.gui_geometry_main_x = pos().x();
recent.gui_geometry_main_y = pos().y();
@@ -1134,6 +1133,9 @@ void WiresharkMainWindow::saveWindowGeometry()
if (prefs.gui_geometry_save_maximized) {
// On macOS this is false when it shouldn't be
+ // XXX: Does save/restoreGeometry work any better on macOS
+ // for maximized windows? Apparently not:
+ // https://bugreports.qt.io/browse/QTBUG-100272
recent.gui_geometry_main_maximized = isMaximized();
}
@@ -1141,6 +1143,14 @@ void WiresharkMainWindow::saveWindowGeometry()
recent.gui_geometry_main_upper_pane = master_split_.sizes()[0];
}
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = g_strdup(master_split_.saveState().toHex().constData());
+ recent.gui_geometry_main_extra_split = g_strdup(extra_split_.saveState().toHex().constData());
+
+ // Saving the QSplitter state is more accurate (#19361), but save
+ // the old GTK-style pane information for backwards compatibility
+ // for switching back and forth with older versions.
if (master_split_.sizes().length() > 2) {
recent.gui_geometry_main_lower_pane = master_split_.sizes()[1];
} else if (extra_split_.sizes().length() > 0) {
@@ -1151,7 +1161,7 @@ void WiresharkMainWindow::saveWindowGeometry()
// Our event loop becomes nested whenever we call update_progress_dlg, which
// includes several places in file.c. The GTK+ UI stays out of trouble by
// showing a modal progress dialog. We attempt to do the equivalent below by
-// disabling parts of the main window. At a minumum the ProgressFrame in the
+// disabling parts of the main window. At a minimum the ProgressFrame in the
// main status bar must remain accessible.
//
// We might want to do this any time the main status bar progress frame is
@@ -1193,7 +1203,7 @@ void WiresharkMainWindow::mergeCaptureFile()
if (prefs.gui_ask_unsaved) {
if (cf_has_unsaved_data(capture_file_.capFile())) {
QMessageBox msg_dialog;
- gchar *display_basename;
+ char *display_basename;
int response;
msg_dialog.setIcon(QMessageBox::Question);
@@ -1263,17 +1273,17 @@ void WiresharkMainWindow::mergeCaptureFile()
/* chronological order */
in_filenames[0] = g_strdup(capture_file_.capFile()->filename);
in_filenames[1] = qstring_strdup(file_name);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, FALSE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, false);
} else if (merge_dlg.mergeType() <= 0) {
/* prepend file */
in_filenames[0] = qstring_strdup(file_name);
in_filenames[1] = g_strdup(capture_file_.capFile()->filename);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, true);
} else {
/* append file */
in_filenames[0] = g_strdup(capture_file_.capFile()->filename);
in_filenames[1] = qstring_strdup(file_name);
- merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(this, global_capture_opts.temp_dir, &tmpname, 2, in_filenames, file_type, true);
}
g_free(in_filenames[0]);
@@ -1288,8 +1298,10 @@ void WiresharkMainWindow::mergeCaptureFile()
cf_close(capture_file_.capFile());
/* Try to open the merged capture file. */
+ // XXX - Just free rfcode and call
+ // openCaptureFile(tmpname, read_filter, WTAP_TYPE_AUTO, true);
CaptureFile::globalCapFile()->window = this;
- if (cf_open(CaptureFile::globalCapFile(), tmpname, WTAP_TYPE_AUTO, TRUE /* temporary file */, &err) != CF_OK) {
+ if (cf_open(CaptureFile::globalCapFile(), tmpname, WTAP_TYPE_AUTO, true /* temporary file */, &err) != CF_OK) {
/* We couldn't open it; fail. */
CaptureFile::globalCapFile()->window = NULL;
dfilter_free(rfcode);
@@ -1302,7 +1314,7 @@ void WiresharkMainWindow::mergeCaptureFile()
previous read filter attached to "cf"). */
cf_set_rfcode(CaptureFile::globalCapFile(), rfcode);
- switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/FALSE)) {
+ switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
@@ -1320,8 +1332,7 @@ void WiresharkMainWindow::mergeCaptureFile()
return;
}
- /* Save the name of the containing directory specified in the path name. */
- mainApp->setLastOpenDirFromFilename(tmpname);
+ /* This is a tempfile; don't change the last open directory. */
g_free(tmpname);
main_ui_->statusBar->showExpert();
return;
@@ -1343,12 +1354,12 @@ void WiresharkMainWindow::importCaptureFile() {
return;
}
- openCaptureFile(import_dlg.capfileName());
+ openCaptureFile(import_dlg.capfileName(), QString(), WTAP_TYPE_AUTO, true);
}
bool WiresharkMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
QString file_name;
- gboolean discard_comments;
+ bool discard_comments;
if (cf->is_tempfile) {
/* This is a temporary capture file, so saving it means saving
@@ -1358,7 +1369,7 @@ bool WiresharkMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
probably pcapng, which supports comments and, if it's
not pcapng, let the user decide what they want to do
if they've added comments. */
- return saveAsCaptureFile(cf, FALSE, dont_reopen);
+ return saveAsCaptureFile(cf, false, dont_reopen);
} else {
if (cf->unsaved_changes) {
cf_write_status_t status;
@@ -1377,7 +1388,7 @@ bool WiresharkMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1385,7 +1396,7 @@ bool WiresharkMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1393,7 +1404,7 @@ bool WiresharkMainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
support comments, and the user said not to delete the
comments. Do a "Save As" so the user can select
one of those formats and choose a file name. */
- return saveAsCaptureFile(cf, TRUE, dont_reopen);
+ return saveAsCaptureFile(cf, true, dont_reopen);
case CANCELLED:
/* The user said "forget it". Just return. */
@@ -1461,8 +1472,8 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
int file_type;
wtap_compression_type compression_type;
cf_write_status_t status;
- gchar *dirname;
- gboolean discard_comments = FALSE;
+ char *dirname;
+ bool discard_comments = false;
if (!cf) {
return false;
@@ -1479,7 +1490,7 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1487,7 +1498,7 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1497,7 +1508,7 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
formats that don't support comments trimmed from it,
so run the dialog again, to let the user decide
whether to save in one of those formats or give up. */
- must_support_comments = TRUE;
+ must_support_comments = true;
continue;
case CANCELLED:
@@ -1518,11 +1529,6 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
}
compression_type = save_as_dlg.compressionType();
-#ifdef Q_OS_WIN
- // the Windows dialog does not fixup extensions, do it manually here.
- fileAddExtension(file_name, file_type, compression_type);
-#endif // Q_OS_WIN
-
//#ifndef _WIN32
// /* If the file exists and it's user-immutable or not writable,
// ask the user whether they want to override that. */
@@ -1564,7 +1570,7 @@ bool WiresharkMainWindow::saveAsCaptureFile(capture_file *cf, bool must_support_
cf->unsaved_changes = false; //we just saved so we signal that we have no unsaved changes
updateForUnsavedChanges(); // we update the title bar to remove the *
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(qUtf8Printable(file_name));
+ add_menu_recent_capture_file(qUtf8Printable(file_name), false);
return true;
case CF_WRITE_ERROR:
@@ -1585,7 +1591,7 @@ void WiresharkMainWindow::exportSelectedPackets() {
wtap_compression_type compression_type;
packet_range_t range;
cf_write_status_t status;
- gchar *dirname;
+ char *dirname;
bool discard_comments = false;
if (!capture_file_.capFile())
@@ -1593,8 +1599,8 @@ void WiresharkMainWindow::exportSelectedPackets() {
/* Init the packet range */
packet_range_init(&range, capture_file_.capFile());
- range.process_filtered = TRUE;
- range.include_dependents = TRUE;
+ range.process_filtered = true;
+ range.include_dependents = true;
QList<int> rows = packet_list_->selectedRows(true);
@@ -1614,7 +1620,7 @@ void WiresharkMainWindow::exportSelectedPackets() {
case SAVE:
/* The file can be saved in the specified format as is;
just drive on and save in the format they selected. */
- discard_comments = FALSE;
+ discard_comments = false;
break;
case SAVE_WITHOUT_COMMENTS:
@@ -1622,7 +1628,7 @@ void WiresharkMainWindow::exportSelectedPackets() {
but it can be saved without the comments, and the user
said "OK, discard the comments", so save it in the
format they specified without the comments. */
- discard_comments = TRUE;
+ discard_comments = true;
break;
case SAVE_IN_ANOTHER_FORMAT:
@@ -1650,7 +1656,7 @@ void WiresharkMainWindow::exportSelectedPackets() {
*/
if (files_identical(capture_file_.capFile()->filename, qUtf8Printable(file_name))) {
QMessageBox msg_box;
- gchar *display_basename = g_filename_display_basename(qUtf8Printable(file_name));
+ char *display_basename = g_filename_display_basename(qUtf8Printable(file_name));
msg_box.setIcon(QMessageBox::Critical);
msg_box.setText(QString(tr("Unable to export to \"%1\".").arg(display_basename)));
@@ -1674,10 +1680,6 @@ void WiresharkMainWindow::exportSelectedPackets() {
goto cleanup;
}
compression_type = esp_dlg.compressionType();
-#ifdef Q_OS_WIN
- // the Windows dialog does not fixup extensions, do it manually here.
- fileAddExtension(file_name, file_type, compression_type);
-#endif // Q_OS_WIN
//#ifndef _WIN32
// /* If the file exists and it's user-immutable or not writable,
@@ -1706,7 +1708,7 @@ void WiresharkMainWindow::exportSelectedPackets() {
if (discard_comments)
packet_list_->redrawVisiblePackets();
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(qUtf8Printable(file_name));
+ add_menu_recent_capture_file(qUtf8Printable(file_name), false);
goto cleanup;
case CF_WRITE_ERROR:
@@ -1740,110 +1742,6 @@ void WiresharkMainWindow::exportDissections(export_type_e export_type) {
ed_dlg->show();
}
-#ifdef Q_OS_WIN
-/*
- * Ensure that:
- *
- * If the file is to be compressed:
- *
- * if there is a set of extensions used by the file type to be used,
- * the file name has one of those extensions followed by the extension
- * for the compression type to be used;
- *
- * otherwise, the file name has the extension for the compression type
- * to be used;
- *
- * otherwise:
- *
- * if there is a set of extensions used by the file type to be used,
- * the file name has one of those extensions.
- */
-void WiresharkMainWindow::fileAddExtension(QString &file_name, int file_type, wtap_compression_type compression_type) {
- QString file_name_lower;
- GSList *extensions_list;
- const char *compressed_file_extension;
- gboolean add_extension_for_file_type;
-
- /* Lower-case the file name, so the extension matching is case-insensitive. */
- file_name_lower = file_name.toLower();
-
- /* Get a list of all extensions used for this file type; don't
- include the ones with compression type extensions, as we
- only want to check for the extension for the compression
- type we'll be using. */
- extensions_list = wtap_get_file_extensions_list(file_type, FALSE);
-
- /* Get the extension for the compression type we'll be using;
- NULL is returned if the type isn't supported or compression
- is not being done. */
- compressed_file_extension = wtap_compression_type_extension(compression_type);
-
- if (extensions_list != NULL) {
- GSList *extension;
-
- /* This file type has one or more extensions.
- Start out assuming we need to add the default one. */
- add_extension_for_file_type = TRUE;
-
- /* OK, see if the file has one of those extensions, followed
- by the appropriate compression type extension if it's to be
- compressed. */
- for (extension = extensions_list; extension != NULL;
- extension = g_slist_next(extension)) {
- QString file_suffix = QString(".") + (char *)extension->data;
- if (compressed_file_extension != NULL)
- file_suffix += QString(".") + compressed_file_extension;
- if (file_name_lower.endsWith(file_suffix)) {
- /*
- * The file name has one of the extensions for this file
- * type, followed by a compression type extension if
- * appropriate, so we don't need to add an extension for
- * the file type or the compression type.
- */
- add_extension_for_file_type = FALSE;
- break;
- }
- }
- } else {
- /* We have no extensions for this file type. Just check
- to see if we need to add an extension for the compressed
- file type.
-
- Start out assuming we do. */
- add_extension_for_file_type = TRUE;
- if (compressed_file_extension != NULL) {
- QString file_suffix = QString(".") + compressed_file_extension;
- if (file_name_lower.endsWith(file_suffix)) {
- /*
- * The file name has the appropriate compressed file extension,
- * so we don't need to add an extension for the compression
- * type.
- */
- add_extension_for_file_type = FALSE;
- }
- }
- }
-
- /*
- * If we need to add an extension for the file type or compressed
- * file type, do so.
- */
- if (add_extension_for_file_type) {
- if (wtap_default_file_extension(file_type) != NULL) {
- /* This file type has a default extension; append it. */
- file_name += QString(".") + wtap_default_file_extension(file_type);
- }
- if (compression_type != WTAP_UNCOMPRESSED) {
- /*
- * The file is to be compressed, so append the extension for
- * its compression type.
- */
- file_name += QString(".") + compressed_file_extension;
- }
- }
-}
-#endif // Q_OS_WIN
-
bool WiresharkMainWindow::testCaptureFileClose(QString before_what, FileCloseContext context) {
bool capture_in_progress = false;
bool do_close_file = false;
@@ -1891,7 +1789,7 @@ bool WiresharkMainWindow::testCaptureFileClose(QString before_what, FileCloseCon
return false;
}
- QMessageBox msg_dialog;
+ QMessageBox msg_dialog(this);
QString question;
QString infotext;
QPushButton *save_button;
@@ -1916,7 +1814,7 @@ bool WiresharkMainWindow::testCaptureFileClose(QString before_what, FileCloseCon
}
} else {
// No capture in progress and not a tempfile, so this is not unsaved packets
- gchar *display_basename = g_filename_display_basename(capture_file_.capFile()->filename);
+ char *display_basename = g_filename_display_basename(capture_file_.capFile()->filename);
question = tr("Do you want to save the changes you've made to the capture file \"%1\"%2?").arg(display_basename, before_what);
infotext = tr("Your changes will be lost if you don't save them.");
g_free(display_basename);
@@ -1991,7 +1889,7 @@ bool WiresharkMainWindow::testCaptureFileClose(QString before_what, FileCloseCon
*/
QList<QAbstractButton *> buttons = msg_dialog.buttons();
for (int i = 0; i < buttons.size(); ++i) {
- QPushButton *button = static_cast<QPushButton *>(buttons.at(i));;
+ QPushButton *button = static_cast<QPushButton *>(buttons.at(i));
button->setAutoDefault(false);
}
@@ -2001,7 +1899,13 @@ bool WiresharkMainWindow::testCaptureFileClose(QString before_what, FileCloseCon
*/
discard_button->setFocus();
#endif
-
+ /*
+ * On Windows, if multiple Wireshark processes are open, another
+ * application has focus, and "Close all [Wireshark] windows" is
+ * chosen from the taskbar, we need to activate the window to
+ * at least flash the taskbar (#16309).
+ */
+ activateWindow();
msg_dialog.exec();
/* According to the Qt doc:
* when using QMessageBox with custom buttons, exec() function returns an opaque value.
@@ -2119,7 +2023,7 @@ void WiresharkMainWindow::findTextCodecs() {
// annoying to properly place IBM00858 and IBM00924 in the middle of
// code page numbers not zero padded to 5 digits.
// We could manipulate the key further to have more commonly used
- // charsets earlier. IANA MIB ordering would be unxpected:
+ // charsets earlier. IANA MIB ordering would be unexpected:
// https://www.iana.org/assignments/character-sets/character-sets.xml
// For data about use in HTTP (other protocols can be quite different):
// https://w3techs.com/technologies/overview/character_encoding
@@ -2152,11 +2056,10 @@ void WiresharkMainWindow::initMainToolbarIcons()
main_ui_->actionCaptureRestart->setIcon(StockIcon("x-capture-restart"));
main_ui_->actionCaptureOptions->setIcon(StockIcon("x-capture-options"));
- // Menu icons are disabled in main_window.ui for these items.
+ // Menu icons are disabled in wireshark_main_window.ui for these File-> items.
main_ui_->actionFileOpen->setIcon(StockIcon("document-open"));
main_ui_->actionFileSave->setIcon(StockIcon("x-capture-file-save"));
main_ui_->actionFileClose->setIcon(StockIcon("x-capture-file-close"));
- main_ui_->actionViewReload->setIcon(StockIcon("x-capture-file-reload"));
main_ui_->actionEditFindPacket->setIcon(StockIcon("edit-find"));
main_ui_->actionGoPreviousPacket->setIcon(StockIcon("go-previous"));
@@ -2183,6 +2086,8 @@ void WiresharkMainWindow::initMainToolbarIcons()
main_ui_->actionViewZoomOut->setIcon(StockIcon("zoom-out"));
main_ui_->actionViewNormalSize->setIcon(StockIcon("zoom-original"));
main_ui_->actionViewResizeColumns->setIcon(StockIcon("x-resize-columns"));
+ main_ui_->actionViewResetLayout->setIcon(StockIcon("x-reset-layout_2"));
+ main_ui_->actionViewReload->setIcon(StockIcon("x-capture-file-reload"));
main_ui_->actionNewDisplayFilterExpression->setIcon(StockIcon("list-add"));
}
@@ -2219,7 +2124,7 @@ void WiresharkMainWindow::initShowHideMainWidgets()
/* Initially hide the additional toolbars menus */
main_ui_->menuAdditionalToolbars->menuAction()->setVisible(false);
- connect(show_hide_actions_, SIGNAL(triggered(QAction*)), this, SLOT(showHideMainWidgets(QAction*)));
+ connect(show_hide_actions_, &QActionGroup::triggered, this, &WiresharkMainWindow::showHideMainWidgets);
}
void WiresharkMainWindow::initTimeDisplayFormatMenu()
@@ -2246,7 +2151,7 @@ void WiresharkMainWindow::initTimeDisplayFormatMenu()
time_display_actions_->addAction(tda);
}
- connect(time_display_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setTimestampFormat(QAction*)));
+ connect(time_display_actions_, &QActionGroup::triggered, this, &WiresharkMainWindow::setTimestampFormat);
}
void WiresharkMainWindow::initTimePrecisionFormatMenu()
@@ -2274,7 +2179,7 @@ void WiresharkMainWindow::initTimePrecisionFormatMenu()
time_precision_actions_->addAction(tpa);
}
- connect(time_precision_actions_, SIGNAL(triggered(QAction*)), this, SLOT(setTimestampPrecision(QAction*)));
+ connect(time_precision_actions_, &QActionGroup::triggered, this, &WiresharkMainWindow::setTimestampPrecision);
}
// Menu items which will be disabled when we freeze() and whose state will
@@ -2284,10 +2189,10 @@ void WiresharkMainWindow::initFreezeActions()
QList<QAction *> freeze_actions = QList<QAction *>()
<< main_ui_->actionFileClose
<< main_ui_->actionViewReload
- << main_ui_->actionEditMarkPacket
+ << main_ui_->actionEditMarkSelected
<< main_ui_->actionEditMarkAllDisplayed
<< main_ui_->actionEditUnmarkAllDisplayed
- << main_ui_->actionEditIgnorePacket
+ << main_ui_->actionEditIgnoreSelected
<< main_ui_->actionEditIgnoreAllDisplayed
<< main_ui_->actionEditUnignoreAllDisplayed
<< main_ui_->actionEditSetTimeReference
@@ -2315,8 +2220,8 @@ void WiresharkMainWindow::initConversationMenus()
ConversationAction *conv_action = new ConversationAction(main_ui_->menuConversationFilter, conv_filter);
main_ui_->menuConversationFilter->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(applyConversationFilter()), Qt::QueuedConnection);
+ connect(this, &WiresharkMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &WiresharkMainWindow::applyConversationFilter, Qt::QueuedConnection);
// Packet list context menu items
packet_list_->conversationMenu()->addAction(conv_action);
@@ -2330,15 +2235,15 @@ void WiresharkMainWindow::initConversationMenus()
conv_action->setIcon(cc_action->icon());
conv_action->setColorNumber(i++);
submenu->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &WiresharkMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &WiresharkMainWindow::colorizeActionTriggered);
}
conv_action = new ConversationAction(submenu, conv_filter);
conv_action->setText(main_ui_->actionViewColorizeNewColoringRule->text());
submenu->addAction(conv_action);
- connect(this, SIGNAL(packetInfoChanged(_packet_info*)), conv_action, SLOT(setPacketInfo(_packet_info*)));
- connect(conv_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &WiresharkMainWindow::packetInfoChanged, conv_action, &ConversationAction::setPacketInfo);
+ connect(conv_action, &ConversationAction::triggered, this, &WiresharkMainWindow::colorizeActionTriggered);
// Proto tree conversation menu is filled in in ProtoTree::contextMenuEvent.
// We should probably do that here.
@@ -2353,15 +2258,15 @@ void WiresharkMainWindow::initConversationMenus()
colorize_action->setIcon(cc_action->icon());
colorize_action->setColorNumber(i++);
proto_tree_->colorizeMenu()->addAction(colorize_action);
- connect(this, SIGNAL(fieldFilterChanged(QByteArray)), colorize_action, SLOT(setFieldFilter(QByteArray)));
- connect(colorize_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &WiresharkMainWindow::fieldFilterChanged, colorize_action, &ColorizeAction::setFieldFilter);
+ connect(colorize_action, &ColorizeAction::triggered, this, &WiresharkMainWindow::colorizeActionTriggered);
}
colorize_action = new ColorizeAction(proto_tree_->colorizeMenu());
colorize_action->setText(main_ui_->actionViewColorizeNewColoringRule->text());
proto_tree_->colorizeMenu()->addAction(colorize_action);
- connect(this, SIGNAL(fieldFilterChanged(QByteArray)), colorize_action, SLOT(setFieldFilter(QByteArray)));
- connect(colorize_action, SIGNAL(triggered()), this, SLOT(colorizeActionTriggered()));
+ connect(this, &WiresharkMainWindow::fieldFilterChanged, colorize_action, &ColorizeAction::setFieldFilter);
+ connect(colorize_action, &ColorizeAction::triggered, this, &WiresharkMainWindow::colorizeActionTriggered);
}
bool WiresharkMainWindow::addExportObjectsMenuItem(const void *, void *value, void *userdata)
@@ -2375,9 +2280,9 @@ bool WiresharkMainWindow::addExportObjectsMenuItem(const void *, void *value, vo
//initially disable until a file is loaded (then file signals will take over)
export_action->setEnabled(false);
- connect(&window->capture_file_, SIGNAL(captureEvent(CaptureEvent)), export_action, SLOT(captureFileEvent(CaptureEvent)));
- connect(export_action, SIGNAL(triggered()), window, SLOT(applyExportObject()));
- return FALSE;
+ connect(&window->capture_file_, &CaptureFile::captureEvent, export_action, &ExportObjectAction::captureFileEvent);
+ connect(export_action, &ExportObjectAction::triggered, window, &WiresharkMainWindow::applyExportObject);
+ return false;
}
void WiresharkMainWindow::initExportObjectsMenus()
@@ -2417,12 +2322,14 @@ bool WiresharkMainWindow::addFollowStreamMenuItem(const void *key, void *value,
follow_action->setText(tr("HTTP/2 Stream"));
} else if (g_strcmp0(short_name, "SIP") == 0) {
follow_action->setText(tr("SIP Call"));
+ } else if (g_strcmp0(short_name, "USBCOM") == 0) {
+ follow_action->setText(tr("USB CDC Data"));
}
connect(follow_action, &QAction::triggered, window,
[window, follow]() { window->openFollowStreamDialog(get_follow_proto_id(follow)); },
Qt::QueuedConnection);
- return FALSE;
+ return false;
}
void WiresharkMainWindow::initFollowStreamMenus()
@@ -2434,24 +2341,8 @@ void WiresharkMainWindow::initFollowStreamMenus()
// Titlebar
void WiresharkMainWindow::setTitlebarForCaptureFile()
{
- if (capture_file_.capFile() && capture_file_.capFile()->filename) {
- setWSWindowTitle(QString("[*]%1").arg(capture_file_.fileDisplayName()));
- //
- // XXX - on non-Mac platforms, put in the application
- // name? Or do so only for temporary files?
- //
- if (!capture_file_.capFile()->is_tempfile) {
- //
- // Set the file path; that way, for macOS, it'll set the
- // "proxy icon".
- //
- setWindowFilePath(capture_file_.filePath());
- }
- setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
- } else {
- /* We have no capture file. */
- setWSWindowTitle();
- }
+ use_capturing_title_ = false;
+ updateTitlebar();
}
QString WiresharkMainWindow::replaceWindowTitleVariables(QString title)
@@ -2459,6 +2350,18 @@ QString WiresharkMainWindow::replaceWindowTitleVariables(QString title)
title.replace("%P", get_profile_name());
title.replace("%V", get_ws_vcs_version_info());
+#ifdef HAVE_LIBPCAP
+ if (global_commandline_info.capture_comments) {
+ // Use the first capture comment from command line.
+ title.replace("%C", (char *)g_ptr_array_index(global_commandline_info.capture_comments, 0));
+ } else {
+ // No capture comment.
+ title.remove("%C");
+ }
+#else
+ title.remove("%C");
+#endif
+
if (title.contains("%F")) {
// %F is file path of the capture file.
if (capture_file_.capFile()) {
@@ -2528,10 +2431,30 @@ void WiresharkMainWindow::setWSWindowTitle(QString title)
void WiresharkMainWindow::setTitlebarForCaptureInProgress()
{
- if (capture_file_.capFile()) {
+ use_capturing_title_ = true;
+ updateTitlebar();
+}
+
+void WiresharkMainWindow::updateTitlebar()
+{
+ if (use_capturing_title_ && capture_file_.capFile()) {
setWSWindowTitle(tr("Capturing from %1").arg(cf_get_tempfile_source(capture_file_.capFile())));
+ } else if (capture_file_.capFile() && capture_file_.capFile()->filename) {
+ setWSWindowTitle(QString("[*]%1").arg(capture_file_.fileDisplayName()));
+ //
+ // XXX - on non-Mac platforms, put in the application
+ // name? Or do so only for temporary files?
+ //
+ if (!capture_file_.capFile()->is_tempfile) {
+ //
+ // Set the file path; that way, for macOS, it'll set the
+ // "proxy icon".
+ //
+ setWindowFilePath(capture_file_.filePath());
+ }
+ setWindowModified(cf_has_unsaved_data(capture_file_.capFile()));
} else {
- /* We have no capture in progress. */
+ /* We have no capture file. */
setWSWindowTitle();
}
}
@@ -2708,7 +2631,7 @@ void WiresharkMainWindow::setWindowIcon(const QIcon &icon) {
}
void WiresharkMainWindow::updateForUnsavedChanges() {
- setTitlebarForCaptureFile();
+ updateTitlebar();
setMenusForCaptureFile();
}
@@ -2722,7 +2645,7 @@ void WiresharkMainWindow::changeEvent(QEvent* event)
main_ui_->retranslateUi(this);
// make sure that the "Clear Menu" item is retranslated
mainApp->emitAppSignal(WiresharkApplication::RecentCapturesChanged);
- setTitlebarForCaptureFile();
+ updateTitlebar();
break;
case QEvent::LocaleChange: {
QString locale = QLocale::system().name();
@@ -2773,6 +2696,13 @@ void WiresharkMainWindow::addMenuActions(QList<QAction *> &actions, int menu_gro
switch (menu_group) {
case REGISTER_PACKET_ANALYZE_GROUP_UNSORTED:
case REGISTER_PACKET_STAT_GROUP_UNSORTED:
+ case REGISTER_STAT_GROUP_GENERIC:
+ // XXX - The Lua documentation claims that ANALYZE_GROUP_UNSORTED
+ // is under the Analyze menu, and STAT_GROUP_GENERIC and
+ // PACKET_STAT_GROUP_UNSORTED are distinguished by whether they
+ // go before the separator in the group of non protocol-specific
+ // actions or after the separator with the protocol-specific
+ // actions. We currently put them all in the same place.
main_ui_->menuStatistics->insertAction(
main_ui_->actionStatistics_REGISTER_STAT_GROUP_UNSORTED,
action);
@@ -2783,24 +2713,30 @@ void WiresharkMainWindow::addMenuActions(QList<QAction *> &actions, int menu_gro
case REGISTER_STAT_GROUP_RSERPOOL:
main_ui_->menuRSerPool->addAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY:
+ case REGISTER_TELEPHONY_GROUP_UNSORTED:
main_ui_->menuTelephony->addAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_ANSI:
+ case REGISTER_TELEPHONY_GROUP_ANSI:
main_ui_->menuANSI->addAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_GSM:
+ case REGISTER_TELEPHONY_GROUP_GSM:
main_ui_->menuGSM->addAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_LTE:
+ case REGISTER_TELEPHONY_GROUP_3GPP_UU:
main_ui_->menuLTE->addAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_MTP3:
+ case REGISTER_TELEPHONY_GROUP_MTP3:
main_ui_->menuMTP3->addAction(action);
break;
+ case REGISTER_TELEPHONY_GROUP_SCTP:
+ // XXX - There are two SCTP menus, under Analyze and Telephony,
+ // that have the same default actions. The default actions from
+ // Analyze are copied to the PacketList context menu.
+ main_ui_->menuTelephonySCTP->addAction(action);
+ break;
case REGISTER_TOOLS_GROUP_UNSORTED:
{
- // Allow the creation of submenus. Mimics the behavor of
+ // Allow the creation of submenus. Mimics the behavior of
// ui/gtk/main_menubar.c:add_menu_item_to_main_menubar
// and GtkUIManager.
//
@@ -2829,9 +2765,9 @@ void WiresharkMainWindow::addMenuActions(QList<QAction *> &actions, int menu_gro
// distinguish various types of actions. Setting their objectName
// seems to work OK.
if (action->objectName() == TapParameterDialog::actionName()) {
- connect(action, SIGNAL(triggered(bool)), this, SLOT(openTapParameterDialog()));
+ connect(action, &QAction::triggered, this, [=]() { openTapParameterDialog(); });
} else if (action->objectName() == FunnelStatistics::actionName()) {
- connect(action, SIGNAL(triggered(bool)), funnel_statistics_, SLOT(funnelActionTriggered()));
+ connect(action, &QAction::triggered, funnel_statistics_, &FunnelStatistics::funnelActionTriggered);
}
}
}
@@ -2841,6 +2777,7 @@ void WiresharkMainWindow::removeMenuActions(QList<QAction *> &actions, int menu_
switch (menu_group) {
case REGISTER_PACKET_ANALYZE_GROUP_UNSORTED:
case REGISTER_PACKET_STAT_GROUP_UNSORTED:
+ case REGISTER_STAT_GROUP_GENERIC:
main_ui_->menuStatistics->removeAction(action);
break;
case REGISTER_STAT_GROUP_RESPONSE_TIME:
@@ -2849,21 +2786,24 @@ void WiresharkMainWindow::removeMenuActions(QList<QAction *> &actions, int menu_
case REGISTER_STAT_GROUP_RSERPOOL:
main_ui_->menuRSerPool->removeAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY:
+ case REGISTER_TELEPHONY_GROUP_UNSORTED:
main_ui_->menuTelephony->removeAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_ANSI:
+ case REGISTER_TELEPHONY_GROUP_ANSI:
main_ui_->menuANSI->removeAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_GSM:
+ case REGISTER_TELEPHONY_GROUP_GSM:
main_ui_->menuGSM->removeAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_LTE:
+ case REGISTER_TELEPHONY_GROUP_3GPP_UU:
main_ui_->menuLTE->removeAction(action);
break;
- case REGISTER_STAT_GROUP_TELEPHONY_MTP3:
+ case REGISTER_TELEPHONY_GROUP_MTP3:
main_ui_->menuMTP3->removeAction(action);
break;
+ case REGISTER_TELEPHONY_GROUP_SCTP:
+ main_ui_->menuTelephonySCTP->removeAction(action);
+ break;
case REGISTER_TOOLS_GROUP_UNSORTED:
{
// Allow removal of submenus.
@@ -2894,12 +2834,12 @@ void WiresharkMainWindow::removeMenuActions(QList<QAction *> &actions, int menu_
void WiresharkMainWindow::addDynamicMenus()
{
// Manual additions
- mainApp->addDynamicMenuGroupItem(REGISTER_STAT_GROUP_TELEPHONY_GSM, main_ui_->actionTelephonyGsmMapSummary);
- mainApp->addDynamicMenuGroupItem(REGISTER_STAT_GROUP_TELEPHONY_LTE, main_ui_->actionTelephonyLteMacStatistics);
- mainApp->addDynamicMenuGroupItem(REGISTER_STAT_GROUP_TELEPHONY_LTE, main_ui_->actionTelephonyLteRlcStatistics);
- mainApp->addDynamicMenuGroupItem(REGISTER_STAT_GROUP_TELEPHONY_LTE, main_ui_->actionTelephonyLteRlcGraph);
- mainApp->addDynamicMenuGroupItem(REGISTER_STAT_GROUP_TELEPHONY_MTP3, main_ui_->actionTelephonyMtp3Summary);
- mainApp->addDynamicMenuGroupItem(REGISTER_STAT_GROUP_TELEPHONY, main_ui_->actionTelephonySipFlows);
+ mainApp->addDynamicMenuGroupItem(REGISTER_TELEPHONY_GROUP_GSM, main_ui_->actionTelephonyGsmMapSummary);
+ mainApp->addDynamicMenuGroupItem(REGISTER_TELEPHONY_GROUP_3GPP_UU, main_ui_->actionTelephonyLteMacStatistics);
+ mainApp->addDynamicMenuGroupItem(REGISTER_TELEPHONY_GROUP_3GPP_UU, main_ui_->actionTelephonyLteRlcStatistics);
+ mainApp->addDynamicMenuGroupItem(REGISTER_TELEPHONY_GROUP_3GPP_UU, main_ui_->actionTelephonyLteRlcGraph);
+ mainApp->addDynamicMenuGroupItem(REGISTER_TELEPHONY_GROUP_MTP3, main_ui_->actionTelephonyMtp3Summary);
+ mainApp->addDynamicMenuGroupItem(REGISTER_TELEPHONY_GROUP_UNSORTED, main_ui_->actionTelephonySipFlows);
// Fill in each menu
foreach(register_stat_group_t menu_group, menu_groups_) {
@@ -2910,16 +2850,16 @@ void WiresharkMainWindow::addDynamicMenus()
// Empty menus don't show up: https://bugreports.qt.io/browse/QTBUG-33728
// We've added a placeholder in order to make sure some menus are visible.
// Hide them as needed.
- if (mainApp->dynamicMenuGroupItems(REGISTER_STAT_GROUP_TELEPHONY_ANSI).length() > 0) {
+ if (mainApp->dynamicMenuGroupItems(REGISTER_TELEPHONY_GROUP_ANSI).length() > 0) {
main_ui_->actionTelephonyANSIPlaceholder->setVisible(false);
}
- if (mainApp->dynamicMenuGroupItems(REGISTER_STAT_GROUP_TELEPHONY_GSM).length() > 0) {
+ if (mainApp->dynamicMenuGroupItems(REGISTER_TELEPHONY_GROUP_GSM).length() > 0) {
main_ui_->actionTelephonyGSMPlaceholder->setVisible(false);
}
- if (mainApp->dynamicMenuGroupItems(REGISTER_STAT_GROUP_TELEPHONY_LTE).length() > 0) {
+ if (mainApp->dynamicMenuGroupItems(REGISTER_TELEPHONY_GROUP_3GPP_UU).length() > 0) {
main_ui_->actionTelephonyLTEPlaceholder->setVisible(false);
}
- if (mainApp->dynamicMenuGroupItems(REGISTER_STAT_GROUP_TELEPHONY_MTP3).length() > 0) {
+ if (mainApp->dynamicMenuGroupItems(REGISTER_TELEPHONY_GROUP_MTP3).length() > 0) {
main_ui_->actionTelephonyMTP3Placeholder->setVisible(false);
}
}
@@ -2938,7 +2878,7 @@ void WiresharkMainWindow::reloadDynamicMenus()
mainApp->clearRemovedMenuGroupItems();
}
-void WiresharkMainWindow::externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth)
+void WiresharkMainWindow::externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, int depth)
{
QAction * itemAction = Q_NULLPTR;
ext_menubar_t * item = Q_NULLPTR;
@@ -3127,7 +3067,7 @@ QString WiresharkMainWindow::findRtpStreams(QVector<rtpstream_id_t *> *stream_id
{
rtpstream_tapinfo_t tapinfo;
rtpstream_id_t *new_id;
- const gchar filter_text[] = "rtp && rtp.version == 2 && rtp.ssrc && (ip || ipv6)";
+ const char filter_text[] = "rtp && rtp.version == 2 && rtp.ssrc && (ip || ipv6)";
dfilter_t *sfcode;
df_error_t *df_err = NULL;
diff --git a/ui/qt/wireshark_main_window.h b/ui/qt/wireshark_main_window.h
index 781a1b28..a1cc8b17 100644
--- a/ui/qt/wireshark_main_window.h
+++ b/ui/qt/wireshark_main_window.h
@@ -40,8 +40,6 @@
#include <config.h>
-#include <glib.h>
-
#include "file.h"
#include "ui/ws_ui_util.h"
@@ -123,7 +121,7 @@ public:
void removeAdditionalToolbar(QString toolbarName);
void addInterfaceToolbar(const iface_toolbar *toolbar_entry);
- void removeInterfaceToolbar(const gchar *menu_title);
+ void removeInterfaceToolbar(const char *menu_title);
QString getMwFileName();
void setMwFileName(QString fileName);
@@ -181,6 +179,7 @@ private:
bool capture_stopping_;
bool capture_filter_valid_;
+ bool use_capturing_title_;
#ifdef HAVE_LIBPCAP
capture_session cap_session_;
CaptureOptionsDialog *capture_options_dialog_;
@@ -233,10 +232,10 @@ private:
QString replaceWindowTitleVariables(QString title);
void updateStyleSheet();
- void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, gint depth);
+ void externalMenuHelper(ext_menu_t * menu, QMenu * subMenu, int depth);
void setForCaptureInProgress(bool capture_in_progress = false, bool handle_toolbars = false, GArray *ifaces = NULL);
- QMenu* findOrAddMenu(QMenu *parent_menu, QString& menu_text);
+ QMenu* findOrAddMenu(QMenu *parent_menu, const QStringList& menu_parts);
void captureFileReadStarted(const QString &action);
@@ -269,11 +268,11 @@ public slots:
* @param cf_path Path to the file.
* @param display_filter Display filter to apply. May be empty.
* @param type File type.
- * @param is_tempfile TRUE/FALSE.
+ * @param is_tempfile true/false.
* @return True on success, false on failure.
*/
// XXX We might want to return a cf_read_status_t or a CaptureFile.
- bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, gboolean is_tempfile = FALSE);
+ bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, bool is_tempfile = false);
bool openCaptureFile(QString cf_path = QString(), QString display_filter = QString()) { return openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO); }
void filterPackets(QString new_filter = QString(), bool force = false);
void updateForUnsavedChanges();
@@ -299,8 +298,8 @@ public slots:
void captureFileClosing();
void captureFileClosed();
- void launchRLCGraph(bool channelKnown, guint16 ueid, guint8 rlcMode,
- guint16 channelType, guint16 channelId, guint8 direction);
+ void launchRLCGraph(bool channelKnown, uint8_t RAT, uint16_t ueid, uint8_t rlcMode,
+ uint16_t channelType, uint16_t channelId, uint8_t direction);
void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
@@ -332,6 +331,7 @@ private slots:
*/
void startCapture(QStringList);
void startCapture();
+ void pushLiveCaptureInProgress();
void popLiveCaptureInProgress();
void stopCapture();
@@ -363,6 +363,7 @@ private slots:
void addPluginIFStructures();
QMenu * searchSubMenu(QString objectName);
void activatePluginIFToolbar(bool);
+ void updateTitlebar();
void startInterfaceCapture(bool valid, const QString capture_filter);
@@ -398,7 +399,7 @@ private slots:
// Automatically connected slots ("on_<object>_<signal>").
//
- // The slots below follow the naming conventaion described in
+ // The slots below follow the naming convention described in
// https://doc.qt.io/archives/qt-4.8/qmetaobject.html#connectSlotsByName
// and are automatically connected at initialization time via
// main_ui_->setupUi, which in turn calls connectSlotsByName.
@@ -423,7 +424,7 @@ private slots:
void editConfigurationProfiles();
void editTimeShiftFinished(int);
void addPacketCommentFinished(PacketCommentDialog* pc_dialog, int result);
- void editPacketCommentFinished(PacketCommentDialog* pc_dialog, int result, guint nComment);
+ void editPacketCommentFinished(PacketCommentDialog* pc_dialog, int result, unsigned nComment);
void deleteAllPacketComments();
void deleteAllPacketCommentsFinished(int result);
void injectSecrets();
@@ -464,7 +465,7 @@ private slots:
void applyConversationFilter();
void applyExportObject();
- void openFollowStreamDialog(int proto_id, guint stream_num, guint sub_stream_num, bool use_stream_index = true);
+ void openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num, bool use_stream_index = true);
void openFollowStreamDialog(int proto_id);
void statCommandExpertInfo(const char *, void *);
@@ -494,8 +495,9 @@ private slots:
void statCommandWlanStatistics(const char *arg, void *);
- void openStatisticsTreeDialog(const gchar *abbr);
+ void openStatisticsTreeDialog(const char *abbr);
void statCommandIOGraph(const char *, void *);
+ void showIOGraphDialog(io_graph_item_unit_t value_units, QString);
void connectTelephonyMenuActions();
diff --git a/ui/qt/wireshark_main_window.ui b/ui/qt/wireshark_main_window.ui
index cb01e642..5ff9f8e5 100644
--- a/ui/qt/wireshark_main_window.ui
+++ b/ui/qt/wireshark_main_window.ui
@@ -471,6 +471,13 @@
<addaction name="actionStatisticsBACappObjectId"/>
<addaction name="actionStatisticsBACappService"/>
</widget>
+ <widget class="QMenu" name="menuDNS">
+ <property name="title">
+ <string>DNS</string>
+ </property>
+ <addaction name="actionStatisticsDNS"/>
+ <addaction name="actionStatisticsDNS_QR"/>
+ </widget>
<widget class="QMenu" name="menuHTTP">
<property name="title">
<string>HTTP</string>
@@ -554,7 +561,7 @@
<addaction name="actionStatisticsANCP"/>
<addaction name="menuBACnet"/>
<addaction name="actionStatisticsCollectd"/>
- <addaction name="actionStatisticsDNS"/>
+ <addaction name="menuDNS"/>
<addaction name="actionStatisticsFlowGraph"/>
<addaction name="actionStatisticsHART_IP"/>
<addaction name="actionStatisticsHpfeeds"/>
@@ -608,7 +615,7 @@
</widget>
<widget class="QMenu" name="menuLTE">
<property name="title">
- <string>&amp;LTE</string>
+ <string>&amp;3GPP Uu</string>
</property>
<addaction name="actionTelephonyLTEPlaceholder"/>
</widget>
@@ -639,6 +646,7 @@
<addaction name="actionTelephonyUCPMessages"/>
<addaction name="actionTelephonyF1APMessages"/>
<addaction name="actionTelephonyNGAPMessages"/>
+ <addaction name="actionTelephonyE2APMessages"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
@@ -670,13 +678,13 @@
<addaction name="actionEditFindNext"/>
<addaction name="actionEditFindPrevious"/>
<addaction name="separator"/>
- <addaction name="actionEditMarkPacket"/>
+ <addaction name="actionEditMarkSelected"/>
<addaction name="actionEditMarkAllDisplayed"/>
<addaction name="actionEditUnmarkAllDisplayed"/>
<addaction name="actionEditNextMark"/>
<addaction name="actionEditPreviousMark"/>
<addaction name="separator"/>
- <addaction name="actionEditIgnorePacket"/>
+ <addaction name="actionEditIgnoreSelected"/>
<addaction name="actionEditIgnoreAllDisplayed"/>
<addaction name="actionEditUnignoreAllDisplayed"/>
<addaction name="separator"/>
@@ -779,6 +787,7 @@
<addaction name="actionViewZoomOut"/>
<addaction name="actionViewNormalSize"/>
<addaction name="actionViewResizeColumns"/>
+ <addaction name="actionViewResetLayout"/>
</widget>
<widget class="MainStatusBar" name="statusBar"/>
<widget class="QToolBar" name="displayFilterToolBar">
@@ -893,17 +902,15 @@
</action>
<action name="actionHelpContents">
<property name="text">
- <string>&amp;Contents</string>
+ <string>&amp;User's Guide</string>
</property>
+ <!-- This tooltip is replaced with the URL -->
<property name="toolTip">
- <string>Help contents</string>
+ <string>Wireshark User's Guide</string>
</property>
<property name="shortcut">
<string notr="true">F1</string>
</property>
- <property name="iconVisibleInMenu">
- <bool>true</bool>
- </property>
</action>
<action name="actionHelpMPWireshark">
<property name="text">
@@ -912,7 +919,7 @@
</action>
<action name="actionHelpMPWireshark_Filter">
<property name="text">
- <string>Wireshark Filter</string>
+ <string>Display Filters</string>
</property>
</action>
<action name="actionHelpMPTShark">
@@ -1463,9 +1470,9 @@
<string notr="true">Ctrl+B</string>
</property>
</action>
- <action name="actionEditMarkPacket">
+ <action name="actionEditMarkSelected">
<property name="text">
- <string>&amp;Mark/Unmark Packet(s)</string>
+ <string>&amp;Mark/Unmark Selected</string>
</property>
<property name="toolTip">
<string>Mark or unmark each selected packet</string>
@@ -1518,9 +1525,9 @@
<string notr="true">Ctrl+Shift+B</string>
</property>
</action>
- <action name="actionEditIgnorePacket">
+ <action name="actionEditIgnoreSelected">
<property name="text">
- <string>&amp;Ignore/Unignore Packet(s)</string>
+ <string>&amp;Ignore/Unignore Selected</string>
</property>
<property name="toolTip">
<string>Ignore or unignore each selected packet</string>
@@ -1812,12 +1819,20 @@
</action>
<action name="actionStatisticsDNS">
<property name="text">
- <string>DNS</string>
+ <string>General</string>
</property>
<property name="toolTip">
<string>DNS statistics</string>
</property>
</action>
+ <action name="actionStatisticsDNS_QR">
+ <property name="text">
+ <string>Query-Response</string>
+ </property>
+ <property name="toolTip">
+ <string>DNS Query-Response Statistics</string>
+ </property>
+ </action>
<action name="actionStatisticsHART_IP">
<property name="text">
<string>HART-IP</string>
@@ -1970,6 +1985,14 @@
<string>NGAP Messages</string>
</property>
</action>
+ <action name="actionTelephonyE2APMessages">
+ <property name="text">
+ <string>E2AP</string>
+ </property>
+ <property name="toolTip">
+ <string>E2AP Messages</string>
+ </property>
+ </action>
<action name="actionAnalyzeDecodeAs">
<property name="text">
<string>Decode &amp;As…</string>
@@ -2181,7 +2204,7 @@
<string>Reset Layout</string>
</property>
<property name="toolTip">
- <string>Reset appearance layout to default size</string>
+ <string>Reset layout to default size</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+W</string>
diff --git a/ui/qt/wireshark_main_window_slots.cpp b/ui/qt/wireshark_main_window_slots.cpp
index a348bd47..db1e15f7 100644
--- a/ui/qt/wireshark_main_window_slots.cpp
+++ b/ui/qt/wireshark_main_window_slots.cpp
@@ -19,7 +19,7 @@
/*
* The generated Ui_WiresharkMainWindow::setupUi() can grow larger than our configured limit,
- * so turn off -Wframe-larger-than= for ui_main_window.h.
+ * so turn off -Wframe-larger-than= for ui_wireshark_main_window.h.
*/
DIAG_OFF(frame-larger-than=)
#include <ui_wireshark_main_window.h>
@@ -188,14 +188,14 @@ DIAG_ON(frame-larger-than=)
// Public slots
//
-bool WiresharkMainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned int type, gboolean is_tempfile)
+bool WiresharkMainWindow::openCaptureFile(QString cf_path, QString read_filter, unsigned int type, bool is_tempfile)
{
QString file_name = "";
dfilter_t *rfcode = NULL;
df_error_t *df_err = NULL;
int err;
- gboolean name_param;
- gboolean ret = true;
+ bool name_param;
+ bool ret = true;
// was a file name given as function parameter?
name_param = !cf_path.isEmpty();
@@ -262,7 +262,7 @@ bool WiresharkMainWindow::openCaptureFile(QString cf_path, QString read_filter,
continue;
}
- switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/FALSE)) {
+ switch (cf_read(CaptureFile::globalCapFile(), /*reloading=*/false)) {
case CF_READ_OK:
case CF_READ_ERROR:
/* Just because we got an error, that doesn't mean we were unable
@@ -282,7 +282,9 @@ bool WiresharkMainWindow::openCaptureFile(QString cf_path, QString read_filter,
break;
}
- mainApp->setLastOpenDirFromFilename(cf_path);
+ if (!is_tempfile) {
+ mainApp->setLastOpenDirFromFilename(cf_path);
+ }
main_ui_->statusBar->showExpert();
@@ -364,6 +366,16 @@ void WiresharkMainWindow::layoutToolbars()
}
}
+static const char* layout_icons[] = {
+ NULL,
+ "x-reset-layout_5",
+ "x-reset-layout_2",
+ "x-reset-layout_1",
+ "x-reset-layout_4",
+ "x-reset-layout_3",
+ "x-reset-layout_6"
+};
+
void WiresharkMainWindow::updatePreferenceActions()
{
main_ui_->actionViewPacketList->setEnabled(prefs_has_layout_pane_content(layout_pane_content_plist));
@@ -374,6 +386,9 @@ void WiresharkMainWindow::updatePreferenceActions()
main_ui_->actionViewNameResolutionPhysical->setChecked(gbl_resolv_flags.mac_name);
main_ui_->actionViewNameResolutionNetwork->setChecked(gbl_resolv_flags.network_name);
main_ui_->actionViewNameResolutionTransport->setChecked(gbl_resolv_flags.transport_name);
+
+ if (prefs.gui_layout_type > 0)
+ main_ui_->actionViewResetLayout->setIcon(StockIcon(layout_icons[prefs.gui_layout_type]));
}
void WiresharkMainWindow::updateRecentActions()
@@ -422,7 +437,7 @@ void WiresharkMainWindow::updateRecentActions()
main_ui_->actionGoAutoScroll->setChecked(recent.capture_auto_scroll);
}
-// Don't connect to this directly. Connect to or emit fiterAction(...) instead.
+// Don't connect to this directly. Connect to or emit filterAction(...) instead.
void WiresharkMainWindow::queuedFilterAction(QString action_filter, FilterAction::Action action, FilterAction::ActionType type)
{
QString cur_filter, new_filter;
@@ -506,17 +521,17 @@ void WiresharkMainWindow::queuedFilterAction(QString action_filter, FilterAction
#ifdef HAVE_LIBPCAP
void WiresharkMainWindow::captureCapturePrepared(capture_session *session) {
setTitlebarForCaptureInProgress();
-
setWindowIcon(mainApp->captureIcon());
+ pushLiveCaptureInProgress();
/* Disable menu items that make no sense if you're currently running
a capture. */
bool handle_toolbars = (session->session_will_restart ? false : true);
setForCaptureInProgress(true, handle_toolbars, session->capture_opts->ifaces);
-// set_capture_if_dialog_for_capture_in_progress(TRUE);
+// set_capture_if_dialog_for_capture_in_progress(true);
// /* Don't set up main window for a capture file. */
-// main_set_for_capture_file(FALSE);
+// main_set_for_capture_file(false);
showCapture();
}
@@ -526,6 +541,7 @@ void WiresharkMainWindow::captureCaptureUpdateStarted(capture_session *session)
switching to the next multiple file. */
setTitlebarForCaptureInProgress();
setWindowIcon(mainApp->captureIcon());
+ pushLiveCaptureInProgress();
bool handle_toolbars = (session->session_will_restart ? false : true);
setForCaptureInProgress(true, handle_toolbars, session->capture_opts->ifaces);
@@ -540,6 +556,7 @@ void WiresharkMainWindow::captureCaptureUpdateFinished(capture_session *session)
/* Update the main window as appropriate */
updateForUnsavedChanges();
+ setTitlebarForCaptureFile();
/* Enable menu items that make sense if you're not currently running
a capture. */
@@ -561,6 +578,7 @@ void WiresharkMainWindow::captureCaptureFixedFinished(capture_session *) {
/* The capture isn't stopping any more - it's stopped. */
capture_stopping_ = false;
+ setTitlebarForCaptureFile();
/* Enable menu items that make sense if you're not currently running
a capture. */
@@ -583,7 +601,7 @@ void WiresharkMainWindow::captureCaptureFixedFinished(capture_session *) {
void WiresharkMainWindow::captureCaptureFailed(capture_session *) {
/* Capture isn't stopping any more. */
capture_stopping_ = false;
-
+ setTitlebarForCaptureFile();
setForCaptureInProgress(false);
showWelcome();
@@ -666,7 +684,7 @@ void WiresharkMainWindow::captureEventHandler(CaptureEvent ev)
thaw();
break;
case CaptureEvent::Flushed:
- draw_tap_listeners(FALSE);
+ draw_tap_listeners(false);
break;
default:
break;
@@ -756,7 +774,7 @@ void WiresharkMainWindow::captureFileReadStarted(const QString &action) {
// tap_param_dlg_update();
/* Set up main window for a capture file. */
-// main_set_for_capture_file(TRUE);
+// main_set_for_capture_file(true);
mainApp->popStatus(WiresharkApplication::FileStatus);
QString msg = QString(tr("%1: %2")).arg(action).arg(capture_file_.fileName());
@@ -770,7 +788,7 @@ void WiresharkMainWindow::captureFileReadStarted(const QString &action) {
void WiresharkMainWindow::captureFileReadFinished() {
if (!capture_file_.capFile()->is_tempfile && capture_file_.capFile()->filename) {
/* Add this filename to the list of recent files in the "Recent Files" submenu */
- add_menu_recent_capture_file(capture_file_.capFile()->filename);
+ add_menu_recent_capture_file(capture_file_.capFile()->filename, false);
/* Remember folder for next Open dialog and save it in recent */
mainApp->setLastOpenDirFromFilename(capture_file_.capFile()->filename);
@@ -795,6 +813,7 @@ void WiresharkMainWindow::captureFileReadFinished() {
void WiresharkMainWindow::captureFileClosing() {
setMenusForCaptureFile(true);
+ setTitlebarForCaptureFile();
setForCapturedPackets(false);
setForCaptureInProgress(false);
@@ -839,12 +858,12 @@ void WiresharkMainWindow::startCapture() {
startCapture(QStringList());
}
-void WiresharkMainWindow::startCapture(QStringList interfaces _U_) {
+void WiresharkMainWindow::startCapture(QStringList interfaces) {
#ifdef HAVE_LIBPCAP
interface_options *interface_opts;
- guint i;
+ unsigned i;
interface_t *device;
- gboolean can_start_capture = TRUE;
+ bool can_start_capture = true;
if (interfaces.count() > 0) {
global_capture_opts.num_selected = 0;
@@ -852,11 +871,11 @@ void WiresharkMainWindow::startCapture(QStringList interfaces _U_) {
device = &g_array_index(global_capture_opts.all_ifaces, interface_t, i);
if (interfaces.contains(device->name)) {
- device->selected = TRUE;
+ device->selected = true;
global_capture_opts.num_selected++;
}
else {
- device->selected = FALSE;
+ device->selected = false;
}
}
}
@@ -877,11 +896,11 @@ void WiresharkMainWindow::startCapture(QStringList interfaces _U_) {
*/
if (extcap_requires_configuration(device->name))
{
- /* Request openning of extcap options dialog */
+ /* Request opening of extcap options dialog */
QString device_name(device->name);
emit showExtcapOptions(device_name, false);
/* Cancel start of capture */
- can_start_capture = FALSE;
+ can_start_capture = false;
}
}
}
@@ -924,24 +943,6 @@ void WiresharkMainWindow::startCapture(QStringList interfaces _U_) {
info_data_.ui.ui = this;
if (capture_start(&global_capture_opts, NULL, &cap_session_, &info_data_,
main_window_update)) {
- capture_options *capture_opts = cap_session_.capture_opts;
- GString *interface_names;
-
- /* Add "interface name<live capture in progress>" on main status bar */
- interface_names = get_iface_list_string(capture_opts, 0);
- if (strlen(interface_names->str) > 0) {
- g_string_append(interface_names, ":");
- }
- g_string_append(interface_names, " ");
-
- mainApp->popStatus(WiresharkApplication::FileStatus);
- QString msg = QString("%1<live capture in progress>").arg(interface_names->str);
- QString msgtip = QString("to file: ");
- if (capture_opts->save_file)
- msgtip += capture_opts->save_file;
- mainApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
- g_string_free(interface_names, TRUE);
-
/* The capture succeeded, which means the capture filter syntax is
valid; add this capture filter to the recent capture filter list. */
QByteArray filter_ba;
@@ -979,6 +980,30 @@ DIAG_ON(stringop-overread)
} else {
CaptureFile::globalCapFile()->window = NULL;
}
+#else // HAVE_LIBPCAP
+ Q_UNUSED(interfaces)
+#endif // HAVE_LIBPCAP
+}
+
+void WiresharkMainWindow::pushLiveCaptureInProgress() {
+#ifdef HAVE_LIBPCAP
+ capture_options *capture_opts = cap_session_.capture_opts;
+ GString *interface_names;
+
+ /* Add "interface name<live capture in progress>" on main status bar */
+ interface_names = get_iface_list_string(capture_opts, 0);
+ if (strlen(interface_names->str) > 0) {
+ g_string_append(interface_names, ":");
+ }
+ g_string_append(interface_names, " ");
+
+ mainApp->popStatus(WiresharkApplication::FileStatus);
+ QString msg = QString("%1<live capture in progress>").arg(interface_names->str);
+ QString msgtip = QString("to file: ");
+ if (capture_opts->save_file)
+ msgtip += capture_opts->save_file;
+ mainApp->pushStatus(WiresharkApplication::FileStatus, msg, msgtip);
+ g_string_free(interface_names, TRUE);
#endif // HAVE_LIBPCAP
}
@@ -1044,7 +1069,9 @@ void WiresharkMainWindow::updateRecentCaptures() {
/* Iterate through the actions in menuOpenRecentCaptureFile,
* removing special items, a maybe duplicate entry and every item above count_max */
+#if defined(Q_OS_MAC)
int shortcut = Qt::Key_0;
+#endif
foreach(recent_item_status *ri, mainApp->recentItems()) {
// Add the new item
ra = new QAction(recentMenu);
@@ -1053,12 +1080,14 @@ void WiresharkMainWindow::updateRecentCaptures() {
ra->setEnabled(ri->accessible);
recentMenu->insertAction(NULL, ra);
action_cf_name = ra->data().toString();
+#if defined(Q_OS_MAC)
if (shortcut <= Qt::Key_9) {
ra->setShortcut(Qt::META | (Qt::Key)shortcut);
shortcut++;
}
+#endif
ra->setText(action_cf_name);
- connect(ra, SIGNAL(triggered()), this, SLOT(recentActionTriggered()));
+ connect(ra, &QAction::triggered, this, &WiresharkMainWindow::recentActionTriggered);
/* This is slow, at least on my VM here. The added links also open Wireshark
* in a new window. It might make more sense to add a recent item when we
@@ -1082,8 +1111,15 @@ void WiresharkMainWindow::updateRecentCaptures() {
QFileInfo fi(ri->filename);
rda->setText(fi.fileName());
dock_menu_->insertAction(NULL, rda);
- connect(rda, SIGNAL(triggered()), ra, SLOT(trigger()));
+ connect(rda, &QAction::triggered, ra, &QAction::trigger);
+#endif
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ if (recentMenu->actions().count() == static_cast<int>(prefs.gui_recent_files_count_max)) {
+#else
+ if (recentMenu->actions().count() == static_cast<qsizetype>(prefs.gui_recent_files_count_max)) {
#endif
+ break;
+ }
}
if (recentMenu->actions().count() > 0) {
@@ -1096,7 +1132,7 @@ void WiresharkMainWindow::updateRecentCaptures() {
ra = new QAction(recentMenu);
ra->setText(tr("Clear Menu"));
recentMenu->insertAction(NULL, ra);
- connect(ra, SIGNAL(triggered()), mainApp, SLOT(clearRecentCaptures()));
+ connect(ra, &QAction::triggered, mainApp, &MainApplication::clearRecentCaptures);
} else {
if (main_ui_->actionDummyNoFilesFound) {
recentMenu->addAction(main_ui_->actionDummyNoFilesFound);
@@ -1138,10 +1174,10 @@ void WiresharkMainWindow::setEditCommentsMenu()
const int thisRow = selectedRows().first();
frame_data * current_frame = frameDataForRow(thisRow);
wtap_block_t pkt_block = cf_get_packet_block(capture_file_.capFile(), current_frame);
- guint nComments = wtap_block_count_option(pkt_block, OPT_COMMENT);
+ unsigned nComments = wtap_block_count_option(pkt_block, OPT_COMMENT);
if (nComments > 0) {
main_ui_->menuPacketComment->addSeparator();
- for (guint i = 0; i < nComments; i++) {
+ for (unsigned i = 0; i < nComments; i++) {
QString comment = packet_list_->getPacketComment(i);
comment = this->commentToMenuText(comment);
action = main_ui_->menuPacketComment->addAction(tr("Edit \"%1\"", "edit packet comment").arg(comment));
@@ -1150,7 +1186,7 @@ void WiresharkMainWindow::setEditCommentsMenu()
}
main_ui_->menuPacketComment->addSeparator();
- for (guint i = 0; i < nComments; i++) {
+ for (unsigned i = 0; i < nComments; i++) {
QString comment = packet_list_->getPacketComment(i);
comment = this->commentToMenuText(comment);
action = main_ui_->menuPacketComment->addAction(tr("Delete \"%1\"", "delete packet comment").arg(comment));
@@ -1172,8 +1208,8 @@ void WiresharkMainWindow::setEditCommentsMenu()
void WiresharkMainWindow::setMenusForSelectedPacket()
{
- gboolean is_ip = FALSE, is_tcp = FALSE, is_udp = FALSE, is_sctp = FALSE, is_tls = FALSE, is_rtp = FALSE, is_lte_rlc = FALSE,
- is_quic = FALSE, is_exported_pdu = FALSE;
+ bool is_ip = false, is_tcp = false, is_udp = false, is_sctp = false, is_tls = false, is_rtp = false, is_lte_rlc = false,
+ is_quic = false, is_exported_pdu = false;
/* Making the menu context-sensitive allows for easier selection of the
desired item and has the added benefit, with large captures, of
@@ -1237,7 +1273,7 @@ void WiresharkMainWindow::setMenusForSelectedPacket()
another_is_time_ref = have_time_ref && rows.count() <= 1 &&
!(capture_file_.capFile()->ref_time_count == 1 && frame_selected && current_frame->ref_time);
- if (capture_file_.capFile()->edt && ! multi_selection)
+ if (capture_file_.capFile()->edt && ! multi_selection && frame_selected)
{
proto_get_frame_protocols(capture_file_.capFile()->edt->pi.layers,
&is_ip, &is_tcp, &is_udp, &is_sctp,
@@ -1249,30 +1285,31 @@ void WiresharkMainWindow::setMenusForSelectedPacket()
if (is_exported_pdu &&
(capture_file_.capFile()->edt->pi.net_src.type == AT_IPv4 || capture_file_.capFile()->edt->pi.net_src.type == AT_IPv6) &&
(capture_file_.capFile()->edt->pi.net_dst.type == AT_IPv4 || capture_file_.capFile()->edt->pi.net_dst.type == AT_IPv6)) {
- is_ip = TRUE;
+ is_ip = true;
}
foreach (FollowStreamAction *follow_action, main_ui_->menuFollow->findChildren<FollowStreamAction *>()) {
/* QUIC has TLS handshakes; don't enabled Follow TLS Stream if
* there's QUIC.
*/
- gboolean is_frame = proto_is_frame_protocol(capture_file_.capFile()->edt->pi.layers, follow_action->filterName());
+ bool is_frame = proto_is_frame_protocol(capture_file_.capFile()->edt->pi.layers, follow_action->filterName());
if (g_strcmp0(follow_action->filterName(), "tls") == 0) {
follow_action->setEnabled(is_frame && !is_quic);
} else {
follow_action->setEnabled(is_frame);
}
}
+ } else {
+ foreach (FollowStreamAction *follow_action, main_ui_->menuFollow->findChildren<FollowStreamAction *>()) {
+ follow_action->setEnabled(false);
+ }
}
}
- main_ui_->actionEditMarkPacket->setText(tr("&Mark/Unmark Packet(s)", "", static_cast<int>(selectedRows().count())));
- main_ui_->actionEditIgnorePacket->setText(tr("&Ignore/Unignore Packet(s)", "", static_cast<int>(selectedRows().count())));
-
main_ui_->actionCopyListAsText->setEnabled(selectedRows().count() > 0);
main_ui_->actionCopyListAsCSV->setEnabled(selectedRows().count() > 0);
main_ui_->actionCopyListAsYAML->setEnabled(selectedRows().count() > 0);
- main_ui_->actionEditMarkPacket->setEnabled(frame_selected || multi_selection);
+ main_ui_->actionEditMarkSelected->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditMarkAllDisplayed->setEnabled(have_frames);
/* Unlike un-ignore, do not allow unmark of all frames when no frames are displayed */
main_ui_->actionEditUnmarkAllDisplayed->setEnabled(have_marked);
@@ -1287,7 +1324,7 @@ void WiresharkMainWindow::setMenusForSelectedPacket()
main_ui_->menuPacketComment->setEnabled(enableEditComments && selectedRows().count() > 0);
main_ui_->actionDeleteAllPacketComments->setEnabled(enableEditComments);
- main_ui_->actionEditIgnorePacket->setEnabled(frame_selected || multi_selection);
+ main_ui_->actionEditIgnoreSelected->setEnabled(frame_selected || multi_selection);
main_ui_->actionEditIgnoreAllDisplayed->setEnabled(have_filtered);
/* Allow un-ignore of all frames even with no frames currently displayed */
main_ui_->actionEditUnignoreAllDisplayed->setEnabled(have_ignored);
@@ -1361,10 +1398,26 @@ void WiresharkMainWindow::setMenusForSelectedTreeRow(FieldInformation *finfo) {
if (fi && fi->ds_tvb && (fi->length > 0)) {
have_packet_bytes = true;
}
+
+ if (!(capture_file_.capFile()->search_in_progress && (capture_file_.capFile()->hex || (capture_file_.capFile()->string && capture_file_.capFile()->packet_data)))) {
+ // If we're not in the middle of a packet bytes search, then set
+ // search_pos and search_len so that we can start a new search
+ // from this point. (If we are, then we already set it.)
+ if (fi && capture_file_.capFile()->edt && (fi->ds_tvb == capture_file_.capFile()->edt->tvb)) {
+ // We can only do a Packet Bytes search in the main bytes from
+ // the frame, not from any secondary data sources. (XXX: This
+ // might be surprising to users, though.)
+ capture_file_.capFile()->search_pos = (uint32_t)(finfo->position().start + finfo->position().length - 1);
+ capture_file_.capFile()->search_len = (uint32_t)finfo->position().length;
+ } else {
+ capture_file_.capFile()->search_pos = 0;
+ capture_file_.capFile()->search_len = 0;
+ }
+ }
}
if (capture_file_.capFile() != NULL && fi != NULL) {
- header_field_info *hfinfo = fi->hfinfo;
+ const header_field_info *hfinfo = fi->hfinfo;
int linked_frame = -1;
can_match_selected = proto_can_match_selected(capture_file_.capFile()->finfo_selected, capture_file_.capFile()->edt);
@@ -1522,7 +1575,7 @@ void WiresharkMainWindow::checkDisplayFilter()
void WiresharkMainWindow::fieldsChanged()
{
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
if (!color_filters_reload(&err_msg, color_filter_add_cb)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
@@ -1545,7 +1598,7 @@ void WiresharkMainWindow::reloadLuaPlugins()
if (mainApp->isReloadingLua())
return;
- gboolean uses_lua_filehandler = FALSE;
+ bool uses_lua_filehandler = false;
if (capture_file_.capFile()) {
// Check if the current capture file is opened with a Lua FileHandler
@@ -1633,11 +1686,11 @@ void WiresharkMainWindow::initViewColorizeMenu()
<< main_ui_->actionViewColorizeConversation7 << main_ui_->actionViewColorizeConversation8
<< main_ui_->actionViewColorizeConversation9 << main_ui_->actionViewColorizeConversation10;
- guint8 color_num = 1;
+ uint8_t color_num = 1;
foreach(QAction *cc_action, cc_actions) {
cc_action->setData(color_num);
- connect(cc_action, SIGNAL(triggered()), this, SLOT(colorizeConversation()));
+ connect(cc_action, &QAction::triggered, this, &WiresharkMainWindow::colorizeConversation);
const color_filter_t *colorf = color_filters_tmp_color(color_num);
if (colorf) {
@@ -1674,16 +1727,15 @@ void WiresharkMainWindow::addStatsPluginsToMenu() {
parent_menu = main_ui_->menuStatistics;
// gtk/main_menubar.c compresses double slashes, hence SkipEmptyParts
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
- QStringList cfg_name_parts = QString(cfg->name).split("/", Qt::SkipEmptyParts);
+ QStringList cfg_name_parts = QString(cfg->path).split(STATS_TREE_MENU_SEPARATOR, Qt::SkipEmptyParts);
#else
- QStringList cfg_name_parts = QString(cfg->name).split("/", QString::SkipEmptyParts);
+ QStringList cfg_name_parts = QString(cfg->path).split(STATS_TREE_MENU_SEPARATOR, QString::SkipEmptyParts);
#endif
if (cfg_name_parts.isEmpty()) continue;
- QString stat_name = cfg_name_parts.takeLast();
+ QString stat_name = cfg_name_parts.takeLast().trimmed();
if (!cfg_name_parts.isEmpty()) {
- QString menu_name = cfg_name_parts.join("/");
- parent_menu = findOrAddMenu(parent_menu, menu_name);
+ parent_menu = findOrAddMenu(parent_menu, cfg_name_parts);
}
stats_tree_action = new QAction(stat_name, this);
@@ -1757,10 +1809,8 @@ void WiresharkMainWindow::openTapParameterDialog(const QString cfg_str, const QS
TapParameterDialog *tp_dialog = TapParameterDialog::showTapParameterStatistics(*this, capture_file_, cfg_str, arg, userdata);
if (!tp_dialog) return;
- connect(tp_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(tp_dialog, SIGNAL(updateFilter(QString)),
- df_combo_box_->lineEdit(), SLOT(setText(QString)));
+ connect(tp_dialog, &TapParameterDialog::filterAction, this, &WiresharkMainWindow::filterAction);
+ connect(tp_dialog, &TapParameterDialog::updateFilter, df_combo_box_->lineEdit(), &QLineEdit::setText);
tp_dialog->show();
}
@@ -1881,7 +1931,7 @@ void WiresharkMainWindow::exportPacketBytes()
);
if (file_name.length() > 0) {
- const guint8 *data_p;
+ const uint8_t *data_p;
data_p = tvb_get_ptr(capture_file_.capFile()->finfo_selected->ds_tvb, 0, -1) +
capture_file_.capFile()->finfo_selected->start;
@@ -1953,8 +2003,8 @@ void WiresharkMainWindow::exportTLSSessionKeys()
tr("TLS Session Keys (*.keys *.txt);;All Files (" ALL_FILES_WILDCARD ")")
);
if (file_name.length() > 0) {
- gsize keylist_length;
- gchar *keylist = ssl_export_sessions(&keylist_length);
+ size_t keylist_length;
+ char *keylist = ssl_export_sessions(&keylist_length);
write_file_binary_mode(qUtf8Printable(file_name), keylist, keylist_length);
/* Save the directory name for future file dialogs. */
@@ -2023,7 +2073,7 @@ void WiresharkMainWindow::connectEditMenuActions()
// The items below are used in the packet list and detail context menus.
// Use QueuedConnections so that the context menus aren't destroyed
// prematurely.
- connect(main_ui_->actionEditMarkPacket, &QAction::triggered, this, [this]() {
+ connect(main_ui_->actionEditMarkSelected, &QAction::triggered, this, [this]() {
freeze();
packet_list_->markFrame();
thaw();
@@ -2056,7 +2106,7 @@ void WiresharkMainWindow::connectEditMenuActions()
}
}, Qt::QueuedConnection);
- connect(main_ui_->actionEditIgnorePacket, &QAction::triggered, this, [this]() {
+ connect(main_ui_->actionEditIgnoreSelected, &QAction::triggered, this, [this]() {
freeze();
packet_list_->ignoreFrame();
thaw();
@@ -2140,7 +2190,7 @@ void WiresharkMainWindow::copySelectedItems(WiresharkMainWindow::CopySelected se
break;
case CopySelectedValue:
if (finfo_selected && capture_file_.capFile()->edt != 0) {
- gchar* field_str = get_node_field_value(finfo_selected, capture_file_.capFile()->edt);
+ char* field_str = get_node_field_value(finfo_selected, capture_file_.capFile()->edt);
clip.append(field_str);
g_free(field_str);
}
@@ -2231,10 +2281,9 @@ void WiresharkMainWindow::findPacket()
void WiresharkMainWindow::editTimeShift()
{
TimeShiftDialog *ts_dialog = new TimeShiftDialog(this, capture_file_.capFile());
- connect(ts_dialog, SIGNAL(finished(int)), this, SLOT(editTimeShiftFinished(int)));
+ connect(ts_dialog, &TimeShiftDialog::finished, this, &WiresharkMainWindow::editTimeShiftFinished);
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- ts_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(this, &WiresharkMainWindow::setCaptureFile, ts_dialog, &TimeShiftDialog::setCaptureFile);
connect(ts_dialog, &TimeShiftDialog::timeShifted, packet_list_, &PacketList::applyTimeShift, Qt::QueuedConnection);
ts_dialog->setWindowModality(Qt::ApplicationModal);
@@ -2282,7 +2331,7 @@ void WiresharkMainWindow::editPacketComment()
return;
QAction *ra = qobject_cast<QAction*>(sender());
- guint nComment = ra->data().toUInt();
+ unsigned nComment = ra->data().toUInt();
PacketCommentDialog* pc_dialog;
pc_dialog = new PacketCommentDialog(true, this, packet_list_->getPacketComment(nComment));
connect(pc_dialog, &QDialog::finished, std::bind(&WiresharkMainWindow::editPacketCommentFinished, this, pc_dialog, std::placeholders::_1, nComment));
@@ -2291,7 +2340,7 @@ void WiresharkMainWindow::editPacketComment()
pc_dialog->show();
}
-void WiresharkMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog _U_, int result _U_, guint nComment)
+void WiresharkMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dialog _U_, int result _U_, unsigned nComment)
{
if (result == QDialog::Accepted) {
packet_list_->setPacketComment(nComment, pc_dialog->text());
@@ -2302,7 +2351,7 @@ void WiresharkMainWindow::editPacketCommentFinished(PacketCommentDialog* pc_dial
void WiresharkMainWindow::deletePacketComment()
{
QAction *ra = qobject_cast<QAction*>(sender());
- guint nComment = ra->data().toUInt();
+ unsigned nComment = ra->data().toUInt();
packet_list_->setPacketComment(nComment, QString(""));
updateForUnsavedChanges();
}
@@ -2316,7 +2365,7 @@ void WiresharkMainWindow::deleteCommentsFromPackets()
void WiresharkMainWindow::deleteAllPacketComments()
{
QMessageBox *msg_dialog = new QMessageBox();
- connect(msg_dialog, SIGNAL(finished(int)), this, SLOT(deleteAllPacketCommentsFinished(int)));
+ connect(msg_dialog, &QMessageBox::finished, this, &WiresharkMainWindow::deleteAllPacketCommentsFinished);
msg_dialog->setIcon(QMessageBox::Question);
msg_dialog->setText(tr("Are you sure you want to remove all packet comments?"));
@@ -2355,7 +2404,7 @@ void WiresharkMainWindow::injectSecrets()
if (ret != QMessageBox::Yes) return;
- QUrl wiki_url = QString(WS_WIKI_URL("TLS/#tls-decryption"));
+ QUrl wiki_url = QString(WS_WIKI_URL("TLS#tls-decryption"));
QDesktopServices::openUrl(wiki_url);
return;
}
@@ -2377,7 +2426,7 @@ void WiresharkMainWindow::discardAllSecrets()
return;
QMessageBox* msg_dialog = new QMessageBox();
- connect(msg_dialog, SIGNAL(finished(int)), this, SLOT(discardAllSecretsFinished(int)));
+ connect(msg_dialog, &QMessageBox::finished, this, &WiresharkMainWindow::discardAllSecretsFinished);
msg_dialog->setIcon(QMessageBox::Question);
msg_dialog->setText(tr("Are you sure you want to discard all decryption secrets?"));
@@ -2398,7 +2447,7 @@ void WiresharkMainWindow::discardAllSecretsFinished(int result)
*/
capture_file* cf = capture_file_.capFile();
if (wtap_file_discard_decryption_secrets(cf->provider.wth)) {
- cf->unsaved_changes = TRUE;
+ cf->unsaved_changes = true;
updateForUnsavedChanges();
}
}
@@ -2415,7 +2464,7 @@ void WiresharkMainWindow::editConfigurationProfiles()
void WiresharkMainWindow::showPreferencesDialog(QString module_name)
{
PreferencesDialog *pref_dialog = new PreferencesDialog(this);
- connect(pref_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(pref_dialog, &PreferencesDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
saveWindowGeometry(); // Save in case the layout panes are rearranged
pref_dialog->setPane(module_name);
@@ -2494,7 +2543,7 @@ void WiresharkMainWindow::connectViewMenuActions()
[this]() { showColoringRulesDialog(); });
connect(main_ui_->actionViewColorizeResetColorization, &QAction::triggered, this, [this]() {
- gchar *err_msg = NULL;
+ char *err_msg = NULL;
if (!color_filters_reset_tmp(&err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
@@ -2509,6 +2558,10 @@ void WiresharkMainWindow::connectViewMenuActions()
connect(main_ui_->actionViewResetLayout, &QAction::triggered, this, [this]() {
recent.gui_geometry_main_upper_pane = 0;
recent.gui_geometry_main_lower_pane = 0;
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_master_split = NULL;
+ recent.gui_geometry_main_extra_split = NULL;
applyRecentPaneGeometry();
});
@@ -2592,7 +2645,7 @@ void WiresharkMainWindow::showHideMainWidgets(QAction *action)
if (widget == toolbar) {
GList *entry = g_list_find_custom(recent.interface_toolbars, action->text().toUtf8(), (GCompareFunc)strcmp);
if (show && !entry) {
- recent.interface_toolbars = g_list_append(recent.interface_toolbars, g_strdup(action->text().toUtf8().constData()));
+ recent.interface_toolbars = g_list_append(recent.interface_toolbars, qstring_strdup(action->text()));
} else if (!show && entry) {
recent.interface_toolbars = g_list_remove(recent.interface_toolbars, entry->data);
}
@@ -2691,9 +2744,9 @@ void WiresharkMainWindow::editResolvedName()
void WiresharkMainWindow::setNameResolution()
{
- gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? TRUE : FALSE;
- gbl_resolv_flags.network_name = main_ui_->actionViewNameResolutionNetwork->isChecked() ? TRUE : FALSE;
- gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? TRUE : FALSE;
+ gbl_resolv_flags.mac_name = main_ui_->actionViewNameResolutionPhysical->isChecked() ? true : false;
+ gbl_resolv_flags.network_name = main_ui_->actionViewNameResolutionNetwork->isChecked() ? true : false;
+ gbl_resolv_flags.transport_name = main_ui_->actionViewNameResolutionTransport->isChecked() ? true : false;
if (packet_list_) {
packet_list_->resetColumns();
@@ -2727,8 +2780,8 @@ void WiresharkMainWindow::colorizeConversation(bool create_rule)
if (capture_file_.capFile() && selectedRows().count() > 0) {
packet_info *pi = capture_file_.packetInfo();
- guint8 cc_num = colorize_action->data().toUInt();
- gchar *filter = conversation_filter_from_packet(pi);
+ uint8_t cc_num = colorize_action->data().toUInt();
+ char *filter = conversation_filter_from_packet(pi);
if (filter == NULL) {
mainApp->pushStatus(WiresharkApplication::TemporaryStatus, tr("Unable to build conversation filter."));
return;
@@ -2742,8 +2795,8 @@ void WiresharkMainWindow::colorizeConversation(bool create_rule)
this, &WiresharkMainWindow::filterAction);
coloring_rules_dialog.exec();
} else {
- gchar *err_msg = NULL;
- if (!color_filters_set_tmp(cc_num, filter, FALSE, &err_msg)) {
+ char *err_msg = NULL;
+ if (!color_filters_set_tmp(cc_num, filter, false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
@@ -2779,8 +2832,8 @@ void WiresharkMainWindow::colorizeWithFilter(QByteArray filter, int color_number
if (color_number > 0) {
// Assume "Color X"
- gchar *err_msg = NULL;
- if (!color_filters_set_tmp(color_number, filter.constData(), FALSE, &err_msg)) {
+ char *err_msg = NULL;
+ if (!color_filters_set_tmp(color_number, filter.constData(), false, &err_msg)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_msg);
g_free(err_msg);
}
@@ -2803,7 +2856,7 @@ void WiresharkMainWindow::openPacketDialog(bool from_reference)
/* Find the frame for which we're popping up a dialog */
if (from_reference) {
- guint32 framenum = fvalue_get_uinteger(capture_file_.capFile()->finfo_selected->value);
+ uint32_t framenum = fvalue_get_uinteger(capture_file_.capFile()->finfo_selected->value);
if (framenum == 0)
return;
@@ -2929,9 +2982,9 @@ void WiresharkMainWindow::connectGoMenuActions()
}
void WiresharkMainWindow::goToConversationFrame(bool go_next) {
- gchar *filter = NULL;
+ char *filter = NULL;
dfilter_t *dfcode = NULL;
- gboolean found_packet = FALSE;
+ bool found_packet = false;
packet_info *pi = capture_file_.packetInfo();
if (!pi) {
@@ -2985,7 +3038,7 @@ void WiresharkMainWindow::connectCaptureMenuActions()
#ifdef HAVE_LIBPCAP
connect(main_ui_->actionCaptureRestart, &QAction::triggered, this, [this]() {
QString before_what(tr(" before restarting the capture"));
- cap_session_.capture_opts->restart = TRUE;
+ cap_session_.capture_opts->restart = true;
if (!testCaptureFileClose(before_what, Restart)) {
return;
}
@@ -3061,13 +3114,13 @@ void WiresharkMainWindow::startCaptureTriggered()
// /*
// * There's an options dialog; get the values from it and close it.
// */
-// gboolean success;
+// bool success;
// /* Determine if "capture start" while building of the "capture options" window */
// /* is in progress. If so, ignore the "capture start. */
// /* XXX: Would it be better/cleaner for the "capture options" window code to */
// /* disable the capture start button temporarily ? */
-// if (cap_open_complete == FALSE) {
+// if (cap_open_complete == false) {
// return; /* Building options window: ignore "capture start" */
// }
// success = capture_dlg_prep(cap_open_w);
@@ -3110,14 +3163,10 @@ void WiresharkMainWindow::connectAnalyzeMenuActions()
});
connect(main_ui_->actionAnalyzeDisplayFilterMacros, &QAction::triggered, this, [=]() {
- struct epan_uat* dfm_uat;
- dfilter_macro_get_uat(&dfm_uat);
- UatDialog *uat_dlg = new UatDialog(parentWidget(), dfm_uat);
- connect(uat_dlg, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
-
- uat_dlg->setWindowModality(Qt::ApplicationModal);
- uat_dlg->setAttribute(Qt::WA_DeleteOnClose);
- uat_dlg->show();
+ FilterDialog *display_filter_dlg = new FilterDialog(window(), FilterDialog::DisplayMacro);
+ display_filter_dlg->setWindowModality(Qt::ApplicationModal);
+ display_filter_dlg->setAttribute(Qt::WA_DeleteOnClose);
+ display_filter_dlg->show();
});
connect(main_ui_->actionDisplayFilterExpression, &QAction::triggered, this, [=]() {
@@ -3133,7 +3182,7 @@ void WiresharkMainWindow::connectAnalyzeMenuActions()
connect(main_ui_->actionAnalyzeEnabledProtocols, &QAction::triggered, this, [=]() {
EnabledProtocolsDialog *enable_proto_dialog = new EnabledProtocolsDialog(this);
- connect(enable_proto_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(enable_proto_dialog, &EnabledProtocolsDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
enable_proto_dialog->setWindowModality(Qt::ApplicationModal);
enable_proto_dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -3145,7 +3194,7 @@ void WiresharkMainWindow::connectAnalyzeMenuActions()
bool create_new = da_action && da_action->property("create_new").toBool();
DecodeAsDialog *da_dialog = new DecodeAsDialog(this, capture_file_.capFile(), create_new);
- connect(da_dialog, SIGNAL(destroyed(QObject*)), mainApp, SLOT(flushAppSignals()));
+ connect(da_dialog, &DecodeAsDialog::destroyed, mainApp, &MainApplication::flushAppSignals);
da_dialog->setWindowModality(Qt::ApplicationModal);
da_dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -3209,7 +3258,7 @@ void WiresharkMainWindow::matchFieldFilter(FilterAction::Action action, FilterAc
void WiresharkMainWindow::applyFieldAsColumn()
{
if (capture_file_.capFile() != 0 && capture_file_.capFile()->finfo_selected != 0) {
- header_field_info *hfinfo = capture_file_.capFile()->finfo_selected->hfinfo;
+ const header_field_info *hfinfo = capture_file_.capFile()->finfo_selected->hfinfo;
int col = column_prefs_has_custom(hfinfo->abbrev);
if (col == -1) {
insertColumn(hfinfo->name, hfinfo->abbrev);
@@ -3224,7 +3273,7 @@ void WiresharkMainWindow::applyFieldAsColumn()
if (!get_column_visible(col)) {
packet_list_->setColumnHidden(col, false);
- set_column_visible(col, TRUE);
+ set_column_visible(col, true);
prefs_main_write();
}
}
@@ -3261,10 +3310,10 @@ void WiresharkMainWindow::applyExportObject()
export_dialog->show();
}
-void WiresharkMainWindow::openFollowStreamDialog(int proto_id, guint stream_num, guint sub_stream_num, bool use_stream_index) {
+void WiresharkMainWindow::openFollowStreamDialog(int proto_id, unsigned stream_num, unsigned sub_stream_num, bool use_stream_index) {
FollowStreamDialog *fsd = new FollowStreamDialog(*this, capture_file_, proto_id);
- connect(fsd, SIGNAL(updateFilter(QString, bool)), this, SLOT(filterPackets(QString, bool)));
- connect(fsd, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
+ connect(fsd, &FollowStreamDialog::updateFilter, this, &WiresharkMainWindow::filterPackets);
+ connect(fsd, &FollowStreamDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
fsd->addCodecs(text_codec_map_);
fsd->show();
if (use_stream_index) {
@@ -3283,10 +3332,8 @@ void WiresharkMainWindow::openFollowStreamDialog(int proto_id) {
void WiresharkMainWindow::openSCTPAllAssocsDialog()
{
SCTPAllAssocsDialog *sctp_dialog = new SCTPAllAssocsDialog(this, capture_file_.capFile());
- connect(sctp_dialog, SIGNAL(filterPackets(QString, bool)),
- this, SLOT(filterPackets(QString, bool)));
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- sctp_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(sctp_dialog, &SCTPAllAssocsDialog::filterPackets, this, &WiresharkMainWindow::filterPackets);
+ connect(this, &WiresharkMainWindow::setCaptureFile, sctp_dialog, &SCTPAllAssocsDialog::setCaptureFile);
sctp_dialog->fillTable();
if (sctp_dialog->isMinimized() == true)
@@ -3314,8 +3361,7 @@ void WiresharkMainWindow::on_actionSCTPAnalyseThisAssociation_triggered()
return;
}
SCTPAssocAnalyseDialog *sctp_analyse = new SCTPAssocAnalyseDialog(this, assoc, capture_file_.capFile());
- connect(sctp_analyse, SIGNAL(filterPackets(QString, bool)),
- this, SLOT(filterPackets(QString, bool)));
+ connect(sctp_analyse, &SCTPAssocAnalyseDialog::filterPackets, this, &WiresharkMainWindow::filterPackets);
if (sctp_analyse->isMinimized() == true)
{
@@ -3344,9 +3390,8 @@ void WiresharkMainWindow::on_actionSCTPFilterThisAssociation_triggered()
void WiresharkMainWindow::statCommandWlanStatistics(const char *arg, void *)
{
WlanStatisticsDialog *wlan_stats_dlg = new WlanStatisticsDialog(*this, capture_file_, arg);
- connect(wlan_stats_dlg, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
wlan_stats_dlg->show();
+ connect(wlan_stats_dlg, &WlanStatisticsDialog::filterAction, this, &WiresharkMainWindow::filterAction);
}
// -z expert
@@ -3355,10 +3400,9 @@ void WiresharkMainWindow::statCommandExpertInfo(const char *, void *)
const DisplayFilterEdit *df_edit = dynamic_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
ExpertInfoDialog *expert_dialog = new ExpertInfoDialog(*this, capture_file_, df_edit->text());
- connect(expert_dialog->getExpertInfoView(), SIGNAL(goToPacket(int, int)),
- packet_list_, SLOT(goToPacket(int, int)));
- connect(expert_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(expert_dialog->getExpertInfoView(), &ExpertInfoTreeView::goToPacket,
+ this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(expert_dialog, &ExpertInfoDialog::filterAction, this, &WiresharkMainWindow::filterAction);
expert_dialog->show();
}
@@ -3372,8 +3416,8 @@ void WiresharkMainWindow::connectStatisticsMenuActions()
{
connect(main_ui_->actionStatisticsCaptureFileProperties, &QAction::triggered, this, [=]() {
CaptureFilePropertiesDialog *capture_file_properties_dialog = new CaptureFilePropertiesDialog(*this, capture_file_);
- connect(capture_file_properties_dialog, SIGNAL(captureCommentChanged()),
- this, SLOT(updateForUnsavedChanges()));
+ connect(capture_file_properties_dialog, &CaptureFilePropertiesDialog::captureCommentChanged,
+ this, &WiresharkMainWindow::updateForUnsavedChanges);
capture_file_properties_dialog->show();
});
@@ -3381,8 +3425,7 @@ void WiresharkMainWindow::connectStatisticsMenuActions()
connect(main_ui_->actionStatisticsProtocolHierarchy, &QAction::triggered, this, [=]() {
ProtocolHierarchyDialog *phd = new ProtocolHierarchyDialog(*this, capture_file_);
- connect(phd, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(phd, &ProtocolHierarchyDialog::filterAction, this, &WiresharkMainWindow::filterAction);
phd->show();
});
@@ -3400,6 +3443,7 @@ void WiresharkMainWindow::connectStatisticsMenuActions()
connect(main_ui_->actionStatisticsCollectd, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("collectd"); });
connect(main_ui_->actionStatisticsDNS, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("dns"); });
+ connect(main_ui_->actionStatisticsDNS_QR, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("dns_qr"); });
connect(main_ui_->actionStatisticsHART_IP, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("hart_ip"); });
connect(main_ui_->actionStatisticsHpfeeds, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("hpfeeds"); });
connect(main_ui_->actionStatisticsHTTP2, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("http2"); });
@@ -3451,28 +3495,22 @@ void WiresharkMainWindow::connectStatisticsMenuActions()
connect(main_ui_->actionStatistics29WestUIM_Streams, &QAction::triggered, this, [=]() {
LBMStreamDialog *stream_dialog = new LBMStreamDialog(this, capture_file_.capFile());
- // connect(stream_dialog, SIGNAL(goToPacket(int)),
- // packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- stream_dialog, SLOT(setCaptureFile(capture_file*)));
+ // connect(stream_dialog, &LBMStreamDialog::goToPacket, packet_list_, &PacketList::goToPacket);
+ connect(this, &WiresharkMainWindow::setCaptureFile, stream_dialog, &LBMStreamDialog::setCaptureFile);
stream_dialog->show();
});
connect(main_ui_->actionStatistics29WestLBTRM, &QAction::triggered, this, [=]() {
LBMLBTRMTransportDialog * lbtrm_dialog = new LBMLBTRMTransportDialog(this, capture_file_.capFile());
- connect(lbtrm_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- lbtrm_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(lbtrm_dialog, &LBMLBTRMTransportDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(this, &WiresharkMainWindow::setCaptureFile, lbtrm_dialog, &LBMLBTRMTransportDialog::setCaptureFile);
lbtrm_dialog->show();
});
connect(main_ui_->actionStatistics29WestLBTRU, &QAction::triggered, this, [=]() {
LBMLBTRUTransportDialog * lbtru_dialog = new LBMLBTRUTransportDialog(this, capture_file_.capFile());
- connect(lbtru_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- lbtru_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(lbtru_dialog, &LBMLBTRUTransportDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(this, &WiresharkMainWindow::setCaptureFile, lbtru_dialog, &LBMLBTRUTransportDialog::setCaptureFile);
lbtru_dialog->show();
});
@@ -3505,10 +3543,8 @@ void WiresharkMainWindow::connectStatisticsMenuActions()
void WiresharkMainWindow::openTcpStreamDialog(int graph_type)
{
TCPStreamDialog *stream_dialog = new TCPStreamDialog(this, capture_file_.capFile(), (tcp_graph_type)graph_type);
- connect(stream_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(setCaptureFile(capture_file*)),
- stream_dialog, SLOT(setCaptureFile(capture_file*)));
+ connect(stream_dialog, &TCPStreamDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(this, &WiresharkMainWindow::setCaptureFile, stream_dialog, &TCPStreamDialog::setCaptureFile);
if (stream_dialog->result() == QDialog::Accepted) {
stream_dialog->show();
}
@@ -3518,31 +3554,68 @@ void WiresharkMainWindow::openTcpStreamDialog(int graph_type)
void WiresharkMainWindow::statCommandMulticastStatistics(const char *arg, void *)
{
MulticastStatisticsDialog *mcast_stats_dlg = new MulticastStatisticsDialog(*this, capture_file_, arg);
- connect(mcast_stats_dlg, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(mcast_stats_dlg, &MulticastStatisticsDialog::filterAction, this, &WiresharkMainWindow::filterAction);
mcast_stats_dlg->show();
}
-void WiresharkMainWindow::openStatisticsTreeDialog(const gchar *abbr)
+void WiresharkMainWindow::openStatisticsTreeDialog(const char *abbr)
{
StatsTreeDialog *st_dialog = new StatsTreeDialog(*this, capture_file_, abbr);
-// connect(st_dialog, SIGNAL(goToPacket(int)),
-// packet_list_, SLOT(goToPacket(int)));
+// connect(st_dialog, &StatsTreeDialog::goToPacket, packet_list_, &PacketList::goToPacket);
st_dialog->show();
}
// -z io,stat
void WiresharkMainWindow::statCommandIOGraph(const char *, void *)
{
+ showIOGraphDialog(IOG_ITEM_UNIT_PACKETS, QString());
+}
+
+void WiresharkMainWindow::showIOGraphDialog(io_graph_item_unit_t value_units, QString yfield)
+{
const DisplayFilterEdit *df_edit = qobject_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit());
+ IOGraphDialog *iog_dialog = nullptr;
QString displayFilter;
if (df_edit)
displayFilter = df_edit->text();
- IOGraphDialog *iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter);
- connect(iog_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
- connect(this, SIGNAL(reloadFields()), iog_dialog, SLOT(reloadFields()));
- iog_dialog->show();
+ if (!yfield.isEmpty()) {
+ QList<IOGraphDialog *> iographdialogs = findChildren<IOGraphDialog *>();
+ // GeometryStateDialogs aren't parented on Linux and Windows
+ // (see geometry_state_dialog.h), so we search for an
+ // I/O Dialog in all the top level widgets.
+ if (iographdialogs.isEmpty()) {
+ foreach(QWidget *topLevelWidget, mainApp->topLevelWidgets()) {
+ if (qobject_cast<IOGraphDialog*>(topLevelWidget)) {
+ iographdialogs << qobject_cast<IOGraphDialog*>(topLevelWidget);
+ }
+ }
+ }
+ bool iog_found = false;
+ foreach(iog_dialog, iographdialogs) {
+ if (!iog_dialog->fileClosed()) {
+ iog_found = true;
+ iog_dialog->addGraph(true, displayFilter, value_units, yfield);
+ break;
+ }
+ }
+ if (!iog_found) {
+ iog_dialog = nullptr;
+ }
+ }
+
+ if (iog_dialog == nullptr) {
+ iog_dialog = new IOGraphDialog(*this, capture_file_, displayFilter, value_units, yfield);
+ connect(iog_dialog, &IOGraphDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(this, &WiresharkMainWindow::reloadFields, iog_dialog, &IOGraphDialog::reloadFields);
+ }
+ if (iog_dialog->isMinimized()) {
+ iog_dialog->showNormal();
+ } else {
+ iog_dialog->show();
+ }
+ iog_dialog->raise();
+ iog_dialog->activateWindow();
}
// Telephony Menu
@@ -3570,7 +3643,7 @@ void WiresharkMainWindow::connectTelephonyMenuActions()
connect(main_ui_->actionTelephonyLteMacStatistics, &QAction::triggered, this, [=]() { statCommandLteMacStatistics(NULL, NULL); });
connect(main_ui_->actionTelephonyLteRlcGraph, &QAction::triggered, this, [=]() {
// We don't yet know the channel.
- launchRLCGraph(false, 0, 0, 0, 0, 0);
+ launchRLCGraph(false, RLC_RAT_LTE, 0, 0, 0, 0, 0);
});
connect(main_ui_->actionTelephonyLteRlcStatistics, &QAction::triggered, this, [=]() { statCommandLteRlcStatistics(NULL, NULL); });
@@ -3595,6 +3668,8 @@ void WiresharkMainWindow::connectTelephonyMenuActions()
connect(main_ui_->actionTelephonyNGAPMessages, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("ngap"); });
+ connect(main_ui_->actionTelephonyE2APMessages, &QAction::triggered, this, [=]() { openStatisticsTreeDialog("e2ap"); });
+
connect(main_ui_->actionTelephonySipFlows, &QAction::triggered, this, [=]() {
VoipCallsDialog *dialog = VoipCallsDialog::openVoipCallsDialogSip(*this, capture_file_, packet_list_);
dialog->show();
@@ -3626,38 +3701,35 @@ RtpAnalysisDialog *WiresharkMainWindow::openTelephonyRtpAnalysisDialog()
return dialog;
}
-// -z mac-lte,stat
+// -z mac-3gpp,stat
void WiresharkMainWindow::statCommandLteMacStatistics(const char *arg, void *)
{
LteMacStatisticsDialog *lte_mac_stats_dlg = new LteMacStatisticsDialog(*this, capture_file_, arg);
- connect(lte_mac_stats_dlg, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(lte_mac_stats_dlg, &LteMacStatisticsDialog::filterAction, this, &WiresharkMainWindow::filterAction);
lte_mac_stats_dlg->show();
}
void WiresharkMainWindow::statCommandLteRlcStatistics(const char *arg, void *)
{
LteRlcStatisticsDialog *lte_rlc_stats_dlg = new LteRlcStatisticsDialog(*this, capture_file_, arg);
- connect(lte_rlc_stats_dlg, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
+ connect(lte_rlc_stats_dlg, &LteRlcStatisticsDialog::filterAction, this, &WiresharkMainWindow::filterAction);
// N.B. It is necessary for the RLC Statistics window to launch the RLC graph in this way, to ensure
// that the goToPacket() signal/slot connection gets set up...
- connect(lte_rlc_stats_dlg, SIGNAL(launchRLCGraph(bool, guint16, guint8, guint16, guint16, guint8)),
- this, SLOT(launchRLCGraph(bool, guint16, guint8, guint16, guint16, guint8)));
+ connect(lte_rlc_stats_dlg, &LteRlcStatisticsDialog::launchRLCGraph, this, &WiresharkMainWindow::launchRLCGraph);
lte_rlc_stats_dlg->show();
}
void WiresharkMainWindow::launchRLCGraph(bool channelKnown,
- guint16 ueid, guint8 rlcMode,
- guint16 channelType, guint16 channelId, guint8 direction)
+ uint8_t RAT, uint16_t ueid, uint8_t rlcMode,
+ uint16_t channelType, uint16_t channelId, uint8_t direction)
{
LteRlcGraphDialog *lrg_dialog = new LteRlcGraphDialog(*this, capture_file_, channelKnown);
- connect(lrg_dialog, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
+ connect(lrg_dialog, &LteRlcGraphDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
// This is a bit messy, but wanted to hide these parameters from users of
// on_actionTelephonyLteRlcGraph_triggered().
if (channelKnown) {
- lrg_dialog->setChannelInfo(ueid, rlcMode, channelType, channelId, direction);
+ lrg_dialog->setChannelInfo(RAT, ueid, rlcMode, channelType, channelId, direction);
}
lrg_dialog->show();
}
@@ -3724,28 +3796,27 @@ void WiresharkMainWindow::connectWirelessMenuActions()
{
connect(main_ui_->actionBluetoothATT_Server_Attributes, &QAction::triggered, this, [=]() {
BluetoothAttServerAttributesDialog *bluetooth_att_sever_attributes_dialog = new BluetoothAttServerAttributesDialog(*this, capture_file_);
- connect(bluetooth_att_sever_attributes_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(bluetooth_att_sever_attributes_dialog, SIGNAL(updateFilter(QString, bool)),
- this, SLOT(filterPackets(QString, bool)));
+ connect(bluetooth_att_sever_attributes_dialog, &BluetoothAttServerAttributesDialog::goToPacket,
+ this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(bluetooth_att_sever_attributes_dialog, &BluetoothAttServerAttributesDialog::updateFilter,
+ this, &WiresharkMainWindow::filterPackets);
bluetooth_att_sever_attributes_dialog->show();
});
connect(main_ui_->actionBluetoothDevices, &QAction::triggered, this, [=]() {
BluetoothDevicesDialog *bluetooth_devices_dialog = new BluetoothDevicesDialog(*this, capture_file_, packet_list_);
- connect(bluetooth_devices_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(bluetooth_devices_dialog, SIGNAL(updateFilter(QString, bool)),
- this, SLOT(filterPackets(QString, bool)));
+ connect(bluetooth_devices_dialog, &BluetoothDevicesDialog::goToPacket, this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(bluetooth_devices_dialog, &BluetoothDevicesDialog::updateFilter,
+ this, &WiresharkMainWindow::filterPackets);
bluetooth_devices_dialog->show();
});
connect(main_ui_->actionBluetoothHCI_Summary, &QAction::triggered, this, [=]() {
BluetoothHciSummaryDialog *bluetooth_hci_summary_dialog = new BluetoothHciSummaryDialog(*this, capture_file_);
- connect(bluetooth_hci_summary_dialog, SIGNAL(goToPacket(int)),
- packet_list_, SLOT(goToPacket(int)));
- connect(bluetooth_hci_summary_dialog, SIGNAL(updateFilter(QString, bool)),
- this, SLOT(filterPackets(QString, bool)));
+ connect(bluetooth_hci_summary_dialog, &BluetoothHciSummaryDialog::goToPacket,
+ this, [=](int packet_num) {packet_list_->goToPacket(packet_num);});
+ connect(bluetooth_hci_summary_dialog, &BluetoothHciSummaryDialog::updateFilter,
+ this, &WiresharkMainWindow::filterPackets);
bluetooth_hci_summary_dialog->show();
});
@@ -3824,7 +3895,7 @@ void WiresharkMainWindow::checkForUpdates()
void WiresharkMainWindow::setPreviousFocus() {
previous_focus_ = mainApp->focusWidget();
if (previous_focus_ != nullptr) {
- connect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
+ connect(previous_focus_, &QWidget::destroyed, this, &WiresharkMainWindow::resetPreviousFocus);
}
}
@@ -3836,7 +3907,7 @@ void WiresharkMainWindow::goToCancelClicked()
{
main_ui_->goToFrame->animatedHide();
if (previous_focus_) {
- disconnect(previous_focus_, SIGNAL(destroyed()), this, SLOT(resetPreviousFocus()));
+ disconnect(previous_focus_, &QWidget::destroyed, this, &WiresharkMainWindow::resetPreviousFocus);
previous_focus_->setFocus();
resetPreviousFocus();
}
@@ -3871,24 +3942,23 @@ void WiresharkMainWindow::showResolvedAddressesDialog()
void WiresharkMainWindow::showConversationsDialog()
{
ConversationDialog *conv_dialog = new ConversationDialog(*this, capture_file_);
- connect(conv_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(conv_dialog, SIGNAL(openFollowStreamDialog(int, guint, guint)),
- this, SLOT(openFollowStreamDialog(int, guint, guint)));
- connect(conv_dialog, SIGNAL(openTcpStreamGraph(int)),
- this, SLOT(openTcpStreamDialog(int)));
+ connect(conv_dialog, &ConversationDialog::filterAction, this, &WiresharkMainWindow::filterAction);
+ connect(conv_dialog, &ConversationDialog::openFollowStreamDialog, this,
+ [=](int proto_id, unsigned stream_num, unsigned sub_stream_num) {
+ openFollowStreamDialog(proto_id, stream_num, sub_stream_num);
+ });
+ connect(conv_dialog, &ConversationDialog::openTcpStreamGraph, this, &WiresharkMainWindow::openTcpStreamDialog);
conv_dialog->show();
}
void WiresharkMainWindow::showEndpointsDialog()
{
EndpointDialog *endp_dialog = new EndpointDialog(*this, capture_file_);
- connect(endp_dialog, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)),
- this, SIGNAL(filterAction(QString, FilterAction::Action, FilterAction::ActionType)));
- connect(endp_dialog, SIGNAL(openFollowStreamDialog(int)),
- this, SLOT(openFollowStreamDialog(int)));
- connect(endp_dialog, SIGNAL(openTcpStreamGraph(int)),
- this, SLOT(openTcpStreamDialog(int)));
+ connect(endp_dialog, &EndpointDialog::filterAction, this, &WiresharkMainWindow::filterAction);
+ connect(endp_dialog, &EndpointDialog::openFollowStreamDialog, this,
+ [=](int proto_id) {openFollowStreamDialog(proto_id);
+ });
+ connect(endp_dialog, &EndpointDialog::openTcpStreamGraph, this, &WiresharkMainWindow::openTcpStreamDialog);
endp_dialog->show();
}
@@ -3906,9 +3976,9 @@ void WiresharkMainWindow::externalMenuItemTriggered()
entry = (ext_menubar_t *)v.value<void *>();
if (entry->type == EXT_MENUBAR_ITEM) {
- entry->callback(EXT_MENUBAR_QT_GUI, (gpointer)((void *)main_ui_), entry->user_data);
+ entry->callback(EXT_MENUBAR_QT_GUI, (void *)((void *)main_ui_), entry->user_data);
} else {
- QDesktopServices::openUrl(QUrl(QString((gchar *)entry->user_data)));
+ QDesktopServices::openUrl(QUrl(QString((char *)entry->user_data)));
}
}
}
@@ -3932,15 +4002,11 @@ void WiresharkMainWindow::showExtcapOptionsDialog(QString &device_name, bool sta
if (extcap_options_dialog) {
extcap_options_dialog->setModal(true);
extcap_options_dialog->setAttribute(Qt::WA_DeleteOnClose);
- if (startCaptureOnClose) {
- connect(extcap_options_dialog, SIGNAL(finished(int)),
- this, SLOT(extcap_options_finished(int)));
- }
+ connect(extcap_options_dialog, &ExtcapOptionsDialog::finished, this, &WiresharkMainWindow::extcap_options_finished);
#ifdef HAVE_LIBPCAP
- if (capture_options_dialog_ && startCaptureOnClose) {
+ if (capture_options_dialog_) {
/* Allow capture options dialog to close */
- connect(extcap_options_dialog, SIGNAL(accepted()),
- capture_options_dialog_, SLOT(accept()));
+ connect(extcap_options_dialog, &ExtcapOptionsDialog::accepted, capture_options_dialog_, &CaptureOptionsDialog::accept);
}
#endif
extcap_options_dialog->show();
diff --git a/ui/qt/wireshark_pl.ts b/ui/qt/wireshark_pl.ts
index 65abbd71..530878c0 100644
--- a/ui/qt/wireshark_pl.ts
+++ b/ui/qt/wireshark_pl.ts
@@ -21,7 +21,7 @@
</message>
<message>
<source>&lt;span size=\&quot;x-large\&quot; weight=\&quot;bold\&quot;&gt;Network Protocol Analyzer&lt;/span&gt;</source>
- <translation>&lt;span size=\&quot;x-large\&quot; weight=\&quot;bold\&quot;&gt;Analizator protokołów sieciowych&lt;/span&gt;</translation>
+ <translation>&lt;span size=\&quot;x-large\&quot; weight=\&quot;bold\&quot;&gt;Analizator Protokołów&lt;/span&gt;</translation>
</message>
<message>
<source>Copy the version information to the clipboard</source>
@@ -44,8 +44,8 @@
<translation>Foldery</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Filtruj po ścieżce</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Licencja</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>O Logray</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Katalog nie istnieje.</translation>
</message>
@@ -109,10 +117,10 @@
</message>
<message numerus="yes">
<source>Copy Row(s)</source>
- <translation>
- <numerusform>Kopiuj wiersz</numerusform>
- <numerusform>Kopiuj wiersze</numerusform>
- <numerusform>Kopiuj wiersze</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
</context>
@@ -137,7 +145,7 @@
</message>
<message>
<source>Can&apos;t assign %1 to %2.</source>
- <translation>Nie można przypisać %1 do %2.</translation>
+ <translation>Nie można przypisać %1 do %2</translation>
</message>
</context>
<context>
@@ -756,6 +764,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>Edytuj komentarze przechwytywania</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>Dodaj komentarz</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>Sekcja %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>Komentarz %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -812,32 +842,6 @@
<source>Automatically detect file type</source>
<translation>Automatycznie wykryj typ pliku</translation>
</message>
- <message numerus="yes">
- <source>%1, error after %Ln packet(s)</source>
- <oldsource>%1, error after %2 packets</oldsource>
- <translation type="vanished">
- <numerusform>%1, błąd po wczytaniu %Ln pakiet</numerusform>
- <numerusform>%1, błąd po wczytaniu %Ln pakietów</numerusform>
- <numerusform>%1, błąd po wczytaniu %Ln pakietów</numerusform>
- </translation>
- </message>
- <message numerus="yes">
- <source>%1, timed out at %Ln packet(s)</source>
- <oldsource>%1, timed out at %2 packets</oldsource>
- <translation type="vanished">
- <numerusform>%1, przekroczenie czasu przy %Ln pakiecie</numerusform>
- <numerusform>%1, przekroczenie czasu przy %Ln pakiecie</numerusform>
- <numerusform>%1, przekroczenie czasu przy %Ln pakiecie</numerusform>
- </translation>
- </message>
- <message numerus="yes">
- <source>%1, %Ln packet(s)</source>
- <translation type="vanished">
- <numerusform>%1, %Ln pakiet</numerusform>
- <numerusform>%1, %Ln pakiety</numerusform>
- <numerusform>%1, %Ln pakietów</numerusform>
- </translation>
- </message>
<message>
<source>Prepend packets</source>
<translation>Dodaj pakiety na początku</translation>
@@ -867,10 +871,6 @@
<translation>Filtr wczytywania:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Kompresuj używając gzip</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Otwórz plik przechwytywania</translation>
@@ -921,26 +921,26 @@
<message numerus="yes">
<source>%1, error after %Ln data record(s)</source>
<oldsource>%1, error after %Ln record(s)</oldsource>
- <translation>
- <numerusform>%1, błąd po wczytaniu %Ln pakietu</numerusform>
- <numerusform>%1, błąd po wczytaniu %Ln pakietów</numerusform>
- <numerusform>%1, błąd po wczytaniu %Ln pakietów</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%1, timed out at %Ln data record(s)</source>
- <translation>
- <numerusform>%1, przekroczono limit czasu dla %Ln rekordu danych</numerusform>
- <numerusform>%1, przekroczono limit czasu dla %Ln rekordów danych</numerusform>
- <numerusform>%1, przekroczono limit czasu dla %Ln rekordów danych</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%1, %Ln data record(s)</source>
- <translation>
- <numerusform>%1, %Ln rekord danych</numerusform>
- <numerusform>%1, %Ln rekordy danych</numerusform>
- <numerusform>%1, %Ln rekordów danych</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -955,8 +955,8 @@
<translation>Szczegóły</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Komentarze pliku przechwytywania</translation>
+ <source>Edit Comments</source>
+ <translation>Edytuj komentarze</translation>
</message>
<message>
<source>Refresh</source>
@@ -967,10 +967,6 @@
<translation>Skopiuj do schowka</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Zapisz komentarze</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Szczegóły pliku przechwytywania</translation>
</message>
@@ -1019,10 +1015,18 @@
<translation>Pierwszy pakiet</translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Ostatni pakiet</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Minęło</translation>
</message>
@@ -1059,6 +1063,10 @@
<translation>Porzucone pakiety</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Filtr przechwytywania</translation>
</message>
@@ -1071,6 +1079,10 @@
<translation>Limit rozmiaru pakietu (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>brak</translation>
</message>
@@ -1079,6 +1091,26 @@
<translation>%1 bajtów</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>Komentarze</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>Komentarz %1: </translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>Typ</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>Rozmiar</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Statystyki</translation>
</message>
@@ -1103,6 +1135,10 @@
<translation>Pakiety</translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished">Events</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Okres czasu, s</translation>
</message>
@@ -1115,6 +1151,10 @@
<translation>Średni rozmiar pakietu, B</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Bajty</translation>
</message>
@@ -1127,14 +1167,14 @@
<translation>Średnio bitów/s</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Komentarz sekcji</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Komentarze pakietu</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Ramka %1: </translation>
</message>
@@ -1144,6 +1184,14 @@
</source>
<translation>Stworzony dzięki Wiresharkowi %1</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Stworzony dzięki Logray %1
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1326,7 +1374,7 @@
</message>
<message>
<source>packets</source>
- <translation>pakiety</translation>
+ <translation>pakietów</translation>
</message>
<message>
<source>Switch to the next file after the file size exceeds the specified file size.</source>
@@ -1358,7 +1406,7 @@
</message>
<message>
<source>hours</source>
- <translation>godzinach</translation>
+ <translation>godzin</translation>
</message>
<message>
<source>when time is a multiple of</source>
@@ -1370,6 +1418,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zwykle bezprzewodowa karta sieciowa przechwytuje tylko ruch wysyłany do i z jej własnego adresu sieciowego, i tylko przechwytuje ruch &lt;em&gt;danych użytkownika&lt;/em&gt; z &amp;quot;fałszywymi&amp;quot; ruch nagłówkami Ethernet. Jeśli chcesz przechwytywać cały ruch, który karty sieci bezprzewodowej mogą „widzieć”, lub interesują Cię pakiety zarządzania lub kontroli standardu 802.11 albo informacje warstwy radiowej, zaznacz tę opcję. Dostępność trybu monitorowania zależy od karty bezprzewodowej i sterownika. Więcej szczegółów na temat przechwytywania pakietów w sieciach WLAN można znaleźć na Wiki.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>Włącz tryb monitora na wszystkich interfejsach 802.11</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>kompresja</translation>
</message>
@@ -1382,8 +1438,32 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation>YYYYmmDDHHMMSS_NNNNN</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation>NNNNN_YYYYmmDDHHMMSS</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Kiedy przechwytywanie jest przekierowywane do nowego pliku i liczba plików zostanie przekroczona to skasuj najstarszy plik.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Use a ring buffer with </source>
@@ -1391,7 +1471,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>files</source>
- <translation>pliki</translation>
+ <translation>plików</translation>
</message>
<message>
<source>Options</source>
@@ -1403,7 +1483,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Using this option will show the captured packets immediately on the main screen. Please note: this will slow down capturing, so increased packet drops might appear.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Wybierając tą opcję przechwytywane pakiety będą bezpośrednio wyświetlane na ekranie. Uwaga: to może spowalniać przechwytywanie, co może skutkować możliwością zgubienia pakietów.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Update list of packets in real-time</source>
@@ -1470,6 +1550,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zatrzymaj przechwytywanie po stworzeniu określonej liczby plików.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zatrzymaj przechwytywanie po przekroczeniu ustalonego rozmiaru danych.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1523,15 +1607,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>no addresses</source>
- <translation>brak adresu</translation>
+ <translation>brak adresów</translation>
</message>
<message>
<source>Error</source>
<translation>Błąd</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Wiele plików: Żądana wielkość pliku jest zbyt duża. Wielkość pliku nie może być większa niż 2 GiB.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1539,7 +1623,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Multiple files: No file limit given. You must specify a file size, interval, or number of packets for each file.</source>
- <translation>Wiele plików: bez limitu plików. Dla każdego pliku należy określić rozmiar pliku, interwał lub liczbę pakietów.</translation>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -1561,6 +1645,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Zrzucaj pakiety w trybie mieszanym</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>Przechwytuj pakiety w trybie monitora na urządzeniach 802.11</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zapisuj pakiety w formacie pcap-ng&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1742,7 +1834,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Resolve Names:</source>
- <translation>Rozwiązuj nazwy:</translation>
+ <translation>Rozwiąż nazwy:</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;p&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
@@ -1788,6 +1880,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Rozwiązane</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>Szerokość</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>Wyrównanie</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1835,6 +1935,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1901,6 +2020,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Bitów/sek. B</translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Całkowita liczba pakietów</translation>
</message>
@@ -1921,7 +2044,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Graph…</source>
- <translation>Wykres</translation>
+ <translation>Wykres...</translation>
</message>
<message>
<source>Graph a TCP conversation.</source>
@@ -1947,7 +2070,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Copy entries from another profile.</source>
- <translation>Kopiuj z innego profilu.</translation>
+ <translation>Skopiuj wpisy z innego profilu.</translation>
</message>
<message>
<source>System default</source>
@@ -2008,21 +2131,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>…as Hex Dump</source>
- <translation>…jako Hex Dump</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Copy packet bytes as a hex dump.</source>
<translation>Kopiuj bajty pakietu jako Hex.</translation>
</message>
<message>
- <source>…as Printable Text</source>
- <translation>…drukowalny tekst</translation>
- </message>
- <message>
- <source>Copy only the printable text in the packet.</source>
- <translation>Kopiuj tylko drukowalny tekst z pakietu.</translation>
- </message>
- <message>
<source>…as MIME Data</source>
<translation>…jako dane MIME</translation>
</message>
@@ -2035,8 +2150,40 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>…as Go literal</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>…as a Hex Stream</source>
- <translation>…jako strumień Hex</translation>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Copy packet bytes as a stream of hex.</source>
@@ -2090,7 +2237,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Change behavior when the field matches this value</source>
- <translation type="unfinished"></translation>
+ <translation>Zmień zachowanie, gdy pole odpowiada tej wartości</translation>
</message>
<message>
<source>Field value type (and base, if Integer)</source>
@@ -2168,7 +2315,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Display Filter Expression…</source>
- <translation type="unfinished">Wyrażenie filtru wyświetlania...</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Apply a display filter %1 &lt;%2/&gt;</source>
@@ -2344,7 +2491,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>DissectorTablesProxyModel</name>
<message>
<source>Table Type</source>
- <translation>Typ Tabeli</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>String</source>
@@ -2391,7 +2538,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>in</source>
- <translation>w</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Enable All</source>
@@ -2536,7 +2683,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Save As…</source>
- <translation>Zapisz jako…</translation>
+ <translation>Zapisz jako...</translation>
</message>
<message>
<source>Map file error</source>
@@ -2774,7 +2921,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Only display entries containing this string</source>
- <translation type="unfinished"></translation>
+ <translation>Wyświetlaj tylko wpisy zawierające ten ciąg</translation>
</message>
<message>
<source>Preview</source>
@@ -2834,6 +2981,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Filtr:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2873,10 +3024,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Start</translation>
</message>
<message>
- <source>Save</source>
- <translation>Zapisz</translation>
- </message>
- <message>
<source>Default</source>
<translation>Domyślnie</translation>
</message>
@@ -2933,10 +3080,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message numerus="yes">
<source>%Ln File(s) in Set</source>
<oldsource>%1 File%2 in Set</oldsource>
- <translation>
- <numerusform>%Ln plik w zbiorze</numerusform>
- <numerusform>%Ln pliki w zbiorze</numerusform>
- <numerusform>%Ln plików w zbiorze</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
</context>
@@ -2967,11 +3114,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>FilterAction</name>
<message>
<source>Selected</source>
- <translation>Wybrane</translation>
+ <translation>Wybrany</translation>
</message>
<message>
<source>Not Selected</source>
- <translation>Nie wybrane</translation>
+ <translation>Nie wybrany</translation>
</message>
<message>
<source>…and Selected</source>
@@ -3019,6 +3166,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Filtry wyświetlania</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>Nowe makro</translation>
+ </message>
+ <message>
<source>Open </source>
<translation>Otwórz</translation>
</message>
@@ -3061,7 +3216,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Comment:</source>
- <translation>Komentarz</translation>
+ <translation>Komentarz:</translation>
</message>
<message>
<source>Enter a comment for the filter button</source>
@@ -3102,10 +3257,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>Nazwa makra</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Nazwa filtra</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Wyrażenie filtru</translation>
</message>
@@ -3114,11 +3277,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>FindLineEdit</name>
<message>
<source>Textual Find</source>
- <translation type="unfinished"></translation>
+ <translation>Wyszukiwanie tekstu</translation>
</message>
<message>
<source>Regular Expression Find</source>
- <translation type="unfinished"></translation>
+ <translation>Wyszukiwanie wyrażeniem regularnym</translation>
</message>
</context>
<context>
@@ -3191,22 +3354,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>capture files</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Temp</source>
<translation>Temp</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation type="unfinished"></translation>
</message>
@@ -3215,14 +3366,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Konfiguracja globalna</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>System</source>
<translation type="unfinished"></translation>
</message>
@@ -3235,18 +3378,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>program files</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Wtyczki osobiste</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Globalne wtyczki</translation>
</message>
@@ -3263,11 +3398,35 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Skrypty Lua</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3329,22 +3488,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Print</source>
<translation>Drukuj</translation>
</message>
- <message numerus="yes">
- <source>%Ln client pkt(s), </source>
- <translation type="vanished">
- <numerusform>%Ln pakiet klienta,</numerusform>
- <numerusform>%Ln pakiety klienta,</numerusform>
- <numerusform>%Ln pakietów klienta,</numerusform>
- </translation>
- </message>
- <message numerus="yes">
- <source>%Ln server pkt(s), </source>
- <translation type="vanished">
- <numerusform>%Ln pakiet serwera,</numerusform>
- <numerusform>%Ln pakiety serwera,</numerusform>
- <numerusform>%Ln pakietów serwera,</numerusform>
- </translation>
- </message>
<message>
<source>ASCII</source>
<translation>ASCII</translation>
@@ -3387,26 +3530,46 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;client&lt;/span&gt; pkt(s), </source>
- <translation>
- <numerusform>%Ln pakiet &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;klienta&lt;/span&gt;, </numerusform>
- <numerusform>%Ln pakiety &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;klienta&lt;/span&gt;, </numerusform>
- <numerusform>%Ln pakietów &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;klienta&lt;/span&gt;, </numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;server&lt;/span&gt; pkt(s), </source>
- <translation>
- <numerusform>%Ln pakiet &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;serwera&lt;/span&gt;,</numerusform>
- <numerusform>%Ln pakiety &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;serwera&lt;/span&gt;, </numerusform>
- <numerusform>%Ln pakietów &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;serwera&lt;/span&gt;, </numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%Ln turn(s).</source>
- <translation>
- <numerusform>%Ln próba.</numerusform>
- <numerusform>%Ln próby.</numerusform>
- <numerusform>%Ln prób.</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>Event %1. </source>
+ <translation>Zdarzenie %1.</translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -3442,6 +3605,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Nie znaleziono strumienia %1 w wybranym pakiecie.</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>Aktywność odczytu(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>Aktywność zapisu(%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>Cała aktywność we/wy (%1)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation type="unfinished"></translation>
</message>
@@ -3457,16 +3632,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation>Zapisz zawartość strumienia jako...</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation type="unfinished"></translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
- <translation>
- <numerusform>%Ln strumień.</numerusform>
- <numerusform>%Ln strumienie.</numerusform>
- <numerusform>%Ln strumieni.</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
@@ -3490,9 +3661,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Podpowiedź.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Pokazuj dane jako</translation>
+ <source>Show as</source>
+ <translation>Pokaż jako</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Stream</source>
@@ -3507,11 +3689,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Znajdź:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Rozróżniaj wielkość znaków</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Znajdź &amp;następny</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[Obcięto dane strumienia]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3580,7 +3773,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message>
<source>Sample warning filter</source>
<oldsource>Sample deprecated filter</oldsource>
- <translation>Przykładowy filtr z ostrzeżeniem</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Example GIF query packets have jumbo window sizes</source>
@@ -3840,29 +4033,28 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Usuń ten wykres.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Utwórz nowy wykres.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Duplikuj ten wykres.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Wyczyść wszystkie wykresy.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>Przesuń ten wykres w górę.</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Duplicate the selected graph(s).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation>Przesuń ten wykres w dół.</translation>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Mouse</source>
@@ -3905,10 +4097,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Włącz legendę</translation>
</message>
<message>
- <source>Reset</source>
- <translation>Reset</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Resetuj wykres</translation>
</message>
@@ -4107,7 +4295,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>I/O Graphs</source>
- <translation>Wykresy I/O</translation>
+ <translation>Wykresy we./wy.</translation>
</message>
<message>
<source>Save As…</source>
@@ -4122,6 +4310,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Skopiuj wykresy z innego profilu.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4166,8 +4390,16 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>5 sek.</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10 min {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10 min {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
- <translation>Wireshark wykres we./wy.: %1</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Filtered packets</source>
@@ -4178,6 +4410,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Filtrowane zdarzenia</translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Wszystkie pakiety</translation>
</message>
@@ -4190,8 +4430,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Wszystkie zdarzenia</translation>
</message>
<message>
- <source>Access Denied</source>
- <translation>Brak dostępu</translation>
+ <source>All Execs</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Hover over the graph for details.</source>
@@ -4238,6 +4478,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Kliknij by wybrać obszar wykresu.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Dokument PDF (*.pdf)</translation>
</message>
@@ -4259,7 +4527,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Save Graph As…</source>
- <translation>Zapisz wykres jako...</translation>
+ <translation>Zapisz wykres jako</translation>
</message>
</context>
<context>
@@ -4714,7 +4982,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prefix each frame with an Ethernet and IP header</source>
- <translation>Poprzedź każdą ramkę nagłówkami Ethernet i IPv4</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>IP</source>
@@ -4722,19 +4990,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prefix each frame with an Ethernet, IP and UDP header</source>
- <translation>Poprzedź każdą ramkę nagłówkami Ethernet, IPv4 i UDP</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Prefix each frame with an Ethernet, IP and TCP header</source>
- <translation>Poprzedź każdą ramkę nagłówkami Ethernet, IPv4 i TCP</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Prefix each frame with an Ethernet, IP and SCTP header</source>
- <translation>Poprzedź każdą ramkę nagłówkami Ethernet, IPv4 i SCTP</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Prefix each frame with an Ethernet, IP and SCTP (DATA) header</source>
- <translation>Poprzedź każdą ramkę nagłówkami Ethernet, IPv4 i SCTP (dane)</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Source address:</source>
@@ -4990,6 +5258,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished">domyślny</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5053,7 +5328,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Extcap interface: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Interfejs extcap: %1</translation>
</message>
<message>
<source>No addresses</source>
@@ -5968,8 +6243,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>Statystyki LTE Mac</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation>Statystyki LTE/NR Mac</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6074,7 +6349,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Switch the direction of the connection (view the opposite flow).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zmień kierunek przepływu w połączeniu (przepływ w przeciwnym kierunku).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Zmień kierunek przepływu w połączeni (przepływ przeciwny).
+&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Switch Direction</source>
@@ -6273,12 +6549,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Numer sekwencyjny</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>Wykres LTE RLC (UE=%1 kanał=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>Wykres LTE RLC - brak wybranego kanału</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Save As…</source>
@@ -6332,8 +6608,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>Statystyki LTE RLC</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation>Statystyki 3GPP RLC</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6419,6 +6695,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Profil: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation> %1 Wyświetlanych: %2 (%3%)</translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Zarządzaj profilami...</translation>
</message>
@@ -6475,10 +6755,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message numerus="yes">
<source>%Ln byte(s)</source>
<oldsource>, %1 bytes</oldsource>
- <translation>
- <numerusform>%Ln bajt</numerusform>
- <numerusform>%Ln bajty</numerusform>
- <numerusform>%Ln bajtów</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -6494,9 +6782,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Wybrany pakiet: %1 %2</translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Pakietów: %1 %4 Wyświetlanych: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation>Wybrane zdarzenie: %1 %2</translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation>Zdarzenie: %1</translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6528,6 +6819,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Brak pakietów</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation>Brak zdarzeń</translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>Z pliku ZIP....</translation>
</message>
@@ -6561,6 +6856,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6592,6 +6894,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Ostanio użyty folder</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Pokazuj aż do</translation>
</message>
@@ -6786,7 +7092,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Short Name</source>
- <translation>Krótka Nazwa</translation>
+ <translation>Krótka nazwa</translation>
</message>
<message>
<source>Vendor Name</source>
@@ -7022,6 +7328,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Pokaż wartości pól</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">Odśwież</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Zapisz diagram jako…</translation>
</message>
@@ -7069,6 +7379,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Pokaż bajty pakietu</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation>Wygląd:</translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Pakiet %1</translation>
</message>
@@ -7086,10 +7400,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln byte(s)</source>
- <translation>
- <numerusform>%Ln bajt</numerusform>
- <numerusform>%Ln bajty</numerusform>
- <numerusform>%Ln bajtów</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
</context>
@@ -7512,7 +7834,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>&amp;Print…</source>
- <translation>&amp;Drukuj…</translation>
+ <translation>&amp;Drukuj...</translation>
</message>
<message>
<source>Page &amp;Setup…</source>
@@ -7550,10 +7872,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Kopiuj ten profil.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Konfiguracja profili</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Importuj</translation>
@@ -7573,10 +7907,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln Selected Personal Profile(s)...</source>
- <translation>
- <numerusform>%Ln wybrany profil osobisty...</numerusform>
- <numerusform>%Ln wybrane profile osobiste...</numerusform>
- <numerusform>%Ln wybranych profili osobistych...</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -7603,29 +7937,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Select zip file for export</source>
<translation>Wybierz plik ZIP do wyeksportowania</translation>
</message>
- <message numerus="yes">
- <source>… %Ln selected personal profile(s)</source>
- <translation type="vanished">
- <numerusform>... %Ln wybrany profil osobisty</numerusform>
- <numerusform>... %Ln wybrane profile osobiste</numerusform>
- <numerusform>... %Ln wybranych profili osobistych</numerusform>
- </translation>
- </message>
- <message numerus="yes">
- <source>%Ln selected personal profile(s)</source>
- <translation type="vanished">
- <numerusform>%Ln wybrany profil osobisty</numerusform>
- <numerusform>%Ln wybrane profile osobiste</numerusform>
- <numerusform>%Ln wybranych profili osobistych</numerusform>
- </translation>
- </message>
<message>
<source>An import of profiles is not allowed, while changes are pending</source>
<translation>Import profili nie jest dozwolony, dopóki oczekujące zmiany nie zostaną wprowadzone</translation>
</message>
<message>
<source>An import is pending to be saved. Additional imports are not allowed</source>
- <translation>Import oczekuje na zapisanie. Kolejny import nie jest dozwolony</translation>
+ <translation>Import oczekuje na zapisanie. Dodatkowy import nie jest dozwolony</translation>
</message>
<message>
<source>An export of profiles is only allowed for personal profiles</source>
@@ -7637,10 +7955,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln profile(s) exported</source>
- <translation>
- <numerusform>%Ln profil wyeksportowany</numerusform>
- <numerusform>%Ln profile wyeksportowane</numerusform>
- <numerusform>%Ln profili wyeksportowanych</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -7669,18 +7987,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln profile(s) imported</source>
- <translation>
- <numerusform>%Ln profil zaimportowany</numerusform>
- <numerusform>%Ln profile zaimportowane</numerusform>
- <numerusform>%Ln profili zaimportowanych</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>, %Ln profile(s) skipped</source>
- <translation>
- <numerusform>, %Ln profil pominięto</numerusform>
- <numerusform>, %Ln profile pominięto</numerusform>
- <numerusform>, %Ln profili pominięto</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -7743,6 +8061,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>usunięte</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>kopiuj</translation>
@@ -7785,7 +8107,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Renamed from: %1</source>
- <translation>Przemianowano z %1</translation>
+ <translation>Przemianowano z: %1</translation>
</message>
<message>
<source>Copied from: %1</source>
@@ -7894,7 +8216,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Filter Field Reference</source>
- <translation>Odwołania filtru pola</translation>
+ <translation type="unfinished">Odwołania filtru pola</translation>
</message>
<message>
<source>Copied </source>
@@ -8127,7 +8449,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prepare as Filter</source>
- <translation>Przygotuj jako filtr</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Find</source>
@@ -8266,6 +8588,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Brakujący znacznik?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation>LTE</translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation>NR</translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8286,6 +8616,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation>RAT</translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>Ramki UL</translation>
</message>
@@ -8509,9 +8843,69 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation>Przeglądaj…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished">W lewo</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished">W prawo</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation>CCCH</translation>
@@ -8612,6 +9006,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8727,6 +9128,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Rozwiązane Adresy</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation>Kopiuj</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>Zapisz jako…</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Rozwiązane adresy znalezione w %1</translation>
</message>
@@ -8740,6 +9149,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation>jako zwykły tekst</translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation>Skopiuj wybrane wiersze</translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>Skopiuj tabelę</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation>jako CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation>jako JSON</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation>Zapisz wybrane wiersze jako…</translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation>Zapisz tabelę jako…</translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation>Zapisz rozwiązane adresy jako…</translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation>Zwykły tekst (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation>Dokument CSV (*.csv)</translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation>Dokument JSON (*.json)</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>Ostrzeżenie</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation>Nie można zapisać %1: %2</translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -8961,7 +9425,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source> %1 streams, </source>
- <translation>%1 strumieni,</translation>
+ <translation>%1 strumieni.</translation>
</message>
<message>
<source>Save one stream CSV</source>
@@ -9077,15 +9541,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation>Przygotuj &amp;filtr</translation>
+ <translation>Przygotuj filtr</translation>
</message>
<message>
<source>Prepare a filter matching the selected stream(s).</source>
- <translation>Przygotuj filtr pasujący do wybranego(ych) strumieni.</translation>
+ <translation type="unfinished">Przygotuj filtr dla zaznaczonych strumieni.</translation>
</message>
<message>
<source>&amp;Current Tab</source>
- <translation>&amp;Bieżąca karta</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Prepare a filter matching current tab.</source>
@@ -9360,7 +9824,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Remove Streams</source>
- <translation>Usuń strumienie</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Remove selected streams from the list</source>
@@ -9436,15 +9900,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation>Przygotuj &amp;filtr</translation>
+ <translation type="unfinished">Przygotuj filtr</translation>
</message>
<message>
<source>Prepare a filter matching the selected stream(s).</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Przygotuj filtr dla zaznaczonych strumieni.</translation>
</message>
<message>
<source>R&amp;efresh streams</source>
- <translation>&amp;Odśwież strumienie</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Read captured packets from capture in progress to player</source>
@@ -9500,7 +9964,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Play the stream</source>
- <translation type="unfinished"></translation>
+ <translation>Odtwórz strumień</translation>
</message>
<message>
<source>To Left</source>
@@ -9532,7 +9996,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>&amp;Play Streams</source>
- <translation>&amp;Odtwarzaj strumienie</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Open RTP player dialog</source>
@@ -9564,7 +10028,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>No Audio</source>
- <translation>Brak audio</translation>
+ <translation>Brak Audio</translation>
</message>
<message>
<source>Decoding streams...</source>
@@ -9612,7 +10076,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Playback of stream %1 failed!</source>
- <translation>Odtwarzanie strumienia %1 nie powiodło się!</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Automatic</source>
@@ -9771,7 +10235,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation type="unfinished">Przygotuj &amp;filtr</translation>
+ <translation type="unfinished">Przygotuj filtr</translation>
</message>
<message>
<source>&amp;Export</source>
@@ -9951,7 +10415,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Save RTPDump As…</source>
- <translation type="unfinished"></translation>
+ <translation>Zapisz RTPDump jako</translation>
</message>
</context>
<context>
@@ -10414,6 +10878,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Bajty pakietu</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Opcje:&lt;/b&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Szukaj ciągu znaków w kodowanie wąskim (UTF-8 i ASCII) lub szerokim (UTF-16).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10434,6 +10902,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Rozróżniaj wielkość znaków</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation>Wstecz</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation>Wiele wystąpień</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Szukaj używając składni filtru wyświetlania (np. ip.addr==10.1.1.1), szesnastkowo (np. fffffda5), ciągu znaków (np. &quot;My String&quot;) lub wyrażenia regularnego (np. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10471,6 +10951,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Błędny filtr.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Ten filtr nie sprawdza niczego.</translation>
</message>
@@ -10535,18 +11031,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln node(s)</source>
- <translation>
- <numerusform>%Ln węzeł</numerusform>
- <numerusform>%Ln węzły</numerusform>
- <numerusform>%Ln węzłów</numerusform>
+ <translation type="unfinished">
+ <numerusform>%Ln node</numerusform>
+ <numerusform>%Ln nodes</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%Ln item(s)</source>
- <translation>
- <numerusform>%Ln obiekt</numerusform>
- <numerusform>%Ln obiekty</numerusform>
- <numerusform>%Ln obiektów</numerusform>
+ <translation type="unfinished">
+ <numerusform>%Ln item</numerusform>
+ <numerusform>%Ln items</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -10916,15 +11412,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Znajdź:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>Rozróżniaj wielkość znaków</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Znajdź &amp;następny</translation>
</message>
<message numerus="yes">
<source>Frame %1, %2, %Ln byte(s).</source>
- <translation>
- <numerusform>Ramka %1, %2, %Ln bajt.</numerusform>
- <numerusform>Ramka %1, %2, %Ln bajty.</numerusform>
- <numerusform>Ramka %1, %2, %Ln bajtów.</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -11012,15 +11512,23 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Zapisz jako…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Zapisz zaznaczone bajty pakietu jako</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
- <translation>
- <numerusform>Wyświetlanych %Ln bajt.</numerusform>
- <numerusform>Wyświetlane bajty: %Ln.</numerusform>
- <numerusform>Wyświetlanych bajtów: %Ln.</numerusform>
+ <source>Using %Ln byte(s).</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -11120,6 +11628,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Filtr wyświetlania:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11175,7 +11687,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>&quot;%1&quot; is deprecated in favour of &quot;%2&quot;. See Help section 6.4.8 for details.</source>
- <translation>&quot;%1&quot; jest przestarzałe na rzecz &quot;%2&quot;.. Aby uzyskać szczegółowe informacje, zobacz sekcję Pomocy 6.4.8.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>%1</source>
@@ -12020,7 +12532,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Copy all values of this page to the clipboard in CSV (Comma Separated Values) format.</source>
- <translation>Kopiuj wszystkie wartości z tej strony w CSV (Comma Separated Values) do schowka.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>as YAML</source>
@@ -12028,7 +12540,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Copy all values of this page to the clipboard in the YAML data serialization format.</source>
- <translation>Kopiuj wszystkie wartości z tej strony w formacie YAML do schowka.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>as JSON</source>
@@ -12036,7 +12548,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Copy all values of this page to the clipboard in the JSON data serialization format.</source>
- <translation>Kopiuj wszystkie wartości z tej strony w formacie JSON do schowka.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Save data as raw</source>
@@ -12088,22 +12600,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Stwórz nowy wpis.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Usuń wpis.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Kopiuj wpis.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Przesuń wpis w górę.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Przesuń wpis w dół.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12129,20 +12639,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Stwórz nowy wpis.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Usuń wpis.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Kopiuj wpis.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Przesuń wpis w górę.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Przesuń wpis w dół.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12193,7 +12703,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Prepare &amp;Filter</source>
- <translation>Przygotuj &amp;filtr</translation>
+ <translation type="unfinished">Przygotuj filtr</translation>
</message>
<message>
<source>Prepare a filter matching the selected calls(s).</source>
@@ -12289,7 +12799,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Select</source>
- <translation>&amp;Wybrane</translation>
+ <translation>Wybrane</translation>
</message>
</context>
<context>
@@ -12503,10 +13013,10 @@ a:hover {
</message>
<message numerus="yes">
<source>%n interface(s) shown, %1 hidden</source>
- <translation>
- <numerusform>%n wyświetlany interfejs, %1 ukrytych</numerusform>
- <numerusform>%n wyświetlane interfejsy, %1 ukrytych</numerusform>
- <numerusform>%n wyświetlanych interfejsów, %1 ukrytych</numerusform>
+ <translation type="unfinished">
+ <numerusform>%n interface shown, %1 hidden</numerusform>
+ <numerusform>%n interfaces shown, %1 hidden</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -12514,10 +13024,18 @@ a:hover {
<translation>Dzięki Wiresharkowi podglądasz fundamenty współczesnego Internetu.</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Używasz Wireshark </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation>Logray uruchomiony</translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation> Automatyczne aktualizacje są włączone.</translation>
</message>
@@ -12675,7 +13193,7 @@ a:hover {
</message>
<message>
<source>Prepare as Filter</source>
- <translation>Przygotuj jako filtr</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>SCTP</source>
@@ -12715,7 +13233,7 @@ a:hover {
</message>
<message>
<source>&amp;Analyze</source>
- <translation>&amp;Analiza</translation>
+ <translation>Analizuj</translation>
</message>
<message>
<source>Follow</source>
@@ -12794,20 +13312,12 @@ a:hover {
<translation>Nie znaleziono pliku</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>Podrę&amp;cznik</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Filtr</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
<message>
<source>Rawshark</source>
- <translation>RawShark</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Dumpcap</source>
@@ -13051,7 +13561,7 @@ a:hover {
</message>
<message>
<source>&amp;DTN</source>
- <translation>&amp;DTN</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Osmux</source>
@@ -13067,10 +13577,6 @@ a:hover {
<translation>Pasek sniffera WiFi</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Pomoc</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>FAQ</translation>
</message>
@@ -13191,11 +13697,6 @@ a:hover {
<translation>Znajdź poprzedni pakiet</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Zaznacz/odznacz pakiet</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Zaznacz wszystkie wyświetlane</translation>
</message>
@@ -13224,11 +13725,6 @@ a:hover {
<translation>Idź do poprzedniego zaznaczonego pakietu</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Ignoruj/odignoruj pakiet</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Ignoruj wszystkie wyświetlane</translation>
</message>
@@ -13534,7 +14030,7 @@ a:hover {
</message>
<message>
<source>Osmux packet counts</source>
- <translation>Liczba pakietów Osmux</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>RTSP packet counts</source>
@@ -13646,7 +14142,7 @@ a:hover {
</message>
<message>
<source>&amp;I/O Graphs</source>
- <translation>&amp;Wykresy wej./wyj.</translation>
+ <translation>&amp;Wykresy we./wy.</translation>
</message>
<message>
<source>&amp;Conversations</source>
@@ -13666,11 +14162,7 @@ a:hover {
</message>
<message>
<source>Reset Layout</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Reset appearance layout to default size</source>
- <translation>Resetuje układ do rozmiarów domyślnych</translation>
+ <translation>Resetuj wygląd</translation>
</message>
<message>
<source>Seconds Since First Captured Packet</source>
@@ -13758,7 +14250,7 @@ a:hover {
</message>
<message>
<source>Display Filter Expression…</source>
- <translation>Wyrażenie filtru wyświetlania...</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>REGISTER_STAT_GROUP_RSERPOOL</source>
@@ -13833,20 +14325,28 @@ a:hover {
<translation>Bloki adresów MAC</translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>&amp;Opcje…</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
- <translation>Informacje o wydaniu</translation>
+ <source>&amp;Wireless</source>
+ <translation>Bezprze&amp;wodowe</translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>&amp;Opcje…</translation>
+ <source>&amp;User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
- <translation>Bezprze&amp;wodowe</translation>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
+ <translation>Filtry wyświetlania</translation>
</message>
<message>
<source>Capture &amp;Filters…</source>
@@ -13893,10 +14393,18 @@ a:hover {
<translation>Znajdź poprzedni…</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation>&amp;Zaznacz/Odznacz wybrane</translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13937,6 +14445,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>General</source>
+ <translation>Ogólne</translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation>Statystyki odpowiedzi na zapytania DNS</translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation type="unfinished"></translation>
</message>
@@ -13945,6 +14465,14 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation>E2AP</translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Dekoduj jako…</translation>
</message>
@@ -14005,6 +14533,10 @@ a:hover {
<translation>Normalny rozmiar</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Zmień rozmiar kolumn</translation>
</message>
@@ -14227,7 +14759,7 @@ a:hover {
</message>
<message>
<source>RTP Player</source>
- <translation>Odtwarzacz RTP</translation>
+ <translation type="unfinished">Odtwarzacz RTP</translation>
</message>
<message>
<source>Play selected stream. Press CTRL key for playing reverse stream too.</source>
@@ -14263,6 +14795,14 @@ a:hover {
<translation>Idź do pakietu do którego odwołuje się zaznaczone pole.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>Informacje o wydaniu</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>Połączenia VoIP</translation>
</message>
@@ -14295,10 +14835,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14542,11 +15078,11 @@ a:hover {
</message>
<message>
<source>Unable to drop files during capture.</source>
- <translation>Nie można porzucić pliku podczas przechwytywania.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Unknown file type returned by merge dialog.</source>
- <translation>Nieznany typ pliku zwrócony przez okno dialogowe łączenia plików.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Please report this as a Wireshark issue at https://gitlab.com/wireshark/wireshark/-/issues.</source>
@@ -14554,7 +15090,7 @@ a:hover {
</message>
<message>
<source>Unknown file type returned by export dialog.</source>
- <translation>Nieznany typ pliku zwrócony przez okno dialogowe eksportu.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Do you want to stop the capture and save the captured packets%1?</source>
@@ -14583,8 +15119,12 @@ a:hover {
<translation>Wyjdź bez zapisy&amp;wania</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation>Dane USB CDC</translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
- <translation>Brak pola &quot;rtp.ssrc&quot; w tej wersji programu Wireshark.</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Please select an RTPv2 packet with an SSRC value</source>
@@ -14644,15 +15184,6 @@ a:hover {
<source>No Keys</source>
<translation>Brak kluczy</translation>
</message>
- <message numerus="yes">
- <source>Export SSL Session Keys (%Ln key(s))</source>
- <oldsource>Export SSL Session Keys (%1 key%2</oldsource>
- <translation type="vanished">
- <numerusform>Eksportuj klucze sesji SSL (%Ln klucz)</numerusform>
- <numerusform>Eksportuj klucze sesji SSL (%Ln klucze)</numerusform>
- <numerusform>Eksportuj klucze sesji SSL (%Ln kluczy)</numerusform>
- </translation>
- </message>
<message>
<source>Raw data (*.bin *.dat *.raw);;All Files (</source>
<translation>Surowe dane (*.bin *.dat *.raw);;Dowolny plik (</translation>
@@ -14683,7 +15214,7 @@ a:hover {
</message>
<message>
<source>No interface selected.</source>
- <translation>Nie wybrano interfejsu.</translation>
+ <translation>Nie wybrano interfejsu</translation>
</message>
<message>
<source>Saving %1…</source>
@@ -14722,10 +15253,10 @@ a:hover {
</message>
<message numerus="yes">
<source>Delete comments from %n packet(s)</source>
- <translation>
- <numerusform>Usuń komentarze z %n pakietu</numerusform>
- <numerusform>Usuń komentarze z %n pakietów</numerusform>
- <numerusform>Usuń komentarze z %n pakietów</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -14746,14 +15277,14 @@ a:hover {
</message>
<message>
<source>There are no TLS Session Keys to save.</source>
- <translation>Nie ma żadnych kluczy sesji SSL do zapisu.</translation>
+ <translation>Nie ma żadnych kluczy sesji TLS do zapisu.</translation>
</message>
<message numerus="yes">
<source>Export TLS Session Keys (%Ln key(s))</source>
- <translation>
- <numerusform>Eksportuj klucze sesji TLS (%Ln klucz)</numerusform>
- <numerusform>Eksportuj klucze sesji TLS (%Ln klucze)</numerusform>
- <numerusform>Eksportuj klucze sesji TLS (%Ln kluczy)</numerusform>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -14798,7 +15329,7 @@ a:hover {
</message>
<message>
<source>No Interface Selected.</source>
- <translation>Nie wybrano interfejsu.</translation>
+ <translation>Nie wybrano interfejsu</translation>
</message>
<message>
<source> before restarting the capture</source>
diff --git a/ui/qt/wireshark_ru.ts b/ui/qt/wireshark_ru.ts
index 870d0df6..2bd5d309 100644
--- a/ui/qt/wireshark_ru.ts
+++ b/ui/qt/wireshark_ru.ts
@@ -44,8 +44,8 @@
<translation>Папки</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Фильтр по пути размещения</translation>
+ <source>Search Folders</source>
+ <translation>Поиск папок</translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Лицензия</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>О Logray</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Журнал</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Каталог отсутствует</translation>
</message>
@@ -109,10 +117,10 @@
</message>
<message numerus="yes">
<source>Copy Row(s)</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>Копировать строку</numerusform>
+ <numerusform>Копировать строки</numerusform>
+ <numerusform>Копировать строки</numerusform>
</translation>
</message>
</context>
@@ -732,11 +740,11 @@
</message>
<message>
<source>…as decimal</source>
- <translation type="unfinished"></translation>
+ <translation>... как десятичный</translation>
</message>
<message>
<source>…as octal</source>
- <translation type="unfinished"></translation>
+ <translation>...как восьмеричный</translation>
</message>
<message>
<source>…as bits</source>
@@ -756,6 +764,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>Редактирование комментариев к захвату</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>Добавить комментарий</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>Раздел %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>Комментарий %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -812,6 +842,32 @@
<source>Automatically detect file type</source>
<translation>Автоматически определить тип файла</translation>
</message>
+ <message numerus="yes">
+ <source>%1, error after %Ln packet(s)</source>
+ <oldsource>%1, error after %2 packets</oldsource>
+ <translation type="vanished">
+ <numerusform>%1, ошибка после %Ln пакета</numerusform>
+ <numerusform>%1, ошибка после %Ln пакетов</numerusform>
+ <numerusform>%1, ошибка после %Ln пакетов</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%1, timed out at %Ln packet(s)</source>
+ <oldsource>%1, timed out at %2 packets</oldsource>
+ <translation type="vanished">
+ <numerusform>%1, таймер прерван на %Ln пакете</numerusform>
+ <numerusform>%1, таймер прерван на %Ln пакетах</numerusform>
+ <numerusform>%1, таймер прерван на %Ln пакетах</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%1, %Ln packet(s)</source>
+ <translation type="vanished">
+ <numerusform>%1, %Ln пакет</numerusform>
+ <numerusform>%1, %Ln пакета</numerusform>
+ <numerusform>%1, %Ln пакетов</numerusform>
+ </translation>
+ </message>
<message>
<source>Prepend packets</source>
<translation>Добавить пакеты к началу файла</translation>
@@ -841,10 +897,6 @@
<translation>Фильтр чтения:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Сжать с помощью g&amp;zip</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Открытие файла захвата</translation>
@@ -895,26 +947,26 @@
<message numerus="yes">
<source>%1, error after %Ln data record(s)</source>
<oldsource>%1, error after %Ln record(s)</oldsource>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%1, ошибка после %Ln записи данных</numerusform>
+ <numerusform>%1, ошибка после %Ln записей данных</numerusform>
+ <numerusform>%1, ошибка после %Ln записей данных</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%1, timed out at %Ln data record(s)</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%1, таймер прерван на %Ln записи данных</numerusform>
+ <numerusform>%1, таймер прерван на %Ln записи данных</numerusform>
+ <numerusform>%1, таймер прерван на %Ln записях данных</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%1, %Ln data record(s)</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%1, %Ln запись данных</numerusform>
+ <numerusform>%1, %Ln записи данных</numerusform>
+ <numerusform>%1, %Ln записей данных</numerusform>
</translation>
</message>
<message>
@@ -929,8 +981,8 @@
<translation>Подробности</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Комментарии в файле захвата</translation>
+ <source>Edit Comments</source>
+ <translation>Редактировать комментарии</translation>
</message>
<message>
<source>Refresh</source>
@@ -941,10 +993,6 @@
<translation>Копировать в буфер обмена</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Сохранить комментарии</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Свойства файла захвата</translation>
</message>
@@ -993,10 +1041,18 @@
<translation>Первый пакет</translation>
</message>
<message>
+ <source>First event</source>
+ <translation>Первое событие</translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Последний пакет</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation>Последнее событие</translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Прошло</translation>
</message>
@@ -1033,6 +1089,10 @@
<translation>Потерянные пакеты</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation>Отмененные события</translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Фильтр захвата</translation>
</message>
@@ -1045,6 +1105,10 @@
<translation>Ограничение на размер пакета (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation>Ограничение размера события (оснастка)</translation>
+ </message>
+ <message>
<source>none</source>
<translation>нет</translation>
</message>
@@ -1053,6 +1117,26 @@
<translation>%1 Б</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>Комментарии</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>Комментарий %1: </translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation>Секреты расшифровки</translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>Тип</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>Размер</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Статистика</translation>
</message>
@@ -1077,18 +1161,26 @@
<translation>Пакеты</translation>
</message>
<message>
+ <source>Events</source>
+ <translation>События</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Временной промежуток, с</translation>
</message>
<message>
<source>Average pps</source>
- <translation>В среднем, пакетов/с </translation>
+ <translation>В среднем, пакетов/с</translation>
</message>
<message>
<source>Average packet size, B</source>
<translation>Средний размер пакета, Б</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation>Средний размер события, B</translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Байты</translation>
</message>
@@ -1101,14 +1193,14 @@
<translation>В среднем бит/с</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Комментарий к разделу</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Комментарии к пакету</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation>Комментарии к событию</translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Кадр %1: </translation>
</message>
@@ -1120,6 +1212,14 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Создано Logray %1
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1347,6 +1447,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Например, если указать 1 час, то каждый час будет создаваться новый файл.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Обычно беспроводная сетевая карта перехватывает только трафик, отправленный на ее собственный сетевой адрес и с него, а также трафик пользовательских данных&lt;em&gt; с &amp;quot;поддельными&lt;/em&gt;&amp;quot; заголовками Ethernet. Если вы хотите перехватывать весь трафик, который могут &amp;quot;видеть&amp;quot; беспроводные сетевые карты, или вас интересуют пакеты управления или контроля 802.11, или информация радиоуровня, отметьте этот параметр. Доступность режима мониторинга зависит от беспроводной карты и драйвера. Дополнительные сведения о перехвате пакетов в сетях WLAN см. в Wiki.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>Включите режим монитора на всех интерфейсах 802.11</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>сжатие</translation>
</message>
@@ -1359,6 +1467,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation>Инфиксный шаблон файла</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;В режиме нескольких файлов дата и время, а также индексный номер файла вставляются между шаблоном имени файла и любым суффиксом. Выберите их порядок.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation>YYYYmmDDHHMMSS_NNNNN</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;p&gt;Дата и время перед индексным номером файла. В результате файлы сортируются в порядке времени создания, а файлы из одной партии располагаются в строгом порядке.&lt;/p&gt;&lt;body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation>NNNNN_YYYYmmDDHHMMSS</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Номер индекса файла перед датой и временем. Это исторический заказ Wireshark.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;При переходе записи данных на следующий файл превышение указанного здесь числа файлов приведёт к удалению самого старого из них.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1447,6 +1579,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Останавливать захват после создания указанного числа файлов.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation>Остановка захвата после создания указанного количества файлов.</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Остановить захват при достижении указанного объёма захваченных данных.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1507,8 +1643,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Ошибка</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Несколько файлов: Указан слишком большой размер файла. Размер файла не может превышать 2 ГиБ.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation>Несколько файлов: Запрашиваемый размер файлов слишком велик. Размер файлов не может превышать 2 ТБ.</translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1538,6 +1674,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Захватывать пакеты в смешанном режиме</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Обычно беспроводная сетевая карта перехватывает только трафик, отправленный на ее собственный сетевой адрес и с него,&lt;em&gt; а также трафик пользовательских данных с &amp;quot;поддельными&lt;/em&gt;&amp;quot; заголовками Ethernet. Если вы хотите перехватывать весь трафик, который могут &amp;quot;видеть&amp;quot; беспроводные сетевые карты, или вас интересуют пакеты управления или контроля 802.11, или информация радиоуровня, отметьте этот параметр. Доступность режима мониторинга зависит от беспроводной карты и драйвера. Дополнительные сведения о перехвате пакетов в сетях WLAN см. в Wiki.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>Захват пакетов в режиме монитора на устройствах 802.11</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Выполнять захват пакетов в формате файла захвата следующего поколения «pcapng».&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1555,15 +1699,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Interval between updates (ms)</source>
- <translation type="unfinished"></translation>
+ <translation>Интервал между обновлениями (мс)</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;How often the capture notifies the GUI of new packets. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Как часто захват уведомляет графический интерфейс о новых пакетах. Влияет на частоту обновления графического интерфейса и гранулярность таймеров.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The interval between new packet updates. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;head/&gt;&lt;body&gt;&lt;p&gt;Интервал между новыми обновлениями пакетов. Влияет на частоту обновления графического интерфейса и гранулярность таймеров.&lt;/p&gt;&lt;/body&gt;&lt;html&gt;</translation>
</message>
<message>
<source>Don&apos;t load interfaces on startup</source>
@@ -1657,7 +1801,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Open </source>
- <translation>Открыть</translation>
+ <translation>Открыть </translation>
</message>
<message>
<source>Double click to edit. Drag to move. Rules are processed in order until a match is found.</source>
@@ -1765,6 +1909,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Разрешено</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>Ширина</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>Выравнивание</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;Показывать человекочитаемые строки вместо необработанных значений полей. Может применяться только к дополнительным столбцам с полями, содержащими строки значений.&lt;/html&gt;</translation>
</message>
@@ -1812,6 +1964,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation>Опции сжатия</translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation>&amp;Не сжатый</translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation>Сжатие с помощью g&amp;zip</translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation>Сжатие с помощью &amp;LZ4</translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1878,6 +2049,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Бит/с B </translation>
</message>
<message>
+ <source>Flows</source>
+ <translation>Потоки</translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Всего пакетов</translation>
</message>
@@ -1992,30 +2167,54 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Копировать байты пакета в виде шестнадцатеричного дампа.</translation>
</message>
<message>
- <source>…as Printable Text</source>
- <translation type="unfinished"></translation>
+ <source>…as MIME Data</source>
+ <translation>...как данные MIME</translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
- <translation type="unfinished"></translation>
+ <source>…as C String</source>
+ <translation>...как строка C</translation>
</message>
<message>
- <source>…as MIME Data</source>
- <translation type="unfinished"></translation>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <translation>Копирование байтов пакета в виде печатаемых символов ASCII и управляющих последовательностей.</translation>
</message>
<message>
- <source>…as C String</source>
- <translation type="unfinished"></translation>
+ <source>…as Go literal</source>
+ <translation>...как буквальный го</translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
- <translation type="unfinished"></translation>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation>Скопируйте байты пакета как литерал Go.</translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation>...как массив C</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
+ <translation>Скопируйте байты пакета в массив C.</translation>
</message>
<message>
<source>…as a Hex Stream</source>
<translation>…в виде шестнадцатеричного потока</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation>...как текст UTF-8</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation>Копирование байтов пакета в виде текста с обработкой в формате UTF-8.</translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation>... как текст ASCII</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation>Копирование байтов пакета в виде текста с обработкой в формате ASCII.</translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>Копировать байты пакета в виде шестнадцатеричного потока.</translation>
</message>
@@ -2056,7 +2255,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Open </source>
- <translation>Открыть</translation>
+ <translation>Открыть </translation>
</message>
</context>
<context>
@@ -2295,11 +2494,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>DissectorSyntaxLineEdit</name>
<message>
<source>Dissector entry</source>
- <translation type="unfinished"></translation>
+ <translation>Вход в диссектор</translation>
</message>
<message>
<source>Enter a dissector %1</source>
- <translation type="unfinished"></translation>
+ <translation>Введите рассекатель %1</translation>
</message>
</context>
<context>
@@ -2811,6 +3010,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Фильтр отображения:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation>Экспорт PDU</translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2850,10 +3053,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Старт</translation>
</message>
<message>
- <source>Save</source>
- <translation>Сохранить</translation>
- </message>
- <message>
<source>Default</source>
<translation>По умолчанию</translation>
</message>
@@ -2910,10 +3109,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message numerus="yes">
<source>%Ln File(s) in Set</source>
<oldsource>%1 File%2 in Set</oldsource>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln Файл в Наборе</numerusform>
+ <numerusform>%Ln Файла в Наборе</numerusform>
+ <numerusform>%Ln Файлов в Наборе</numerusform>
</translation>
</message>
</context>
@@ -2996,8 +3195,16 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Фильтры отображения</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation>Макросы фильтров отображения</translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>Новый макрос</translation>
+ </message>
+ <message>
<source>Open </source>
- <translation>Открыть</translation>
+ <translation>Открыть </translation>
</message>
<message>
<source>New capture filter</source>
@@ -3079,10 +3286,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>Название макроса</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Имя фильтра</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation>Макро выражение</translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Выражение фильтра</translation>
</message>
@@ -3168,22 +3383,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>Диалоговые окна открытия файлов</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>Файлы захвата</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Временные файлы</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>Безымянные файлы захвата</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Персональная конфигурация</translation>
</message>
@@ -3192,14 +3395,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Глобальная конфигурация</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfilters, preferences, ethers, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>dfilters, preferences, manuf, …</translation>
- </message>
- <message>
<source>System</source>
<translation>Конфигурация системы</translation>
</message>
@@ -3212,18 +3407,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Программы</translation>
</message>
<message>
- <source>program files</source>
- <translation>Файлы программ</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Пользовательские подключаемые модули</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>Исполняемые файлы подключаемых модулей</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Глобальные подключаемые модули</translation>
</message>
@@ -3240,12 +3427,36 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Сценарии Lua</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation>Местонахождение диалога &quot;Файл&quot;</translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation>Захват файлов</translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation>Файлы захвата без названия</translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation>Предпочтения, профили, производство, ...</translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation>Программные файлы</translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation>Бинарные плагины</translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>Пользовательский путь Extcap</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
- <translation>модули внешненго захвата (extcap)</translation>
+ <source>External capture (extcap) plugins</source>
+ <translation>Плагины для внешнего захвата (extcap)</translation>
</message>
<message>
<source>Global Extcap path</source>
@@ -3292,7 +3503,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>FollowStreamAction</name>
<message>
<source>%1 Stream</source>
- <translation type="unfinished"></translation>
+ <translation>%1 Поток</translation>
</message>
</context>
<context>
@@ -3306,6 +3517,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Print</source>
<translation>Печать</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln client pkt(s), </source>
+ <translation type="vanished">
+ <numerusform>%Ln клиентский пакет,</numerusform>
+ <numerusform>%Ln клиентских пакета,</numerusform>
+ <numerusform>%Ln клиентских пакетах,</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln server pkt(s), </source>
+ <translation type="vanished">
+ <numerusform>%Ln серверный пакет, </numerusform>
+ <numerusform>%Ln серверных пакета, </numerusform>
+ <numerusform>%Ln серверных пакетов, </numerusform>
+ </translation>
+ </message>
<message>
<source>ASCII</source>
<translation>ASCII</translation>
@@ -3348,26 +3575,46 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;client&lt;/span&gt; pkt(s), </source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;клиентский&lt;/span&gt; пакет,</numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;клиентских&lt;/span&gt; пакета,</numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;клиентских&lt;/span&gt; пакетов,</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;server&lt;/span&gt; pkt(s), </source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;серверный&lt;/span&gt; пакет, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;серверных&lt;/span&gt; пакета, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;серверных&lt;/span&gt; пакетов, </numerusform>
</translation>
</message>
<message numerus="yes">
<source>%Ln turn(s).</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln поворот.</numerusform>
+ <numerusform>%Ln поворота.</numerusform>
+ <numerusform>%Ln поворотов.</numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>Event %1. </source>
+ <translation>Событие %1. </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;чтение&lt;/span&gt;, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;чтения&lt;/span&gt;, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;чтений&lt;/span&gt;, </numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;запись&lt;/span&gt;, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;записи&lt;/span&gt;, </numerusform>
+ <numerusform>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;записей&lt;/span&gt;, </numerusform>
</translation>
</message>
<message>
@@ -3403,6 +3650,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Поток %1 не найден в выбранном пакете.</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>Активность чтения(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>Письменная активность(%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>Вся активность ввода/вывода (%1)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>Весь диалог (%1)</translation>
</message>
@@ -3418,24 +3677,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation>Сохранить содержимое потока как…</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[Вывод потока усечён]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln всего поток.</numerusform>
+ <numerusform>%Ln всех потоков.</numerusform>
+ <numerusform>%Ln всех потоков.</numerusform>
</translation>
</message>
<message numerus="yes">
<source>Max sub stream ID for the selected stream: %Ln</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>Максимальный идентификатор подпотока для выбранного потока: %Ln</numerusform>
+ <numerusform>Максимальный идентификатор подпотока для выбранных потоков: %Ln</numerusform>
+ <numerusform>Максимальный идентификатор подпотока для выбранных потоков: %Ln</numerusform>
</translation>
</message>
<message>
@@ -3451,9 +3706,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Подсказка.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Отобразить данные в виде</translation>
+ <source>Show as</source>
+ <translation>Показать как</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation>Нет дельты времени</translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation>Дельта времени поворота</translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation>Все дельта-время</translation>
</message>
<message>
<source>Stream</source>
@@ -3468,11 +3734,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Найти:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>С учетом регистра</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Найти &amp;далее</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[Вывод потока усечен]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3546,11 +3823,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message>
<source>Example GIF query packets have jumbo window sizes</source>
<extracomment>These are pangrams. Feel free to replace with nonsense text that spans your alphabet. https://en.wikipedia.org/wiki/Pangram</extracomment>
- <translation>Любя, съешь щипцы,&#xa0;— вздохнёт мэр,&#xa0;— кайф жгуч.</translation>
+ <translation>Любя, съешь щипцы,&#xa0;— вздохнёт мэр,&#xa0;— кайф жгуч</translation>
</message>
<message>
<source>Lazy badgers move unique waxy jellyfish packets</source>
- <translation>Съешь же ещё этих мягких французских булок да выпей чаю.</translation>
+ <translation>Съешь же ещё этих мягких французских булок да выпей чаю</translation>
</message>
<message>
<source>Font</source>
@@ -3694,23 +3971,23 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>IOConsoleDialog</name>
<message>
<source>Dialog</source>
- <translation type="unfinished"></translation>
+ <translation>Диалог</translation>
</message>
<message>
<source>Enter code</source>
- <translation type="unfinished"></translation>
+ <translation>Введите код</translation>
</message>
<message>
<source>Evaluate</source>
- <translation type="unfinished"></translation>
+ <translation>Оценить</translation>
</message>
<message>
<source>Clear</source>
- <translation type="unfinished">Очистить</translation>
+ <translation>Очистить</translation>
</message>
<message>
<source>Use %1 to evaluate.</source>
- <translation type="unfinished"></translation>
+ <translation>Используйте %1 для оценки.</translation>
</message>
</context>
<context>
@@ -3808,29 +4085,28 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Удалить этот график.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Добавить новый график.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Дублировать этот график.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Очистить все графики.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>Переместить этот график вверх.</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation>Удалить выбранный график(ы).</translation>
+ </message>
+ <message>
+ <source>Duplicate the selected graph(s).</source>
+ <translation>Дублирование выбранного графика (графиков).</translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation>Переместить этот график вниз.</translation>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation>Переместите выбранный график(ы) вверх.</translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation>Переместите выбранный график(ы) вниз.</translation>
</message>
<message>
<source>Mouse</source>
@@ -3866,15 +4142,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Automatic update</source>
- <translation type="unfinished"></translation>
+ <translation>Автоматическое обновление</translation>
</message>
<message>
<source>Enable legend</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Reset</source>
- <translation>Сброс</translation>
+ <translation>Включить легенду</translation>
</message>
<message>
<source>Reset Graph</source>
@@ -4090,6 +4362,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Копировать графики из другого профиля.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation>1 мкс</translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation>2 мкс</translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation>5 мкс</translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation>10 мкс</translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation>20 мкс</translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation>50 мкс</translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation>100 мкс</translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation>200 мкс</translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation>500 мкс</translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 мс</translation>
</message>
@@ -4134,6 +4442,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>5 сек</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation>2 минуты</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation>5 минут</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Графики ввода/вывода Wireshark: %1</translation>
</message>
@@ -4143,7 +4459,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Filtered events</source>
- <translation type="unfinished"></translation>
+ <translation>Отфильтрованные события</translation>
+ </message>
+ <message>
+ <source>All packets</source>
+ <translation>Все пакеты</translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation>Все события</translation>
</message>
<message>
<source>All Packets</source>
@@ -4155,11 +4479,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>All Events</source>
- <translation type="unfinished"></translation>
+ <translation>Все события</translation>
</message>
<message>
- <source>Access Denied</source>
- <translation type="unfinished"></translation>
+ <source>All Execs</source>
+ <translation>Все руководители</translation>
</message>
<message>
<source>Hover over the graph for details.</source>
@@ -4171,7 +4495,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>No events in interval</source>
- <translation type="unfinished"></translation>
+ <translation>Нет событий в интервале</translation>
</message>
<message>
<source>Click to select packet</source>
@@ -4183,11 +4507,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Click to select event</source>
- <translation type="unfinished"></translation>
+ <translation>Нажмите, чтобы выбрать событие</translation>
</message>
<message>
<source>Event</source>
- <translation type="unfinished">Событие</translation>
+ <translation>Событие</translation>
</message>
<message>
<source>%1 (%2s%3).</source>
@@ -4206,6 +4530,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Щёлкните для выбора участка графика.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation>%1 Интервалы </translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation>Переместить в левый верхний угол</translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation>Переместить в верхний центр</translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation>Переместить в правый верхний угол</translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation>Переместить в левый нижний угол</translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation>Переместить в нижний центр</translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation>Перемещение в правый нижний угол</translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Portable Document Format (*.pdf)</translation>
</message>
@@ -4958,6 +5310,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation>по умолчанию</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5936,8 +6295,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>Статистика LTE Mac</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation>Статистика LTE/NR Mac</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -5949,7 +6308,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>MAC Statistics</source>
- <translation>Статистика MAC </translation>
+ <translation>Статистика MAC</translation>
</message>
</context>
<context>
@@ -6241,12 +6600,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Номер последовательности</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>График LTE RLC (UE=%1 канал=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation>%1 График RLC (UE=%2 канал=%3%4 %5 - %6)</translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>График LTE RLC — канал не выбран</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation>3GPP RLC График - канал не выбран</translation>
</message>
<message>
<source>Save As…</source>
@@ -6300,8 +6659,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>Статистика LTE RLC</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation>Статистика 3GPP RLC</translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6387,6 +6746,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Профиль: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation> %1 Отображено: %2 (%3%)</translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Управление профилями…</translation>
</message>
@@ -6443,10 +6806,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<message numerus="yes">
<source>%Ln byte(s)</source>
<oldsource>, %1 bytes</oldsource>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln байт</numerusform>
+ <numerusform>%Ln байта</numerusform>
+ <numerusform>%Ln байтов</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln бит</numerusform>
+ <numerusform>%Ln бита</numerusform>
+ <numerusform>%Ln битов</numerusform>
</translation>
</message>
<message>
@@ -6462,9 +6833,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Выбран пакет: %1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Пакеты: %1 %4 Отображаются: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation>Выбранное событие: %1 %2 </translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation>События: %1</translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6496,6 +6870,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Пакеты отсутствуют</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation>Нет событий</translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>Из zip-фйла…</translation>
</message>
@@ -6529,6 +6907,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation>Отображение фильтра как %1</translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6560,6 +6945,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Последняя использованная папка</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation>Текущий рабочий каталог</translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Показывать до</translation>
</message>
@@ -6703,62 +7092,62 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>ManufDialog</name>
<message>
<source>MAC Address Blocks</source>
- <translation type="unfinished"></translation>
+ <translation>Блокировка MAC-адресов</translation>
</message>
<message>
<source>Search MAC address or address prefix. Special purpose bits are masked.</source>
- <translation type="unfinished"></translation>
+ <translation>Поиск MAC-адреса или префикса адреса. Биты специального назначения маскируются.</translation>
</message>
<message>
<source>MAC Address</source>
- <translation type="unfinished"></translation>
+ <translation>MAC-адрес</translation>
</message>
<message>
<source>Search vendor name using a case-insentitive regular expression.</source>
- <translation type="unfinished"></translation>
+ <translation>Поиск названия поставщика с помощью регулярного выражения, не зависящего от регистра.</translation>
</message>
<message>
<source>Vendor Name</source>
- <translation type="unfinished"></translation>
+ <translation>Название поставщика</translation>
</message>
<message>
<source>Show short name column.</source>
- <translation type="unfinished"></translation>
+ <translation>Показать колонку с короткими названиями.</translation>
</message>
<message>
<source>Short name</source>
- <translation type="unfinished"></translation>
+ <translation>Краткое название</translation>
</message>
<message>
<source>Select all</source>
- <translation type="unfinished">Выбрать все</translation>
+ <translation>Выбрать все</translation>
</message>
<message>
<source>Copy</source>
- <translation type="unfinished">Копировать</translation>
+ <translation>Копировать</translation>
</message>
<message>
<source>Find</source>
- <translation type="unfinished">Найти</translation>
+ <translation>Найти</translation>
</message>
<message>
<source>Clear</source>
- <translation type="unfinished">Очистить</translation>
+ <translation>Очистить</translation>
</message>
</context>
<context>
<name>ManufTableModel</name>
<message>
<source>Address Block</source>
- <translation type="unfinished"></translation>
+ <translation>Адресный блокиратор</translation>
</message>
<message>
<source>Short Name</source>
- <translation type="unfinished">Короткое имя</translation>
+ <translation>Краткое название</translation>
</message>
<message>
<source>Vendor Name</source>
- <translation type="unfinished"></translation>
+ <translation>Название поставщика</translation>
</message>
</context>
<context>
@@ -6990,6 +7379,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Показать значения полей</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation>Обновить</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Сохранить диаграмму как…</translation>
</message>
@@ -7037,6 +7430,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Показывать байты пакета</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation>Макет:</translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Пакет %1</translation>
</message>
@@ -7054,10 +7451,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln byte(s)</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln байт</numerusform>
+ <numerusform>%Ln байта</numerusform>
+ <numerusform>%Ln байтов</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation>
+ <numerusform>%Ln бит</numerusform>
+ <numerusform>%Ln бита</numerusform>
+ <numerusform>%Ln битов</numerusform>
</translation>
</message>
</context>
@@ -7230,7 +7635,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Sorting …</source>
- <translation type="unfinished"></translation>
+ <translation>Сортировка …</translation>
</message>
</context>
<context>
@@ -7265,11 +7670,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Include &amp;depended upon packets</source>
- <translation type="unfinished"></translation>
+ <translation>Включать и зависеть от пакетов</translation>
</message>
<message>
<source>Also include packets depended upon, such as those used to reassemble displayed packets</source>
- <translation type="unfinished"></translation>
+ <translation>Включите также пакеты, от которых зависят, например, пакеты, используемые для повторной сборки отображаемых пакетов.</translation>
</message>
<message>
<source>First &amp;to last marked</source>
@@ -7395,11 +7800,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Checking this will show only changed preferences.</source>
- <translation type="unfinished"></translation>
+ <translation>Если установить этот флажок, будут показаны только измененные настройки.</translation>
</message>
<message>
<source>Show changed values</source>
- <translation type="unfinished"></translation>
+ <translation>Показать измененные значения</translation>
</message>
<message>
<source>Preferences</source>
@@ -7519,10 +7924,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Копировать данный профиль.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation>Количество пакетов или событий, которые необходимо проверить для автоматического переключения профиля.</translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation>Ограничение пакетов автоматического переключения</translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Профили конфигурации</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation>Предел события автоматического переключения</translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Импорт</translation>
@@ -7542,10 +7959,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln Selected Personal Profile(s)...</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln Выбранный персональный профиль...</numerusform>
+ <numerusform>%Ln Выбранный персональный профиля...</numerusform>
+ <numerusform>%Ln Выбранный персональный профилей...</numerusform>
</translation>
</message>
<message>
@@ -7572,6 +7989,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Select zip file for export</source>
<translation>Выбрать zip-файл для экспорта</translation>
</message>
+ <message numerus="yes">
+ <source>… %Ln selected personal profile(s)</source>
+ <translation type="vanished">
+ <numerusform>... %Ln выбранный личный профиль</numerusform>
+ <numerusform>... %Ln выбранных личных профиля</numerusform>
+ <numerusform>... %Ln выбранных личных профилей</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln selected personal profile(s)</source>
+ <translation type="vanished">
+ <numerusform>%Ln выбранный личный профиль</numerusform>
+ <numerusform>%Ln выбранных личных профиля</numerusform>
+ <numerusform>%Ln выбранных личных профилей</numerusform>
+ </translation>
+ </message>
<message>
<source>An import of profiles is not allowed, while changes are pending</source>
<translation>Импорт профилей при наличии ожидающих сохранения изменений не допускается</translation>
@@ -7590,10 +8023,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln profile(s) exported</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln профиль экспортирован</numerusform>
+ <numerusform>%Ln профиля экспортировано</numerusform>
+ <numerusform>%Ln профилей экспортировано</numerusform>
</translation>
</message>
<message>
@@ -7622,18 +8055,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln profile(s) imported</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln профиль импортирован</numerusform>
+ <numerusform>%Ln профиля импортировано</numerusform>
+ <numerusform>%Ln профилей импортировано</numerusform>
</translation>
</message>
<message numerus="yes">
<source>, %Ln profile(s) skipped</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln профиль пропущен</numerusform>
+ <numerusform>%Ln профиля пропущено</numerusform>
+ <numerusform>%Ln профилей пропущено</numerusform>
</translation>
</message>
<message>
@@ -7696,6 +8129,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>удалённый</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation>Автоматический переключатель фильтра</translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>копия</translation>
@@ -7934,27 +8371,27 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Copy short names</source>
- <translation type="unfinished"></translation>
+ <translation>Копирование коротких названий</translation>
</message>
<message>
<source>Copy short protocol names in use.</source>
- <translation type="unfinished"></translation>
+ <translation>Скопируйте используемые короткие названия протоколов.</translation>
</message>
<message>
<source>Disable unused protocols</source>
- <translation type="unfinished"></translation>
+ <translation>Отключите неиспользуемые протоколы</translation>
</message>
<message>
<source>Disable all protocols but those listed.</source>
- <translation type="unfinished"></translation>
+ <translation>Отключите все протоколы, кроме перечисленных.</translation>
</message>
<message>
<source>Re-enable unused protocols</source>
- <translation type="unfinished"></translation>
+ <translation>Повторное включение неиспользуемых протоколов</translation>
</message>
<message>
<source>Re-enable protocols that were disabled in this dialog.</source>
- <translation type="unfinished"></translation>
+ <translation>Повторное включение протоколов, которые были отключены в этом диалоговом окне.</translation>
</message>
<message>
<source>Protocol Hierarchy Statistics</source>
@@ -7974,19 +8411,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>protocol short names</source>
- <translation type="unfinished"></translation>
+ <translation>краткие названия протоколов</translation>
</message>
<message>
<source>Protocols</source>
- <translation type="unfinished"></translation>
+ <translation>Протоколы</translation>
</message>
<message>
<source>Disable unused</source>
- <translation type="unfinished"></translation>
+ <translation>Отключить неиспользуемые</translation>
</message>
<message>
<source>Revert changes</source>
- <translation type="unfinished"></translation>
+ <translation>Отмена изменений</translation>
</message>
<message>
<source>No display filter.</source>
@@ -7998,11 +8435,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Unused protocols have been disabled.</source>
- <translation type="unfinished"></translation>
+ <translation>Неиспользуемые протоколы были отключены.</translation>
</message>
<message>
<source>Protocol changes have been reverted.</source>
- <translation type="unfinished"></translation>
+ <translation>Изменения протокола были отменены.</translation>
</message>
</context>
<context>
@@ -8056,7 +8493,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Unacked (Outstanding) Bytes (B)</source>
- <translation type="unfinished"></translation>
+ <translation>Нераспакованные (выданные) байты (B)</translation>
</message>
<message>
<source>[no capture file]</source>
@@ -8219,6 +8656,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Отсутствует маркер?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation>LTE</translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation>NR</translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8239,6 +8684,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation>КРЫСА</translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>Кадры UL</translation>
</message>
@@ -8462,9 +8911,69 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation>Обзор…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation>ПАКЕТЫ</translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation>СОБЫТИЯ</translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation>БАЙТЫ</translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation>БИТЫ</translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation>СЧЁТНЫЕ РАМКИ</translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation>СЧЕТНЫЕ ПОЛЯ</translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation>СУММА</translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation>МАКСИМАЛЬНО</translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation>МИНИМАЛЬНО</translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation>СРЕДНИЙ</translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation>ТРЕУГОЛЬНИК</translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation>ЗАГРУЗКА</translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation>Левый</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation>Центр</translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation>Правый</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation>CCCH</translation>
@@ -8565,6 +9074,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation>Изменить размер всех %1 по содержимому</translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8680,6 +9196,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Разрешённые адреса</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation>Копировать</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation>Сохранить как...</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Разрешённые адреса найденные в %1</translation>
</message>
@@ -8693,6 +9217,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation>как обычный текст</translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation>Копирование выбранных строк</translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation>Копирование таблицы</translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation>как CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation>как JSON</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation>Сохранить выбранные строки как...</translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation>Сохраните таблицу как...</translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation>Сохранить решенные адреса как...</translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation>Обычный текст (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation>Документ CSV (*.csv)</translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation>Документ JSON (*.json)</translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation>Внимание</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation>Невозможно сохранить %1: %2</translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10018,11 +10597,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>-</source>
- <translation type="unfinished">-</translation>
+ <translation>-</translation>
</message>
<message>
<source>&lt;small&gt;&lt;i&gt;For complete analysis check SCTP preference Enable Association indexing&lt;/i&gt;&lt;/small&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;small&gt;Для полного анализа проверьте предпочтение SCTP Включить индексирование ассоциаций&lt;i&gt;&lt;/small&gt;</translation>
</message>
<message>
<source>Complete List of IP addresses from INIT Chunk:</source>
@@ -10367,6 +10946,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Байты пакета</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation>&lt;b&gt;Опции:&lt;/b&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Поиск строк, содержащих символы в обычной (UTF-8 и ASCII) или многобайтовой (UTF-16) кодировке.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10387,6 +10970,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Чувствительность к регистру</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation>Назад</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Поиск последующего вхождения в текущем пакете перед переходом к следующему пакету.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation>Множественные случаи</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Поиск данных можно выполнять с использованием фильтров отображения (например, «ip.addr==10.1.1.1»), шестнадцатеричных строк (например, «fffffda5»), обычных текстовых строк (например, «Моя строка») и регулярных выражений (например, «colou?r»).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10424,6 +11019,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Недопустимый фильтр.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation>Список событий</translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation>Подробности события</translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation>Байты событий</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Поиск в колонке &quot;Информация&quot; списка событий (панель сводки), в декодированных метках отображения событий (панель древовидного представления) или в преобразованных в ASCII данных события (панель шестнадцатеричного представления).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Этот фильтр не производит тестирование.</translation>
</message>
@@ -10488,18 +11099,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message numerus="yes">
<source>%Ln node(s)</source>
- <translation type="unfinished">
- <numerusform>%Ln node</numerusform>
- <numerusform>%Ln nodes</numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln узел</numerusform>
+ <numerusform>%Ln узла</numerusform>
+ <numerusform>%Ln узлов</numerusform>
</translation>
</message>
<message numerus="yes">
<source>%Ln item(s)</source>
- <translation type="unfinished">
- <numerusform>%Ln item</numerusform>
- <numerusform>%Ln items</numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln элемент</numerusform>
+ <numerusform>%Ln элемента</numerusform>
+ <numerusform>%Ln элементов</numerusform>
</translation>
</message>
<message>
@@ -10869,15 +11480,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Найти:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation>С учетом регистра</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Найти &amp;следующий</translation>
</message>
<message numerus="yes">
<source>Frame %1, %2, %Ln byte(s).</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>Кадр %1, %2, %Ln байт.</numerusform>
+ <numerusform>Кадров %1, %2, %Ln байт.</numerusform>
+ <numerusform>Кадров %1, %2, %Ln байт.</numerusform>
</translation>
</message>
<message>
@@ -10965,15 +11580,23 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Сохранить как…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation>Расшифровано как %1.</translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Сохранение выбранных байтов пакета как…</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation>сжато %1</translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <source>Using %Ln byte(s).</source>
+ <translation>
+ <numerusform>Использование %Ln байта.</numerusform>
+ <numerusform>Использование %Ln байта.</numerusform>
+ <numerusform>Использование %Ln байт.</numerusform>
</translation>
</message>
<message>
@@ -11045,7 +11668,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Applying changed preferences</source>
- <translation type="unfinished"></translation>
+ <translation>Применение измененных предпочтений</translation>
</message>
<message>
<source>(Unknown action)</source>
@@ -11073,6 +11696,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Фильтр отображения:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation>Полосатые заголовки</translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11725,51 +12352,51 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>TLSKeylogDialog</name>
<message>
<source>Dialog</source>
- <translation type="unfinished"></translation>
+ <translation>Диалог</translation>
</message>
<message>
<source>Browse…</source>
- <translation type="unfinished">Обзор…</translation>
+ <translation>Просмотреть...</translation>
</message>
<message>
<source>Command line</source>
- <translation type="unfinished"></translation>
+ <translation>Командная строка</translation>
</message>
<message>
<source>Run an application with the SSLKEYLOGFILE environment variable set to the file specified by the TLS key log filename preference. This enables TLS decryption in Wireshark. Set the key log file and start the capture before launching the application to ensure that the initial TLS handshakes are captured.</source>
- <translation type="unfinished"></translation>
+ <translation>Запустите приложение с переменной окружения SSLKEYLOGFILE, установленной на файл, указанный в параметре &quot;Имя файла журнала ключей TLS&quot;. Это позволяет расшифровать TLS в Wireshark. Установите файл журнала ключей и запустите захват перед запуском приложения, чтобы обеспечить захват начальных рукопожатий TLS.</translation>
</message>
<message>
<source>&lt;span style=&quot; font-size:small;&quot;&gt;Firefox and Chrome are known to work. If your desired browser is currently running, close it first before launching it below. Command line options are supported.&lt;/span&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;span style=&quot; font-size:small;&quot;&gt;Известно, что Firefox и Chrome работают. Если нужный вам браузер запущен, закройте его, прежде чем запускать ниже. Поддерживаются параметры командной строки.&lt;/span&gt;</translation>
</message>
<message>
<source>TLS (Pre)-Master-Secret log file path (tls.keylog_file)</source>
- <translation type="unfinished"></translation>
+ <translation>Путь к файлу журнала TLS (Предварительный) - Мастер-секрет (tls.keylog_file)</translation>
</message>
<message>
<source>&lt;span style=&quot; font-size:small;&quot;&gt;TLS session secrets will be logged to this file. If you change this field, hit the Save button to update the TLS protocol preferences.&lt;/span&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;span style=&quot; font-size:small;&quot;&gt;В этот файл будут записываться секреты сеанса TLS. Если вы измените это поле, нажмите кнопку Сохранить, чтобы обновить настройки протокола TLS.&lt;/span&gt;</translation>
</message>
<message>
<source>Launch application with SSLKEYLOGFILE</source>
- <translation type="unfinished"></translation>
+ <translation>Запуск приложения с SSLKEYLOGFILE</translation>
</message>
<message>
<source>Launch</source>
- <translation type="unfinished"></translation>
+ <translation>Запуск</translation>
</message>
<message>
<source>Save</source>
- <translation type="unfinished">Сохранить</translation>
+ <translation>Сохранить</translation>
</message>
<message>
<source>TLS Keylog file</source>
- <translation type="unfinished"></translation>
+ <translation>Файл журнала ключей TLS</translation>
</message>
<message>
<source>Program to start with SSLKEYLOGFILE</source>
- <translation type="unfinished"></translation>
+ <translation>Программа для запуска с SSLKEYLOGFILE</translation>
</message>
</context>
<context>
@@ -11889,7 +12516,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Time shifting is not available while capturing packets.</source>
- <translation type="unfinished"></translation>
+ <translation>Перемещение по времени при захвате пакетов недоступно.</translation>
</message>
</context>
<context>
@@ -12046,22 +12673,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Создать новую запись.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Удалить эту запись.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Удалить выбранную запись(и).</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Копировать эту запись.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Копирование выбранной записи (записей).</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Переместить запись выше.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Переместите выбранную запись(и) вверх.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Переместить запись ниже.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Переместите выбранную запись(и) вниз.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12087,20 +12712,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Создать новую запись.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Удалить эту запись.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation>Удалите выбранную запись(и).</translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Копировать эту запись.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation>Копирование выбранной записи (записей).</translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Переместить запись выше.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation>Переместите выбранную запись(и) вверх.</translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Переместить запись ниже.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation>Переместите выбранную запись(и) вниз.</translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12461,10 +13086,10 @@ a:hover {
</message>
<message numerus="yes">
<source>%n interface(s) shown, %1 hidden</source>
- <translation type="unfinished">
- <numerusform>%n interface shown, %1 hidden</numerusform>
- <numerusform>%n interfaces shown, %1 hidden</numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%n интерфейсов показано, %1 скрыт</numerusform>
+ <numerusform>%n интерфейсов показано, %1 скрыто</numerusform>
+ <numerusform>%n интерфейсов показано, %1 скрыто</numerusform>
</translation>
</message>
<message>
@@ -12472,10 +13097,18 @@ a:hover {
<translation>Все составные звенья Интернета анализировать поможет Wireshark </translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation>Вы нюхаете клей, который держит вашу систему вместе, используя Logray. </translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Работа производится в Wireshark </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation>Вы используете Logray </translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation> Обновления выполняются автоматически.</translation>
</message>
@@ -12752,14 +13385,6 @@ a:hover {
<translation>Файлы не найдены</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Содержание</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Фильтр Wireshark</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -13025,10 +13650,6 @@ a:hover {
<translation>Панель инструментов беспроводного соединения</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Содержание справки</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>Вопросы и ответы</translation>
</message>
@@ -13149,11 +13770,6 @@ a:hover {
<translation>Найти предыдущий пакет</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Установить/снять отметку пакета (пакетов)</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Отметить всё отображаемое</translation>
</message>
@@ -13182,11 +13798,6 @@ a:hover {
<translation>Перейти к предыдущему отмеченному пакету</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Игнорировать/отменить игнорирование пакета</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Игнорировать всё отображаемое</translation>
</message>
@@ -13627,32 +14238,28 @@ a:hover {
<translation>Сбросить разметку</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Сбросить внешний вид разметки к размеру по умолчанию</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>Количество секунд с момента захвата первого пакета</translation>
</message>
<message>
<source>Show packet times as the seconds since the first captured packet.</source>
- <translation type="unfinished"></translation>
+ <translation>Показывает время прохождения пакетов в секундах с момента первого захваченного пакета.</translation>
</message>
<message>
<source>Tenths of a millisecond</source>
- <translation type="unfinished"></translation>
+ <translation>Десятые доли миллисекунды</translation>
</message>
<message>
<source>Hundredths of a millisecond</source>
- <translation type="unfinished"></translation>
+ <translation>Сотые доли миллисекунды</translation>
</message>
<message>
<source>Tenths of a microsecond</source>
- <translation type="unfinished"></translation>
+ <translation>Десятые доли микросекунды</translation>
</message>
<message>
<source>Hundredths of a microsecond</source>
- <translation type="unfinished"></translation>
+ <translation>Сотые доли микросекунды</translation>
</message>
<message>
<source>Packet &amp;Diagram</source>
@@ -13788,25 +14395,33 @@ a:hover {
</message>
<message>
<source>MAC Address Blocks</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>TLS Keylog Launcher</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Release Notes</source>
- <translation type="unfinished"></translation>
+ <translation>Блокировка MAC-адресов</translation>
</message>
<message>
<source>&amp;Options…</source>
<translation>&amp;Опции…</translation>
</message>
<message>
+ <source>&amp;3GPP Uu</source>
+ <translation>&amp;3GPP Uu</translation>
+ </message>
+ <message>
<source>&amp;Wireless</source>
<translation>&amp;Беспроводная связь</translation>
</message>
<message>
+ <source>&amp;User&apos;s Guide</source>
+ <translation>&amp;Руководство пользователя</translation>
+ </message>
+ <message>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation>Руководство пользователя Wireshark</translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
+ <translation>Фильтры дисплея</translation>
+ </message>
+ <message>
<source>Capture &amp;Filters…</source>
<translation>Фильтры &amp;захвата…</translation>
</message>
@@ -13851,10 +14466,18 @@ a:hover {
<translation>Найти пр&amp;едыдущий</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation>&amp;Маркировать/немаркировать выбранное</translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Установить или снять отметку всех выбранных пакетов</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation>&amp;Игнорировать/Неигнорировать выбранное</translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Игнорировать или отменить игнорирование всех выбранных пакетов</translation>
</message>
@@ -13872,19 +14495,19 @@ a:hover {
</message>
<message>
<source>Inject TLS Secrets</source>
- <translation type="unfinished"></translation>
+ <translation>Инъекция секретов TLS</translation>
</message>
<message>
<source>Embed used TLS secrets in the capture file</source>
- <translation type="unfinished"></translation>
+ <translation>Встраивание используемых секретов TLS в файл захвата</translation>
</message>
<message>
<source>Discard All Secrets</source>
- <translation type="unfinished"></translation>
+ <translation>Выбросить все секреты</translation>
</message>
<message>
<source>Discard all decryption secrets in the capture file</source>
- <translation type="unfinished"></translation>
+ <translation>Отбросьте все секреты расшифровки в файле захвата</translation>
</message>
<message>
<source>&amp;Preferences…</source>
@@ -13895,6 +14518,18 @@ a:hover {
<translation>Пропускная способность TCP</translation>
</message>
<message>
+ <source>General</source>
+ <translation>Общий</translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation>Запрос-ответ</translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation>Статистика DNS-запросов-ответов</translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>Последовательности запросов</translation>
</message>
@@ -13903,6 +14538,14 @@ a:hover {
<translation>Последовательности HTTP-запросов</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation>E2AP</translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation>Сообщения E2AP</translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Декодировать &amp;как…</translation>
</message>
@@ -13963,6 +14606,10 @@ a:hover {
<translation>Обычный размер</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation>Сброс макета до размера по умолчанию</translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Изменить размер столбцов</translation>
</message>
@@ -14221,6 +14868,14 @@ a:hover {
<translation>Перейти к пакету по ссылке из выбранного поля.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation>Запускатель TLS Keylog</translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation>Примечания к выпуску</translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>Вызовы &amp;VoIP</translation>
</message>
@@ -14253,10 +14908,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14541,6 +15192,10 @@ a:hover {
<translation>Выйти &amp;без сохранения</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation>Данные USB CDC</translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>В этой версии Wireshark отсутствует поле «rtp.ssrc».</translation>
</message>
@@ -14602,6 +15257,15 @@ a:hover {
<source>No Keys</source>
<translation>Отсутствуют ключи</translation>
</message>
+ <message numerus="yes">
+ <source>Export SSL Session Keys (%Ln key(s))</source>
+ <oldsource>Export SSL Session Keys (%1 key%2</oldsource>
+ <translation type="vanished">
+ <numerusform>Экспорт ключей сеансов SSL (%Ln ключа)</numerusform>
+ <numerusform>Экспорт ключей сеансов SSL (%Ln ключа)</numerusform>
+ <numerusform>Экспорт ключей сеансов SSL (%Ln ключей)</numerusform>
+ </translation>
+ </message>
<message>
<source>Raw data (*.bin *.dat *.raw);;All Files (</source>
<translation>Необработанные данные (*.bin *.dat *.raw);;Все Файлы (</translation>
@@ -14671,10 +15335,10 @@ a:hover {
</message>
<message numerus="yes">
<source>Delete comments from %n packet(s)</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>Удалить комментарии из %n пакета(ов)</numerusform>
+ <numerusform>Удалить комментарии из %n пакета(ов)</numerusform>
+ <numerusform>Удалить комментарии из %n пакета(ов)</numerusform>
</translation>
</message>
<message>
@@ -14691,7 +15355,7 @@ a:hover {
</message>
<message>
<source> before updating</source>
- <translation type="unfinished"></translation>
+ <translation> перед обновлением</translation>
</message>
<message>
<source>There are no TLS Session Keys to save.</source>
@@ -14699,10 +15363,10 @@ a:hover {
</message>
<message numerus="yes">
<source>Export TLS Session Keys (%Ln key(s))</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>Экспорт ключей сеанса TLS (%Ln ключ)</numerusform>
+ <numerusform>Экспорт ключей сеанса TLS (%Ln ключа)</numerusform>
+ <numerusform>Экспорт ключей сеанса TLS (%Ln ключей)</numerusform>
</translation>
</message>
<message>
@@ -14711,15 +15375,15 @@ a:hover {
</message>
<message>
<source>No TLS Secrets</source>
- <translation type="unfinished"></translation>
+ <translation>Нет секретов TLS</translation>
</message>
<message>
<source>There are no available secrets used to decrypt TLS traffic in the capture file. Would you like to view information about how to decrypt TLS traffic on the wiki?</source>
- <translation type="unfinished"></translation>
+ <translation>В файле захвата нет доступных секретов, используемых для расшифровки трафика TLS. Вы хотите просмотреть информацию о расшифровке трафика TLS в вики?</translation>
</message>
<message>
<source>Are you sure you want to discard all decryption secrets?</source>
- <translation type="unfinished"></translation>
+ <translation>Вы уверены, что хотите выбросить все секреты расшифровки?</translation>
</message>
<message>
<source>No filter available. Try another %1.</source>
diff --git a/ui/qt/wireshark_sv.ts b/ui/qt/wireshark_sv.ts
index d9936d05..a12781ae 100644
--- a/ui/qt/wireshark_sv.ts
+++ b/ui/qt/wireshark_sv.ts
@@ -44,8 +44,8 @@
<translation>Mappar</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Filtrera efter sökväg</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Licens</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Katalogen finns inte</translation>
</message>
@@ -755,6 +763,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation type="unfinished">Avsnitt %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -840,10 +870,6 @@
<translation>Läsfilter:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>Komprimera med g&amp;zip</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Öppna fångstfil</translation>
@@ -925,8 +951,8 @@
<translation>Detaljer</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Fångstfilkommentarer</translation>
+ <source>Edit Comments</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
@@ -937,10 +963,6 @@
<translation>Kopiera till urklipp</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Spara kommentarer</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Fångstfilegenskaper</translation>
</message>
@@ -989,10 +1011,18 @@
<translation>Första paket</translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Sista paket</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Förflutet</translation>
</message>
@@ -1029,6 +1059,10 @@
<translation>Släppta paket</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Fångstfilter</translation>
</message>
@@ -1041,6 +1075,10 @@
<translation>Storleksgräns på paket (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>ingen</translation>
</message>
@@ -1049,6 +1087,26 @@
<translation>%1 byte</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation type="unfinished">Kommentarer</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation type="unfinished">Typ</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation type="unfinished">Storlek</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Statistik</translation>
</message>
@@ -1073,6 +1131,10 @@
<translation>Paket</translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished">Händelser</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Tidsintervall, s</translation>
</message>
@@ -1085,6 +1147,10 @@
<translation>Genomsnittlig paketstorlek, B</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Byte</translation>
</message>
@@ -1097,14 +1163,14 @@
<translation>Genomsnittligt bitar/s</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Avsnittskommentar</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Paketkommentarer</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Ram %1:</translation>
</message>
@@ -1116,6 +1182,12 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1343,6 +1415,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid hel timma.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>compression</source>
<translation>komprimering</translation>
</message>
@@ -1355,6 +1435,30 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Efter att infångandet har bytt till nästa fil och det angivna antalet filer har överskridits tas den äldsta filen bort.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1443,6 +1547,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sluta fånga efter att det angivna antalet filer har skapats.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sluta fånga efter att den angivna mängden data har infångats.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1503,8 +1611,8 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Fel</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Flera filer: den begärda filstorleken är för stor. Filstorleken får inte vara större än 2 GiB.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1534,6 +1642,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Fånga paket i promiskuöst läge</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Fånga paket i nästa generations format för fångstfiler.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1761,6 +1877,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Uppslagen</translation>
</message>
<message>
+ <source>Width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;Visa mänskligt läsbara strängar istället för råa värden för fält. Endast tillämpligt på anpassade kolumner med fält som har värdesträngar.&lt;/html&gt;</translation>
</message>
@@ -1808,6 +1932,25 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1847,7 +1990,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Packets B </source>
- <translation type="unfinished"></translation>
+ <translation>Paket B</translation>
</message>
<message>
<source>Bytes B </source>
@@ -1874,6 +2017,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Bitar/s B</translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Totalt antal paket</translation>
</message>
@@ -1988,23 +2135,31 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Kopiera paketbyte som en hex-dump.</translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>…as C String</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>…as Go literal</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -2012,16 +2167,32 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>… som en hex-ström</translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>Kopiera paketbyte som en ström av hex.</translation>
</message>
<message>
<source>…as a Base64 String</source>
- <translation type="unfinished"></translation>
+ <translation>… som en Base64-sträng</translation>
</message>
<message>
<source>Copy packet bytes as a base64 encoded string.</source>
- <translation type="unfinished"></translation>
+ <translation>Kopiera paketbyte som en Base64-kodad sträng.</translation>
</message>
<message>
<source>Copy packet bytes as application/octet-stream MIME data.</source>
@@ -2173,7 +2344,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Invalid filter: </source>
- <translation type="unfinished">Felaktigt filter: </translation>
+ <translation>Felaktigt filter: </translation>
</message>
<message>
<source>Save this filter</source>
@@ -2325,7 +2496,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Dissector Description</source>
- <translation type="unfinished"></translation>
+ <translation>Dissekeringsbeskrivning</translation>
</message>
<message>
<source>Integer</source>
@@ -2470,11 +2641,11 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Latitude</source>
- <translation type="unfinished"></translation>
+ <translation>Latitud</translation>
</message>
<message>
<source>Longitude</source>
- <translation type="unfinished"></translation>
+ <translation>Longitud</translation>
</message>
<message>
<source>AS Number</source>
@@ -2807,6 +2978,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<source>Display filter:</source>
<translation>Visningsfilter:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2846,10 +3021,6 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Starta</translation>
</message>
<message>
- <source>Save</source>
- <translation>Spara</translation>
- </message>
- <message>
<source>Default</source>
<translation>Standard</translation>
</message>
@@ -2991,6 +3162,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Visningsfilter</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Open </source>
<translation>Öppna </translation>
</message>
@@ -3074,10 +3253,18 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Filternamn</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Filteruttryck</translation>
</message>
@@ -3163,22 +3350,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>”Arkiv”-dialoger</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>fångstfiler</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Temp</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>namnlösa fångstfiler</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Personlig konfiguration</translation>
</message>
@@ -3187,14 +3362,6 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Global konfiguration</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>dfilter, inställningar, ether:ar, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>dfilter, inställningar, manuf, …</translation>
- </message>
- <message>
<source>System</source>
<translation>System</translation>
</message>
@@ -3207,18 +3374,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Program</translation>
</message>
<message>
- <source>program files</source>
- <translation>programfiler</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Personliga insticksmoduler</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>binära insticksmoduler</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Globala insticksmoduler</translation>
</message>
@@ -3232,6 +3391,30 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Lua scripts</source>
+ <translation>Lua-skript</translation>
+ </message>
+ <message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3239,7 +3422,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Personlig extcap-sökväg</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3363,6 +3546,24 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation>Klicka för att välja.</translation>
</message>
@@ -3392,6 +3593,18 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>%1 stream not found on the selected packet.</source>
+ <translation>%1-strömmar fanns inte i det valda paketet.</translation>
+ </message>
+ <message>
+ <source>Read activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3410,10 +3623,6 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<source>Save Stream Content As…</source>
<translation>Spara ströminnehållet som …</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[Strömutdatan avhuggen]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation>
@@ -3423,9 +3632,9 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message numerus="yes">
<source>Max sub stream ID for the selected stream: %Ln</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>Maximalt underströms-ID för den valda strömmen: %Ln</numerusform>
+ <numerusform>Maximalt underströms-ID för den valda strömmen: %Ln</numerusform>
</translation>
</message>
<message>
@@ -3441,9 +3650,20 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Tips.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Visa data som</translation>
+ <source>Show as</source>
+ <translation type="unfinished">Visa som</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Stream</source>
@@ -3458,11 +3678,22 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Sök:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Skiftlägeskänsligt</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Sök &amp;nästa</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3798,28 +4029,27 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Ta bort denna graf.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Lägg till en ny graf.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Dubblera denna graf.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Nollställ alla grafer.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
+ <source>Remove the selected graph(s).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Duplicate the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3863,10 +4093,6 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation>Återställ</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Återställ grafen</translation>
</message>
@@ -4080,6 +4306,42 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Kopiera grafer från en annan profil.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4124,6 +4386,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>5 s</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10 min {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10 min {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Wireshark I/O-grafer: %1</translation>
</message>
@@ -4136,6 +4406,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Alla paket</translation>
</message>
@@ -4148,7 +4426,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4196,6 +4474,34 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Klicka för att välja en del av grafen.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Portable Document Format (*.pdf)</translation>
</message>
@@ -4948,6 +5254,13 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished">standard</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5898,11 +6211,11 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Maximum number of cached rows (affects sorting)</source>
- <translation type="unfinished"></translation>
+ <translation>Maximalt antal cachade rader (påverkar sortering)</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If more than this many rows are displayed, then sorting by columns that require packet dissection will be disabled. Increasing this number increases memory consumption by caching column values.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Om mer än så här många rader visas kommer sortering enligt kolumner som kräver paketdissekering att avaktiveras. Att öka detta tal ökar minnesförbrukningen genom att kolumnvärden cachas.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Enable mouse-over colorization</source>
@@ -5924,8 +6237,8 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>LTE Mac-statistik</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6229,12 +6542,12 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Sekvensnummer</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>LTE RLC-graf (UE=%1 kan=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>LTE RLC-graf – ingen kanal vald</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Save As…</source>
@@ -6288,8 +6601,8 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>LTE RLC-statistik</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6375,6 +6688,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Profil: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Hantera profiler …</translation>
</message>
@@ -6436,6 +6753,13 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<numerusform>%Ln byte</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>Byte %1</translation>
@@ -6449,9 +6773,12 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Välj paket: %1 %2</translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Paket: %1 %4 Visat: %2 (%3 %)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6483,20 +6810,24 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Inga paket</translation>
</message>
<message>
- <source>From Zip File...</source>
+ <source>No Events</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>From Zip File...</source>
+ <translation>Från en zip-fil …</translation>
+ </message>
+ <message>
<source>From Directory...</source>
- <translation type="unfinished"></translation>
+ <translation>Från en katalog …</translation>
</message>
<message>
<source>Selected Personal Profile...</source>
- <translation type="unfinished"></translation>
+ <translation>Vald personlig profil …</translation>
</message>
<message>
<source>All Personal Profiles...</source>
- <translation type="unfinished"></translation>
+ <translation>Alla personliga profiler …</translation>
</message>
<message>
<source>Packets: %1</source>
@@ -6515,6 +6846,13 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6546,6 +6884,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Den senast använda mappen</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Visa upp till</translation>
</message>
@@ -6976,6 +7318,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Visa fältvärden</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">Uppdatera</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Spara diagrammet som …</translation>
</message>
@@ -7023,6 +7369,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Visa paketbyte</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Paket %1</translation>
</message>
@@ -7045,6 +7395,13 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<numerusform>%Ln byte</numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7203,11 +7560,11 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<name>PacketListModel</name>
<message>
<source>Column</source>
- <translation type="unfinished"></translation>
+ <translation>Kolumn</translation>
</message>
<message>
<source>%1 can only be sorted with %2 or fewer visible rows; increase cache size in Layout preferences</source>
- <translation type="unfinished"></translation>
+ <translation>%1 kan bara sorteras med %2 eller färre synliga rader; öka cachestorleken i inställningarna av layout</translation>
</message>
<message>
<source>Sorting &quot;%1&quot;…</source>
@@ -7215,7 +7572,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Sorting …</source>
- <translation type="unfinished"></translation>
+ <translation>Sortering …</translation>
</message>
</context>
<context>
@@ -7504,10 +7861,22 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Kopiera denna profil.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Konfigurationsprofiler</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>Import</translation>
@@ -7519,22 +7888,22 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>From Zip File...</source>
- <translation type="unfinished"></translation>
+ <translation>Från en zip-fil …</translation>
</message>
<message>
<source>From Directory...</source>
- <translation type="unfinished"></translation>
+ <translation>Från en katalog …</translation>
</message>
<message numerus="yes">
<source>%Ln Selected Personal Profile(s)...</source>
- <translation type="unfinished">
- <numerusform></numerusform>
- <numerusform></numerusform>
+ <translation>
+ <numerusform>%Ln vald personlig profil …</numerusform>
+ <numerusform>%Ln valda personliga profiler …</numerusform>
</translation>
</message>
<message>
<source>All Personal Profiles...</source>
- <translation type="unfinished"></translation>
+ <translation>Alla personliga profiler …</translation>
</message>
<message>
<source>New profile</source>
@@ -7676,6 +8045,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>borttagen</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>kopia</translation>
@@ -8199,6 +8572,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Saknad markör?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8219,6 +8600,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL-ramar</translation>
</message>
@@ -8442,12 +8827,72 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<source>Browse…</source>
<translation>Bläddra…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished">Vänster</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished">Höger</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
- <translation>CCCH</translation>
+ <translation type="unfinished">CCCH</translation>
</message>
</context>
<context>
@@ -8545,6 +8990,13 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8660,6 +9112,14 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Uppslagna adresser</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished">Kopiera</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation type="unfinished">Spara som …</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Uppslagna adresser hittade i %1</translation>
</message>
@@ -8673,6 +9133,61 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished">som CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished">som JSON</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished">Vanlig text (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished">Varning</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10347,6 +10862,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Paketbyte</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sök efter strängar som innehåller smala (UTF-8 och ASCII) eller breda (UTF-16) tecken.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10367,6 +10886,18 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Skiftlägeskänsligt</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sök efter data med användning av visningsfiltersyntax (t.ex. ip.addr==10.1.1.1), en hexadecimal sträng (t.ex. fffffda5), en enkel sträng (t.ex. Min Sträng) eller ett reguljärt uttryck (t.ex. schyss?t).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10404,6 +10935,22 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Felaktigt filter.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Det filtret testar inte någonting.</translation>
</message>
@@ -10847,6 +11394,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Sök:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Skiftlägeskänsligt</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Sök &amp;nästa</translation>
</message>
@@ -10875,7 +11426,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Percent-Encoding</source>
- <translation type="unfinished"></translation>
+ <translation>Procentkodning</translation>
</message>
<message>
<source>Quoted-Printable</source>
@@ -10942,14 +11493,22 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Spara som …</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Spara valda paketbyte som …</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
- <translation>
- <numerusform>Visar %Ln byte.</numerusform>
- <numerusform>Visar %Ln byte.</numerusform>
+ <source>Using %Ln byte(s).</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -11049,6 +11608,10 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<source>Display filter:</source>
<translation>Visningsfilter:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11100,7 +11663,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<name>SyntaxLineEdit</name>
<message>
<source>Invalid filter: %1</source>
- <translation type="unfinished"></translation>
+ <translation>Felaktigt filter: %1</translation>
</message>
<message>
<source>&quot;%1&quot; is deprecated in favour of &quot;%2&quot;. See Help section 6.4.8 for details.</source>
@@ -11737,7 +12300,7 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
</message>
<message>
<source>Save</source>
- <translation type="unfinished">Spara</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>TLS Keylog file</source>
@@ -12022,22 +12585,20 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Skapa en ny post.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Ta bort denna post.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Kopiera denna post.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Flytta upp posten.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Flytta ned posten.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12063,20 +12624,20 @@ Till exempel, använd 1 timma för att en ny fil skall skapas varje timma vid he
<translation>Skapa en ny post.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Ta bort denna post.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Kopiera denna post.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Flytta upp posten.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Flytta ned posten.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12375,7 +12936,49 @@ a:hover {
&lt;/tr&gt;&lt;/table&gt;
&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head&gt;
+&lt;style&gt;
+a:link {
+ color: palette(text);
+ text-decoration: none;
+}
+a:hover {
+ color: palette(text);
+ text-decoration: underline;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;table&gt;&lt;tr&gt;
+&lt;th&gt;&lt;a href=&quot;https://www.wireshark.org/docs/wsug_html_chunked/&quot;&gt;Användarguide&lt;/a&gt;&lt;/th&gt;
+
+&lt;td style=&quot;padding-left: 8px; padding-right: 8px;&quot;&gt;·&lt;/td&gt;
+
+&lt;th&gt;&lt;a href=&quot;https://gitlab.com/wireshark/wireshark/-/wikis/&quot;&gt;Wiki&lt;/a&gt;&lt;/th&gt;
+
+&lt;td style=&quot;padding-left: 8px; padding-right: 8px;&quot;&gt;·&lt;/td&gt;
+
+&lt;th&gt;&lt;a href=&quot;https://ask.wireshark.org/&quot;&gt;Frågor och svar&lt;/a&gt;&lt;/th&gt;
+
+&lt;td style=&quot;padding-left: 8px; padding-right: 8px;&quot;&gt;·&lt;/td&gt;
+
+&lt;th&gt;&lt;a href=&quot;https://www.wireshark.org/lists/&quot;&gt;Sändlistor&lt;/a&gt;&lt;/th&gt;
+
+&lt;td style=&quot;padding-left: 8px; padding-right: 8px;&quot;&gt;·&lt;/td&gt;
+
+&lt;th&gt;&lt;a href=&quot;https://sharkfest.wireshark.org/&quot;&gt;SharkFest&lt;/a&gt;&lt;/th&gt;
+
+&lt;td style=&quot;padding-left: 8px; padding-right: 8px;&quot;&gt;·&lt;/td&gt;
+
+&lt;th&gt;&lt;a href=&quot;https://discord.com/invite/ts9GZCjGj5&quot;&gt;Wireshark Discord&lt;/a&gt;&lt;/th&gt;
+
+&lt;td style=&quot;padding-left: 8px; padding-right: 8px;&quot;&gt;·&lt;/td&gt;
+
+&lt;th&gt;&lt;a href=&quot;https://wiresharkfoundation.org/donate/&quot;&gt;Donate&lt;/a&gt;&lt;/th&gt;
+
+&lt;/tr&gt;&lt;/table&gt;
+&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Show in Finder</source>
@@ -12405,10 +13008,18 @@ a:hover {
<translation>Du luktar på limmet som håller samman Internet med Wireshark</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Du kör Wireshark</translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation>Du får automatiska uppdateringar.</translation>
</message>
@@ -12685,14 +13296,6 @@ a:hover {
<translation>Inga filer hittades</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Innehåll</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Wireshark-filter</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12942,7 +13545,7 @@ a:hover {
</message>
<message>
<source>&amp;DTN</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;DTN</translation>
</message>
<message>
<source>Osmux</source>
@@ -12958,10 +13561,6 @@ a:hover {
<translation>Verktygsrad för trådlöst</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Hjälpinnehåll</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>Frågor och svar</translation>
</message>
@@ -13082,11 +13681,6 @@ a:hover {
<translation>Sök efter föregående paket</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Markera/avmarkera paket</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Markera alla visade</translation>
</message>
@@ -13115,11 +13709,6 @@ a:hover {
<translation>Gå till föregående märkta paket</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Ignorera/avignorera paket</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Ignorera alla visade</translation>
</message>
@@ -13409,11 +13998,11 @@ a:hover {
</message>
<message>
<source>&amp;LTP</source>
- <translation type="unfinished"></translation>
+ <translation>&amp;LTP</translation>
</message>
<message>
<source>LTP segment and block statistics</source>
- <translation type="unfinished"></translation>
+ <translation>LTP-segment- och blockstatistik</translation>
</message>
<message>
<source>&amp;ISUP Messages</source>
@@ -13560,10 +14149,6 @@ a:hover {
<translation>Återställ layouten</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Återställ utseendelayouten till sin standardstorlek</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>Sekunder sedan första fångade paket</translation>
</message>
@@ -13724,20 +14309,28 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>&amp;Alternativ …</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;Wireless</source>
+ <translation>&amp;Trådlöst</translation>
+ </message>
+ <message>
+ <source>&amp;User&apos;s Guide</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>&amp;Alternativ …</translation>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
- <translation>&amp;Trådlöst</translation>
+ <source>Display Filters</source>
+ <translation type="unfinished">Visningsfilter</translation>
</message>
<message>
<source>Capture &amp;Filters…</source>
@@ -13784,10 +14377,18 @@ a:hover {
<translation>Sök f&amp;öregående</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Markera eller avmarkera varje valt paket</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Ignorera eller avignorera varje valt paket</translation>
</message>
@@ -13828,6 +14429,18 @@ a:hover {
<translation>TCP-genomströmning</translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>Begärandesekvenser</translation>
</message>
@@ -13836,6 +14449,14 @@ a:hover {
<translation>HTTP-begärandesekvenser</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Avkoda &amp;som …</translation>
</message>
@@ -13896,6 +14517,10 @@ a:hover {
<translation>Normal storlek</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Ändra storlek på kolumner</translation>
</message>
@@ -14154,6 +14779,14 @@ a:hover {
<translation>Gå till paketet refererat av det valda fältet.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;VoIP-anrop</translation>
</message>
@@ -14186,10 +14819,6 @@ a:hover {
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14474,6 +15103,10 @@ a:hover {
<translation>Avsluta &amp;utan att spara</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>Det finns inget &quot;rtp.ssrc&quot;-fält i denna version av Wireshark.</translation>
</message>
diff --git a/ui/qt/wireshark_tr_TR.ts b/ui/qt/wireshark_tr_TR.ts
index 1328942d..85e0e3aa 100644
--- a/ui/qt/wireshark_tr_TR.ts
+++ b/ui/qt/wireshark_tr_TR.ts
@@ -44,8 +44,8 @@
<translation>Klasörler</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Yola göre filtrele</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Lisans</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>Logray Hakkında</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Dizin mevcut değil</translation>
</message>
@@ -730,11 +738,11 @@
</message>
<message>
<source>…as decimal</source>
- <translation type="unfinished"></translation>
+ <translation>…ondalık sayı olarak</translation>
</message>
<message>
<source>…as octal</source>
- <translation type="unfinished"></translation>
+ <translation>…sekizli olarak</translation>
</message>
<message>
<source>…as bits</source>
@@ -754,6 +762,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation>Yakalama Yorumlarını Düzenle</translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation>Yorum Ekle</translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation>Bölüm %1</translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation>Yorum %1</translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -839,10 +869,6 @@
<translation>Filtreyi oku:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>G&amp;zip ile sıkıştır</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Yakalama Dosyasını Aç</translation>
@@ -921,8 +947,8 @@
<translation>Detaylar</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Dosya yorumlarını yakala</translation>
+ <source>Edit Comments</source>
+ <translation>Yorumları Düzenle</translation>
</message>
<message>
<source>Refresh</source>
@@ -933,10 +959,6 @@
<translation>Panoya Kopyala</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Yorumları Kaydet</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Yakalama Dosyası Özellikleri</translation>
</message>
@@ -985,10 +1007,18 @@
<translation>İlk paket</translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Son paket</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Geçen</translation>
</message>
@@ -1025,6 +1055,10 @@
<translation>Bırakılan paketler</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Yakalama filtresi</translation>
</message>
@@ -1037,6 +1071,10 @@
<translation>Paket boyutu sınırı (snaplen)</translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>yok</translation>
</message>
@@ -1045,6 +1083,26 @@
<translation>%1 bayt</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation>Yorumlar</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation>Yorum %1:</translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation>Şifre Çözme Sırları</translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation>Tür</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation>Boyut</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>İstatistikler</translation>
</message>
@@ -1069,6 +1127,10 @@
<translation>Paketler</translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished">Etkinlikler</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Zaman aralığı, s</translation>
</message>
@@ -1081,6 +1143,10 @@
<translation>Ortalama paket boyutu, B</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Bayt</translation>
</message>
@@ -1093,14 +1159,14 @@
<translation>Ortalama bit/sn</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation>Bölüm Yorumu</translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>Paket Yorumları</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;Çerçeve %1: </translation>
</message>
@@ -1112,6 +1178,14 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation>Logray %1 tarafından oluşturuldu
+
+</translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1339,6 +1413,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
Örneğin, her saat başı yeni bir dosyanın oluşturulması için 1 saat kullanın.</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;/html&gt;&lt;head/&gt;&lt;/body&gt;&lt;/p&gt;Genellikle bir kablosuz ağ kartı, yalnızca kendi ağ adresine gönderilen ve ondan gelen trafiği yakalar ve yalnızca &quot;sahte&quot; Ethernet başlıklarıyla &lt;em&gt;kullanıcı verisi&lt;/em&gt; trafiğini yakalar. Kablosuz ağ kartlarının &quot;görebildiği&quot; tüm trafiği yakalamak istiyorsanız veya 802.11 yönetim veya kontrol paketleri veya radyo katmanı bilgileriyle ilgileniyorsanız, bu seçeneği işaretleyin. Monitor modu, kablosuz kart ve sürücüye bağlıdır. WLAN ağlarında paket yakalama hakkında daha fazla ayrıntı için Wiki&apos;ye bakın.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation>Tüm 802.11 arayüzlerinde monitör modunu etkinleştirin</translation>
+ </message>
+ <message>
<source>compression</source>
<translation>sıkıştırma</translation>
</message>
@@ -1351,6 +1433,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation>Dosya ek deseni</translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Çoklu dosya modunda, tarih ve saat ile dosya dizin numarası, dosya adı şablonu ve herhangi bir ek arasına yerleştirilir. Sıralamayı seçin.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tarih ve saat, dosya dizin numarasından önce gelir. Bu, dosyaların oluşturma zamanına göre sıralanmasına ve aynı grup dosyaların yakın bir şekilde sıralanmasına neden olur.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Dosya dizin numarası tarih ve saat öncesinde. Bu, tarihsel Wireshark sıralamasıdır.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Yakalama bir sonraki dosyaya geçtikten ve verilen dosya sayısı aşıldıktan sonra, en eski dosya kaldırılacaktır.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1439,6 +1545,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Belirtilen sayıda dosya oluşturulduktan sonra yakalamayı durdurun.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Belirtilen miktarda veri yakalandıktan sonra yakalamayı durdurun.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1499,8 +1609,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Hata</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
- <translation>Birden çok dosya: İstenen dosya boyutu çok büyük. Dosya boyutu 2 GiB&apos;den büyük olamaz.</translation>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Multiple files: No capture file name given. You must specify a filename if you want to use multiple files.</source>
@@ -1530,6 +1640,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Paketleri karışık modda yakalayın</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Genellikle bir kablosuz ağ kartı, yalnızca kendi ağ adresine gönderilen ve ondan gelen trafiği yakalar ve yalnızca &quot;sahte&quot; Ethernet başlıklarıyla &lt;em&gt;kullanıcı verisi&lt;/em&gt; trafiğini yakalar. Kablosuz ağ kartlarının &quot;görebildiği&quot; tüm trafiği yakalamak istiyorsanız veya 802.11 yönetim veya kontrol paketleri veya radyo katmanı bilgileriyle ilgileniyorsanız, bu seçeneği işaretleyin. Monitor modu, kablosuz kart ve sürücüye bağlıdır. WLAN ağlarında paket yakalama hakkında daha fazla ayrıntı için Wiki&apos;ye bakın.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation>802.11 cihazlarda monitör modunda paketleri yakalayın.</translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Paketleri yeni nesil yakalama dosyası biçiminde yakalayın.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1547,15 +1665,15 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Interval between updates (ms)</source>
- <translation type="unfinished"></translation>
+ <translation>Güncellemeler arasındaki süre (ms)</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;How often the capture notifies the GUI of new packets. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Yakalamanın Arayüz`e yeni paketler hakkında ne sıklıkta bildirimde bulunduğu. Arayüz`ün ne sıklıkta güncellendiğini ve zamanlayıcıların ayrıntı düzeyini etkiler.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The interval between new packet updates. Affects how often the GUI updates and the granularity of timers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Yeni paket güncellemeleri arasındaki süre. Arayüz&apos;ün ne sıklıkla güncellendiğini ve zamanlayıcıların ayrıntısını etkiler.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
<source>Don&apos;t load interfaces on startup</source>
@@ -1757,6 +1875,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Çözüldü</translation>
</message>
<message>
+ <source>Width</source>
+ <translation>Genişlik</translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation>Hizalama</translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation>&lt;html&gt;Alanlar için ham değerler yerine insan tarafından okunabilir dizeleri gösterin. Yalnızca değer dizeleri olan alanlara sahip özel sütunlar için geçerlidir.&lt;/html&gt;</translation>
</message>
@@ -1804,6 +1930,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1870,6 +2015,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Bit/s B </translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation>Toplam Paket</translation>
</message>
@@ -1984,28 +2133,52 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Paket baytlarını hex dökümü olarak kopyalayın.</translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
+ <translation>…MIME Verisi</translation>
+ </message>
+ <message>
+ <source>…as C String</source>
+ <translation>…C Dizesi olarak</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <translation>Paket baytlarını yazdırılabilir ASCII karakterleri ve kaçış dizilerini kopyala.</translation>
+ </message>
+ <message>
+ <source>…as Go literal</source>
+ <translation>…Go literali olarak</translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation>Paket baytlarını Go literali olarak kopyala.</translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>…as a Hex Stream</source>
+ <translation>…Hex Akışı olarak</translation>
+ </message>
+ <message>
+ <source>…as UTF-8 Text</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>…as ASCII Text</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as a Hex Stream</source>
- <translation>…Hex Akışı olarak</translation>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Copy packet bytes as a stream of hex.</source>
@@ -2287,11 +2460,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>DissectorSyntaxLineEdit</name>
<message>
<source>Dissector entry</source>
- <translation type="unfinished"></translation>
+ <translation>Dissektör girişi</translation>
</message>
<message>
<source>Enter a dissector %1</source>
- <translation type="unfinished"></translation>
+ <translation>Bir dissector %1 girin.</translation>
</message>
</context>
<context>
@@ -2803,6 +2976,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Ekran filtresi:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2842,10 +3019,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Başla</translation>
</message>
<message>
- <source>Save</source>
- <translation>Kaydet</translation>
- </message>
- <message>
<source>Default</source>
<translation>Ön tanımlı</translation>
</message>
@@ -2986,6 +3159,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Ekran Filtreleri</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation>Filtre Makrolarını Görüntüle</translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation>Yeni makro</translation>
+ </message>
+ <message>
<source>Open </source>
<translation>Aç </translation>
</message>
@@ -3069,10 +3250,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation>Macro Adı</translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation>Filtre Adı</translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation>Makro İfade</translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation>Filtre İfadesi</translation>
</message>
@@ -3158,22 +3347,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>&quot;Dosya&quot; diyalogları</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>yakalama dosyaları</translation>
- </message>
- <message>
<source>Temp</source>
<translation>Geçici</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>başlıksız yakalama dosyaları</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>Kişisel yapılandırma</translation>
</message>
@@ -3182,14 +3359,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Genel yapılandırma</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation>filtreler, tercihler, eterler, …</translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation>filtreler, tercihler, üretici, …</translation>
- </message>
- <message>
<source>System</source>
<translation>Sistem</translation>
</message>
@@ -3202,18 +3371,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Uygulama</translation>
</message>
<message>
- <source>program files</source>
- <translation>program dosyaları</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>Kişisel Eklentiler</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>ikili eklentiler</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>Genel Eklentiler</translation>
</message>
@@ -3230,12 +3391,36 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Lua betikleri</translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation>Kişisel Excap yolu</translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
- <translation>harici yakalama (extcap) eklentileri</translation>
+ <source>External capture (extcap) plugins</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Global Extcap path</source>
@@ -3282,7 +3467,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>FollowStreamAction</name>
<message>
<source>%1 Stream</source>
- <translation type="unfinished"></translation>
+ <translation>%1 Akış</translation>
</message>
</context>
<context>
@@ -3355,6 +3540,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation>Etkinlik %1.</translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation> Seçmek için tıkla.</translation>
</message>
@@ -3387,6 +3588,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Seçili pakette %1 akışı bulunamadı.</translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation>Etkinliği oku(%6)</translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation>Etkinlik yaz (%6)</translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation>Tüm G/Ç etkinliği (%1)</translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>Tüm konuşma (%1)</translation>
</message>
@@ -3402,10 +3615,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation>Akış İçeriğini Farklı Kaydet…</translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[Akış çıkışı kesildi]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation type="unfinished">
@@ -3431,9 +3640,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>İpucu.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
- <translation>Verileri şu şekilde göster</translation>
+ <source>Show as</source>
+ <translation>Olarak göster</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation>Delta zamanları yok</translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation>Delta zamanlarını çevirin</translation>
+ </message>
+ <message>
+ <source>All delta times</source>
+ <translation>Tüm delta süreleri</translation>
</message>
<message>
<source>Stream</source>
@@ -3448,11 +3668,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Bul:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Büyük küçük harf duyarlı</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Sonrakini &amp;Bul</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation>[Akış çıkışı kesildi]</translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3674,23 +3905,23 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<name>IOConsoleDialog</name>
<message>
<source>Dialog</source>
- <translation type="unfinished"></translation>
+ <translation>İletişim</translation>
</message>
<message>
<source>Enter code</source>
- <translation type="unfinished"></translation>
+ <translation>Kod girin</translation>
</message>
<message>
<source>Evaluate</source>
- <translation type="unfinished"></translation>
+ <translation>Değerlendir</translation>
</message>
<message>
<source>Clear</source>
- <translation type="unfinished">Temiz</translation>
+ <translation>Temizle</translation>
</message>
<message>
<source>Use %1 to evaluate.</source>
- <translation type="unfinished"></translation>
+ <translation>%1 &apos;i değerlendirmek için kullanın.</translation>
</message>
</context>
<context>
@@ -3788,29 +4019,28 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Bu grafiği kaldırın.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Yeni bir grafik ekleyin.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Bu grafiği çoğaltın.</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>Tüm grafikleri temizle.</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
- <translation>Bu grafiği yukarı doğru götür.</translation>
+ <source>Remove the selected graph(s).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
- <translation>Bu grafiği aşağı doğru götür.</translation>
+ <source>Duplicate the selected graph(s).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Mouse</source>
@@ -3853,10 +4083,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation>Sıfırla</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Grafiği Sıfırla</translation>
</message>
@@ -4070,6 +4296,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Grafikleri başka bir profilden kopyalayın.</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1 ms</translation>
</message>
@@ -4114,6 +4376,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>5 san</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10 dakika {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10 dakika {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation>Wireshark G/Ç Grafikleri: %1</translation>
</message>
@@ -4126,6 +4396,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation>Tüm Paketler</translation>
</message>
@@ -4138,7 +4416,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4186,6 +4464,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Grafiğin bir bölümünü seçmek için tıklayın.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Taşınabilir Belge Formatı (*.pdf)</translation>
</message>
@@ -4938,6 +5244,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished">öntanımlı</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5912,8 +6225,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>LTE Mac İstatistikleri</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6217,12 +6530,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Sıra Numarası</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>LTE RLC Grafiği (UE=%1 chan=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>LTE RLC Grafiği - kanal seçilmedi</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Save As…</source>
@@ -6276,8 +6589,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>LTE RLC İstatistikleri</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6363,6 +6676,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Profil: %1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation>Profilleri Yönet…</translation>
</message>
@@ -6423,6 +6740,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>Bayt %1</translation>
@@ -6436,9 +6759,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Seçilen Paket: %1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>Paketler: %1 %4 Görüntülenen: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6470,6 +6796,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Paket Yok</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation>Zip Dosyasından...</translation>
</message>
@@ -6501,6 +6831,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6532,6 +6869,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>En son kullanılan klasör</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>Kadar göster</translation>
</message>
@@ -6715,7 +7056,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Clear</source>
- <translation type="unfinished">Temiz</translation>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -6962,6 +7303,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Alan Değerlerini Göster</translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">Yenile</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation>Şemayı Farklı Kaydet…</translation>
</message>
@@ -7009,6 +7354,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Paket baytlarını göster</translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>Paket %1</translation>
</message>
@@ -7030,6 +7379,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7200,7 +7555,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Sorting …</source>
- <translation type="unfinished"></translation>
+ <translation>Sıralanıyor ...</translation>
</message>
</context>
<context>
@@ -7489,10 +7844,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Bu profili kopyalayın.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Yapılandırma Profilleri</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation>İçe Aktar</translation>
@@ -7656,6 +8023,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>silindi</translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation>kopyala</translation>
@@ -8179,6 +8550,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>İşaretçi eksik mi?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8199,6 +8578,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>YÜ Çerçeveler</translation>
</message>
@@ -8422,12 +8805,72 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation>Gözat…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished">Sol</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished">Sağa</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
- <translation>CCCH</translation>
+ <translation type="unfinished">CCCH</translation>
</message>
</context>
<context>
@@ -8525,6 +8968,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8640,6 +9090,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Çözümlenen Adresler</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished">Kopyala</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># Çözülmüş adresler %1&apos;de bulundu</translation>
</message>
@@ -8653,6 +9111,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished">CSV olarak</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished">JSON olarak</translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished">Düz metin (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished">Uyarı</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -10327,6 +10840,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Paket bayt</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Dar (UTF-8 ve ASCII) veya geniş (UTF-16) karakterler içeren dizeleri arayın.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10347,6 +10864,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Büyük küçük harf duyarlı</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Görüntü filtresi sözdizimini (ör. ip.addr==10.1.1.1), onaltılık bir dizeyi (ör. fffffda5), düz bir dizeyi (ör. My Dize) veya normal bir ifadeyi (ör. colou?r) kullanarak veri arayın.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10384,6 +10913,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Geçersiz filtre.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>O filtre hiçbir şeyi test etmez.</translation>
</message>
@@ -10825,6 +11370,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Bul:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Büyük küçük harf duyarlı</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Sonrakini &amp;Bul</translation>
</message>
@@ -10919,11 +11468,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Farklı kaydet…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation>Seçili Paket Baytlarını Farklı Kaydet…</translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation type="unfinished">
<numerusform></numerusform>
</translation>
@@ -11025,6 +11582,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Görüntüleme filtresi:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11713,7 +12274,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Save</source>
- <translation type="unfinished">Kaydet</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>TLS Keylog file</source>
@@ -11998,22 +12559,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Yeni bir giriş oluşturun.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>Bu girişi kaldırın.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>Bu girişi kopyalayın.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Girişi yukarı taşı.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Girişi aşağı taşı.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12039,20 +12598,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Yeni bir giriş oluşturun.</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>Bu girişi kaldırın.</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>Bu girişi kopyalayın.</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>Girişi yukarı taşı.</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>Girişi aşağı taşı.</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12422,10 +12981,18 @@ a:üzerine gelin{
<translation>Wireshark kullanarak interneti bir arada tutan yapıştırıcıyı kokluyorsunuz </translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>Wireshark&apos;ı çalıştırıyorsunuz </translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation> Otomatik güncelleme alıyorsunuz.</translation>
</message>
@@ -12702,14 +13269,6 @@ a:üzerine gelin{
<translation>Dosya bulunamadı</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;İçerik</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Wireshark Filtresi</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12975,10 +13534,6 @@ a:üzerine gelin{
<translation>Kablosuz Araç Çubuğu</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>Yardım içeriği</translation>
- </message>
- <message>
<source>FAQs</source>
<translation>SSS</translation>
</message>
@@ -13099,11 +13654,6 @@ a:üzerine gelin{
<translation>Önceki paketi bul</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>&amp;Paketi İşaretle/İşaretini Kaldır</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Tüm Görüntülenenleri İşaretle</translation>
</message>
@@ -13132,11 +13682,6 @@ a:üzerine gelin{
<translation>Önceki işaretli pakete git</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>&amp;Paketi Yoksay/Yoksaymaktan vazgeç</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Tüm Görüntülenenleri Yoksay</translation>
</message>
@@ -13577,10 +14122,6 @@ a:üzerine gelin{
<translation>Düzeni Sıfırla</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>Görünüm düzenini varsayılan boyuta sıfırla</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation>İlk Yakalanan Paketten Beri Saniye</translation>
</message>
@@ -13741,20 +14282,28 @@ a:üzerine gelin{
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>&amp;Seçenekler…</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;Wireless</source>
+ <translation>&amp;Kablosuz</translation>
+ </message>
+ <message>
+ <source>&amp;User&apos;s Guide</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>&amp;Seçenekler…</translation>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
- <translation>&amp;Kablosuz</translation>
+ <source>Display Filters</source>
+ <translation type="unfinished">Ekran Filtreleri</translation>
</message>
<message>
<source>Capture &amp;Filters…</source>
@@ -13801,10 +14350,18 @@ a:üzerine gelin{
<translation>Öncekini Bu&amp;l</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation>Seçilen her paketi işaretleyin veya işaretini kaldırın</translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation>Seçilen her paketi yoksay veya yoksay</translation>
</message>
@@ -13845,6 +14402,18 @@ a:üzerine gelin{
<translation>TCP verimi</translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>İstek Dizileri</translation>
</message>
@@ -13853,6 +14422,14 @@ a:üzerine gelin{
<translation>HTTP İstek Dizileri</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Kodu &amp;Çöz…</translation>
</message>
@@ -13913,6 +14490,10 @@ a:üzerine gelin{
<translation>Normal Boyut</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Sütunları Yeniden Boyutlandır</translation>
</message>
@@ -14171,6 +14752,14 @@ a:üzerine gelin{
<translation>Seçili alan tarafından başvurulan pakete gidin.</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;VoIP Aramaları</translation>
</message>
@@ -14203,10 +14792,6 @@ a:üzerine gelin{
<translation>&amp;GSM</translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation>&amp;LTE</translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation>&amp;MTP3</translation>
</message>
@@ -14491,6 +15076,10 @@ a:üzerine gelin{
<translation>Kaydetmeden &amp;çık</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation>Wireshark&apos;ın bu sürümünde &quot;rtp.ssrc&quot; alanı yoktur.</translation>
</message>
diff --git a/ui/qt/wireshark_uk.ts b/ui/qt/wireshark_uk.ts
index 4720152d..f95322a1 100644
--- a/ui/qt/wireshark_uk.ts
+++ b/ui/qt/wireshark_uk.ts
@@ -29,7 +29,7 @@
</message>
<message>
<source>Copy to Clipboard</source>
- <translation type="unfinished"></translation>
+ <translation>Скопіювати до буферу обміну</translation>
</message>
<message>
<source>Authors</source>
@@ -44,8 +44,8 @@
<translation>Каталоги</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>Фільтр за шляхом</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>Ліцензія</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation>Про Logray</translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation>Logray</translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>Директорія не існує</translation>
</message>
@@ -137,14 +145,14 @@
</message>
<message>
<source>Can&apos;t assign %1 to %2.</source>
- <translation type="unfinished"></translation>
+ <translation>Неможливо призначити %1 до %2.</translation>
</message>
</context>
<context>
<name>AdvancedPrefsModel</name>
<message>
<source>Name</source>
- <translation type="unfinished"></translation>
+ <translation>Ім&apos;я</translation>
</message>
<message>
<source>Status</source>
@@ -170,7 +178,7 @@
<name>AuthorListModel</name>
<message>
<source>Name</source>
- <translation type="unfinished"></translation>
+ <translation>Ім&apos;я</translation>
</message>
<message>
<source>Email</source>
@@ -225,15 +233,15 @@
</message>
<message>
<source>Mark/Unmark Row</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/Зняти позначку з рядка</translation>
</message>
<message>
<source>Ctrl-M</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl-M</translation>
</message>
<message>
<source>Mark/Unmark Cell</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/зняти позначку з клітинки</translation>
</message>
<message>
<source>Save Table Image</source>
@@ -248,171 +256,171 @@
<name>BluetoothDeviceDialog</name>
<message>
<source>Bluetooth Device</source>
- <translation type="unfinished"></translation>
+ <translation>Пристрій Bluetooth</translation>
</message>
<message>
<source>BD_ADDR</source>
- <translation type="unfinished">BD_ADDR</translation>
+ <translation>BD_ADDR</translation>
</message>
<message>
<source>OUI</source>
- <translation type="unfinished">УІО (OUI)</translation>
+ <translation>OUI</translation>
</message>
<message>
<source>Name</source>
- <translation type="unfinished"></translation>
+ <translation>Ім&apos;я</translation>
</message>
<message>
<source>Class of Device</source>
- <translation type="unfinished"></translation>
+ <translation>Клас пристрою</translation>
</message>
<message>
<source>LMP Version</source>
- <translation type="unfinished">Версія LMP</translation>
+ <translation>Версія LMP</translation>
</message>
<message>
<source>LMP Subversion</source>
- <translation type="unfinished">Підверсія LMP</translation>
+ <translation>Підверсія LMP</translation>
</message>
<message>
<source>Manufacturer</source>
- <translation type="unfinished">Виробник</translation>
+ <translation>Виробник</translation>
</message>
<message>
<source>HCI Version</source>
- <translation type="unfinished">Версія HCI</translation>
+ <translation>Версія HCI</translation>
</message>
<message>
<source>HCI Revision</source>
- <translation type="unfinished">Ревізія HCI</translation>
+ <translation>Ревізія HCI</translation>
</message>
<message>
<source>Scan</source>
- <translation type="unfinished"></translation>
+ <translation>Сканувати</translation>
</message>
<message>
<source>Authentication</source>
- <translation type="unfinished"></translation>
+ <translation>Аутентифікація</translation>
</message>
<message>
<source>Encryption</source>
- <translation type="unfinished"></translation>
+ <translation>Шифрування</translation>
</message>
<message>
<source>ACL MTU</source>
- <translation type="unfinished"></translation>
+ <translation>ACL MTU</translation>
</message>
<message>
<source>ACL Total Packets</source>
- <translation type="unfinished"></translation>
+ <translation>Всього пакетів ACL</translation>
</message>
<message>
<source>SCO MTU</source>
- <translation type="unfinished"></translation>
+ <translation>SCO MTU</translation>
</message>
<message>
<source>SCO Total Packets</source>
- <translation type="unfinished"></translation>
+ <translation>Всього пакетів SCO</translation>
</message>
<message>
<source>LE ACL MTU</source>
- <translation type="unfinished"></translation>
+ <translation>LE ACL MTU</translation>
</message>
<message>
<source>LE ACL Total Packets</source>
- <translation type="unfinished"></translation>
+ <translation>Всього пакетів LE ACL</translation>
</message>
<message>
<source>LE ISO MTU</source>
- <translation type="unfinished"></translation>
+ <translation>LE ISO MTU</translation>
</message>
<message>
<source>LE ISO Total Packets</source>
- <translation type="unfinished"></translation>
+ <translation>Всього пакетів LE ISO</translation>
</message>
<message>
<source>Inquiry Mode</source>
- <translation type="unfinished"></translation>
+ <translation>Режим запитів</translation>
</message>
<message>
<source>Page Timeout</source>
- <translation type="unfinished"></translation>
+ <translation>Таймаут сторінки</translation>
</message>
<message>
<source>Simple Pairing Mode</source>
- <translation type="unfinished"></translation>
+ <translation>Простий режим парування</translation>
</message>
<message>
<source>Voice Setting</source>
- <translation type="unfinished"></translation>
+ <translation>Налаштування голосу</translation>
</message>
<message>
<source>Value</source>
- <translation type="unfinished">Значення</translation>
+ <translation>Значення</translation>
</message>
<message>
<source>Changes</source>
- <translation type="unfinished"></translation>
+ <translation>Зміни</translation>
</message>
<message>
<source>%1 changes</source>
- <translation type="unfinished"></translation>
+ <translation>%1 зміни</translation>
</message>
<message>
<source>Copy Cell</source>
- <translation type="unfinished">Скопіювати Клітинку</translation>
+ <translation>Копіювати клітинку</translation>
</message>
<message>
<source>Copy Rows</source>
- <translation type="unfinished">Скопіювати Рядки</translation>
+ <translation>Копіювати рядки</translation>
</message>
<message>
<source>Copy All</source>
- <translation type="unfinished">Скопіювати Все</translation>
+ <translation>Копіювати все</translation>
</message>
<message>
<source>Save as image</source>
- <translation type="unfinished">Зберегти як зображення</translation>
+ <translation>Зберегти як зображення</translation>
</message>
<message>
<source>Mark/Unmark Row</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/Зняти позначку з рядка</translation>
</message>
<message>
<source>Ctrl+M</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+M</translation>
</message>
<message>
<source>Mark/Unmark Cell</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/зняти позначку з клітинки</translation>
</message>
<message>
<source>Unknown</source>
- <translation type="unfinished">Невідомо</translation>
+ <translation>Невідомий</translation>
</message>
<message>
<source>Bluetooth Device - %1%2</source>
- <translation type="unfinished"></translation>
+ <translation>Пристрій Bluetooth - %1%2</translation>
</message>
<message>
<source>enabled</source>
- <translation type="unfinished"></translation>
+ <translation>ввімкнено</translation>
</message>
<message>
<source>disabled</source>
- <translation type="unfinished"></translation>
+ <translation>вимкнено</translation>
</message>
<message>
<source>%1 ms (%2 slots)</source>
- <translation type="unfinished"></translation>
+ <translation>%1 мс (%2 слоти)</translation>
</message>
<message>
<source>Save Table Image</source>
- <translation type="unfinished">Зберегти Зображення Таблиці</translation>
+ <translation>Зберегти зображення таблиці</translation>
</message>
<message>
<source>PNG Image (*.png)</source>
- <translation type="unfinished">Зображення PNG (*.png)</translation>
+ <translation>Зображення PNG (*.png)</translation>
</message>
</context>
<context>
@@ -463,11 +471,11 @@
</message>
<message>
<source>Show information steps</source>
- <translation type="unfinished"></translation>
+ <translation>Показати кроки інформації</translation>
</message>
<message>
<source>%1 items; Right click for more option; Double click for device details</source>
- <translation type="unfinished"></translation>
+ <translation>%1 елементів; Клацніть правою кнопкою миші для отримання додаткових опцій; Подвійний клік для отримання деталей пристрою</translation>
</message>
<message>
<source>Copy Cell</source>
@@ -487,19 +495,19 @@
</message>
<message>
<source>Mark/Unmark Row</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/Зняти позначку з рядка</translation>
</message>
<message>
<source>Ctrl-M</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl-M</translation>
</message>
<message>
<source>Mark/Unmark Cell</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/зняти позначку з клітинки</translation>
</message>
<message>
<source>true</source>
- <translation type="unfinished"></translation>
+ <translation>істина</translation>
</message>
<message>
<source>Save Table Image</source>
@@ -538,7 +546,7 @@
</message>
<message>
<source>Subevent</source>
- <translation type="unfinished"></translation>
+ <translation>Підподія</translation>
</message>
<message>
<source>Status</source>
@@ -554,7 +562,7 @@
</message>
<message>
<source>Occurrence</source>
- <translation type="unfinished"></translation>
+ <translation>Випадок</translation>
</message>
<message>
<source>Link Control Commands</source>
@@ -646,11 +654,11 @@
</message>
<message>
<source>Results filter:</source>
- <translation type="unfinished"></translation>
+ <translation>Фільтр результатів:</translation>
</message>
<message>
<source>Display filter:</source>
- <translation type="unfinished">Фільтр відображення:</translation>
+ <translation>Фільтр відображення:</translation>
</message>
<message>
<source>All Interfaces</source>
@@ -678,19 +686,19 @@
</message>
<message>
<source>Mark/Unmark Row</source>
- <translation type="unfinished"></translation>
+ <translation>Позначити/Зняти позначку з рядка</translation>
</message>
<message>
<source>Ctrl+M</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Ctrl+M</translation>
</message>
<message>
<source>Mark/Unmark Cell</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Позначити/зняти позначку з клітинки</translation>
</message>
<message>
<source>Unknown</source>
- <translation type="unfinished">Невідомо</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Adapter %1</source>
@@ -756,6 +764,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -841,10 +871,6 @@
<translation type="unfinished"></translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>&amp;Стиснути gzip&apos;ом</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>Відкрити Файл Захоплення</translation>
@@ -929,8 +955,8 @@
<translation>Подробиці</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>Коментарі файлу захоплення</translation>
+ <source>Edit Comments</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
@@ -941,10 +967,6 @@
<translation>Скопіювати До Буферу Обміну</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>Зберегти Коментарі</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>Властивості Файлу Захоплення</translation>
</message>
@@ -993,10 +1015,18 @@
<translation>Перший пакет</translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>Останній пакет</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>Витрачено</translation>
</message>
@@ -1033,6 +1063,10 @@
<translation>Відкинуті пакети</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>Фільтр захоплення</translation>
</message>
@@ -1045,6 +1079,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>відсутній</translation>
</message>
@@ -1053,6 +1091,26 @@
<translation>%1 байтів</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation type="unfinished">Тип</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>Статистика</translation>
</message>
@@ -1077,6 +1135,10 @@
<translation>Пакетів</translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished">Події</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>Проміжок часу, с</translation>
</message>
@@ -1089,6 +1151,10 @@
<translation>Середній розмір пакету, Б</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>Байтів</translation>
</message>
@@ -1101,11 +1167,11 @@
<translation>біт/с (середнє значення)</translation>
</message>
<message>
- <source>Section Comment</source>
+ <source>Packet Comments</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Packet Comments</source>
+ <source>Event Comments</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1120,6 +1186,12 @@
</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1346,6 +1418,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>compression</source>
<translation type="unfinished"></translation>
</message>
@@ -1358,6 +1438,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1446,6 +1550,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1506,7 +1614,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">Помилка</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1537,6 +1645,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Захоплювати пакети в нерозбірливому режимі</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Захоплювати пакети в форматі файлу захоплення наступного покоління.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1764,6 +1880,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1811,6 +1935,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1877,6 +2020,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation type="unfinished"></translation>
</message>
@@ -1991,23 +2138,31 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>…as C String</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>…as Go literal</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -2015,6 +2170,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation type="unfinished"></translation>
</message>
@@ -2808,6 +2979,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>Фільтр відображення:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2847,10 +3022,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Save</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Default</source>
<translation type="unfinished"></translation>
</message>
@@ -2993,6 +3164,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Open </source>
<translation type="unfinished">Відкрити </translation>
</message>
@@ -3076,10 +3255,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation type="unfinished"></translation>
</message>
@@ -3165,75 +3352,71 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>capture files</source>
+ <source>Temp</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Temp</source>
+ <source>Personal configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>untitled capture files</source>
+ <source>Global configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Personal configuration</source>
+ <source>System</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Global configuration</source>
+ <source>ethers, ipxnets</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
+ <source>Program</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>dfilters, preferences, manuf, …</source>
+ <source>Personal Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>System</source>
+ <source>Global Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>ethers, ipxnets</source>
+ <source>Personal Lua Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Program</source>
+ <source>Global Lua Plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>program files</source>
+ <source>Lua scripts</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Personal Plugins</source>
+ <source>&quot;File&quot; dialog location</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>binary plugins</source>
+ <source>Capture files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Global Plugins</source>
+ <source>Untitled capture files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Personal Lua Plugins</source>
+ <source>Preferences, profiles, manuf, …</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Global Lua Plugins</source>
+ <source>Program files</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Lua scripts</source>
+ <source>Binary plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3241,7 +3424,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3368,6 +3551,26 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation>Клікніть для вибору.</translation>
</message>
@@ -3400,6 +3603,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation type="unfinished"></translation>
</message>
@@ -3415,10 +3630,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation type="unfinished"></translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation type="unfinished">
@@ -3448,8 +3659,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Підказка.</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
+ <source>Show as</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3465,11 +3687,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Знайти:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Враховувати регістр</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>Знайти &amp;Наступний</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3776,28 +4009,27 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>Видалити цей графік.</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>Додати новий графік.</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>Продублювати цей графік.</translation>
+ <source>Clear all graphs.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Clear all graphs.</source>
+ <source>Remove the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph upwards.</source>
+ <source>Duplicate the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3841,10 +4073,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation>Скинути</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>Скинути Зміни До Діаграми</translation>
</message>
@@ -4058,6 +4286,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation type="unfinished"></translation>
</message>
@@ -4102,6 +4366,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">10 сек {5 ?}</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10 хв {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10 хв {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation type="unfinished"></translation>
</message>
@@ -4114,6 +4386,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation type="unfinished"></translation>
</message>
@@ -4126,7 +4406,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4174,6 +4454,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Клікніть, щоб виділити частину графіку.</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>Формат Переносних Документів (*.pdf)</translation>
</message>
@@ -4926,6 +5234,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5904,7 +6219,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
+ <source>LTE/NR Mac Statistics</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6184,11 +6499,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
+ <source>3GPP RLC Graph - no channel selected</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6243,7 +6558,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
+ <source>3GPP RLC Statistics</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6330,6 +6645,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation type="unfinished"></translation>
</message>
@@ -6392,6 +6711,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation type="unfinished"></translation>
@@ -6405,8 +6732,11 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -6439,6 +6769,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Пакети відсутні</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation type="unfinished"></translation>
</message>
@@ -6472,6 +6806,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6503,6 +6844,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation type="unfinished"></translation>
</message>
@@ -6933,6 +7278,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">Оновити</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation type="unfinished"></translation>
</message>
@@ -6980,6 +7329,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation type="unfinished"></translation>
</message>
@@ -7003,6 +7356,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7460,10 +7821,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Скопіювати цей профіль.</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>Профілі Конфігурації</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation type="unfinished"></translation>
@@ -7637,6 +8010,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation type="unfinished"></translation>
@@ -8160,6 +8537,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation type="unfinished"></translation>
</message>
@@ -8180,6 +8565,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation type="unfinished"></translation>
</message>
@@ -8325,7 +8714,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Unknown</source>
- <translation type="unfinished">Невідомо</translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>UE Id</source>
@@ -8403,9 +8792,69 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation type="unfinished">Перегляд...</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished">Вліво</translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished">Вправо</translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
<translation type="unfinished"></translation>
@@ -8427,7 +8876,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Authentication</source>
- <translation type="unfinished"></translation>
+ <translation type="unfinished">Аутентифікація</translation>
</message>
<message>
<source>Null authentication</source>
@@ -8506,6 +8955,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8621,6 +9077,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Визначені Адреси</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished">Скопіювати</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation type="unfinished">Зберегти як...</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation type="unfinished"></translation>
</message>
@@ -8632,6 +9096,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished">як CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished">Звичайний текст (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished">Попередження</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -9572,7 +10091,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Unknown</source>
- <translation type="unfinished">Невідомо</translation>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -10302,6 +10821,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Байти пакету</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Шукати рядки, що містять звичайні (UTF-8 та ASCII) або розширені (UTF-16) символи.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10322,6 +10845,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Враховувати регістр</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation type="unfinished"></translation>
@@ -10359,6 +10894,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>Некоректний фільтр.</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>Цей фільтр нічого не перевіряє.</translation>
</message>
@@ -10781,6 +11332,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">Знайти:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">Враховувати регістр</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation type="unfinished">Знайти &amp;Наступний</translation>
</message>
@@ -10877,11 +11432,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">Зберегти як...</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
+ <source>Using %Ln byte(s).</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
@@ -10985,6 +11548,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation type="unfinished">Фільтр відображення:</translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11828,7 +12395,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Unknown</source>
- <translation type="unfinished">Невідомо</translation>
+ <translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -11919,21 +12486,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
+ <source>Remove the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
+ <source>Copy the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
+ <source>Move the selected entry(ies) up.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
+ <source>Move the selected entry(ies) down.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -11960,19 +12525,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Remove this entry.</source>
+ <source>Remove the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
+ <source>Copy the selected entry(ies).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
+ <source>Move the selected entry(ies) up.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
+ <source>Move the selected entry(ies) down.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -12303,10 +12868,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation type="unfinished"></translation>
</message>
@@ -12583,14 +13156,6 @@ a:hover {
<translation>Не знайдено жодного файлу</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>&amp;Зміст</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Фільтр Wireshark’а</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12856,10 +13421,6 @@ a:hover {
<translation>Панель Бездротової Мережі</translation>
</message>
<message>
- <source>Help contents</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>FAQs</source>
<translation type="unfinished"></translation>
</message>
@@ -12980,11 +13541,6 @@ a:hover {
<translation>Знайти попередній пакет</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>Позначити Всі Відображені</translation>
</message>
@@ -13013,11 +13569,6 @@ a:hover {
<translation>Перейти до попереднього позначеного пакету</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>Прибрати Всі Відображені</translation>
</message>
@@ -13458,10 +14009,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13622,19 +14169,27 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>&amp;Опції...</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;Wireless</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>&amp;Опції...</translation>
+ <source>&amp;User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Display Filters</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -13682,10 +14237,18 @@ a:hover {
<translation>Знайти Поп&amp;ередній</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13726,6 +14289,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation type="unfinished"></translation>
</message>
@@ -13734,6 +14309,14 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>Декодувати &amp;Як...</translation>
</message>
@@ -13794,6 +14377,10 @@ a:hover {
<translation>Нормальний Розмір</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>Змінити Розмір Колонок</translation>
</message>
@@ -14052,6 +14639,14 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;Виклики VoIP</translation>
</message>
@@ -14084,10 +14679,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation type="unfinished"></translation>
</message>
@@ -14372,6 +14963,10 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/ui/qt/wireshark_zh_CN.ts b/ui/qt/wireshark_zh_CN.ts
index 13b953b6..b2bf81cb 100644
--- a/ui/qt/wireshark_zh_CN.ts
+++ b/ui/qt/wireshark_zh_CN.ts
@@ -29,7 +29,7 @@
</message>
<message>
<source>Copy to Clipboard</source>
- <translation type="unfinished"></translation>
+ <translation>复制到剪贴板</translation>
</message>
<message>
<source>Authors</source>
@@ -44,8 +44,8 @@
<translation>文件夹</translation>
</message>
<message>
- <source>Filter by path</source>
- <translation>按路径过滤</translation>
+ <source>Search Folders</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Plugins</source>
@@ -80,6 +80,14 @@
<translation>许可</translation>
</message>
<message>
+ <source>About Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Logray</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>The directory does not exist</source>
<translation>该目录不存在</translation>
</message>
@@ -270,7 +278,7 @@
</message>
<message>
<source>LMP Subversion</source>
- <translation type="unfinished">LMP 子版本</translation>
+ <translation>LMP 子版本</translation>
</message>
<message>
<source>Manufacturer</source>
@@ -378,7 +386,7 @@
</message>
<message>
<source>Ctrl+M</source>
- <translation type="unfinished">Ctrl+M</translation>
+ <translation>Ctrl+M</translation>
</message>
<message>
<source>Mark/Unmark Cell</source>
@@ -754,6 +762,28 @@
</message>
</context>
<context>
+ <name>CaptureCommentDialog</name>
+ <message>
+ <source>Edit Capture Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Add Comment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Section %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CaptureCommentTabWidget</name>
+ <message>
+ <source>Comment %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>CaptureFile</name>
<message>
<source> [closing]</source>
@@ -839,10 +869,6 @@
<translation>读取过滤器:</translation>
</message>
<message>
- <source>Compress with g&amp;zip</source>
- <translation>用 gzip 压缩(&amp;Z)</translation>
- </message>
- <message>
<source>Open Capture File</source>
<oldsource>Wireshark: Open Capture File</oldsource>
<translation>打开捕获文件</translation>
@@ -921,8 +947,8 @@
<translation>细节</translation>
</message>
<message>
- <source>Capture file comments</source>
- <translation>捕获文件描述</translation>
+ <source>Edit Comments</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Refresh</source>
@@ -933,10 +959,6 @@
<translation>复制到剪贴板</translation>
</message>
<message>
- <source>Save Comments</source>
- <translation>保存注释</translation>
- </message>
- <message>
<source>Capture File Properties</source>
<translation>捕获文件属性</translation>
</message>
@@ -985,10 +1007,18 @@
<translation>第一个分组</translation>
</message>
<message>
+ <source>First event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Last packet</source>
<translation>最后分组</translation>
</message>
<message>
+ <source>Last event</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Elapsed</source>
<translation>经过时间</translation>
</message>
@@ -1025,6 +1055,10 @@
<translation>丢弃分组</translation>
</message>
<message>
+ <source>Dropped events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Capture filter</source>
<translation>捕获过滤器</translation>
</message>
@@ -1037,6 +1071,10 @@
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Event size limit (snaplen)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>none</source>
<translation>无</translation>
</message>
@@ -1045,6 +1083,26 @@
<translation>%1 字节</translation>
</message>
<message>
+ <source>Comments</source>
+ <translation type="unfinished">注释</translation>
+ </message>
+ <message>
+ <source>Comment %1: </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Decryption Secrets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Type</source>
+ <translation type="unfinished">类型</translation>
+ </message>
+ <message>
+ <source>Size</source>
+ <translation type="unfinished">大小</translation>
+ </message>
+ <message>
<source>Statistics</source>
<translation>统计</translation>
</message>
@@ -1069,6 +1127,10 @@
<translation>分组</translation>
</message>
<message>
+ <source>Events</source>
+ <translation type="unfinished">事件</translation>
+ </message>
+ <message>
<source>Time span, s</source>
<translation>时间跨度,s</translation>
</message>
@@ -1081,6 +1143,10 @@
<translation>平均分组大小,B</translation>
</message>
<message>
+ <source>Average event size, B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Bytes</source>
<translation>字节</translation>
</message>
@@ -1093,14 +1159,14 @@
<translation>平均 比特/秒</translation>
</message>
<message>
- <source>Section Comment</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Packet Comments</source>
<translation>分组注释</translation>
</message>
<message>
+ <source>Event Comments</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;p&gt;Frame %1: </source>
<translation>&lt;p&gt;帧 %1: </translation>
</message>
@@ -1110,6 +1176,12 @@
</source>
<translation>通过 Wireshark 创建 %1</translation>
</message>
+ <message>
+ <source>Created by Logray %1
+
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>CaptureFilterCombo</name>
@@ -1337,6 +1409,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
例如,如果设置成1小时,则每个整点将创建一个文件。</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for some more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Enable monitor mode on all 802.11 interfaces</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>compression</source>
<translation>压缩</translation>
</message>
@@ -1349,6 +1429,30 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>gzip</translation>
</message>
<message>
+ <source>File infix pattern</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;In multiple file mode, the date and time and file index number are inserted between filename template and any suffix. Select their order.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>YYYYmmDDHHMMSS_NNNNN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Date and time before the file index number. This causes files to sort in creation time order, and keeps files from the same batch closely ordered.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NNNNN_YYYYmmDDHHMMSS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;File index number before the date and time. This is the historic Wireshark ordering.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;After capturing has switched to the next file and the given number of files has exceeded, the oldest file will be removed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;当捕获切换到下一个文件并且给定的文件数已经达到时,则最早的文件将会被删除。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1437,6 +1541,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Stop capturing after the specified number of files have been created.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Stop capturing after the specified amount of data has been captured.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1497,7 +1605,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">错误</translation>
</message>
<message>
- <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 GiB.</source>
+ <source>Multiple files: Requested filesize too large. The filesize cannot be greater than 2 TB.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1528,6 +1636,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>使用混杂模式捕获分组</translation>
</message>
<message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Usually a wireless network card will only capture the traffic sent to and from its own network address, and only captures &lt;em&gt;user data&lt;/em&gt; traffic with &amp;quot;fake&amp;quot; Ethernet headers. If you want to capture all traffic that wireless network cards can &amp;quot;see&amp;quot;, or are interested in 802.11 management or control packets, or radio-layer information, mark this option. Monitor mode availability depends on the wireless card and driver. See the Wiki for more details of capturing packets on WLAN networks.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture packets in monitor mode on 802.11 devices</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capture packets in the next-generation capture file format.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;使用下一代捕获文件格式来捕获分组。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -1755,6 +1871,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Width</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Alignment</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;Show human-readable strings instead of raw values for fields. Only applicable to custom columns with fields that have value strings.&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
@@ -1802,6 +1926,25 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>CompressionGroupBox</name>
+ <message>
+ <source>Compression options</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&amp;Uncompressed</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with g&amp;zip</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Compress with &amp;LZ4</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ConversationDataModel</name>
<message>
<source>Address A</source>
@@ -1868,6 +2011,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Flows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Total Packets</source>
<translation type="unfinished"></translation>
</message>
@@ -1982,23 +2129,31 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>将分组字节复制为十六进制转储。</translation>
</message>
<message>
- <source>…as Printable Text</source>
+ <source>…as MIME Data</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy only the printable text in the packet.</source>
+ <source>…as C String</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as MIME Data</source>
+ <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>…as C String</source>
+ <source>…as Go literal</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Copy packet bytes as printable ASCII characters and escape sequences.</source>
+ <source>Copy packet bytes as Go literal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as C Array</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as C Array.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -2006,6 +2161,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>…as UTF-8 Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as UTF-8.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>…as ASCII Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy packet bytes as text, treating as ASCII.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Copy packet bytes as a stream of hex.</source>
<translation>将分组字节复制为十六进制流。</translation>
</message>
@@ -2799,6 +2970,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation>显示过滤器:</translation>
</message>
+ <message>
+ <source>Export PDUs</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>ExtArgSelector</name>
@@ -2838,10 +3013,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>开始</translation>
</message>
<message>
- <source>Save</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Default</source>
<translation>默认</translation>
</message>
@@ -2982,6 +3153,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>显示过滤器</translation>
</message>
<message>
+ <source>Display Filter Macros</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>New macro</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Open </source>
<translation>打开 </translation>
</message>
@@ -3065,10 +3244,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FilterListModel</name>
<message>
+ <source>Macro Name</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Name</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Macro Expression</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Filter Expression</source>
<translation type="unfinished"></translation>
</message>
@@ -3154,22 +3341,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>FolderListModel</name>
<message>
- <source>&quot;File&quot; dialogs</source>
- <translation>“文件”对话框</translation>
- </message>
- <message>
- <source>capture files</source>
- <translation>捕获文件</translation>
- </message>
- <message>
<source>Temp</source>
<translation>临时</translation>
</message>
<message>
- <source>untitled capture files</source>
- <translation>无标题捕获文件</translation>
- </message>
- <message>
<source>Personal configuration</source>
<translation>个人配置</translation>
</message>
@@ -3178,14 +3353,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>全局配置</translation>
</message>
<message>
- <source>dfilters, preferences, ethers, …</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>dfilters, preferences, manuf, …</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>System</source>
<translation>系统</translation>
</message>
@@ -3198,18 +3365,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>程序</translation>
</message>
<message>
- <source>program files</source>
- <translation>程序文件</translation>
- </message>
- <message>
<source>Personal Plugins</source>
<translation>个人插件</translation>
</message>
<message>
- <source>binary plugins</source>
- <translation>二进制插件</translation>
- </message>
- <message>
<source>Global Plugins</source>
<translation>全局插件</translation>
</message>
@@ -3226,11 +3385,35 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&quot;File&quot; dialog location</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Untitled capture files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Preferences, profiles, manuf, …</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Program files</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Binary plugins</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Personal Extcap path</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>external capture (extcap) plugins</source>
+ <source>External capture (extcap) plugins</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3351,6 +3534,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</translation>
</message>
<message>
+ <source>Event %1. </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;reads&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln &lt;span style=&quot;color: %1; background-color:%2&quot;&gt;writes&lt;/span&gt;, </source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
<source> Click to select.</source>
<translation>点击选择。</translation>
</message>
@@ -3383,6 +3582,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Read activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Write activity(%6)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Entire I/O activity (%1)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Entire conversation (%1)</source>
<translation>整个对话(%1)</translation>
</message>
@@ -3398,10 +3609,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Save Stream Content As…</source>
<translation type="unfinished"></translation>
</message>
- <message>
- <source>[Stream output truncated]</source>
- <translation>[流输出被截断]</translation>
- </message>
<message numerus="yes">
<source>%Ln total stream(s).</source>
<translation>
@@ -3427,8 +3634,19 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>提示。</translation>
</message>
<message>
- <source>Show data as</source>
- <oldsource>Show and save data as</oldsource>
+ <source>Show as</source>
+ <translation type="unfinished">显示为</translation>
+ </message>
+ <message>
+ <source>No delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Turn delta times</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All delta times</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3444,11 +3662,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>查找:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">区分大小写</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>查找下一个(&amp;N)</translation>
</message>
</context>
<context>
+ <name>FollowStreamText</name>
+ <message>
+ <source>[Stream output truncated]</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>FontColorPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -3784,28 +4013,27 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
- <source>Remove this graph.</source>
- <oldsource>Remove this dissection behavior.</oldsource>
- <translation>删除图形。</translation>
- </message>
- <message>
<source>Add a new graph.</source>
<translation>增加新图形。</translation>
</message>
<message>
- <source>Duplicate this graph.</source>
- <translation>复制图形。</translation>
- </message>
- <message>
<source>Clear all graphs.</source>
<translation>清除所有图形。</translation>
</message>
<message>
- <source>Move this graph upwards.</source>
+ <source>Remove the selected graph(s).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Duplicate the selected graph(s).</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Move this graph downwards.</source>
+ <source>Move the selected graph(s) upwards.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move the selected graph(s) downwards.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -3849,10 +4077,6 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Reset</source>
- <translation>复位</translation>
- </message>
- <message>
<source>Reset Graph</source>
<translation>复位图形</translation>
</message>
@@ -4066,6 +4290,42 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>从另一个配置文件复制图形。</translation>
</message>
<message>
+ <source>1 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>2 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>5 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>10 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>20 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>50 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>100 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>200 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>500 μs</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>1 ms</source>
<translation>1毫秒</translation>
</message>
@@ -4110,6 +4370,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">10秒 {5 ?}</translation>
</message>
<message>
+ <source>2 min</source>
+ <translation type="unfinished">10分钟 {2 ?}</translation>
+ </message>
+ <message>
+ <source>5 min</source>
+ <translation type="unfinished">10分钟 {5 ?}</translation>
+ </message>
+ <message>
<source>Wireshark I/O Graphs: %1</source>
<translation type="unfinished"></translation>
</message>
@@ -4122,6 +4390,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>All packets</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>All events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>All Packets</source>
<translation type="unfinished"></translation>
</message>
@@ -4134,7 +4410,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
- <source>Access Denied</source>
+ <source>All Execs</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -4182,6 +4458,34 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>点击选择图形的一部分。</translation>
</message>
<message>
+ <source>%1 Intervals </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to top right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Move to bottom right</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Portable Document Format (*.pdf)</source>
<translation>便携式文档格式 (*.pdf)</translation>
</message>
@@ -4934,6 +5238,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>InterfaceTreeDelegate</name>
+ <message>
+ <source>default</source>
+ <translation type="unfinished">默认</translation>
+ </message>
+</context>
+<context>
<name>InterfaceTreeModel</name>
<message>
<source>Show</source>
@@ -5908,8 +6219,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteMacStatisticsDialog</name>
<message>
- <source>LTE Mac Statistics</source>
- <translation>LTE MAC 统计</translation>
+ <source>LTE/NR Mac Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6213,12 +6524,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>序列号</translation>
</message>
<message>
- <source>LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)</source>
- <translation>LTE RLC 图表 (UE=%1 chan=%2%3 %4 - %5)</translation>
+ <source>%1 RLC Graph (UE=%2 chan=%3%4 %5 - %6)</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>LTE RLC Graph - no channel selected</source>
- <translation>LTE RLC 图表 - 没有选择信道</translation>
+ <source>3GPP RLC Graph - no channel selected</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Save As…</source>
@@ -6272,8 +6583,8 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<context>
<name>LteRlcStatisticsDialog</name>
<message>
- <source>LTE RLC Statistics</source>
- <translation>LTE RLC 统计</translation>
+ <source>3GPP RLC Statistics</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Include SR frames in filter</source>
@@ -6359,6 +6670,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>配置:%1</translation>
</message>
<message>
+ <source> %1 Displayed: %2 (%3%)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Manage Profiles…</source>
<translation type="unfinished"></translation>
</message>
@@ -6419,6 +6734,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
<message>
<source>Byte %1</source>
<translation>字节 %1</translation>
@@ -6432,9 +6753,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>所选分组:%1 %2 </translation>
</message>
<message>
- <source>Packets: %1 %4 Displayed: %2 (%3%)</source>
- <oldsource>Packets: %1 %4 Displayed: %2 %4 Marked: %3</oldsource>
- <translation>分组: %1 %4 已显示: %2 (%3%)</translation>
+ <source>Selected Event: %1 %2 </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Events: %1</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source> %1 Selected: %2 (%3%)</source>
@@ -6466,6 +6790,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>无分组</translation>
</message>
<message>
+ <source>No Events</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>From Zip File...</source>
<translation type="unfinished"></translation>
</message>
@@ -6497,6 +6825,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>MainWindow</name>
+ <message>
+ <source>Display filter as %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>MainWindowPreferencesFrame</name>
<message>
<source>Frame</source>
@@ -6528,6 +6863,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>最近使用的文件夹</translation>
</message>
<message>
+ <source>The current working directory</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Show up to</source>
<translation>显示最多</translation>
</message>
@@ -6958,6 +7297,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Refresh</source>
+ <translation type="unfinished">刷新</translation>
+ </message>
+ <message>
<source>Save Diagram As…</source>
<translation type="unfinished"></translation>
</message>
@@ -7005,6 +7348,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Layout:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Packet %1</source>
<translation>分组 %1</translation>
</message>
@@ -7026,6 +7373,12 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<numerusform></numerusform>
</translation>
</message>
+ <message numerus="yes">
+ <source>%Ln bit(s)</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
+ </translation>
+ </message>
</context>
<context>
<name>PacketFormatGroupBox</name>
@@ -7484,10 +7837,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>复制该配置文件。</translation>
</message>
<message>
+ <source>The number of packets or events to check for automatic profile switching.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Auto switch packet limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Configuration Profiles</source>
<translation>配置文件</translation>
</message>
<message>
+ <source>Auto switch event limit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Import</source>
<comment>noun</comment>
<translation type="unfinished">导入</translation>
@@ -7651,6 +8016,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished"></translation>
</message>
<message>
+ <source>Auto Switch Filter</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>copy</source>
<comment>noun</comment>
<translation type="unfinished"></translation>
@@ -8174,6 +8543,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>标记缺失?</translation>
</message>
<message>
+ <source>LTE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>NR</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>C-RNTI</source>
<translation>C-RNTI</translation>
</message>
@@ -8194,6 +8571,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>UEId</translation>
</message>
<message>
+ <source>RAT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>UL Frames</source>
<translation>UL 帧</translation>
</message>
@@ -8417,12 +8798,72 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Browse…</source>
<translation type="unfinished">浏览…</translation>
</message>
+ <message>
+ <source>PACKETS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>EVENTS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BYTES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>BITS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FRAMES</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>COUNT FIELDS</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SUM</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MAX</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>MIN</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>AVERAGE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>THROUGHPUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>LOAD</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Left</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Center</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Right</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>QObject::QObject</name>
+ <name>QObject::QObject::QObject</name>
<message>
<source>CCCH</source>
- <translation>CCCH</translation>
+ <translation type="unfinished">CCCH</translation>
</message>
</context>
<context>
@@ -8520,6 +8961,13 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResizeHeaderView</name>
+ <message>
+ <source>Resize all %1 to contents</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResolvedAddressesDialog</name>
<message>
<source>Dialog</source>
@@ -8635,6 +9083,14 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>解析后的地址</translation>
</message>
<message>
+ <source>Copy</source>
+ <translation type="unfinished">复制</translation>
+ </message>
+ <message>
+ <source>Save as…</source>
+ <translation type="unfinished">另存为…</translation>
+ </message>
+ <message>
<source># Resolved addresses found in %1</source>
<translation># 在 %1 中找到的解析后的地址</translation>
</message>
@@ -8648,6 +9104,61 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
</context>
<context>
+ <name>ResolvedAddressesView</name>
+ <message>
+ <source>as Plain Text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy selected rows</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Copy table</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>as CSV</source>
+ <translation type="unfinished">作为 CSV</translation>
+ </message>
+ <message>
+ <source>as JSON</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save selected rows as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save table as…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Save Resolved Addresses As…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plain text (*.txt)</source>
+ <translation type="unfinished">纯文本 (*.txt)</translation>
+ </message>
+ <message>
+ <source>CSV Document (*.csv)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>JSON Document (*.json)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Warning</source>
+ <translation type="unfinished">警告</translation>
+ </message>
+ <message>
+ <source>Unable to save %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>ResponseTimeDelayDialog</name>
<message>
<source>%1 Response Time Delay Statistics</source>
@@ -9416,7 +9927,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Left + Right</source>
- <translation type="unfinished"></translation>
+ <translation>左 + 右</translation>
</message>
<message>
<source>To Right</source>
@@ -9727,7 +10238,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Shift+R</source>
- <translation type="unfinished"></translation>
+ <translation>Shift+R</translation>
</message>
<message>
<source>Find Only &amp;Singles</source>
@@ -9739,7 +10250,7 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
</message>
<message>
<source>Ctrl+R</source>
- <translation type="unfinished"></translation>
+ <translation>Ctrl+R</translation>
</message>
<message>
<source>Mark Packets</source>
@@ -10322,6 +10833,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>分组字节流</translation>
</message>
<message>
+ <source>&lt;b&gt;Options:&lt;/b&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for strings containing narrow (UTF-8 and ASCII) or wide (UTF-16) characters.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;搜索包含窄字符集 (UTF-8 与 ASCII) 或宽字符集 (UTF-16) 的字符串。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
@@ -10342,6 +10857,18 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>区分大小写</translation>
</message>
<message>
+ <source>Backwards</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for a subsequent occurrence in the current packet before advancing to the next packet.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Multiple occurrences</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5), a plain string (e.g. My String) or a regular expression (e.g. colou?r).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<oldsource>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search for data using display filter syntax (e.g. ip.addr==10.1.1.1), a hexadecimal string (e.g. fffffda5) or a plain string (e.g. My String).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</oldsource>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;以“显示过滤器”语法 (如 ip.addr==10.1.1.1)、十六进制字符串 (如 fffffda5) 或纯字符串 (如 My String) 搜索数据。&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
@@ -10379,6 +10906,22 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>无效过滤器。</translation>
</message>
<message>
+ <source>Event List</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Details</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Event Bytes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Search the Info column of the event list (summary pane), decoded event display labels (tree view pane) or the ASCII-converted event data (hex view pane).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>That filter doesn&apos;t test anything.</source>
<translation>该过滤器未测试任何项目。</translation>
</message>
@@ -10820,6 +11363,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>查找:</translation>
</message>
<message>
+ <source>Case sensitive</source>
+ <translation type="unfinished">区分大小写</translation>
+ </message>
+ <message>
<source>Find &amp;Next</source>
<translation>查找下一个(&amp;N)</translation>
</message>
@@ -10914,13 +11461,21 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation type="unfinished">另存为…</translation>
</message>
<message>
+ <source>Decoded as %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Save Selected Packet Bytes As…</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>compressed %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message numerus="yes">
- <source>Displaying %Ln byte(s).</source>
- <translation>
- <numerusform>已显示 %Ln 字节。</numerusform>
+ <source>Using %Ln byte(s).</source>
+ <translation type="unfinished">
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -11020,6 +11575,10 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<source>Display filter:</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Strip Headers</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>SupportedProtocolsDialog</name>
@@ -11989,22 +12548,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>创建一个新项。</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <oldsource>Remove this profile.</oldsource>
- <translation>移除此项。</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <oldsource>Copy this profile.</oldsource>
- <translation>复制此项。</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>向上移动条目。</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>向下移动条目。</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12030,20 +12587,20 @@ For example, use 1 hour to have a new file created every hour on the hour.</sour
<translation>创建一个新条目。</translation>
</message>
<message>
- <source>Remove this entry.</source>
- <translation>删除此条目。</translation>
+ <source>Remove the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Copy this entry.</source>
- <translation>复制此条目。</translation>
+ <source>Copy the selected entry(ies).</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry up.</source>
- <translation>向上移动条目。</translation>
+ <source>Move the selected entry(ies) up.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>Move entry down.</source>
- <translation>向下移动条目。</translation>
+ <source>Move the selected entry(ies) down.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<source>Clear all entries.</source>
@@ -12371,10 +12928,18 @@ a:hover {
<translation>你正在使用 Wireshark 嗅探互联网的联机</translation>
</message>
<message>
+ <source>You are sniffing the glue that holds your system together using Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>You are running Wireshark </source>
<translation>正在运行 Wireshark</translation>
</message>
<message>
+ <source>You are running Logray </source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source> You receive automatic updates.</source>
<translation>接受自动更新。</translation>
</message>
@@ -12651,14 +13216,6 @@ a:hover {
<translation>未找到文件</translation>
</message>
<message>
- <source>&amp;Contents</source>
- <translation>内容(&amp;C)</translation>
- </message>
- <message>
- <source>Wireshark Filter</source>
- <translation>Wireshark 过滤器</translation>
- </message>
- <message>
<source>TShark</source>
<translation>TShark</translation>
</message>
@@ -12924,10 +13481,6 @@ a:hover {
<translation>无线工具栏</translation>
</message>
<message>
- <source>Help contents</source>
- <translation>帮助内容</translation>
- </message>
- <message>
<source>FAQs</source>
<translation type="unfinished"></translation>
</message>
@@ -13048,11 +13601,6 @@ a:hover {
<translation>查找上一分组</translation>
</message>
<message>
- <source>&amp;Mark/Unmark Packet(s)</source>
- <oldsource>&amp;Mark/Unmark Packet</oldsource>
- <translation>标记/取消标记 分组(&amp;M)</translation>
- </message>
- <message>
<source>Mark All Displayed</source>
<translation>标记所有显示的分组</translation>
</message>
@@ -13081,11 +13629,6 @@ a:hover {
<translation>转到前一个已标记的分组</translation>
</message>
<message>
- <source>&amp;Ignore/Unignore Packet(s)</source>
- <oldsource>&amp;Ignore/Unignore Packet</oldsource>
- <translation>忽略/取消忽略 分组(&amp;I)</translation>
- </message>
- <message>
<source>Ignore All Displayed</source>
<translation>忽略所有显示的分组</translation>
</message>
@@ -13526,10 +14069,6 @@ a:hover {
<translation>重置布局</translation>
</message>
<message>
- <source>Reset appearance layout to default size</source>
- <translation>重置外观布局为默认尺寸</translation>
- </message>
- <message>
<source>Seconds Since First Captured Packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13690,20 +14229,28 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>TLS Keylog Launcher</source>
+ <source>&amp;Options…</source>
+ <translation>选项(&amp;O)…</translation>
+ </message>
+ <message>
+ <source>&amp;3GPP Uu</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>Release Notes</source>
+ <source>&amp;Wireless</source>
+ <translation>无线(&amp;W)</translation>
+ </message>
+ <message>
+ <source>&amp;User&apos;s Guide</source>
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Options…</source>
- <translation>选项(&amp;O)…</translation>
+ <source>Wireshark User&apos;s Guide</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;Wireless</source>
- <translation>无线(&amp;W)</translation>
+ <source>Display Filters</source>
+ <translation type="unfinished">显示过滤器</translation>
</message>
<message>
<source>Capture &amp;Filters…</source>
@@ -13750,10 +14297,18 @@ a:hover {
<translation>查找上一个(&amp;v)</translation>
</message>
<message>
+ <source>&amp;Mark/Unmark Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Mark or unmark each selected packet</source>
<translation type="unfinished"></translation>
</message>
<message>
+ <source>&amp;Ignore/Unignore Selected</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Ignore or unignore each selected packet</source>
<translation type="unfinished"></translation>
</message>
@@ -13794,6 +14349,18 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
+ <source>General</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Query-Response</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>DNS Query-Response Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Request Sequences</source>
<translation>请求序列</translation>
</message>
@@ -13802,6 +14369,14 @@ a:hover {
<translation>HTTP 请求序列</translation>
</message>
<message>
+ <source>E2AP</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>E2AP Messages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Decode &amp;As…</source>
<translation>解码为(&amp;A)…</translation>
</message>
@@ -13862,6 +14437,10 @@ a:hover {
<translation>普通大小</translation>
</message>
<message>
+ <source>Reset layout to default size</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>Resize Columns</source>
<translation>调整列宽</translation>
</message>
@@ -14120,6 +14699,14 @@ a:hover {
<translation>转至选定字段引用的分组。</translation>
</message>
<message>
+ <source>TLS Keylog Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Release Notes</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>&amp;VoIP Calls</source>
<translation>&amp;VoIP 通话</translation>
</message>
@@ -14152,10 +14739,6 @@ a:hover {
<translation type="unfinished"></translation>
</message>
<message>
- <source>&amp;LTE</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>&amp;MTP3</source>
<translation type="unfinished"></translation>
</message>
@@ -14440,6 +15023,10 @@ a:hover {
<translation>直接退出,不保存(&amp;W)</translation>
</message>
<message>
+ <source>USB CDC Data</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<source>There is no &quot;rtp.ssrc&quot; field in this version of Wireshark.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp
index 0fc529ea..7166cbab 100644
--- a/ui/qt/wlan_statistics_dialog.cpp
+++ b/ui/qt/wlan_statistics_dialog.cpp
@@ -222,7 +222,7 @@ public:
} else if (wlan_hdr->stats.ssid_len == 1 && wlan_hdr->stats.ssid[0] == 0) {
ssid_text = QObject::tr("<Hidden>");
} else {
- gchar *str = format_text(NULL, (const char *)wlan_hdr->stats.ssid, wlan_hdr->stats.ssid_len);
+ char *str = format_text(NULL, (const char *)wlan_hdr->stats.ssid, wlan_hdr->stats.ssid_len);
ssid_text = str;
wmem_free(NULL, str);
}
@@ -293,7 +293,7 @@ public:
}
if (update_ssid) {
- gchar* str;
+ char* str;
ssid_ = QByteArray::fromRawData((const char *)wlan_hdr->stats.ssid, wlan_hdr->stats.ssid_len);
str = format_text(NULL, (const char *)wlan_hdr->stats.ssid, wlan_hdr->stats.ssid_len);
setText(col_ssid_, str);
@@ -571,7 +571,7 @@ tap_packet_status WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info
const wlan_hdr_t *wlan_hdr = (const wlan_hdr_t *)wlan_hdr_ptr;
if (!ws_dlg || !wlan_hdr) return TAP_PACKET_DONT_REDRAW;
- guint16 frame_type = wlan_hdr->type & 0xff0;
+ uint16_t frame_type = wlan_hdr->type & 0xff0;
if (!((frame_type == 0x0) || (frame_type == 0x20) || (frame_type == 0x30))
|| ((frame_type == 0x20) && DATA_FRAME_IS_NULL(wlan_hdr->type))) {
/* Not a management or non null data or extension frame; let's skip it */
diff --git a/ui/recent.c b/ui/recent.c
index 1906bfba..d019f0f3 100644
--- a/ui/recent.c
+++ b/ui/recent.c
@@ -57,11 +57,14 @@
#define RECENT_GUI_GEOMETRY_MAIN_WIDTH "gui.geometry_main_width"
#define RECENT_GUI_GEOMETRY_MAIN_HEIGHT "gui.geometry_main_height"
#define RECENT_GUI_GEOMETRY_MAIN_MAXIMIZED "gui.geometry_main_maximized"
+#define RECENT_GUI_GEOMETRY_MAIN "gui.geometry_main"
#define RECENT_GUI_GEOMETRY_LEFTALIGN_ACTIONS "gui.geometry_leftalign_actions"
#define RECENT_GUI_GEOMETRY_MAIN_UPPER_PANE "gui.geometry_main_upper_pane"
#define RECENT_GUI_GEOMETRY_MAIN_LOWER_PANE "gui.geometry_main_lower_pane"
-#define RECENT_GUI_GEOMETRY_WLAN_STATS_PANE "gui.geometry_status_wlan_stats_pane"
+#define RECENT_GUI_GEOMETRY_MAIN_MASTER_SPLIT "gui.geometry_main_master_split"
+#define RECENT_GUI_GEOMETRY_MAIN_EXTRA_SPLIT "gui.geometry_main_extra_split"
#define RECENT_LAST_USED_PROFILE "gui.last_used_profile"
+#define RECENT_PROFILE_SWITCH_CHECK_COUNT "gui.profile_switch_check_count"
#define RECENT_GUI_FILEOPEN_REMEMBERED_DIR "gui.fileopen_remembered_dir"
#define RECENT_GUI_CONVERSATION_TABS "gui.conversation_tabs"
#define RECENT_GUI_CONVERSATION_TABS_COLUMNS "gui.conversation_tabs_columns"
@@ -74,8 +77,11 @@
#define RECENT_GUI_SEARCH_IN "gui.search_in"
#define RECENT_GUI_SEARCH_CHAR_SET "gui.search_char_set"
#define RECENT_GUI_SEARCH_CASE_SENSITIVE "gui.search_case_sensitive"
+#define RECENT_GUI_SEARCH_REVERSE_DIR "gui.search_reverse_dir"
+#define RECENT_GUI_SEARCH_MULTIPLE_OCCURS "gui.search_multiple_occurs"
#define RECENT_GUI_SEARCH_TYPE "gui.search_type"
#define RECENT_GUI_FOLLOW_SHOW "gui.follow_show"
+#define RECENT_GUI_FOLLOW_DELTA "gui.follow_delta"
#define RECENT_GUI_SHOW_BYTES_DECODE "gui.show_bytes_decode"
#define RECENT_GUI_SHOW_BYTES_SHOW "gui.show_bytes_show"
@@ -184,6 +190,13 @@ static const value_string bytes_show_values[] = {
{ 0, NULL }
};
+static const value_string follow_delta_values[] = {
+ { FOLLOW_DELTA_NONE, "NONE" },
+ { FOLLOW_DELTA_TURN, "TURN" },
+ { FOLLOW_DELTA_ALL, "ALL" },
+ { 0, NULL }
+};
+
static const value_string show_bytes_decode_values[] = {
{ DecodeAsNone, "NONE" },
{ DecodeAsBASE64, "BASE64" },
@@ -196,18 +209,16 @@ static const value_string show_bytes_decode_values[] = {
};
static void
-free_col_width_data(gpointer data, gpointer user_data _U_)
+free_col_width_data(void *data)
{
col_width_data *cfmt = (col_width_data *)data;
- g_free(cfmt->cfield);
g_free(cfmt);
}
-static void
-free_col_width_info(recent_settings_t *rs)
+void
+recent_free_column_width_info(recent_settings_t *rs)
{
- g_list_foreach(rs->col_width_list, free_col_width_data, NULL);
- g_list_free(rs->col_width_list);
+ g_list_free_full(rs->col_width_list, free_col_width_data);
rs->col_width_list = NULL;
}
@@ -218,7 +229,7 @@ free_col_width_info(recent_settings_t *rs)
* @param rfh recent file handle (FILE)
*/
static void
-write_recent_geom(gpointer key _U_, gpointer value, gpointer rfh)
+write_recent_geom(void *key _U_, void *value, void *rfh)
{
window_geometry_t *geom = (window_geometry_t *)value;
FILE *rf = (FILE *)rfh;
@@ -232,33 +243,40 @@ write_recent_geom(gpointer key _U_, gpointer value, gpointer rfh)
fprintf(rf, RECENT_GUI_GEOMETRY "%s.height: %d\n", geom->key,
geom->height);
- fprintf(rf, "# TRUE or FALSE (case-insensitive).\n");
+ fprintf(rf, "# true or false (case-insensitive).\n");
fprintf(rf, RECENT_GUI_GEOMETRY "%s.maximized: %s\n", geom->key,
- geom->maximized == TRUE ? "TRUE" : "FALSE");
+ geom->maximized == true ? "true" : "false");
+ fprintf(rf, "# Qt Geometry State (hex byte string).\n");
+ fprintf(rf, RECENT_GUI_GEOMETRY "%s.qt_geometry: %s\n", geom->key,
+ geom->qt_geom);
}
/* the geometry hashtable for all known window classes,
* the window name is the key, and the geometry struct is the value */
-static GHashTable *window_geom_hash = NULL;
+static GHashTable *window_geom_hash;
+
+static GHashTable *window_splitter_hash;
+
+void
+window_geom_free(void *data)
+{
+ window_geometry_t *geom = (window_geometry_t*)data;
+ g_free(geom->key);
+ g_free(geom->qt_geom);
+ g_free(geom);
+}
/* save the window and its current geometry into the geometry hashtable */
void
-window_geom_save(const gchar *name, window_geometry_t *geom)
+window_geom_save(const char *name, window_geometry_t *geom)
{
- gchar *key;
+ char *key;
window_geometry_t *work;
/* init hashtable, if not already done */
if (!window_geom_hash) {
- window_geom_hash = g_hash_table_new(g_str_hash, g_str_equal);
- }
- /* if we have an old one, remove and free it first */
- work = (window_geometry_t *)g_hash_table_lookup(window_geom_hash, name);
- if (work) {
- g_hash_table_remove(window_geom_hash, name);
- g_free(work->key);
- g_free(work);
+ window_geom_hash = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, window_geom_free);
}
/* g_malloc and insert the new one */
@@ -266,39 +284,64 @@ window_geom_save(const gchar *name, window_geometry_t *geom)
*work = *geom;
key = g_strdup(name);
work->key = key;
- g_hash_table_insert(window_geom_hash, key, work);
+ g_hash_table_replace(window_geom_hash, key, work);
}
/* load the desired geometry for this window from the geometry hashtable */
-gboolean
-window_geom_load(const gchar *name,
+bool
+window_geom_load(const char *name,
window_geometry_t *geom)
{
window_geometry_t *p;
/* init hashtable, if not already done */
if (!window_geom_hash) {
- window_geom_hash = g_hash_table_new(g_str_hash, g_str_equal);
+ window_geom_hash = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, window_geom_free);
}
p = (window_geometry_t *)g_hash_table_lookup(window_geom_hash, name);
if (p) {
*geom = *p;
- return TRUE;
+ return true;
} else {
- return FALSE;
+ return false;
+ }
+}
+
+/* save the window and its splitter state into the splitter hashtable */
+void
+window_splitter_save(const char *name, const char *splitter_state)
+{
+ /* init hashtable, if not already done */
+ if (!window_splitter_hash) {
+ window_splitter_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
}
+
+ g_hash_table_replace(window_splitter_hash, g_strdup(name), g_strdup(splitter_state));
}
+/* save the window and its splitter state into the geometry hashtable */
+const char*
+window_splitter_load(const char *name)
+{
+ /* init hashtable, if not already done */
+ if (!window_splitter_hash) {
+ return NULL;
+ }
+
+ return g_hash_table_lookup(window_splitter_hash, name);
+}
+
+
/* parse values of particular types */
static void
-parse_recent_boolean(const gchar *val_str, gboolean *valuep)
+parse_recent_boolean(const char *val_str, bool *valuep)
{
if (g_ascii_strcasecmp(val_str, "true") == 0) {
- *valuep = TRUE;
+ *valuep = true;
}
else {
- *valuep = FALSE;
+ *valuep = false;
}
}
@@ -315,33 +358,41 @@ window_geom_recent_read_pair(const char *name,
{
window_geometry_t geom;
+ if (strcmp(key, "splitter") == 0) {
+ window_splitter_save(name, value);
+ return;
+ }
+
/* find window geometry maybe already in hashtable */
if (!window_geom_load(name, &geom)) {
/* not in table, init geom with "basic" values */
geom.key = NULL; /* Will be set in window_geom_save() */
- geom.set_pos = FALSE;
+ geom.set_pos = false;
geom.x = -1;
geom.y = -1;
- geom.set_size = FALSE;
+ geom.set_size = false;
geom.width = -1;
geom.height = -1;
+ geom.qt_geom = NULL;
}
if (strcmp(key, "x") == 0) {
- geom.x = (gint)strtol(value, NULL, 10);
- geom.set_pos = TRUE;
+ geom.x = (int)strtol(value, NULL, 10);
+ geom.set_pos = true;
} else if (strcmp(key, "y") == 0) {
- geom.y = (gint)strtol(value, NULL, 10);
- geom.set_pos = TRUE;
+ geom.y = (int)strtol(value, NULL, 10);
+ geom.set_pos = true;
} else if (strcmp(key, "width") == 0) {
- geom.width = (gint)strtol(value, NULL, 10);
- geom.set_size = TRUE;
+ geom.width = (int)strtol(value, NULL, 10);
+ geom.set_size = true;
} else if (strcmp(key, "height") == 0) {
- geom.height = (gint)strtol(value, NULL, 10);
- geom.set_size = TRUE;
+ geom.height = (int)strtol(value, NULL, 10);
+ geom.set_size = true;
} else if (strcmp(key, "maximized") == 0) {
parse_recent_boolean(value, &geom.maximized);
- geom.set_maximized = TRUE;
+ geom.set_maximized = true;
+ } else if (strcmp(key, "qt_geometry") == 0) {
+ geom.qt_geom = g_strdup(value);
} else {
/*
* Silently ignore the bogus key. We shouldn't abort here,
@@ -366,12 +417,35 @@ window_geom_recent_write_all(FILE *rf)
{
/* init hashtable, if not already done */
if (!window_geom_hash) {
- window_geom_hash = g_hash_table_new(g_str_hash, g_str_equal);
+ window_geom_hash = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, window_geom_free);
}
g_hash_table_foreach(window_geom_hash, write_recent_geom, rf);
}
+/** Write all known window splitter states to the recent file.
+ *
+ * @param rf recent file handle from caller
+ */
+static void
+window_splitter_recent_write_all(FILE *rf)
+{
+ /* init hashtable, if not already done */
+ if (!window_splitter_hash) {
+ return;
+ }
+
+ GHashTableIter iter;
+ void *key, *value;
+ g_hash_table_iter_init(&iter, window_splitter_hash);
+ while (g_hash_table_iter_next(&iter, &key, &value)) {
+ fprintf(rf, "\n# Splitter state of %s window.\n", (char*)key);
+ fprintf(rf, "# Qt Splitter state (hex byte string).\n");
+ fprintf(rf, RECENT_GUI_GEOMETRY "%s.splitter: %s\n", (char*)key,
+ (char*)value);
+ }
+}
+
/* Global list of recent capture filters. */
static GList *recent_cfilter_list;
@@ -386,7 +460,7 @@ static GHashTable *per_interface_cfilter_lists_hash;
* before the pref, so don't truncate the list when reading
* (see the similar #16782 for the recent files.)
*/
-static guint cfilter_combo_max_recent = 20;
+static unsigned cfilter_combo_max_recent = 20;
/**
* Returns a list of recent capture filters.
@@ -394,7 +468,7 @@ static guint cfilter_combo_max_recent = 20;
* @param ifname interface name; NULL refers to the global list.
*/
GList *
-recent_get_cfilter_list(const gchar *ifname)
+recent_get_cfilter_list(const char *ifname)
{
if (ifname == NULL)
return recent_cfilter_list;
@@ -413,11 +487,11 @@ recent_get_cfilter_list(const gchar *ifname)
* @param s text of capture filter
*/
void
-recent_add_cfilter(const gchar *ifname, const gchar *s)
+recent_add_cfilter(const char *ifname, const char *s)
{
GList *cfilter_list;
GList *li;
- gchar *li_filter, *newfilter = NULL;
+ char *li_filter, *newfilter = NULL;
/* Don't add empty filters to the list. */
if (s[0] == '\0')
@@ -460,7 +534,13 @@ recent_add_cfilter(const gchar *ifname, const gchar *s)
}
#ifdef HAVE_PCAP_REMOTE
-static GHashTable *remote_host_list=NULL;
+/* XXX: use a preference for this setting! */
+/* N.B.: If we use a pref, we will read the recent_common file
+ * before the pref, so don't truncate the list when reading
+ * (see the similar #16782 for the recent files.)
+ */
+static unsigned remote_host_max_recent = 20;
+static GList *remote_host_list;
int recent_get_remote_host_list_size(void)
{
@@ -468,40 +548,62 @@ int recent_get_remote_host_list_size(void)
/* No entries exist. */
return 0;
}
- return g_hash_table_size (remote_host_list);
+ return g_list_length(remote_host_list);
}
-void recent_add_remote_host(gchar *host, struct remote_host *rh)
+static void
+free_remote_host(void *value)
{
- if (remote_host_list == NULL) {
- remote_host_list = g_hash_table_new (g_str_hash, g_str_equal);
- }
- g_hash_table_insert (remote_host_list, g_strdup(host), rh);
+ struct remote_host* rh = (struct remote_host*)value;
+
+ g_free(rh->r_host);
+ g_free(rh->remote_port);
+ g_free(rh->auth_username);
+ g_free(rh->auth_password);
+
}
-static gboolean
-free_remote_host (gpointer key _U_, gpointer value, gpointer user _U_)
+static int
+remote_host_compare(const void *a, const void *b)
{
- struct remote_host *rh = (struct remote_host *) value;
+ const struct remote_host* rh_a = (const struct remote_host*)a;
+ const struct remote_host* rh_b = (const struct remote_host*)b;
- g_free (rh->r_host);
- g_free (rh->remote_port);
- g_free (rh->auth_username);
- g_free (rh->auth_password);
+ /* We assume only one entry per host (the GUI assumes that too.) */
+ return g_strcmp0(rh_a->r_host, rh_b->r_host);
+}
- return TRUE;
+static void
+remote_host_reverse(void)
+{
+ if (remote_host_list) {
+ remote_host_list = g_list_reverse(remote_host_list);
+ }
+}
+
+void recent_add_remote_host(char *host _U_, struct remote_host *rh)
+{
+ GList* li = NULL;
+ if (remote_host_list) {
+ li = g_list_find_custom(remote_host_list, rh, remote_host_compare);
+ if (li != NULL) {
+ free_remote_host(li->data);
+ remote_host_list = g_list_delete_link(remote_host_list, li);
+ }
+ }
+ remote_host_list = g_list_prepend(remote_host_list, rh);
}
void
-recent_remote_host_list_foreach(GHFunc func, gpointer user_data)
+recent_remote_host_list_foreach(GFunc func, void *user_data)
{
if (remote_host_list != NULL) {
- g_hash_table_foreach(remote_host_list, func, user_data);
+ g_list_foreach(remote_host_list, func, user_data);
}
}
static void
-recent_print_remote_host (gpointer key _U_, gpointer value, gpointer user)
+recent_print_remote_host(void *value, void *user)
{
FILE *rf = (FILE *)user;
struct remote_host_info *ri = (struct remote_host_info *)value;
@@ -517,28 +619,35 @@ recent_print_remote_host (gpointer key _U_, gpointer value, gpointer user)
static void
capture_remote_combo_recent_write_all(FILE *rf)
{
- if (remote_host_list && g_hash_table_size (remote_host_list) > 0) {
- /* Write all remote interfaces to the recent file */
- g_hash_table_foreach (remote_host_list, recent_print_remote_host, rf);
+ unsigned max_count = 0;
+ GList *li = g_list_first(remote_host_list);
+
+ /* write all non empty remote capture hosts to the recent file (until max count) */
+ while (li && (max_count++ <= remote_host_max_recent)) {
+ recent_print_remote_host(li->data, rf);
+ li = li->next;
}
}
void recent_free_remote_host_list(void)
{
- g_hash_table_foreach_remove(remote_host_list, free_remote_host, NULL);
+ g_list_free_full(remote_host_list, free_remote_host);
+ remote_host_list = NULL;
}
struct remote_host *
-recent_get_remote_host(const gchar *host)
+recent_get_remote_host(const char *host)
{
if (host == NULL)
return NULL;
- if (remote_host_list == NULL) {
- /* No such host exist. */
- return NULL;
+ for (GList* li = g_list_first(remote_host_list); li != NULL; li = li->next) {
+ struct remote_host *rh = (struct remote_host*)li->data;
+ if (g_strcmp0(host, rh->r_host) == 0) {
+ return rh;
+ }
}
- return (struct remote_host *)g_hash_table_lookup(remote_host_list, host);
+ return NULL;
}
/**
@@ -547,8 +656,8 @@ recent_get_remote_host(const gchar *host)
* @param s String to be filled from the 'recent' file.
* @return True, if the list was written successfully, False otherwise.
*/
-static gboolean
-capture_remote_combo_add_recent(const gchar *s)
+static bool
+capture_remote_combo_add_recent(const char *s)
{
GList *vals = prefs_get_string_list (s);
GList *valp = vals;
@@ -557,21 +666,22 @@ capture_remote_combo_add_recent(const gchar *s)
struct remote_host *rh;
if (valp == NULL)
- return FALSE;
+ return false;
- if (remote_host_list == NULL) {
- remote_host_list = g_hash_table_new (g_str_hash, g_str_equal);
+ /* First value is the host */
+ if (recent_get_remote_host(valp->data)) {
+ /* Don't add it, it's already in the list (shouldn't happen). */
+ return false; // Should this be true or false?
}
-
- rh =(struct remote_host *) g_malloc (sizeof (*rh));
+ rh = (struct remote_host *) g_malloc (sizeof (*rh));
/* First value is the host */
- rh->r_host = (gchar *)g_strdup ((const gchar *)valp->data);
+ rh->r_host = (char *)g_strdup ((const char *)valp->data);
if (strlen(rh->r_host) == 0) {
/* Empty remote host */
g_free(rh->r_host);
g_free(rh);
- return FALSE;
+ return false;
}
rh->auth_type = CAPTURE_AUTH_NULL;
valp = valp->next;
@@ -580,9 +690,9 @@ capture_remote_combo_add_recent(const gchar *s)
/* Found value 2, this is the port number */
if (!strcmp((const char*)valp->data, "0")) {
/* Port 0 isn't valid, so leave port blank */
- rh->remote_port = (gchar *)g_strdup ("");
+ rh->remote_port = (char *)g_strdup ("");
} else {
- rh->remote_port = (gchar *)g_strdup ((const gchar *)valp->data);
+ rh->remote_port = (char *)g_strdup ((const char *)valp->data);
}
valp = valp->next;
} else {
@@ -592,7 +702,7 @@ capture_remote_combo_add_recent(const gchar *s)
if (valp) {
/* Found value 3, this is the authentication type */
- auth_type = (capture_auth)strtol((const gchar *)valp->data, &p, 0);
+ auth_type = (capture_auth)strtol((const char *)valp->data, &p, 0);
if (p != valp->data && *p == '\0') {
rh->auth_type = auth_type;
}
@@ -604,16 +714,15 @@ capture_remote_combo_add_recent(const gchar *s)
prefs_clear_string_list(vals);
- g_hash_table_insert (remote_host_list, g_strdup(rh->r_host), rh);
-
- return TRUE;
+ remote_host_list = g_list_prepend(remote_host_list, rh);
+ return true;
}
#endif
static void
-cfilter_recent_write_all_list(FILE *rf, const gchar *ifname, GList *cfilter_list)
+cfilter_recent_write_all_list(FILE *rf, const char *ifname, GList *cfilter_list)
{
- guint max_count = 0;
+ unsigned max_count = 0;
GList *li;
/* write all non empty capture filter strings to the recent file (until max count) */
@@ -630,9 +739,9 @@ cfilter_recent_write_all_list(FILE *rf, const gchar *ifname, GList *cfilter_list
}
static void
-cfilter_recent_write_all_hash_callback(gpointer key, gpointer value, gpointer user_data)
+cfilter_recent_write_all_hash_callback(void *key, void *value, void *user_data)
{
- cfilter_recent_write_all_list((FILE *)user_data, (const gchar *)key, (GList *)value);
+ cfilter_recent_write_all_list((FILE *)user_data, (const char *)key, (GList *)value);
}
/** Write all capture filter values to the recent file.
@@ -647,7 +756,7 @@ cfilter_recent_write_all(FILE *rf)
/* Write out all the per-interface lists. */
if (per_interface_cfilter_lists_hash != NULL) {
- g_hash_table_foreach(per_interface_cfilter_lists_hash, cfilter_recent_write_all_hash_callback, (gpointer)rf);
+ g_hash_table_foreach(per_interface_cfilter_lists_hash, cfilter_recent_write_all_hash_callback, (void *)rf);
}
}
@@ -664,7 +773,7 @@ cfilter_recent_reverse_all(void)
/* Reverse all the per-interface lists. */
if (per_interface_cfilter_lists_hash != NULL) {
GHashTableIter iter;
- gpointer key, value;
+ void *key, *value;
g_hash_table_iter_init(&iter, per_interface_cfilter_lists_hash);
GList *li;
while (g_hash_table_iter_next(&iter, &key, &value)) {
@@ -681,20 +790,20 @@ cfilter_recent_reverse_all(void)
/* Write out recent settings of particular types. */
static void
write_recent_boolean(FILE *rf, const char *description, const char *name,
- gboolean value)
+ bool value)
{
fprintf(rf, "\n# %s.\n", description);
- fprintf(rf, "# TRUE or FALSE (case-insensitive).\n");
- fprintf(rf, "%s: %s\n", name, value == TRUE ? "TRUE" : "FALSE");
+ fprintf(rf, "# true or false (case-insensitive).\n");
+ fprintf(rf, "%s: %s\n", name, value == true ? "true" : "false");
}
static void
write_recent_enum(FILE *rf, const char *description, const char *name,
- const value_string *values, guint value)
+ const value_string *values, unsigned value)
{
const char *if_invalid = NULL;
const value_string *valp;
- const gchar *str_value;
+ const char *str_value;
fprintf(rf, "\n# %s.\n", description);
fprintf(rf, "# One of: ");
@@ -716,9 +825,9 @@ write_recent_enum(FILE *rf, const char *description, const char *name,
}
/* Attempt to write out "recent common" to the user's recent_common file.
- If we got an error report it with a dialog box and return FALSE,
- otherwise return TRUE. */
-gboolean
+ If we got an error report it with a dialog box and return false,
+ otherwise return true. */
+bool
write_recent(void)
{
char *pf_dir_path;
@@ -739,16 +848,16 @@ write_recent(void)
"Can't create directory\n\"%s\"\nfor recent file: %s.", pf_dir_path,
g_strerror(errno));
g_free(pf_dir_path);
- return FALSE;
+ return false;
}
- rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
+ rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, false);
if ((rf = ws_fopen(rf_path, "w")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't open recent file\n\"%s\": %s.", rf_path,
g_strerror(errno));
g_free(rf_path);
- return FALSE;
+ return false;
}
g_free(rf_path);
@@ -779,7 +888,7 @@ write_recent(void)
#ifdef HAVE_PCAP_REMOTE
fputs("\n"
- "######## Recent remote hosts, cannot be altered through command line ########\n"
+ "######## Recent remote hosts (latest first), cannot be altered through command line ########\n"
"\n", rf);
capture_remote_combo_recent_write_all(rf);
@@ -798,6 +907,13 @@ write_recent(void)
RECENT_GUI_GEOMETRY_MAIN_MAXIMIZED,
recent.gui_geometry_main_maximized);
+ if (recent.gui_geometry_main != NULL) {
+ fprintf(rf, "\n# Main window geometry state.\n");
+ fprintf(rf, "# Hex byte string.\n");
+ fprintf(rf, RECENT_GUI_GEOMETRY_MAIN ": %s\n",
+ recent.gui_geometry_main);
+ }
+
write_recent_boolean(rf, "Leftalign Action Buttons",
RECENT_GUI_GEOMETRY_LEFTALIGN_ACTIONS,
recent.gui_geometry_leftalign_actions);
@@ -805,10 +921,11 @@ write_recent(void)
fprintf(rf, "\n# Last used Configuration Profile.\n");
fprintf(rf, RECENT_LAST_USED_PROFILE ": %s\n", get_profile_name());
- fprintf(rf, "\n# WLAN statistics upper pane size.\n");
- fprintf(rf, "# Decimal number.\n");
- fprintf(rf, RECENT_GUI_GEOMETRY_WLAN_STATS_PANE ": %d\n",
- recent.gui_geometry_wlan_stats_pane);
+ fprintf(rf, "\n# Number of packets or events to check for automatic profile switching.\n");
+ fprintf(rf, "# Decimal number. Zero disables switching.\n");
+ const char * def_prefix = recent.gui_profile_switch_check_count == 1000 ? "#" : "";
+ fprintf(rf, "%s" RECENT_PROFILE_SWITCH_CHECK_COUNT ": %d\n", def_prefix,
+ recent.gui_profile_switch_check_count);
write_recent_boolean(rf, "Warn if running with elevated permissions (e.g. as root)",
RECENT_KEY_PRIVS_WARN_IF_ELEVATED,
@@ -825,6 +942,12 @@ write_recent(void)
write_recent_boolean(rf, "Find packet case sensitive search",
RECENT_GUI_SEARCH_CASE_SENSITIVE,
recent.gui_search_case_sensitive);
+ write_recent_boolean(rf, "Find packet search reverse direction",
+ RECENT_GUI_SEARCH_REVERSE_DIR,
+ recent.gui_search_reverse_dir);
+ write_recent_boolean(rf, "Find packet search multiple occurrences",
+ RECENT_GUI_SEARCH_MULTIPLE_OCCURS,
+ recent.gui_search_multiple_occurs);
write_recent_enum(rf, "Find packet search type", RECENT_GUI_SEARCH_TYPE, search_type_values,
recent.gui_search_type);
@@ -842,14 +965,14 @@ write_recent(void)
an error indication, or maybe write to a new recent file and
rename that file on top of the old one only if there are not I/O
errors. */
- return TRUE;
+ return true;
}
/* Attempt to Write out profile "recent" to the user's profile recent file.
- If we got an error report it with a dialog box and return FALSE,
- otherwise return TRUE. */
-gboolean
+ If we got an error report it with a dialog box and return false,
+ otherwise return true. */
+bool
write_profile_recent(void)
{
char *pf_dir_path;
@@ -870,16 +993,16 @@ write_profile_recent(void)
"Can't create directory\n\"%s\"\nfor recent file: %s.", pf_dir_path,
g_strerror(errno));
g_free(pf_dir_path);
- return FALSE;
+ return false;
}
- rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE);
+ rf_path = get_persconffile_path(RECENT_FILE_NAME, true);
if ((rf = ws_fopen(rf_path, "w")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Can't open recent file\n\"%s\": %s.", rf_path,
g_strerror(errno));
g_free(rf_path);
- return FALSE;
+ return false;
}
g_free(rf_path);
@@ -953,7 +1076,7 @@ write_profile_recent(void)
{
const char *if_invalid = NULL;
const value_string *valp;
- const gchar *str_value;
+ const char *str_value;
fprintf(rf, "\n# %s.\n", "Timestamp display precision");
fprintf(rf, "# One of: ");
@@ -1008,6 +1131,10 @@ write_profile_recent(void)
RECENT_GUI_FOLLOW_SHOW, bytes_show_values,
recent.gui_follow_show);
+ write_recent_enum(rf, "Follow stream delta times",
+ RECENT_GUI_FOLLOW_DELTA, follow_delta_values,
+ recent.gui_follow_delta);
+
write_recent_enum(rf, "Show packet bytes decode as",
RECENT_GUI_SHOW_BYTES_DECODE, show_bytes_decode_values,
recent.gui_show_bytes_decode);
@@ -1029,6 +1156,22 @@ write_profile_recent(void)
recent.gui_geometry_main_lower_pane);
}
+ if (recent.gui_geometry_main_master_split != NULL) {
+ fprintf(rf, "\n# Main window master splitter state.\n");
+ fprintf(rf, "# Hex byte string.\n");
+ fprintf(rf, RECENT_GUI_GEOMETRY_MAIN_MASTER_SPLIT ": %s\n",
+ recent.gui_geometry_main_master_split);
+ }
+
+ if (recent.gui_geometry_main_extra_split != NULL) {
+ fprintf(rf, "\n# Main window extra splitter state.\n");
+ fprintf(rf, "# Hex byte string.\n");
+ fprintf(rf, RECENT_GUI_GEOMETRY_MAIN_EXTRA_SPLIT ": %s\n",
+ recent.gui_geometry_main_extra_split);
+ }
+
+ window_splitter_recent_write_all(rf);
+
fprintf(rf, "\n# Packet list column pixel widths.\n");
fprintf(rf, "# Each pair of strings consists of a column format and its pixel width.\n");
packet_list_recent_write_all(rf);
@@ -1084,14 +1227,14 @@ write_profile_recent(void)
an error indication, or maybe write to a new recent file and
rename that file on top of the old one only if there are not I/O
errors. */
- return TRUE;
+ return true;
}
/* set one user's recent common file key/value pair */
static prefs_set_pref_e
-read_set_recent_common_pair_static(gchar *key, const gchar *value,
+read_set_recent_common_pair_static(char *key, const char *value,
void *private_data _U_,
- gboolean return_range_errors _U_)
+ bool return_range_errors _U_)
{
long num;
char *p;
@@ -1104,37 +1247,40 @@ read_set_recent_common_pair_static(gchar *key, const gchar *value,
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
- recent.gui_geometry_main_x = (gint)num;
+ recent.gui_geometry_main_x = (int)num;
} else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_Y) == 0) {
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
- recent.gui_geometry_main_y = (gint)num;
+ recent.gui_geometry_main_y = (int)num;
} else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_WIDTH) == 0) {
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
if (num <= 0)
return PREFS_SET_SYNTAX_ERR; /* number must be positive */
- recent.gui_geometry_main_width = (gint)num;
+ recent.gui_geometry_main_width = (int)num;
} else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_HEIGHT) == 0) {
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
if (num <= 0)
return PREFS_SET_SYNTAX_ERR; /* number must be positive */
- recent.gui_geometry_main_height = (gint)num;
+ recent.gui_geometry_main_height = (int)num;
+ } else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN) == 0) {
+ g_free(recent.gui_geometry_main);
+ recent.gui_geometry_main = g_strdup(value);
} else if (strcmp(key, RECENT_LAST_USED_PROFILE) == 0) {
- if ((strcmp(value, DEFAULT_PROFILE) != 0) && profile_exists (value, FALSE)) {
+ if ((strcmp(value, DEFAULT_PROFILE) != 0) && profile_exists (value, false)) {
set_profile_name (value);
}
- } else if (strcmp(key, RECENT_GUI_GEOMETRY_WLAN_STATS_PANE) == 0) {
+ } else if (strcmp(key, RECENT_PROFILE_SWITCH_CHECK_COUNT) == 0) {
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
if (num <= 0)
return PREFS_SET_SYNTAX_ERR; /* number must be positive */
- recent.gui_geometry_wlan_stats_pane = (gint)num;
+ recent.gui_profile_switch_check_count = (int)num;
} else if (strncmp(key, RECENT_GUI_GEOMETRY, sizeof(RECENT_GUI_GEOMETRY)-1) == 0) {
/* now have something like "gui.geom.main.x", split it into win and sub_key */
char *win = &key[sizeof(RECENT_GUI_GEOMETRY)-1];
@@ -1154,6 +1300,10 @@ read_set_recent_common_pair_static(gchar *key, const gchar *value,
recent.gui_search_char_set = (search_char_set_type)str_to_val(value, search_char_set_values, SEARCH_CHAR_SET_NARROW_AND_WIDE);
} else if (strcmp(key, RECENT_GUI_SEARCH_CASE_SENSITIVE) == 0) {
parse_recent_boolean(value, &recent.gui_search_case_sensitive);
+ } else if (strcmp(key, RECENT_GUI_SEARCH_REVERSE_DIR) == 0) {
+ parse_recent_boolean(value, &recent.gui_search_reverse_dir);
+ } else if (strcmp(key, RECENT_GUI_SEARCH_MULTIPLE_OCCURS) == 0) {
+ parse_recent_boolean(value, &recent.gui_search_multiple_occurs);
} else if (strcmp(key, RECENT_GUI_SEARCH_TYPE) == 0) {
recent.gui_search_type = (search_type_type)str_to_val(value, search_type_values, SEARCH_TYPE_DISPLAY_FILTER);
} else if (strcmp(key, RECENT_GUI_CUSTOM_COLORS) == 0) {
@@ -1165,17 +1315,15 @@ read_set_recent_common_pair_static(gchar *key, const gchar *value,
/* set one user's recent file key/value pair */
static prefs_set_pref_e
-read_set_recent_pair_static(gchar *key, const gchar *value,
+read_set_recent_pair_static(char *key, const char *value,
void *private_data _U_,
- gboolean return_range_errors _U_)
+ bool return_range_errors _U_)
{
long num;
- gint32 num_int32;
+ int32_t num_int32;
char *p;
GList *col_l, *col_l_elt;
col_width_data *cfmt;
- const gchar *cust_format = col_format_to_string(COL_CUSTOM);
- int cust_format_len = (int) strlen(cust_format);
if (strcmp(key, RECENT_KEY_MAIN_TOOLBAR_SHOW) == 0) {
parse_recent_boolean(value, &recent.main_toolbar_show);
@@ -1231,7 +1379,7 @@ read_set_recent_pair_static(gchar *key, const gchar *value,
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
- recent.gui_zoom_level = (gint)num;
+ recent.gui_zoom_level = (int)num;
} else if (strcmp(key, RECENT_GUI_BYTES_VIEW) == 0) {
recent.gui_bytes_view =
(bytes_view_type)str_to_val(value, bytes_view_type_values, BYTES_HEX);
@@ -1244,33 +1392,52 @@ read_set_recent_pair_static(gchar *key, const gchar *value,
parse_recent_boolean(value, &recent.gui_allow_hover_selection);
} else if (strcmp(key, RECENT_GUI_FOLLOW_SHOW) == 0) {
recent.gui_follow_show = (bytes_show_type)str_to_val(value, bytes_show_values, SHOW_ASCII);
+ } else if (strcmp(key, RECENT_GUI_FOLLOW_DELTA) == 0) {
+ recent.gui_follow_delta = (follow_delta_type)str_to_val(value, follow_delta_values, FOLLOW_DELTA_NONE);
} else if (strcmp(key, RECENT_GUI_SHOW_BYTES_DECODE) == 0) {
recent.gui_show_bytes_decode = (bytes_decode_type)str_to_val(value, show_bytes_decode_values, DecodeAsNone);
} else if (strcmp(key, RECENT_GUI_SHOW_BYTES_SHOW) == 0) {
recent.gui_show_bytes_show = (bytes_show_type)str_to_val(value, bytes_show_values, SHOW_ASCII);
- } else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_MAXIMIZED) == 0) {
- parse_recent_boolean(value, &recent.gui_geometry_main_maximized);
} else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_UPPER_PANE) == 0) {
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
if (num <= 0)
return PREFS_SET_SYNTAX_ERR; /* number must be positive */
- recent.gui_geometry_main_upper_pane = (gint)num;
+ recent.gui_geometry_main_upper_pane = (int)num;
} else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_LOWER_PANE) == 0) {
num = strtol(value, &p, 0);
if (p == value || *p != '\0')
return PREFS_SET_SYNTAX_ERR; /* number was bad */
if (num <= 0)
return PREFS_SET_SYNTAX_ERR; /* number must be positive */
- recent.gui_geometry_main_lower_pane = (gint)num;
+ recent.gui_geometry_main_lower_pane = (int)num;
+ } else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_MASTER_SPLIT) == 0) {
+ g_free(recent.gui_geometry_main_master_split);
+ recent.gui_geometry_main_master_split = g_strdup(value);
+ } else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_EXTRA_SPLIT) == 0) {
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_extra_split = g_strdup(value);
+ } else if (strncmp(key, RECENT_GUI_GEOMETRY, sizeof(RECENT_GUI_GEOMETRY)-1) == 0) {
+ /* now have something like "gui.geom.win.sub_key", split it into win and sub_key */
+ char *win = &key[sizeof(RECENT_GUI_GEOMETRY)-1];
+ char *sub_key = strchr(win, '.');
+ if (sub_key) {
+ *sub_key = '\0';
+ sub_key++;
+ window_geom_recent_read_pair(win, sub_key, value);
+ }
} else if (strcmp(key, RECENT_GUI_CONVERSATION_TABS) == 0) {
+ g_list_free_full(recent.conversation_tabs, g_free);
recent.conversation_tabs = prefs_get_string_list(value);
} else if (strcmp(key, RECENT_GUI_CONVERSATION_TABS_COLUMNS) == 0) {
+ g_list_free_full(recent.conversation_tabs_columns, g_free);
recent.conversation_tabs_columns = prefs_get_string_list(value);
} else if (strcmp(key, RECENT_GUI_ENDPOINT_TABS) == 0) {
+ g_list_free_full(recent.endpoint_tabs, g_free);
recent.endpoint_tabs = prefs_get_string_list(value);
} else if (strcmp(key, RECENT_GUI_ENDPOINT_TABS_COLUMNS) == 0) {
+ g_list_free_full(recent.endpoint_tabs_columns, g_free);
recent.endpoint_tabs_columns = prefs_get_string_list(value);
} else if (strcmp(key, RECENT_GUI_RLC_PDUS_FROM_MAC_FRAMES) == 0) {
parse_recent_boolean(value, &recent.gui_rlc_use_pdus_from_mac);
@@ -1283,63 +1450,18 @@ read_set_recent_pair_static(gchar *key, const gchar *value,
prefs_clear_string_list(col_l);
return PREFS_SET_SYNTAX_ERR;
}
- /* Check to make sure all column formats are valid. */
- col_l_elt = g_list_first(col_l);
- while (col_l_elt) {
- fmt_data cfmt_check;
-
- /* Make sure the format isn't empty. */
- if (strcmp((const char *)col_l_elt->data, "") == 0) {
- /* It is. */
- prefs_clear_string_list(col_l);
- return PREFS_SET_SYNTAX_ERR;
- }
-
- /* Some predefined columns have been migrated to use custom
- * columns. We'll convert these silently here */
- try_convert_to_custom_column((char **)&col_l_elt->data);
-
- /* Check the format. */
- if (!parse_column_format(&cfmt_check, (char *)col_l_elt->data)) {
- /* It's not a valid column format. */
- prefs_clear_string_list(col_l);
- return PREFS_SET_SYNTAX_ERR;
- }
- if (cfmt_check.fmt == COL_CUSTOM) {
- /* We don't need the custom column field on this pass. */
- g_free(cfmt_check.custom_fields);
- }
-
- /* Go past the format. */
- col_l_elt = col_l_elt->next;
-
- /* Go past the width. */
- col_l_elt = col_l_elt->next;
- }
- free_col_width_info(&recent);
+ recent_free_column_width_info(&recent);
recent.col_width_list = NULL;
col_l_elt = g_list_first(col_l);
while (col_l_elt) {
- gchar *fmt = g_strdup((const gchar *)col_l_elt->data);
cfmt = g_new(col_width_data, 1);
- if (strncmp(fmt, cust_format, cust_format_len) != 0) {
- cfmt->cfmt = get_column_format_from_str(fmt);
- cfmt->cfield = NULL;
- } else {
- cfmt->cfmt = COL_CUSTOM;
- cfmt->cfield = g_strdup(&fmt[cust_format_len+1]); /* add 1 for ':' */
- }
- g_free (fmt);
- if (cfmt->cfmt == -1) {
- g_free(cfmt->cfield);
- g_free(cfmt);
- return PREFS_SET_SYNTAX_ERR; /* string was bad */
- }
-
+ /* Skip the column format, we don't use it anymore because the
+ * column indices are in sync and the key since 4.4. Format is
+ * still written for backwards compatibility.
+ */
col_l_elt = col_l_elt->next;
- cfmt->width = (gint)strtol((const char *)col_l_elt->data, &p, 0);
+ cfmt->width = (int)strtol((const char *)col_l_elt->data, &p, 0);
if (p == col_l_elt->data || (*p != '\0' && *p != ':')) {
- g_free(cfmt->cfield);
g_free(cfmt);
return PREFS_SET_SYNTAX_ERR; /* number was bad */
}
@@ -1371,15 +1493,15 @@ read_set_recent_pair_static(gchar *key, const gchar *value,
/* set one user's recent file key/value pair */
static prefs_set_pref_e
-read_set_recent_pair_dynamic(gchar *key, const gchar *value,
+read_set_recent_pair_dynamic(char *key, const char *value,
void *private_data _U_,
- gboolean return_range_errors _U_)
+ bool return_range_errors _U_)
{
if (!g_utf8_validate(value, -1, NULL)) {
return PREFS_SET_SYNTAX_ERR;
}
if (strcmp(key, RECENT_KEY_CAPTURE_FILE) == 0) {
- add_menu_recent_capture_file(value);
+ add_menu_recent_capture_file(value, true);
} else if (strcmp(key, RECENT_KEY_DISPLAY_FILTER) == 0) {
dfilter_combo_add_recent(value);
} else if (strcmp(key, RECENT_KEY_CAPTURE_FILTER) == 0) {
@@ -1406,7 +1528,7 @@ read_set_recent_pair_dynamic(gchar *key, const gchar *value,
int
recent_set_arg(char *prefarg)
{
- gchar *p, *colonp;
+ char *p, *colonp;
int ret;
colonp = strchr(prefarg, ':');
@@ -1433,14 +1555,14 @@ recent_set_arg(char *prefarg)
return PREFS_SET_SYNTAX_ERR;
}
- ret = read_set_recent_pair_static(prefarg, p, NULL, TRUE);
+ ret = read_set_recent_pair_static(prefarg, p, NULL, true);
*colonp = ':'; /* put the colon back */
return ret;
}
/* opens the user's recent common file and read the first part */
-gboolean
+bool
recent_read_static(char **rf_path_return, int *rf_errno_return)
{
char *rf_path;
@@ -1451,20 +1573,22 @@ recent_read_static(char **rf_path_return, int *rf_errno_return)
recent.gui_geometry_main_y = 20;
recent.gui_geometry_main_width = DEF_WIDTH;
recent.gui_geometry_main_height = DEF_HEIGHT;
- recent.gui_geometry_main_maximized= FALSE;
-
- recent.gui_geometry_leftalign_actions = FALSE;
+ recent.gui_geometry_main_maximized= false;
- recent.gui_geometry_wlan_stats_pane = 200;
+ recent.gui_geometry_leftalign_actions = false;
- recent.privs_warn_if_elevated = TRUE;
- recent.sys_warn_if_no_capture = TRUE;
+ recent.privs_warn_if_elevated = true;
+ recent.sys_warn_if_no_capture = true;
recent.col_width_list = NULL;
+ recent.gui_geometry_main = NULL;
+ recent.gui_geometry_main_master_split = NULL;
+ recent.gui_geometry_main_extra_split = NULL;
+ recent.gui_profile_switch_check_count = 1000;
recent.gui_fileopen_remembered_dir = NULL;
/* Construct the pathname of the user's recent common file. */
- rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
+ rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, false);
/* Read the user's recent common file, if it exists. */
*rf_path_return = NULL;
@@ -1480,41 +1604,42 @@ recent_read_static(char **rf_path_return, int *rf_errno_return)
if (errno != ENOENT) {
*rf_errno_return = errno;
*rf_path_return = rf_path;
- return FALSE;
+ return false;
}
}
g_free(rf_path);
- return TRUE;
+ return true;
}
/* opens the user's recent file and read the first part */
-gboolean
+bool
recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
{
char *rf_path, *rf_common_path;
FILE *rf;
/* set defaults */
- recent.main_toolbar_show = TRUE;
- recent.filter_toolbar_show = TRUE;
- recent.wireless_toolbar_show = FALSE;
- recent.packet_list_show = TRUE;
- recent.tree_view_show = TRUE;
- recent.byte_view_show = TRUE;
- recent.packet_diagram_show = TRUE;
- recent.statusbar_show = TRUE;
- recent.packet_list_colorize = TRUE;
- recent.capture_auto_scroll = TRUE;
+ recent.main_toolbar_show = true;
+ recent.filter_toolbar_show = true;
+ recent.wireless_toolbar_show = false;
+ recent.packet_list_show = true;
+ recent.tree_view_show = true;
+ recent.byte_view_show = true;
+ recent.packet_diagram_show = true;
+ recent.statusbar_show = true;
+ recent.packet_list_colorize = true;
+ recent.capture_auto_scroll = true;
recent.gui_time_format = TS_RELATIVE;
recent.gui_time_precision = TS_PREC_AUTO;
recent.gui_seconds_format = TS_SECONDS_DEFAULT;
recent.gui_zoom_level = 0;
recent.gui_bytes_view = BYTES_HEX;
recent.gui_bytes_encoding = BYTES_ENC_FROM_PACKET;
- recent.gui_allow_hover_selection = TRUE;
+ recent.gui_allow_hover_selection = true;
recent.gui_follow_show = SHOW_ASCII;
+ recent.gui_follow_delta = FOLLOW_DELTA_NONE;
recent.gui_show_bytes_decode = DecodeAsNone;
recent.gui_show_bytes_show = SHOW_ASCII;
@@ -1522,8 +1647,22 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
recent.gui_geometry_main_upper_pane = 0;
recent.gui_geometry_main_lower_pane = 0;
+ if (recent.gui_geometry_main) {
+ g_free(recent.gui_geometry_main);
+ recent.gui_geometry_main = NULL;
+ }
+
+ if (recent.gui_geometry_main_master_split) {
+ g_free(recent.gui_geometry_main_master_split);
+ recent.gui_geometry_main_master_split = NULL;
+ }
+ if (recent.gui_geometry_main_extra_split) {
+ g_free(recent.gui_geometry_main_extra_split);
+ recent.gui_geometry_main_extra_split = NULL;
+ }
+
if (recent.col_width_list) {
- free_col_width_info(&recent);
+ recent_free_column_width_info(&recent);
}
if (recent.gui_fileopen_remembered_dir) {
@@ -1542,7 +1681,7 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
}
/* Construct the pathname of the user's profile recent file. */
- rf_path = get_persconffile_path(RECENT_FILE_NAME, TRUE);
+ rf_path = get_persconffile_path(RECENT_FILE_NAME, true);
/* Read the user's recent file, if it exists. */
*rf_path_return = NULL;
@@ -1559,7 +1698,7 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
* know what's supposed to happen at this point.
* ToDo: Determine if the "recent common file" should be read at this point
*/
- rf_common_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
+ rf_common_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, false);
if (!file_exists(rf_common_path)) {
/* Read older common settings from recent file */
rf = ws_fopen(rf_path, "r");
@@ -1574,15 +1713,15 @@ recent_read_profile_static(char **rf_path_return, int *rf_errno_return)
if (errno != ENOENT) {
*rf_errno_return = errno;
*rf_path_return = rf_path;
- return FALSE;
+ return false;
}
}
g_free(rf_path);
- return TRUE;
+ return true;
}
/* opens the user's recent file and read it out */
-gboolean
+bool
recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
{
char *rf_path;
@@ -1590,11 +1729,11 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
/* Construct the pathname of the user's recent common file. */
- rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, FALSE);
+ rf_path = get_persconffile_path(RECENT_COMMON_FILE_NAME, false);
if (!file_exists (rf_path)) {
/* Recent common file does not exist, read from default recent */
g_free (rf_path);
- rf_path = get_persconffile_path(RECENT_FILE_NAME, FALSE);
+ rf_path = get_persconffile_path(RECENT_FILE_NAME, false);
}
/* Read the user's recent file, if it exists. */
@@ -1610,6 +1749,9 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
* all to keep the latest first.
*/
cfilter_recent_reverse_all();
+#ifdef HAVE_PCAP_REMOTE
+ remote_host_reverse();
+#endif
fclose(rf);
} else {
/* We failed to open it. If we failed for some reason other than
@@ -1618,142 +1760,122 @@ recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
if (errno != ENOENT) {
*rf_errno_return = errno;
*rf_path_return = rf_path;
- return FALSE;
+ return false;
}
}
g_free(rf_path);
- return TRUE;
+ return true;
}
-gint
-recent_get_column_width(gint col)
+void
+recent_insert_column(int col)
{
- GList *col_l;
col_width_data *col_w;
- gint cfmt;
- const gchar *cfield = NULL;
- cfmt = get_column_format(col);
- if (cfmt == COL_CUSTOM) {
- cfield = get_column_custom_fields(col);
- }
-
- col_l = g_list_first(recent.col_width_list);
- while (col_l) {
- col_w = (col_width_data *) col_l->data;
- if (col_w->cfmt == cfmt) {
- if (cfmt != COL_CUSTOM) {
- return col_w->width;
- } else if (cfield && strcmp (cfield, col_w->cfield) == 0) {
- return col_w->width;
- }
- }
- col_l = col_l->next;
- }
-
- return -1;
+ col_w = g_new(col_width_data, 1);
+ col_w->width = -1;
+ col_w->xalign = COLUMN_XALIGN_DEFAULT;
+ recent.col_width_list = g_list_insert(recent.col_width_list, col_w, col);
}
void
-recent_set_column_width(gint col, gint width)
+recent_remove_column(int col)
{
- GList *col_l;
+ GList *col_l = g_list_nth(recent.col_width_list, col);
col_width_data *col_w;
- gint cfmt;
- const gchar *cfield = NULL;
- gboolean found = FALSE;
- cfmt = get_column_format(col);
- if (cfmt == COL_CUSTOM) {
- cfield = get_column_custom_fields(col);
- }
+ if (!col_l) return;
- col_l = g_list_first(recent.col_width_list);
- while (col_l) {
- col_w = (col_width_data *) col_l->data;
- if (col_w->cfmt == cfmt) {
- if (cfmt != COL_CUSTOM || strcmp (cfield, col_w->cfield) == 0) {
- col_w->width = width;
- found = TRUE;
- break;
- }
- }
- col_l = col_l->next;
- }
+ col_w = (col_width_data*)col_l->data;
- if (!found) {
- col_w = g_new(col_width_data, 1);
- col_w->cfmt = cfmt;
- col_w->cfield = g_strdup(cfield);
- col_w->width = width;
- col_w->xalign = COLUMN_XALIGN_DEFAULT;
- recent.col_width_list = g_list_append(recent.col_width_list, col_w);
+ if (col_w) {
+ free_col_width_data(col_w);
}
+
+ recent.col_width_list = g_list_delete_link(recent.col_width_list, col_l);
}
-gchar
-recent_get_column_xalign(gint col)
+int
+recent_get_column_width(int col)
{
- GList *col_l;
col_width_data *col_w;
- gint cfmt;
- const gchar *cfield = NULL;
- cfmt = get_column_format(col);
- if (cfmt == COL_CUSTOM) {
- cfield = get_column_custom_fields(col);
- }
-
- col_l = g_list_first(recent.col_width_list);
- while (col_l) {
- col_w = (col_width_data *) col_l->data;
- if (col_w->cfmt == cfmt) {
- if (cfmt != COL_CUSTOM) {
- return col_w->xalign;
- } else if (cfield && strcmp (cfield, col_w->cfield) == 0) {
- return col_w->xalign;
- }
+ col_w = g_list_nth_data(recent.col_width_list, col);
+ if (col_w) {
+ return col_w->width;
+ } else {
+ /* Make sure the recent column list isn't out of sync with the
+ * number of columns (e.g., for a brand new profile.)
+ */
+ for (unsigned colnr = g_list_length(recent.col_width_list); colnr < g_list_length(prefs.col_list); colnr++) {
+ recent_insert_column(colnr);
}
- col_l = col_l->next;
}
- return 0;
+ return -1;
}
void
-recent_set_column_xalign(gint col, gchar xalign)
+recent_set_column_width(int col, int width)
{
- GList *col_l;
col_width_data *col_w;
- gint cfmt;
- const gchar *cfield = NULL;
- gboolean found = FALSE;
- cfmt = get_column_format(col);
- if (cfmt == COL_CUSTOM) {
- cfield = get_column_custom_fields(col);
+ col_w = g_list_nth_data(recent.col_width_list, col);
+ if (col_w) {
+ col_w->width = width;
+ } else {
+ /* Make sure the recent column list isn't out of sync with the
+ * number of columns (e.g., for a brand new profile.)
+ */
+ for (unsigned colnr = g_list_length(recent.col_width_list); colnr < g_list_length(prefs.col_list); colnr++) {
+ recent_insert_column(colnr);
+ }
+ col_w = g_list_nth_data(recent.col_width_list, col);
+ if (col_w) {
+ col_w->width = width;
+ }
}
+}
- col_l = g_list_first(recent.col_width_list);
- while (col_l) {
- col_w = (col_width_data *) col_l->data;
- if (col_w->cfmt == cfmt) {
- if (cfmt != COL_CUSTOM || strcmp (cfield, col_w->cfield) == 0) {
- col_w->xalign = xalign;
- found = TRUE;
- break;
- }
+char
+recent_get_column_xalign(int col)
+{
+ col_width_data *col_w;
+
+ col_w = g_list_nth_data(recent.col_width_list, col);
+ if (col_w) {
+ return col_w->xalign;
+ } else {
+ /* Make sure the recent column list isn't out of sync with the
+ * number of columns (e.g., for a brand new profile.)
+ */
+ for (unsigned colnr = g_list_length(recent.col_width_list); colnr < g_list_length(prefs.col_list); colnr++) {
+ recent_insert_column(colnr);
}
- col_l = col_l->next;
}
- if (!found) {
- col_w = g_new(col_width_data, 1);
- col_w->cfmt = cfmt;
- col_w->cfield = g_strdup(cfield);
- col_w->width = 40;
+ return COLUMN_XALIGN_DEFAULT;
+}
+
+void
+recent_set_column_xalign(int col, char xalign)
+{
+ col_width_data *col_w;
+
+ col_w = g_list_nth_data(recent.col_width_list, col);
+ if (col_w) {
col_w->xalign = xalign;
- recent.col_width_list = g_list_append(recent.col_width_list, col_w);
+ } else {
+ /* Make sure the recent column list isn't out of sync with the
+ * number of columns (e.g., for a brand new profile.)
+ */
+ for (unsigned colnr = g_list_length(recent.col_width_list); colnr < g_list_length(prefs.col_list); colnr++) {
+ recent_insert_column(colnr);
+ }
+ col_w = g_list_nth_data(recent.col_width_list, col);
+ if (col_w) {
+ col_w->xalign = xalign;
+ }
}
}
@@ -1766,7 +1888,10 @@ recent_init(void)
void
recent_cleanup(void)
{
- free_col_width_info(&recent);
+ recent_free_column_width_info(&recent);
+ g_free(recent.gui_geometry_main);
+ g_free(recent.gui_geometry_main_master_split);
+ g_free(recent.gui_geometry_main_extra_split);
g_free(recent.gui_fileopen_remembered_dir);
g_list_free_full(recent.gui_additional_toolbars, g_free);
g_list_free_full(recent.interface_toolbars, g_free);
diff --git a/ui/recent.h b/ui/recent.h
index 99918ea4..07163dbd 100644
--- a/ui/recent.h
+++ b/ui/recent.h
@@ -41,10 +41,8 @@ extern "C" {
#define RECENT_KEY_REMOTE_HOST "recent.remote_host"
typedef struct _col_width_data {
- gint cfmt;
- gchar *cfield;
- gint width;
- gchar xalign;
+ int width;
+ char xalign;
} col_width_data;
/** Defines used in col_width_data.xalign */
@@ -102,6 +100,12 @@ typedef enum {
} bytes_show_type;
typedef enum {
+ FOLLOW_DELTA_NONE,
+ FOLLOW_DELTA_TURN,
+ FOLLOW_DELTA_ALL
+} follow_delta_type;
+
+typedef enum {
DecodeAsNone,
DecodeAsBASE64,
DecodeAsCompressed,
@@ -113,53 +117,59 @@ typedef enum {
/** Recent settings. */
typedef struct recent_settings_tag {
- gboolean main_toolbar_show;
- gboolean filter_toolbar_show;
- gboolean wireless_toolbar_show;
- gboolean packet_list_show;
- gboolean tree_view_show;
- gboolean byte_view_show;
- gboolean packet_diagram_show;
- gboolean statusbar_show;
- gboolean packet_list_colorize;
- gboolean capture_auto_scroll;
+ bool main_toolbar_show;
+ bool filter_toolbar_show;
+ bool wireless_toolbar_show;
+ bool packet_list_show;
+ bool tree_view_show;
+ bool byte_view_show;
+ bool packet_diagram_show;
+ bool statusbar_show;
+ bool packet_list_colorize;
+ bool capture_auto_scroll;
ts_type gui_time_format;
- gint gui_time_precision;
+ int gui_time_precision;
ts_seconds_type gui_seconds_format;
- gint gui_zoom_level;
+ int gui_zoom_level;
bytes_view_type gui_bytes_view;
bytes_encoding_type gui_bytes_encoding;
- gboolean gui_packet_diagram_field_values;
- gboolean gui_allow_hover_selection;
+ bool gui_packet_diagram_field_values;
+ bool gui_allow_hover_selection;
search_in_type gui_search_in;
search_char_set_type gui_search_char_set;
- gboolean gui_search_case_sensitive;
+ bool gui_search_case_sensitive;
+ bool gui_search_reverse_dir;
+ bool gui_search_multiple_occurs;
search_type_type gui_search_type;
bytes_show_type gui_follow_show;
+ follow_delta_type gui_follow_delta;
bytes_decode_type gui_show_bytes_decode;
bytes_show_type gui_show_bytes_show;
- gint gui_geometry_main_x;
- gint gui_geometry_main_y;
- gint gui_geometry_main_width;
- gint gui_geometry_main_height;
-
- gboolean gui_geometry_main_maximized;
- gboolean gui_geometry_leftalign_actions;
-
- gint gui_geometry_main_upper_pane;
- gint gui_geometry_main_lower_pane;
- gint gui_geometry_wlan_stats_pane;
- gboolean privs_warn_if_elevated;
- gboolean sys_warn_if_no_capture;
+ int gui_geometry_main_x;
+ int gui_geometry_main_y;
+ int gui_geometry_main_width;
+ int gui_geometry_main_height;
+
+ bool gui_geometry_main_maximized;
+ bool gui_geometry_leftalign_actions;
+
+ int gui_geometry_main_upper_pane;
+ int gui_geometry_main_lower_pane;
+ char *gui_geometry_main;
+ char *gui_geometry_main_master_split;
+ char *gui_geometry_main_extra_split;
+ bool privs_warn_if_elevated;
+ bool sys_warn_if_no_capture;
GList *col_width_list; /* column widths */
GList *conversation_tabs; /* enabled conversation dialog tabs */
GList *conversation_tabs_columns; /* save the columns for conversation dialogs */
GList *endpoint_tabs; /* enabled endpoint dialog tabs */
GList *endpoint_tabs_columns; /* save the columns for endpoint dialogs */
- gchar *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
- gboolean gui_rlc_use_pdus_from_mac;
+ int gui_profile_switch_check_count; /* number of packets / events to check for automatic profile switching */
+ char *gui_fileopen_remembered_dir; /* folder of last capture loaded in File Open dialog */
+ bool gui_rlc_use_pdus_from_mac;
GList *custom_colors;
GList *gui_additional_toolbars;
GList *interface_toolbars;
@@ -176,39 +186,39 @@ extern void recent_cleanup(void);
/** Write recent_common settings file.
*
- * @return TRUE if succeeded, FALSE if failed
+ * @return true if succeeded, false if failed
*/
-extern gboolean write_recent(void);
+extern bool write_recent(void);
/** Write profile recent settings file.
*
- * @return TRUE if succeeded, FALSE if failed
+ * @return true if succeeded, false if failed
*/
-extern gboolean write_profile_recent(void);
+extern bool write_profile_recent(void);
/** Read recent settings file (static part).
*
* @param rf_path_return path to recent file if function failed
* @param rf_errno_return if failed
- * @return TRUE if succeeded, FALSE if failed (check parameters for reason).
+ * @return true if succeeded, false if failed (check parameters for reason).
*/
-extern gboolean recent_read_static(char **rf_path_return, int *rf_errno_return);
+extern bool recent_read_static(char **rf_path_return, int *rf_errno_return);
/** Read profile recent settings file (static part).
*
* @param rf_path_return path to recent file if function failed
* @param rf_errno_return if failed
- * @return TRUE if succeeded, FALSE if failed (check parameters for reason).
+ * @return true if succeeded, false if failed (check parameters for reason).
*/
-extern gboolean recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
+extern bool recent_read_profile_static(char **rf_path_return, int *rf_errno_return);
/** Read recent settings file (dynamic part).
*
* @param rf_path_return path to recent file if function failed
* @param rf_errno_return if failed
- * @return TRUE if succeeded, FALSE if failed (check parameters for reason).
+ * @return true if succeeded, false if failed (check parameters for reason).
*/
-extern gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
+extern bool recent_read_dynamic(char **rf_path_return, int *rf_errno_return);
/**
* Given a -o command line string, parse it and set the recent value in
@@ -221,44 +231,70 @@ extern gboolean recent_read_dynamic(char **rf_path_return, int *rf_errno_return)
*/
extern int recent_set_arg(char *prefarg);
+/** Free the recent settings list of column width information
+ *
+ * @param rs the recent settings (currently a global)
+ */
+extern void recent_free_column_width_info(recent_settings_t *rs);
+
+/** Insert an entry in the recent column width setting for
+ * the given column, which should have been just added to
+ * the column list preference. (This keeps them in sync.)
+ *
+ * @param col column number
+ */
+extern void recent_insert_column(int col);
+
+/** Remove an entry in the recent column width setting for
+ * the given column, which should have been just removed to
+ * the column list preference. (This keeps them in sync.)
+ *
+ * @param col column number
+ */
+extern void recent_remove_column(int col);
+
/** Get the column width for the given column
*
* @param col column number
*/
-extern gint recent_get_column_width(gint col);
+extern int recent_get_column_width(int col);
/** Set the column width for the given column
*
* @param col column number
* @param width column width
*/
-extern void recent_set_column_width(gint col, gint width);
+extern void recent_set_column_width(int col, int width);
/** Get the column xalign for the given column
*
* @param col column number
*/
-extern gchar recent_get_column_xalign(gint col);
+extern char recent_get_column_xalign(int col);
/** Set the column xalign for the given column
*
* @param col column number
* @param xalign column alignment
*/
-extern void recent_set_column_xalign(gint col, gchar xalign);
+extern void recent_set_column_xalign(int col, char xalign);
/* save the window and its current geometry into the geometry hashtable */
-extern void window_geom_save(const gchar *name, window_geometry_t *geom);
+extern void window_geom_save(const char *name, window_geometry_t *geom);
/* load the desired geometry for this window from the geometry hashtable */
-extern gboolean window_geom_load(const gchar *name, window_geometry_t *geom);
+extern bool window_geom_load(const char *name, window_geometry_t *geom);
+
+extern void window_splitter_save(const char *name, const char *splitter_state);
+
+extern const char * window_splitter_load(const char *name);
/**
* Returns a list of recent capture filters.
*
* @param ifname interface name; NULL refers to the global list.
*/
-extern GList *recent_get_cfilter_list(const gchar *ifname);
+extern GList *recent_get_cfilter_list(const char *ifname);
/**
* Add a capture filter to the global recent capture filter list or
@@ -267,7 +303,7 @@ extern GList *recent_get_cfilter_list(const gchar *ifname);
* @param ifname interface name; NULL refers to the global list.
* @param s text of capture filter
*/
-extern void recent_add_cfilter(const gchar *ifname, const gchar *s);
+extern void recent_add_cfilter(const char *ifname, const char *s);
/**
* Get the value of an entry for a remote host from the remote host list.
@@ -276,7 +312,7 @@ extern void recent_add_cfilter(const gchar *ifname, const gchar *s);
*
* @return pointer to the entry for the remote host.
*/
-extern struct remote_host *recent_get_remote_host(const gchar *host);
+extern struct remote_host *recent_get_remote_host(const char *host);
/**
* Get the number of entries of the remote host list.
@@ -292,7 +328,7 @@ extern int recent_get_remote_host_list_size(void);
* @param func function to be called
* @param user_data argument to pass as user data to the function
*/
-extern void recent_remote_host_list_foreach(GHFunc func, gpointer user_data);
+extern void recent_remote_host_list_foreach(GFunc func, void *user_data);
/**
* Free all entries of the remote host list.
@@ -305,7 +341,7 @@ extern void recent_free_remote_host_list(void);
* @param host Key of the entry
* @param rh Value of the entry
*/
-extern void recent_add_remote_host(gchar *host, struct remote_host *rh);
+extern void recent_add_remote_host(char *host, struct remote_host *rh);
#ifdef __cplusplus
}
diff --git a/ui/recent_utils.h b/ui/recent_utils.h
index 711f80d1..2d3fc7b1 100644
--- a/ui/recent_utils.h
+++ b/ui/recent_utils.h
@@ -17,9 +17,16 @@
extern "C" {
#endif /* __cplusplus */
-/* Add a new recent capture filename to the "Recent Files" submenu
- (duplicates will be ignored) */
-extern void add_menu_recent_capture_file(const gchar *cf_name);
+/** Add a new recent capture filename to the "Recent Files" submenu
+ * (duplicates will be ignored)
+ *
+ * @param cf_name Capture filename to add
+ * @param force If true, then prefs.gui_recent_file_count_max will be
+ * ignored when adding the file. This is for startup, when the recent_common
+ * file is read before the prefs file. (It will be corrected later when
+ * prefs are read.)
+ */
+extern void add_menu_recent_capture_file(const char *cf_name, bool force);
/** Write all recent capture filenames to the user's recent file.
* @param rf recent file
@@ -37,7 +44,7 @@ extern void cfilter_combo_recent_write_all(FILE *rf);
*
* @param dftext the filter string
*/
-extern gboolean dfilter_combo_add_recent(const gchar *dftext);
+extern bool dfilter_combo_add_recent(const char *dftext);
/** Write all non-empty display filters (until maximum count)
* of the combo box GList to the user's recent file.
diff --git a/ui/rtp_media.c b/ui/rtp_media.c
index fe69c2df..e79f3a7f 100644
--- a/ui/rtp_media.c
+++ b/ui/rtp_media.c
@@ -36,9 +36,9 @@ typedef struct _rtp_decoder_t {
*/
size_t
-decode_rtp_packet_payload(guint8 payload_type, const gchar *payload_type_str, int payload_rate, int payload_channels, wmem_map_t *payload_fmtp_map, guint8 *payload_data, size_t payload_len, SAMPLE **out_buff, GHashTable *decoders_hash, guint *channels_ptr, guint *sample_rate_ptr)
+decode_rtp_packet_payload(uint8_t payload_type, const char *payload_type_str, int payload_rate, int payload_channels, wmem_map_t *payload_fmtp_map, uint8_t *payload_data, size_t payload_len, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr)
{
- const gchar *p;
+ const char *p;
rtp_decoder_t *decoder;
SAMPLE *tmp_buff = NULL;
size_t tmp_buff_len;
@@ -96,9 +96,9 @@ decode_rtp_packet_payload(guint8 payload_type, const gchar *payload_type_str, in
*/
size_t
-decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, guint *channels_ptr, guint *sample_rate_ptr)
+decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr)
{
- guint8 payload_type;
+ uint8_t payload_type;
if ((rp->payload_data == NULL) || (rp->info->info_payload_len == 0) ) {
return 0;
@@ -111,7 +111,7 @@ decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash
/****************************************************************************/
static void
-rtp_decoder_value_destroy(gpointer dec_arg)
+rtp_decoder_value_destroy(void *dec_arg)
{
rtp_decoder_t *dec = (rtp_decoder_t *)dec_arg;
diff --git a/ui/rtp_media.h b/ui/rtp_media.h
index 2de2a853..6a6b1442 100644
--- a/ui/rtp_media.h
+++ b/ui/rtp_media.h
@@ -31,18 +31,18 @@ extern "C" {
/* INTERFACE */
/****************************************************************************/
-typedef gint16 SAMPLE;
-#define SAMPLE_MAX G_MAXINT16
-#define SAMPLE_MIN G_MININT16
+typedef int16_t SAMPLE;
+#define SAMPLE_MAX INT16_MAX
+#define SAMPLE_MIN INT16_MIN
#define SAMPLE_NaN SAMPLE_MIN
#define SAMPLE_BYTES (sizeof(SAMPLE) / sizeof(char))
/* Defines an RTP packet */
typedef struct _rtp_packet {
- guint32 frame_num; /* Qt only */
+ uint32_t frame_num; /* Qt only */
struct _rtp_info *info; /* the RTP dissected info */
double arrive_offset; /* arrive offset time since the beginning of the stream as ms in GTK UI and s in Qt UI */
- guint8* payload_data;
+ uint8_t* payload_data;
} rtp_packet_t;
/** Create a new hash table.
@@ -70,7 +70,7 @@ GHashTable *rtp_decoder_hash_table_new(void);
* @param sample_rate_ptr If non-NULL, receives the sample rate.
* @return The number of decoded bytes on success, 0 on failure.
*/
-size_t decode_rtp_packet_payload(guint8 payload_type, const gchar *payload_type_str, int payload_rate, int payload_channels, wmem_map_t *payload_fmtp_map, guint8 *payload_data, size_t payload_len, SAMPLE **out_buff, GHashTable *decoders_hash, guint *channels_ptr, guint *sample_rate_ptr);
+size_t decode_rtp_packet_payload(uint8_t payload_type, const char *payload_type_str, int payload_rate, int payload_channels, wmem_map_t *payload_fmtp_map, uint8_t *payload_data, size_t payload_len, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr);
/** Decode an RTP packet
*
@@ -81,7 +81,7 @@ size_t decode_rtp_packet_payload(guint8 payload_type, const gchar *payload_type_
* @param sample_rate_ptr If non-NULL, receives the sample rate.
* @return The number of decoded bytes on success, 0 on failure.
*/
-size_t decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, guint *channels_ptr, guint *sample_rate_ptr);
+size_t decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr);
#ifdef __cplusplus
}
diff --git a/ui/rtp_stream.c b/ui/rtp_stream.c
index 2dc2393c..949195cb 100644
--- a/ui/rtp_stream.c
+++ b/ui/rtp_stream.c
@@ -45,7 +45,7 @@ show_tap_registration_error(GString *error_string)
/* scan for RTP streams */
void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const char *fstring)
{
- gboolean was_registered;
+ bool was_registered;
if (!tapinfo || !cap_file) {
return;
@@ -66,12 +66,12 @@ void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const
/****************************************************************************/
/* save rtp dump of stream_fwd */
-gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream, const gchar *filename)
+bool rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream, const char *filename)
{
- gboolean was_registered;
+ bool was_registered;
if (!tapinfo) {
- return FALSE;
+ return false;
}
was_registered = tapinfo->is_registered;
@@ -79,15 +79,15 @@ gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rt
/* open file for saving */
tapinfo->save_file = ws_fopen(filename, "wb");
if (tapinfo->save_file==NULL) {
- open_failure_alert_box(filename, errno, TRUE);
- return FALSE;
+ open_failure_alert_box(filename, errno, true);
+ return false;
}
rtp_write_header(stream, tapinfo->save_file);
if (ferror(tapinfo->save_file)) {
write_failure_alert_box(filename, errno);
fclose(tapinfo->save_file);
- return FALSE;
+ return false;
}
if (!tapinfo->is_registered)
@@ -104,21 +104,21 @@ gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rt
if (ferror(tapinfo->save_file)) {
write_failure_alert_box(filename, errno);
fclose(tapinfo->save_file);
- return FALSE;
+ return false;
}
if (fclose(tapinfo->save_file) == EOF) {
write_failure_alert_box(filename, errno);
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/****************************************************************************/
/* mark packets in stream_fwd or stream_rev */
void rtpstream_mark(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream_fwd, rtpstream_info_t* stream_rev)
{
- gboolean was_registered;
+ bool was_registered;
if (!tapinfo) {
return;
diff --git a/ui/rtp_stream.h b/ui/rtp_stream.h
index 5d7ab01d..43e9ef28 100644
--- a/ui/rtp_stream.h
+++ b/ui/rtp_stream.h
@@ -40,31 +40,31 @@ extern "C" {
typedef struct _rtpstream_info {
rtpstream_id_t id;
- guint8 first_payload_type; /**< Numeric payload type */
- const gchar *first_payload_type_name; /**< Payload type name */
- const gchar *payload_type_names[256]; /**< Seen payload type names. Array index is payload type (byte), filled only during TAP_ANALYSE */
- gchar *all_payload_type_names; /**< All seen payload names for a stream in one string */
-
- gboolean is_srtp;
- guint32 packet_count;
- gboolean end_stream; /**< Used to track streams across payload types */
+ uint8_t first_payload_type; /**< Numeric payload type */
+ const char *first_payload_type_name; /**< Payload type name */
+ const char *payload_type_names[256]; /**< Seen payload type names. Array index is payload type (byte), filled only during TAP_ANALYSE */
+ char *all_payload_type_names; /**< All seen payload names for a stream in one string */
+
+ bool is_srtp;
+ uint32_t packet_count;
+ bool end_stream; /**< Used to track streams across payload types */
int rtp_event;
int call_num; /**< Used to match call_num in voip_calls_info_t */
- guint32 setup_frame_number; /**< frame number of setup message */
+ uint32_t setup_frame_number; /**< frame number of setup message */
/* Start and stop packets needed for .num and .abs_ts */
frame_data *start_fd;
frame_data *stop_fd;
nstime_t start_rel_time; /**< relative start time from pinfo */
nstime_t stop_rel_time; /**< relative stop time from pinfo */
nstime_t start_abs_time; /**< abs start time from pinfo */
- guint16 vlan_id;
- gboolean tag_vlan_error;
- gboolean tag_diffserv_error;
+ uint16_t vlan_id;
+ bool tag_vlan_error;
+ bool tag_diffserv_error;
tap_rtp_stat_t rtp_stats; /**< here goes the RTP statistics info */
- gboolean problem; /**< if the streams had wrong sequence numbers or wrong timestamps */
- const gchar *ed137_info; /** pointer to static text, no freeing is required */
+ bool problem; /**< if the streams had wrong sequence numbers or wrong timestamps */
+ const char *ed137_info; /** pointer to static text, no freeing is required */
} rtpstream_info_t;
/** tapping modes */
@@ -100,8 +100,8 @@ struct _rtpstream_tapinfo {
rtpstream_info_t *filter_stream_fwd; /**< used as filter in some tap modes */
rtpstream_info_t *filter_stream_rev; /**< used as filter in some tap modes */
FILE *save_file;
- gboolean is_registered; /**< if the tap listener is currently registered or not */
- gboolean apply_display_filter; /**< if apply display filter during analyse */
+ bool is_registered; /**< if the tap listener is currently registered or not */
+ bool apply_display_filter; /**< if apply display filter during analyse */
};
#if 0
@@ -129,7 +129,7 @@ void rtpstream_scan(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, const
* Saves an RTP stream as raw data stream with timestamp information for later RTP playback.
* (redissects all packets)
*/
-gboolean rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream, const gchar *filename);
+bool rtpstream_save(rtpstream_tapinfo_t *tapinfo, capture_file *cap_file, rtpstream_info_t* stream, const char *filename);
/**
* Marks all packets belonging to either of stream_fwd or stream_rev.
diff --git a/ui/rtp_stream_id.c b/ui/rtp_stream_id.c
index 2c00a5e4..3c7c33ad 100644
--- a/ui/rtp_stream_id.c
+++ b/ui/rtp_stream_id.c
@@ -38,7 +38,7 @@ void rtpstream_id_copy(const rtpstream_id_t *src, rtpstream_id_t *dest)
/****************************************************************************/
/* deep copy of id from packet_info */
-void rtpstream_id_copy_pinfo(const packet_info *pinfo, rtpstream_id_t *dest, gboolean swap_src_dst)
+void rtpstream_id_copy_pinfo(const packet_info *pinfo, rtpstream_id_t *dest, bool swap_src_dst)
{
if (!swap_src_dst)
{
@@ -58,7 +58,7 @@ void rtpstream_id_copy_pinfo(const packet_info *pinfo, rtpstream_id_t *dest, gbo
/****************************************************************************/
/* shallow copy from packet_info to id */
-void rtpstream_id_copy_pinfo_shallow(const packet_info *pinfo, rtpstream_id_t *dest, gboolean swap_src_dst)
+void rtpstream_id_copy_pinfo_shallow(const packet_info *pinfo, rtpstream_id_t *dest, bool swap_src_dst)
{
if (!swap_src_dst)
{
@@ -86,9 +86,9 @@ void rtpstream_id_free(rtpstream_id_t *id)
/****************************************************************************/
/* convert rtpstream_id_t to hash */
-guint rtpstream_id_to_hash(const rtpstream_id_t *id)
+unsigned rtpstream_id_to_hash(const rtpstream_id_t *id)
{
- guint hash = 0;
+ unsigned hash = 0;
if (!id) { return 0; }
/* XOR of: */
@@ -106,30 +106,30 @@ guint rtpstream_id_to_hash(const rtpstream_id_t *id)
/****************************************************************************/
/* compare two ids by flags */
-gboolean rtpstream_id_equal(const rtpstream_id_t *id1, const rtpstream_id_t *id2, guint flags)
+bool rtpstream_id_equal(const rtpstream_id_t *id1, const rtpstream_id_t *id2, unsigned flags)
{
if (addresses_equal(&(id1->src_addr), &(id2->src_addr))
&& id1->src_port == id2->src_port
&& addresses_equal(&(id1->dst_addr), &(id2->dst_addr))
&& id1->dst_port == id2->dst_port)
{
- gboolean equal = TRUE;
+ bool equal = true;
if ((flags & RTPSTREAM_ID_EQUAL_SSRC)
&& id1->ssrc != id2->ssrc)
{
- equal = FALSE;
+ equal = false;
}
return equal;
}
- return FALSE;
+ return false;
}
/****************************************************************************/
/* compare an rtpstream id address and ports with pinfo */
-gboolean rtpstream_id_equal_pinfo(const rtpstream_id_t *id, const packet_info *pinfo, bool swap_src_dst)
+bool rtpstream_id_equal_pinfo(const rtpstream_id_t *id, const packet_info *pinfo, bool swap_src_dst)
{
if (!swap_src_dst) {
if (addresses_equal(&(id->src_addr), &(pinfo->src))
@@ -137,7 +137,7 @@ gboolean rtpstream_id_equal_pinfo(const rtpstream_id_t *id, const packet_info *p
&& addresses_equal(&(id->dst_addr), &(pinfo->dst))
&& id->dst_port == pinfo->destport)
{
- return TRUE;
+ return true;
}
} else {
if (addresses_equal(&(id->src_addr), &(pinfo->dst))
@@ -145,15 +145,15 @@ gboolean rtpstream_id_equal_pinfo(const rtpstream_id_t *id, const packet_info *p
&& addresses_equal(&(id->dst_addr), &(pinfo->src))
&& id->dst_port == pinfo->srcport)
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/****************************************************************************/
/* compare two ids, one in pinfo */
-gboolean rtpstream_id_equal_pinfo_rtp_info(const rtpstream_id_t *id, const packet_info *pinfo, const struct _rtp_info *rtp_info)
+bool rtpstream_id_equal_pinfo_rtp_info(const rtpstream_id_t *id, const packet_info *pinfo, const struct _rtp_info *rtp_info)
{
if (addresses_equal(&(id->src_addr), &(pinfo->src))
&& id->src_port == pinfo->srcport
@@ -161,17 +161,17 @@ gboolean rtpstream_id_equal_pinfo_rtp_info(const rtpstream_id_t *id, const packe
&& id->dst_port == pinfo->destport
&& id->ssrc == rtp_info->info_sync_src)
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/****************************************************************************/
/* convert packet_info and _rtp_info to hash */
-guint pinfo_rtp_info_to_hash(const packet_info *pinfo, const struct _rtp_info *rtp_info)
+unsigned pinfo_rtp_info_to_hash(const packet_info *pinfo, const struct _rtp_info *rtp_info)
{
- guint hash = 0;
+ unsigned hash = 0;
if (!pinfo || !rtp_info) { return 0; }
/* XOR of: */
diff --git a/ui/rtp_stream_id.h b/ui/rtp_stream_id.h
index 46b92b68..09adb10d 100644
--- a/ui/rtp_stream_id.h
+++ b/ui/rtp_stream_id.h
@@ -32,16 +32,16 @@ struct _rtp_info;
/** Defines an rtp stream identification */
typedef struct _rtpstream_id {
address src_addr;
- guint16 src_port;
+ uint16_t src_port;
address dst_addr;
- guint16 dst_port;
- guint32 ssrc;
+ uint16_t dst_port;
+ uint32_t ssrc;
} rtpstream_id_t;
/**
* Get hash of rtpstream_id
*/
-guint rtpstream_id_to_hash(const rtpstream_id_t *id);
+unsigned rtpstream_id_to_hash(const rtpstream_id_t *id);
/**
* Copy rtpstream_id_t structure
@@ -51,13 +51,13 @@ void rtpstream_id_copy(const rtpstream_id_t *src, rtpstream_id_t *dest);
/**
* Deep copy addresses and ports from pinfo
*/
-void rtpstream_id_copy_pinfo(const packet_info *pinfo, rtpstream_id_t *dest, gboolean swap_src_dst);
+void rtpstream_id_copy_pinfo(const packet_info *pinfo, rtpstream_id_t *dest, bool swap_src_dst);
/**
* Shallow copy addresses and ports from pinfo
* Do not call rtpstream_id_free if you use this function.
*/
-void rtpstream_id_copy_pinfo_shallow(const packet_info *pinfo, rtpstream_id_t *dest, gboolean swap_src_dst);
+void rtpstream_id_copy_pinfo_shallow(const packet_info *pinfo, rtpstream_id_t *dest, bool swap_src_dst);
/**
* Free memory allocated for id
@@ -73,26 +73,26 @@ void rtpstream_id_free(rtpstream_id_t *id);
*/
#define RTPSTREAM_ID_EQUAL_NONE 0x0000
#define RTPSTREAM_ID_EQUAL_SSRC 0x0001
-gboolean rtpstream_id_equal(const rtpstream_id_t *id1, const rtpstream_id_t *id2, guint flags);
+bool rtpstream_id_equal(const rtpstream_id_t *id1, const rtpstream_id_t *id2, unsigned flags);
/**
* Check if rtpstream_id_t is equal to pinfo
* - compare src_addr, dest_addr, src_port, dest_port with pinfo
* - if swap_src_dst is true, compare src to dst and vice versa
*/
-gboolean rtpstream_id_equal_pinfo(const rtpstream_id_t *id, const packet_info *pinfo, bool swap_src_dst);
+bool rtpstream_id_equal_pinfo(const rtpstream_id_t *id, const packet_info *pinfo, bool swap_src_dst);
/**
* Check if rtpstream_id_t is equal to pinfo and rtp_info
* - compare src_addr, dest_addr, src_port, dest_port with pinfo
* - compare ssrc with rtp_info
*/
-gboolean rtpstream_id_equal_pinfo_rtp_info(const rtpstream_id_t *id, const packet_info *pinfo, const struct _rtp_info *rtp_info);
+bool rtpstream_id_equal_pinfo_rtp_info(const rtpstream_id_t *id, const packet_info *pinfo, const struct _rtp_info *rtp_info);
/**
* Get hash of rtpstream_id extracted from packet_info and _rtp_info
*/
-guint pinfo_rtp_info_to_hash(const packet_info *pinfo, const struct _rtp_info *rtp_info);
+unsigned pinfo_rtp_info_to_hash(const packet_info *pinfo, const struct _rtp_info *rtp_info);
#ifdef __cplusplus
}
diff --git a/ui/simple_dialog.h b/ui/simple_dialog.h
index d99b0ee3..d8e01000 100644
--- a/ui/simple_dialog.h
+++ b/ui/simple_dialog.h
@@ -13,6 +13,10 @@
#ifndef __SIMPLE_DIALOG_UI_H__
#define __SIMPLE_DIALOG_UI_H__
+#include <glib.h>
+
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -93,12 +97,12 @@ typedef enum {
* get rid of primary_start and primary_end and reduce the amount of
* gymnastics we have to do in the Qt UI.
*/
-extern gpointer simple_dialog(ESD_TYPE_E type, gint btn_mask,
- const gchar *msg_format, ...)
+extern void *simple_dialog(ESD_TYPE_E type, int btn_mask,
+ const char *msg_format, ...)
G_GNUC_PRINTF(3, 4);
-extern gpointer simple_dialog_async(ESD_TYPE_E type, gint btn_mask,
- const gchar *msg_format, ...)
+extern void *simple_dialog_async(ESD_TYPE_E type, int btn_mask,
+ const char *msg_format, ...)
G_GNUC_PRINTF(3, 4);
/** Surround the primary dialog message text by
@@ -122,7 +126,7 @@ extern char *simple_dialog_format_message(const char *msg);
* Alert box, with optional "don't show this message again" variable
* and checkbox, and optional secondary text.
*/
-extern void simple_message_box(ESD_TYPE_E type, gboolean *notagain,
+extern void simple_message_box(ESD_TYPE_E type, bool *notagain,
const char *secondary_msg,
const char *msg_format, ...) G_GNUC_PRINTF(4, 5);
diff --git a/ui/software_update.c b/ui/software_update.c
index 52f45764..03753912 100644
--- a/ui/software_update.c
+++ b/ui/software_update.c
@@ -64,7 +64,7 @@
#endif
static char *get_appcast_update_url(software_update_channel_e chan) {
- GString *update_url_str = g_string_new("");;
+ GString *update_url_str = g_string_new("");
const char *chan_name;
const char *su_application = get_configuration_namespace();
const char *su_version = VERSION;
diff --git a/ui/ssl_key_export.c b/ui/ssl_key_export.c
index f077ef06..1dfe1e8a 100644
--- a/ui/ssl_key_export.c
+++ b/ui/ssl_key_export.c
@@ -25,12 +25,12 @@ int
ssl_session_key_count(void)
{
int count = 0;
- ssl_master_key_map_t *mk_map = tls_get_master_key_map(FALSE);
+ ssl_master_key_map_t *mk_map = tls_get_master_key_map(false);
if (!mk_map || !mk_map->used_crandom)
return count;
GHashTableIter iter;
- gpointer key;
+ void *key;
g_hash_table_iter_init(&iter, mk_map->used_crandom);
while (g_hash_table_iter_next(&iter, &key, NULL)) {
@@ -57,9 +57,9 @@ ssl_session_key_count(void)
}
static void
-tls_export_client_randoms_func(gpointer key, gpointer value, gpointer user_data, const char* label)
+tls_export_client_randoms_func(void *key, void *value, void *user_data, const char* label)
{
- guint i;
+ unsigned i;
StringInfo *client_random = (StringInfo *)key;
StringInfo *master_secret = (StringInfo *)value;
GString *keylist = (GString *)user_data;
@@ -79,8 +79,8 @@ tls_export_client_randoms_func(gpointer key, gpointer value, gpointer user_data,
g_string_append_c(keylist, '\n');
}
-gchar*
-ssl_export_sessions(gsize *length)
+char*
+ssl_export_sessions(size_t *length)
{
/* Output format is:
* "CLIENT_RANDOM zzzz yyyy\n"
@@ -100,47 +100,47 @@ ssl_export_sessions(gsize *length)
* The TLS 1.3 values are obtained from an existing key log, but exporting
* them is useful in order to filter actually used secrets or add a DSB.
*/
- ssl_master_key_map_t *mk_map = tls_get_master_key_map(FALSE);
+ ssl_master_key_map_t *mk_map = tls_get_master_key_map(false);
if (!mk_map) {
*length = 0;
return g_strdup("");
}
- gsize len = 177 * (gsize)ssl_session_key_count();
+ size_t len = 177 * (size_t)ssl_session_key_count();
GString *keylist = g_string_sized_new(len);
GHashTableIter iter;
- gpointer key, value;
+ void *key, *value;
g_hash_table_iter_init(&iter, mk_map->used_crandom);
while (g_hash_table_iter_next(&iter, &key, NULL)) {
if ((value = g_hash_table_lookup(mk_map->crandom, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "CLIENT_RANDOM ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "CLIENT_RANDOM ");
}
if ((value = g_hash_table_lookup(mk_map->tls13_client_early, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "CLIENT_EARLY_TRAFFIC_SECRET ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "CLIENT_EARLY_TRAFFIC_SECRET ");
}
if ((value = g_hash_table_lookup(mk_map->tls13_client_handshake, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "CLIENT_HANDSHAKE_TRAFFIC_SECRET ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "CLIENT_HANDSHAKE_TRAFFIC_SECRET ");
}
if ((value = g_hash_table_lookup(mk_map->tls13_server_handshake, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "SERVER_HANDSHAKE_TRAFFIC_SECRET ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "SERVER_HANDSHAKE_TRAFFIC_SECRET ");
}
if ((value = g_hash_table_lookup(mk_map->tls13_server_appdata, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "SERVER_TRAFFIC_SECRET_0 ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "SERVER_TRAFFIC_SECRET_0 ");
}
if ((value = g_hash_table_lookup(mk_map->tls13_client_appdata, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "CLIENT_TRAFFIC_SECRET_0 ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "CLIENT_TRAFFIC_SECRET_0 ");
}
#if 0
/* We don't use the EARLY_EXPORT_SECRET or EXPORTER_SECRET now so don't
export, but we may in the future. */
if ((value = g_hash_table_lookup(mk_map->tls13_early_exporter, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "EARLY_EXPORTER_SECRET ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "EARLY_EXPORTER_SECRET ");
}
if ((value = g_hash_table_lookup(mk_map->tls13_exporter, key))) {
- tls_export_client_randoms_func(key, value, (gpointer)keylist, "EXPORTER_SECRET ");
+ tls_export_client_randoms_func(key, value, (void *)keylist, "EXPORTER_SECRET ");
}
#endif
}
@@ -162,12 +162,12 @@ tls_export_dsb(capture_file *cf)
dsb->secrets_type = SECRETS_TYPE_TLS;
dsb->secrets_data = g_memdup2(secrets, secrets_len);
- dsb->secrets_len = (guint)secrets_len;
+ dsb->secrets_len = (unsigned)secrets_len;
/* XXX - support replacing the DSB of the same type instead of adding? */
wtap_file_add_decryption_secrets(cf->provider.wth, block);
/* Mark the file as having unsaved changes */
- cf->unsaved_changes = TRUE;
+ cf->unsaved_changes = true;
return;
}
diff --git a/ui/ssl_key_export.h b/ui/ssl_key_export.h
index edf42d43..945e4c5a 100644
--- a/ui/ssl_key_export.h
+++ b/ui/ssl_key_export.h
@@ -32,7 +32,7 @@ extern int ssl_session_key_count(void);
* @return A string containing all the SSL Session Keys. Must be freed with
* g_free().
*/
-extern gchar* ssl_export_sessions(gsize *length);
+extern char* ssl_export_sessions(size_t *length);
/** Add a DSB with the used TLS secrets to a capture file.
*
diff --git a/ui/summary.c b/ui/summary.c
index 58c7cd68..f271027a 100644
--- a/ui/summary.c
+++ b/ui/summary.c
@@ -106,14 +106,14 @@ void
summary_fill_in(capture_file *cf, summary_tally *st)
{
frame_data *first_frame, *cur_frame;
- guint32 framenum;
+ uint32_t framenum;
iface_summary_info iface;
- guint i;
+ unsigned i;
wtapng_iface_descriptions_t* idb_info;
wtap_block_t wtapng_if_descr;
wtapng_if_descr_mandatory_t *wtapng_if_descr_mand;
wtap_block_t if_stats;
- guint64 isb_ifdrop;
+ uint64_t isb_ifdrop;
char* if_string;
if_filter_opt_t if_filter;
@@ -164,7 +164,7 @@ summary_fill_in(capture_file *cf, summary_tally *st)
st->drops = cf->drops;
st->dfilter = cf->dfilter;
- st->ifaces = g_array_new(FALSE, FALSE, sizeof(iface_summary_info));
+ st->ifaces = g_array_new(false, false, sizeof(iface_summary_info));
idb_info = wtap_file_get_idb_info(cf->provider.wth);
for (i = 0; i < idb_info->interface_data->len; i++) {
wtapng_if_descr = g_array_index(idb_info->interface_data, wtap_block_t, i);
@@ -189,7 +189,7 @@ summary_fill_in(capture_file *cf, summary_tally *st)
} else {
iface.descr = NULL;
}
- iface.drops_known = FALSE;
+ iface.drops_known = false;
iface.drops = 0;
iface.snap = wtapng_if_descr_mand->snap_len;
iface.encap_type = wtapng_if_descr_mand->wtap_encap;
@@ -198,7 +198,7 @@ summary_fill_in(capture_file *cf, summary_tally *st)
/* dumpcap only writes one ISB, only handle that for now */
if_stats = g_array_index(wtapng_if_descr_mand->interface_statistics, wtap_block_t, 0);
if (wtap_block_get_uint64_option_value(if_stats, OPT_ISB_IFDROP, &isb_ifdrop) == WTAP_OPTTYPE_SUCCESS) {
- iface.drops_known = TRUE;
+ iface.drops_known = true;
iface.drops = isb_ifdrop;
}
/* XXX: this doesn't get used, and might need to be g_strdup'ed when it does */
@@ -240,7 +240,7 @@ summary_fill_in_capture(capture_file *cf,capture_options *capture_opts, summary_
{
iface_summary_info iface;
interface_t *device;
- guint i;
+ unsigned i;
if (st->ifaces->len == 0) {
/*
diff --git a/ui/summary.h b/ui/summary.h
index 95a51a38..f47cbaf0 100644
--- a/ui/summary.h
+++ b/ui/summary.h
@@ -25,8 +25,8 @@ typedef struct iface_summary_info_tag {
char *descr;
char *cfilter;
char *isb_comment;
- guint64 drops; /**< number of packet drops */
- gboolean drops_known; /**< TRUE if number of packet drops is known */
+ uint64_t drops; /**< number of packet drops */
+ bool drops_known; /**< true if number of packet drops is known */
int snap; /**< Maximum captured packet length; 0 if not known */
int encap_type; /**< wiretap encapsulation type */
} iface_summary_info;
@@ -34,41 +34,41 @@ typedef struct iface_summary_info_tag {
#define HASH_STR_SIZE (65) /* Max hash size * 2 + '\0' */
typedef struct _summary_tally {
- guint64 bytes; /**< total bytes */
+ uint64_t bytes; /**< total bytes */
double start_time; /**< seconds, with msec resolution */
double stop_time; /**< seconds, with msec resolution */
double elapsed_time; /**< seconds, with msec resolution,
includes time before first packet
and after last packet */
- guint32 marked_count; /**< number of marked packets */
- guint32 marked_count_ts; /**< number of time-stamped marked packets */
- guint64 marked_bytes; /**< total bytes in the marked packets */
+ uint32_t marked_count; /**< number of marked packets */
+ uint32_t marked_count_ts; /**< number of time-stamped marked packets */
+ uint64_t marked_bytes; /**< total bytes in the marked packets */
double marked_start; /**< time in seconds, with msec resolution */
double marked_stop; /**< time in seconds, with msec resolution */
- guint32 ignored_count; /**< number of ignored packets */
- guint32 packet_count; /**< total number of packets in trace */
- guint32 packet_count_ts; /**< total number of time-stamped packets in trace */
- guint32 filtered_count; /**< number of filtered packets */
- guint32 filtered_count_ts; /**< number of time-stamped filtered packets */
- guint64 filtered_bytes; /**< total bytes in the filtered packets */
+ uint32_t ignored_count; /**< number of ignored packets */
+ uint32_t packet_count; /**< total number of packets in trace */
+ uint32_t packet_count_ts; /**< total number of time-stamped packets in trace */
+ uint32_t filtered_count; /**< number of filtered packets */
+ uint32_t filtered_count_ts; /**< number of time-stamped filtered packets */
+ uint64_t filtered_bytes; /**< total bytes in the filtered packets */
double filtered_start; /**< time in seconds, with msec resolution */
double filtered_stop; /**< time in seconds, with msec resolution */
const char *filename; /**< path of capture file */
- gint64 file_length; /**< file length in bytes */
- gchar file_sha256[HASH_STR_SIZE]; /**< SHA256 hash of capture file */
- gchar file_sha1[HASH_STR_SIZE]; /**< SHA1 hash of capture file */
+ int64_t file_length; /**< file length in bytes */
+ char file_sha256[HASH_STR_SIZE]; /**< SHA256 hash of capture file */
+ char file_sha1[HASH_STR_SIZE]; /**< SHA1 hash of capture file */
int file_type; /**< wiretap file type */
wtap_compression_type compression_type; /**< compression type of file, or uncompressed */
int file_encap_type; /**< wiretap encapsulation type for file */
GArray *packet_encap_types; /**< wiretap encapsulation types for packets */
int snap; /**< Maximum captured packet length; 0 if not known */
- gboolean drops_known; /**< TRUE if number of packet drops is known */
- guint64 drops; /**< number of packet drops */
+ bool drops_known; /**< true if number of packet drops is known */
+ uint64_t drops; /**< number of packet drops */
const char *dfilter; /**< display filter */
- gboolean is_tempfile;
+ bool is_tempfile;
/* capture related, use summary_fill_in_capture() to get values */
GArray *ifaces;
- gboolean legacy;
+ bool legacy;
} summary_tally;
extern void
diff --git a/ui/tap-credentials.h b/ui/tap-credentials.h
index ef6de9ff..ac532b05 100644
--- a/ui/tap-credentials.h
+++ b/ui/tap-credentials.h
@@ -16,12 +16,12 @@
#define TAP_CREDENTIALS_PLACEHOLDER "n.a."
typedef struct tap_credential {
- guint num;
- guint username_num;
- guint password_hf_id;
- gchar* username;
- const gchar* proto;
- gchar* info;
+ unsigned num;
+ unsigned username_num;
+ unsigned password_hf_id;
+ char* username;
+ const char* proto;
+ char* info;
} tap_credential_t;
#endif
diff --git a/ui/tap-iax2-analysis.c b/ui/tap-iax2-analysis.c
index dbdbeb37..f540565a 100644
--- a/ui/tap-iax2-analysis.c
+++ b/ui/tap-iax2-analysis.c
@@ -82,7 +82,7 @@ iax2_packet_analyse(tap_iax2_stat_t *statinfo,
statinfo->jitter = 0;
statinfo->diff = 0;
statinfo->flags |= STAT_FLAG_FIRST;
- statinfo->first_packet = FALSE;
+ statinfo->first_packet = false;
}
/* is it a regular packet? */
if (!(statinfo->flags & STAT_FLAG_FIRST)
diff --git a/ui/tap-iax2-analysis.h b/ui/tap-iax2-analysis.h
index c3a1167a..834a84ec 100644
--- a/ui/tap-iax2-analysis.h
+++ b/ui/tap-iax2-analysis.h
@@ -36,25 +36,25 @@ extern "C" {
/* structure that holds the information about the forward and reversed direction */
typedef struct _iax2_bw_history_item {
double time;
- guint32 bytes;
+ uint32_t bytes;
} iax2_bw_history_item;
#define BUFF_BW 300
typedef struct _tap_iax2_stat_t {
- gboolean first_packet; /* do not use in code that is called after iax2_packet_analyse */
+ bool first_packet; /* do not use in code that is called after iax2_packet_analyse */
/* use (flags & STAT_FLAG_FIRST) instead */
/* all of the following fields will be initialized after
iax2_packet_analyse has been called */
- guint32 flags; /* see STAT_FLAG-defines below */
- guint16 seq_num;
- guint32 timestamp;
- guint32 delta_timestamp;
+ uint32_t flags; /* see STAT_FLAG-defines below */
+ uint16_t seq_num;
+ uint32_t timestamp;
+ uint32_t delta_timestamp;
double bandwidth;
iax2_bw_history_item bw_history[BUFF_BW];
- guint16 bw_start_index;
- guint16 bw_index;
- guint32 total_bytes;
+ uint16_t bw_start_index;
+ uint16_t bw_index;
+ uint32_t total_bytes;
double delta;
double jitter;
double diff;
@@ -63,14 +63,14 @@ typedef struct _tap_iax2_stat_t {
double max_delta;
double max_jitter;
double mean_jitter;
- guint32 max_nr;
- guint16 start_seq_nr;
- guint16 stop_seq_nr;
- guint32 total_nr;
- guint32 sequence;
- gboolean under; /* Unused? */
- gint cycles; /* Unused? */
- guint16 pt;
+ uint32_t max_nr;
+ uint16_t start_seq_nr;
+ uint16_t stop_seq_nr;
+ uint32_t total_nr;
+ uint32_t sequence;
+ bool under; /* Unused? */
+ int cycles; /* Unused? */
+ uint16_t pt;
int reg_pt;
} tap_iax2_stat_t;
diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c
index 0d4961c4..ae3972f2 100644
--- a/ui/tap-rlc-graph.c
+++ b/ui/tap-rlc-graph.c
@@ -22,11 +22,16 @@
#include <epan/epan_dissect.h>
#include <epan/tap.h>
-/* Return TRUE if the 2 sets of parameters refer to the same channel. */
-gboolean compare_rlc_headers(guint16 ueid1, guint16 channelType1, guint16 channelId1, guint8 rlcMode1, guint8 direction1,
- guint16 ueid2, guint16 channelType2, guint16 channelId2, guint8 rlcMode2, guint8 direction2,
- gboolean frameIsControl)
+/* Return true if the 2 sets of parameters refer to the same channel. */
+bool compare_rlc_headers(uint8_t rat1, uint8_t rat2,
+ uint16_t ueid1, uint16_t channelType1, uint16_t channelId1, uint8_t rlcMode1, uint8_t direction1,
+ uint16_t ueid2, uint16_t channelType2, uint16_t channelId2, uint8_t rlcMode2, uint8_t direction2,
+ bool frameIsControl)
{
+ if (rat1 != rat2) {
+ return false;
+ }
+
/* Same direction, data - OK. */
if (!frameIsControl) {
return (direction1 == direction2) &&
@@ -44,7 +49,7 @@ gboolean compare_rlc_headers(guint16 ueid1, guint16 channelType1, guint16 channe
(channelId1 == channelId2));
}
else {
- return FALSE;
+ return false;
}
}
}
@@ -55,18 +60,19 @@ static tap_packet_status
tap_lte_rlc_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags _U_)
{
int n;
- gboolean is_unique = TRUE;
+ bool is_unique = true;
th_t *th = (th_t *)pct;
- const rlc_lte_tap_info *header = (const rlc_lte_tap_info*)vip;
+ const rlc_3gpp_tap_info *header = (const rlc_3gpp_tap_info*)vip;
/* Check new header details against any/all stored ones */
for (n=0; n < th->num_hdrs; n++) {
- rlc_lte_tap_info *stored = th->rlchdrs[n];
+ rlc_3gpp_tap_info *stored = th->rlchdrs[n];
- if (compare_rlc_headers(stored->ueid, stored->channelType, stored->channelId, stored->rlcMode, stored->direction,
+ if (compare_rlc_headers(stored->rat, header->rat,
+ stored->ueid, stored->channelType, stored->channelId, stored->rlcMode, stored->direction,
header->ueid, header->channelType, header->channelId, header->rlcMode, header->direction,
header->isControlPDU)) {
- is_unique = FALSE;
+ is_unique = false;
break;
}
}
@@ -76,7 +82,7 @@ tap_lte_rlc_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, c
/* Copy the tap struct in as next header */
/* Need to take a deep copy of the tap struct, it may not be valid
to read after this function returns? */
- th->rlchdrs[th->num_hdrs] = g_new(rlc_lte_tap_info,1);
+ th->rlchdrs[th->num_hdrs] = g_new(rlc_3gpp_tap_info,1);
*(th->rlchdrs[th->num_hdrs]) = *header;
/* Store in direction of data though... */
@@ -92,9 +98,9 @@ tap_lte_rlc_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, c
/* Return an array of tap_info structs that were found while dissecting the current frame
* in the packet list. Errors are passed back to the caller, as they will be reported differently
* depending upon which GUI toolkit is being used. */
-rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
- struct rlc_segment *hdrs,
- gchar **err_msg)
+rlc_3gpp_tap_info* select_rlc_lte_session(capture_file *cf,
+ struct rlc_segment *hdrs,
+ char **err_msg)
{
frame_data *fdata;
epan_dissect_t edt;
@@ -110,7 +116,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
}
/* No real filter yet */
- if (!dfilter_compile("rlc-lte", &sfcode, NULL)) {
+ if (!dfilter_compile("rlc-lte or rlc-nr", &sfcode, NULL)) {
return NULL;
}
@@ -123,7 +129,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
fdata = cf->current_frame;
/* Set tap listener that will populate th. */
- error_string = register_tap_listener("rlc-lte", &th, NULL, 0, NULL, tap_lte_rlc_packet, NULL, NULL);
+ error_string = register_tap_listener("rlc-3gpp", &th, NULL, 0, NULL, tap_lte_rlc_packet, NULL, NULL);
if (error_string){
fprintf(stderr, "wireshark: Couldn't register rlc_lte_graph tap: %s\n",
error_string->str);
@@ -132,7 +138,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
exit(1); /* XXX: fix this */
}
- epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
+ epan_dissect_init(&edt, cf->epan, true, false);
epan_dissect_prime_with_dfilter(&edt, sfcode);
epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
@@ -161,6 +167,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
hdrs->rel_secs = rel_ts.secs;
hdrs->rel_usecs = rel_ts.nsecs/1000;
+ hdrs->rat = th.rlchdrs[0]->rat;
hdrs->ueid = th.rlchdrs[0]->ueid;
hdrs->channelType = th.rlchdrs[0]->channelType;
hdrs->channelId = th.rlchdrs[0]->channelId;
@@ -176,10 +183,11 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
static tap_packet_status rlc_lte_tap_for_graph_data(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags _U_)
{
struct rlc_graph *graph = (struct rlc_graph *)pct;
- const rlc_lte_tap_info *rlchdr = (const rlc_lte_tap_info*)vip;
+ const rlc_3gpp_tap_info *rlchdr = (const rlc_3gpp_tap_info*)vip;
/* See if this one matches graph's channel */
- if (compare_rlc_headers(graph->ueid, graph->channelType, graph->channelId, graph->rlcMode, graph->direction,
+ if (compare_rlc_headers(graph->rat, rlchdr->rat,
+ graph->ueid, graph->channelType, graph->channelId, graph->rlcMode, graph->direction,
rlchdr->ueid, rlchdr->channelType, rlchdr->channelId, rlchdr->rlcMode, rlchdr->direction,
rlchdr->isControlPDU)) {
@@ -187,29 +195,38 @@ static tap_packet_status rlc_lte_tap_for_graph_data(void *pct, packet_info *pinf
struct rlc_segment *segment = g_new(struct rlc_segment, 1);
segment->next = NULL;
segment->num = pinfo->num;
- segment->rel_secs = (guint32) pinfo->rel_ts.secs;
+ segment->rel_secs = (uint32_t) pinfo->rel_ts.secs;
segment->rel_usecs = pinfo->rel_ts.nsecs/1000;
+ segment->rat = rlchdr->rat;
segment->ueid = rlchdr->ueid;
segment->channelType = rlchdr->channelType;
segment->channelId = rlchdr->channelId;
segment->direction = rlchdr->direction;
segment->rlcMode = rlchdr->rlcMode;
+ segment->sequenceNumberLength = rlchdr->sequenceNumberLength;
segment->isControlPDU = rlchdr->isControlPDU;
if (!rlchdr->isControlPDU) {
- /* Data */
- segment->SN = rlchdr->sequenceNumber;
- segment->isResegmented = rlchdr->isResegmented;
- segment->pduLength = rlchdr->pduLength;
+ if (rlchdr->sequenceNumberGiven) {
+ /* Data */
+ segment->SN = rlchdr->sequenceNumber;
+ segment->isResegmented = rlchdr->isResegmented;
+ segment->pduLength = rlchdr->pduLength;
+ }
+ else {
+ /* No sequence number, so not going to show at all */
+ g_free(segment);
+ return TAP_PACKET_DONT_REDRAW; /* i.e. no immediate redraw requested */
+ }
}
else {
/* Status PDU */
- gint n;
+ int n;
segment->ACKNo = rlchdr->ACKNo;
segment->noOfNACKs = rlchdr->noOfNACKs;
- for (n=0; n < rlchdr->noOfNACKs; n++) {
+ for (n=0; (n < rlchdr->noOfNACKs) && (n < MAX_NACKs); n++) {
segment->NACKs[n] = rlchdr->NACKs[n];
}
}
@@ -232,7 +249,7 @@ static tap_packet_status rlc_lte_tap_for_graph_data(void *pct, packet_info *pinf
/* If don't have a channel, try to get one from current frame, then read all frames looking for data
* for that channel. */
-gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gboolean stream_known,
+bool rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, bool stream_known,
char **err_string)
{
struct rlc_segment current;
@@ -240,16 +257,18 @@ gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gbool
if (!cf || !g) {
/* Really shouldn't happen */
- return FALSE;
+ return false;
}
if (!stream_known) {
- struct rlc_lte_tap_info *header = select_rlc_lte_session(cf, &current, err_string);
+ struct rlc_3gpp_tap_info *header = select_rlc_lte_session(cf, &current, err_string);
if (!header) {
/* Didn't have a channel, and current frame didn't provide one */
- return FALSE;
+ return false;
}
- g->channelSet = TRUE;
+ g->channelSet = true;
+
+ g->rat = header->rat;
g->ueid = header->ueid;
g->channelType = header->channelType;
g->channelId = header->channelId;
@@ -259,12 +278,15 @@ gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gbool
/* Rescan all the packets and pick up all interesting RLC headers.
- * We only filter for rlc-lte here for speed and do the actual compare
+ * We only filter for RLC frames here for speed and do the actual compare
* in the tap listener
*/
g->last_segment = NULL;
- error_string = register_tap_listener("rlc-lte", g, "rlc-lte", 0, NULL, rlc_lte_tap_for_graph_data, NULL, NULL);
+ error_string = register_tap_listener("rlc-3gpp", // tap name
+ g,
+ "rlc-lte or rlc-nr", // filter name
+ 0, NULL, rlc_lte_tap_for_graph_data, NULL, NULL);
if (error_string) {
fprintf(stderr, "wireshark: Couldn't register rlc_graph tap: %s\n",
error_string->str);
@@ -276,10 +298,10 @@ gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gbool
if (g->last_segment == NULL) {
*err_string = g_strdup("No packets found");
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/* Free and zero the segments list of an rlc_graph struct */
diff --git a/ui/tap-rlc-graph.h b/ui/tap-rlc-graph.h
index 5f5b4c16..45a77eb4 100644
--- a/ui/tap-rlc-graph.h
+++ b/ui/tap-rlc-graph.h
@@ -16,6 +16,7 @@
#include <epan/packet.h>
#include <cfile.h>
#include <epan/dissectors/packet-rlc-lte.h>
+#include <epan/dissectors/packet-rlc-3gpp-common.h>
#ifdef __cplusplus
extern "C" {
@@ -23,24 +24,25 @@ extern "C" {
struct rlc_segment {
struct rlc_segment *next;
- guint32 num; /* framenum */
+ uint32_t num; /* framenum */
time_t rel_secs;
- guint32 rel_usecs;
-
- gboolean isControlPDU;
- guint16 SN;
- guint16 isResegmented;
- guint16 ACKNo;
- #define MAX_NACKs 128
- guint16 noOfNACKs;
- guint16 NACKs[MAX_NACKs];
- guint16 pduLength;
-
- guint16 ueid;
- guint16 channelType;
- guint16 channelId;
- guint8 rlcMode;
- guint8 direction;
+ uint32_t rel_usecs;
+
+ bool isControlPDU;
+ uint32_t SN;
+ uint16_t isResegmented;
+ uint32_t ACKNo;
+ uint16_t noOfNACKs;
+ uint32_t NACKs[MAX_NACKs];
+ uint16_t pduLength;
+
+ uint8_t rat;
+ uint16_t ueid;
+ uint16_t channelType;
+ uint16_t channelId;
+ uint8_t rlcMode;
+ uint8_t direction;
+ uint16_t sequenceNumberLength;
};
/* A collection of channels that may be found in one frame. Used when working out
@@ -48,7 +50,7 @@ struct rlc_segment {
typedef struct _th_t {
int num_hdrs;
#define MAX_SUPPORTED_CHANNELS 8
- rlc_lte_tap_info *rlchdrs[MAX_SUPPORTED_CHANNELS];
+ rlc_3gpp_tap_info *rlchdrs[MAX_SUPPORTED_CHANNELS];
} th_t;
struct rlc_graph {
@@ -57,25 +59,28 @@ struct rlc_graph {
struct rlc_segment *last_segment;
/* These are filled in with the channel/direction this graph is showing */
- gboolean channelSet;
- guint16 ueid;
- guint16 channelType;
- guint16 channelId;
- guint8 rlcMode;
- guint8 direction;
+ bool channelSet;
+
+ uint8_t rat;
+ uint16_t ueid;
+ uint16_t channelType;
+ uint16_t channelId;
+ uint8_t rlcMode;
+ uint8_t direction;
};
-gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *tg, gboolean stream_known,
+bool rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *tg, bool stream_known,
char **err_string);
void rlc_graph_segment_list_free(struct rlc_graph * );
-gboolean compare_rlc_headers(guint16 ueid1, guint16 channelType1, guint16 channelId1, guint8 rlcMode1, guint8 direction1,
- guint16 ueid2, guint16 channelType2, guint16 channelId2, guint8 rlcMode2, guint8 direction2,
- gboolean isControlFrame);
-rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, struct rlc_segment *hdrs,
- gchar **err_msg);
+bool compare_rlc_headers(uint8_t rat1, uint8_t rat2,
+ uint16_t ueid1, uint16_t channelType1, uint16_t channelId1, uint8_t rlcMode1, uint8_t direction1,
+ uint16_t ueid2, uint16_t channelType2, uint16_t channelId2, uint8_t rlcMode2, uint8_t direction2,
+ bool isControlFrame);
+rlc_3gpp_tap_info *select_rlc_lte_session(capture_file *cf, struct rlc_segment *hdrs,
+ char **err_msg);
#ifdef __cplusplus
diff --git a/ui/tap-rtp-analysis.c b/ui/tap-rtp-analysis.c
index 92c5a796..177164fc 100644
--- a/ui/tap-rtp-analysis.c
+++ b/ui/tap-rtp-analysis.c
@@ -32,8 +32,8 @@
#include "tap-rtp-analysis.h"
typedef struct _key_value {
- guint32 key;
- guint32 value;
+ uint32_t key;
+ uint32_t value;
} key_value;
@@ -70,10 +70,10 @@ static const key_value clock_map[] = {
{PT_H263, 90000},
};
-#define NUM_CLOCK_VALUES (sizeof clock_map / sizeof clock_map[0])
+#define NUM_CLOCK_VALUES array_length(clock_map)
-static guint32
-get_clock_rate(guint32 key)
+static uint32_t
+get_clock_rate(uint32_t key)
{
size_t i;
@@ -85,8 +85,8 @@ get_clock_rate(guint32 key)
}
typedef struct _mimetype_and_clock {
- const gchar *pt_mime_name_str;
- guint32 value;
+ const char *pt_mime_name_str;
+ uint32_t value;
} mimetype_and_clock;
/* RTP sampling clock rates for
"In addition to the RTP payload formats (encodings) listed in the RTP
@@ -139,10 +139,10 @@ static const mimetype_and_clock mimetype_and_clock_map[] = {
{"telephone-event", 8000}, /* [RFC4733] */
};
-#define NUM_DYN_CLOCK_VALUES (sizeof mimetype_and_clock_map / sizeof mimetype_and_clock_map[0])
+#define NUM_DYN_CLOCK_VALUES array_length(mimetype_and_clock_map)
-static guint32
-get_dyn_pt_clock_rate(const gchar *payload_type_str)
+static uint32_t
+get_dyn_pt_clock_rate(const char *payload_type_str)
{
int i;
@@ -156,7 +156,7 @@ get_dyn_pt_clock_rate(const gchar *payload_type_str)
return 0;
}
-#define TIMESTAMP_DIFFERENCE(v1,v2) ((gint64)v2-(gint64)v1)
+#define TIMESTAMP_DIFFERENCE(v1,v2) ((int64_t)v2-(int64_t)v1)
/****************************************************************************/
void
@@ -172,21 +172,20 @@ rtppacket_analyse(tap_rtp_stat_t *statinfo,
double arrivaltime;
double expected_time;
double absskew;
- guint32 clock_rate;
- gboolean in_time_sequence;
+ uint32_t clock_rate;
+ bool in_time_sequence;
/* Store the current time */
current_time = nstime_to_msec(&pinfo->rel_ts);
/* Is this the first packet we got in this direction? */
if (statinfo->first_packet) {
- statinfo->start_seq_nr = rtpinfo->info_seq_num;
- statinfo->stop_seq_nr = rtpinfo->info_seq_num;
+ statinfo->start_seq_nr = rtpinfo->info_extended_seq_num;
+ statinfo->stop_seq_nr = rtpinfo->info_extended_seq_num;
statinfo->seq_num = rtpinfo->info_seq_num;
statinfo->start_time = current_time;
- statinfo->timestamp = rtpinfo->info_timestamp;
- statinfo->seq_timestamp = rtpinfo->info_timestamp;
- statinfo->first_timestamp = rtpinfo->info_timestamp;
+ statinfo->timestamp = rtpinfo->info_extended_timestamp;
+ statinfo->seq_timestamp = rtpinfo->info_extended_timestamp;
statinfo->time = current_time;
statinfo->lastnominaltime = 0;
statinfo->lastarrivaltime = 0;
@@ -221,74 +220,47 @@ rtppacket_analyse(tap_rtp_stat_t *statinfo,
statinfo->flags |= STAT_FLAG_MARKER;
}
statinfo->first_packet_num = pinfo->num;
- statinfo->first_packet = FALSE;
+ statinfo->first_packet = false;
return;
}
/* Reset flags */
statinfo->flags = 0;
- /* When calculating expected rtp packets the seq number can wrap around
- * so we have to count the number of cycles
- * Variable seq_cycles counts the wraps around in forwarding connection and
- * under is flag that indicates where we are
+ /* When calculating expected rtp packets the seq number can wrap around.
+ * The RTP dissector does an extended sequence number calculation and
+ * passes it here so we use that for the number of cycles.
*
* XXX How to determine number of cycles with all possible lost, late
- * and duplicated packets without any doubt? It seems to me, that
+ * and duplicated packets without any doubt? It seems to me that
* because of all possible combination of late, duplicated or lost
- * packets, this can only be more or less good approximation
+ * packets this can only be more or less a good approximation.
+ * The RTP dissector doesn't do exactly the algorithm in RFC 3550 A.1
+ * but could be modified.
*
* There are some combinations (rare but theoretically possible),
- * where below code won't work correctly - statistic may be wrong then.
+ * where it won't work correctly - statistic may be wrong then.
*/
- /* Check if time sequence of packets is in order. We check whether
- * timestamp difference is below 1/2 of timestamp range (hours or days).
- * Packets can be in pure sequence or sequence can be wrapped around
- * 0xFFFFFFFF.
+ /* Check if time sequence of packets is in order. Use the extended
+ * timestamp that the RTP dissector has already calculated.
*/
- if ((statinfo->first_timestamp <= rtpinfo->info_timestamp) &&
- TIMESTAMP_DIFFERENCE(statinfo->first_timestamp, rtpinfo->info_timestamp) < 0x80000000) {
+ if (statinfo->seq_timestamp <= rtpinfo->info_extended_timestamp) {
// Normal timestamp sequence
- in_time_sequence = TRUE;
- } else if ((statinfo->first_timestamp > rtpinfo->info_timestamp) &&
- (TIMESTAMP_DIFFERENCE(statinfo->first_timestamp, 0xFFFFFFFF) + TIMESTAMP_DIFFERENCE(0x00000000, rtpinfo->info_timestamp)) < 0x80000000) {
- // Normal timestamp sequence with wraparound
- in_time_sequence = TRUE;
+ in_time_sequence = true;
} else {
// New packet is not in sequence (is in past)
- in_time_sequence = FALSE;
+ in_time_sequence = false;
statinfo->flags |= STAT_FLAG_WRONG_TIMESTAMP;
}
- /* So if the current sequence number is less than the start one
- * we assume, that there is another cycle running
- */
- if ((rtpinfo->info_seq_num < statinfo->start_seq_nr) &&
- in_time_sequence &&
- (statinfo->under == FALSE)) {
- statinfo->seq_cycles++;
- statinfo->under = TRUE;
- }
- /* what if the start seq nr was 0? Then the above condition will never
- * be true, so we add another condition. XXX The problem would arise
- * if one of the packets with seq nr 0 or 65535 would be lost or late
- */
- else if ((rtpinfo->info_seq_num == 0) && (statinfo->stop_seq_nr == 65535) &&
- in_time_sequence &&
- (statinfo->under == FALSE)) {
- statinfo->seq_cycles++;
- statinfo->under = TRUE;
- }
- /* the whole round is over, so reset the flag */
- else if ((rtpinfo->info_seq_num > statinfo->start_seq_nr) &&
- in_time_sequence &&
- (statinfo->under != FALSE)) {
- statinfo->under = FALSE;
- }
-
/* Since it is difficult to count lost, duplicate or late packets separately,
* we would like to know at least how many times the sequence number was not ok
+ *
+ * RFC 3550 Appendix A.1 recommends storing the bad sequence number after
+ * a jump so we can see if we get consecutive in-order sequence numbers
+ * that indicate the other side restarted, see #10665. Handling that would
+ * require additional changes in the number of packets expected.
*/
/* If the current seq number equals the last one or if we are here for
@@ -369,12 +341,12 @@ rtppacket_analyse(tap_rtp_stat_t *statinfo,
* XXX: Do we really need to exclude those? The underlying problem in
* #16330 was not allowing the time difference to be negative.
*/
- if ( in_time_sequence || TRUE ) {
+ if ( in_time_sequence || true ) {
/* XXX: We try to handle clock rate changes, but if the clock rate
* changed during a dropped packet (or if we go backwards because
- * a packet is reorderd), it won't be quite right.
+ * a packet is reordered), it won't be quite right.
*/
- nominaltime_diff = (double)(TIMESTAMP_DIFFERENCE(statinfo->seq_timestamp, rtpinfo->info_timestamp));
+ nominaltime_diff = (double)(TIMESTAMP_DIFFERENCE(statinfo->seq_timestamp, rtpinfo->info_extended_timestamp));
/* Can only analyze defined sampling rates */
if (clock_rate != 0) {
@@ -517,6 +489,9 @@ rtppacket_analyse(tap_rtp_stat_t *statinfo,
}
}
/* Regular payload change? (CN ignored) */
+ /* XXX - We should ignore FEC payload type too, but that's determined
+ * out of band (e.g., SDP), see RFCs 5109, 8627, Issue #15403.
+ */
if (!(statinfo->flags & STAT_FLAG_FIRST)
&& !(statinfo->flags & STAT_FLAG_PT_CN)) {
if ((statinfo->pt != statinfo->reg_pt)
@@ -535,10 +510,15 @@ rtppacket_analyse(tap_rtp_stat_t *statinfo,
* therefore diff calculations are correct for it
*/
statinfo->time = current_time;
- statinfo->seq_timestamp = rtpinfo->info_timestamp;
+ statinfo->seq_timestamp = rtpinfo->info_extended_timestamp;
}
- statinfo->timestamp = rtpinfo->info_timestamp;
- statinfo->stop_seq_nr = rtpinfo->info_seq_num;
+ statinfo->timestamp = rtpinfo->info_extended_timestamp;
+ /* RFC 3550 Appendices A.1, A.3 say that we do *not* change base_seq,
+ * AKA start_seq_nr, when receiving a reordered packet later that has
+ * an earlier sequence number, but it's probably less surprising to do so.
+ */
+ statinfo->start_seq_nr = MIN(statinfo->start_seq_nr, rtpinfo->info_extended_seq_num);
+ statinfo->stop_seq_nr = MAX(statinfo->stop_seq_nr, rtpinfo->info_extended_seq_num);
statinfo->total_nr++;
statinfo->last_payload_len = rtpinfo->info_payload_len;
diff --git a/ui/tap-rtp-analysis.h b/ui/tap-rtp-analysis.h
index 0ad6d9bc..057eedac 100644
--- a/ui/tap-rtp-analysis.h
+++ b/ui/tap-rtp-analysis.h
@@ -35,28 +35,27 @@ extern "C" {
/* structure that holds the information about the forward and reversed direction */
typedef struct _bw_history_item {
double time;
- guint32 bytes;
+ uint32_t bytes;
} bw_history_item;
#define BUFF_BW 300
typedef struct _tap_rtp_stat_t {
- gboolean first_packet; /**< do not use in code that is called after rtppacket_analyse */
+ bool first_packet; /**< do not use in code that is called after rtppacket_analyse */
/* use (flags & STAT_FLAG_FIRST) instead */
/* all of the following fields will be initialized after
* rtppacket_analyse has been called
*/
- guint32 flags; /* see STAT_FLAG-defines below */
- guint16 seq_num;
- guint32 timestamp;
- guint32 seq_timestamp;
- guint32 first_timestamp;
+ uint32_t flags; /* see STAT_FLAG-defines below */
+ uint16_t seq_num;
+ uint64_t timestamp; /* The generated "extended" timestamp */
+ uint64_t seq_timestamp; /* The last in-sequence extended timestamp */
double bandwidth;
bw_history_item bw_history[BUFF_BW];
- guint16 bw_start_index;
- guint16 bw_index;
- guint32 total_bytes;
- guint32 clock_rate;
+ uint16_t bw_start_index;
+ uint16_t bw_index;
+ uint32_t total_bytes;
+ uint32_t clock_rate;
double delta;
double jitter;
double diff;
@@ -76,21 +75,19 @@ typedef struct _tap_rtp_stat_t {
double max_jitter;
double max_skew;
double mean_jitter;
- guint32 max_nr;
- guint16 start_seq_nr;
- guint16 stop_seq_nr;
- guint32 total_nr;
- guint32 sequence;
- gboolean under;
- gint seq_cycles;
- guint16 pt;
+ uint32_t max_nr; /**< The frame number of the last packet by timestamp */
+ uint32_t start_seq_nr; /**< (extended) base_seq per RFC 3550 A.1 */
+ uint32_t stop_seq_nr; /**< (extended) max_seq per RFC 3550 A.1 */
+ uint32_t total_nr; /**< total number of received packets */
+ uint32_t sequence; /**< total number of sequence errors */
+ uint16_t pt;
int reg_pt;
- guint32 first_packet_num;
- guint last_payload_len;
+ uint32_t first_packet_num;
+ unsigned last_payload_len;
} tap_rtp_stat_t;
typedef struct _tap_rtp_save_data_t {
- guint32 timestamp;
+ uint32_t timestamp;
unsigned int payload_type;
size_t payload_len;
} tap_rtp_save_data_t;
diff --git a/ui/tap-rtp-common.c b/ui/tap-rtp-common.c
index b2c39290..ef2d1464 100644
--- a/ui/tap-rtp-common.c
+++ b/ui/tap-rtp-common.c
@@ -32,7 +32,7 @@
#include "tap-rtp-common.h"
/* XXX: are changes needed to properly handle situations where
- info_all_data_present == FALSE ?
+ info_all_data_present == false ?
E.G., when captured frames are truncated.
*/
@@ -40,8 +40,8 @@
/* Type for storing and writing rtpdump information */
typedef struct st_rtpdump_info {
double rec_time; /**< milliseconds since start of recording */
- guint16 num_samples; /**< number of bytes in *frame */
- const guint8 *samples; /**< data bytes */
+ uint16_t num_samples; /**< number of bytes in *frame */
+ const uint8_t *samples; /**< data bytes */
} rtpdump_info_t;
/****************************************************************************/
@@ -107,7 +107,7 @@ void rtpstream_info_free_all(rtpstream_info_t *info)
/****************************************************************************/
/* GCompareFunc style comparison function for rtpstream_info_t */
-gint rtpstream_info_cmp(gconstpointer aa, gconstpointer bb)
+int rtpstream_info_cmp(const void *aa, const void *bb)
{
const rtpstream_info_t *a = (const rtpstream_info_t *)aa;
const rtpstream_info_t *b = (const rtpstream_info_t *)bb;
@@ -124,18 +124,18 @@ gint rtpstream_info_cmp(gconstpointer aa, gconstpointer bb)
/****************************************************************************/
/* compare the endpoints of two RTP streams */
-gboolean rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b)
+bool rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b)
{
if (stream_a == NULL || stream_b == NULL)
- return FALSE;
+ return false;
if ((addresses_equal(&(stream_a->id.src_addr), &(stream_b->id.dst_addr)))
&& (stream_a->id.src_port == stream_b->id.dst_port)
&& (addresses_equal(&(stream_a->id.dst_addr), &(stream_b->id.src_addr)))
&& (stream_a->id.dst_port == stream_b->id.src_port))
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
/****************************************************************************/
@@ -206,7 +206,7 @@ remove_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo)
{
if (tapinfo && tapinfo->is_registered) {
remove_tap_listener(tapinfo);
- tapinfo->is_registered = FALSE;
+ tapinfo->is_registered = false;
}
}
@@ -233,7 +233,7 @@ register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstrin
exit(1);
}
- tapinfo->is_registered = TRUE;
+ tapinfo->is_registered = true;
}
}
@@ -253,12 +253,12 @@ register_tap_listener_rtpstream(rtpstream_tapinfo_t *tapinfo, const char *fstrin
* the RTP/RTCP header and (optionally) the actual payload.
*/
-static const gchar *PAYLOAD_UNKNOWN_STR = "Unknown";
+static const char *PAYLOAD_UNKNOWN_STR = "Unknown";
static void update_payload_names(rtpstream_info_t *stream_info, const struct _rtp_info *rtpinfo)
{
GString *payload_type_names;
- const gchar *new_payload_type_str;
+ const char *new_payload_type_str;
/* Ensure that we have non empty payload_type_str */
if (rtpinfo->info_payload_type_str != NULL) {
@@ -290,7 +290,7 @@ static void update_payload_names(rtpstream_info_t *stream_info, const struct _rt
g_string_free(payload_type_names, FALSE);
}
-gboolean rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const guint8 payload_type)
+bool rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const uint8_t payload_type)
{
return stream_info->payload_type_names[payload_type] != NULL;
}
@@ -304,12 +304,12 @@ gboolean rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const gu
*/
void rtp_write_header(rtpstream_info_t *strinfo, FILE *file)
{
- guint32 start_sec; /* start of recording (GMT) (seconds) */
- guint32 start_usec; /* start of recording (GMT) (microseconds)*/
- guint32 source; /* network source (multicast address) */
+ uint32_t start_sec; /* start of recording (GMT) (seconds) */
+ uint32_t start_usec; /* start of recording (GMT) (microseconds)*/
+ uint32_t source; /* network source (multicast address) */
size_t sourcelen;
- guint16 port; /* UDP port */
- guint16 padding; /* 2 padding bytes */
+ uint16_t port; /* UDP port */
+ uint16_t padding; /* 2 padding bytes */
char* addr_str = address_to_display(NULL, &(strinfo->id.dst_addr));
fprintf(file, "#!rtpplay%s %s/%u\n", RTPFILE_VERSION,
@@ -319,7 +319,7 @@ void rtp_write_header(rtpstream_info_t *strinfo, FILE *file)
start_sec = g_htonl(strinfo->start_fd->abs_ts.secs);
start_usec = g_htonl(strinfo->start_fd->abs_ts.nsecs / 1000);
- /* rtpdump only accepts guint32 as source, will be fake for IPv6 */
+ /* rtpdump only accepts uint32_t as source, will be fake for IPv6 */
memset(&source, 0, sizeof source);
sourcelen = strinfo->id.src_addr.len;
if (sourcelen > sizeof source)
@@ -343,10 +343,10 @@ void rtp_write_header(rtpstream_info_t *strinfo, FILE *file)
/* utility function for writing a sample to file in rtpdump -F dump format (.rtp)*/
static void rtp_write_sample(rtpdump_info_t* rtpdump_info, FILE* file)
{
- guint16 length; /* length of packet, including this header (may
+ uint16_t length; /* length of packet, including this header (may
be smaller than plen if not whole packet recorded) */
- guint16 plen; /* actual header+payload length for RTP, 0 for RTCP */
- guint32 offset; /* milliseconds since the start of recording */
+ uint16_t plen; /* actual header+payload length for RTP, 0 for RTCP */
+ uint32_t offset; /* milliseconds since the start of recording */
length = g_htons(rtpdump_info->num_samples + 8);
plen = g_htons(rtpdump_info->num_samples);
@@ -375,7 +375,7 @@ tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissec
/* gather infos on the stream this packet is part of.
* Shallow copy addresses as this is just for examination. */
- rtpstream_id_copy_pinfo_shallow(pinfo,&new_stream_id,FALSE);
+ rtpstream_id_copy_pinfo_shallow(pinfo,&new_stream_id,false);
new_stream_id.ssrc = rtpinfo->info_sync_src;
if (tapinfo->mode == TAP_ANALYSE) {
@@ -394,7 +394,7 @@ tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissec
/* init info and collect id */
stream_info = rtpstream_info_malloc_and_init();
/* Deep copy addresses for the new entry. */
- rtpstream_id_copy_pinfo(pinfo,&(stream_info->id),FALSE);
+ rtpstream_id_copy_pinfo(pinfo,&(stream_info->id),false);
stream_info->id.ssrc = rtpinfo->info_sync_src;
/* init counters for first packet */
@@ -419,7 +419,7 @@ tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissec
else if (tapinfo->mode == TAP_SAVE) {
if (rtpstream_id_equal(&new_stream_id, &(tapinfo->filter_stream_fwd->id), RTPSTREAM_ID_EQUAL_SSRC)) {
/* XXX - what if rtpinfo->info_all_data_present is
- FALSE, so that we don't *have* all the data? */
+ false, so that we don't *have* all the data? */
rtpdump_info.rec_time = nstime_to_msec(&pinfo->abs_ts) -
nstime_to_msec(&tapinfo->filter_stream_fwd->start_fd->abs_ts);
rtpdump_info.num_samples = rtpinfo->info_data_len;
@@ -449,7 +449,7 @@ void rtpstream_info_calculate(const rtpstream_info_t *strinfo, rtpstream_info_ca
double sumt2;
double sumtTS;
double clock_drift_x;
- guint32 clock_rate_x;
+ uint32_t clock_rate_x;
double duration_x;
calc->src_addr_str = address_to_display(NULL, &(strinfo->id.src_addr));
@@ -462,8 +462,7 @@ void rtpstream_info_calculate(const rtpstream_info_t *strinfo, rtpstream_info_ca
calc->packet_count = strinfo->packet_count;
/* packet count, lost packets */
- calc->packet_expected = (strinfo->rtp_stats.stop_seq_nr + strinfo->rtp_stats.seq_cycles*0x10000)
- - strinfo->rtp_stats.start_seq_nr + 1;
+ calc->packet_expected = strinfo->rtp_stats.stop_seq_nr - strinfo->rtp_stats.start_seq_nr + 1;
calc->total_nr = strinfo->rtp_stats.total_nr;
calc->lost_num = calc->packet_expected - strinfo->rtp_stats.total_nr;
if (calc->packet_expected) {
@@ -489,7 +488,7 @@ void rtpstream_info_calculate(const rtpstream_info_t *strinfo, rtpstream_info_ca
if ((calc->packet_count >0) && (sumt2 > 0)) {
clock_drift_x = (calc->packet_count * sumtTS - sumt * sumTS) / (calc->packet_count * sumt2 - sumt * sumt);
calc->clock_drift_ms = duration_x * (clock_drift_x - 1.0);
- clock_rate_x = (guint32)(strinfo->rtp_stats.clock_rate * clock_drift_x);
+ clock_rate_x = (uint32_t)(strinfo->rtp_stats.clock_rate * clock_drift_x);
calc->freq_drift_hz = clock_drift_x * clock_rate_x;
calc->freq_drift_perc = 100.0 * (clock_drift_x - 1.0);
} else {
@@ -527,7 +526,7 @@ void rtpstream_info_analyse_init(rtpstream_info_t *stream_info, const packet_inf
stream_info->start_abs_time = pinfo->abs_ts;
/* reset RTP stats */
- stream_info->rtp_stats.first_packet = TRUE;
+ stream_info->rtp_stats.first_packet = true;
stream_info->rtp_stats.reg_pt = PT_UNDEFINED;
/* Get the Setup frame number who set this RTP stream */
@@ -550,7 +549,7 @@ void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_
if (stream_info->rtp_stats.flags & STAT_FLAG_WRONG_TIMESTAMP
|| stream_info->rtp_stats.flags & STAT_FLAG_WRONG_SEQ)
- stream_info->problem = TRUE;
+ stream_info->problem = true;
/* increment the packets counter for this stream */
++(stream_info->packet_count);
@@ -559,7 +558,7 @@ void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_
/****************************************************************************/
/* Get hash for rtpstream_info_t */
-guint rtpstream_to_hash(gconstpointer key)
+unsigned rtpstream_to_hash(const void *key)
{
if (key) {
return rtpstream_id_to_hash(&((rtpstream_info_t *)key)->id);
@@ -574,14 +573,14 @@ guint rtpstream_to_hash(gconstpointer key)
void rtpstream_info_multihash_insert(GHashTable *multihash, rtpstream_info_t *new_stream_info)
{
GList *hlist = (GList *)g_hash_table_lookup(multihash, GINT_TO_POINTER(rtpstream_to_hash(new_stream_info)));
- gboolean found = FALSE;
+ bool found = false;
if (hlist) {
// Key exists in hash
GList *list = g_list_first(hlist);
while (list)
{
if (rtpstream_id_equal(&(new_stream_info->id), &((rtpstream_info_t *)(list->data))->id, RTPSTREAM_ID_EQUAL_SSRC)) {
- found = TRUE;
+ found = true;
break;
}
list = g_list_next(list);
@@ -622,7 +621,7 @@ rtpstream_info_t *rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstre
/****************************************************************************/
/* Destroys GList used in multihash */
-void rtpstream_info_multihash_destroy_value(gpointer key _U_, gpointer value, gpointer user_data _U_)
+void rtpstream_info_multihash_destroy_value(void *key _U_, void *value, void *user_data _U_)
{
g_list_free((GList *)value);
}
diff --git a/ui/tap-rtp-common.h b/ui/tap-rtp-common.h
index 65c9d38e..ddd8d919 100644
--- a/ui/tap-rtp-common.h
+++ b/ui/tap-rtp-common.h
@@ -39,22 +39,22 @@ typedef enum {
typedef struct _tap_rtp_save_info_t {
FILE *fp;
- guint32 count;
+ uint32_t count;
tap_rtp_error_type_t error_type;
- gboolean saved;
+ bool saved;
} tap_rtp_save_info_t;
typedef struct _rtpstream_info_calc {
- gchar *src_addr_str;
- guint16 src_port;
- gchar *dst_addr_str;
- guint16 dst_port;
- guint32 ssrc;
- gchar *all_payload_type_names; /* Name of codec derived from fixed or dynamic codec names */
- guint32 packet_count;
- guint32 total_nr;
- guint32 packet_expected; /* Count of expected packets, derived from length of RTP stream */
- gint32 lost_num;
+ char *src_addr_str;
+ uint16_t src_port;
+ char *dst_addr_str;
+ uint16_t dst_port;
+ uint32_t ssrc;
+ char *all_payload_type_names; /* Name of codec derived from fixed or dynamic codec names */
+ uint32_t packet_count;
+ uint32_t total_nr;
+ uint32_t packet_expected; /* Count of expected packets, derived from length of RTP stream */
+ int32_t lost_num;
double lost_perc;
double max_delta;
double min_delta;
@@ -63,15 +63,15 @@ typedef struct _rtpstream_info_calc {
double max_jitter;
double max_skew;
double mean_jitter;
- gboolean problem; /* Indication that RTP stream contains something unusual -GUI should indicate it somehow */
+ bool problem; /* Indication that RTP stream contains something unusual -GUI should indicate it somehow */
double clock_drift_ms;
double freq_drift_hz;
double freq_drift_perc;
double duration_ms;
- guint32 sequence_err;
+ uint32_t sequence_err;
double start_time_ms; /**< Unit is ms */
- guint32 first_packet_num;
- guint32 last_packet_num;
+ uint32_t first_packet_num;
+ uint32_t last_packet_num;
} rtpstream_info_calc_t;
/**
@@ -89,21 +89,21 @@ void rtpstream_info_free_all(rtpstream_info_t* info);
*
* @return -1,0,1
*/
-gint rtpstream_info_cmp(gconstpointer aa, gconstpointer bb);
+int rtpstream_info_cmp(const void *aa, const void *bb);
/**
* Compares the endpoints of two RTP streams.
*
-* @return TRUE if the
+* @return true if the
*/
-gboolean rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b);
+bool rtpstream_info_is_reverse(const rtpstream_info_t *stream_a, rtpstream_info_t *stream_b);
/**
* Checks if payload_type is used in rtpstream.
*
- * @returns TRUE if is used
+ * @returns true if is used
*/
-gboolean rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const guint8 payload_type);
+bool rtpstream_is_payload_used(const rtpstream_info_t *stream_info, const uint8_t payload_type);
/****************************************************************************/
/* INTERFACE */
@@ -155,7 +155,7 @@ void rtpstream_info_analyse_process(rtpstream_info_t *stream_info, const packet_
/**
* Get hash key for rtpstream_info_t
*/
-guint rtpstream_to_hash(gconstpointer key);
+unsigned rtpstream_to_hash(const void *key);
/**
* Insert new_stream_info into multihash
@@ -170,7 +170,7 @@ rtpstream_info_t *rtpstream_info_multihash_lookup(GHashTable *multihash, rtpstre
/**
* GHFunc () for destroying GList in multihash
*/
-void rtpstream_info_multihash_destroy_value(gpointer key, gpointer value, gpointer user_data);
+void rtpstream_info_multihash_destroy_value(void *key, void *value, void *user_data);
#ifdef __cplusplus
}
diff --git a/ui/tap-sctp-analysis.c b/ui/tap-sctp-analysis.c
index 9a4427a4..a4077bef 100644
--- a/ui/tap-sctp-analysis.c
+++ b/ui/tap-sctp-analysis.c
@@ -35,16 +35,16 @@
#define ADDRESS_BACKWARD_ADD_BACKWARD_VTAG 9
#define ASSOC_NOT_FOUND 10
-static sctp_allassocs_info_t sctp_tapinfo_struct = {0, NULL, FALSE, NULL};
+static sctp_allassocs_info_t sctp_tapinfo_struct;
static void
-free_first(gpointer data, gpointer user_data _U_)
+free_first(void *data, void *user_data _U_)
{
g_free(data);
}
static void
-tsn_free(gpointer data)
+tsn_free(void *data)
{
tsn_t *tsn;
@@ -59,7 +59,7 @@ tsn_free(gpointer data)
}
static void
-chunk_free(gpointer data)
+chunk_free(void *data)
{
sctp_addr_chunk *chunk = (sctp_addr_chunk *) data;
@@ -68,7 +68,7 @@ chunk_free(gpointer data)
}
static void
-store_free(gpointer data)
+store_free(void *data)
{
address *addr = (address *) data;
@@ -137,16 +137,16 @@ reset(void *arg)
}
if (info->sort_tsn1 != NULL)
- g_ptr_array_free(info->sort_tsn1, TRUE);
+ g_ptr_array_free(info->sort_tsn1, true);
if (info->sort_tsn2 != NULL)
- g_ptr_array_free(info->sort_tsn2, TRUE);
+ g_ptr_array_free(info->sort_tsn2, true);
if (info->sort_sack1 != NULL)
- g_ptr_array_free(info->sort_sack1, TRUE);
+ g_ptr_array_free(info->sort_sack1, true);
if (info->sort_sack2 != NULL)
- g_ptr_array_free(info->sort_sack2, TRUE);
+ g_ptr_array_free(info->sort_sack2, true);
if (info->min_max != NULL)
{
@@ -175,7 +175,7 @@ reset(void *arg)
static sctp_assoc_info_t *
calc_checksum(const struct _sctp_info *check_data, sctp_assoc_info_t *data)
{
- gboolean ok = FALSE;
+ bool ok = false;
if (check_data->adler32_calculated)
{
@@ -196,7 +196,7 @@ calc_checksum(const struct _sctp_info *check_data, sctp_assoc_info_t *data)
char str[] = "ADLER32";
(void) g_strlcpy(data->checksum_type, str, 8);
data->n_checksum_errors=(data->n_adler32_calculated-data->n_adler32_correct);
- ok = TRUE;
+ ok = true;
}
}
@@ -207,7 +207,7 @@ calc_checksum(const struct _sctp_info *check_data, sctp_assoc_info_t *data)
char str[] = "CRC32C";
(void) g_strlcpy(data->checksum_type, str, 8);
data->n_checksum_errors=data->n_crc32c_calculated-data->n_crc32c_correct;
- ok = TRUE;
+ ok = true;
}
}
@@ -246,7 +246,7 @@ find_assoc(sctp_tmp_info_t *needle)
}
static sctp_assoc_info_t *
-add_chunk_count(address *vadd, sctp_assoc_info_t *info, guint32 direction, guint32 type)
+add_chunk_count(address *vadd, sctp_assoc_info_t *info, uint32_t direction, uint32_t type)
{
GList *list;
sctp_addr_chunk *ch=NULL;
@@ -291,7 +291,7 @@ add_chunk_count(address *vadd, sctp_assoc_info_t *info, guint32 direction, guint
}
static sctp_assoc_info_t *
-add_address(address *vadd, sctp_assoc_info_t *info, guint16 direction)
+add_address(address *vadd, sctp_assoc_info_t *info, uint16_t direction)
{
GList *list;
address *v=NULL;
@@ -324,23 +324,23 @@ static tap_packet_status
packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_)
{
const struct _sctp_info *sctp_info = (const struct _sctp_info *)data;
- guint32 chunk_number = 0, tsnumber, framenumber;
+ uint32_t chunk_number = 0, tsnumber, framenumber;
sctp_tmp_info_t tmp_info;
sctp_assoc_info_t *info = NULL;
sctp_error_info_t *error = NULL;
- guint16 type, length = 0;
+ uint16_t type, length = 0;
address *store = NULL;
tsn_t *tsn = NULL;
tsn_t *sack = NULL;
- guint8 *t_s_n = NULL;
- gboolean sackchunk = FALSE;
- gboolean datachunk = FALSE;
- gboolean forwardchunk = FALSE;
+ uint8_t *t_s_n = NULL;
+ bool sackchunk = false;
+ bool datachunk = false;
+ bool forwardchunk = false;
struct tsn_sort *tsn_s;
int i;
- guint8 idx = 0;
- gboolean tsn_used = FALSE;
- gboolean sack_used = FALSE;
+ uint8_t idx = 0;
+ bool tsn_used = false;
+ bool sack_used = false;
framenumber = pinfo->num;
@@ -372,7 +372,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
tmp_info.verification_tag2 = 0;
}
tmp_info.n_tvbs = 0;
- if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID)
+ if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID)
{
tmp_info.initiate_tag = tvb_get_ntohl(sctp_info->tvb[0], 4);
}
@@ -401,10 +401,10 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->verification_tag2 = tmp_info.verification_tag2;
info->initiate_tag = tmp_info.initiate_tag;
info->n_tvbs = tmp_info.n_tvbs;
- info->init = FALSE;
- info->initack = FALSE;
- info->check_address = FALSE;
- info->firstdata = TRUE;
+ info->init = false;
+ info->initack = false;
+ info->check_address = false;
+ info->firstdata = true;
info->direction = sctp_info->direction;
info->instream1 = 0;
info->outstream1 = 0;
@@ -456,13 +456,13 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
info->addr_chunk_count = NULL;
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
{
tsn = g_new0(tsn_t, 1);
copy_address(&tsn->src, &tmp_info.src);
@@ -471,14 +471,14 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
sack = g_new0(tsn_t, 1);
copy_address(&sack->src, &tmp_info.src);
copy_address(&sack->dst, &tmp_info.dst);
- sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs;
- sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000;
-
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
+ sack->secs=tsn->secs = (uint32_t)pinfo->rel_ts.secs;
+ sack->usecs=tsn->usecs = (uint32_t)pinfo->rel_ts.nsecs/1000;
+
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
{
if (tsn->secs < info->min_secs)
{
@@ -499,7 +499,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
sack->frame_number = tsn->frame_number = pinfo->num;
}
- if ((tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) || (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID))
+ if ((tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) || (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID))
{
info->min_tsn1 = tvb_get_ntohl(sctp_info->tvb[0],INIT_CHUNK_INITIAL_TSN_OFFSET);
info->verification_tag2 = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET);
@@ -523,17 +523,17 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
}
- if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID)
+ if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID)
{
- info->init = TRUE;
+ info->init = true;
}
else
{
info->initack_dir = 1;
- info->initack = TRUE;
+ info->initack = true;
}
- idx = tvb_get_guint8(sctp_info->tvb[0],0);
+ idx = tvb_get_uint8(sctp_info->tvb[0],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
@@ -541,22 +541,22 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->ep1_chunk_count[idx]++;
info = add_chunk_count(&tmp_info.src, info, 1, idx);
if (info->direction == 1) {
- if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
- info->dir1->init = TRUE;
+ if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
+ info->dir1->init = true;
info->dir1->init_min_tsn = info->min_tsn1;
info->dir1->init_vtag = info->verification_tag2;
- } else if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
- info->dir1->initack = TRUE;
+ } else if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
+ info->dir1->initack = true;
info->dir1->initack_min_tsn = info->min_tsn1;
info->dir1->initack_vtag = info->verification_tag2;
}
} else {
- if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
- info->dir2->init = TRUE;
+ if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
+ info->dir2->init = true;
info->dir2->init_min_tsn = info->min_tsn1;
info->dir2->init_vtag = info->verification_tag2;
- } else if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
- info->dir2->initack = TRUE;
+ } else if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
+ info->dir2->initack = true;
info->dir2->initack_min_tsn = info->min_tsn1;
info->dir2->initack_vtag = info->verification_tag2;
}
@@ -564,20 +564,20 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
else
{
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_I_DATA_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID))
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_INIT_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_I_DATA_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID))
{
tsn = g_new0(tsn_t, 1);
sack = g_new0(tsn_t, 1);
}
for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++)
{
- idx = tvb_get_guint8(sctp_info->tvb[0],0);
+ idx = tvb_get_uint8(sctp_info->tvb[0],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
@@ -585,11 +585,11 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->ep1_chunk_count[idx]++;
info = add_chunk_count(&tmp_info.src, info, 1, idx);
- if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) ||
- (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_I_DATA_CHUNK_ID))
+ if ((tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) ||
+ (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_I_DATA_CHUNK_ID))
{
- datachunk = TRUE;
- if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
+ datachunk = true;
+ if (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - DATA_CHUNK_HEADER_LENGTH;
} else {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH;
@@ -598,16 +598,16 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->n_data_bytes+=length;
info->outstream1 = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
}
- if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID))
+ if ((tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID))
{
- forwardchunk = TRUE;
+ forwardchunk = true;
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET);
info->n_forward_chunks++;
}
if (datachunk || forwardchunk)
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET);
- info->firstdata = FALSE;
+ info->firstdata = false;
if (tsnumber < info->min_tsn1)
info->min_tsn1 = tsnumber;
if (tsnumber > info->max_tsn1)
@@ -625,23 +625,23 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
tsn->first_tsn = tsnumber;
if (datachunk)
{
- t_s_n = (guint8 *)g_malloc(16);
- tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16);
+ t_s_n = (uint8_t *)g_malloc(16);
+ tvb_memcpy(sctp_info->tvb[chunk_number], (uint8_t *)(t_s_n),0, 16);
}
else
{
- t_s_n = (guint8 *)g_malloc(length);
- tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length);
+ t_s_n = (uint8_t *)g_malloc(length);
+ tvb_memcpy(sctp_info->tvb[chunk_number], (uint8_t *)(t_s_n),0, length);
}
tsn->tsns = g_list_append(tsn->tsns, t_s_n);
tsn_s = g_new(struct tsn_sort, 1);
tsn_s->tsnumber = tsnumber;
- tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs;
- tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000;
+ tsn_s->secs = tsn->secs = (uint32_t)pinfo->rel_ts.secs;
+ tsn_s->usecs = tsn->usecs = (uint32_t)pinfo->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
if (datachunk)
- if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
+ if (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
tsn_s->length = length - DATA_CHUNK_HEADER_LENGTH;
} else {
tsn_s->length = length - I_DATA_CHUNK_HEADER_LENGTH;
@@ -666,8 +666,8 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
g_ptr_array_add(info->sort_tsn1, tsn_s);
info->n_array_tsn1++;
}
- if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) ||
- (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID) )
+ if ((tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) ||
+ (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID) )
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET);
if (tsnumber < info->min_tsn2)
@@ -677,14 +677,14 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET);
if (sack->first_tsn == 0)
sack->first_tsn = tsnumber;
- t_s_n = (guint8 *)g_malloc(length);
- tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length);
+ t_s_n = (uint8_t *)g_malloc(length);
+ tvb_memcpy(sctp_info->tvb[chunk_number], (uint8_t *)(t_s_n),0, length);
sack->tsns = g_list_append(sack->tsns, t_s_n);
- sackchunk = TRUE;
+ sackchunk = true;
tsn_s = g_new(struct tsn_sort, 1);
tsn_s->tsnumber = tsnumber;
- tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs;
- tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000;
+ tsn_s->secs = tsn->secs = (uint32_t)pinfo->rel_ts.secs;
+ tsn_s->usecs = tsn->usecs = (uint32_t)pinfo->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET);
@@ -712,7 +712,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
if (info->verification_tag1 != 0 || info->verification_tag2 != 0)
{
- guint32 number;
+ uint32_t number;
store = g_new(address, 1);
copy_address(store, &tmp_info.src);
info = add_address(store, info, info->direction);
@@ -726,23 +726,23 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->frame_numbers=g_list_prepend(info->frame_numbers, GUINT_TO_POINTER(number));
if (datachunk || forwardchunk) {
info->tsn1 = g_list_prepend(info->tsn1, tsn);
- tsn_used = TRUE;
+ tsn_used = true;
}
- if (sackchunk == TRUE) {
+ if (sackchunk == true) {
info->sack2 = g_list_prepend(info->sack2, sack);
- sack_used = TRUE;
+ sack_used = true;
}
sctp_tapinfo_struct.assoc_info_list = g_list_append(sctp_tapinfo_struct.assoc_info_list, info);
}
else
{
- gchar* tmp_str;
+ char* tmp_str;
error = g_new(sctp_error_info_t, 1);
error->frame_number = pinfo->num;
error->chunk_info[0] = '\0';
- if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)
+ if ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)
{
- tmp_str = val_to_str_wmem(NULL, tvb_get_guint8(sctp_info->tvb[0],0),chunk_type_values,"Reserved (%d)");
+ tmp_str = val_to_str_wmem(NULL, tvb_get_uint8(sctp_info->tvb[0],0),chunk_type_values,"Reserved (%d)");
(void) g_strlcpy(error->chunk_info, tmp_str, 200);
wmem_free(NULL, tmp_str);
}
@@ -750,7 +750,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
{
for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++)
{
- tmp_str = val_to_str_wmem(NULL, tvb_get_guint8(sctp_info->tvb[chunk_number],0),chunk_type_values,"Reserved (%d)");
+ tmp_str = val_to_str_wmem(NULL, tvb_get_uint8(sctp_info->tvb[chunk_number],0),chunk_type_values,"Reserved (%d)");
(void) g_strlcat(error->chunk_info, tmp_str, 200);
wmem_free(NULL, tmp_str);
}
@@ -762,7 +762,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
} /* endif (!info) */
else
{
- guint32 number;
+ uint32_t number;
info->direction = sctp_info->direction;
if (info->verification_tag1 == 0 && info->verification_tag2 != sctp_info->verification_tag) {
@@ -770,13 +770,13 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
} else if (info->verification_tag2 == 0 && info->verification_tag1 != sctp_info->verification_tag) {
info->verification_tag2 = sctp_info->verification_tag;
}
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
{
tsn = g_new0(tsn_t, 1);
@@ -786,14 +786,14 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
sack = g_new0(tsn_t, 1);
copy_address(&sack->src, &tmp_info.src);
copy_address(&sack->dst, &tmp_info.dst);
- sack->secs=tsn->secs = (guint32)pinfo->rel_ts.secs;
- sack->usecs=tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000;
-
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
+ sack->secs=tsn->secs = (uint32_t)pinfo->rel_ts.secs;
+ sack->usecs=tsn->usecs = (uint32_t)pinfo->rel_ts.nsecs/1000;
+
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_I_DATA_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_NR_SACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
{
if (tsn->secs < info->min_secs)
{
@@ -846,8 +846,8 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
break;
}
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) ||
- ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID))
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID) ||
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID))
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], INIT_CHUNK_INITIAL_TSN_OFFSET);
if (info->direction == 2)
@@ -860,7 +860,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->outstream2 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET);
info->arwnd2 = tvb_get_ntohl(sctp_info->tvb[0],INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET);
info->tsn2 = g_list_prepend(info->tsn2, tsn);
- tsn_used = TRUE;
+ tsn_used = true;
}
else if (info->direction == 1)
{
@@ -872,10 +872,10 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->outstream1 = tvb_get_ntohs(sctp_info->tvb[0],INIT_CHUNK_NUMBER_OF_OUTBOUND_STREAMS_OFFSET);
info->arwnd1 = tvb_get_ntohl(sctp_info->tvb[0],INIT_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET);
info->tsn1 = g_list_prepend(info->tsn1, tsn);
- tsn_used = TRUE;
+ tsn_used = true;
}
- idx = tvb_get_guint8(sctp_info->tvb[0],0);
+ idx = tvb_get_uint8(sctp_info->tvb[0],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
info->chunk_count[idx]++;
@@ -902,53 +902,53 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
if (info->direction == 1) {
if (info->dir1->init || info->dir1->initack) {
- info->init_collision = TRUE;
+ info->init_collision = true;
}
- if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
- info->dir1->init = TRUE;
+ if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
+ info->dir1->init = true;
info->dir1->init_min_tsn = tvb_get_ntohl((sctp_info->tvb)[0], INIT_CHUNK_INITIAL_TSN_OFFSET);
info->min_tsn1 = info->dir1->init_min_tsn;
info->dir1->init_vtag = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET);
- } else if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
- info->dir1->initack = TRUE;
+ } else if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
+ info->dir1->initack = true;
info->dir1->initack_min_tsn = tvb_get_ntohl((sctp_info->tvb)[0], INIT_CHUNK_INITIAL_TSN_OFFSET);
info->min_tsn1 = info->dir1->initack_min_tsn;
info->dir1->initack_vtag = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET);
}
} else {
if (info->dir2->init || info->dir2->initack) {
- info->init_collision = TRUE;
+ info->init_collision = true;
}
- if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
- info->dir2->init = TRUE;
+ if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_CHUNK_ID) {
+ info->dir2->init = true;
info->dir2->init_min_tsn = tvb_get_ntohl((sctp_info->tvb)[0], INIT_CHUNK_INITIAL_TSN_OFFSET);
info->min_tsn2 = info->dir2->init_min_tsn;
info->dir2->init_vtag = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET);
- } else if (tvb_get_guint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
- info->dir2->initack = TRUE;
+ } else if (tvb_get_uint8(sctp_info->tvb[0],0) == SCTP_INIT_ACK_CHUNK_ID) {
+ info->dir2->initack = true;
info->dir2->initack_min_tsn = tvb_get_ntohl((sctp_info->tvb)[0], INIT_CHUNK_INITIAL_TSN_OFFSET);
info->min_tsn2 = info->dir2->initack_min_tsn;
info->dir2->initack_vtag = tvb_get_ntohl(sctp_info->tvb[0], INIT_CHUNK_INITIATE_TAG_OFFSET);
}
}
- if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID)
+ if ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_ACK_CHUNK_ID)
{
- info->initack = TRUE;
+ info->initack = true;
info->initack_dir = info->direction;
}
- else if ((tvb_get_guint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)
+ else if ((tvb_get_uint8(sctp_info->tvb[0],0)) == SCTP_INIT_CHUNK_ID)
{
- info->init = TRUE;
+ info->init = true;
}
}
else
{
- if (((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_I_DATA_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) &&
- ((tvb_get_guint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID))
+ if (((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_INIT_ACK_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_DATA_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_I_DATA_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_SACK_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_NR_SACK_CHUNK_ID) &&
+ ((tvb_get_uint8(sctp_info->tvb[0],0)) != SCTP_FORWARD_TSN_CHUNK_ID))
{
if (!sack)
sack = g_new0(tsn_t, 1);
@@ -961,7 +961,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++)
{
- idx = tvb_get_guint8(sctp_info->tvb[chunk_number],0);
+ idx = tvb_get_uint8(sctp_info->tvb[chunk_number],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
@@ -972,11 +972,11 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->ep2_chunk_count[idx]++;
info = add_chunk_count(&tmp_info.src, info,info->direction, idx);
- if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) ||
- (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_I_DATA_CHUNK_ID))
- datachunk = TRUE;
- if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID)
- forwardchunk = TRUE;
+ if ((tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) ||
+ (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_I_DATA_CHUNK_ID))
+ datachunk = true;
+ if (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_FORWARD_TSN_CHUNK_ID)
+ forwardchunk = true;
if ((datachunk || forwardchunk) && tsn != NULL)
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET);
@@ -984,9 +984,9 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
tsn->first_tsn = tsnumber;
if (datachunk)
{
- t_s_n = (guint8 *)g_malloc(16);
- tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, 16);
- if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
+ t_s_n = (uint8_t *)g_malloc(16);
+ tvb_memcpy(sctp_info->tvb[chunk_number], (uint8_t *)(t_s_n),0, 16);
+ if (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET)-DATA_CHUNK_HEADER_LENGTH;
} else {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH;
@@ -997,16 +997,16 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
else
{
length=tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET);
- t_s_n = (guint8 *)g_malloc(length);
- tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length);
+ t_s_n = (uint8_t *)g_malloc(length);
+ tvb_memcpy(sctp_info->tvb[chunk_number], (uint8_t *)(t_s_n),0, length);
info->n_forward_chunks++;
}
tsn->tsns = g_list_append(tsn->tsns, t_s_n);
tsn_s = g_new0(struct tsn_sort, 1);
tsn_s->tsnumber = tsnumber;
- tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs;
- tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000;
+ tsn_s->secs = tsn->secs = (uint32_t)pinfo->rel_ts.secs;
+ tsn_s->usecs = tsn->usecs = (uint32_t)pinfo->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = length;
@@ -1030,7 +1030,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
if (info->direction == 1)
{
if (info->firstdata) {
- info->firstdata = FALSE;
+ info->firstdata = false;
if (info->init_collision) {
if (tsnumber != info->min_tsn1) {
info->min_tsn1 = info->dir1->init_min_tsn;
@@ -1069,12 +1069,12 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
if (datachunk)
{
- if (info->init == FALSE) {
- guint16 tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
+ if (info->init == false) {
+ uint16_t tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
if (info->outstream1 < tmp) info->outstream1 = tmp;
}
- if (info->initack == FALSE) {
- guint16 tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
+ if (info->initack == false) {
+ uint16_t tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
if (info->instream2 < tmp) info->instream2 = tmp;
}
}
@@ -1085,7 +1085,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
else if (info->direction == 2)
{
if (info->firstdata) {
- info->firstdata = FALSE;
+ info->firstdata = false;
if (info->init_collision) {
if (tsnumber != info->min_tsn2) {
info->min_tsn2 = info->dir2->init_min_tsn;
@@ -1102,7 +1102,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
{
if (datachunk)
{
- if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
+ if (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - DATA_CHUNK_HEADER_LENGTH;
} else {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH;
@@ -1120,7 +1120,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->max_tsn2 = tsnumber;
if (datachunk)
{
- if (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
+ if (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_DATA_CHUNK_ID) {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - DATA_CHUNK_HEADER_LENGTH;
} else {
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET) - I_DATA_CHUNK_HEADER_LENGTH;
@@ -1135,12 +1135,12 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
}
if (datachunk)
{
- if (info->init == FALSE) {
- guint16 tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
+ if (info->init == false) {
+ uint16_t tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
if (info->instream1 < tmp) info->instream1 = tmp;
}
- if (info->initack == FALSE) {
- guint16 tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
+ if (info->initack == false) {
+ uint16_t tmp = tvb_get_ntohs((sctp_info->tvb)[chunk_number], DATA_CHUNK_STREAM_ID_OFFSET)+1;
if (info->outstream2 < tmp) info->outstream2 = tmp;
}
}
@@ -1149,8 +1149,8 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->n_array_tsn2++;
}
}
- else if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) ||
- (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID)) &&
+ else if (((tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) ||
+ (tvb_get_uint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID)) &&
sack != NULL)
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET);
@@ -1159,14 +1159,14 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
if (sack->first_tsn == 0)
sack->first_tsn = tsnumber;
- t_s_n = (guint8 *)g_malloc(length);
- tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length);
+ t_s_n = (uint8_t *)g_malloc(length);
+ tvb_memcpy(sctp_info->tvb[chunk_number], (uint8_t *)(t_s_n),0, length);
sack->tsns = g_list_append(sack->tsns, t_s_n);
- sackchunk = TRUE;
+ sackchunk = true;
tsn_s = g_new0(struct tsn_sort, 1);
tsn_s->tsnumber = tsnumber;
- tsn_s->secs = tsn->secs = (guint32)pinfo->rel_ts.secs;
- tsn_s->usecs = tsn->usecs = (guint32)pinfo->rel_ts.nsecs/1000;
+ tsn_s->secs = tsn->secs = (uint32_t)pinfo->rel_ts.secs;
+ tsn_s->usecs = tsn->usecs = (uint32_t)pinfo->rel_ts.nsecs/1000;
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = tvb_get_ntohl(sctp_info->tvb[chunk_number], SACK_CHUNK_ADV_REC_WINDOW_CREDIT_OFFSET);
@@ -1220,15 +1220,15 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
info->tsn1 = g_list_prepend(info->tsn1, tsn);
else if (info->direction == 2)
info->tsn2 = g_list_prepend(info->tsn2, tsn);
- tsn_used = TRUE;
+ tsn_used = true;
}
- if (sackchunk == TRUE)
+ if (sackchunk == true)
{
if (info->direction == 1)
info->sack2 = g_list_prepend(info->sack2, sack);
else if(info->direction == 2)
info->sack1 = g_list_prepend(info->sack1, sack);
- sack_used = TRUE;
+ sack_used = true;
}
info->n_tvbs += sctp_info->number_of_tvbs;
sctp_tapinfo_struct.sum_tvbs += sctp_info->number_of_tvbs;
@@ -1251,7 +1251,7 @@ remove_tap_listener_sctp_stat(void)
{
if (sctp_tapinfo_struct.is_registered) {
remove_tap_listener(&sctp_tapinfo_struct);
- sctp_tapinfo_struct.is_registered = FALSE;
+ sctp_tapinfo_struct.is_registered = false;
}
}
@@ -1271,7 +1271,7 @@ sctp_stat_get_info(void)
}
const sctp_assoc_info_t *
-get_sctp_assoc_info(guint16 assoc_id)
+get_sctp_assoc_info(uint16_t assoc_id)
{
sctp_tmp_info_t needle = { .assoc_id = assoc_id };
return find_assoc(&needle);
@@ -1289,6 +1289,6 @@ register_tap_listener_sctp_stat(void)
g_string_free(error_string, TRUE);
return;
}
- sctp_tapinfo_struct.is_registered=TRUE;
+ sctp_tapinfo_struct.is_registered=true;
}
}
diff --git a/ui/tap-sctp-analysis.h b/ui/tap-sctp-analysis.h
index 0f7f1ebc..054d91b1 100644
--- a/ui/tap-sctp-analysis.h
+++ b/ui/tap-sctp-analysis.h
@@ -139,116 +139,116 @@ extern "C" {
#define MAX_SCTP_CHUNK_TYPE 256
typedef struct _tsn {
- guint32 frame_number;
- guint32 secs; /* Absolute seconds */
- guint32 usecs;
+ uint32_t frame_number;
+ uint32_t secs; /* Absolute seconds */
+ uint32_t usecs;
address src;
address dst;
- guint32 first_tsn;
+ uint32_t first_tsn;
GList *tsns;
} tsn_t;
typedef struct _sctp_tmp_info {
- guint16 assoc_id;
- guint16 direction;
+ uint16_t assoc_id;
+ uint16_t direction;
address src;
address dst;
- guint16 port1;
- guint16 port2;
- guint32 verification_tag1;
- guint32 verification_tag2;
- guint32 initiate_tag;
- guint32 n_tvbs;
+ uint16_t port1;
+ uint16_t port2;
+ uint32_t verification_tag1;
+ uint32_t verification_tag2;
+ uint32_t initiate_tag;
+ uint32_t n_tvbs;
} sctp_tmp_info_t;
typedef struct _sctp_init_collision {
- guint32 init_vtag; /* initiate tag of the INIT chunk */
- guint32 initack_vtag; /* initiate tag of the INIT-ACK chunk */
- guint32 init_min_tsn; /* initial tsn of the INIT chunk */
- guint32 initack_min_tsn; /* initial tsn of the INIT-ACK chunk */
+ uint32_t init_vtag; /* initiate tag of the INIT chunk */
+ uint32_t initack_vtag; /* initiate tag of the INIT-ACK chunk */
+ uint32_t init_min_tsn; /* initial tsn of the INIT chunk */
+ uint32_t initack_min_tsn; /* initial tsn of the INIT-ACK chunk */
bool init:1;
bool initack:1;
} sctp_init_collision_t;
struct tsn_sort{
- guint32 tsnumber;
- guint32 secs;
- guint32 usecs;
- guint32 offset;
- guint32 length;
- guint32 framenumber;
+ uint32_t tsnumber;
+ uint32_t secs;
+ uint32_t usecs;
+ uint32_t offset;
+ uint32_t length;
+ uint32_t framenumber;
};
typedef struct _sctp_addr_chunk {
- guint32 direction;
+ uint32_t direction;
address addr;
/* The array is initialized to MAX_SCTP_CHUNK_TYPE
* so that there is no memory overwrite
* when accessed using sctp chunk type as index.
*/
- guint32 addr_count[MAX_SCTP_CHUNK_TYPE];
+ uint32_t addr_count[MAX_SCTP_CHUNK_TYPE];
} sctp_addr_chunk;
typedef struct _sctp_assoc_info {
- guint16 assoc_id;
+ uint16_t assoc_id;
address src;
address dst;
- guint16 port1;
- guint16 port2;
- guint32 verification_tag1;
- guint32 verification_tag2;
- guint32 initiate_tag;
- guint32 n_tvbs;
+ uint16_t port1;
+ uint16_t port2;
+ uint32_t verification_tag1;
+ uint32_t verification_tag2;
+ uint32_t initiate_tag;
+ uint32_t n_tvbs;
GList *addr1;
GList *addr2;
- guint16 instream1;
- guint16 outstream1;
- guint16 instream2;
- guint16 outstream2;
- guint32 n_adler32_calculated;
- guint32 n_adler32_correct;
- guint32 n_crc32c_calculated;
- guint32 n_crc32c_correct;
- gchar checksum_type[8];
- guint32 n_checksum_errors;
- guint32 n_bundling_errors;
- guint32 n_padding_errors;
- guint32 n_length_errors;
- guint32 n_value_errors;
- guint32 n_data_chunks;
- guint32 n_forward_chunks;
- guint32 n_forward_chunks_ep1;
- guint32 n_forward_chunks_ep2;
- guint32 n_data_bytes;
- guint32 n_packets;
- guint32 n_data_chunks_ep1;
- guint32 n_data_bytes_ep1;
- guint32 n_data_chunks_ep2;
- guint32 n_data_bytes_ep2;
- guint32 n_sack_chunks_ep1;
- guint32 n_sack_chunks_ep2;
- guint32 n_array_tsn1;
- guint32 n_array_tsn2;
- guint32 max_window1;
- guint32 max_window2;
- guint32 arwnd1;
- guint32 arwnd2;
+ uint16_t instream1;
+ uint16_t outstream1;
+ uint16_t instream2;
+ uint16_t outstream2;
+ uint32_t n_adler32_calculated;
+ uint32_t n_adler32_correct;
+ uint32_t n_crc32c_calculated;
+ uint32_t n_crc32c_correct;
+ char checksum_type[8];
+ uint32_t n_checksum_errors;
+ uint32_t n_bundling_errors;
+ uint32_t n_padding_errors;
+ uint32_t n_length_errors;
+ uint32_t n_value_errors;
+ uint32_t n_data_chunks;
+ uint32_t n_forward_chunks;
+ uint32_t n_forward_chunks_ep1;
+ uint32_t n_forward_chunks_ep2;
+ uint32_t n_data_bytes;
+ uint32_t n_packets;
+ uint32_t n_data_chunks_ep1;
+ uint32_t n_data_bytes_ep1;
+ uint32_t n_data_chunks_ep2;
+ uint32_t n_data_bytes_ep2;
+ uint32_t n_sack_chunks_ep1;
+ uint32_t n_sack_chunks_ep2;
+ uint32_t n_array_tsn1;
+ uint32_t n_array_tsn2;
+ uint32_t max_window1;
+ uint32_t max_window2;
+ uint32_t arwnd1;
+ uint32_t arwnd2;
bool init:1;
bool initack:1;
bool firstdata:1;
bool init_collision:1;
- guint16 initack_dir;
- guint16 direction;
- guint32 min_secs;
- guint32 min_usecs;
- guint32 max_secs;
- guint32 max_usecs;
- guint32 min_tsn1;
- guint32 min_tsn2;
- guint32 max_tsn1;
- guint32 max_tsn2;
- guint32 max_bytes1;
- guint32 max_bytes2;
+ uint16_t initack_dir;
+ uint16_t direction;
+ uint32_t min_secs;
+ uint32_t min_usecs;
+ uint32_t max_secs;
+ uint32_t max_usecs;
+ uint32_t min_tsn1;
+ uint32_t min_tsn2;
+ uint32_t max_tsn1;
+ uint32_t max_tsn2;
+ uint32_t max_bytes1;
+ uint32_t max_bytes2;
sctp_init_collision_t *dir1;
sctp_init_collision_t *dir2;
GSList *min_max;
@@ -261,29 +261,29 @@ typedef struct _sctp_assoc_info {
GPtrArray *sort_tsn2;
GPtrArray *sort_sack2;
GList *sack2;
- gboolean check_address;
+ bool check_address;
GList* error_info_list;
/* The array is initialized to MAX_SCTP_CHUNK_TYPE
* so that there is no memory overwrite
* when accessed using sctp chunk type as index.
*/
- guint32 chunk_count[MAX_SCTP_CHUNK_TYPE];
- guint32 ep1_chunk_count[MAX_SCTP_CHUNK_TYPE];
- guint32 ep2_chunk_count[MAX_SCTP_CHUNK_TYPE];
- GList *addr_chunk_count;
+ uint32_t chunk_count[MAX_SCTP_CHUNK_TYPE];
+ uint32_t ep1_chunk_count[MAX_SCTP_CHUNK_TYPE];
+ uint32_t ep2_chunk_count[MAX_SCTP_CHUNK_TYPE];
+ GList *addr_chunk_count;
} sctp_assoc_info_t;
typedef struct _sctp_error_info {
- guint32 frame_number;
- gchar chunk_info[200];
- const gchar *info_text;
+ uint32_t frame_number;
+ char chunk_info[200];
+ const char *info_text;
} sctp_error_info_t;
typedef struct _sctp_allassocs_info {
- guint32 sum_tvbs;
+ uint32_t sum_tvbs;
GList *assoc_info_list;
- gboolean is_registered;
+ bool is_registered;
GList *children;
} sctp_allassocs_info_t;
@@ -297,7 +297,7 @@ void sctp_stat_scan(void);
void remove_tap_listener_sctp_stat(void);
-const sctp_assoc_info_t* get_sctp_assoc_info(guint16 assoc_id);
+const sctp_assoc_info_t* get_sctp_assoc_info(uint16_t assoc_id);
const sctp_assoc_info_t* get_selected_assoc(void);
#ifdef __cplusplus
diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c
index 2f96441a..25ea10e2 100644
--- a/ui/tap-tcp-stream.c
+++ b/ui/tap-tcp-stream.c
@@ -48,10 +48,30 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons
* We only know the stream number. Fill in our connection data.
* We assume that the server response is more interesting.
*/
- copy_address(&tg->src_address, &tcphdr->ip_dst);
- tg->src_port = tcphdr->th_dport;
- copy_address(&tg->dst_address, &tcphdr->ip_src);
- tg->dst_port = tcphdr->th_sport;
+ bool server_is_src;
+ if (tcphdr->th_flags & TH_SYN) {
+ if (tcphdr->th_flags & TH_ACK) {
+ /* SYN-ACK packet, so the server is the source. */
+ server_is_src = true;
+ } else {
+ /* SYN packet, so the server is the destination. */
+ server_is_src = false;
+ }
+ } else {
+ /* Fallback to assuming the lower numbered port is the server. */
+ server_is_src = tcphdr->th_sport < tcphdr->th_dport;
+ }
+ if (server_is_src) {
+ copy_address(&tg->src_address, &tcphdr->ip_src);
+ tg->src_port = tcphdr->th_sport;
+ copy_address(&tg->dst_address, &tcphdr->ip_dst);
+ tg->dst_port = tcphdr->th_dport;
+ } else {
+ copy_address(&tg->src_address, &tcphdr->ip_dst);
+ tg->src_port = tcphdr->th_dport;
+ copy_address(&tg->dst_address, &tcphdr->ip_src);
+ tg->dst_port = tcphdr->th_sport;
+ }
}
if (compare_headers(&tg->src_address, &tg->dst_address,
@@ -64,14 +84,29 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons
struct segment *segment = g_new(struct segment, 1);
segment->next = NULL;
segment->num = pinfo->num;
- segment->rel_secs = (guint32)pinfo->rel_ts.secs;
+ segment->rel_secs = (uint32_t)pinfo->rel_ts.secs;
segment->rel_usecs = pinfo->rel_ts.nsecs/1000;
/* Currently unused
segment->abs_secs = pinfo->abs_ts.secs;
segment->abs_usecs = pinfo->abs_ts.nsecs/1000;
*/
+ /* tcphdr->th_rawseq is always the absolute sequence number.
+ * tcphdr->th_seq is either the relative or absolute sequence number
+ * depending on the TCP dissector preferences.
+ * The sack entries are also either the relative or absolute sequence
+ * number depending on the TCP dissector preferences.
+ * The TCP stream graphs have their own action / button press to
+ * switch between relative and absolute sequence numbers on the fly;
+ * if the TCP dissector hasn't calculated the relative sequence numbers,
+ * the tap will do so. (XXX - The calculation is cheap enough that we
+ * could do it here and store the offsets at the graph level to save
+ * memory. The TCP dissector could include its calculated base seq in
+ * the tap information to ensure consistency.)
+ */
segment->th_seq = tcphdr->th_seq;
segment->th_ack = tcphdr->th_ack;
+ segment->th_rawseq = tcphdr->th_rawseq;
+ segment->th_rawack = tcphdr->th_rawack;
segment->th_win = tcphdr->th_win;
segment->th_flags = tcphdr->th_flags;
segment->th_sport = tcphdr->th_sport;
@@ -145,7 +180,7 @@ graph_segment_list_free(struct tcp_graph *tg)
}
int
-compare_headers(address *saddr1, address *daddr1, guint16 sport1, guint16 dport1, const address *saddr2, const address *daddr2, guint16 sport2, guint16 dport2, int dir)
+compare_headers(address *saddr1, address *daddr1, uint16_t sport1, uint16_t dport1, const address *saddr2, const address *daddr2, uint16_t sport2, uint16_t dport2, int dir)
{
int dir1, dir2;
@@ -212,7 +247,7 @@ static tap_packet_status
tap_tcpip_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip, tap_flags_t flags _U_)
{
int n;
- gboolean is_unique = TRUE;
+ bool is_unique = true;
th_t *th = (th_t *)pct;
const struct tcpheader *header = (const struct tcpheader *)vip;
@@ -225,7 +260,7 @@ tap_tcpip_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
&header->ip_src, &header->ip_dst,
header->th_sport, stored->th_dport,
COMPARE_CURR_DIR)) {
- is_unique = FALSE;
+ is_unique = false;
break;
}
}
@@ -249,31 +284,31 @@ tap_tcpip_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, con
* then present the user with a dialog where the user can select WHICH tcp
* session to graph.
*/
-guint32
+uint32_t
select_tcpip_session(capture_file *cf)
{
frame_data *fdata;
epan_dissect_t edt;
dfilter_t *sfcode;
- guint32 th_stream;
+ uint32_t th_stream;
df_error_t *df_err;
GString *error_string;
th_t th = {0, {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
if (!cf) {
- return G_MAXUINT32;
+ return UINT32_MAX;
}
/* no real filter yet */
if (!dfilter_compile("tcp", &sfcode, &df_err)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", df_err->msg);
df_error_free(&df_err);
- return G_MAXUINT32;
+ return UINT32_MAX;
}
/* dissect the current record */
if (!cf_read_current_record(cf)) {
- return G_MAXUINT32; /* error reading the record */
+ return UINT32_MAX; /* error reading the record */
}
fdata = cf->current_frame;
@@ -286,7 +321,7 @@ select_tcpip_session(capture_file *cf)
exit(1);
}
- epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
+ epan_dissect_init(&edt, cf->epan, true, false);
epan_dissect_prime_with_dfilter(&edt, sfcode);
epan_dissect_run_with_taps(&edt, cf->cd_t, &cf->rec,
frame_tvbuff_new_buffer(&cf->provider, fdata, &cf->buf),
@@ -302,7 +337,7 @@ select_tcpip_session(capture_file *cf)
* to determine whether to enable any of our menu items. */
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Selected packet isn't a TCP segment or is truncated");
- return G_MAXUINT32;
+ return UINT32_MAX;
}
/* XXX fix this later, we should show a dialog allowing the user
to select which session he wants here
@@ -312,7 +347,7 @@ select_tcpip_session(capture_file *cf)
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"The selected packet has more than one TCP unique conversation "
"in it.");
- return G_MAXUINT32;
+ return UINT32_MAX;
}
/* For now, still always choose the first/only one */
@@ -334,10 +369,10 @@ int rtt_is_retrans(struct rtt_unack *list, unsigned int seqno)
for (u=list; u; u=u->next) {
if (tcp_seq_eq_or_after(seqno, u->seqno) &&
tcp_seq_before(seqno, u->end_seqno)) {
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
struct rtt_unack *
diff --git a/ui/tap-tcp-stream.h b/ui/tap-tcp-stream.h
index 3bc46887..122b104b 100644
--- a/ui/tap-tcp-stream.h
+++ b/ui/tap-tcp-stream.h
@@ -29,27 +29,29 @@ typedef enum tcp_graph_type_ {
struct segment {
struct segment *next;
- guint32 num;
- guint32 rel_secs;
- guint32 rel_usecs;
+ uint32_t num;
+ uint32_t rel_secs;
+ uint32_t rel_usecs;
/* Currently unused.
time_t abs_secs;
- guint32 abs_usecs;
+ uint32_t abs_usecs;
*/
- guint32 th_seq;
- guint32 th_ack;
- guint16 th_flags;
- guint32 th_win; /* make it 32 bits so we can handle some scaling */
- guint32 th_seglen;
- guint16 th_sport;
- guint16 th_dport;
+ uint32_t th_seq;
+ uint32_t th_ack;
+ uint32_t th_rawseq;
+ uint32_t th_rawack;
+ uint16_t th_flags;
+ uint32_t th_win; /* make it 32 bits so we can handle some scaling */
+ uint32_t th_seglen;
+ uint16_t th_sport;
+ uint16_t th_dport;
address ip_src;
address ip_dst;
- guint8 num_sack_ranges;
- guint32 sack_left_edge[MAX_TCP_SACK_RANGES];
- guint32 sack_right_edge[MAX_TCP_SACK_RANGES];
+ uint8_t num_sack_ranges;
+ uint32_t sack_left_edge[MAX_TCP_SACK_RANGES];
+ uint32_t sack_right_edge[MAX_TCP_SACK_RANGES];
};
struct tcp_graph {
@@ -57,10 +59,10 @@ struct tcp_graph {
/* The stream this graph will show */
address src_address;
- guint16 src_port;
+ uint16_t src_port;
address dst_address;
- guint16 dst_port;
- guint32 stream;
+ uint16_t dst_port;
+ uint32_t stream;
/* Should this be a map or tree instead? */
struct segment *segments;
};
@@ -81,12 +83,12 @@ void graph_segment_list_free(struct tcp_graph * );
#define COMPARE_CURR_DIR 0
#define COMPARE_ANY_DIR 1
-int compare_headers(address *saddr1, address *daddr1, guint16 sport1, guint16 dport1, const address *saddr2, const address *daddr2, guint16 sport2, guint16 dport2, int dir);
+int compare_headers(address *saddr1, address *daddr1, uint16_t sport1, uint16_t dport1, const address *saddr2, const address *daddr2, uint16_t sport2, uint16_t dport2, int dir);
int get_num_dsegs(struct tcp_graph * );
int get_num_acks(struct tcp_graph *, int * );
-guint32 select_tcpip_session(capture_file *);
+uint32_t select_tcpip_session(capture_file *);
/* This is used by rtt module only */
struct rtt_unack {
@@ -103,21 +105,21 @@ void rtt_delete_unack_from_list(struct rtt_unack ** , struct rtt_unack * );
void rtt_destroy_unack_list(struct rtt_unack ** );
static inline int
-tcp_seq_before(guint32 s1, guint32 s2) {
- return (gint32)(s1 - s2) < 0;
+tcp_seq_before(uint32_t s1, uint32_t s2) {
+ return (int32_t)(s1 - s2) < 0;
}
static inline int
-tcp_seq_eq_or_after(guint32 s1, guint32 s2) {
+tcp_seq_eq_or_after(uint32_t s1, uint32_t s2) {
return !tcp_seq_before(s1, s2);
}
static inline int
-tcp_seq_after(guint32 s1, guint32 s2) {
- return (gint32)(s1 - s2) > 0;
+tcp_seq_after(uint32_t s1, uint32_t s2) {
+ return (int32_t)(s1 - s2) > 0;
}
-static inline int tcp_seq_before_or_eq(guint32 s1, guint32 s2) {
+static inline int tcp_seq_before_or_eq(uint32_t s1, uint32_t s2) {
return !tcp_seq_after(s1, s2);
}
diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c
index 912884d0..ca52debe 100644
--- a/ui/tap_export_pdu.c
+++ b/ui/tap_export_pdu.c
@@ -29,9 +29,9 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
exp_pdu_t *exp_pdu_tap_data = (exp_pdu_t *)tapdata;
wtap_rec rec;
int err;
- gchar *err_info;
+ char *err_info;
int buffer_len;
- guint8 *packet_buf;
+ uint8_t *packet_buf;
tap_packet_status status = TAP_PACKET_DONT_REDRAW; /* no GUI, nothing to redraw */
/*
@@ -41,7 +41,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
memset(&rec, 0, sizeof rec);
buffer_len = exp_pdu_data->tvb_captured_length + exp_pdu_data->tlv_buffer_len;
- packet_buf = (guint8 *)g_malloc(buffer_len);
+ packet_buf = (uint8_t *)g_malloc(buffer_len);
if(exp_pdu_data->tlv_buffer_len > 0){
memcpy(packet_buf, exp_pdu_data->tlv_buffer, exp_pdu_data->tlv_buffer_len);
@@ -63,7 +63,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
* copying it here does not hurt. (Can invalidation really happen?) */
if (pinfo->fd->has_modified_block) {
rec.block = epan_get_modified_block(edt->session, pinfo->fd);
- rec.block_was_modified = TRUE;
+ rec.block_was_modified = true;
} else {
rec.block = pinfo->rec->block;
}
@@ -81,18 +81,18 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
return status;
}
-gboolean
+bool
exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, char *pathname,
int file_type_subtype, int fd, const char *comment,
- int *err, gchar **err_info)
+ int *err, char **err_info)
{
/* pcapng defs */
wtap_block_t shb_hdr;
wtap_block_t int_data;
wtapng_if_descr_mandatory_t *int_data_mand;
GString *os_info_str;
- gsize opt_len;
- gchar *opt_str;
+ size_t opt_len;
+ char *opt_str;
/*
* If the file format supports a section block, and the section
@@ -128,7 +128,7 @@ exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, char *pathname,
wtap_block_add_string_option_format(shb_hdr, OPT_SHB_USERAPPL, "%s",
get_appname_and_version());
- exp_pdu_tap_data->shb_hdrs = g_array_new(FALSE, FALSE, sizeof(wtap_block_t));
+ exp_pdu_tap_data->shb_hdrs = g_array_new(false, false, sizeof(wtap_block_t));
g_array_append_val(exp_pdu_tap_data->shb_hdrs, shb_hdr);
} else {
exp_pdu_tap_data->shb_hdrs = NULL;
@@ -141,7 +141,7 @@ exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, char *pathname,
if (wtap_file_type_subtype_supports_block(file_type_subtype,
WTAP_BLOCK_IF_ID_AND_INFO) != BLOCK_NOT_SUPPORTED) {
exp_pdu_tap_data->idb_inf = g_new(wtapng_iface_descriptions_t,1);
- exp_pdu_tap_data->idb_inf->interface_data = g_array_new(FALSE, FALSE, sizeof(wtap_block_t));
+ exp_pdu_tap_data->idb_inf->interface_data = g_array_new(false, false, sizeof(wtap_block_t));
/* create the fake interface data */
int_data = wtap_block_create(WTAP_BLOCK_IF_ID_AND_INFO);
@@ -172,17 +172,17 @@ exp_pdu_open(exp_pdu_t *exp_pdu_tap_data, char *pathname,
WTAP_UNCOMPRESSED, &params, err, err_info);
}
if (exp_pdu_tap_data->wdh == NULL)
- return FALSE;
+ return false;
exp_pdu_tap_data->pathname = pathname;
exp_pdu_tap_data->framenum = 0; /* No frames written yet */
- return TRUE;
+ return true;
}
-gboolean
-exp_pdu_close(exp_pdu_t *exp_pdu_tap_data, int *err, gchar **err_info)
+bool
+exp_pdu_close(exp_pdu_t *exp_pdu_tap_data, int *err, char **err_info)
{
- gboolean status;
+ bool status;
status = wtap_dump_close(exp_pdu_tap_data->wdh, NULL, err, err_info);
@@ -200,12 +200,12 @@ exp_pdu_pre_open(const char *tap_name, const char *filter, exp_pdu_t *exp_pdu_ta
GString *error_string;
/* Make sure tap is suitable for exported PDUs */
- gboolean found = FALSE;
+ bool found = false;
for (GSList *export_pdu_tap_name_list = get_export_pdu_tap_list();
export_pdu_tap_name_list != NULL;
export_pdu_tap_name_list = g_slist_next(export_pdu_tap_name_list)) {
if (strcmp((const char*)(export_pdu_tap_name_list->data), tap_name) == 0) {
- found = TRUE;
+ found = true;
break;
}
}
diff --git a/ui/tap_export_pdu.h b/ui/tap_export_pdu.h
index fa25edb3..19f31e0d 100644
--- a/ui/tap_export_pdu.h
+++ b/ui/tap_export_pdu.h
@@ -22,7 +22,7 @@ typedef struct _exp_pdu_t {
wtap_dumper* wdh;
GArray* shb_hdrs;
wtapng_iface_descriptions_t* idb_inf;
- guint32 framenum;
+ uint32_t framenum;
} exp_pdu_t;
/**
@@ -45,13 +45,13 @@ char *exp_pdu_pre_open(const char *tap_name, const char *filter,
* @param[out] err Will be set to an error code on failure.
* @param[out] err_info for some errors, a string giving more details of
* the error
-* @return TRUE on success or FALSE on failure.
+* @return true on success or false on failure.
*/
-gboolean exp_pdu_open(exp_pdu_t *data, char *pathname, int file_type_subtype,
- int fd, const char *comment, int *err, gchar **err_info);
+bool exp_pdu_open(exp_pdu_t *data, char *pathname, int file_type_subtype,
+ int fd, const char *comment, int *err, char **err_info);
/* Stops the PDUs export. */
-gboolean exp_pdu_close(exp_pdu_t *exp_pdu_tap_data, int *err, gchar **err_info);
+bool exp_pdu_close(exp_pdu_t *exp_pdu_tap_data, int *err, char **err_info);
#ifdef __cplusplus
}
diff --git a/ui/taps.h b/ui/taps.h
index 70822a5a..933e505e 100644
--- a/ui/taps.h
+++ b/ui/taps.h
@@ -20,9 +20,9 @@
extern "C" {
#endif /* __cplusplus */
-extern tap_reg_t tap_reg_listener[];
+extern tap_reg_t const tap_reg_listener[];
-extern const gulong tap_reg_listener_count;
+extern const unsigned long tap_reg_listener_count;
#ifdef __cplusplus
}
diff --git a/ui/text_import.c b/ui/text_import.c
index ffde4ac6..242f4ee0 100644
--- a/ui/text_import.c
+++ b/ui/text_import.c
@@ -116,15 +116,15 @@
static text_import_info_t *info_p;
/* Dummy Ethernet header */
-static gboolean hdr_ethernet = FALSE;
-static guint8 hdr_eth_dest_addr[6] = {0x20, 0x52, 0x45, 0x43, 0x56, 0x00};
-static guint8 hdr_eth_src_addr[6] = {0x20, 0x53, 0x45, 0x4E, 0x44, 0x00};
-static guint32 hdr_ethernet_proto = 0;
+static bool hdr_ethernet;
+static uint8_t hdr_eth_dest_addr[6] = {0x20, 0x52, 0x45, 0x43, 0x56, 0x00};
+static uint8_t hdr_eth_src_addr[6] = {0x20, 0x53, 0x45, 0x4E, 0x44, 0x00};
+static uint32_t hdr_ethernet_proto;
/* Dummy IP header */
-static gboolean hdr_ip = FALSE;
-static gboolean hdr_ipv6 = FALSE;
-static guint hdr_ip_proto = 0;
+static bool hdr_ip;
+static bool hdr_ipv6;
+static unsigned hdr_ip_proto;
/* Destination and source addresses for IP header */
static ws_in6_addr NO_IPv6_ADDRESS = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
@@ -135,67 +135,67 @@ static ws_in6_addr IPv6_SRC = {{0xfd, 0xce, 0xd8, 0x62, 0x14, 0x1b, 0x00, 0x01,
static ws_in6_addr IPv6_DST = {{0xfd, 0xce, 0xd8, 0x62, 0x14, 0x1b, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}};
/* Dummy UDP header */
-static gboolean hdr_udp = FALSE;
+static bool hdr_udp;
/* Dummy TCP header */
-static gboolean hdr_tcp = FALSE;
+static bool hdr_tcp;
/* TCP sequence numbers when has_direction is true */
-static guint32 tcp_in_seq_num = 0;
-static guint32 tcp_out_seq_num = 0;
+static uint32_t tcp_in_seq_num;
+static uint32_t tcp_out_seq_num;
/* Dummy SCTP header */
-static gboolean hdr_sctp = FALSE;
+static bool hdr_sctp;
/* Dummy DATA chunk header */
-static gboolean hdr_data_chunk = FALSE;
-static guint8 hdr_data_chunk_type = 0;
-static guint8 hdr_data_chunk_bits = 0;
-static guint32 hdr_data_chunk_tsn = 0;
-static guint16 hdr_data_chunk_sid = 0;
-static guint16 hdr_data_chunk_ssn = 0;
+static bool hdr_data_chunk;
+static uint8_t hdr_data_chunk_type;
+static uint8_t hdr_data_chunk_bits;
+static uint32_t hdr_data_chunk_tsn;
+static uint16_t hdr_data_chunk_sid;
+static uint16_t hdr_data_chunk_ssn;
/* Dummy ExportPdu header */
-static gboolean hdr_export_pdu = FALSE;
+static bool hdr_export_pdu;
/* Hex+ASCII text dump identification, to handle an edge case where
* the ASCII representation contains patterns that look like bytes. */
-static guint8* pkt_lnstart;
+static uint8_t* pkt_lnstart;
-static gboolean has_direction = FALSE;
-static guint32 direction = PACK_FLAGS_RECEPTION_TYPE_UNSPECIFIED;
-static gboolean has_seqno = FALSE;
-static guint64 seqno = 0;
+static bool has_direction;
+static uint32_t direction = PACK_FLAGS_RECEPTION_TYPE_UNSPECIFIED;
+static bool has_seqno;
+static uint64_t seqno;
/*--- Local data -----------------------------------------------------------------*/
/* This is where we store the packet currently being built */
-static guint8 *packet_buf;
-static guint32 curr_offset = 0;
-static guint32 packet_start = 0;
-static gboolean offset_warned = FALSE;
-static import_status_t start_new_packet(gboolean);
+static uint8_t *packet_buf;
+static uint32_t curr_offset;
+static uint32_t packet_start;
+static bool offset_warned;
+static import_status_t start_new_packet(bool);
/* This buffer contains strings present before the packet offset 0 */
#define PACKET_PREAMBLE_MAX_LEN 2048
-static guint8 packet_preamble[PACKET_PREAMBLE_MAX_LEN+1];
-static int packet_preamble_len = 0;
+static uint8_t packet_preamble[PACKET_PREAMBLE_MAX_LEN+1];
+static int packet_preamble_len;
/* Time code of packet, derived from packet_preamble */
-static time_t ts_sec = 0;
-static guint32 ts_nsec = 0;
-static gboolean ts_fmt_iso = FALSE;
+static time_t ts_sec;
+static uint32_t ts_nsec;
+static bool ts_fmt_iso;
static struct tm timecode_default;
-static gboolean timecode_warned = FALSE;
+static bool timecode_warned;
/* The time delta to add to packets without a valid time code.
* This can be no smaller than the time resolution of the dump
* file, so the default is 1000 nanoseconds, or 1 microsecond.
* XXX: We should at least get this from the resolution of the file we're
* writing to, and possibly allow the user to set a different value.
*/
-static guint32 ts_tick = 1000;
+static uint32_t ts_tick = 1000;
/* HDR_ETH Offset base to parse */
-static guint32 offset_base = 16;
+static uint32_t offset_base = 16;
/* ----- State machine -----------------------------------------------------------*/
@@ -228,25 +228,25 @@ static const char *token_str[] = {"",
/* ----- Skeleton Packet Headers --------------------------------------------------*/
typedef struct {
- guint8 dest_addr[6];
- guint8 src_addr[6];
- guint16 l3pid;
+ uint8_t dest_addr[6];
+ uint8_t src_addr[6];
+ uint16_t ethertype;
} hdr_ethernet_t;
static hdr_ethernet_t HDR_ETHERNET;
typedef struct {
- guint8 ver_hdrlen;
- guint8 dscp;
- guint16 packet_length;
- guint16 identification;
- guint8 flags;
- guint8 fragment;
- guint8 ttl;
- guint8 protocol;
- guint16 hdr_checksum;
- guint32 src_addr;
- guint32 dest_addr;
+ uint8_t ver_hdrlen;
+ uint8_t dscp;
+ uint16_t packet_length;
+ uint16_t identification;
+ uint8_t flags;
+ uint8_t fragment;
+ uint8_t ttl;
+ uint8_t protocol;
+ uint16_t hdr_checksum;
+ uint32_t src_addr;
+ uint32_t dest_addr;
} hdr_ip_t;
/* Default IPv4 addresses if none supplied */
@@ -264,11 +264,11 @@ static hdr_ip_t HDR_IP =
{0x45, 0, 0, IP_ID, 0, 0, 0xff, 0, 0, IP_SRC, IP_DST};
static struct { /* pseudo header for checksum calculation */
- guint32 src_addr;
- guint32 dest_addr;
- guint8 zero;
- guint8 protocol;
- guint16 length;
+ uint32_t src_addr;
+ uint32_t dest_addr;
+ uint8_t zero;
+ uint8_t protocol;
+ uint16_t length;
} pseudoh;
@@ -277,12 +277,12 @@ static struct { /* pseudo header for checksum calculation */
typedef struct {
union {
struct ip6_hdrctl {
- guint32 ip6_un1_flow; /* 24 bits of flow-ID */
- guint16 ip6_un1_plen; /* payload length */
- guint8 ip6_un1_nxt; /* next header */
- guint8 ip6_un1_hlim; /* hop limit */
+ uint32_t ip6_un1_flow; /* 24 bits of flow-ID */
+ uint16_t ip6_un1_plen; /* payload length */
+ uint8_t ip6_un1_nxt; /* next header */
+ uint8_t ip6_un1_hlim; /* hop limit */
} ip6_un1;
- guint8 ip6_un2_vfc; /* 4 bits version, 4 bits priority */
+ uint8_t ip6_un2_vfc; /* 4 bits version, 4 bits priority */
} ip6_ctlun;
ws_in6_addr ip6_src; /* source address */
ws_in6_addr ip6_dst; /* destination address */
@@ -294,59 +294,59 @@ static hdr_ipv6_t HDR_IPv6;
static struct { /* pseudo header ipv6 for checksum calculation */
struct e_in6_addr src_addr6;
struct e_in6_addr dst_addr6;
- guint32 length;
- guint8 zero[3];
- guint8 next_header;
+ uint32_t length;
+ uint8_t zero[3];
+ uint8_t next_header;
} pseudoh6;
typedef struct {
- guint16 source_port;
- guint16 dest_port;
- guint16 length;
- guint16 checksum;
+ uint16_t source_port;
+ uint16_t dest_port;
+ uint16_t length;
+ uint16_t checksum;
} hdr_udp_t;
static hdr_udp_t HDR_UDP = {0, 0, 0, 0};
typedef struct {
- guint16 source_port;
- guint16 dest_port;
- guint32 seq_num;
- guint32 ack_num;
- guint8 hdr_length;
- guint8 flags;
- guint16 window;
- guint16 checksum;
- guint16 urg;
+ uint16_t source_port;
+ uint16_t dest_port;
+ uint32_t seq_num;
+ uint32_t ack_num;
+ uint8_t hdr_length;
+ uint8_t flags;
+ uint16_t window;
+ uint16_t checksum;
+ uint16_t urg;
} hdr_tcp_t;
static hdr_tcp_t HDR_TCP = {0, 0, 0, 0, 0x50, 0, 0, 0, 0};
typedef struct {
- guint16 src_port;
- guint16 dest_port;
- guint32 tag;
- guint32 checksum;
+ uint16_t src_port;
+ uint16_t dest_port;
+ uint32_t tag;
+ uint32_t checksum;
} hdr_sctp_t;
static hdr_sctp_t HDR_SCTP = {0, 0, 0, 0};
typedef struct {
- guint8 type;
- guint8 bits;
- guint16 length;
- guint32 tsn;
- guint16 sid;
- guint16 ssn;
- guint32 ppid;
+ uint8_t type;
+ uint8_t bits;
+ uint16_t length;
+ uint32_t tsn;
+ uint16_t sid;
+ uint16_t ssn;
+ uint32_t ppid;
} hdr_data_chunk_t;
static hdr_data_chunk_t HDR_DATA_CHUNK = {0, 0, 0, 0, 0, 0, 0};
typedef struct {
- guint16 tag_type;
- guint16 payload_len;
+ uint16_t tag_type;
+ uint16_t payload_len;
} hdr_export_pdu_t;
static hdr_export_pdu_t HDR_EXPORT_PDU = {0, 0};
@@ -356,10 +356,10 @@ static hdr_export_pdu_t HDR_EXPORT_PDU = {0, 0};
/*----------------------------------------------------------------------
* Parse a single hex number
* Will abort the program if it can't parse the number
- * Pass in TRUE if this is an offset, FALSE if not
+ * Pass in true if this is an offset, false if not
*/
static import_status_t
-parse_num(const char *str, int offset, guint32* num)
+parse_num(const char *str, int offset, uint32_t* num)
{
char *c;
@@ -380,11 +380,11 @@ parse_num(const char *str, int offset, guint32* num)
offset ? offset_base : 16);
return IMPORT_FAILURE;
}
- if (ulnum > G_MAXUINT32) {
+ if (ulnum > UINT32_MAX) {
report_failure("%s too large", str);
return IMPORT_FAILURE;
}
- *num = (guint32) ulnum;
+ *num = (uint32_t) ulnum;
return IMPORT_SUCCESS;
}
@@ -394,15 +394,15 @@ parse_num(const char *str, int offset, guint32* num)
static import_status_t
write_byte(const char *str)
{
- guint32 num;
+ uint32_t num;
- if (parse_num(str, FALSE, &num) != IMPORT_SUCCESS)
+ if (parse_num(str, false, &num) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
- packet_buf[curr_offset] = (guint8) num;
+ packet_buf[curr_offset] = (uint8_t) num;
curr_offset++;
if (curr_offset >= info_p->max_frame_length) /* packet full */
- if (start_new_packet(TRUE) != IMPORT_SUCCESS)
+ if (start_new_packet(true) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
return IMPORT_SUCCESS;
@@ -412,7 +412,7 @@ write_byte(const char *str)
* Remove bytes from the current packet
*/
static void
-unwrite_bytes (guint32 nbytes)
+unwrite_bytes (uint32_t nbytes)
{
curr_offset -= nbytes;
}
@@ -420,10 +420,10 @@ unwrite_bytes (guint32 nbytes)
/*----------------------------------------------------------------------
* Determine SCTP chunk padding length
*/
-static guint32
-number_of_padding_bytes (guint32 length)
+static uint32_t
+number_of_padding_bytes (uint32_t length)
{
- guint32 remainder;
+ uint32_t remainder;
remainder = length % 4;
@@ -436,13 +436,13 @@ number_of_padding_bytes (guint32 length)
/*----------------------------------------------------------------------
* Write current packet out
*
- * @param cont [IN] TRUE if a packet is being written because the max frame
+ * @param cont [IN] true if a packet is being written because the max frame
* length was reached, and the original packet from the input file is
* continued in a later frame. Used to set fragmentation fields in dummy
* headers (currently only implemented for SCTP; IPv4 could be added later.)
*/
static import_status_t
-write_current_packet(gboolean cont)
+write_current_packet(bool cont)
{
int prefix_length = 0;
int proto_length = 0;
@@ -455,7 +455,7 @@ write_current_packet(gboolean cont)
/* Write the packet */
/* Is direction indication on with an inbound packet? */
- gboolean isOutbound = has_direction && (direction == PACK_FLAGS_DIRECTION_OUTBOUND);
+ bool isOutbound = has_direction && (direction == PACK_FLAGS_DIRECTION_OUTBOUND);
/* Compute packet length */
prefix_length = 0;
@@ -500,7 +500,7 @@ write_current_packet(gboolean cont)
memcpy(HDR_ETHERNET.dest_addr, hdr_eth_dest_addr, 6);
memcpy(HDR_ETHERNET.src_addr, hdr_eth_src_addr, 6);
}
- HDR_ETHERNET.l3pid = g_htons(hdr_ethernet_proto);
+ HDR_ETHERNET.ethertype = g_htons(hdr_ethernet_proto);
memcpy(&packet_buf[prefix_index], &HDR_ETHERNET, sizeof(HDR_ETHERNET));
prefix_index += (int)sizeof(HDR_ETHERNET);
}
@@ -518,9 +518,9 @@ write_current_packet(gboolean cont)
HDR_IP.dest_addr = info_p->ip_dest_addr.ipv4 ? info_p->ip_dest_addr.ipv4 : IP_DST;
}
HDR_IP.packet_length = g_htons(ip_length);
- HDR_IP.protocol = (guint8) hdr_ip_proto;
+ HDR_IP.protocol = (uint8_t) hdr_ip_proto;
HDR_IP.hdr_checksum = 0;
- cksum_vector[0].ptr = (guint8 *)&HDR_IP; cksum_vector[0].len = sizeof(HDR_IP);
+ cksum_vector[0].ptr = (uint8_t *)&HDR_IP; cksum_vector[0].len = sizeof(HDR_IP);
HDR_IP.hdr_checksum = in_cksum(cksum_vector, 1);
memcpy(&packet_buf[prefix_index], &HDR_IP, sizeof(HDR_IP));
@@ -530,7 +530,7 @@ write_current_packet(gboolean cont)
pseudoh.src_addr = HDR_IP.src_addr;
pseudoh.dest_addr = HDR_IP.dest_addr;
pseudoh.zero = 0;
- pseudoh.protocol = (guint8) hdr_ip_proto;
+ pseudoh.protocol = (uint8_t) hdr_ip_proto;
pseudoh.length = g_htons(proto_length);
} else if (hdr_ipv6) {
if (memcmp(&info_p->ip_dest_addr.ipv6, &NO_IPv6_ADDRESS, sizeof(ws_in6_addr))) {
@@ -547,7 +547,7 @@ write_current_packet(gboolean cont)
HDR_IPv6.ip6_ctlun.ip6_un2_vfc &= 0x0F;
HDR_IPv6.ip6_ctlun.ip6_un2_vfc |= (6<< 4);
HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen = g_htons(ip_length);
- HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_nxt = (guint8) hdr_ip_proto;
+ HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_nxt = (uint8_t) hdr_ip_proto;
HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_hlim = 32;
memcpy(&packet_buf[prefix_index], &HDR_IPv6, sizeof(HDR_IPv6));
@@ -557,7 +557,7 @@ write_current_packet(gboolean cont)
pseudoh6.src_addr6 = HDR_IPv6.ip6_src;
pseudoh6.dst_addr6 = HDR_IPv6.ip6_dst;
memset(pseudoh6.zero, 0, sizeof(pseudoh6.zero));
- pseudoh6.next_header = (guint8) hdr_ip_proto;
+ pseudoh6.next_header = (uint8_t) hdr_ip_proto;
pseudoh6.length = g_htons(proto_length);
}
@@ -571,11 +571,11 @@ write_current_packet(gboolean cont)
HDR_UDP.checksum = 0;
if (hdr_ipv6) {
- cksum_vector[0].ptr = (guint8 *)&pseudoh6; cksum_vector[0].len = sizeof(pseudoh6);
+ cksum_vector[0].ptr = (uint8_t *)&pseudoh6; cksum_vector[0].len = sizeof(pseudoh6);
} else {
- cksum_vector[0].ptr = (guint8 *)&pseudoh; cksum_vector[0].len = sizeof(pseudoh);
+ cksum_vector[0].ptr = (uint8_t *)&pseudoh; cksum_vector[0].len = sizeof(pseudoh);
}
- cksum_vector[1].ptr = (guint8 *)&HDR_UDP; cksum_vector[1].len = sizeof(HDR_UDP);
+ cksum_vector[1].ptr = (uint8_t *)&HDR_UDP; cksum_vector[1].len = sizeof(HDR_UDP);
cksum_vector[2].ptr = &packet_buf[prefix_length]; cksum_vector[2].len = curr_offset;
HDR_UDP.checksum = in_cksum(cksum_vector, 3);
@@ -604,11 +604,11 @@ write_current_packet(gboolean cont)
HDR_TCP.checksum = 0;
if (hdr_ipv6) {
- cksum_vector[0].ptr = (guint8 *)&pseudoh6; cksum_vector[0].len = sizeof(pseudoh6);
+ cksum_vector[0].ptr = (uint8_t *)&pseudoh6; cksum_vector[0].len = sizeof(pseudoh6);
} else {
- cksum_vector[0].ptr = (guint8 *)&pseudoh; cksum_vector[0].len = sizeof(pseudoh);
+ cksum_vector[0].ptr = (uint8_t *)&pseudoh; cksum_vector[0].len = sizeof(pseudoh);
}
- cksum_vector[1].ptr = (guint8 *)&HDR_TCP; cksum_vector[1].len = sizeof(HDR_TCP);
+ cksum_vector[1].ptr = (uint8_t *)&HDR_TCP; cksum_vector[1].len = sizeof(HDR_TCP);
cksum_vector[2].ptr = &packet_buf[prefix_length]; cksum_vector[2].len = curr_offset;
HDR_TCP.checksum = in_cksum(cksum_vector, 3);
@@ -674,7 +674,7 @@ write_current_packet(gboolean cont)
/* Write ExportPDU header */
if (hdr_export_pdu) {
- guint payload_len = (guint)strlen(info_p->payload);
+ unsigned payload_len = (unsigned)strlen(info_p->payload);
HDR_EXPORT_PDU.tag_type = g_htons(EXP_PDU_TAG_DISSECTOR_NAME);
HDR_EXPORT_PDU.payload_len = g_htons(payload_len);
memcpy(&packet_buf[prefix_index], &HDR_EXPORT_PDU, sizeof(HDR_EXPORT_PDU));
@@ -696,7 +696,7 @@ write_current_packet(gboolean cont)
/* Write the packet */
wtap_rec rec;
int err;
- gchar *err_info;
+ char *err_info;
memset(&rec, 0, sizeof rec);
@@ -795,11 +795,11 @@ append_to_preamble(char *str)
* one Unit is least_common_mmultiple(bits_per_char, 8) bits.
*/
struct plain_decoding_data {
- const gchar* name;
- guint chars_per_unit;
- guint bytes_per_unit : 3; /* Internally a guint64 is used to hold units */
- guint bits_per_char : 6;
- gint8 table[256];
+ const char* name;
+ unsigned chars_per_unit;
+ unsigned bytes_per_unit : 3; /* Internally a uint64_t is used to hold units */
+ unsigned bits_per_char : 6;
+ int8_t table[256];
};
#define _INVALID_INIT2 INVALID_VALUE, INVALID_VALUE
@@ -911,20 +911,20 @@ DIAG_ON_INIT_TWICE
* fragmentation and not actually due to EOT) you have to resume the parser at
* *src_last_unit and dest - result % bytes_per_unit
*/
-static int parse_plain_data(guchar** src, const guchar* src_end,
- guint8** dest, const guint8* dest_end, const struct plain_decoding_data* encoding,
- guchar** src_last_unit) {
+static int parse_plain_data(unsigned char** src, const unsigned char* src_end,
+ uint8_t** dest, const uint8_t* dest_end, const struct plain_decoding_data* encoding,
+ unsigned char** src_last_unit) {
int status = 1;
int units = 0;
/* unit buffer */
- guint64 c_val = 0;
- guint c_chars = 0;
+ uint64_t c_val = 0;
+ unsigned c_chars = 0;
/**
* Src data |- - -|- - -|- - -|- - -|- - -|- - -|- - -|- - -|
* Bytes |- - - - - - - -|- - - - - - - -|- - - - - - - -|
* Units |- - - - - - - - - - - - - - - - - - - - - - - -|
*/
- guint64 val;
+ uint64_t val;
int j;
if (ws_log_get_level() >= LOG_LEVEL_NOISY) {
char* debug_str = wmem_strndup(NULL, *src, (src_end-*src));
@@ -950,7 +950,7 @@ static int parse_plain_data(guchar** src, const guchar* src_end,
*src_last_unit = *src;
c_chars = 0;
for (j = encoding->bytes_per_unit; j > 0; --j) {
- **dest = (gchar) (c_val >> (j * 8 - 8));
+ **dest = (char) (c_val >> (j * 8 - 8));
*dest += 1;
}
}
@@ -959,15 +959,15 @@ static int parse_plain_data(guchar** src, const guchar* src_end,
}
remainder:
for (j = c_chars * encoding->bits_per_char; j >= 8; j -= 8) {
- **dest = (gchar) (c_val >> (j - 8));
+ **dest = (char) (c_val >> (j - 8));
*dest += 1;
}
return status * units;
}
-void parse_data(guchar* start_field, guchar* end_field, enum data_encoding encoding) {
- guint8* dest = &packet_buf[curr_offset];
- guint8* dest_end = &packet_buf[info_p->max_frame_length];
+void parse_data(unsigned char* start_field, unsigned char* end_field, enum data_encoding encoding) {
+ uint8_t* dest = &packet_buf[curr_offset];
+ uint8_t* dest_end = &packet_buf[info_p->max_frame_length];
const struct plain_decoding_data* table; /* should be further down */
switch (encoding) {
@@ -997,7 +997,7 @@ void parse_data(guchar* start_field, guchar* end_field, enum data_encoding encod
parse_plain_data(&start_field, end_field, &dest, dest_end, table, NULL);
curr_offset = (int) (dest - packet_buf);
if (curr_offset == info_p->max_frame_length) {
- write_current_packet(TRUE);
+ write_current_packet(true);
dest = &packet_buf[curr_offset];
} else
break;
@@ -1012,7 +1012,7 @@ void parse_data(guchar* start_field, guchar* end_field, enum data_encoding encod
#define setFlags(VAL, MASK, FLAGS) \
((VAL) & ~(MASK)) | ((FLAGS) & (MASK))
-static void _parse_dir(const guchar* start_field, const guchar* end_field _U_, const gchar* in_indicator, const gchar* out_indicator, guint32* dir) {
+static void _parse_dir(const unsigned char* start_field, const unsigned char* end_field _U_, const char* in_indicator, const char* out_indicator, uint32_t* dir) {
for (; *in_indicator && *start_field != *in_indicator; ++in_indicator);
if (*in_indicator) {
@@ -1027,21 +1027,21 @@ static void _parse_dir(const guchar* start_field, const guchar* end_field _U_, c
*dir = setFlags(*dir, PACK_FLAGS_DIRECTION_MASK << PACK_FLAGS_DIRECTION_SHIFT, PACK_FLAGS_DIRECTION_UNKNOWN);
}
-void parse_dir(const guchar* start_field, const guchar* end_field, const gchar* in_indicator, const gchar* out_indicator) {
+void parse_dir(const unsigned char* start_field, const unsigned char* end_field, const char* in_indicator, const char* out_indicator) {
_parse_dir(start_field, end_field, in_indicator, out_indicator, &direction);
}
#define PARSE_BUF 64
/* Attempt to parse a time according to the given format. If the conversion
- * succeeds, set sec and nsec appropriately and return TRUE. If it fails,
- * leave sec and nsec unchanged and return FALSE.
+ * succeeds, set sec and nsec appropriately and return true. If it fails,
+ * leave sec and nsec unchanged and return false.
*/
-static gboolean
-_parse_time(const guchar* start_field, const guchar* end_field, const gchar* _format, time_t* sec, gint* nsec) {
+static bool
+_parse_time(const unsigned char* start_field, const unsigned char* end_field, const char* _format, time_t* sec, int* nsec) {
struct tm timecode;
time_t sec_buf;
- gint nsec_buf = 0;
+ int nsec_buf = 0;
char field[PARSE_BUF];
char format[PARSE_BUF];
@@ -1057,7 +1057,7 @@ _parse_time(const guchar* start_field, const guchar* end_field, const gchar* _fo
if (ts_fmt_iso) {
nstime_t ts_iso;
if (!iso8601_to_nstime(&ts_iso, field, ISO8601_DATETIME_AUTO)) {
- return FALSE;
+ return false;
}
*sec = ts_iso.secs;
*nsec = ts_iso.nsecs;
@@ -1083,23 +1083,23 @@ _parse_time(const guchar* start_field, const guchar* end_field, const gchar* _fo
cursor = ws_strptime_p(cursor, format, &timecode);
if (cursor == NULL) {
- return FALSE;
+ return false;
}
if (subsecs_fmt != NULL) {
/*
* Parse subsecs and any following format
*/
- nsec_buf = (guint) strtol(cursor, &p, 10);
+ nsec_buf = (unsigned) strtol(cursor, &p, 10);
if (p == cursor) {
- return FALSE;
+ return false;
}
subseclen = (int) (p - cursor);
cursor = p;
cursor = ws_strptime_p(cursor, subsecs_fmt + 2, &timecode);
if (cursor == NULL) {
- return FALSE;
+ return false;
}
}
@@ -1127,32 +1127,32 @@ _parse_time(const guchar* start_field, const guchar* end_field, const gchar* _fo
}
if ( -1 == (sec_buf = mktime(&timecode)) ) {
- return FALSE;
+ return false;
}
*sec = sec_buf;
*nsec = nsec_buf;
}
- ws_noisy("parsed time %s Format(%s), time(%u), subsecs(%u)\n", field, _format, (guint32)*sec, (guint32)*nsec);
+ ws_noisy("parsed time %s Format(%s), time(%u), subsecs(%u)\n", field, _format, (uint32_t)*sec, (uint32_t)*nsec);
- return TRUE;
+ return true;
}
-void parse_time(const guchar* start_field, const guchar* end_field, const gchar* format) {
+void parse_time(const unsigned char* start_field, const unsigned char* end_field, const char* format) {
if (format == NULL || !_parse_time(start_field, end_field, format, &ts_sec, &ts_nsec)) {
ts_nsec += ts_tick;
}
}
-void parse_seqno(const guchar* start_field, const guchar* end_field) {
+void parse_seqno(const unsigned char* start_field, const unsigned char* end_field) {
char* buf = (char*) g_alloca(end_field - start_field + 1);
(void) g_strlcpy(buf, start_field, end_field - start_field + 1);
seqno = g_ascii_strtoull(buf, NULL, 10);
}
void flush_packet(void) {
- write_current_packet(FALSE);
+ write_current_packet(false);
}
/*----------------------------------------------------------------------
@@ -1163,7 +1163,7 @@ static void
parse_preamble (void)
{
int i;
- gboolean got_time = FALSE;
+ bool got_time = false;
/*
* Null-terminate the preamble.
@@ -1198,7 +1198,7 @@ parse_preamble (void)
*/
if (!timecode_warned) {
report_warning("Time conversions (%s) failed, advancing time by %d ns from previous packet on failure. First failure was for %s on input packet %d.", info_p->timestamp_format, ts_tick, packet_preamble, info_p->num_packets_read);
- timecode_warned = TRUE;
+ timecode_warned = true;
}
ws_warning("Time conversion (%s) failed for %s on input packet %d.", info_p->timestamp_format, packet_preamble, info_p->num_packets_read);
}
@@ -1207,7 +1207,7 @@ parse_preamble (void)
char *c;
while ((c = strchr(packet_preamble, '\r')) != NULL) *c=' ';
ws_noisy("[[parse_preamble: \"%s\"]]", packet_preamble);
- ws_noisy("Format(%s), time(%u), subsecs(%u)", info_p->timestamp_format, (guint32)ts_sec, ts_nsec);
+ ws_noisy("Format(%s), time(%u), subsecs(%u)", info_p->timestamp_format, (uint32_t)ts_sec, ts_nsec);
}
if (!got_time) {
@@ -1221,16 +1221,16 @@ parse_preamble (void)
/*----------------------------------------------------------------------
* Start a new packet
*
- * @param cont [IN] TRUE if a new packet is starting because the max frame
+ * @param cont [IN] true if a new packet is starting because the max frame
* length was reached on the current packet, and the original packet from the
* input file is continued in a later frame. Passed to write_current_packet,
* where it is used to set fragmentation fields in dummy headers (currently
* only implemented for SCTP; IPv4 could be added later.)
*/
static import_status_t
-start_new_packet(gboolean cont)
+start_new_packet(bool cont)
{
- ws_debug("Start new packet (cont = %s).", cont ? "TRUE" : "FALSE");
+ ws_debug("Start new packet (cont = %s).", cont ? "true" : "false");
/* Write out the current packet, if required */
if (write_current_packet(cont) != IMPORT_SUCCESS)
@@ -1262,7 +1262,7 @@ process_directive (char *str _U_)
import_status_t
parse_token(token_t token, char *str)
{
- guint32 num;
+ uint32_t num;
/* Variables for the hex+ASCII identification / lookback */
int by_eol;
int rollback = 0;
@@ -1308,17 +1308,17 @@ parse_token(token_t token, char *str)
tokens = g_strsplit_set(str, ": \t\r\n", 2);
if (!offset_warned) {
report_warning("Running in no offset mode but read offset (%s) at start of file, treating as preamble", tokens[0]);
- offset_warned = TRUE;
+ offset_warned = true;
}
ws_warning("Running in no offset mode but read offset (%s) at start of file, treating as preamble", tokens[0]);
g_strfreev(tokens);
break;
}
- if (parse_num(str, TRUE, &num) != IMPORT_SUCCESS)
+ if (parse_num(str, true, &num) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
if (num == 0) {
/* New packet starts here */
- if (start_new_packet(FALSE) != IMPORT_SUCCESS)
+ if (start_new_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
state = READ_OFFSET;
pkt_lnstart = packet_buf + num;
@@ -1326,7 +1326,7 @@ parse_token(token_t token, char *str)
break;
case T_BYTE:
if (offset_base == 0) {
- if (start_new_packet(FALSE) != IMPORT_SUCCESS)
+ if (start_new_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
if (write_byte(str) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
@@ -1335,7 +1335,7 @@ parse_token(token_t token, char *str)
}
break;
case T_EOF:
- if (write_current_packet(FALSE) != IMPORT_SUCCESS)
+ if (write_current_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
break;
default:
@@ -1361,17 +1361,17 @@ parse_token(token_t token, char *str)
tokens = g_strsplit_set(str, ": \t\r\n", 2);
if (!offset_warned) {
report_warning("Running in no offset mode but read offset (%s) at start of line, ignoring", tokens[0]);
- offset_warned = TRUE;
+ offset_warned = true;
}
ws_warning("Running in no offset mode but read offset (%s) at start of line, ignoring.", tokens[0]);
g_strfreev(tokens);
break;
}
- if (parse_num(str, TRUE, &num) != IMPORT_SUCCESS)
+ if (parse_num(str, true, &num) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
if (num == 0) {
/* New packet starts here */
- if (start_new_packet(FALSE) != IMPORT_SUCCESS)
+ if (start_new_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
packet_start = 0;
state = READ_OFFSET;
@@ -1392,7 +1392,7 @@ parse_token(token_t token, char *str)
/* Bad offset; switch to INIT state */
ws_message("Inconsistent offset. Expecting %0X, got %0X. Ignoring rest of packet",
curr_offset, num);
- if (write_current_packet(FALSE) != IMPORT_SUCCESS)
+ if (write_current_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
state = INIT;
}
@@ -1410,7 +1410,7 @@ parse_token(token_t token, char *str)
}
break;
case T_EOF:
- if (write_current_packet(FALSE) != IMPORT_SUCCESS)
+ if (write_current_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
break;
default:
@@ -1436,7 +1436,7 @@ parse_token(token_t token, char *str)
state = START_OF_LINE;
break;
case T_EOF:
- if (write_current_packet(FALSE) != IMPORT_SUCCESS)
+ if (write_current_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
break;
default:
@@ -1511,7 +1511,7 @@ parse_token(token_t token, char *str)
}
break;
case T_EOF:
- if (write_current_packet(FALSE) != IMPORT_SUCCESS)
+ if (write_current_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
break;
default:
@@ -1526,7 +1526,7 @@ parse_token(token_t token, char *str)
state = START_OF_LINE;
break;
case T_EOF:
- if (write_current_packet(FALSE) != IMPORT_SUCCESS)
+ if (write_current_packet(false) != IMPORT_SUCCESS)
return IMPORT_FAILURE;
break;
default:
@@ -1580,13 +1580,13 @@ text_import(text_import_info_t * const info)
info_p = info;
/* Dummy headers */
- hdr_ethernet = FALSE;
- hdr_ip = FALSE;
- hdr_udp = FALSE;
- hdr_tcp = FALSE;
- hdr_sctp = FALSE;
- hdr_data_chunk = FALSE;
- hdr_export_pdu = FALSE;
+ hdr_ethernet = false;
+ hdr_ip = false;
+ hdr_udp = false;
+ hdr_tcp = false;
+ hdr_sctp = false;
+ hdr_data_chunk = false;
+ hdr_export_pdu = false;
if (info->mode == TEXT_IMPORT_HEXDUMP) {
switch (info->hexdump.offset_type)
@@ -1612,12 +1612,12 @@ text_import(text_import_info_t * const info)
}
if (info->timestamp_format == NULL || g_ascii_strcasecmp(info->timestamp_format, "ISO")) {
- ts_fmt_iso = FALSE;
+ ts_fmt_iso = false;
} else {
- ts_fmt_iso = TRUE;
+ ts_fmt_iso = true;
}
- offset_warned = FALSE;
- timecode_warned = FALSE;
+ offset_warned = false;
+ timecode_warned = false;
/* XXX: It would be good to know the time precision of the file,
* to use for the time delta for packets without timestamps. (ts_tick)
@@ -1628,44 +1628,44 @@ text_import(text_import_info_t * const info)
switch (info->dummy_header_type)
{
case HEADER_ETH:
- hdr_ethernet = TRUE;
+ hdr_ethernet = true;
hdr_ethernet_proto = info->pid;
break;
case HEADER_IPV4:
- hdr_ip = TRUE;
+ hdr_ip = true;
hdr_ip_proto = info->protocol;
break;
case HEADER_UDP:
- hdr_udp = TRUE;
- hdr_tcp = FALSE;
- hdr_ip = TRUE;
+ hdr_udp = true;
+ hdr_tcp = false;
+ hdr_ip = true;
hdr_ip_proto = 17;
break;
case HEADER_TCP:
- hdr_tcp = TRUE;
- hdr_udp = FALSE;
- hdr_ip = TRUE;
+ hdr_tcp = true;
+ hdr_udp = false;
+ hdr_ip = true;
hdr_ip_proto = 6;
break;
case HEADER_SCTP:
- hdr_sctp = TRUE;
- hdr_ip = TRUE;
+ hdr_sctp = true;
+ hdr_ip = true;
hdr_ip_proto = 132;
break;
case HEADER_SCTP_DATA:
- hdr_sctp = TRUE;
- hdr_data_chunk = TRUE;
- hdr_ip = TRUE;
+ hdr_sctp = true;
+ hdr_data_chunk = true;
+ hdr_ip = true;
hdr_ip_proto = 132;
break;
case HEADER_EXPORT_PDU:
- hdr_export_pdu = TRUE;
+ hdr_export_pdu = true;
break;
default:
@@ -1674,8 +1674,8 @@ text_import(text_import_info_t * const info)
if (hdr_ip) {
if (info->ipv6) {
- hdr_ipv6 = TRUE;
- hdr_ip = FALSE;
+ hdr_ipv6 = true;
+ hdr_ip = false;
hdr_ethernet_proto = 0x86DD;
} else {
hdr_ethernet_proto = 0x0800;
@@ -1684,7 +1684,7 @@ text_import(text_import_info_t * const info)
switch (info->encapsulation) {
case (WTAP_ENCAP_ETHERNET):
- hdr_ethernet = TRUE;
+ hdr_ethernet = true;
break;
case (WTAP_ENCAP_RAW_IP):
@@ -1713,7 +1713,7 @@ text_import(text_import_info_t * const info)
info->num_packets_read = 0;
info->num_packets_written = 0;
- packet_buf = (guint8 *)g_malloc(sizeof(HDR_ETHERNET) + sizeof(HDR_IP) +
+ packet_buf = (uint8_t *)g_malloc(sizeof(HDR_ETHERNET) + sizeof(HDR_IP) +
sizeof(HDR_SCTP) + sizeof(HDR_DATA_CHUNK) +
sizeof(HDR_EXPORT_PDU) + WTAP_MAX_PACKET_SIZE_STANDARD);
@@ -1795,7 +1795,7 @@ text_import_pre_open(wtap_dump_params * const params, int file_type_subtype, con
wtap_block_add_string_option_format(shb_hdr, OPT_SHB_USERAPPL, "%s", get_appname_and_version());
- params->shb_hdrs = g_array_new(FALSE, FALSE, sizeof(wtap_block_t));
+ params->shb_hdrs = g_array_new(false, false, sizeof(wtap_block_t));
g_array_append_val(params->shb_hdrs, shb_hdr);
}
@@ -1851,7 +1851,7 @@ text_import_pre_open(wtap_dump_params * const params, int file_type_subtype, con
}
params->idb_inf = g_new(wtapng_iface_descriptions_t,1);
- params->idb_inf->interface_data = g_array_new(FALSE, FALSE, sizeof(wtap_block_t));
+ params->idb_inf->interface_data = g_array_new(false, false, sizeof(wtap_block_t));
g_array_append_val(params->idb_inf->interface_data, int_data);
}
diff --git a/ui/text_import.h b/ui/text_import.h
index dae7db98..28c1cd2d 100644
--- a/ui/text_import.h
+++ b/ui/text_import.h
@@ -65,7 +65,7 @@ typedef struct
{
/* Input info */
// TODO: add const, as this way string constants can't be used
- // BUT: the other way clang-check complaines when you free them
+ // BUT: the other way clang-check complains when you free them
/* const */ char *import_text_filename;
char *output_filename;
enum text_import_mode mode;
@@ -73,27 +73,27 @@ typedef struct
struct {
FILE *import_text_FILE;
enum offset_type offset_type;
- gboolean has_direction;
- gboolean identify_ascii;
+ bool has_direction;
+ bool identify_ascii;
} hexdump;
struct {
GMappedFile* import_text_GMappedFile;
/* const */ GRegex* format;
enum data_encoding encoding;
- /* const */ gchar* in_indication;
- /* const */ gchar* out_indication;
+ /* const */ char* in_indication;
+ /* const */ char* out_indication;
} regex;
const char* timestamp_format;
/* Import info */
/* Wiretap encapsulation type; see wiretap/wtap.h for details */
- guint encapsulation;
+ unsigned encapsulation;
wtap_dumper* wdh;
/* Dummy header info (if encapsulation == 1) */
enum dummy_header_type dummy_header_type;
- guint pid;
- gboolean ipv6;
+ unsigned pid;
+ bool ipv6;
union {
ws_in4_addr ipv4;
ws_in6_addr ipv6;
@@ -102,18 +102,18 @@ typedef struct
ws_in4_addr ipv4;
ws_in6_addr ipv6;
} ip_dest_addr;
- guint protocol;
- guint src_port;
- guint dst_port;
- guint tag;
- guint ppi;
- /* const */ gchar* payload;
+ unsigned protocol;
+ unsigned src_port;
+ unsigned dst_port;
+ unsigned tag;
+ unsigned ppi;
+ /* const */ char* payload;
- guint max_frame_length;
+ unsigned max_frame_length;
/* Output info */
- guint num_packets_read;
- guint num_packets_written;
+ unsigned num_packets_read;
+ unsigned num_packets_written;
} text_import_info_t;
int text_import(text_import_info_t * const info);
diff --git a/ui/text_import_regex.c b/ui/text_import_regex.c
index 928957a7..e587cdb7 100644
--- a/ui/text_import_regex.c
+++ b/ui/text_import_regex.c
@@ -33,8 +33,8 @@ int text_import_regex(const text_import_info_t* info) {
// IO
GMappedFile* file = g_mapped_file_ref(info->regex.import_text_GMappedFile);
GError* gerror = NULL;
- gsize f_size = g_mapped_file_get_length(file);
- guchar* f_content = g_mapped_file_get_contents(file);
+ size_t f_size = g_mapped_file_get_length(file);
+ unsigned char* f_content = g_mapped_file_get_contents(file);
{ /* zero terminate the file */
if (f_content[f_size - 1] != '\n') {
fprintf(stderr, "Error: file did not end on \\n\n");
@@ -45,10 +45,10 @@ int text_import_regex(const text_import_info_t* info) {
}
// Regex result dissecting
- gboolean re_time, re_dir, re_seqno;
+ bool re_time, re_dir, re_seqno;
GMatchInfo* match;
- gint field_start;
- gint field_end;
+ int field_start;
+ int field_end;
{ /* analyze regex */
re_time = g_regex_get_string_number(info->regex.format, "time") >= 0;
re_dir = g_regex_get_string_number(info->regex.format, "dir") >= 0;
diff --git a/ui/text_import_regex.h b/ui/text_import_regex.h
index 93307c18..e54309fb 100644
--- a/ui/text_import_regex.h
+++ b/ui/text_import_regex.h
@@ -25,13 +25,13 @@
extern "C" {
#endif /* __cplusplus */
-void parse_data(guchar* start_field, guchar* end_field, enum data_encoding encoding);
+void parse_data(unsigned char* start_field, unsigned char* end_field, enum data_encoding encoding);
-void parse_dir(const guchar* start_field, const guchar* end_field, const gchar* in_indicator, const gchar* out_indicator);
+void parse_dir(const unsigned char* start_field, const unsigned char* end_field, const char* in_indicator, const char* out_indicator);
-void parse_time(const guchar* start_field, const guchar* end_field, const gchar* _format);
+void parse_time(const unsigned char* start_field, const unsigned char* end_field, const char* _format);
-void parse_seqno(const guchar* start_field, const guchar* end_field);
+void parse_seqno(const unsigned char* start_field, const unsigned char* end_field);
void flush_packet(void);
diff --git a/ui/time_shift.c b/ui/time_shift.c
index e54aa21d..095e3690 100644
--- a/ui/time_shift.c
+++ b/ui/time_shift.c
@@ -115,9 +115,9 @@ calcNT3(nstime_t *OT1, nstime_t *OT3, nstime_t *NT1, nstime_t *NT3,
nstime_add(NT3, NT1);
}
-const gchar *
-time_string_parse(const gchar *time_text, int *year, int *month, int *day, gboolean *negative, int *hour, int *minute, long double *second) {
- const gchar *pts = time_text;
+const char *
+time_string_parse(const char *time_text, int *year, int *month, int *day, bool *negative, int *hour, int *minute, long double *second) {
+ const char *pts = time_text;
if (!time_text || !hour || !minute || !second)
return "Unable to convert time.";
@@ -181,9 +181,9 @@ time_string_parse(const gchar *time_text, int *year, int *month, int *day, gbool
*/
/* check for minus sign */
- *negative = FALSE;
+ *negative = false;
if (pts[0] == '-') {
- *negative = TRUE;
+ *negative = true;
pts++;
}
@@ -213,14 +213,14 @@ time_string_parse(const gchar *time_text, int *year, int *month, int *day, gbool
return NULL;
}
-static const gchar *
-time_string_to_nstime(const gchar *time_text, nstime_t *packettime, nstime_t *nstime)
+static const char *
+time_string_to_nstime(const char *time_text, nstime_t *packettime, nstime_t *nstime)
{
int h, m, Y, M, D;
long double f;
struct tm tm, *tmptm;
time_t tt;
- const gchar *err_str;
+ const char *err_str;
if ((err_str = time_string_parse(time_text, &Y, &M, &D, NULL, &h, &m, &f)) != NULL)
return err_str;
@@ -253,17 +253,17 @@ time_string_to_nstime(const gchar *time_text, nstime_t *packettime, nstime_t *ns
return NULL;
}
-const gchar *
-time_shift_all(capture_file *cf, const gchar *offset_text)
+const char *
+time_shift_all(capture_file *cf, const char *offset_text)
{
nstime_t offset;
long double offset_float = 0;
- guint32 i;
+ uint32_t i;
frame_data *fd;
- gboolean neg;
+ bool neg;
int h, m;
long double f;
- const gchar *err_str;
+ const char *err_str;
if (!cf || !offset_text)
return "Nothing to work with.";
@@ -289,19 +289,19 @@ time_shift_all(capture_file *cf, const gchar *offset_text)
continue; /* Shouldn't happen */
modify_time_perform(fd, neg ? SHIFT_NEG : SHIFT_POS, &offset, SHIFT_KEEPOFFSET);
}
- cf->unsaved_changes = TRUE;
+ cf->unsaved_changes = true;
packet_list_queue_draw();
return NULL;
}
-const gchar *
-time_shift_settime(capture_file *cf, guint packet_num, const gchar *time_text)
+const char *
+time_shift_settime(capture_file *cf, unsigned packet_num, const char *time_text)
{
nstime_t set_time, diff_time, packet_time;
frame_data *fd, *packetfd;
- guint32 i;
- const gchar *err_str;
+ uint32_t i;
+ const char *err_str;
if (!cf || !time_text)
return "Nothing to work with.";
@@ -335,19 +335,19 @@ time_shift_settime(capture_file *cf, guint packet_num, const gchar *time_text)
modify_time_perform(fd, SHIFT_POS, &diff_time, SHIFT_SETTOZERO);
}
- cf->unsaved_changes = TRUE;
+ cf->unsaved_changes = true;
packet_list_queue_draw();
return NULL;
}
-const gchar *
-time_shift_adjtime(capture_file *cf, guint packet1_num, const gchar *time1_text, guint packet2_num, const gchar *time2_text)
+const char *
+time_shift_adjtime(capture_file *cf, unsigned packet1_num, const char *time1_text, unsigned packet2_num, const char *time2_text)
{
nstime_t nt1, nt2, ot1, ot2, nt3;
nstime_t dnt, dot, d3t;
frame_data *fd, *packet1fd, *packet2fd;
- guint32 i;
- const gchar *err_str;
+ uint32_t i;
+ const char *err_str;
if (!cf || !time1_text || !time2_text)
return "Nothing to work with.";
@@ -419,15 +419,15 @@ time_shift_adjtime(capture_file *cf, guint packet1_num, const gchar *time1_text,
modify_time_perform(fd, SHIFT_POS, &d3t, SHIFT_SETTOZERO);
}
- cf->unsaved_changes = TRUE;
+ cf->unsaved_changes = true;
packet_list_queue_draw();
return NULL;
}
-const gchar *
+const char *
time_shift_undo(capture_file *cf)
{
- guint32 i;
+ uint32_t i;
frame_data *fd;
nstime_t nulltime;
diff --git a/ui/time_shift.h b/ui/time_shift.h
index 89dd6619..e2dfb84a 100644
--- a/ui/time_shift.h
+++ b/ui/time_shift.h
@@ -42,7 +42,7 @@ extern "C" {
* @return NULL on success or an error description on failure.
*/
-const gchar * time_string_parse(const gchar *time_text, int *year, int *month, int *day, gboolean *negative, int *hour, int *minute, long double *second);
+const char * time_string_parse(const char *time_text, int *year, int *month, int *day, bool *negative, int *hour, int *minute, long double *second);
/** Shift all packets by an offset
*
@@ -51,7 +51,7 @@ const gchar * time_string_parse(const gchar *time_text, int *year, int *month, i
*
* @return NULL on success or an error description on failure.
*/
-const gchar * time_shift_all(capture_file *cf, const gchar *offset_text);
+const char * time_shift_all(capture_file *cf, const char *offset_text);
/* Set the time for a single packet
*
@@ -61,7 +61,7 @@ const gchar * time_shift_all(capture_file *cf, const gchar *offset_text);
*
* @return NULL on success or an error description on failure.
*/
-const gchar * time_shift_settime(capture_file *cf, guint packet_num, const gchar *time_text);
+const char * time_shift_settime(capture_file *cf, unsigned packet_num, const char *time_text);
/* Set the time for two packets and extrapolate the rest
*
@@ -73,7 +73,7 @@ const gchar * time_shift_settime(capture_file *cf, guint packet_num, const gchar
*
* @return NULL on success or an error description on failure.
*/
-const gchar * time_shift_adjtime(capture_file *cf, guint packet1_num, const gchar *time1_text, guint packet2_num, const gchar *time2_text);
+const char * time_shift_adjtime(capture_file *cf, unsigned packet1_num, const char *time1_text, unsigned packet2_num, const char *time2_text);
/* Reset the times for all packets
*
@@ -81,7 +81,7 @@ const gchar * time_shift_adjtime(capture_file *cf, guint packet1_num, const gcha
*
* @return NULL on success or an error description on failure.
*/
-const gchar * time_shift_undo(capture_file *cf);
+const char * time_shift_undo(capture_file *cf);
#ifdef __cplusplus
}
diff --git a/ui/urls.h b/ui/urls.h
index f1a6adcc..32ed7cb6 100644
--- a/ui/urls.h
+++ b/ui/urls.h
@@ -15,7 +15,7 @@
#define WS_DOCS_URL "https://www.wireshark.org/docs/"
#define WS_FAQ_URL "https://www.wireshark.org/faq.html"
#define WS_Q_AND_A_URL "https://ask.wireshark.org"
-#define WS_WIKI_HOME_URL "https://gitlab.com/wireshark/wireshark/-/wikis"
+#define WS_WIKI_HOME_URL "https://wiki.wireshark.org"
/*
* Construct a wiki URL given the path to the wiki page.
diff --git a/ui/util.c b/ui/util.c
index 77576da0..d8703319 100644
--- a/ui/util.c
+++ b/ui/util.c
@@ -25,6 +25,7 @@
#include "epan/address.h"
#include "epan/addr_resolv.h"
+#include "epan/prefs.h"
#include "epan/strutil.h"
#include <wsutil/filesystem.h>
@@ -79,8 +80,8 @@ get_args_as_string(int argc, char **argv, int optindex)
/* Compute the difference between two seconds/microseconds time stamps. */
void
-compute_timestamp_diff(gint *diffsec, gint *diffusec,
- guint32 sec1, guint32 usec1, guint32 sec2, guint32 usec2)
+compute_timestamp_diff(int *diffsec, int *diffusec,
+ uint32_t sec1, uint32_t usec1, uint32_t sec2, uint32_t usec2)
{
if (sec1 == sec2) {
/* The seconds part of the first time is the same as the seconds
@@ -123,8 +124,8 @@ compute_timestamp_diff(gint *diffsec, gint *diffusec,
/* Remove any %<interface_name> from an IP address. */
static char *sanitize_filter_ip(char *hostname) {
- gchar *end;
- gchar *ret;
+ char *end;
+ char *ret;
ret = g_strdup(hostname);
if (!ret)
@@ -147,9 +148,9 @@ static char *sanitize_filter_ip(char *hostname) {
SESSIONNAME (terminal server): <remote name>
*/
-const gchar *get_conn_cfilter(void) {
+const char *get_conn_cfilter(void) {
static GString *filter_str = NULL;
- gchar *env, **tokens;
+ char *env, **tokens;
char *lastp, *lastc, *p;
char *pprotocol = NULL;
char *phostname = NULL;
@@ -330,10 +331,10 @@ const gchar *get_conn_cfilter(void) {
return filter_str->str;
}
-gboolean display_is_remote(void)
+bool display_is_remote(void)
{
- static gboolean remote_display_checked;
- static gboolean is_remote;
+ static bool remote_display_checked;
+ static bool is_remote;
if (!remote_display_checked) {
is_remote = (strlen(get_conn_cfilter()) > 0);
@@ -342,7 +343,7 @@ gboolean display_is_remote(void)
}
// MUST be UTF-8
-static char *last_open_dir = NULL;
+static char *last_open_dir;
const char *
get_last_open_dir(void)
@@ -354,7 +355,7 @@ void
set_last_open_dir(const char *dirname)
{
size_t len;
- gchar *new_last_open_dir;
+ char *new_last_open_dir;
if (dirname && dirname[0]) {
len = strlen(dirname);
@@ -377,14 +378,41 @@ const char *
get_open_dialog_initial_dir(void)
{
const char *initial_dir;
- /*
- * If we have a "last directory in which a file was opened", use
- * that.
- *
- * If not, use the user's personal data file directory.
- */
- initial_dir = get_last_open_dir();
- if (initial_dir == NULL)
- initial_dir = get_persdatafile_dir();
+
+ switch (prefs.gui_fileopen_style) {
+
+ case FO_STYLE_LAST_OPENED:
+ /* The user has specified that we should start out in the last directory
+ we looked in.
+
+ If we have a "last directory in which a file was opened", use that.
+
+ If not, use the user's personal data file directory. */
+ /* This is now the default behaviour in file_selection_new() */
+ initial_dir = get_last_open_dir();
+ if (initial_dir == NULL)
+ initial_dir = get_persdatafile_dir();
+ break;
+
+ case FO_STYLE_SPECIFIED:
+ /* The user has specified that we should always start out in a
+ specified directory; if they've specified that directory,
+ start out by showing the files in that dir, otherwise use
+ the user's personal data file directory. */
+ if (prefs.gui_fileopen_dir[0] != '\0')
+ initial_dir = prefs.gui_fileopen_dir;
+ else
+ initial_dir = get_persdatafile_dir();
+ break;
+
+ case FO_STYLE_CWD:
+ initial_dir = get_current_working_dir();
+ break;
+
+ default:
+ ws_assert_not_reached();
+ initial_dir = NULL;
+ break;
+ }
return initial_dir;
}
diff --git a/ui/util.h b/ui/util.h
index 36f29f2d..8cf18c2b 100644
--- a/ui/util.h
+++ b/ui/util.h
@@ -12,6 +12,8 @@
#ifndef __UTIL_H__
#define __UTIL_H__
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -24,8 +26,8 @@ char *get_args_as_string(int argc, char **argv, int optindex);
/* Compute the difference between two seconds/microseconds time stamps.
* Beware: we're using nanosecond resolution now and function is currently unused
*/
-void compute_timestamp_diff(gint *diffsec, gint *diffusec,
- guint32 sec1, guint32 usec1, guint32 sec2, guint32 usec2);
+void compute_timestamp_diff(int *diffsec, int *diffusec,
+ uint32_t sec1, uint32_t usec1, uint32_t sec2, uint32_t usec2);
/* Try to figure out if we're remotely connected, e.g. via ssh or
Terminal Server, and create a capture filter that matches aspects of the
@@ -40,9 +42,9 @@ void compute_timestamp_diff(gint *diffsec, gint *diffusec,
const char *get_conn_cfilter(void);
/** Check if we're running on a remote connection.
- * @return TRUE if we're running remotely, FALSE if local.
+ * @return true if we're running remotely, false if local.
*/
-gboolean display_is_remote(void);
+bool display_is_remote(void);
/** Get the latest directory in which a file has been opened.
*
diff --git a/ui/voip_calls.c b/ui/voip_calls.c
index e6175e04..2e6b5604 100644
--- a/ui/voip_calls.c
+++ b/ui/voip_calls.c
@@ -152,15 +152,15 @@ tap_id_to_base(void* tap_id, int offset) {
}
typedef struct {
- gchar *frame_label;
- gchar *comment;
+ char *frame_label;
+ char *comment;
} graph_str;
#define H245_MAX 6
typedef struct _h245_labels {
- guint32 frame_num;
- gint8 labels_count;
+ uint32_t frame_num;
+ int8_t labels_count;
graph_str labels[H245_MAX];
} h245_labels_t;
@@ -331,10 +331,10 @@ voip_calls_free_callsinfo(voip_calls_info_t *callsinfo)
/****************************************************************************/
/* Add a new item into the graph */
static void
-add_to_graph(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const gchar *frame_label, const gchar *comment, guint16 call_num, address *src_addr, address *dst_addr, guint16 line_style)
+add_to_graph(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const char *frame_label, const char *comment, uint16_t call_num, address *src_addr, address *dst_addr, uint16_t line_style)
{
seq_analysis_item_t *gai;
- gchar time_str[COL_MAX_LEN];
+ char time_str[COL_MAX_LEN];
if (!tapinfo->graph_analysis) {
return;
@@ -362,7 +362,7 @@ add_to_graph(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *
gai->line_style=line_style;
set_fd_time(edt->session, pinfo->fd, time_str);
gai->time_str = g_strdup(time_str);
- gai->display=FALSE;
+ gai->display=false;
g_queue_push_tail(tapinfo->graph_analysis->items, gai);
g_hash_table_insert(tapinfo->graph_analysis->ht, GUINT_TO_POINTER(gai->frame_number), gai);
@@ -371,11 +371,11 @@ add_to_graph(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *
/****************************************************************************/
/* Append str to frame_label and comment in a graph item */
/* return 0 if the frame_num is not in the graph list */
-static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
+static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo, uint32_t frame_num, const char *new_frame_label, const char *new_comment)
{
seq_analysis_item_t *gai=NULL;
- gchar *frame_label = NULL;
- gchar *comment = NULL;
+ char *frame_label = NULL;
+ char *comment = NULL;
if(tapinfo->graph_analysis && NULL!=tapinfo->graph_analysis->ht)
gai=(seq_analysis_item_t *)g_hash_table_lookup(tapinfo->graph_analysis->ht, GUINT_TO_POINTER(frame_num));
@@ -400,11 +400,11 @@ static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_nu
/****************************************************************************/
/* Change the frame_label and comment in a graph item if not NULL*/
/* return 0 if the frame_num is not in the graph list */
-static int change_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
+static int change_frame_graph(voip_calls_tapinfo_t *tapinfo, uint32_t frame_num, const char *new_frame_label, const char *new_comment)
{
seq_analysis_item_t *gai=NULL;
- gchar *frame_label = NULL;
- gchar *comment = NULL;
+ char *frame_label = NULL;
+ char *comment = NULL;
if(tapinfo->graph_analysis && NULL!=tapinfo->graph_analysis->ht)
gai=(seq_analysis_item_t *)g_hash_table_lookup(tapinfo->graph_analysis->ht, GUINT_TO_POINTER(frame_num));
@@ -428,11 +428,11 @@ static int change_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num,
/****************************************************************************/
/* Change all the graph items with call_num to new_call_num */
-static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo, guint16 call_num, guint16 new_call_num)
+static unsigned change_call_num_graph(voip_calls_tapinfo_t *tapinfo, uint16_t call_num, uint16_t new_call_num)
{
seq_analysis_item_t *gai;
GList *list;
- guint items_changed;
+ unsigned items_changed;
items_changed = 0;
if(tapinfo->graph_analysis){
@@ -452,12 +452,12 @@ static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo, guint16 call_n
/****************************************************************************/
/* Insert the item in the graph list */
-static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const gchar *frame_label, const gchar *comment, guint16 call_num, address *src_addr, address *dst_addr, guint16 line_style, guint32 frame_num)
+static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const char *frame_label, const char *comment, uint16_t call_num, address *src_addr, address *dst_addr, uint16_t line_style, uint32_t frame_num)
{
seq_analysis_item_t *gai, *new_gai;
GList *list;
- gboolean inserted;
- gchar time_str[COL_MAX_LEN];
+ bool inserted;
+ char time_str[COL_MAX_LEN];
if (!tapinfo->graph_analysis){
/* Nothing to do */
@@ -484,9 +484,9 @@ static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo, packet_info *pinf
new_gai->line_style=line_style;
set_fd_time(edt->session, pinfo->fd, time_str);
new_gai->time_str = g_strdup(time_str);
- new_gai->display=FALSE;
+ new_gai->display=false;
- inserted = FALSE;
+ inserted = false;
list = g_queue_peek_nth_link(tapinfo->graph_analysis->items, 0);
while (list)
@@ -495,7 +495,7 @@ static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo, packet_info *pinf
if (gai->frame_number > frame_num) {
g_queue_insert_before(tapinfo->graph_analysis->items, list, new_gai);
g_hash_table_insert(tapinfo->graph_analysis->ht, GUINT_TO_POINTER(new_gai->frame_number), new_gai);
- inserted = TRUE;
+ inserted = true;
break;
}
list = g_list_next(list);
@@ -512,7 +512,7 @@ static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo, packet_info *pinf
/* ***************************TAP for RTP Events*****************************/
/****************************************************************************/
-/*static guint32 rtp_evt_setup_frame_num = 0;*/
+/*static uint32_t rtp_evt_setup_frame_num = 0;*/
/****************************************************************************/
/* whenever a rtp event packet is seen by the tap listener */
@@ -636,11 +636,11 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c
{
tmp_listinfo=(rtpstream_info_t *)list->data;
if ( (tmp_listinfo->setup_frame_number == rtp_info->info_setup_frame_num)
- && (tmp_listinfo->id.ssrc == rtp_info->info_sync_src) && (tmp_listinfo->end_stream == FALSE)) {
+ && (tmp_listinfo->id.ssrc == rtp_info->info_sync_src) && (tmp_listinfo->end_stream == false)) {
/* if the payload type has changed, we mark the stream as finished to create a new one
this is to show multiple payload changes in the Graph for example for DTMF RFC2833 */
if ( tmp_listinfo->first_payload_type != rtp_info->info_payload_type ) {
- tmp_listinfo->end_stream = TRUE;
+ tmp_listinfo->end_stream = true;
} else if ( ( ( tmp_listinfo->ed137_info == NULL ) && (rtp_info->info_ed137_info != NULL) ) ||
( ( tmp_listinfo->ed137_info != NULL ) && (rtp_info->info_ed137_info == NULL) ) ||
( ( tmp_listinfo->ed137_info != NULL ) && (rtp_info->info_ed137_info != NULL) &&
@@ -648,7 +648,7 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c
)
) {
/* if ed137_info has changed, create new stream */
- tmp_listinfo->end_stream = TRUE;
+ tmp_listinfo->end_stream = true;
} else {
strinfo = (rtpstream_info_t*)(list->data);
break;
@@ -658,14 +658,14 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c
}
/* if this is a duplicated RTP Event End, just return */
- if ((tapinfo->rtp_evt_frame_num == pinfo->num) && !strinfo && (tapinfo->rtp_evt_end == TRUE)) {
+ if ((tapinfo->rtp_evt_frame_num == pinfo->num) && !strinfo && (tapinfo->rtp_evt_end == true)) {
return TAP_PACKET_DONT_REDRAW;
}
/* not in the list? then create a new entry */
if (strinfo==NULL) {
strinfo = rtpstream_info_malloc_and_init();
- rtpstream_id_copy_pinfo(pinfo,&(strinfo->id),FALSE);
+ rtpstream_id_copy_pinfo(pinfo,&(strinfo->id),false);
strinfo->id.ssrc = rtp_info->info_sync_src;
strinfo->first_payload_type = rtp_info->info_payload_type;
strinfo->is_srtp = rtp_info->info_is_srtp;
@@ -674,7 +674,7 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c
/* Use existing packet info if available */
p_packet_data = (struct _rtp_packet_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_get_id_by_filter_name("rtp"), RTP_CONVERSATION_PROTO_DATA);
if (p_packet_data && p_packet_data->rtp_dyn_payload) {
- const gchar *encoding_name = rtp_dyn_payload_get_name(p_packet_data->rtp_dyn_payload, strinfo->first_payload_type);
+ const char *encoding_name = rtp_dyn_payload_get_name(p_packet_data->rtp_dyn_payload, strinfo->first_payload_type);
if (encoding_name) {
strinfo->first_payload_type_name = encoding_name;
}
@@ -705,8 +705,8 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c
/* process RTP Event */
if (tapinfo->rtp_evt_frame_num == pinfo->num) {
strinfo->rtp_event = tapinfo->rtp_evt;
- if (tapinfo->rtp_evt_end == TRUE) {
- strinfo->end_stream = TRUE;
+ if (tapinfo->rtp_evt_end == true) {
+ strinfo->end_stream = true;
}
}
@@ -726,9 +726,9 @@ rtp_draw(void *tap_offset_ptr)
/* GList *voip_calls_graph_list; */
seq_analysis_item_t *gai = NULL;
seq_analysis_item_t *new_gai;
- guint16 conv_num;
- gdouble duration;
- gchar time_str[COL_MAX_LEN];
+ uint16_t conv_num;
+ double duration;
+ char time_str[COL_MAX_LEN];
/* add each rtp stream to the graph */
rtpstreams_list = g_list_first(tapinfo->rtpstream_list);
@@ -749,7 +749,7 @@ rtp_draw(void *tap_offset_ptr)
/* if RTP was already in the Graph, just update the comment information */
gai = (seq_analysis_item_t *)g_hash_table_lookup(tapinfo->graph_analysis->ht, GUINT_TO_POINTER(rtp_listinfo->start_fd->num));
if (gai != NULL) {
- duration = (gdouble)(nstime_to_msec(&rtp_listinfo->stop_rel_time) - nstime_to_msec(&rtp_listinfo->start_rel_time));
+ duration = (double)(nstime_to_msec(&rtp_listinfo->stop_rel_time) - nstime_to_msec(&rtp_listinfo->start_rel_time));
g_free(gai->comment);
gai->comment = ws_strdup_printf(comment_fmt,
(rtp_listinfo->is_srtp)?"SRTP":"RTP", rtp_listinfo->packet_count,
@@ -761,7 +761,7 @@ rtp_draw(void *tap_offset_ptr)
copy_address(&(new_gai->dst_addr),&(rtp_listinfo->id.dst_addr));
new_gai->port_src = rtp_listinfo->id.src_port;
new_gai->port_dst = rtp_listinfo->id.dst_port;
- duration = (gdouble)(nstime_to_msec(&rtp_listinfo->stop_rel_time) - nstime_to_msec(&rtp_listinfo->start_rel_time));
+ duration = (double)(nstime_to_msec(&rtp_listinfo->stop_rel_time) - nstime_to_msec(&rtp_listinfo->start_rel_time));
new_gai->frame_label = ws_strdup_printf("%s (%s) %s%s%s",
(rtp_listinfo->is_srtp)?"SRTP":"RTP",
rtp_listinfo->first_payload_type_name,
@@ -787,7 +787,7 @@ rtp_draw(void *tap_offset_ptr)
new_gai->conv_num = conv_num;
set_fd_time(tapinfo->session, rtp_listinfo->start_fd, time_str);
new_gai->time_str = g_strdup(time_str);
- new_gai->display=FALSE;
+ new_gai->display=false;
new_gai->line_style = 2; /* the arrow line will be 2 pixels width */
g_queue_push_tail(tapinfo->graph_analysis->items, new_gai);
g_hash_table_insert(tapinfo->graph_analysis->ht, GUINT_TO_POINTER(rtp_listinfo->start_fd->num), new_gai);
@@ -810,12 +810,12 @@ rtp_packet_draw(void *tap_offset_ptr)
GList *rtpstreams_list;
rtpstream_info_t *rtp_listinfo;
GList *voip_calls_graph_list;
- guint item;
+ unsigned item;
seq_analysis_item_t *gai;
seq_analysis_item_t *new_gai;
- guint16 conv_num;
- guint32 duration;
- gchar time_str[COL_MAX_LEN];
+ uint16_t conv_num;
+ uint32_t duration;
+ char time_str[COL_MAX_LEN];
/* add each rtp stream to the graph */
rtpstreams_list = g_list_first(tapinfo->stream_list);
@@ -838,7 +838,7 @@ rtp_packet_draw(void *tap_offset_ptr)
gai = voip_calls_graph_list->data;
/* if RTP was already in the Graph, just update the comment information */
if (rtp_listinfo->start_fd->num == gai->frame_number) {
- duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts));
+ duration = (uint32_t)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts));
g_free(gai->comment);
gai->comment = ws_strdup_printf("%s Num packets:%u Duration:%u.%03us SSRC:0x%X",
(rtp_listinfo->is_srtp)?"SRTP":"RTP", rtp_listinfo->npackets,
@@ -859,7 +859,7 @@ rtp_packet_draw(void *tap_offset_ptr)
new_gai->port_src = rtp_listinfo->id.src_port;
new_gai->port_dst = rtp_listinfo->id.dst_port;
new_gai->protocol = g_strdup(port_type_to_str(pinfo->ptype));
- duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts));
+ duration = (uint32_t)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts));
new_gai->frame_label = ws_strdup_printf("%s (%s) %s",
(rtp_listinfo->is_srtp)?"SRTP":"RTP",
rtp_listinfo->first_payload_type_str,
@@ -871,7 +871,7 @@ rtp_packet_draw(void *tap_offset_ptr)
new_gai->conv_num = conv_num;
set_fd_time(cfile.epan, rtp_listinfo->start_fd, time_str);
new_gai->time_str = g_strdup(time_str);
- new_gai->display=FALSE;
+ new_gai->display=false;
new_gai->line_style = 2; /* the arrow line will be 2 pixels width */
tapinfo->graph_analysis->list = g_list_insert(tapinfo->graph_analysis->list, new_gai, item);
break;
@@ -929,12 +929,12 @@ t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const
voip_calls_info_t *tmp_listinfo;
GList *voip_calls_graph_list = NULL;
GList *list;
- gchar *frame_label = NULL;
- gchar *comment = NULL;
+ char *frame_label = NULL;
+ char *comment = NULL;
seq_analysis_item_t *tmp_gai, *gai = NULL;
- gchar *tmp_str1, *tmp_str2;
- guint16 line_style = 2;
- gdouble duration;
+ char *tmp_str1, *tmp_str2;
+ uint16_t line_style = 2;
+ double duration;
int conv_num = -1;
const t38_packet_info *t38_info = (const t38_packet_info *)t38_info_ptr;
@@ -1059,7 +1059,7 @@ t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const
comment = ws_strdup_printf(comment_fmt,
tmp_str1, duration, t38_info->desc_comment );
insert_to_graph_t38(tapinfo, pinfo, edt, frame_label, comment,
- (guint16)conv_num, &(pinfo->src), &(pinfo->dst),
+ (uint16_t)conv_num, &(pinfo->src), &(pinfo->dst),
line_style, t38_info->frame_num_first_t4_data);
g_free(comment_fmt);
wmem_free(NULL, tmp_str1);
@@ -1068,7 +1068,7 @@ t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const
}
if (frame_label && !(t38_info->Data_Field_field_type_value == 7 && t38_info->type_msg == 1)) {
- add_to_graph(tapinfo, pinfo, edt, frame_label, comment, (guint16)conv_num, &(pinfo->src), &(pinfo->dst), line_style);
+ add_to_graph(tapinfo, pinfo, edt, frame_label, comment, (uint16_t)conv_num, &(pinfo->src), &(pinfo->dst), line_style);
}
g_free(comment);
@@ -1124,7 +1124,7 @@ remove_tap_listener_t38(voip_calls_tapinfo_t *tap_id_base)
/****************************************************************************/
static void
-free_sip_info(gpointer p) {
+free_sip_info(void *p) {
sip_calls_info_t *si = (sip_calls_info_t *)p;
g_free(si->call_identifier);
@@ -1143,10 +1143,10 @@ sip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt ,
voip_calls_info_t *callsinfo = NULL;
sip_calls_info_t *tmp_sipinfo = NULL;
address tmp_src, tmp_dst;
- gchar *frame_label = NULL;
- gchar *comment = NULL;
- gchar *old_comment = NULL;
- gchar *key = NULL;
+ char *frame_label = NULL;
+ char *comment = NULL;
+ char *old_comment = NULL;
+ char *key = NULL;
const sip_info_value_t *pi = (const sip_info_value_t *)SIPinfo;
@@ -1367,12 +1367,12 @@ isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
voip_calls_info_t *tmp_listinfo;
voip_calls_info_t *callsinfo = NULL;
isup_calls_info_t *tmp_isupinfo;
- gboolean found = FALSE;
- gboolean forward = FALSE;
- gboolean right_pair;
+ bool found = false;
+ bool forward = false;
+ bool right_pair;
GList *list;
- gchar *frame_label = NULL;
- gchar *comment = NULL;
+ char *frame_label = NULL;
+ char *comment = NULL;
const isup_tap_rec_t *pi = (const isup_tap_rec_t *)isup_info;
@@ -1389,26 +1389,26 @@ isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
list = g_queue_peek_nth_link(tapinfo->callsinfos, 0);
while (list)
{
- right_pair = TRUE;
+ right_pair = true;
tmp_listinfo=(voip_calls_info_t *)list->data;
if ((tmp_listinfo->protocol == VOIP_ISUP)&&(tmp_listinfo->call_active_state==VOIP_ACTIVE)) {
tmp_isupinfo = (isup_calls_info_t *)tmp_listinfo->prot_info;
if ((tmp_isupinfo->cic == pi->circuit_id)&&(tmp_isupinfo->ni == tapinfo->mtp3_ni)) {
if ((tmp_isupinfo->opc == tapinfo->mtp3_opc)&&(tmp_isupinfo->dpc == tapinfo->mtp3_dpc)) {
- forward = TRUE;
+ forward = true;
} else if ((tmp_isupinfo->dpc == tapinfo->mtp3_opc)&&(tmp_isupinfo->opc == tapinfo->mtp3_dpc)) {
- forward = FALSE;
+ forward = false;
} else {
- right_pair = FALSE;
+ right_pair = false;
}
if (right_pair) {
/* if there is an IAM for a call that is not in setup state, that means the previous call in the same
cic is no longer active */
if (tmp_listinfo->call_state == VOIP_CALL_SETUP) {
- found = TRUE;
+ found = true;
} else if (pi->message_type != 1) {
- found = TRUE;
+ found = true;
} else {
tmp_listinfo->call_active_state=VOIP_INACTIVE;
}
@@ -1663,7 +1663,7 @@ remove_tap_listener_mtp3_calls(voip_calls_tapinfo_t *tap_id_base)
/****************************************************************************/
/* ***************************TAP for Q931 **********************************/
/****************************************************************************/
-static void h245_add_to_graph(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num);
+static void h245_add_to_graph(voip_calls_tapinfo_t *tapinfo, uint32_t new_frame_num);
static const e_guid_t guid_allzero = {0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };
/* defines specific H323 data */
@@ -1679,7 +1679,7 @@ q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
voip_calls_info_t *tmp_listinfo;
voip_calls_info_t *callsinfo = NULL;
h245_address_t *h245_add = NULL;
- gchar *comment, *tmp_str;
+ char *comment, *tmp_str;
const q931_packet_info *pi = (const q931_packet_info *)q931_info;
@@ -1782,8 +1782,8 @@ q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
list = g_list_next (list);
}
- comment = ws_strdup_printf("H225 From: %s To:%s TunnH245:%s FS:%s", callsinfo->from_identity, callsinfo->to_identity, (tmp_h323info->is_h245Tunneling==TRUE?"on":"off"),
- (tapinfo->h225_is_faststart==TRUE?"on":"off"));
+ comment = ws_strdup_printf("H225 From: %s To:%s TunnH245:%s FS:%s", callsinfo->from_identity, callsinfo->to_identity, (tmp_h323info->is_h245Tunneling==true?"on":"off"),
+ (tapinfo->h225_is_faststart==true?"on":"off"));
} else if (tapinfo->h225_cstype == H225_RELEASE_COMPLET) {
/* get the Q931 Release cause code */
if (tapinfo->q931_cause_value != 0xFF) {
@@ -1989,7 +1989,7 @@ add_h245_Address(h323_calls_info_t *h323info, h245_address_t *h245_address)
static void
-free_h225_info(gpointer p) {
+free_h225_info(void *p) {
h323_calls_info_t *tmp_h323info = (h323_calls_info_t *)p;
/* DUMP_PTR2(tmp_h323info->guid); */
@@ -2020,8 +2020,8 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
voip_calls_info_t *tmp_listinfo;
voip_calls_info_t *callsinfo = NULL;
h323_calls_info_t *tmp_h323info = NULL;
- gchar *frame_label;
- gchar *comment;
+ char *frame_label;
+ char *comment;
GList *list;
h245_address_t *h245_add = NULL;
@@ -2100,10 +2100,10 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
clear_address(&tmp_h323info->h225SetupAddr);
tmp_h323info->h245_list = NULL;
- tmp_h323info->is_faststart_Setup = FALSE;
- tmp_h323info->is_faststart_Proc = FALSE;
- tmp_h323info->is_h245Tunneling = FALSE;
- tmp_h323info->is_h245 = FALSE;
+ tmp_h323info->is_faststart_Setup = false;
+ tmp_h323info->is_faststart_Proc = false;
+ tmp_h323info->is_h245Tunneling = false;
+ tmp_h323info->is_h245 = false;
tmp_h323info->q931_crv = -1;
tmp_h323info->q931_crv2 = -1;
tmp_h323info->requestSeqNum = 0;
@@ -2132,7 +2132,7 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
if (pi->msg_type == H225_CS) {
/* this is still IPv4 only, because the dissector is */
- if (pi->is_h245 == TRUE) {
+ if (pi->is_h245 == true) {
h245_add = g_new(h245_address_t, 1);
alloc_address_wmem(NULL, &h245_add->h245_address, AT_IPv4, 4, &pi->h245_address);
h245_add->h245_port = pi->h245_port;
@@ -2151,14 +2151,14 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
if (tmp_h323info->h225SetupAddr.type == AT_NONE)
copy_address(&(tmp_h323info->h225SetupAddr), &(pinfo->src));
callsinfo->call_state=VOIP_CALL_SETUP;
- comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==TRUE?"on":"off"),
- (pi->is_faststart==TRUE?"on":"off"));
+ comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==true?"on":"off"),
+ (pi->is_faststart==true?"on":"off"));
break;
case H225_CONNECT:
callsinfo->call_state=VOIP_IN_CALL;
- if (pi->is_faststart == TRUE) tmp_h323info->is_faststart_Proc = TRUE;
- comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==TRUE?"on":"off"),
- (pi->is_faststart==TRUE?"on":"off"));
+ if (pi->is_faststart == true) tmp_h323info->is_faststart_Proc = true;
+ comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==true?"on":"off"),
+ (pi->is_faststart==true?"on":"off"));
break;
case H225_RELEASE_COMPLET:
if (callsinfo->call_state==VOIP_CALL_SETUP) {
@@ -2178,13 +2178,13 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
case H225_PROGRESS:
case H225_ALERTING:
case H225_CALL_PROCEDING:
- if (pi->is_faststart == TRUE) tmp_h323info->is_faststart_Proc = TRUE;
- comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==TRUE?"on":"off"),
- (pi->is_faststart==TRUE?"on":"off"));
+ if (pi->is_faststart == true) tmp_h323info->is_faststart_Proc = true;
+ comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==true?"on":"off"),
+ (pi->is_faststart==true?"on":"off"));
break;
default:
- comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==TRUE?"on":"off"),
- (pi->is_faststart==TRUE?"on":"off"));
+ comment = ws_strdup_printf("H225 TunnH245:%s FS:%s", (tmp_h323info->is_h245Tunneling==true?"on":"off"),
+ (pi->is_faststart==true?"on":"off"));
}
}
@@ -2275,9 +2275,9 @@ remove_tap_listener_h225_calls(voip_calls_tapinfo_t *tap_id_base)
/* Add the h245 label info to the graph */
void
-h245_add_to_graph(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num)
+h245_add_to_graph(voip_calls_tapinfo_t *tapinfo, uint32_t new_frame_num)
{
- gint8 n;
+ int8_t n;
if (new_frame_num != tapinfo->h245_labels->frame_num) return;
@@ -2294,9 +2294,9 @@ h245_add_to_graph(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num)
/* free the h245_labels if the frame number is different */
static void
-h245_free_labels(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num)
+h245_free_labels(voip_calls_tapinfo_t *tapinfo, uint32_t new_frame_num)
{
- gint8 n;
+ int8_t n;
if (new_frame_num == tapinfo->h245_labels->frame_num) return;
@@ -2312,7 +2312,7 @@ h245_free_labels(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num)
/* add the frame_label and comment to h245_labels and free the actual one if it is different frame num */
static void
-h245_add_label(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num, const gchar *frame_label, const gchar *comment)
+h245_add_label(voip_calls_tapinfo_t *tapinfo, uint32_t new_frame_num, const char *frame_label, const char *comment)
{
h245_free_labels(tapinfo, new_frame_num);
@@ -2527,18 +2527,18 @@ remove_tap_listener_sdp_calls(voip_calls_tapinfo_t *tap_id_base)
This function will look for a signal/event in the SignalReq/ObsEvent string
and return true if it is found
*/
-static gboolean
-is_mgcp_signal(const gchar *signal_str_p, const gchar *signalStr)
+static bool
+is_mgcp_signal(const char *signal_str_p, const char *signalStr)
{
- gint i;
- gchar **resultArray;
- gboolean found = FALSE;
+ int i;
+ char **resultArray;
+ bool found = false;
/* if there is no signalStr, just return false */
- if (signalStr == NULL) return FALSE;
+ if (signalStr == NULL) return false;
/* if are both "blank" return true */
- if ( (*signal_str_p == '\0') && (*signalStr == '\0') ) return TRUE;
+ if ( (*signal_str_p == '\0') && (*signalStr == '\0') ) return true;
/* look for signal in signalStr */
resultArray = g_strsplit(signalStr, ",", 10);
@@ -2546,7 +2546,7 @@ is_mgcp_signal(const gchar *signal_str_p, const gchar *signalStr)
for (i = 0; resultArray[i]; i++) {
g_strstrip(resultArray[i]);
if (strcmp(resultArray[i], signal_str_p) == 0) {
- found = TRUE;
+ found = true;
break;
}
}
@@ -2561,9 +2561,9 @@ is_mgcp_signal(const gchar *signal_str_p, const gchar *signalStr)
This is how it looks the caller Id: rg, ci(02/16/08/29, "3035550002","Ale Sipura 2")
*/
static void
-mgcp_caller_id(gchar *signalStr, gchar **callerId)
+mgcp_caller_id(char *signalStr, char **callerId)
{
- gchar **arrayStr;
+ char **arrayStr;
/* if there is no signalStr, just return false */
if (signalStr == NULL) return;
@@ -2584,14 +2584,14 @@ mgcp_caller_id(gchar *signalStr, gchar **callerId)
This is how it looks the dialed digits 5,5,5,0,0,0,2,#,*
*/
static void
-mgcp_dialed_digits(gchar *signalStr, gchar **dialedDigits)
+mgcp_dialed_digits(char *signalStr, char **dialedDigits)
{
- gchar *tmpStr;
- gchar *resultStr;
- gint i,j;
+ char *tmpStr;
+ char *resultStr;
+ int i,j;
/* start with 1 for the null-terminator */
- guint resultStrLen = 1;
+ unsigned resultStrLen = 1;
/* if there is no signalStr, just return false */
if (signalStr == NULL) return;
@@ -2616,7 +2616,7 @@ mgcp_dialed_digits(gchar *signalStr, gchar **dialedDigits)
return;
}
- resultStr = (gchar *)g_malloc(resultStrLen);
+ resultStr = (char *)g_malloc(resultStrLen);
for (i = 0, j = 0; tmpStr[i]; i++) {
if (tmpStr[i] != '?')
@@ -2645,12 +2645,12 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
mgcp_calls_info_t *tmp_mgcpinfo = NULL;
GList *list;
GList *listGraph = NULL;
- gchar *frame_label = NULL;
- gchar *comment = NULL;
+ char *frame_label = NULL;
+ char *comment = NULL;
seq_analysis_item_t *gai = NULL;
- gboolean newcall = FALSE;
- gboolean fromEndpoint = FALSE; /* true for calls originated in Endpoints, false for calls from MGC */
- gdouble diff_time;
+ bool newcall = false;
+ bool fromEndpoint = false; /* true for calls originated in Endpoints, false for calls from MGC */
+ double diff_time;
const mgcp_info_t *pi = (const mgcp_info_t *)MGCPinfo;
@@ -2694,12 +2694,12 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
if (callsinfo == NULL) {
if ( (strcmp(pi->code, "NTFY") == 0) && is_mgcp_signal("hd", pi->observedEvents) ) { /* off hook transition */
/* this is a new call from the Endpoint */
- fromEndpoint = TRUE;
- newcall = TRUE;
+ fromEndpoint = true;
+ newcall = true;
} else if (strcmp(pi->code, "CRCX") == 0) {
/* this is a new call from the MGC */
- fromEndpoint = FALSE;
- newcall = TRUE;
+ fromEndpoint = false;
+ newcall = true;
}
if (!newcall) return TAP_PACKET_DONT_REDRAW;
}
@@ -2805,9 +2805,9 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
}
if (pi->signalReq != NULL)
- frame_label = ws_strdup_printf("%s%sSigReq:%s",pi->code, (pi->hasDigitMap == TRUE)?" DigitMap ":"", pi->signalReq);
+ frame_label = ws_strdup_printf("%s%sSigReq:%s",pi->code, (pi->hasDigitMap == true)?" DigitMap ":"", pi->signalReq);
else
- frame_label = ws_strdup_printf("%s%s",pi->code, (pi->hasDigitMap == TRUE)?" DigitMap ":"");
+ frame_label = ws_strdup_printf("%s%s",pi->code, (pi->hasDigitMap == true)?" DigitMap ":"");
/* use the CallerID info to fill the "From" for the call */
if (!tmp_mgcpinfo->fromEndpoint) mgcp_caller_id(pi->signalReq, &(callsinfo->from_identity));
@@ -2934,7 +2934,7 @@ actrace_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e
if (pi->type == 1) { /* is CAS protocol */
address pstn_add;
- gchar *comment = NULL;
+ char *comment = NULL;
callsinfo = NULL;
list = g_queue_peek_nth_link(tapinfo->callsinfos, 0);
@@ -3051,13 +3051,13 @@ remove_tap_listener_actrace_calls(voip_calls_tapinfo_t *tap_id_base)
static tap_packet_status
-h248_calls_packet_common(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info, guint32 redraw_bit) {
+h248_calls_packet_common(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info, uint32_t redraw_bit) {
const gcp_cmd_t *cmd = (const gcp_cmd_t *)prot_info;
GList *list;
voip_calls_info_t *callsinfo = NULL;
address *mgw;
address *mgc;
- gchar mgw_addr[128];
+ char mgw_addr[128];
if (cmd->ctx->id == NULL_CONTEXT || cmd->ctx->id == ALL_CONTEXTS ) {
return TAP_PACKET_DONT_REDRAW;
@@ -3245,13 +3245,13 @@ static const voip_protocol sccp_proto_map[] = {
const value_string* sccp_payload_values;
static tap_packet_status
-sccp_calls(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info, guint32 redraw_bit) {
+sccp_calls(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info, uint32_t redraw_bit) {
const sccp_msg_info_t* msg = (const sccp_msg_info_t *)prot_info;
sccp_assoc_info_t* assoc = msg->data.co.assoc;
GList *list;
voip_calls_info_t *callsinfo = NULL;
- gchar *label = NULL;
- const gchar *comment = NULL;
+ char *label = NULL;
+ const char *comment = NULL;
/* check whether we already have this assoc in the list */
for(list = g_queue_peek_nth_link(tapinfo->callsinfos, 0) ; list ; list = g_list_next (list) ) {
@@ -3447,8 +3447,8 @@ unistim_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e
unistim_info_t *tmp_unistim_info = NULL;
GList *list = NULL;
GString *g_tmp = NULL;
- const gchar *frame_label = NULL;
- gchar *comment = NULL;
+ const char *frame_label = NULL;
+ char *comment = NULL;
/* Fetch specific packet infos */
const unistim_info_t *pi = (const unistim_info_t *)unistim_info;
@@ -3981,7 +3981,7 @@ skinny_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed
address* phone;
const skinny_info_t *si = (const skinny_info_t *)skinny_info;
skinny_calls_info_t *tmp_skinnyinfo;
- gchar *comment;
+ char *comment;
/* if display filtering activated and packet do not match, ignore it */
if (tapinfo->apply_display_filter && (pinfo->fd->passed_dfilter == 0)) {
@@ -4043,7 +4043,7 @@ skinny_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed
g_free(callsinfo->to_identity);
callsinfo->to_identity = g_strdup(si->calledParty);
}
- if ((si->callState > 0) && (si->callState < (sizeof(skinny_tap_voip_state)/sizeof(skinny_tap_voip_state[0]))))
+ if ((si->callState > 0) && (si->callState < array_length(skinny_tap_voip_state)))
callsinfo->call_state = skinny_tap_voip_state[si->callState];
callsinfo->stop_fd = pinfo->fd;
@@ -4126,7 +4126,7 @@ remove_tap_listener_skinny_calls(voip_calls_tapinfo_t *tap_id_base)
/* ***************************TAP for IAX2 **********************************/
/****************************************************************************/
-static void free_iax2_info(gpointer p) {
+static void free_iax2_info(void *p) {
iax2_info_t *ii = (iax2_info_t *)p;
g_free(ii);
diff --git a/ui/voip_calls.h b/ui/voip_calls.h
index d2878b7c..c1fa3248 100644
--- a/ui/voip_calls.h
+++ b/ui/voip_calls.h
@@ -85,22 +85,22 @@ typedef enum _sip_call_state {
} sip_call_state;
typedef struct _sip_calls_info {
- gchar *call_identifier;
- guint32 invite_cseq;
+ char *call_identifier;
+ uint32_t invite_cseq;
sip_call_state sip_state;
} sip_calls_info_t;
/** defines specific ISUP data */
typedef struct _isup_calls_info {
- guint16 cic;
- guint32 opc, dpc;
- guint8 ni;
+ uint16_t cic;
+ uint32_t opc, dpc;
+ uint8_t ni;
} isup_calls_info_t;
/* defines specific H245 data */
typedef struct _h245_address {
address h245_address;
- guint16 h245_port;
+ uint16_t h245_port;
} h245_address_t;
/** defines specific H323 data */
@@ -108,53 +108,53 @@ typedef struct _h323_calls_info {
e_guid_t *guid; /* Call ID to identify a H225 */
GList* h245_list; /**< list of H245 Address and ports for tunneling off calls*/
address h225SetupAddr; /**< we use the SETUP H225 IP to determine if packets are forward or reverse */
- gboolean is_h245;
- gboolean is_faststart_Setup; /**< if faststart field is included in Setup*/
- gboolean is_faststart_Proc; /**< if faststart field is included in Proce, Alerting, Progress or Connect*/
- gboolean is_h245Tunneling;
- gint32 q931_crv;
- gint32 q931_crv2;
- guint requestSeqNum;
+ bool is_h245;
+ bool is_faststart_Setup; /**< if faststart field is included in Setup*/
+ bool is_faststart_Proc; /**< if faststart field is included in Proce, Alerting, Progress or Connect*/
+ bool is_h245Tunneling;
+ int32_t q931_crv;
+ int32_t q931_crv2;
+ unsigned requestSeqNum;
} h323_calls_info_t;
/**< defines specific MGCP data */
typedef struct _mgcp_calls_info {
- gchar *endpointId;
- gboolean fromEndpoint; /**< true if the call was originated from the Endpoint, false for calls from MGC */
+ char *endpointId;
+ bool fromEndpoint; /**< true if the call was originated from the Endpoint, false for calls from MGC */
} mgcp_calls_info_t;
/** defines specific ACTRACE ISDN data */
typedef struct _actrace_isdn_calls_info {
- gint32 crv;
+ int32_t crv;
int trunk;
} actrace_isdn_calls_info_t;
/** defines specific ACTRACE CAS data */
typedef struct _actrace_cas_calls_info {
- gint32 bchannel;
+ int32_t bchannel;
int trunk;
} actrace_cas_calls_info_t;
/** defines specific SKINNY data */
typedef struct _skinny_calls_info {
- guint32 callId;
+ uint32_t callId;
} skinny_calls_info_t;
/** defines a voip call */
typedef struct _voip_calls_info {
voip_call_state call_state;
voip_call_active_state call_active_state;
- gchar *call_id;
- gchar *from_identity;
- gchar *to_identity;
- gpointer prot_info;
- void (*free_prot_info)(gpointer);
+ char *call_id;
+ char *from_identity;
+ char *to_identity;
+ void * prot_info;
+ void (*free_prot_info)(void *);
address initial_speaker;
- guint32 npackets;
+ uint32_t npackets;
voip_protocol protocol;
- gchar *protocol_name;
- gchar *call_comment;
- guint16 call_num;
+ char *protocol_name;
+ char *call_comment;
+ uint16_t call_num;
/**> The frame_data struct holds the frame number and timing information needed. */
frame_data *start_fd;
nstime_t start_rel_ts;
@@ -187,32 +187,32 @@ typedef struct _voip_calls_tapinfo {
epan_t *session; /**< epan session */
int nrtpstreams; /**< number of rtp streams */
GList* rtpstream_list; /**< list of rtpstream_info_t */
- guint32 rtp_evt_frame_num;
- guint8 rtp_evt;
- gboolean rtp_evt_end;
- gchar *sdp_summary;
- guint32 sdp_frame_num;
- guint32 mtp3_opc;
- guint32 mtp3_dpc;
- guint8 mtp3_ni;
- guint32 mtp3_frame_num;
+ uint32_t rtp_evt_frame_num;
+ uint8_t rtp_evt;
+ bool rtp_evt_end;
+ char *sdp_summary;
+ uint32_t sdp_frame_num;
+ uint32_t mtp3_opc;
+ uint32_t mtp3_dpc;
+ uint8_t mtp3_ni;
+ uint32_t mtp3_frame_num;
struct _h245_labels *h245_labels; /**< H.245 labels */
- gchar *q931_calling_number;
- gchar *q931_called_number;
- guint8 q931_cause_value;
- gint32 q931_crv;
- guint32 q931_frame_num;
- guint32 h225_frame_num;
- guint16 h225_call_num;
+ char *q931_calling_number;
+ char *q931_called_number;
+ uint8_t q931_cause_value;
+ int32_t q931_crv;
+ uint32_t q931_frame_num;
+ uint32_t h225_frame_num;
+ uint16_t h225_call_num;
int h225_cstype; /* XXX actually an enum */
- gboolean h225_is_faststart;
- guint32 sip_frame_num;
- guint32 actrace_frame_num;
- gint32 actrace_trunk;
- gint32 actrace_direction;
+ bool h225_is_faststart;
+ uint32_t sip_frame_num;
+ uint32_t actrace_frame_num;
+ int32_t actrace_trunk;
+ int32_t actrace_direction;
flow_show_options fs_option;
- guint32 redraw;
- gboolean apply_display_filter;
+ uint32_t redraw;
+ bool apply_display_filter;
} voip_calls_tapinfo_t;
#if 0
diff --git a/ui/win32/file_dlg_win32.cpp b/ui/win32/file_dlg_win32.cpp
index 6261c915..1f613bf6 100644
--- a/ui/win32/file_dlg_win32.cpp
+++ b/ui/win32/file_dlg_win32.cpp
@@ -13,86 +13,25 @@
#include "config.h"
#include <tchar.h>
-#include <stdlib.h>
-#include <fcntl.h>
-
-#include <string>
#include <windows.h>
-#include <commdlg.h>
-#include <richedit.h>
-#include <strsafe.h>
-
-#include "file.h"
-
-#include "wsutil/file_util.h"
-#include "wsutil/str_util.h"
-#include "wsutil/unicode-utils.h"
-#include <wsutil/ws_assert.h>
-#include "wsutil/filesystem.h"
-#include "epan/prefs.h"
-
-#include "ui/alert_box.h"
-#include "ui/help_url.h"
-#include "ui/file_dialog.h"
-#include "ui/simple_dialog.h"
-#include "ui/util.h"
-#include "ui/ws_ui_util.h"
-#include "ui/all_files_wildcard.h"
+#include <ws_attributes.h>
+#include <ws_diag_control.h>
#include "file_dlg_win32.h"
-typedef enum {
- merge_append,
- merge_chrono,
- merge_prepend
-} merge_action_e;
-
-#define FILE_OPEN_DEFAULT 2 /* All Capture Files */
-
-#define FILE_MERGE_DEFAULT FILE_OPEN_DEFAULT
-
-#define FILE_TYPES_EXPORT \
- _T("Plain text (*.txt)\0") _T("*.txt\0") \
- _T("PostScript (*.ps)\0") _T("*.ps\0") \
- _T("CSV (Comma Separated Values summary) (*.csv)\0") _T("*.csv\0") \
- _T("PSML (XML packet summary) (*.psml)\0") _T("*.psml\0") \
- _T("PDML (XML packet detail) (*.pdml)\0") _T("*.pdml\0") \
- _T("C Arrays (packet bytes) (*.c)\0") _T("*.c\0") \
- _T("JSON (*.json)\0") _T("*.json\0")
-
-static const TCHAR *FILE_EXT_EXPORT[] =
-{
- _T(""), /* export type starts at 1 */
- _T("txt"),
- _T("ps"),
- _T("csv"),
- _T("psml"),
- _T("pdml"),
- _T("c"),
- _T("json")
-};
-
-static UINT_PTR CALLBACK open_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
-static UINT_PTR CALLBACK save_as_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
-static UINT_PTR CALLBACK export_specified_packets_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
-static UINT_PTR CALLBACK merge_file_hook_proc(HWND mf_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
-static UINT_PTR CALLBACK export_file_hook_proc(HWND of_hwnd, UINT ui_msg, WPARAM w_param, LPARAM l_param);
-static void range_update_dynamics(HWND sf_hwnd, packet_range_t *range);
-static void range_handle_wm_initdialog(HWND dlg_hwnd, packet_range_t *range);
-static void range_handle_wm_command(HWND dlg_hwnd, HWND ctrl, WPARAM w_param, packet_range_t *range);
-
-static TCHAR *build_file_open_type_list(void);
-static TCHAR *build_file_save_type_list(GArray *savable_file_types);
-
+/* As of Wireshark 4.2, we only support Windows 10 and later, so this
+ * should always be defined. OTOH, Qt >= 6.0 uses DPI Awareness
+ * Context Per Monitor Aware v2 by default, so maybe we should make
+ * it a no-op there. */
#ifdef DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
typedef DPI_AWARENESS_CONTEXT (WINAPI *GetThreadDpiAwarenessContextProc)(void);
typedef DPI_AWARENESS_CONTEXT (WINAPI *SetThreadDpiAwarenessContextProc)(DPI_AWARENESS_CONTEXT);
static GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContextP;
static SetThreadDpiAwarenessContextProc SetThreadDpiAwarenessContextP;
-static bool got_proc_addresses = false;
+static bool got_proc_addresses;
DIAG_OFF(cast-function-type)
static bool get_proc_addresses(void) {
@@ -139,1764 +78,4 @@ HANDLE set_thread_per_monitor_v2_awareness(void) { return 0; }
void revert_thread_per_monitor_v2_awareness(HANDLE context _U_) { }
#endif // DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
-static int g_filetype;
-static bool g_compressed;
-static packet_range_t *g_range;
-static capture_file *g_cf;
-static merge_action_e g_merge_action;
-static print_args_t print_args;
-/* XXX - The reason g_sf_hwnd exists is so that we can call
- * range_update_dynamics() from anywhere; it's currently
- * static, but if we move to using the native Windows
- * print dialog and put range widgets in it as well,
- * it might be moved to a separate file.
- *
- * However, the save file dialog hogs the foreground, so
- * this may not be necessary (and, in fact, the file dialogs
- * should arguably be modal to the window for the file
- * being opened/saved/etc.).
- */
-static HWND g_sf_hwnd = NULL;
-static char *g_dfilter_str = NULL;
-static unsigned int g_format_type = WTAP_TYPE_AUTO;
-
-/*
- * According to https://docs.microsoft.com/en-us/windows/win32/shell/common-file-dialog
- * we should use IFileOpenDialog and IFileSaveDialog on Windows Vista
- * and later.
- */
-
-bool
-win32_open_file (HWND h_wnd, const wchar_t *title, GString *file_name, unsigned int *type, GString *display_filter) {
- OPENFILENAME *ofn;
- TCHAR file_name16[MAX_PATH] = _T("");
- int ofnsize = sizeof(OPENFILENAME);
- BOOL gofn_ok;
-
- if (!file_name || !display_filter)
- return false;
-
- if (file_name->len > 0) {
- StringCchCopy(file_name16, MAX_PATH, utf_8to16(file_name->str));
- }
-
- if (display_filter->len > 0) {
- g_dfilter_str = g_strdup(display_filter->str);
- } else if (g_dfilter_str) {
- g_free(g_dfilter_str);
- g_dfilter_str = NULL;
- }
-
- ofn = new OPENFILENAME();
-
- ofn->lStructSize = ofnsize;
- ofn->hwndOwner = h_wnd;
- ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
- ofn->lpstrFilter = build_file_open_type_list();
- ofn->lpstrCustomFilter = NULL;
- ofn->nMaxCustFilter = 0;
- ofn->nFilterIndex = FILE_OPEN_DEFAULT;
- ofn->lpstrFile = file_name16;
- ofn->nMaxFile = MAX_PATH;
- ofn->lpstrFileTitle = NULL;
- ofn->nMaxFileTitle = 0;
- if (prefs.gui_fileopen_style == FO_STYLE_SPECIFIED && prefs.gui_fileopen_dir[0] != '\0') {
- ofn->lpstrInitialDir = utf_8to16(prefs.gui_fileopen_dir);
- } else {
- ofn->lpstrInitialDir = utf_8to16(get_open_dialog_initial_dir());
- }
- ofn->lpstrTitle = title;
- ofn->Flags = OFN_ENABLESIZING | OFN_ENABLETEMPLATE | OFN_EXPLORER |
- OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY |
- OFN_ENABLEHOOK | OFN_SHOWHELP;
- ofn->lpstrDefExt = NULL;
- ofn->lpfnHook = open_file_hook_proc;
- ofn->lpTemplateName = _T("WIRESHARK_OPENFILENAME_TEMPLATE");
-
- HANDLE save_da_ctx = set_thread_per_monitor_v2_awareness();
- gofn_ok = GetOpenFileName(ofn);
- revert_thread_per_monitor_v2_awareness(save_da_ctx);
-
- if (gofn_ok) {
- g_string_printf(file_name, "%s", utf_16to8(file_name16));
- g_string_printf(display_filter, "%s", g_dfilter_str ? g_dfilter_str : "");
- *type = g_format_type;
- }
-
- g_free( (void *) ofn->lpstrFilter);
- delete ofn;
- g_free(g_dfilter_str);
- g_dfilter_str = NULL;
- return gofn_ok;
-}
-
-bool
-win32_save_as_file(HWND h_wnd, const wchar_t *title, capture_file *cf, GString *file_name, int *file_type,
- wtap_compression_type *compression_type,
- bool must_support_all_comments)
-{
- uint32_t required_comment_types;
- GArray *savable_file_types;
- OPENFILENAME *ofn;
- TCHAR file_name16[MAX_PATH] = _T("");
- int ofnsize = sizeof(OPENFILENAME);
- BOOL gsfn_ok;
-
- if (!file_name || !file_type || !compression_type)
- return false;
-
- if (file_name->len > 0) {
- StringCchCopy(file_name16, MAX_PATH, utf_8to16(file_name->str));
- }
-
- /* What types of comments do we have to support? */
- if (must_support_all_comments)
- required_comment_types = cf_comment_types(cf); /* all the ones the file has */
- else
- required_comment_types = 0; /* none of them */
-
- savable_file_types = wtap_get_savable_file_types_subtypes_for_file(cf->cd_t,
- cf->linktypes,
- required_comment_types,
- FT_SORT_BY_DESCRIPTION);
- if (savable_file_types == NULL)
- return false; /* shouldn't happen - the "Save As..." item should be disabled if we can't save the file */
- g_compressed = false;
-
- ofn = new OPENFILENAME();
-
- ofn->lStructSize = ofnsize;
- ofn->hwndOwner = h_wnd;
- ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
- ofn->lpstrFilter = build_file_save_type_list(savable_file_types);
- ofn->lpstrCustomFilter = NULL;
- ofn->nMaxCustFilter = 0;
- ofn->nFilterIndex = 1; /* the first entry is the best match; 1-origin indexing */
- ofn->lpstrFile = file_name16;
- ofn->nMaxFile = MAX_PATH;
- ofn->lpstrFileTitle = NULL;
- ofn->nMaxFileTitle = 0;
- ofn->lpstrInitialDir = utf_8to16(get_open_dialog_initial_dir());
- ofn->lpstrTitle = title;
- ofn->Flags = OFN_ENABLESIZING | OFN_ENABLETEMPLATE | OFN_EXPLORER |
- OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY |
- OFN_PATHMUSTEXIST | OFN_ENABLEHOOK | OFN_SHOWHELP;
- ofn->lpstrDefExt = NULL;
- ofn->lCustData = (LPARAM) cf;
- ofn->lpfnHook = save_as_file_hook_proc;
- ofn->lpTemplateName = _T("WIRESHARK_SAVEASFILENAME_TEMPLATE");
-
- HANDLE save_da_ctx = set_thread_per_monitor_v2_awareness();
- gsfn_ok = GetSaveFileName(ofn);
- revert_thread_per_monitor_v2_awareness(save_da_ctx);
-
- if (gsfn_ok) {
- g_string_printf(file_name, "%s", utf_16to8(file_name16));
- /* What file format was specified? */
- *file_type = g_array_index(savable_file_types, int, ofn->nFilterIndex - 1);
- *compression_type = g_compressed ? WTAP_GZIP_COMPRESSED : WTAP_UNCOMPRESSED;
- } else {
- /* User cancelled or closed the dialog, or an error occurred. */
- if (CommDlgExtendedError() != 0) {
- /* XXX - pop up some error here. FNERR_INVALIDFILENAME
- * might be a user error; if so, they should know about
- * it. For now we force a do-over.
- */
- g_string_truncate(file_name, 0);
- gsfn_ok = true;
- }
- }
-
- g_sf_hwnd = NULL;
- g_array_free(savable_file_types, true);
- g_free( (void *) ofn->lpstrFilter);
- delete ofn;
- return gsfn_ok;
-}
-
-bool
-win32_export_specified_packets_file(HWND h_wnd, const wchar_t *title,
- capture_file *cf,
- GString *file_name,
- int *file_type,
- wtap_compression_type *compression_type,
- packet_range_t *range) {
- GArray *savable_file_types;
- OPENFILENAME *ofn;
- TCHAR file_name16[MAX_PATH] = _T("");
- int ofnsize = sizeof(OPENFILENAME);
- BOOL gsfn_ok;
-
- if (!file_name || !file_type || !compression_type || !range)
- return false;
-
- if (file_name->len > 0) {
- StringCchCopy(file_name16, MAX_PATH, utf_8to16(file_name->str));
- }
-
- savable_file_types = wtap_get_savable_file_types_subtypes_for_file(cf->cd_t,
- cf->linktypes, 0,
- FT_SORT_BY_DESCRIPTION);
- if (savable_file_types == NULL)
- return false; /* shouldn't happen - the "Save As..." item should be disabled if we can't save the file */
-
- g_range = range;
- g_cf = cf;
- g_compressed = false;
-
- ofn = new OPENFILENAME();
-
- ofn->lStructSize = ofnsize;
- ofn->hwndOwner = h_wnd;
- ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
- ofn->lpstrFilter = build_file_save_type_list(savable_file_types);
- ofn->lpstrCustomFilter = NULL;
- ofn->nMaxCustFilter = 0;
- ofn->nFilterIndex = 1; /* the first entry is the best match; 1-origin indexing */
- ofn->lpstrFile = file_name16;
- ofn->nMaxFile = MAX_PATH;
- ofn->lpstrFileTitle = NULL;
- ofn->nMaxFileTitle = 0;
- ofn->lpstrInitialDir = utf_8to16(get_open_dialog_initial_dir());
- ofn->lpstrTitle = title;
- ofn->Flags = OFN_ENABLESIZING | OFN_ENABLETEMPLATE | OFN_EXPLORER |
- OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY |
- OFN_PATHMUSTEXIST | OFN_ENABLEHOOK | OFN_SHOWHELP;
- ofn->lpstrDefExt = NULL;
- ofn->lCustData = (LPARAM) cf;
- ofn->lpfnHook = export_specified_packets_file_hook_proc;
- ofn->lpTemplateName = _T("WIRESHARK_EXPORT_SPECIFIED_PACKETS_FILENAME_TEMPLATE");
-
- HANDLE save_da_ctx = set_thread_per_monitor_v2_awareness();
- gsfn_ok = GetSaveFileName(ofn);
- revert_thread_per_monitor_v2_awareness(save_da_ctx);
-
- if (gsfn_ok) {
- g_string_printf(file_name, "%s", utf_16to8(file_name16));
- /* What file format was specified? */
- *file_type = g_array_index(savable_file_types, int, ofn->nFilterIndex - 1);
- *compression_type = g_compressed ? WTAP_GZIP_COMPRESSED : WTAP_UNCOMPRESSED;
- } else {
- /* User cancelled or closed the dialog, or an error occurred. */
- if (CommDlgExtendedError() != 0) {
- /* XXX - pop up some error here. FNERR_INVALIDFILENAME
- * might be a user error; if so, they should know about
- * it. For now we force a do-over.
- */
- g_string_truncate(file_name, 0);
- gsfn_ok = true;
- }
- }
-
- g_sf_hwnd = NULL;
- g_range = NULL;
- g_cf = NULL;
- g_array_free(savable_file_types, true);
- g_free( (void *) ofn->lpstrFilter);
- delete ofn;
- return gsfn_ok;
-}
-
-
-bool
-win32_merge_file (HWND h_wnd, const wchar_t *title, GString *file_name, GString *display_filter, int *merge_type) {
- OPENFILENAME *ofn;
- TCHAR file_name16[MAX_PATH] = _T("");
- int ofnsize = sizeof(OPENFILENAME);
- BOOL gofn_ok;
-
- if (!file_name || !display_filter || !merge_type)
- return false;
-
- if (file_name->len > 0) {
- StringCchCopy(file_name16, MAX_PATH, utf_8to16(file_name->str));
- }
-
- if (display_filter->len > 0) {
- g_dfilter_str = g_strdup(display_filter->str);
- } else if (g_dfilter_str) {
- g_free(g_dfilter_str);
- g_dfilter_str = NULL;
- }
-
- ofn = new OPENFILENAME();
-
- ofn->lStructSize = ofnsize;
- ofn->hwndOwner = h_wnd;
- ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
- ofn->lpstrFilter = build_file_open_type_list();
- ofn->lpstrCustomFilter = NULL;
- ofn->nMaxCustFilter = 0;
- ofn->nFilterIndex = FILE_MERGE_DEFAULT;
- ofn->lpstrFile = file_name16;
- ofn->nMaxFile = MAX_PATH;
- ofn->lpstrFileTitle = NULL;
- ofn->nMaxFileTitle = 0;
- if (prefs.gui_fileopen_style == FO_STYLE_SPECIFIED && prefs.gui_fileopen_dir[0] != '\0') {
- ofn->lpstrInitialDir = utf_8to16(prefs.gui_fileopen_dir);
- } else {
- ofn->lpstrInitialDir = utf_8to16(get_open_dialog_initial_dir());
- }
- ofn->lpstrTitle = title;
- ofn->Flags = OFN_ENABLESIZING | OFN_ENABLETEMPLATE | OFN_EXPLORER |
- OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY |
- OFN_ENABLEHOOK | OFN_SHOWHELP;
- ofn->lpstrDefExt = NULL;
- ofn->lpfnHook = merge_file_hook_proc;
- ofn->lpTemplateName = _T("WIRESHARK_MERGEFILENAME_TEMPLATE");
-
- HANDLE save_da_ctx = set_thread_per_monitor_v2_awareness();
- gofn_ok = GetOpenFileName(ofn);
- revert_thread_per_monitor_v2_awareness(save_da_ctx);
-
- if (gofn_ok) {
- g_string_printf(file_name, "%s", utf_16to8(file_name16));
- g_string_printf(display_filter, "%s", g_dfilter_str ? g_dfilter_str : "");
-
- switch (g_merge_action) {
- case merge_append:
- *merge_type = 1;
- break;
- case merge_chrono:
- *merge_type = 0;
- break;
- case merge_prepend:
- *merge_type = -1;
- break;
- default:
- ws_assert_not_reached();
- }
- }
-
- g_free( (void *) ofn->lpstrFilter);
- delete ofn;
- g_free(g_dfilter_str);
- g_dfilter_str = NULL;
- return gofn_ok;
-}
-
-void
-win32_export_file(HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type, const char *range_) {
- OPENFILENAME *ofn;
- TCHAR file_name[MAX_PATH] = _T("");
- char *dirname;
- cf_print_status_t status;
- int ofnsize = sizeof(OPENFILENAME);
-
- g_cf = cf;
-
- ofn = new OPENFILENAME();
-
- ofn->lStructSize = ofnsize;
- ofn->hwndOwner = h_wnd;
- ofn->hInstance = (HINSTANCE) GetWindowLongPtr(h_wnd, GWLP_HINSTANCE);
- ofn->lpstrFilter = FILE_TYPES_EXPORT;
- ofn->lpstrCustomFilter = NULL;
- ofn->nMaxCustFilter = 0;
- ofn->nFilterIndex = export_type;
- ofn->lpstrFile = file_name;
- ofn->nMaxFile = MAX_PATH;
- ofn->lpstrFileTitle = NULL;
- ofn->nMaxFileTitle = 0;
- ofn->lpstrInitialDir = utf_8to16(get_open_dialog_initial_dir());
- ofn->lpstrTitle = title;
- ofn->Flags = OFN_ENABLESIZING | OFN_ENABLETEMPLATE | OFN_EXPLORER |
- OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY |
- OFN_PATHMUSTEXIST | OFN_ENABLEHOOK | OFN_SHOWHELP;
- ofn->lpstrDefExt = FILE_EXT_EXPORT[export_type];
- ofn->lCustData = (LPARAM) cf;
- ofn->lpfnHook = export_file_hook_proc;
- ofn->lpTemplateName = _T("WIRESHARK_EXPORTFILENAME_TEMPLATE");
-
- /* Fill in our print (and export) args */
-
- /* init the printing range */
- packet_range_init(&print_args.range, cf);
-
- if (strlen(range_) > 0)
- packet_range_convert_selection_str(&print_args.range, range_);
-
- print_args.format = PR_FMT_TEXT;
- print_args.to_file = true;
- print_args.cmd = NULL;
- print_args.print_summary = true;
- print_args.print_col_headings = true;
- print_args.print_dissections = print_dissections_as_displayed;
- print_args.print_hex = false;
- print_args.hexdump_options = HEXDUMP_SOURCE_MULTI;
- print_args.print_formfeed = false;
- print_args.stream = NULL;
-
- HANDLE save_da_ctx = set_thread_per_monitor_v2_awareness();
- BOOL gsfn_ok = GetSaveFileName(ofn);
- revert_thread_per_monitor_v2_awareness(save_da_ctx);
-
- if (gsfn_ok) {
- print_args.file = utf_16to8(file_name);
- switch (ofn->nFilterIndex) {
- case export_type_text: /* Text */
- print_args.stream = print_stream_text_new(true, print_args.file);
- if (print_args.stream == NULL) {
- open_failure_alert_box(print_args.file, errno, true);
- delete ofn;
- return;
- }
- status = cf_print_packets(cf, &print_args, true);
- break;
- case export_type_ps: /* PostScript (r) */
- print_args.stream = print_stream_ps_new(true, print_args.file);
- if (print_args.stream == NULL) {
- open_failure_alert_box(print_args.file, errno, true);
- delete ofn;
- return;
- }
- status = cf_print_packets(cf, &print_args, true);
- break;
- case export_type_csv: /* CSV */
- status = cf_write_csv_packets(cf, &print_args);
- break;
- case export_type_carrays: /* C Arrays */
- status = cf_write_carrays_packets(cf, &print_args);
- break;
- case export_type_psml: /* PSML */
- status = cf_write_psml_packets(cf, &print_args);
- break;
- case export_type_pdml: /* PDML */
- status = cf_write_pdml_packets(cf, &print_args);
- break;
- case export_type_json: /* JSON */
- status = cf_write_json_packets(cf, &print_args);
- break;
- default:
- delete ofn;
- return;
- }
-
- switch (status) {
- case CF_PRINT_OK:
- break;
- case CF_PRINT_OPEN_ERROR:
- open_failure_alert_box(print_args.file, errno, true);
- break;
- case CF_PRINT_WRITE_ERROR:
- write_failure_alert_box(print_args.file, errno);
- break;
- }
- /* Save the directory name for future file dialogs. */
- dirname = get_dirname(utf_16to8(file_name)); /* Overwrites cf_name */
- set_last_open_dir(dirname);
- }
-
- g_cf = NULL;
- delete ofn;
-}
-
-
-/*
- * Private routines
- */
-
-/** Given a print_args_t struct, update a set of print/export format controls
- * accordingly.
- *
- * @param dlg_hwnd HWND of the dialog in question.
- * @param args Pointer to a print args struct.
- */
-static void
-print_update_dynamic(HWND dlg_hwnd, print_args_t *args) {
- HWND cur_ctrl;
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_SUMMARY_CB);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- args->print_summary = true;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_COL_HEADINGS_CB);
- EnableWindow(cur_ctrl, true);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- args->print_col_headings = true;
- else
- args->print_col_headings = false;
- } else {
- args->print_summary = false;
- args->print_col_headings = false;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_COL_HEADINGS_CB);
- EnableWindow(cur_ctrl, false);
- }
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_DETAIL_CB);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_DETAIL_COMBO);
- switch (SendMessage(cur_ctrl, CB_GETCURSEL, 0, 0)) {
- case 0:
- args->print_dissections = print_dissections_collapsed;
- break;
- case 1:
- args->print_dissections = print_dissections_as_displayed;
- break;
- case 2:
- args->print_dissections = print_dissections_expanded;
- break;
- default:
- ws_assert_not_reached();
- }
- EnableWindow(cur_ctrl, true);
- } else {
- args->print_dissections = print_dissections_none;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_DETAIL_COMBO);
- EnableWindow(cur_ctrl, false);
- }
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_BYTES_CB);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- args->print_hex = true;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DATA_SOURCES_CB);
- EnableWindow(cur_ctrl, true);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- args->hexdump_options = HEXDUMP_SOURCE_MULTI;
- else
- args->hexdump_options = HEXDUMP_SOURCE_PRIMARY;
- } else {
- args->print_hex = false;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DATA_SOURCES_CB);
- EnableWindow(cur_ctrl, false);
- }
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_NEW_PAGE_CB);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- args->print_formfeed = true;
- else
- args->print_formfeed = false;
-}
-
-static void
-format_handle_wm_initdialog(HWND dlg_hwnd, print_args_t *args) {
- HWND cur_ctrl;
-
- /* Set the "Packet summary" and "Include column headings" boxes */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_SUMMARY_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, args->print_summary, 0);
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_COL_HEADINGS_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, args->print_col_headings, 0);
-
- /* Set the "Packet details" box */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_DETAIL_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, args->print_dissections != print_dissections_none, 0);
-
- /* Set the "Packet details" combo */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_DETAIL_COMBO);
- SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) _T("All collapsed"));
- SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) _T("As displayed"));
- SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) _T("All expanded"));
-
- switch (args->print_dissections) {
- case print_dissections_none:
- case print_dissections_collapsed:
- SendMessage(cur_ctrl, CB_SETCURSEL, 0, 0);
- break;
- case print_dissections_as_displayed:
- SendMessage(cur_ctrl, CB_SETCURSEL, 1, 0);
- break;
- case print_dissections_expanded:
- SendMessage(cur_ctrl, CB_SETCURSEL, 2, 0);
- break;
- default:
- ws_assert_not_reached();
- }
-
- /* Set the "Packet bytes" box */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_BYTES_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, args->print_hex, 0);
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DATA_SOURCES_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, !(args->hexdump_options & HEXDUMP_SOURCE_PRIMARY), 0);
-
- /* Set the "Each packet on a new page" box */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_PKT_NEW_PAGE_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, args->print_formfeed, 0);
-
- print_update_dynamic(dlg_hwnd, args);
-}
-
-
-#define PREVIEW_STR_MAX 200
-
-/* If preview_file is NULL, disable the elements. If not, enable and
- * show the preview info. */
-static bool
-preview_set_file_info(HWND of_hwnd, char *preview_file) {
- HWND cur_ctrl;
- int i;
- wtap *wth;
- int err;
- char *err_info;
- ws_file_preview_stats stats;
- ws_file_preview_stats_status status;
- TCHAR string_buff[PREVIEW_STR_MAX];
- TCHAR first_buff[PREVIEW_STR_MAX];
- int64_t filesize;
- char *size_str;
- time_t ti_time;
- struct tm *ti_tm;
- unsigned elapsed_time;
-
- for (i = EWFD_PTX_FORMAT; i <= EWFD_PTX_START_ELAPSED; i++) {
- cur_ctrl = GetDlgItem(of_hwnd, i);
- if (cur_ctrl) {
- EnableWindow(cur_ctrl, false);
- }
- }
-
- for (i = EWFD_PTX_FORMAT; i <= EWFD_PTX_START_ELAPSED; i++) {
- cur_ctrl = GetDlgItem(of_hwnd, i);
- if (cur_ctrl) {
- SetWindowText(cur_ctrl, _T("-"));
- }
- }
-
- if (preview_file == NULL || strlen(preview_file) < 1) {
- return false;
- }
-
- /* Format: directory */
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_PTX_FORMAT);
- if (test_for_directory(preview_file) == EISDIR) {
- SetWindowText(cur_ctrl, _T("directory"));
- return false;
- }
-
- wth = wtap_open_offline(preview_file, WTAP_TYPE_AUTO, &err, &err_info, true);
- if (cur_ctrl && wth == NULL) {
- if(err == WTAP_ERR_FILE_UNKNOWN_FORMAT) {
- SetWindowText(cur_ctrl, _T("unknown file format"));
- } else {
- SetWindowText(cur_ctrl, _T("error opening file"));
- }
- return false;
- }
-
- /* Success! */
- for (i = EWFD_PT_FORMAT; i <= EWFD_PTX_START_ELAPSED; i++) {
- cur_ctrl = GetDlgItem(of_hwnd, i);
- if (cur_ctrl) {
- EnableWindow(cur_ctrl, true);
- }
- }
-
- /* Format */
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_PTX_FORMAT);
- SetWindowText(cur_ctrl, utf_8to16(wtap_file_type_subtype_description(wtap_file_type_subtype(wth))));
-
- /* Size */
- filesize = wtap_file_size(wth, &err);
- // Windows Explorer uses IEC.
- size_str = format_size(filesize, FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_IEC);
-
- status = get_stats_for_preview(wth, &stats, &err, &err_info);
-
- if(status == PREVIEW_READ_ERROR) {
- /* XXX - give error details? */
- g_free(err_info);
- utf_8to16_snprintf(string_buff, PREVIEW_STR_MAX, "%s, error after %u records",
- size_str, stats.records);
- g_free(size_str);
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_PTX_SIZE);
- SetWindowText(cur_ctrl, string_buff);
- wtap_close(wth);
- return true;
- }
-
- /* Packet count */
- if(status == PREVIEW_TIMED_OUT) {
- utf_8to16_snprintf(string_buff, PREVIEW_STR_MAX, "%s, timed out at %u data records",
- size_str, stats.data_records);
- } else {
- utf_8to16_snprintf(string_buff, PREVIEW_STR_MAX, "%s, %u data records",
- size_str, stats.data_records);
- }
- g_free(size_str);
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_PTX_SIZE);
- SetWindowText(cur_ctrl, string_buff);
-
- /* First packet / elapsed time */
- if(stats.have_times) {
- /*
- * We saw at least one record with a time stamp, so we can give
- * a start time (if we have a mix of records with and without
- * time stamps, and there were records without time stamps
- * before the one with a time stamp, this may be inaccurate).
- */
- ti_time = (long)stats.start_time;
- ti_tm = localtime( &ti_time );
- if(ti_tm) {
- StringCchPrintf(first_buff, PREVIEW_STR_MAX,
- _T("%04d-%02d-%02d %02d:%02d:%02d"),
- ti_tm->tm_year + 1900,
- ti_tm->tm_mon + 1,
- ti_tm->tm_mday,
- ti_tm->tm_hour,
- ti_tm->tm_min,
- ti_tm->tm_sec);
- } else {
- StringCchPrintf(first_buff, PREVIEW_STR_MAX, _T("?"));
- }
- } else {
- StringCchPrintf(first_buff, PREVIEW_STR_MAX, _T("unknown"));
- }
-
- /* Elapsed time */
- if(status == PREVIEW_SUCCEEDED && stats.have_times) {
- /*
- * We didn't time out, so we looked at all packets, and we got
- * at least one packet with a time stamp, so we can calculate
- * an elapsed time from the time stamp of the last packet with
- * with a time stamp (if we have a mix of records with and without
- * time stamps, and there were records without time stamps after
- * the last one with a time stamp, this may be inaccurate).
- */
- elapsed_time = (unsigned int)(stats.stop_time-stats.start_time);
- if (elapsed_time/86400) {
- StringCchPrintf(string_buff, PREVIEW_STR_MAX, _T("%s / %02u days %02u:%02u:%02u"),
- first_buff, elapsed_time/86400, elapsed_time%86400/3600, elapsed_time%3600/60, elapsed_time%60);
- } else {
- StringCchPrintf(string_buff, PREVIEW_STR_MAX, _T("%s / %02u:%02u:%02u"),
- first_buff, elapsed_time%86400/3600, elapsed_time%3600/60, elapsed_time%60);
- }
- } else {
- StringCchPrintf(string_buff, PREVIEW_STR_MAX, _T("%s / unknown"),
- first_buff);
- }
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_PTX_START_ELAPSED);
- SetWindowText(cur_ctrl, string_buff);
-
- wtap_close(wth);
-
- return true;
-
-}
-
-static char *
-filter_tb_get(HWND hwnd) {
- TCHAR *strval = NULL;
- int len;
- char *ret;
-
- /* If filter_text is non-NULL, use it. Otherwise, grab the text from
- * the window */
- len = GetWindowTextLength(hwnd);
- if (len > 0) {
- len++;
- strval = g_new(TCHAR, len);
- len = GetWindowText(hwnd, strval, len);
- ret = g_utf16_to_utf8((gunichar2 *) strval, -1, NULL, NULL, NULL);
- g_free(strval);
- return ret;
- } else {
- return NULL;
- }
-}
-
-
-/* XXX - Copied from "filter-util.c" in the wireshark-win32 branch */
-/* XXX - The only reason for the "filter_text" parameter is to be able to feed
- * in the "real" filter string in the case of a CBN_SELCHANGE notification message.
- */
-static void
-filter_tb_syntax_check(HWND hwnd, const TCHAR *filter_text) {
- std::wstring strval;
- dfilter_t *dfp;
-
- /* If filter_text is non-NULL, use it. Otherwise, grab the text from
- * the window */
- if (filter_text) {
- strval = filter_text;
- } else {
- int len = GetWindowTextLength(hwnd);
- if (len > 0) {
- len++;
- strval.resize(len);
- len = GetWindowText(hwnd, &strval[0], len);
- strval.resize(len);
- }
- }
-
- if (strval.empty()) {
- /* Default window background */
- SendMessage(hwnd, EM_SETBKGNDCOLOR, (WPARAM) 1, COLOR_WINDOW);
- return;
- } else if (dfilter_compile(utf_16to8(strval.c_str()), &dfp, NULL)) { /* colorize filter string entry */
- dfilter_free(dfp);
- /* Valid (light green) */
- SendMessage(hwnd, EM_SETBKGNDCOLOR, 0, RGB(0xe4, 0xff, 0xc7)); /* tango_chameleon_1 */
- } else {
- /* Invalid (light red) */
- SendMessage(hwnd, EM_SETBKGNDCOLOR, 0, RGB(0xff, 0xcc, 0xcc)); /* tango_scarlet_red_1 */
- }
-}
-
-static int alpha_sort(gconstpointer a, gconstpointer b)
-{
- return g_ascii_strcasecmp(*(const char **)a, *(const char **)b);
-}
-
-static UINT_PTR CALLBACK
-open_file_hook_proc(HWND of_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
- HWND cur_ctrl, parent;
- OFNOTIFY *notify = (OFNOTIFY *) l_param;
- TCHAR sel_name[MAX_PATH];
- int i;
-
- switch(msg) {
- case WM_INITDIALOG:
- {
- /* Retain the filter text, and fill it in. */
- if(g_dfilter_str != NULL) {
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_FILTER_EDIT);
- SetWindowText(cur_ctrl, utf_8to16(g_dfilter_str));
- }
-
- /* Put Auto, as well as pcap and pcapng (which are the first two entries in
- open_routines), at the top of the file type list. */
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_FORMAT_TYPE);
- SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) _T("Automatically detect file type"));
- for (i = 0; i < 2; i += 1) {
- SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) utf_8to16(open_routines[i].name));
- }
- /* Generate a sorted list of the remaining file types.
- The magic number 60 is a rough starting point for how big the
- GPtrArray should start. It'll automatically grow if needed, so
- the exact number isn't critical. (This is good, because we don't have
- an easy way to get the exact number.) */
- GPtrArray *routine_names = g_ptr_array_sized_new(60);
- for ( /* keep using i */ ; open_routines[i].name != NULL; i += 1) {
- g_ptr_array_add(routine_names, (void *)open_routines[i].name);
- }
- g_ptr_array_sort(routine_names, alpha_sort);
- for (unsigned i = 0; i < routine_names->len; i += 1) {
- SendMessage(cur_ctrl, CB_ADDSTRING, 0, (WPARAM) utf_8to16((const char *)g_ptr_array_index(routine_names, i)));
- }
- g_ptr_array_free(routine_names, true);
- SendMessage(cur_ctrl, CB_SETCURSEL, 0, 0);
-
- preview_set_file_info(of_hwnd, NULL);
- }
- break;
- case WM_NOTIFY:
- switch (notify->hdr.code) {
- case CDN_FILEOK:
- /* Fetch the read filter */
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_FILTER_EDIT);
- g_free(g_dfilter_str);
- g_dfilter_str = filter_tb_get(cur_ctrl);
-
- cur_ctrl = GetDlgItem(of_hwnd, EWFD_FORMAT_TYPE);
- g_format_type = (unsigned int) SendMessage(cur_ctrl, CB_GETCURSEL, 0, 0);
-
- /* The list of file formats is sorted. Get the format by name. */
- LRESULT label_len;
- label_len = SendMessage(cur_ctrl, CB_GETLBTEXTLEN, (WPARAM) g_format_type, 0);
- if (label_len != CB_ERR) {
- TCHAR *label = g_new(TCHAR, label_len+1);
- SendMessage(cur_ctrl, CB_GETLBTEXT, (WPARAM) g_format_type, (LPARAM) label);
- g_format_type = open_info_name_to_type(utf_16to8(label));
- g_free(label);
- }
- else {
- /* Problem, fall back on automatic */
- g_format_type = WTAP_TYPE_AUTO;
- }
-
- break;
- case CDN_SELCHANGE:
- /* This _almost_ works correctly. We need to handle directory
- selections, etc. */
- parent = GetParent(of_hwnd);
- CommDlg_OpenSave_GetFilePath(parent, sel_name, MAX_PATH);
- preview_set_file_info(of_hwnd, utf_16to8(sel_name));
- break;
- case CDN_HELP:
- topic_action(HELP_OPEN_WIN32_DIALOG);
- break;
- default:
- break;
- }
- break;
- case WM_COMMAND:
- cur_ctrl = (HWND) l_param;
- switch(w_param) {
- case (EN_UPDATE << 16) | EWFD_FILTER_EDIT:
- filter_tb_syntax_check(cur_ctrl, NULL);
- break;
- /*
- * If we ever figure out a way to integrate the Windows
- * and GTK+ event loops (or make a native filter dialog),
- * we can re-enable the "Filter" button.
- */
- /*
- case EWFD_FILTER_BTN:
- break;
- */
- default:
- break;
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-/* Generate a list of the file types we can filter for in the open dialog. */
-static void
-append_file_extension_type(GArray *sa, int et)
-{
- GString* pattern_str = g_string_new("");
- GString* description_str = g_string_new("");
- char sep;
- GSList *extensions_list, *extension;
- const TCHAR *str16;
- uint16_t zero = 0;
-
- /* Construct the list of patterns. */
- extensions_list = wtap_get_file_extension_type_extensions(et);
- sep = '\0';
- for (extension = extensions_list; extension != NULL;
- extension = g_slist_next(extension)) {
- if (sep != '\0')
- g_string_append_c(pattern_str, sep);
- g_string_append_printf(pattern_str, "*.%s", (char *)extension->data);
- sep = ';';
- }
- wtap_free_extensions_list(extensions_list);
-
- /* Construct the description. */
- g_string_printf(description_str, "%s (%s)",
- wtap_get_file_extension_type_name(et),
- pattern_str->str);
- str16 = utf_8to16(description_str->str);
- sa = g_array_append_vals(sa, str16, (unsigned) strlen(description_str->str));
- sa = g_array_append_val(sa, zero);
- g_string_free(description_str, true);
-
- str16 = utf_8to16(pattern_str->str);
- sa = g_array_append_vals(sa, str16, (unsigned) strlen(pattern_str->str));
- sa = g_array_append_val(sa, zero);
- g_string_free(pattern_str, true);
-}
-
-static TCHAR *
-build_file_open_type_list(void) {
- const TCHAR *str16;
- int et;
- GArray* sa;
- static const uint16_t zero = 0;
- GString* pattern_str;
- char sep;
- GSList *extensions_list, *extension;
-
- /*
- * Microsoft's UI guidelines say, of the file filters in open and
- * save dialogs:
- *
- * For meta-filters, remove the file extension list to eliminate
- * clutter. Examples: "All files," "All pictures," "All music,"
- * and "All videos."
- *
- * so we omit them (for "All Capture Files", the filter would be
- * *really* long). On both Windows XP and Windows 7, Wordpad doesn't
- * do that, but Paint does.
- */
-
- /*
- * Array of hexadectets used as a sequence of null-terminated
- * UTF-16 strings.
- */
- sa = g_array_new(false /*zero_terminated*/, false /*clear_*/,2 /*element_size*/);
-
- /* Add the "All Files" entry. */
- str16 = utf_8to16("All Files");
- sa = g_array_append_vals(sa, str16, (unsigned) strlen("All Files"));
- sa = g_array_append_val(sa, zero);
- str16 = utf_8to16(ALL_FILES_WILDCARD);
- sa = g_array_append_vals(sa, str16, (unsigned) strlen(ALL_FILES_WILDCARD));
- sa = g_array_append_val(sa, zero);
-
- /*
- * Add an "All Capture Files" entry, with all the capture file
- * extensions we know about.
- */
- str16 = utf_8to16("All Capture Files");
- sa = g_array_append_vals(sa, str16, (unsigned) strlen("All Capture Files"));
- sa = g_array_append_val(sa, zero);
-
- /*
- * Construct its list of patterns.
- */
- pattern_str = g_string_new("");
- extensions_list = wtap_get_all_capture_file_extensions_list();
- sep = '\0';
- for (extension = extensions_list; extension != NULL;
- extension = g_slist_next(extension)) {
- if (sep != '\0')
- g_string_append_c(pattern_str, sep);
- g_string_append_printf(pattern_str, "*.%s", (char *)extension->data);
- sep = ';';
- }
- wtap_free_extensions_list(extensions_list);
- str16 = utf_8to16(pattern_str->str);
- sa = g_array_append_vals(sa, str16, (unsigned) strlen(pattern_str->str));
- sa = g_array_append_val(sa, zero);
-
- /* Include all the file type extensions Wireshark supports. */
- for (et = 0; et < wtap_get_num_file_type_extensions(); et++) {
- append_file_extension_type(sa, et);
- }
-
- /* terminate the array */
- sa = g_array_append_val(sa, zero);
-
- return (TCHAR *) g_array_free(sa, false /*free_segment*/);
-}
-
-/* Generate a list of the file types we can save this file as.
-
- "g_filetype" is the type it has now.
-
- "encap" is the encapsulation for its packets (which could be
- "unknown" or "per-packet").
-
- "filtered" is true if we're to save only the packets that passed
- the display filter (in which case we have to save it using Wiretap)
- and false if we're to save the entire file (in which case, if we're
- saving it in the type it has already, we can just copy it).
-
- The same applies for sel_curr, sel_all, sel_m_only, sel_m_range and sel_man_range
-*/
-static void
-append_file_type(GArray *sa, int ft)
-{
- GString* pattern_str = g_string_new("");
- GString* description_str = g_string_new("");
- char sep;
- GSList *extensions_list, *extension;
- const TCHAR *str16;
- uint16_t zero = 0;
-
- extensions_list = wtap_get_file_extensions_list(ft, true);
- if (extensions_list == NULL) {
- /* This file type doesn't have any particular extension
- conventionally used for it, so we'll just use a
- wildcard that matches all file names - even those with
- no extension, so we don't need to worry about compressed
- file extensions. */
- g_string_printf(pattern_str, ALL_FILES_WILDCARD);
- } else {
- /* Construct the list of patterns. */
- sep = '\0';
- for (extension = extensions_list; extension != NULL;
- extension = g_slist_next(extension)) {
- if (sep != '\0')
- g_string_append_c(pattern_str, sep);
- g_string_append_printf(pattern_str, "*.%s", (char *)extension->data);
- sep = ';';
- }
- wtap_free_extensions_list(extensions_list);
- }
-
- /* Construct the description. */
- g_string_printf(description_str, "%s (%s)", wtap_file_type_subtype_description(ft),
- pattern_str->str);
- str16 = utf_8to16(description_str->str);
- sa = g_array_append_vals(sa, str16, (unsigned) strlen(description_str->str));
- sa = g_array_append_val(sa, zero);
- g_string_free(description_str, true);
-
- str16 = utf_8to16(pattern_str->str);
- sa = g_array_append_vals(sa, str16, (unsigned) strlen(pattern_str->str));
- sa = g_array_append_val(sa, zero);
- g_string_free(pattern_str, true);
-}
-
-static TCHAR *
-build_file_save_type_list(GArray *savable_file_types) {
- unsigned i;
- int ft;
- GArray* sa = g_array_new(false /*zero_terminated*/, false /*clear_*/,2 /*element_size*/);
- uint16_t zero = 0;
-
- /* Get only the file types as which we can save this file. */
- for (i = 0; i < savable_file_types->len; i++) {
- ft = g_array_index(savable_file_types, int, i);
- append_file_type(sa, ft);
- }
-
- /* terminate the array */
- sa = g_array_append_val(sa, zero);
-
- return (TCHAR *) g_array_free(sa, false /*free_segment*/);
-}
-
-static UINT_PTR CALLBACK
-save_as_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param _U_, LPARAM l_param) {
- HWND cur_ctrl;
- OFNOTIFY *notify = (OFNOTIFY *) l_param;
- /*int new_filetype, file_index;*/
-
- switch(msg) {
- case WM_INITDIALOG: {
- OPENFILENAME *ofnp = (OPENFILENAME *) l_param;
- capture_file *cf = (capture_file *) ofnp->lCustData;
- g_sf_hwnd = sf_hwnd;
-
- /* Default to saving in the file's current format. */
- g_filetype = cf->cd_t;
-
- /* Fill in the file format list */
- /*build_file_format_list(sf_hwnd);*/
- /* Fill in the compression checkbox */
- cur_ctrl = GetDlgItem(sf_hwnd, EWFD_GZIP_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, g_compressed, 0);
-
- break;
- }
- case WM_COMMAND:
- break;
- case WM_NOTIFY:
- switch (notify->hdr.code) {
- case CDN_HELP:
- topic_action(HELP_SAVE_WIN32_DIALOG);
- break;
- case CDN_FILEOK: {
- HWND parent;
- char *file_name8;
- OPENFILENAME *ofnp = (OPENFILENAME *) notify->lpOFN;
- capture_file *cf = (capture_file *) ofnp->lCustData;
-
- /* Fetch our compression value */
- cur_ctrl = GetDlgItem(sf_hwnd, EWFD_GZIP_CB);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- g_compressed = true;
- else
- g_compressed = false;
-
- /* Check if we're trying to overwrite the currently open file */
- parent = GetParent(sf_hwnd);
- file_name8 = utf_16to8(notify->lpOFN->lpstrFile);
- if (files_identical(cf->filename, file_name8)) {
- /* XXX: Is MessageBox the best way to pop up an error ? How to make text bold ? */
- char *str = ws_strdup_printf(
- "Capture File \"%s\" identical to loaded file.\n\n"
- "Please choose a different filename.",
- file_name8);
- MessageBox( parent, utf_8to16(str), _T("Error"), MB_ICONERROR | MB_APPLMODAL | MB_OK);
- g_free(str);
- SetWindowLongPtr(sf_hwnd, DWLP_MSGRESULT, 1L); /* Don't allow ! */
- return 1;
- }
- }
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-#define RANGE_TEXT_MAX 128
-static UINT_PTR CALLBACK
-export_specified_packets_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
- HWND cur_ctrl;
- OFNOTIFY *notify = (OFNOTIFY *) l_param;
- /*int new_filetype, file_index;*/
-
- switch(msg) {
- case WM_INITDIALOG: {
- g_sf_hwnd = sf_hwnd;
-
- /* Default to saving all packets, in the file's current format. */
- g_filetype = g_cf->cd_t;
-
- /* Fill in the file format list */
- /*build_file_format_list(sf_hwnd);*/
-
- range_handle_wm_initdialog(sf_hwnd, g_range);
-
- /* Fill in the compression checkbox */
- cur_ctrl = GetDlgItem(sf_hwnd, EWFD_GZIP_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, g_compressed, 0);
-
- break;
- }
- case WM_COMMAND:
- cur_ctrl = (HWND) l_param;
- range_handle_wm_command(sf_hwnd, cur_ctrl, w_param, g_range);
- break;
- case WM_NOTIFY:
- switch (notify->hdr.code) {
- case CDN_HELP:
- topic_action(HELP_SAVE_WIN32_DIALOG);
- break;
- case CDN_FILEOK: {
- HWND parent;
- char *file_name8;
- OPENFILENAME *ofnp = (OPENFILENAME *) notify->lpOFN;
- capture_file *cf = (capture_file *) ofnp->lCustData;
-
- /* Fetch our compression value */
- cur_ctrl = GetDlgItem(sf_hwnd, EWFD_GZIP_CB);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- g_compressed = true;
- else
- g_compressed = false;
-
- /* Check if we're trying to overwrite the currently open file */
- parent = GetParent(sf_hwnd);
- file_name8 = utf_16to8(notify->lpOFN->lpstrFile);
- if (files_identical(cf->filename, file_name8)) {
- /* XXX: Is MessageBox the best way to pop up an error ? How to make text bold ? */
- char *str = ws_strdup_printf(
- "Capture File \"%s\" identical to loaded file.\n\n"
- "Please choose a different filename.",
- file_name8);
- MessageBox( parent, utf_8to16(str), _T("Error"), MB_ICONERROR | MB_APPLMODAL | MB_OK);
- g_free(str);
- SetWindowLongPtr(sf_hwnd, DWLP_MSGRESULT, 1L); /* Don't allow ! */
- return 1;
- }
- }
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-#define STATIC_LABEL_CHARS 100
-/* For each range static control, fill in its value and enable/disable it. */
-static void
-range_update_dynamics(HWND dlg_hwnd, packet_range_t *range) {
- HWND cur_ctrl;
- bool filtered_active = false;
- TCHAR static_val[STATIC_LABEL_CHARS];
- uint32_t ignored_cnt = 0, displayed_ignored_cnt = 0;
- uint32_t depended_cnt = 0, displayed_depended_cnt = 0;
- uint32_t label_cnt;
- bool range_valid = true;
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DISPLAYED_BTN);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- filtered_active = true;
-
- /* RANGE_SELECT_ALL */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_ALL_PKTS_CAP);
- EnableWindow(cur_ctrl, !filtered_active);
- label_cnt = g_cf->count;
- if (range->remove_ignored) {
- label_cnt -= range->ignored_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_ALL_PKTS_DISP);
- EnableWindow(cur_ctrl, filtered_active);
- if (range->include_dependents)
- label_cnt = range->displayed_plus_dependents_cnt;
- else
- label_cnt = range->displayed_cnt;
- if (range->remove_ignored) {
- label_cnt -= range->displayed_ignored_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- /* RANGE_SELECT_CURR */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_SEL_PKT_CAP);
- EnableWindow(cur_ctrl, range->selection_range_cnt > 0 && !filtered_active);
- if (range->include_dependents) {
- label_cnt = range->selected_plus_depends_cnt;
- } else {
- label_cnt = range->selection_range_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->ignored_selection_range_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_SEL_PKT_DISP);
- EnableWindow(cur_ctrl, range->displayed_selection_range_cnt > 0 && filtered_active);
- if (range->include_dependents) {
- label_cnt = range->displayed_selected_plus_depends_cnt;
- } else {
- label_cnt = range->displayed_selection_range_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->displayed_ignored_selection_range_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- /* RANGE_SELECT_MARKED */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_MARKED_BTN);
- EnableWindow(cur_ctrl, g_cf->marked_count);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_MARKED_CAP);
- EnableWindow(cur_ctrl, g_cf->marked_count && !filtered_active);
- if (range->include_dependents) {
- label_cnt = range->marked_plus_depends_cnt;
- } else {
- label_cnt = g_cf->marked_count;
- }
- if (range->remove_ignored) {
- label_cnt -= range->ignored_marked_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_MARKED_DISP);
- EnableWindow(cur_ctrl, g_cf->marked_count && filtered_active);
- if (range->include_dependents) {
- label_cnt = range->displayed_marked_plus_depends_cnt;
- } else {
- label_cnt = range->displayed_marked_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->displayed_ignored_marked_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- /* RANGE_SELECT_MARKED_RANGE */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_FIRST_LAST_BTN);
- EnableWindow(cur_ctrl, range->mark_range_cnt);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_FIRST_LAST_CAP);
- EnableWindow(cur_ctrl, range->mark_range_cnt && !filtered_active);
- if (range->include_dependents) {
- label_cnt = range->mark_range_plus_depends_cnt;
- } else {
- label_cnt = range->mark_range_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->ignored_mark_range_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_FIRST_LAST_DISP);
- EnableWindow(cur_ctrl, range->displayed_mark_range_cnt && filtered_active);
- if (range->include_dependents) {
- label_cnt = range->displayed_mark_range_plus_depends_cnt;
- } else {
- label_cnt = range->displayed_mark_range_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->displayed_ignored_mark_range_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- /* RANGE_SELECT_USER */
- switch (packet_range_check(range)) {
- case CVT_NO_ERROR:
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_EDIT);
- SendMessage(cur_ctrl, EM_SETBKGNDCOLOR, (WPARAM) 1, COLOR_WINDOW);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_CAP);
- EnableWindow(cur_ctrl, !filtered_active);
- if (range->include_dependents) {
- label_cnt = range->user_range_plus_depends_cnt;
- } else {
- label_cnt = range->user_range_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->ignored_user_range_cnt;
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%d"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_DISP);
- EnableWindow(cur_ctrl, filtered_active);
- if (range->include_dependents) {
- label_cnt = range->displayed_user_range_plus_depends_cnt;
- } else {
- label_cnt = range->displayed_user_range_cnt;
- }
- if (range->remove_ignored) {
- label_cnt -= range->displayed_ignored_user_range_cnt;
- } else {
- }
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), label_cnt);
- SetWindowText(cur_ctrl, static_val);
- break;
- case CVT_SYNTAX_ERROR:
- if (range->process == range_process_user_range) range_valid = false;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_EDIT);
- SendMessage(cur_ctrl, EM_SETBKGNDCOLOR, 0, RGB(0xff, 0xcc, 0xcc));
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_CAP);
- SetWindowText(cur_ctrl, _T("Bad range"));
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_DISP);
- SetWindowText(cur_ctrl, _T("-"));
- break;
- case CVT_NUMBER_TOO_BIG:
- if (range->process == range_process_user_range) range_valid = false;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_EDIT);
- SendMessage(cur_ctrl, EM_SETBKGNDCOLOR, 0, RGB(0xff, 0xcc, 0xcc));
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_CAP);
- SetWindowText(cur_ctrl, _T("Too large"));
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_DISP);
- SetWindowText(cur_ctrl, _T("-"));
- break;
-
- default:
- ws_assert_not_reached();
- }
-
- /* RANGE_REMOVE_IGNORED_PACKETS */
- switch(range->process) {
- case(range_process_all):
- ignored_cnt = range->ignored_cnt;
- displayed_ignored_cnt = range->displayed_ignored_cnt;
- break;
- case(range_process_selected):
- ignored_cnt = range->ignored_selection_range_cnt;
- displayed_ignored_cnt = range->displayed_ignored_selection_range_cnt;
- break;
- case(range_process_marked):
- ignored_cnt = range->ignored_marked_cnt;
- displayed_ignored_cnt = range->displayed_ignored_marked_cnt;
- break;
- case(range_process_marked_range):
- ignored_cnt = range->ignored_mark_range_cnt;
- displayed_ignored_cnt = range->displayed_ignored_mark_range_cnt;
- break;
- case(range_process_user_range):
- ignored_cnt = range->ignored_user_range_cnt;
- displayed_ignored_cnt = range->displayed_ignored_user_range_cnt;
- break;
- default:
- ws_assert_not_reached();
- }
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_REMOVE_IGN_CB);
- EnableWindow(cur_ctrl, ignored_cnt);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_IGNORED_CAP);
- EnableWindow(cur_ctrl, ignored_cnt && !filtered_active);
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), ignored_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_IGNORED_DISP);
- EnableWindow(cur_ctrl, displayed_ignored_cnt && filtered_active);
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), displayed_ignored_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- /* RANGE_REMOVE_IGNORED_PACKETS */
- switch(range->process) {
- case(range_process_all):
- depended_cnt = 0;
- displayed_depended_cnt = range->displayed_plus_dependents_cnt - range->displayed_cnt;
- break;
- case(range_process_selected):
- depended_cnt = range->selected_plus_depends_cnt - range->selection_range_cnt;
- displayed_depended_cnt = range->displayed_selected_plus_depends_cnt - range->displayed_selection_range_cnt;
- break;
- case(range_process_marked):
- depended_cnt = range->marked_plus_depends_cnt - range->cf->marked_count;
- displayed_depended_cnt = range->displayed_marked_plus_depends_cnt - range->displayed_marked_cnt;
- break;
- case(range_process_marked_range):
- depended_cnt = range->mark_range_plus_depends_cnt - range->mark_range_cnt;
- displayed_depended_cnt = range->displayed_mark_range_plus_depends_cnt - range->displayed_mark_range_cnt;
- break;
- case(range_process_user_range):
- depended_cnt = range->user_range_plus_depends_cnt - range->user_range_cnt;
- displayed_depended_cnt = range->displayed_user_range_plus_depends_cnt - range->displayed_user_range_cnt;
- break;
- default:
- ws_assert_not_reached();
- }
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_INCLUDE_DPD_CB);
- if (filtered_active) {
- EnableWindow(cur_ctrl, displayed_depended_cnt);
- } else {
- EnableWindow(cur_ctrl, depended_cnt);
- }
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DEPENDED_CAP);
- EnableWindow(cur_ctrl, depended_cnt && !filtered_active);
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), depended_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DEPENDED_DISP);
- EnableWindow(cur_ctrl, displayed_depended_cnt && filtered_active);
- StringCchPrintf(static_val, STATIC_LABEL_CHARS, _T("%u"), displayed_depended_cnt);
- SetWindowText(cur_ctrl, static_val);
-
- cur_ctrl = GetDlgItem(GetParent(dlg_hwnd), IDOK);
- EnableWindow(cur_ctrl, range_valid);
-}
-
-static void
-range_handle_wm_initdialog(HWND dlg_hwnd, packet_range_t *range) {
- HWND cur_ctrl;
-
- /* Set the appropriate captured/displayed radio */
- if (range->process_filtered)
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DISPLAYED_BTN);
- else
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_CAPTURED_BTN);
- SendMessage(cur_ctrl, BM_SETCHECK, true, 0);
-
- /* Retain the filter text, and fill it in. */
- if(range->user_range != NULL) {
- char* tmp_str;
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_EDIT);
- tmp_str = range_convert_range(NULL, range->user_range);
- SetWindowText(cur_ctrl, utf_8to16(tmp_str));
- wmem_free(NULL, tmp_str);
- }
-
- /* dynamic values in the range frame */
- range_update_dynamics(dlg_hwnd, range);
-
- /* Set the appropriate range radio */
- switch(range->process) {
- case(range_process_all):
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_ALL_PKTS_BTN);
- break;
- case(range_process_selected):
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_SEL_PKT_BTN);
- break;
- case(range_process_marked):
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_MARKED_BTN);
- break;
- case(range_process_marked_range):
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_FIRST_LAST_BTN);
- break;
- case(range_process_user_range):
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_BTN);
- break;
- default:
- ws_assert_not_reached();
- }
- SendMessage(cur_ctrl, BM_SETCHECK, true, 0);
-
- /* Set the include depended upon checkbox */
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_INCLUDE_DPD_CB);
- SendMessage(cur_ctrl, BM_SETCHECK, range->include_dependents, 0);
-}
-
-static void
-range_handle_wm_command(HWND dlg_hwnd, HWND ctrl, WPARAM w_param, packet_range_t *range) {
- HWND cur_ctrl;
- TCHAR range_text[RANGE_TEXT_MAX];
-
- if (!range) return;
-
- switch(w_param) {
- case (BN_CLICKED << 16) | EWFD_CAPTURED_BTN:
- case (BN_CLICKED << 16) | EWFD_DISPLAYED_BTN:
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_CAPTURED_BTN);
- if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
- range->process_filtered = false;
- else
- range->process_filtered = true;
- range_update_dynamics(dlg_hwnd, range);
- break;
- case (BN_CLICKED << 16) | EWFD_ALL_PKTS_BTN:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->process = range_process_all;
- range_update_dynamics(dlg_hwnd, range);
- }
- break;
- case (BN_CLICKED << 16) | EWFD_SEL_PKT_BTN:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->process = range_process_selected;
- range_update_dynamics(dlg_hwnd, range);
- }
- break;
- case (BN_CLICKED << 16) | EWFD_MARKED_BTN:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->process = range_process_marked;
- range_update_dynamics(dlg_hwnd, range);
- }
- break;
- case (BN_CLICKED << 16) | EWFD_FIRST_LAST_BTN:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->process = range_process_marked_range;
- range_update_dynamics(dlg_hwnd, range);
- }
- break;
- case (BN_CLICKED << 16) | EWFD_RANGE_BTN:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->process = range_process_user_range;
- range_update_dynamics(dlg_hwnd, range);
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_EDIT);
- SetFocus(cur_ctrl);
- }
- break;
- case (EN_SETFOCUS << 16) | EWFD_RANGE_EDIT:
- cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_RANGE_BTN);
- SendMessage(cur_ctrl, BM_CLICK, 0, 0);
- break;
- case (EN_UPDATE << 16) | EWFD_RANGE_EDIT:
- SendMessage(ctrl, WM_GETTEXT, (WPARAM) RANGE_TEXT_MAX, (LPARAM) range_text);
- packet_range_convert_str(range, utf_16to8(range_text));
- range_update_dynamics(dlg_hwnd, range);
- break;
- case (BN_CLICKED << 16) | EWFD_REMOVE_IGN_CB:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->remove_ignored = true;
- } else {
- range->remove_ignored = false;
- }
- range_update_dynamics(dlg_hwnd, range);
- break;
- case (BN_CLICKED << 16) | EWFD_INCLUDE_DPD_CB:
- if (SendMessage(ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- range->include_dependents = true;
- } else {
- range->include_dependents = false;
- }
- range_update_dynamics(dlg_hwnd, range);
- break;
- }
-}
-
-static UINT_PTR CALLBACK
-merge_file_hook_proc(HWND mf_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
- HWND cur_ctrl, parent;
- OFNOTIFY *notify = (OFNOTIFY *) l_param;
- TCHAR sel_name[MAX_PATH];
-
- switch(msg) {
- case WM_INITDIALOG:
- /* Retain the filter text, and fill it in. */
- if(g_dfilter_str != NULL) {
- cur_ctrl = GetDlgItem(mf_hwnd, EWFD_FILTER_EDIT);
- SetWindowText(cur_ctrl, utf_8to16(g_dfilter_str));
- }
-
- /* Chrono by default */
- cur_ctrl = GetDlgItem(mf_hwnd, EWFD_MERGE_CHRONO_BTN);
- SendMessage(cur_ctrl, BM_SETCHECK, true, 0);
- g_merge_action = merge_append;
-
- preview_set_file_info(mf_hwnd, NULL);
- break;
- case WM_NOTIFY:
- switch (notify->hdr.code) {
- case CDN_FILEOK:
- /* Fetch the read filter */
- cur_ctrl = GetDlgItem(mf_hwnd, EWFD_FILTER_EDIT);
- g_free(g_dfilter_str);
- g_dfilter_str = filter_tb_get(cur_ctrl);
-
- cur_ctrl = GetDlgItem(mf_hwnd, EWFD_MERGE_CHRONO_BTN);
- if(SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- g_merge_action = merge_chrono;
- } else {
- cur_ctrl = GetDlgItem(mf_hwnd, EWFD_MERGE_PREPEND_BTN);
- if(SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) {
- g_merge_action = merge_prepend;
- }
- }
-
- break;
- case CDN_SELCHANGE:
- /* This _almost_ works correctly. We need to handle directory
- selections, etc. */
- parent = GetParent(mf_hwnd);
- CommDlg_OpenSave_GetFilePath(parent, sel_name, MAX_PATH);
- preview_set_file_info(mf_hwnd, utf_16to8(sel_name));
- break;
- case CDN_HELP:
- topic_action(HELP_MERGE_WIN32_DIALOG);
- break;
- default:
- break;
- }
- break;
- case WM_COMMAND:
- cur_ctrl = (HWND) l_param;
- switch(w_param) {
- case (EN_UPDATE << 16) | EWFD_FILTER_EDIT:
- filter_tb_syntax_check(cur_ctrl, NULL);
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
-
-static UINT_PTR CALLBACK
-export_file_hook_proc(HWND ef_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) {
- HWND cur_ctrl;
- OFNOTIFY *notify = (OFNOTIFY *) l_param;
- bool pkt_fmt_enable;
- int i, filter_index;
-
- switch(msg) {
- case WM_INITDIALOG: {
- /* default to displayed packets */
- print_args.range.process_filtered = true;
- range_handle_wm_initdialog(ef_hwnd, &print_args.range);
- format_handle_wm_initdialog(ef_hwnd, &print_args);
-
- break;
- }
- case WM_COMMAND:
- cur_ctrl = (HWND) l_param;
- switch (w_param) {
- case (CBN_SELCHANGE << 16) | EWFD_PKT_DETAIL_COMBO:
- default:
- range_handle_wm_command(ef_hwnd, cur_ctrl, w_param, &print_args.range);
- print_update_dynamic(ef_hwnd, &print_args);
- break;
- }
- break;
- case WM_NOTIFY:
- switch (notify->hdr.code) {
- case CDN_FILEOK:
- break;
- case CDN_TYPECHANGE:
- filter_index = notify->lpOFN->nFilterIndex;
-
- if (filter_index == 2) /* PostScript */
- print_args.format = PR_FMT_TEXT;
- else
- print_args.format = PR_FMT_PS;
- if (filter_index == 3 || filter_index == 4 || filter_index == 5 || filter_index == 6)
- pkt_fmt_enable = false;
- else
- pkt_fmt_enable = true;
- for (i = EWFD_PKT_FORMAT_GB; i <= EWFD_PKT_NEW_PAGE_CB; i++) {
- cur_ctrl = GetDlgItem(ef_hwnd, i);
- EnableWindow(cur_ctrl, pkt_fmt_enable);
- }
- break;
- case CDN_HELP:
- topic_action(HELP_EXPORT_FILE_WIN32_DIALOG);
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- return 0;
-}
-
#endif // _WIN32
diff --git a/ui/win32/file_dlg_win32.h b/ui/win32/file_dlg_win32.h
index 2bb2fb4d..eef7fe38 100644
--- a/ui/win32/file_dlg_win32.h
+++ b/ui/win32/file_dlg_win32.h
@@ -12,11 +12,6 @@
#ifndef __FILE_DLG_WIN32_H__
#define __FILE_DLG_WIN32_H__
-#ifndef RC_INVOKED // RC warns about gatomic's long identifiers.
-#include "ui/file_dialog.h"
-#include "ui/packet_range.h"
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -28,8 +23,10 @@ extern "C" {
* via Qt:AA_EnableHighDpiScaling. We do this in main.cpp. In order for
* native dialogs to be rendered correctly we need to set per-monitor
* *v2* awareness prior to creating the dialog, which we can do here.
- * Qt doesn't render correctly when per-monitor v2 awareness is enabled, so
- * we need to revert our thread context when we're done.
+ * Qt < 5.14(?) or so doesn't render correctly when per-monitor v2 awareness
+ * is enabled, so we need to revert our thread context when we're done.
+ * Qt >= 6.0 is per-monitor DPI awareness v2 by default, so this doesn't
+ * have any effect.
*
* @return The current thread DPI awareness context, which should
* be passed to revert_thread_per_monitor_v2_awareness.
@@ -42,140 +39,6 @@ HANDLE set_thread_per_monitor_v2_awareness(void);
*/
void revert_thread_per_monitor_v2_awareness(HANDLE context);
-/** Open the "Open" dialog box.
- *
- * @param h_wnd HWND of the parent window.
- * @param file_name File name
- * @param type File type
- * @param display_filter a display filter
- */
-bool win32_open_file (HWND h_wnd, const wchar_t *title, GString *file_name, unsigned int *type, GString *display_filter);
-
-/** Open the "Save As" dialog box.
- *
- * @param h_wnd HWND of the parent window.
- * @param cf capture_file Structure for the capture to be saved
- * @param file_name File name. May be empty.
- * @param file_type Wiretap file type.
- * @param compression_type Compression type to use, or uncompressed.
- * @param must_support_comments true if the file format list should
- * include only file formats that support comments
- *
- * @return true if packets were discarded when saving, false otherwise
- */
-bool win32_save_as_file(HWND h_wnd, const wchar_t *title, capture_file *cf,
- GString *file_name, int *file_type,
- wtap_compression_type *compression_type,
- bool must_support_comments);
-
-/** Open the "Export Specified Packets" dialog box.
- *
- * @param h_wnd HWND of the parent window.
- * @param cf capture_file Structure for the capture to be saved
- * @param file_name File name. May be empty.
- * @param file_type Wiretap file type.
- * @param compression_type Compression type to use, or uncompressed.
- * @param range Range of packets to export.
- *
- * @return true if packets were discarded when saving, false otherwise
- */
-bool win32_export_specified_packets_file(HWND h_wnd,
- const wchar_t *title,
- capture_file *cf,
- GString *file_name,
- int *file_type,
- wtap_compression_type *compression_type,
- packet_range_t *range);
-
-
-/** Open the "Merge" dialog box.
- *
- * @param h_wnd HWND of the parent window.
- * @param file_name File name
- * @param display_filter a display filter
- * @param merge_type type of merge
- */
-bool win32_merge_file (HWND h_wnd, const wchar_t *title, GString *file_name, GString *display_filter, int *merge_type);
-
-/** Open the "Export" dialog box.
- *
- * @param h_wnd HWND of the parent window.
- * @param cf capture_file Structure for the capture to be saved
- * @param export_type The export type.
- * @param range a possible range
- */
-void win32_export_file (HWND h_wnd, const wchar_t *title, capture_file *cf, export_type_e export_type, const char *range);
-
-/* Open dialog defines */
-/* #define EWFD_FILTER_BTN 1000 */
-#define EWFD_FILTER_LBL 1000
-#define EWFD_FILTER_EDIT 1001
-
-#define EWFD_MAC_NR_CB 1002
-#define EWFD_NET_NR_CB 1003
-#define EWFD_TRANS_NR_CB 1004
-#define EWFD_EXTERNAL_NR_CB 1005
-
-/* Note: The preview title (PT) and text (PTX) MUST have sequential IDs;
- they're used in a for loop. EWFD_PT_FILENAME MUST be first, and
- EWFD_PTX_ELAPSED MUST be last. (so why don't we just use an enum? */
-#define EWFD_PT_FORMAT 1006
-#define EWFD_PT_SIZE 1007
-#define EWFD_PT_START_ELAPSED 1008
-
-#define EWFD_PTX_FORMAT 1009
-#define EWFD_PTX_SIZE 1010
-#define EWFD_PTX_START_ELAPSED 1011
-
-#define EWFD_FORMAT_TYPE 1020
-
-/* Save as and export dialog defines */
-#define EWFD_GZIP_CB 1040
-
-/* Export dialog defines */
-#define EWFD_CAPTURED_BTN 1000
-#define EWFD_DISPLAYED_BTN 1001
-#define EWFD_ALL_PKTS_BTN 1002
-#define EWFD_SEL_PKT_BTN 1003
-#define EWFD_MARKED_BTN 1004
-#define EWFD_FIRST_LAST_BTN 1005
-#define EWFD_RANGE_BTN 1006
-#define EWFD_RANGE_EDIT 1007
-#define EWFD_REMOVE_IGN_CB 1008
-#define EWFD_INCLUDE_DPD_CB 1009
-
-#define EWFD_ALL_PKTS_CAP 1010
-#define EWFD_SEL_PKT_CAP 1011
-#define EWFD_MARKED_CAP 1012
-#define EWFD_FIRST_LAST_CAP 1013
-#define EWFD_RANGE_CAP 1014
-#define EWFD_IGNORED_CAP 1015
-#define EWFD_DEPENDED_CAP 1016
-
-#define EWFD_ALL_PKTS_DISP 1017
-#define EWFD_SEL_PKT_DISP 1018
-#define EWFD_MARKED_DISP 1019
-#define EWFD_FIRST_LAST_DISP 1020
-#define EWFD_RANGE_DISP 1021
-#define EWFD_IGNORED_DISP 1022
-#define EWFD_DEPENDED_DISP 1023
-
-/* Merge dialog defines. Overlays Open dialog defines above. */
-#define EWFD_MERGE_PREPEND_BTN 1050
-#define EWFD_MERGE_CHRONO_BTN 1051
-#define EWFD_MERGE_APPEND_BTN 1052
-
-/* Export dialog defines. Overlays Save dialog defines above. */
-/* These MUST be contiguous */
-#define EWFD_PKT_FORMAT_GB 1050
-#define EWFD_PKT_SUMMARY_CB 1051
-#define EWFD_COL_HEADINGS_CB 1052
-#define EWFD_PKT_DETAIL_CB 1053
-#define EWFD_PKT_DETAIL_COMBO 1054
-#define EWFD_PKT_BYTES_CB 1055
-#define EWFD_DATA_SOURCES_CB 1056
-#define EWFD_PKT_NEW_PAGE_CB 1057
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/ui/ws_ui_util.h b/ui/ws_ui_util.h
index 3250559c..f16ecdb3 100644
--- a/ui/ws_ui_util.h
+++ b/ui/ws_ui_util.h
@@ -28,15 +28,16 @@ extern "C" {
/** geometry values for use in window_get_geometry() and window_set_geometry() */
typedef struct window_geometry_s {
- gchar *key; /**< current key in hashtable (internally used only) */
- gboolean set_pos; /**< set the x and y position values */
- gint x; /**< the windows x position */
- gint y; /**< the windows y position */
- gboolean set_size; /**< set the width and height values */
- gint width; /**< the windows width */
- gint height; /**< the windows height */
- gboolean set_maximized; /**< set the maximized state */
- gboolean maximized; /**< the windows maximized state */
+ char *key; /**< current key in hashtable (internally used only) */
+ bool set_pos; /**< set the x and y position values */
+ int x; /**< the windows x position */
+ int y; /**< the windows y position */
+ bool set_size; /**< set the width and height values */
+ int width; /**< the windows width */
+ int height; /**< the windows height */
+ bool set_maximized; /**< set the maximized state */
+ bool maximized; /**< the windows maximized state */
+ char* qt_geom; /**< hex bytestring from Qt's saveGeometry() */
} window_geometry_t;
/* update the main window */
@@ -51,7 +52,7 @@ WS_NORETURN extern void exit_application(int status);
files
Function names make it clear where they are coming from
*/
-void color_filter_add_cb(color_filter_t *colorf, gpointer user_data);
+void color_filter_add_cb(color_filter_t *colorf, void *user_data);
#ifdef __cplusplus
}