47 #include "ui/ws_ui_util.h" 48 #include "ui/iface_toolbar.h" 50 #include <epan/prefs.h> 51 #include <epan/plugin_if.h> 52 #include <epan/timestamp.h> 57 #include <capchild/capture_session.h> 59 #include <QMainWindow> 66 # include <QSocketNotifier> 69 #include "capture_file.h" 70 #include "capture_file_dialog.h" 71 #include "capture_file_properties_dialog.h" 72 #include <ui/qt/utils/field_information.h> 73 #include <ui/qt/widgets/display_filter_combo.h> 74 #include "filter_action.h" 75 #include "follow_stream_dialog.h" 76 #include <ui/qt/models/pref_models.h> 80 class CaptureInterfacesDialog;
97 Q_DECLARE_METATYPE(ts_type)
98 Q_DECLARE_METATYPE(ts_precision)
107 void setPipeInputHandler(gint source, gpointer user_data, ws_process_id *child_process, pipe_input_cb_t input_cb);
112 info_data_t *captureInfoData() {
return &info_data_; }
115 virtual QMenu *createPopupMenu();
117 void gotoFrame(
int packet_num);
118 CaptureFile *captureFile() {
return &capture_file_; }
120 void removeAdditionalToolbar(QString toolbarName);
122 void addInterfaceToolbar(
const iface_toolbar *toolbar_entry);
123 void removeInterfaceToolbar(
const gchar *menu_title);
125 QString getMwFileName();
126 void setMwFileName(QString fileName);
129 virtual bool eventFilter(QObject *obj, QEvent *event);
130 virtual void keyPressEvent(QKeyEvent *event);
131 virtual void closeEvent(QCloseEvent *event);
132 virtual void dragEnterEvent(QDragEnterEvent *event);
133 virtual void dropEvent(QDropEvent *event);
134 virtual void changeEvent(QEvent* event);
135 virtual void resizeEvent(QResizeEvent *event);
141 MatchSelectedReplace,
151 CopyAllVisibleSelectedTreeItems,
152 CopySelectedDescription,
153 CopySelectedFieldName,
157 enum FileCloseContext {
165 QSplitter master_split_;
166 QSplitter extra_split_;
167 QVector<unsigned> cur_layout_;
178 QWidget *previous_focus_;
181 QActionGroup *show_hide_actions_;
182 QActionGroup *time_display_actions_;
183 QActionGroup *time_precision_actions_;
185 QList<QPair<QAction *, bool> > freeze_actions_;
186 QPointer<QWidget> freeze_focus_;
187 QMap<QAction *, ts_type> td_actions;
188 QMap<QAction *, ts_precision> tp_actions;
196 bool capture_stopping_;
197 bool capture_filter_valid_;
200 CaptureInterfacesDialog *capture_interfaces_dialog_;
208 gpointer pipe_user_data_;
209 ws_process_id *pipe_child_process_;
210 pipe_input_cb_t pipe_input_cb_;
214 QSocketNotifier *pipe_notifier_;
217 #if defined(Q_OS_MAC) 221 #ifdef HAVE_SOFTWARE_UPDATE 222 QAction *update_action_;
225 QPoint dragStartPosition;
227 QWidget* getLayoutWidget(layout_pane_content_e type);
232 void mergeCaptureFile();
233 void importCaptureFile();
234 bool saveCaptureFile(
capture_file *cf,
bool dont_reopen);
235 bool saveAsCaptureFile(
capture_file *cf,
bool must_support_comments =
false,
bool dont_reopen =
false);
236 void exportSelectedPackets();
237 void exportDissections(export_type_e export_type);
240 void fileAddExtension(QString &file_name,
int file_type,
bool compressed);
242 bool testCaptureFileClose(QString before_what, FileCloseContext context = Default);
245 void initMainToolbarIcons();
246 void initShowHideMainWidgets();
247 void initTimeDisplayFormatMenu();
248 void initTimePrecisionFormatMenu();
249 void initFreezeActions();
251 void setTitlebarForCaptureInProgress();
252 void setMenusForCaptureFile(
bool force_disable =
false);
253 void setMenusForCaptureInProgress(
bool capture_in_progress =
false);
254 void setMenusForCaptureStopping();
255 void setForCapturedPackets(
bool have_captured_packets);
256 void setMenusForFileSet(
bool enable_list_files);
257 void setWindowIcon(
const QIcon &icon);
258 QString replaceWindowTitleVariables(QString title);
260 void externalMenuHelper(
ext_menu_t * menu, QMenu * subMenu, gint depth);
262 void setForCaptureInProgress(
bool capture_in_progress =
false, GArray *ifaces = NULL);
263 QMenu* findOrAddMenu(QMenu *parent_menu, QString& menu_text);
265 void captureFileReadStarted(
const QString &action);
267 void addMenuActions(QList<QAction *> &actions,
int menu_group);
268 void removeMenuActions(QList<QAction *> &actions,
int menu_group);
269 void goToConversationFrame(
bool go_next);
270 void colorizeWithFilter(QByteArray filter,
int color_number = -1);
272 void createByteViewDialog();
277 void displayFilterSuccess(
bool success);
278 void closePacketDialogs();
281 void fieldFilterChanged(
const QByteArray field_filter);
282 void filterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
287 void frameSelected(
int);
288 void captureActive(
int);
300 bool openCaptureFile(QString cf_path, QString display_filter,
unsigned int type, gboolean is_tempfile = FALSE);
301 bool openCaptureFile(QString cf_path = QString(), QString display_filter = QString()) {
return openCaptureFile(cf_path, display_filter, WTAP_TYPE_AUTO); }
302 void filterPackets(QString new_filter = QString(),
bool force =
false);
303 void updateForUnsavedChanges();
305 void applyRecentPaneGeometry();
306 void layoutToolbars();
307 void updatePreferenceActions();
308 void updateRecentActions();
310 void setTitlebarForCaptureFile();
311 void setWSWindowTitle(QString title = QString());
319 void captureFileOpened();
320 void captureFileReadFinished();
321 void captureFileClosing();
322 void captureFileClosed();
324 void filterExpressionsChanged();
325 static gboolean filter_expression_add_action(
const void *key,
void *value,
void *user_data);
327 void launchRLCGraph(
bool channelKnown, guint16 ueid, guint8 rlcMode,
328 guint16 channelType, guint16 channelId, guint8 direction);
330 void on_actionViewFullScreen_triggered(
bool checked);
332 int uatRowIndexForFilterExpression(QString label, QString expression);
340 void initViewColorizeMenu();
341 void initConversationMenus();
342 static gboolean addExportObjectsMenuItem(
const void *key,
void *value,
void *userdata);
343 void initExportObjectsMenus();
353 void pipeActivated(
int source);
354 void pipeNotifierDestroyed();
357 void loadWindowGeometry();
358 void saveWindowGeometry();
359 void mainStackChanged(
int);
360 void updateRecentCaptures();
361 void recentActionTriggered();
362 void setMenusForSelectedPacket();
364 void interfaceSelectionChanged();
365 void captureFilterSyntaxChanged(
bool valid);
366 void redissectPackets();
367 void checkDisplayFilter();
368 void fieldsChanged();
369 void reloadLuaPlugins();
370 void showAccordionFrame(
AccordionFrame *show_frame,
bool toggle =
false);
371 void showColumnEditor(
int column);
372 void showPreferenceEditor();
373 void addStatsPluginsToMenu();
374 void addDynamicMenus();
375 void reloadDynamicMenus();
376 void addPluginIFStructures();
377 QMenu * searchSubMenu(QString objectName);
378 void activatePluginIFToolbar(
bool);
380 void filterToolbarCustomMenuHandler(
const QPoint& globalPos);
381 void filterToolbarShowPreferences();
382 void filterToolbarEditFilter();
383 void filterToolbarDisableFilter();
384 void filterToolbarRemoveFilter();
385 void filterToolbarActionMoved(QAction * action,
int oldPos,
int newPos);
386 void filterDropped(QString description, QString filter);
388 void startInterfaceCapture(
bool valid,
const QString capture_filter);
390 void applyGlobalCommandLineOptions();
391 void setFeaturesEnabled(
bool enabled =
true);
393 void on_actionDisplayFilterExpression_triggered();
394 void on_actionNewDisplayFilterExpression_triggered();
395 void displayFilterButtonClicked();
398 void queuedFilterAction(QString filter, FilterAction::Action action, FilterAction::ActionType type);
405 void openStatCommandDialog(
const QString &menu_path,
const char *arg,
void *userdata);
412 void openTapParameterDialog(
const QString cfg_str,
const QString arg,
void *userdata);
413 void openTapParameterDialog();
415 #ifdef HAVE_SOFTWARE_UPDATE 416 void softwareUpdateRequested();
432 void on_actionFileOpen_triggered();
433 void on_actionFileMerge_triggered();
434 void on_actionFileImportFromHexDump_triggered();
435 void on_actionFileClose_triggered();
436 void on_actionFileSave_triggered();
437 void on_actionFileSaveAs_triggered();
438 void on_actionFileSetListFiles_triggered();
439 void on_actionFileSetNextFile_triggered();
440 void on_actionFileSetPreviousFile_triggered();
441 void on_actionFileExportPackets_triggered();
442 void on_actionFileExportAsPlainText_triggered();
444 void on_actionFileExportAsCSV_triggered();
445 void on_actionFileExportAsCArrays_triggered();
446 void on_actionFileExportAsPSML_triggered();
447 void on_actionFileExportAsPDML_triggered();
448 void on_actionFileExportAsJSON_triggered();
449 void on_actionFileExportPacketBytes_triggered();
450 void on_actionFilePrint_triggered();
452 void on_actionFileExportPDU_triggered();
453 void on_actionFileExportSSLSessionKeys_triggered();
455 void actionEditCopyTriggered(MainWindow::CopySelected selection_type);
456 void on_actionCopyAllVisibleItems_triggered();
457 void on_actionCopyAllVisibleSelectedTreeItems_triggered();
458 void on_actionEditCopyDescription_triggered();
459 void on_actionEditCopyFieldName_triggered();
460 void on_actionEditCopyValue_triggered();
461 void on_actionEditCopyAsFilter_triggered();
462 void on_actionEditFindPacket_triggered();
463 void on_actionEditFindNext_triggered();
464 void on_actionEditFindPrevious_triggered();
465 void on_actionEditMarkPacket_triggered();
466 void on_actionEditMarkAllDisplayed_triggered();
467 void on_actionEditUnmarkAllDisplayed_triggered();
468 void on_actionEditNextMark_triggered();
469 void on_actionEditPreviousMark_triggered();
470 void on_actionEditIgnorePacket_triggered();
471 void on_actionEditIgnoreAllDisplayed_triggered();
472 void on_actionEditUnignoreAllDisplayed_triggered();
473 void on_actionEditSetTimeReference_triggered();
474 void on_actionEditUnsetAllTimeReferences_triggered();
475 void on_actionEditNextTimeReference_triggered();
476 void on_actionEditPreviousTimeReference_triggered();
477 void on_actionEditTimeShift_triggered();
478 void on_actionEditPacketComment_triggered();
479 void on_actionDeleteAllPacketComments_triggered();
480 void on_actionEditConfigurationProfiles_triggered();
481 void showPreferencesDialog(QString pane_name);
482 void on_actionEditPreferences_triggered();
484 void showHideMainWidgets(QAction *action);
485 void setTimestampFormat(QAction *action);
486 void setTimestampPrecision(QAction *action);
487 void on_actionViewTimeDisplaySecondsWithHoursAndMinutes_triggered(
bool checked);
488 void on_actionViewEditResolvedName_triggered();
489 void setNameResolution();
490 void on_actionViewNameResolutionPhysical_triggered();
491 void on_actionViewNameResolutionNetwork_triggered();
492 void on_actionViewNameResolutionTransport_triggered();
495 void on_actionViewZoomIn_triggered();
496 void on_actionViewZoomOut_triggered();
497 void on_actionViewNormalSize_triggered();
498 void on_actionViewColorizePacketList_triggered(
bool checked);
499 void on_actionViewColoringRules_triggered();
500 void colorizeConversation(
bool create_rule =
false);
501 void colorizeActionTriggered();
502 void on_actionViewColorizeResetColorization_triggered();
503 void on_actionViewColorizeNewColoringRule_triggered();
504 void on_actionViewResetLayout_triggered();
505 void on_actionViewResizeColumns_triggered();
507 void on_actionViewInternalsConversationHashTables_triggered();
508 void on_actionViewInternalsDissectorTables_triggered();
509 void on_actionViewInternalsSupportedProtocols_triggered();
511 void openPacketDialog(
bool from_reference =
false);
512 void on_actionViewShowPacketInNewWindow_triggered();
513 void on_actionContextShowLinkedPacketInNewWindow_triggered();
514 void on_actionViewReload_triggered();
515 void on_actionViewReload_as_File_Format_or_Capture_triggered();
517 void on_actionGoGoToPacket_triggered();
518 void on_actionGoGoToLinkedPacket_triggered();
519 void on_actionGoNextConversationPacket_triggered();
520 void on_actionGoPreviousConversationPacket_triggered();
521 void on_actionGoAutoScroll_toggled(
bool checked);
522 void resetPreviousFocus();
524 void on_actionCaptureOptions_triggered();
526 void on_actionCaptureRefreshInterfaces_triggered();
528 void on_actionCaptureCaptureFilters_triggered();
530 void on_actionAnalyzeDisplayFilters_triggered();
531 void on_actionAnalyzeDisplayFilterMacros_triggered();
532 void matchFieldFilter(FilterAction::Action action, FilterAction::ActionType filter_type);
533 void on_actionAnalyzeCreateAColumn_triggered();
534 void on_actionAnalyzeAAFSelected_triggered();
535 void on_actionAnalyzeAAFNotSelected_triggered();
536 void on_actionAnalyzeAAFAndSelected_triggered();
537 void on_actionAnalyzeAAFOrSelected_triggered();
538 void on_actionAnalyzeAAFAndNotSelected_triggered();
539 void on_actionAnalyzeAAFOrNotSelected_triggered();
540 void on_actionAnalyzePAFSelected_triggered();
541 void on_actionAnalyzePAFNotSelected_triggered();
542 void on_actionAnalyzePAFAndSelected_triggered();
543 void on_actionAnalyzePAFOrSelected_triggered();
544 void on_actionAnalyzePAFAndNotSelected_triggered();
545 void on_actionAnalyzePAFOrNotSelected_triggered();
547 void applyConversationFilter();
548 void applyExportObject();
550 void on_actionAnalyzeEnabledProtocols_triggered();
551 void on_actionAnalyzeDecodeAs_triggered();
552 void on_actionAnalyzeReloadLuaPlugins_triggered();
554 void openFollowStreamDialog(follow_type_t type,
int stream_num = -1);
555 void on_actionAnalyzeFollowTCPStream_triggered();
556 void on_actionAnalyzeFollowUDPStream_triggered();
557 void on_actionAnalyzeFollowSSLStream_triggered();
558 void on_actionAnalyzeFollowHTTPStream_triggered();
559 void statCommandExpertInfo(
const char *,
void *);
560 void on_actionAnalyzeExpertInfo_triggered();
562 void on_actionHelpContents_triggered();
563 void on_actionHelpMPWireshark_triggered();
564 void on_actionHelpMPWireshark_Filter_triggered();
565 void on_actionHelpMPCapinfos_triggered();
566 void on_actionHelpMPDumpcap_triggered();
567 void on_actionHelpMPEditcap_triggered();
568 void on_actionHelpMPMergecap_triggered();
569 void on_actionHelpMPRawShark_triggered();
570 void on_actionHelpMPReordercap_triggered();
571 void on_actionHelpMPText2cap_triggered();
572 void on_actionHelpMPTShark_triggered();
573 void on_actionHelpWebsite_triggered();
574 void on_actionHelpFAQ_triggered();
575 void on_actionHelpAsk_triggered();
576 void on_actionHelpDownloads_triggered();
577 void on_actionHelpWiki_triggered();
578 void on_actionHelpSampleCaptures_triggered();
579 void on_actionHelpAbout_triggered();
581 #ifdef HAVE_SOFTWARE_UPDATE 582 void checkForUpdates();
585 void on_goToCancel_clicked();
586 void on_goToGo_clicked();
587 void on_goToLineEdit_returnPressed();
588 void on_actionCaptureStart_triggered();
589 void on_actionCaptureStop_triggered();
590 void on_actionCaptureRestart_triggered();
592 void on_actionStatisticsCaptureFileProperties_triggered();
593 void on_actionStatisticsResolvedAddresses_triggered();
594 void on_actionStatisticsProtocolHierarchy_triggered();
595 void on_actionStatisticsFlowGraph_triggered();
596 void openTcpStreamDialog(
int graph_type);
597 void on_actionStatisticsTcpStreamStevens_triggered();
598 void on_actionStatisticsTcpStreamTcptrace_triggered();
599 void on_actionStatisticsTcpStreamThroughput_triggered();
600 void on_actionStatisticsTcpStreamRoundTripTime_triggered();
601 void on_actionStatisticsTcpStreamWindowScaling_triggered();
602 void openSCTPAllAssocsDialog();
603 void on_actionSCTPShowAllAssociations_triggered();
604 void on_actionSCTPAnalyseThisAssociation_triggered();
605 void on_actionSCTPFilterThisAssociation_triggered();
606 void statCommandMulticastStatistics(
const char *arg,
void *);
607 void on_actionStatisticsUdpMulticastStreams_triggered();
609 void statCommandWlanStatistics(
const char *arg,
void *);
610 void on_actionWirelessWlanStatistics_triggered();
612 void openStatisticsTreeDialog(
const gchar *abbr);
613 void on_actionStatistics29WestTopics_Advertisements_by_Topic_triggered();
614 void on_actionStatistics29WestTopics_Advertisements_by_Source_triggered();
615 void on_actionStatistics29WestTopics_Advertisements_by_Transport_triggered();
616 void on_actionStatistics29WestTopics_Queries_by_Topic_triggered();
617 void on_actionStatistics29WestTopics_Queries_by_Receiver_triggered();
618 void on_actionStatistics29WestTopics_Wildcard_Queries_by_Pattern_triggered();
619 void on_actionStatistics29WestTopics_Wildcard_Queries_by_Receiver_triggered();
620 void on_actionStatistics29WestQueues_Advertisements_by_Queue_triggered();
621 void on_actionStatistics29WestQueues_Advertisements_by_Source_triggered();
622 void on_actionStatistics29WestQueues_Queries_by_Queue_triggered();
623 void on_actionStatistics29WestQueues_Queries_by_Receiver_triggered();
624 void on_actionStatistics29WestUIM_Streams_triggered();
625 void on_actionStatistics29WestLBTRM_triggered();
626 void on_actionStatistics29WestLBTRU_triggered();
627 void on_actionStatisticsANCP_triggered();
628 void on_actionStatisticsBACappInstanceId_triggered();
629 void on_actionStatisticsBACappIP_triggered();
630 void on_actionStatisticsBACappObjectId_triggered();
631 void on_actionStatisticsBACappService_triggered();
632 void on_actionStatisticsCollectd_triggered();
633 void statCommandConversations(
const char *arg = NULL,
void *userdata = NULL);
634 void on_actionStatisticsConversations_triggered();
635 void statCommandEndpoints(
const char *arg = NULL,
void *userdata = NULL);
636 void on_actionStatisticsEndpoints_triggered();
637 void on_actionStatisticsHART_IP_triggered();
638 void on_actionStatisticsHTTPPacketCounter_triggered();
639 void on_actionStatisticsHTTPRequests_triggered();
640 void on_actionStatisticsHTTPLoadDistribution_triggered();
641 void on_actionStatisticsHTTPRequestSequences_triggered();
642 void on_actionStatisticsPacketLengths_triggered();
643 void statCommandIOGraph(
const char *,
void *);
644 void on_actionStatisticsIOGraph_triggered();
645 void on_actionStatisticsSametime_triggered();
646 void on_actionStatisticsDNS_triggered();
647 void actionStatisticsPlugin_triggered();
648 void on_actionStatisticsHpfeeds_triggered();
649 void on_actionStatisticsHTTP2_triggered();
651 void openVoipCallsDialog(
bool all_flows =
false);
652 void on_actionTelephonyVoipCalls_triggered();
653 void on_actionTelephonyGsmMapSummary_triggered();
654 void statCommandLteMacStatistics(
const char *arg,
void *);
655 void on_actionTelephonyLteRlcStatistics_triggered();
656 void statCommandLteRlcStatistics(
const char *arg,
void *);
657 void on_actionTelephonyLteMacStatistics_triggered();
658 void on_actionTelephonyLteRlcGraph_triggered();
659 void on_actionTelephonyIax2StreamAnalysis_triggered();
660 void on_actionTelephonyISUPMessages_triggered();
661 void on_actionTelephonyMtp3Summary_triggered();
662 void on_actionTelephonyOsmuxPacketCounter_triggered();
663 void on_actionTelephonyRTPStreams_triggered();
664 void on_actionTelephonyRTPStreamAnalysis_triggered();
665 void on_actionTelephonyRTSPPacketCounter_triggered();
666 void on_actionTelephonySMPPOperations_triggered();
667 void on_actionTelephonyUCPMessages_triggered();
668 void on_actionTelephonySipFlows_triggered();
670 void on_actionBluetoothATT_Server_Attributes_triggered();
671 void on_actionBluetoothDevices_triggered();
672 void on_actionBluetoothHCI_Summary_triggered();
674 void on_actionToolsFirewallAclRules_triggered();
676 void externalMenuItem_triggered();
678 void on_actionAnalyzeShowPacketBytes_triggered();
680 void on_actionContextWikiProtocolPage_triggered();
681 void on_actionContextFilterFieldReference_triggered();
683 void extcap_options_finished(
int result);
684 void showExtcapOptionsDialog(QString & device_name);
687 #endif // MAINWINDOW_H
Definition: packet_list.h:30
Definition: packet_info.h:44
Definition: ui_about_dialog.h:291
Definition: proto_tree.h:28
Definition: file_set_dialog.h:30
Definition: wireless_frame.h:21
Definition: capture_event.h:19
Definition: capture_info.h:46
Definition: main_welcome.h:26
Definition: filter_dialog.h:22
bool openCaptureFile(QString cf_path, QString display_filter, unsigned int type, gboolean is_tempfile=FALSE)
Definition: main_window_slots.cpp:181
Definition: accordion_frame.h:17
Definition: ui_main_window.h:2382
Definition: main_window.h:100
Definition: funnel_statistics.h:23
Definition: display_filter_combo.h:16
Definition: capture_file.h:22
Definition: capture_session.h:63
Definition: byte_view_tab.h:28