Wireshark 4.7.3
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, bool clearExtcaps = true);
124
134 void refreshNow(bool clearExtcaps = true);
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
188 void appInitialized();
189
190 InterfaceStatistics *interface_stats_;
191 QStringList currentNames_;
192 bool scanning_;
193 bool refreshPending_;
194 bool pendingUserInitiated_;
195 bool pendingClearExtcaps_;
196 bool captureActive_;
197 bool scanScheduled_;
198 bool prevCaptureNoExtcap_;
199 bool initialScanDone_;
200};
201
202#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:84
void notifyListChanged()
Announces that the interface list changed without re-enumerating.
Definition interface_list_manager.cpp:707
QStringList currentInterfaceNames() const
Interface names from the most recent completed scan.
Definition interface_list_manager.cpp:79
void reapplyInterfacePreferences()
Re-derives interface display attributes from preferences, in place.
Definition interface_list_manager.cpp:805
void requestRefresh(bool userInitiated=false, bool clearExtcaps=true)
Requests a (coalesced, deferred-if-capturing) interface rescan.
Definition interface_list_manager.cpp:684
InterfaceStatistics * statistics() const
Returns the live interface statistics owned by this manager.
Definition interface_list_manager.cpp:89
void refreshNow(bool clearExtcaps=true)
Performs an interface rescan synchronously, before returning.
Definition interface_list_manager.cpp:697
void setCaptureActive(bool active)
Tells the manager whether a capture is active.
Definition interface_list_manager.cpp:712
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