10#ifndef WIRESHARK_MAIN_WINDOW_H
11#define WIRESHARK_MAIN_WINDOW_H
61# include <QSocketNotifier>
75class CaptureOptionsDialog;
87#if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
136 info_data_t *captureInfoData() {
return &info_data_; }
253 MatchSelectedReplace,
261 Ui::WiresharkMainWindow *main_ui_;
263#if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
266 QWidget *previous_focus_;
268 QActionGroup *show_hide_actions_;
269 QActionGroup *time_display_actions_;
270 QActionGroup *time_precision_actions_;
272 QAction *action_telephony_dis_streams_;
273 QList<QPair<QAction *, bool>> freeze_actions_;
274 QPointer<QWidget> freeze_focus_;
275 QMap<QAction *, ts_type> td_actions;
276 QMap<QAction *, ts_precision> tp_actions;
284 bool capture_stopping_;
285 bool capture_filter_valid_;
288 CaptureOptionsDialog *capture_options_dialog_;
292 QPoint dragStartPosition;
294 QPointer<TLSKeylogDialog> tlskeylog_dialog_;
310 void mergeCaptureFile();
316 void importCaptureFile();
324 bool saveCaptureFile(
capture_file *cf,
bool dont_reopen);
334 bool saveAsCaptureFile(
capture_file *cf,
bool must_support_comments =
false,
bool dont_reopen =
false);
340 void exportSelectedPackets();
352 void enableAggregationView(
bool enable)
const;
362 void fileAddExtension(QString &file_name,
int file_type, ws_compression_type compression_type);
369 void captureStop(
bool discard =
false);
372 void initMainToolbarIcons();
375 void initShowHideMainWidgets();
378 void initTimeDisplayFormatMenu();
381 void initTimePrecisionFormatMenu();
384 void initFreezeActions();
390 void setMenusForCaptureFile(
bool force_disable =
false)
override;
396 void setMenusForCaptureInProgress(
bool capture_in_progress =
false);
399 void setMenusForCaptureStopping();
405 void setForCapturedPackets(
bool have_captured_packets);
411 void setMenusForFileSet(
bool enable_list_files);
416 void updateStyleSheet();
424 void externalMenuHelper(
ext_menu_t *menu, QMenu *subMenu,
int depth);
433 void setForCaptureInProgress(
bool capture_in_progress =
false,
bool handle_toolbars =
false, GArray *ifaces = NULL);
442 QMenu *findOrAddMenu(QMenu *parent_menu,
const QStringList &menu_parts);
450 QMenu *findOrAddMenubar(
const QString menu_text);
456 void captureFileReadStarted(
const QString &action);
463 void addMenusandSubmenus(QAction *action, QMenu *cur_menu);
470 void removeMenusandSubmenus(QAction *action, QMenu *cur_menu);
477 void addMenuActions(QList<QAction *> &actions,
int menu_group);
484 void removeMenuActions(QList<QAction *> &actions,
int menu_group);
491 void goToConversationFrame(
bool go_next,
bool start_current =
true);
498 void colorizeWithFilter(QByteArray filter,
int color_number = -1);
543 void showExtcapOptions(QString &device_name,
bool startCaptureOnClose);
565 bool openCaptureFile(QString cf_path, QString display_filter,
unsigned int type,
bool is_tempfile =
false);
580 void filterPackets(QString new_filter = QString(),
bool force =
false)
override;
655 void launchRLCGraph(
bool channelKnown, uint8_t RAT, uint16_t ueid, uint8_t rlcMode,
656 uint16_t channelType, uint16_t channelId, uint8_t direction);
660 void openLuaDebuggerDialog();
719 void initViewColorizeMenu();
722 void initConversationMenus();
731 static bool addExportObjectsMenuItem(
const void *key,
void *value,
void *userdata);
734 void initExportObjectsMenus();
743 static bool addFollowStreamMenuItem(
const void *key,
void *value,
void *userdata);
746 void initFollowStreamMenus();
752 void startCapture(QStringList interfaces);
758 void pushLiveCaptureInProgress();
761 void popLiveCaptureInProgress();
770 void aggregationViewChanged(
bool enable)
const;
773 void loadWindowGeometry();
776 void saveWindowGeometry();
781 void mainStackChanged(
int);
784 void updateRecentCaptures();
787 void addPacketComment();
790 void editPacketComment();
793 void deletePacketComment();
796 void deleteCommentsFromPackets();
804 QString commentToMenuText(QString text,
int max_len = 40);
807 void setEditCommentsMenu();
810 void setMenusForSelectedPacket();
819 void interfaceSelectionChanged();
825 void captureFilterSyntaxChanged(
bool valid);
828 void redissectPackets();
831 void checkDisplayFilter();
834 void fieldsChanged();
837 void reloadLuaPlugins();
844 void showAccordionFrame(
AccordionFrame *show_frame,
bool toggle =
false);
850 void showColumnEditor(
int column);
853 void showPreferenceEditor();
856 void addStatsPluginsToMenu();
859 void addDynamicMenus();
862 void reloadDynamicMenus();
865 void addPluginIFStructures();
872 QMenu *searchSubMenu(QString objectName);
877 void activatePluginIFToolbar(
bool);
884 void startInterfaceCapture(
bool valid,
const QString capture_filter);
888 void applyGlobalCommandLineOptions();
894 void setFeaturesEnabled(
bool enabled =
true);
897 void on_actionNewDisplayFilterExpression_triggered();
904 void onFilterSelected(QString filterText,
bool prepare);
907 void onFilterPreferences();
913 void onFilterEdit(
int uatIndex);
929 void openStatCommandDialog(
const QString &menu_path,
const char *arg,
void *userdata);
937 void openTapParameterDialog(
const QString cfg_str,
const QString arg,
void *userdata);
940 void openTapParameterDialog();
943 void connectFileMenuActions();
946 void exportPacketBytes();
952 void stripPacketHeaders();
955 void exportTLSSessionKeys();
961 void connectEditMenuActions();
973 void on_actionEditFindInPacket_triggered();
976 void editTimeShift();
979 void editConfigurationProfiles();
985 void editTimeShiftFinished(
int result);
1000 void editPacketCommentFinished(
PacketCommentDialog *pc_dialog,
int result,
unsigned nComment);
1003 void deleteAllPacketComments();
1009 void deleteAllPacketCommentsFinished(
int result);
1016 void injectSecrets(
const char *proto_name,
const char *wiki_link);
1019 void discardAllSecrets();
1025 void discardAllSecretsFinished(
int result);
1031 void showPreferencesDialog(QString module_name)
override;
1034 void connectViewMenuActions();
1040 void showHideMainWidgets(QAction *action);
1046 void setTimestampFormat(QAction *action);
1052 void setTimestampPrecision(QAction *action);
1058 void setTimeDisplaySecondsWithHoursAndMinutes(
bool checked);
1061 void editResolvedName();
1064 void setNameResolution();
1070 void showColoringRulesDialog();
1077 void colorizeConversation(
bool create_rule =
false);
1080 void colorizeActionTriggered();
1086 void openPacketDialog(
bool from_reference =
false);
1089 void reloadCaptureFileAsFormatOrCapture();
1092 void reloadCaptureFile();
1095 void connectGoMenuActions();
1098 void setPreviousFocus();
1101 void resetPreviousFocus();
1104 void connectCaptureMenuActions();
1107 void startCaptureTriggered();
1110 void connectAnalyzeMenuActions();
1121 void applyFieldAsColumn();
1124 void filterMenuAboutToShow();
1127 void applyConversationFilter();
1130 void applyExportObject();
1139 void openFollowStreamDialog(
int proto_id,
unsigned stream_num,
unsigned sub_stream_num,
bool use_stream_index =
true);
1145 void openFollowStreamDialog(
int proto_id);
1153 void openIOGraph(
bool filtered, QVector<uint> conv_ids, QVector<QVariant> conv_agg);
1158 void statCommandExpertInfo(
const char *,
void *);
1161 void connectHelpMenuActions();
1164 void goToCancelClicked();
1167 void goToGoClicked();
1170 void goToLineEditReturnPressed();
1173 void connectStatisticsMenuActions();
1176 void showResolvedAddressesDialog();
1179 void showConversationsDialog();
1182 void showEndpointsDialog();
1188 void openTcpStreamDialog(
int graph_type);
1191 void openSCTPAllAssocsDialog();
1194 void on_actionSCTPShowAllAssociations_triggered();
1197 void on_actionSCTPAnalyseThisAssociation_triggered();
1200 void on_actionSCTPFilterThisAssociation_triggered();
1205 void statCommandMulticastStatistics(
const char *,
void *);
1210 void statCommandWlanStatistics(
const char *,
void *);
1216 void openStatisticsTreeDialog(
const char *abbr);
1221 void statCommandIOGraph(
const char *,
void *);
1235 void showPlotDialog(
const QString &y_field = QString(),
bool filtered =
false)
override;
1238 void connectTelephonyMenuActions();
1268 void statCommandLteMacStatistics(
const char *arg,
void *);
1274 void statCommandLteRlcStatistics(
const char *arg,
void *);
1277 void openRtpStreamAnalysisDialog();
1280 void openRtpPlayerDialog();
1283 void connectWirelessMenuActions();
1286 void connectToolsMenuActions();
1289 void externalMenuItemTriggered();
1292 void on_actionContextWikiProtocolPage_triggered();
1295 void on_actionContextFilterFieldReference_triggered();
1301 void extcap_options_finished(
int result);
1308 void showExtcapOptionsDialog(QString device_name,
bool startCaptureOnClose);
1317 QString findRtpStreams(QVector<rtpstream_id_t *> *stream_ids,
bool reverse);
1320 void openTLSKeylogDialog();
A QFrame that shows and hides itself with a slide animation.
Definition accordion_frame.h:21
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
A tab widget that manages and displays different data sources for a packet (e.g., Hex,...
Definition data_source_tab.h:36
A dialog for viewing and managing DIS (Distributed Interactive Simulation) streams from a capture fil...
Definition dis_stream_dialog.h:34
A dialog for managing and displaying capture file sets.
Definition file_set_dialog.h:32
Action
Defines an action to be taken with a filter.
Definition filter_action.h:30
ActionType
Defines how the new filter should be combined with the existing one.
Definition filter_action.h:43
A dialog for managing and editing capture filters, display filters, and display macros.
Definition filter_dialog.h:31
Manages statistics and user interface interactions for Lua-based funnel plugins.
Definition funnel_statistics.h:35
Find bar widget for searching within a specific packet's protocol tree.
Definition in_packet_find_bar.h:28
Core application class handling global state, signals, and configurations.
Definition main_application.h:39
The main window of the application.
Definition main_window.h:51
CopySelected
Enumeration for determining what to copy when items are selected.
Definition main_window.h:211
CaptureFile capture_file_
Definition main_window.h:278
FileCloseContext
Context under which a capture file is being closed.
Definition main_window.h:235
@ Default
Default closing context.
Definition main_window.h:237
A graphics view widget for displaying protocol packet diagrams.
Definition packet_diagram.h:29
The main packet list view for displaying captured packets.
Definition packet_list.h:45
Dialog that provides packet print and print-preview functionality for a live or saved capture file.
Definition print_dialog.h:31
A tree view for displaying protocol dissection details.
Definition proto_tree.h:30
Singleton dialog for analyzing RTP streams.
Definition rtp_analysis_dialog.h:102
Singleton dialog for playing and analyzing RTP audio streams. Singleton pattern based on https://refa...
Definition rtp_player_dialog.h:112
Singleton dialog for viewing and managing RTP streams. Singleton pattern based on https://refactoring...
Definition rtp_stream_dialog.h:32
Widget displayed on application startup, providing interface selection, capture filter configuration,...
Definition welcome_page.h:31
Toolbar frame that exposes 802.11 wireless interface controls — channel, channel type,...
Definition wireless_frame.h:27
Top-level Qt application object for the Wireshark GUI.
Definition wireshark_application.h:19
Wireshark main application window, extending MainWindow with the full Wireshark feature set including...
Definition wireshark_main_window.h:109
bool event(QEvent *event) override
Handles window-level events such as activation changes.
Definition wireshark_main_window.cpp:961
bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, bool is_tempfile=false)
Opens a capture file.
Definition wireshark_main_window_slots.cpp:199
void captureFileReadFinished()
Updates UI state after a capture file has been fully read.
Definition wireshark_main_window_slots.cpp:808
void rtpPlayerDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Adds streams to the RTP Player dialog.
Definition wireshark_main_window_slots.cpp:4286
void updateAggregationView() const
Refreshes the packet aggregation view to reflect the current capture state.
Definition wireshark_main_window_slots.cpp:450
void launchRLCGraph(bool channelKnown, uint8_t RAT, uint16_t ueid, uint8_t rlcMode, uint16_t channelType, uint16_t channelId, uint8_t direction)
Opens the LTE RLC graph dialog for a specific channel.
Definition wireshark_main_window_slots.cpp:3924
void openRecentCaptureFile(const QString &filename) override
Opens the given recent capture file, handling any necessary prompts.
Definition wireshark_main_window_slots.cpp:1069
void keyPressEvent(QKeyEvent *event) override
Handles key press events for global keyboard shortcuts.
Definition wireshark_main_window.cpp:975
void dropEvent(QDropEvent *event) override
Opens a capture file dropped onto the window.
Definition wireshark_main_window.cpp:1108
void rtpPlayerDialogReplaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Replaces all streams in the RTP Player dialog with the given stream list.
Definition wireshark_main_window_slots.cpp:4279
QMenu * createPopupMenu() override
Creates and returns the window's right-click popup menu.
Definition wireshark_main_window.cpp:814
void removeInterfaceToolbar(const char *menu_title)
Removes the interface toolbar with the given menu title.
Definition wireshark_main_window.cpp:890
void rtpAnalysisDialogReplaceRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Replaces all streams in the RTP Analysis dialog with the given stream list.
Definition wireshark_main_window_slots.cpp:4300
void setFunnelMenus(void)
Rebuilds the Lua funnel statistics menus from registered funnel entries.
Definition wireshark_main_window.cpp:3039
void changeEvent(QEvent *event) override
Responds to locale or palette changes by retranslating the UI.
Definition wireshark_main_window.cpp:2627
bool eventFilter(QObject *obj, QEvent *event) override
Filters events on watched objects (e.g. focus changes on child widgets).
Definition wireshark_main_window.cpp:943
void updatePreferenceActions()
Refreshes menu items that reflect preference values.
Definition wireshark_main_window_slots.cpp:387
void rtpPlayerDialogRemoveRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Removes streams from the RTP Player dialog.
Definition wireshark_main_window_slots.cpp:4293
void packetInfoChanged(struct _packet_info *pinfo)
Emitted when the selected packet changes, providing the new packet info.
void setTitlebarForCaptureFile()
Updates the window title bar to reflect the current capture file name and state.
Definition wireshark_main_window.cpp:2452
void dragEnterEvent(QDragEnterEvent *event) override
Accepts drag-enter events for capture files dragged onto the window.
Definition wireshark_main_window.cpp:1077
void rtpStreamsDialogSelectRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Selects the given streams in the RTP Streams dialog.
Definition wireshark_main_window_slots.cpp:4315
void captureFileClosing()
Updates UI state while a capture file is being closed.
Definition wireshark_main_window_slots.cpp:834
void setDissectedCaptureFile(capture_file *cf)
Emitted when a dissected capture file becomes the active file.
void updateRecentActions()
Rebuilds the File → Open Recent submenu from the recent-files list.
Definition wireshark_main_window_slots.cpp:403
CaptureFile * captureFile()
Returns a pointer to the current capture file object.
Definition wireshark_main_window.h:149
void rtpAnalysisDialogAddRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Adds streams to the RTP Analysis dialog.
Definition wireshark_main_window_slots.cpp:4305
void selectRtpStream(rtpstream_id_t *id)
Emitted to request that an RTP stream be selected in all interested dialogs.
void deselectRtpStream(rtpstream_id_t *id)
Emitted to request that an RTP stream be deselected in all interested dialogs.
void rtpAnalysisDialogRemoveRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Removes streams from the RTP Analysis dialog.
Definition wireshark_main_window_slots.cpp:4310
void captureFileOpened()
Updates UI state when a capture file is first opened.
Definition wireshark_main_window_slots.cpp:781
bool openCaptureFile(QString cf_path=QString(), QString display_filter=QString())
Convenience overload that auto-detects file type.
Definition wireshark_main_window.h:573
void layoutToolbars()
Repositions and resizes toolbars according to current layout settings.
Definition wireshark_main_window_slots.cpp:333
~WiresharkMainWindow()
Destroys the main window and releases all associated resources.
Definition wireshark_main_window.cpp:792
void captureFileClosed()
Resets UI state after a capture file has been fully closed.
Definition wireshark_main_window_slots.cpp:849
void reloadFields()
Emitted to request that all views reload their field definitions.
void filterPackets(QString new_filter=QString(), bool force=false) override
Applies a new display filter to the open capture file.
Definition wireshark_main_window_slots.cpp:307
void showCaptureOptionsDialog()
Opens the capture options dialog (interface selection, filters, etc.).
Definition wireshark_main_window_slots.cpp:3114
void closeEvent(QCloseEvent *event) override
Prompts the user to save unsaved changes before closing the window.
Definition wireshark_main_window.cpp:1015
void setMwFileName(QString fileName)
Sets the file path shown in the main window title bar.
Definition wireshark_main_window.cpp:3078
bool tryClosingCaptureFile(QString before_what, FileCloseContext context=Default) override
Attempts to close the current capture file, prompting the user to save if there are unsaved changes.
Definition wireshark_main_window.cpp:1860
void closePacketDialogs()
Emitted to request that all packet-detail dialogs close themselves.
QString getMwFileName()
Returns the file path currently shown in the main window title bar.
Definition wireshark_main_window.cpp:3073
void addInterfaceToolbar(const iface_toolbar *toolbar_entry)
Adds an interface toolbar for the given toolbar descriptor.
Definition wireshark_main_window.cpp:847
void rtpStreamsDialogDeselectRtpStreams(QVector< rtpstream_id_t * > stream_ids)
Deselects the given streams in the RTP Streams dialog.
Definition wireshark_main_window_slots.cpp:4320
void removeAdditionalToolbar(QString toolbarName)
Removes an additional (plugin/interface) toolbar by name.
Definition wireshark_main_window.cpp:3044
void fieldFilterChanged(const QByteArray field_filter)
Emitted when the field-based display filter changes.
export_type_e
Output format for packet data export operations.
Definition file_dialog.h:32
io_graph_item_unit_t
Selects the Y-axis value unit or aggregate calculation mode for an I/O graph plot.
Definition io_graph_item.h:29
Represents a capture file and its associated metadata.
Definition cfile.h:84
Opaque handle representing an active or pending capture session.
Definition capture_session.h:142
Definition capture_info.h:40
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Definition rtp_stream_id.h:33
ts_precision
Sub-second precision used when formatting packet timestamps.
Definition timestamp.h:43
ts_type
Format used to display packet timestamps in the summary packet list.
Definition timestamp.h:22