| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
interface_tree_model.h
Go to the documentation of this file.
1
11
12#ifndef INTERFACE_TREE_MODEL_H
13#define INTERFACE_TREE_MODEL_H
14
15#include <config.h>
16#include <wireshark.h>
17
18#ifdef HAVE_LIBPCAP
19#include "ui/capture.h"
20#include "ui/capture_globals.h"
21#endif
22
23#include <QAbstractTableModel>
24#include <QList>
25#include <QMap>
26#include <QItemSelection>
27
28 typedef QList<int> PointList;
29
30 class InterfaceStatistics;
31
43 enum InterfaceTreeColumns
44{
45 IFTREE_COL_EXTCAP,
46 IFTREE_COL_EXTCAP_PATH,
47 IFTREE_COL_HIDDEN,
48 IFTREE_COL_DISPLAY_NAME,
49 IFTREE_COL_DESCRIPTION,
50 IFTREE_COL_NAME,
51 IFTREE_COL_COMMENT,
52 IFTREE_COL_STATS,
53 IFTREE_COL_DLT,
54 IFTREE_COL_PROMISCUOUSMODE,
55 IFTREE_COL_TYPE,
56 IFTREE_COL_ACTIVE,
57 IFTREE_COL_SNAPLEN,
58 IFTREE_COL_BUFFERLEN,
59 IFTREE_COL_MONITOR_MODE,
60 IFTREE_COL_CAPTURE_FILTER,
61 IFTREE_COL_PIPE_PATH,
62 IFTREE_COL_MAX
63};
64
68 class InterfaceTreeModel : public QAbstractTableModel
69{
70 Q_OBJECT
71
72 public:
77 InterfaceTreeModel(QObject *parent);
78
82 ~InterfaceTreeModel();
83
89 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
90
96 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
97
104 QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
105
113 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
114
123 void setStatistics(InterfaceStatistics *statistics);
124
129 QString interfaceError();
130
135 QItemSelection selectedDevices();
136
142 bool updateSelectedDevices(QItemSelection sourceSelection);
143
151 QVariant getColumnContent(int idx, int col, int role = Qt::DisplayRole);
152
153#ifdef HAVE_PCAP_REMOTE
159 bool isRemote(int idx);
160#endif
161
163 static const QString DefaultNumericValue;
164
165 public slots:
169 void interfaceListChanged();
170
171 private slots:
179 void connectInterfaceListManager();
180
182 void onStatisticsUpdated();
183
185 void onActivityChanged();
186
187 private:
193 QVariant toolTipForInterface(int idx) const;
194
196 InterfaceStatistics *interface_stats_;
197};
198
199#endif // INTERFACE_TREE_MODEL_H
capture.h
capture_globals.h
InterfaceStatistics
GUI-thread facade that owns the interface-statistics sampler and is the single source of truth for pe...
Definition interface_statistics.h:50
InterfaceTreeModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Retrieves the header data for a specific section and role.
Definition interface_tree_model.cpp:283
InterfaceTreeModel::setStatistics
void setStatistics(InterfaceStatistics *statistics)
Sets the statistics provider supplying sparkline/activity data.
Definition interface_tree_model.cpp:421
InterfaceTreeModel::updateSelectedDevices
bool updateSelectedDevices(QItemSelection sourceSelection)
Updates the internal state of selected devices based on a UI selection.
Definition interface_tree_model.cpp:477
InterfaceTreeModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the table model.
Definition interface_tree_model.cpp:115
InterfaceTreeModel::~InterfaceTreeModel
~InterfaceTreeModel()
Destroys the InterfaceTreeModel.
Definition interface_tree_model.cpp:59
InterfaceTreeModel::InterfaceTreeModel
InterfaceTreeModel(QObject *parent)
Constructs a new InterfaceTreeModel.
Definition interface_tree_model.cpp:46
InterfaceTreeModel::interfaceError
QString interfaceError()
Retrieves any current interface-related error messages.
Definition interface_tree_model.cpp:71
InterfaceTreeModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Retrieves data from the model for a given index and role.
Definition interface_tree_model.cpp:121
InterfaceTreeModel::interfaceListChanged
void interfaceListChanged()
Slot triggered when the global list of available interfaces changes.
Definition interface_tree_model.cpp:363
InterfaceTreeModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows (interfaces) under a given parent.
Definition interface_tree_model.cpp:105
InterfaceTreeModel::DefaultNumericValue
static const QString DefaultNumericValue
Definition interface_tree_model.h:163
InterfaceTreeModel::selectedDevices
QItemSelection selectedDevices()
Retrieves the currently selected devices as an item selection.
Definition interface_tree_model.cpp:456
InterfaceTreeModel::getColumnContent
QVariant getColumnContent(int idx, int col, int role=Qt::DisplayRole)
Gets the content for a specific column and row directly.
Definition interface_tree_model.cpp:343
InterfaceTreeColumns
InterfaceTreeColumns
Column indices for the interface tree model shared across interface-related views.
Definition interface_tree_model.h:44
IFTREE_COL_ACTIVE
@ IFTREE_COL_ACTIVE
Definition interface_tree_model.h:56
IFTREE_COL_TYPE
@ IFTREE_COL_TYPE
Definition interface_tree_model.h:55
IFTREE_COL_COMMENT
@ IFTREE_COL_COMMENT
Definition interface_tree_model.h:51
IFTREE_COL_DLT
@ IFTREE_COL_DLT
Definition interface_tree_model.h:53
IFTREE_COL_EXTCAP
@ IFTREE_COL_EXTCAP
Definition interface_tree_model.h:45
IFTREE_COL_NAME
@ IFTREE_COL_NAME
Definition interface_tree_model.h:50
IFTREE_COL_EXTCAP_PATH
@ IFTREE_COL_EXTCAP_PATH
Definition interface_tree_model.h:46
IFTREE_COL_BUFFERLEN
@ IFTREE_COL_BUFFERLEN
Definition interface_tree_model.h:58
IFTREE_COL_STATS
@ IFTREE_COL_STATS
Definition interface_tree_model.h:52
IFTREE_COL_SNAPLEN
@ IFTREE_COL_SNAPLEN
Definition interface_tree_model.h:57
IFTREE_COL_HIDDEN
@ IFTREE_COL_HIDDEN
Definition interface_tree_model.h:47
IFTREE_COL_PROMISCUOUSMODE
@ IFTREE_COL_PROMISCUOUSMODE
Definition interface_tree_model.h:54
IFTREE_COL_MAX
@ IFTREE_COL_MAX
Definition interface_tree_model.h:62
IFTREE_COL_DESCRIPTION
@ IFTREE_COL_DESCRIPTION
Definition interface_tree_model.h:49
IFTREE_COL_CAPTURE_FILTER
@ IFTREE_COL_CAPTURE_FILTER
Definition interface_tree_model.h:60
IFTREE_COL_PIPE_PATH
@ IFTREE_COL_PIPE_PATH
Definition interface_tree_model.h:61
IFTREE_COL_MONITOR_MODE
@ IFTREE_COL_MONITOR_MODE
Definition interface_tree_model.h:59
IFTREE_COL_DISPLAY_NAME
@ IFTREE_COL_DISPLAY_NAME
Definition interface_tree_model.h:48