Wireshark 4.7.2
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_list_manager.h
Go to the documentation of this file.
1
12
13#ifndef INTERFACE_LIST_MANAGER_H
14#define INTERFACE_LIST_MANAGER_H
15
16#include <config.h>
17
18#ifdef HAVE_LIBPCAP
19#include <glib.h>
20#endif
21
22#include <QObject>
23#include <QStringList>
24
26
54class InterfaceListManager : public QObject
55{
56 Q_OBJECT
57
58public:
63 explicit InterfaceListManager(QObject *parent = nullptr);
64
69 QStringList currentInterfaceNames() const;
70
72 bool isScanning() const;
73
79
80#ifdef HAVE_LIBPCAP
100 static GList *cachedInterfaceList(int *err, char **err_str);
101
110 static void cacheInterfaceList(GList *if_list);
111#endif
112
113public slots:
123 void requestRefresh(bool userInitiated = false);
124
134 void refreshNow();
135
144 void notifyListChanged();
145
157
166 void setCaptureActive(bool active);
167
168signals:
171
172private slots:
174 void performScan();
175
180 void onPreferencesChanged();
181
182private:
184 void maybeSchedule();
185
186 InterfaceStatistics *interface_stats_;
187 QStringList currentNames_;
188 bool scanning_;
189 bool refreshPending_;
190 bool pendingUserInitiated_;
191 bool captureActive_;
192 bool scanScheduled_;
193 bool prevCaptureNoInterfaceLoad_;
194 bool prevCaptureNoExtcap_;
195};
196
197#endif // INTERFACE_LIST_MANAGER_H
InterfaceListManager(QObject *parent=nullptr)
Constructs an idle manager.
Definition interface_list_manager.cpp:40
bool isScanning() const
Whether a scan is currently in progress.
Definition interface_list_manager.cpp:75
void notifyListChanged()
Announces that the interface list changed without re-enumerating.
Definition interface_list_manager.cpp:665
QStringList currentInterfaceNames() const
Interface names from the most recent completed scan.
Definition interface_list_manager.cpp:70
void refreshNow()
Performs an interface rescan synchronously, before returning.
Definition interface_list_manager.cpp:656
void reapplyInterfacePreferences()
Re-derives interface display attributes from preferences, in place.
Definition interface_list_manager.cpp:759
void requestRefresh(bool userInitiated=false)
Requests a (coalesced, deferred-if-capturing) interface rescan.
Definition interface_list_manager.cpp:649
InterfaceStatistics * statistics() const
Returns the live interface statistics owned by this manager.
Definition interface_list_manager.cpp:80
void setCaptureActive(bool active)
Tells the manager whether a capture is active.
Definition interface_list_manager.cpp:670
void interfaceListChanged()
Emitted once after a scan, when the interface list is stable.
GUI-thread facade that owns the interface-statistics sampler and is the single source of truth for pe...
Definition interface_statistics.h:50