10 #ifndef WIRESHARK_MAIN_WINDOW_H
11 #define WIRESHARK_MAIN_WINDOW_H
58 #include <QMainWindow>
65 # include <QSocketNotifier>
80 class CaptureOptionsDialog;
90 #if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
103 Q_DECLARE_METATYPE(ts_type)
104 Q_DECLARE_METATYPE(ts_precision)
116 info_data_t *captureInfoData() {
return &info_data_; }
119 virtual QMenu *createPopupMenu();
121 CaptureFile *captureFile() {
return &capture_file_; }
123 void removeAdditionalToolbar(QString toolbarName);
125 void addInterfaceToolbar(
const iface_toolbar *toolbar_entry);
126 void removeInterfaceToolbar(
const gchar *menu_title);
128 QString getMwFileName();
129 void setMwFileName(QString fileName);
132 virtual bool eventFilter(QObject *obj, QEvent *event);
133 virtual bool event(QEvent *event);
134 virtual void keyPressEvent(QKeyEvent *event);
135 virtual void closeEvent(QCloseEvent *event);
136 virtual void dragEnterEvent(QDragEnterEvent *event);
137 virtual void dropEvent(QDropEvent *event);
138 virtual void changeEvent(QEvent* event);
143 MatchSelectedReplace,
151 enum FileCloseContext {
159 Ui::WiresharkMainWindow *main_ui_;
162 QMap<QString, QTextCodec *> text_codec_map_;
163 #if defined(HAVE_LIBNL) && defined(HAVE_NL80211)
166 QWidget *previous_focus_;
168 QActionGroup *show_hide_actions_;
169 QActionGroup *time_display_actions_;
170 QActionGroup *time_precision_actions_;
172 QList<QPair<QAction *, bool> > freeze_actions_;
173 QPointer<QWidget> freeze_focus_;
174 QMap<QAction *, ts_type> td_actions;
175 QMap<QAction *, ts_precision> tp_actions;
182 bool capture_stopping_;
183 bool capture_filter_valid_;
184 bool use_capturing_title_;
187 CaptureOptionsDialog *capture_options_dialog_;
191 #if defined(Q_OS_MAC)
195 #ifdef HAVE_SOFTWARE_UPDATE
196 QAction *update_action_;
199 QPoint dragStartPosition;
201 QPointer<SSLKeylogDialog> sslkeylog_dialog_;
206 void mergeCaptureFile();
207 void importCaptureFile();
208 bool saveCaptureFile(
capture_file *cf,
bool dont_reopen);
209 bool saveAsCaptureFile(
capture_file *cf,
bool must_support_comments =
false,
bool dont_reopen =
false);
210 void exportSelectedPackets();
211 void exportDissections(export_type_e export_type);
214 void fileAddExtension(QString &file_name,
int file_type, wtap_compression_type compression_type);
216 bool testCaptureFileClose(QString before_what, FileCloseContext context = Default);
219 void findTextCodecs();
221 void initMainToolbarIcons();
222 void initShowHideMainWidgets();
223 void initTimeDisplayFormatMenu();
224 void initTimePrecisionFormatMenu();
225 void initFreezeActions();
227 void setTitlebarForCaptureInProgress();
228 void setMenusForCaptureFile(
bool force_disable =
false);
229 void setMenusForCaptureInProgress(
bool capture_in_progress =
false);
230 void setMenusForCaptureStopping();
231 void setForCapturedPackets(
bool have_captured_packets);
232 void setMenusForFileSet(
bool enable_list_files);
233 void setWindowIcon(
const QIcon &icon);
234 QString replaceWindowTitleVariables(QString title);
236 void externalMenuHelper(
ext_menu_t * menu, QMenu * subMenu, gint depth);
238 void setForCaptureInProgress(
bool capture_in_progress =
false,
bool handle_toolbars =
false, GArray *ifaces = NULL);
239 QMenu* findOrAddMenu(QMenu *parent_menu, QString& menu_text);
241 void captureFileReadStarted(
const QString &action);
243 void addMenuActions(QList<QAction *> &actions,
int menu_group);
244 void removeMenuActions(QList<QAction *> &actions,
int menu_group);
245 void goToConversationFrame(
bool go_next);
246 void colorizeWithFilter(QByteArray filter,
int color_number = -1);
250 void closePacketDialogs();
253 void fieldFilterChanged(
const QByteArray field_filter);
257 void captureActive(
int);
262 void showExtcapOptions(QString &device_name,
bool startCaptureOnClose);
276 bool openCaptureFile(QString cf_path, QString display_filter,
unsigned int type, gboolean is_tempfile = FALSE);
277 bool openCaptureFile(QString cf_path = QString(), QString display_filter = QString()) {
return openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO); }
278 void filterPackets(QString new_filter = QString(),
bool force =
false);
279 void updateForUnsavedChanges();
280 void layoutToolbars();
281 void updatePreferenceActions();
282 void updateRecentActions();
284 void setTitlebarForCaptureFile();
285 void setWSWindowTitle(QString title = QString());
287 void showCaptureOptionsDialog();
297 void captureFileOpened();
298 void captureFileReadFinished();
299 void captureFileClosing();
300 void captureFileClosed();
302 void launchRLCGraph(
bool channelKnown, guint16 ueid, guint8 rlcMode,
303 guint16 channelType, guint16 channelId, guint8 direction);
305 void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
306 void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
307 void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
308 void rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
309 void rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
310 void rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
311 void rtpStreamsDialogSelectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
312 void rtpStreamsDialogDeselectRtpStreams(QVector<rtpstream_id_t *> stream_ids);
320 void initViewColorizeMenu();
321 void initConversationMenus();
322 static bool addExportObjectsMenuItem(
const void *key,
void *value,
void *userdata);
323 void initExportObjectsMenus();
324 static bool addFollowStreamMenuItem(
const void *key,
void *value,
void *userdata);
325 void initFollowStreamMenus();
333 void startCapture(QStringList);
335 void popLiveCaptureInProgress();
338 void loadWindowGeometry();
339 void saveWindowGeometry();
340 void mainStackChanged(
int);
341 void updateRecentCaptures();
342 void recentActionTriggered();
343 void addPacketComment();
344 void editPacketComment();
345 void deletePacketComment();
346 void deleteCommentsFromPackets();
347 QString commentToMenuText(QString text,
int max_len = 40);
348 void setEditCommentsMenu();
349 void setMenusForSelectedPacket();
351 void interfaceSelectionChanged();
352 void captureFilterSyntaxChanged(
bool valid);
353 void redissectPackets();
354 void checkDisplayFilter();
355 void fieldsChanged();
356 void reloadLuaPlugins();
357 void showAccordionFrame(
AccordionFrame *show_frame,
bool toggle =
false);
358 void showColumnEditor(
int column);
359 void showPreferenceEditor();
360 void addStatsPluginsToMenu();
361 void addDynamicMenus();
362 void reloadDynamicMenus();
363 void addPluginIFStructures();
364 QMenu * searchSubMenu(QString objectName);
365 void activatePluginIFToolbar(
bool);
366 void updateTitlebar();
368 void startInterfaceCapture(
bool valid,
const QString capture_filter);
370 void applyGlobalCommandLineOptions();
371 void setFeaturesEnabled(
bool enabled =
true);
373 void on_actionNewDisplayFilterExpression_triggered();
374 void onFilterSelected(QString,
bool);
375 void onFilterPreferences();
376 void onFilterEdit(
int uatIndex);
379 void queuedFilterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
386 void openStatCommandDialog(
const QString &menu_path,
const char *arg,
void *userdata);
393 void openTapParameterDialog(
const QString cfg_str,
const QString arg,
void *userdata);
394 void openTapParameterDialog();
396 #if defined(HAVE_SOFTWARE_UPDATE) && defined(Q_OS_WIN)
397 void softwareUpdateRequested();
413 void connectFileMenuActions();
414 void exportPacketBytes();
416 void stripPacketHeaders();
417 void exportTLSSessionKeys();
420 void connectEditMenuActions();
421 void copySelectedItems(WiresharkMainWindow::CopySelected selection_type);
423 void editTimeShift();
424 void editConfigurationProfiles();
425 void editTimeShiftFinished(
int);
427 void editPacketCommentFinished(
PacketCommentDialog* pc_dialog,
int result, guint nComment);
428 void deleteAllPacketComments();
429 void deleteAllPacketCommentsFinished(
int result);
430 void injectSecrets();
431 void discardAllSecrets();
432 void discardAllSecretsFinished(
int result);
433 void showPreferencesDialog(QString module_name);
435 void connectViewMenuActions();
436 void showHideMainWidgets(QAction *action);
437 void setTimestampFormat(QAction *action);
438 void setTimestampPrecision(QAction *action);
439 void setTimeDisplaySecondsWithHoursAndMinutes(
bool checked);
440 void editResolvedName();
441 void setNameResolution();
443 void showColoringRulesDialog();
444 void colorizeConversation(
bool create_rule =
false);
445 void colorizeActionTriggered();
446 void openPacketDialog(
bool from_reference =
false);
447 void reloadCaptureFileAsFormatOrCapture();
448 void reloadCaptureFile();
450 void connectGoMenuActions();
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, guint stream_num, guint 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 gchar *abbr);
498 void statCommandIOGraph(
const char *,
void *);
500 void connectTelephonyMenuActions();
505 void statCommandLteMacStatistics(
const char *arg,
void *);
506 void statCommandLteRlcStatistics(
const char *arg,
void *);
507 void openRtpStreamAnalysisDialog();
508 void openRtpPlayerDialog();
510 void connectWirelessMenuActions();
512 void connectToolsMenuActions();
514 void externalMenuItemTriggered();
516 void on_actionContextWikiProtocolPage_triggered();
517 void on_actionContextFilterFieldReference_triggered();
519 void extcap_options_finished(
int result);
520 void showExtcapOptionsDialog(QString & device_name,
bool startCaptureOnClose);
522 QString findRtpStreams(QVector<rtpstream_id_t *> *stream_ids,
bool reverse);
524 void openBrowserKeylogDialog();
Definition: accordion_frame.h:18
Definition: byte_view_tab.h:29
Definition: capture_event.h:20
Definition: capture_file.h:23
Definition: file_set_dialog.h:31
Definition: filter_dialog.h:28
Definition: funnel_statistics.h:32
Definition: main_application.h:51
Definition: main_window.h:40
Definition: packet_diagram.h:26
Definition: packet_list.h:39
Definition: print_dialog.h:29
Definition: proto_tree.h:29
Definition: rtp_analysis_dialog.h:63
Definition: rtp_player_dialog.h:68
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:107
bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, gboolean 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