device: protect device event broadcast against simultaneous deletions of multiple...
[project/netifd.git] / device.h
index 88a421f..1f852ab 100644 (file)
--- a/device.h
+++ b/device.h
@@ -75,6 +75,8 @@ enum device_event {
 
        DEV_EVENT_LINK_UP,
        DEV_EVENT_LINK_DOWN,
+
+       __DEV_EVENT_MAX
 };
 
 /*
@@ -85,6 +87,9 @@ struct device_user {
 
        bool claimed;
        bool hotplug;
+       bool alias;
+
+       uint8_t ev_idx[__DEV_EVENT_MAX];
 
        struct device *dev;
        void (*cb)(struct device_user *, enum device_event);
@@ -106,6 +111,7 @@ struct device {
 
        struct avl_node avl;
        struct list_head users;
+       struct list_head aliases;
 
        char ifname[IFNAMSIZ + 1];
        int ifindex;