10 #ifndef WIRESHARK_MAIN_WINDOW_H
11 #define WIRESHARK_MAIN_WINDOW_H
56 #include <QMainWindow>
63 # include <QSocketNotifier>
78 class CaptureOptionsDialog;
88 #if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
101 Q_DECLARE_METATYPE(ts_type)
102 Q_DECLARE_METATYPE(ts_precision)
114 info_data_t *captureInfoData() {
return &info_data_; }
117 virtual QMenu *createPopupMenu();
119 CaptureFile *captureFile() {
return &capture_file_; }
121 void removeAdditionalToolbar(QString toolbarName);
123 void addInterfaceToolbar(
const iface_toolbar *toolbar_entry);
124 void removeInterfaceToolbar(
const char *menu_title);
126 QString getMwFileName();
127 void setMwFileName(QString fileName);
130 virtual bool eventFilter(QObject *obj, QEvent *event);
131 virtual bool event(QEvent *event);
132 virtual void keyPressEvent(QKeyEvent *event);
133 virtual void closeEvent(QCloseEvent *event);
134 virtual void dragEnterEvent(QDragEnterEvent *event);
135 virtual void dropEvent(QDropEvent *event);
136 virtual void changeEvent(QEvent* event);
141 MatchSelectedReplace,
149 enum FileCloseContext {
157 Ui::WiresharkMainWindow *main_ui_;
160 QMap<QString, QTextCodec *> text_codec_map_;
161 #if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
164 QWidget *previous_focus_;
166 QActionGroup *show_hide_actions_;
167 QActionGroup *time_display_actions_;
168 QActionGroup *time_precision_actions_;
170 QList<QPair<QAction *, bool> > freeze_actions_;
171 QPointer<QWidget> freeze_focus_;
172 QMap<QAction *, ts_type> td_actions;
173 QMap<QAction *, ts_precision> tp_actions;
180 bool capture_stopping_;
181 bool capture_filter_valid_;
182 bool use_capturing_title_;
185 CaptureOptionsDialog *capture_options_dialog_;
189 #if defined(Q_OS_MAC)
193 #ifdef HAVE_SOFTWARE_UPDATE
194 QAction *update_action_;
197 QPoint dragStartPosition;
199 QPointer<TLSKeylogDialog> tlskeylog_dialog_;
204 void mergeCaptureFile();
205 void importCaptureFile();
206 bool saveCaptureFile(
capture_file *cf,
bool dont_reopen);
207 bool saveAsCaptureFile(
capture_file *cf,
bool must_support_comments =
false,
bool dont_reopen =
false);
208 void exportSelectedPackets();
209 void exportDissections(export_type_e export_type);
212 void fileAddExtension(QString &file_name,
int file_type, wtap_compression_type compression_type);
214 bool testCaptureFileClose(QString before_what, FileCloseContext context = Default);
217 void findTextCodecs();
219 void initMainToolbarIcons();
220 void initShowHideMainWidgets();
221 void initTimeDisplayFormatMenu();
222 void initTimePrecisionFormatMenu();
223 void initFreezeActions();
225 void setTitlebarForCaptureInProgress();
226 void setMenusForCaptureFile(
bool force_disable =
false);
227 void setMenusForCaptureInProgress(
bool capture_in_progress =
false);
228 void setMenusForCaptureStopping();
229 void setForCapturedPackets(
bool have_captured_packets);
230 void setMenusForFileSet(
bool enable_list_files);
231 void setWindowIcon(
const QIcon &icon);
232 QString replaceWindowTitleVariables(QString title);
233 void updateStyleSheet();
235 void externalMenuHelper(
ext_menu_t * menu, QMenu * subMenu,
int depth);
237 void setForCaptureInProgress(
bool capture_in_progress =
false,
bool handle_toolbars =
false, GArray *ifaces = NULL);
238 QMenu* findOrAddMenu(QMenu *parent_menu, QString& menu_text);
240 void captureFileReadStarted(
const QString &action);
242 void addMenuActions(QList<QAction *> &actions,
int menu_group);
243 void removeMenuActions(QList<QAction *> &actions,
int menu_group);
244 void goToConversationFrame(
bool go_next);
245 void colorizeWithFilter(QByteArray filter,
int color_number = -1);
249 void closePacketDialogs();
252 void fieldFilterChanged(
const QByteArray field_filter);
256 void captureActive(
int);
261 void showExtcapOptions(QString &device_name,
bool startCaptureOnClose);
275 bool openCaptureFile(QString cf_path, QString display_filter,
unsigned int type,
bool is_tempfile =
false);
276 bool openCaptureFile(QString cf_path = QString(), QString display_filter = QString()) {
return openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO); }
277 void filterPackets(QString new_filter = QString(),
bool force =
false);
278 void updateForUnsavedChanges();
279 void layoutToolbars();
280 void updatePreferenceActions();
281 void updateRecentActions();
283 void setTitlebarForCaptureFile();
284 void setWSWindowTitle(QString title = QString());
286 void showCaptureOptionsDialog();
296 void captureFileOpened();
297 void captureFileReadFinished();
298 void captureFileClosing();
299 void captureFileClosed();
301 void launchRLCGraph(
bool channelKnown, uint8_t RAT, uint16_t ueid, uint8_t rlcMode,
302 uint16_t channelType, uint16_t channelId, uint8_t direction);
304 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
305 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
306 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
307 void rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
308 void rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
309 void rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
310 void rtpStreamsDialogSelectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
311 void rtpStreamsDialogDeselectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
319 void initViewColorizeMenu();
320 void initConversationMenus();
321 static bool addExportObjectsMenuItem(
const void *key,
void *value,
void *userdata);
322 void initExportObjectsMenus();
323 static bool addFollowStreamMenuItem(
const void *key,
void *value,
void *userdata);
324 void initFollowStreamMenus();
332 void startCapture(QStringList);
334 void popLiveCaptureInProgress();
337 void loadWindowGeometry();
338 void saveWindowGeometry();
339 void mainStackChanged(
int);
340 void updateRecentCaptures();
341 void recentActionTriggered();
342 void addPacketComment();
343 void editPacketComment();
344 void deletePacketComment();
345 void deleteCommentsFromPackets();
346 QString commentToMenuText(QString text,
int max_len = 40);
347 void setEditCommentsMenu();
348 void setMenusForSelectedPacket();
350 void interfaceSelectionChanged();
351 void captureFilterSyntaxChanged(
bool valid);
352 void redissectPackets();
353 void checkDisplayFilter();
354 void fieldsChanged();
355 void reloadLuaPlugins();
356 void showAccordionFrame(
AccordionFrame *show_frame,
bool toggle =
false);
357 void showColumnEditor(
int column);
358 void showPreferenceEditor();
359 void addStatsPluginsToMenu();
360 void addDynamicMenus();
361 void reloadDynamicMenus();
362 void addPluginIFStructures();
363 QMenu * searchSubMenu(QString objectName);
364 void activatePluginIFToolbar(
bool);
365 void updateTitlebar();
367 void startInterfaceCapture(
bool valid,
const QString capture_filter);
369 void applyGlobalCommandLineOptions();
370 void setFeaturesEnabled(
bool enabled =
true);
372 void on_actionNewDisplayFilterExpression_triggered();
373 void onFilterSelected(QString,
bool);
374 void onFilterPreferences();
375 void onFilterEdit(
int uatIndex);
378 void queuedFilterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
385 void openStatCommandDialog(
const QString &menu_path,
const char *arg,
void *userdata);
392 void openTapParameterDialog(
const QString cfg_str,
const QString arg,
void *userdata);
393 void openTapParameterDialog();
395 #if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
396 void softwareUpdateRequested();
412 void connectFileMenuActions();
413 void exportPacketBytes();
415 void stripPacketHeaders();
416 void exportTLSSessionKeys();
419 void connectEditMenuActions();
420 void copySelectedItems(WiresharkMainWindow::CopySelected selection_type);
422 void editTimeShift();
423 void editConfigurationProfiles();
424 void editTimeShiftFinished(
int);
426 void editPacketCommentFinished(
PacketCommentDialog* pc_dialog,
int result,
unsigned nComment);
427 void deleteAllPacketComments();
428 void deleteAllPacketCommentsFinished(
int result);
429 void injectSecrets();
430 void discardAllSecrets();
431 void discardAllSecretsFinished(
int result);
432 void showPreferencesDialog(QString module_name);
434 void connectViewMenuActions();
435 void showHideMainWidgets(QAction *action);
436 void setTimestampFormat(QAction *action);
437 void setTimestampPrecision(QAction *action);
438 void setTimeDisplaySecondsWithHoursAndMinutes(
bool checked);
439 void editResolvedName();
440 void setNameResolution();
442 void showColoringRulesDialog();
443 void colorizeConversation(
bool create_rule =
false);
444 void colorizeActionTriggered();
445 void openPacketDialog(
bool from_reference =
false);
446 void reloadCaptureFileAsFormatOrCapture();
447 void reloadCaptureFile();
449 void connectGoMenuActions();
451 void setPreviousFocus();
452 void resetPreviousFocus();
454 void connectCaptureMenuActions();
455 void startCaptureTriggered();
457 void connectAnalyzeMenuActions();
459 void matchFieldFilter(FilterAction::Action action, FilterAction::ActionType filter_type);
460 void applyFieldAsColumn();
462 void filterMenuAboutToShow();
464 void applyConversationFilter();
465 void applyExportObject();
467 void openFollowStreamDialog(
int proto_id,
unsigned stream_num,
unsigned sub_stream_num,
bool use_stream_index =
true);
468 void openFollowStreamDialog(
int proto_id);
470 void statCommandExpertInfo(
const char *,
void *);
472 void connectHelpMenuActions();
474 #ifdef HAVE_SOFTWARE_UPDATE
475 void checkForUpdates();
478 void goToCancelClicked();
479 void goToGoClicked();
480 void goToLineEditReturnPressed();
482 void connectStatisticsMenuActions();
484 void showResolvedAddressesDialog();
485 void showConversationsDialog();
486 void showEndpointsDialog();
488 void openTcpStreamDialog(
int graph_type);
489 void openSCTPAllAssocsDialog();
490 void on_actionSCTPShowAllAssociations_triggered();
491 void on_actionSCTPAnalyseThisAssociation_triggered();
492 void on_actionSCTPFilterThisAssociation_triggered();
493 void statCommandMulticastStatistics(
const char *arg,
void *);
495 void statCommandWlanStatistics(
const char *arg,
void *);
497 void openStatisticsTreeDialog(
const char *abbr);
498 void statCommandIOGraph(
const char *,
void *);
499 void showIOGraphDialog(io_graph_item_unit_t value_units, QString);
501 void connectTelephonyMenuActions();
506 void statCommandLteMacStatistics(
const char *arg,
void *);
507 void statCommandLteRlcStatistics(
const char *arg,
void *);
508 void openRtpStreamAnalysisDialog();
509 void openRtpPlayerDialog();
511 void connectWirelessMenuActions();
513 void connectToolsMenuActions();
515 void externalMenuItemTriggered();
517 void on_actionContextWikiProtocolPage_triggered();
518 void on_actionContextFilterFieldReference_triggered();
520 void extcap_options_finished(
int result);
521 void showExtcapOptionsDialog(QString & device_name,
bool startCaptureOnClose);
523 QString findRtpStreams(QVector<rtpstream_id_t *> *stream_ids,
bool reverse);
525 void openTLSKeylogDialog();
Definition: accordion_frame.h:18
Definition: byte_view_tab.h:29
Definition: capture_event.h:21
Definition: capture_file.h:21
Definition: file_set_dialog.h:29
Definition: filter_dialog.h:28
Definition: funnel_statistics.h:32
Definition: main_application.h:49
Definition: main_window.h:44
Definition: packet_diagram.h:26
Definition: packet_list.h:40
Definition: print_dialog.h:27
Definition: proto_tree.h:29
Definition: rtp_analysis_dialog.h:62
Definition: rtp_player_dialog.h:67
Definition: rtp_stream_dialog.h:29
Definition: welcome_page.h:27
Definition: wireless_frame.h:22
Definition: wireshark_application.h:16
Definition: wireshark_main_window.h:105
bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, bool is_tempfile=false)
Definition: wireshark_main_window_slots.cpp:191
Definition: capture_session.h:137
Definition: capture_info.h:40
Definition: packet_info.h:44
Definition: rtp_stream_id.h:33