Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
capture_interfaces_dialog.h
1 /* capture_interfaces_dialog.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 
11 #ifndef CAPTURE_INTERFACES_DIALOG_H
12 #define CAPTURE_INTERFACES_DIALOG_H
13 
14 #include <config.h>
15 
16 #ifdef HAVE_LIBPCAP
17 
18 #include <ui/qt/models/interface_tree_model.h>
19 
20 #include "geometry_state_dialog.h"
21 #include <QPushButton>
22 #include <QTreeWidget>
23 
24 typedef struct if_stat_cache_s if_stat_cache_t;
25 
26 namespace Ui {
27 class CaptureInterfacesDialog;
28 }
29 
30 #include <QStyledItemDelegate>
31 
32 class InterfaceTreeDelegate : public QStyledItemDelegate
33 {
34  Q_OBJECT
35 private:
36  QTreeWidget* tree_;
37 
38 public:
39  InterfaceTreeDelegate(QObject *parent = 0);
40  ~InterfaceTreeDelegate();
41 
42  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &idx) const;
43  void setTree(QTreeWidget* tree) { tree_ = tree; }
44  bool eventFilter(QObject *object, QEvent *event);
45 
46 signals:
47  void filterChanged(const QString filter);
48 
49 private slots:
50  void linkTypeChanged(QString selected_link_type);
51  void snapshotLengthChanged(int value);
52  void bufferSizeChanged(int value);
53 };
54 
55 class CaptureInterfacesDialog : public GeometryStateDialog
56 {
57  Q_OBJECT
58 
59 public:
60  explicit CaptureInterfacesDialog(QWidget *parent = 0);
61  ~CaptureInterfacesDialog();
62 
63  void setTab(int idx);
64  void updateInterfaces();
65 
66 protected:
67  virtual void showEvent(QShowEvent *);
68 
69 private slots:
70  void on_capturePromModeCheckBox_toggled(bool checked);
71  void on_gbStopCaptureAuto_toggled(bool checked);
72  void on_cbUpdatePacketsRT_toggled(bool checked);
73  void on_cbAutoScroll_toggled(bool checked);
74  void on_gbNewFileAuto_toggled(bool checked);
75  void on_cbExtraCaptureInfo_toggled(bool checked);
76  void on_cbResolveMacAddresses_toggled(bool checked);
77  void on_compileBPF_clicked();
78  void on_manageButton_clicked();
79  void on_cbResolveNetworkNames_toggled(bool checked);
80  void on_cbResolveTransportNames_toggled(bool checked);
81  void on_buttonBox_accepted();
82  void on_buttonBox_rejected();
83  void on_buttonBox_helpRequested();
84  void interfaceSelected();
85  void filterEdited();
86  void updateWidgets();
87  void updateStatistics(void);
88  void refreshInterfaceList();
89  void updateLocalInterfaces();
90  void browseButtonClicked();
91  void interfaceItemChanged(QTreeWidgetItem *item, int column);
92  void changeEvent(QEvent* event);
93 
94 signals:
95  void startCapture();
96  void stopCapture();
97  void getPoints(int row, PointList *pts);
98  void setSelectedInterfaces();
99  void setFilterValid(bool valid, const QString capture_filter);
100  void interfacesChanged();
101  void ifsChanged();
102  void interfaceListChanged();
103  void captureFilterTextEdited(const QString & text);
104 
105 private:
107 
108  if_stat_cache_t *stat_cache_;
109  QTimer *stat_timer_;
110  InterfaceTreeDelegate interface_item_delegate_;
111 
112  interface_t *getDeviceByName(const QString device_name);
113  bool saveOptionsToPreferences();
114  void updateSelectedFilter();
115 
116  void updateGlobalDeviceSelections();
117  void updateFromGlobalDeviceSelections();
118 };
119 
120 #endif /* HAVE_LIBPCAP */
121 
122 #endif // CAPTURE_INTERFACES_DIALOG_H
123 
124 /*
125  * Editor modelines
126  *
127  * Local Variables:
128  * c-basic-offset: 4
129  * tab-width: 8
130  * indent-tabs-mode: nil
131  * End:
132  *
133  * ex: set shiftwidth=4 tabstop=8 expandtab:
134  * :indentSize=4:tabSize=8:noTabs=true:
135  */
Definition: geometry_state_dialog.h:15
Definition: ui_capture_interfaces_dialog.h:665
Definition: ui_about_dialog.h:291
Definition: pcapng.c:148
Definition: androiddump.c:211