CMake: bump the minimum required CMake version to 3.5
[project/netifd.git] / wireless.h
index a3eadc15c605570cf33a8b416992e22cb7d31d5a..705972392caec786fedd6c6ac31c09fedb365871 100644 (file)
 #define __NETIFD_WIRELESS_H
 
 #include <libubox/utils.h>
+#include <libubox/list.h>
 #include "interface.h"
 
-struct vlist_tree wireless_devices;
-struct avl_tree wireless_drivers;
+extern struct vlist_tree wireless_devices;
+extern struct avl_tree wireless_drivers;
 
 struct wireless_driver {
        struct avl_node node;
@@ -29,12 +30,18 @@ struct wireless_driver {
        struct {
                char *buf;
                struct uci_blob_param_list *config;
-       } device, interface;
+       } device, interface, vlan, station;
 };
 
 struct wireless_device {
        struct vlist_node node;
 
+       struct list_head handler;
+       bool handler_action;
+       bool handler_pending;
+       bool serialize;
+       bool config_update;
+
        struct wireless_driver *drv;
        struct vlist_tree interfaces;
        char *name;
@@ -49,14 +56,17 @@ struct wireless_device {
 
        struct ubus_request_data *kill_request;
 
+       struct blob_attr *prev_config;
        struct blob_attr *config;
        struct blob_attr *data;
 
-       bool config_autostart;
        bool autostart;
+       bool disabled;
+       bool retry_setup_failed;
 
        enum interface_state state;
        enum interface_config_state config_state;
+       bool reconf;
        bool cancel;
        int retry;
 
@@ -68,6 +78,8 @@ struct wireless_interface {
        const char *section;
        char *name;
 
+       struct vlist_tree vlans;
+       struct vlist_tree stations;
        struct wireless_device *wdev;
 
        struct blob_attr *config;
@@ -75,6 +87,40 @@ struct wireless_interface {
 
        const char *ifname;
        struct blob_attr *network;
+       struct blob_attr *network_vlan;
+       bool proxyarp;
+       bool isolate;
+       bool bridge_isolate;
+       bool ap_mode;
+       int multicast_to_unicast;
+       int vlan_idx;
+       int sta_idx;
+       bool disabled;
+};
+
+struct wireless_vlan {
+       struct vlist_node node;
+       const char *section;
+       char *name;
+
+       struct blob_attr *config;
+       struct blob_attr *data;
+
+       const char *ifname;
+       struct blob_attr *network;
+       struct blob_attr *network_vlan;
+       int multicast_to_unicast;
+       bool isolate;
+       bool bridge_isolate;
+};
+
+struct wireless_station {
+       struct vlist_node node;
+       const char *section;
+       char *name;
+
+       struct blob_attr *config;
+       struct blob_attr *data;
 };
 
 struct wireless_process {
@@ -84,16 +130,24 @@ struct wireless_process {
        int pid;
 
        bool required;
+       bool keep;
 };
 
 void wireless_device_create(struct wireless_driver *drv, const char *name, struct blob_attr *data);
 void wireless_device_set_up(struct wireless_device *wdev);
 void wireless_device_set_down(struct wireless_device *wdev);
+void wireless_device_reconf(struct wireless_device *wdev);
 void wireless_device_status(struct wireless_device *wdev, struct blob_buf *b);
-void wireless_interface_create(struct wireless_device *wdev, struct blob_attr *data, const char *section);
+void wireless_device_get_validate(struct wireless_device *wdev, struct blob_buf *b);
+struct wireless_interface* wireless_interface_create(struct wireless_device *wdev, struct blob_attr *data, const char *section);
+void wireless_vlan_create(struct wireless_interface *vif, struct blob_attr *data, const char *section);
+void wireless_station_create(struct wireless_interface *vif, struct blob_attr *data, const char *section);
 int wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data,
                           struct ubus_request_data *req);
 
-void wireless_start_pending(void);
+void wireless_check_network_enabled(void);
+void wireless_start_pending(int timeout);
+void wireless_init(void);
+void wireless_device_hotplug_event(const char *name, bool add);
 
 #endif