mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
network: Rework initial interface search by using a dump
Instead of using an alternative way to list all links in order to choose one when an "interface" is in the configuration, we can ask for a dump of all interface an reuse the handleEvents() function. This patch also start to rework the handleEvents() function to grab more information out of each event, like the interface name.
This commit is contained in:
@ -28,8 +28,11 @@ class Network : public ALabel {
|
||||
static const uint8_t EPOLL_MAX = 200;
|
||||
|
||||
static int handleEvents(struct nl_msg*, void*);
|
||||
static int handleEventsDone(struct nl_msg*, void*);
|
||||
static int handleScan(struct nl_msg*, void*);
|
||||
|
||||
void askForStateDump(void);
|
||||
|
||||
void worker();
|
||||
void createInfoSocket();
|
||||
void createEventSocket();
|
||||
@ -59,6 +62,9 @@ class Network : public ALabel {
|
||||
int nl80211_id_;
|
||||
std::mutex mutex_;
|
||||
|
||||
bool want_link_dump_;
|
||||
bool dump_in_progress_;
|
||||
|
||||
unsigned long long bandwidth_down_total_;
|
||||
unsigned long long bandwidth_up_total_;
|
||||
|
||||
|
Reference in New Issue
Block a user