• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/netifd/wireless.h

  1 /*
  2  * netifd - network interface daemon
  3  * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org>
  4  *
  5  * This program is free software; you can redistribute it and/or modify
  6  * it under the terms of the GNU General Public License version 2
  7  * as published by the Free Software Foundation
  8  *
  9  * This program is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12  * GNU General Public License for more details.
 13  */
 14 #ifndef __NETIFD_WIRELESS_H
 15 #define __NETIFD_WIRELESS_H
 16 
 17 #include <libubox/utils.h>
 18 #include <libubox/list.h>
 19 #include "interface.h"
 20 
 21 extern struct vlist_tree wireless_devices;
 22 extern struct avl_tree wireless_drivers;
 23 
 24 struct wireless_driver {
 25         struct avl_node node;
 26 
 27         const char *name;
 28         const char *script;
 29 
 30         struct {
 31                 char *buf;
 32                 struct uci_blob_param_list *config;
 33         } device, interface, vlan, station;
 34 };
 35 
 36 struct wireless_device {
 37         struct vlist_node node;
 38 
 39         struct list_head handler;
 40         bool handler_action;
 41         bool handler_pending;
 42         bool serialize;
 43 
 44         struct wireless_driver *drv;
 45         struct vlist_tree interfaces;
 46         struct vlist_tree vlans;
 47         struct vlist_tree stations;
 48         char *name;
 49 
 50         struct netifd_process script_task;
 51         struct uloop_timeout timeout;
 52         struct uloop_timeout poll;
 53 
 54         struct list_head script_proc;
 55         struct uloop_fd script_proc_fd;
 56         struct uloop_timeout script_check;
 57 
 58         struct ubus_request_data *kill_request;
 59 
 60         struct blob_attr *prev_config;
 61         struct blob_attr *config;
 62         struct blob_attr *data;
 63 
 64         bool autostart;
 65         bool disabled;
 66         bool retry_setup_failed;
 67 
 68         enum interface_state state;
 69         enum interface_config_state config_state;
 70         bool reconf;
 71         bool cancel;
 72         int retry;
 73 
 74         int vif_idx;
 75         int vlan_idx;
 76         int sta_idx;
 77 };
 78 
 79 struct wireless_interface {
 80         struct vlist_node node;
 81         const char *section;
 82         char *name;
 83 
 84         struct wireless_device *wdev;
 85 
 86         struct blob_attr *config;
 87         struct blob_attr *data;
 88 
 89         const char *ifname;
 90         struct blob_attr *network;
 91         bool proxyarp;
 92         bool isolate;
 93         bool ap_mode;
 94 };
 95 
 96 struct wireless_vlan {
 97         struct vlist_node node;
 98         const char *section;
 99         char *name;
100 
101         struct wireless_device *wdev;
102         char *vif;
103 
104         struct blob_attr *config;
105         struct blob_attr *data;
106 
107         const char *ifname;
108         struct blob_attr *network;
109         bool isolate;
110 };
111 
112 struct wireless_station {
113         struct vlist_node node;
114         const char *section;
115         char *name;
116 
117         struct wireless_device *wdev;
118         char *vif;
119 
120         struct blob_attr *config;
121         struct blob_attr *data;
122 };
123 
124 struct wireless_process {
125         struct list_head list;
126 
127         const char *exe;
128         int pid;
129 
130         bool required;
131         bool keep;
132 };
133 
134 void wireless_device_create(struct wireless_driver *drv, const char *name, struct blob_attr *data);
135 void wireless_device_set_up(struct wireless_device *wdev);
136 void wireless_device_set_down(struct wireless_device *wdev);
137 void wireless_device_reconf(struct wireless_device *wdev);
138 void wireless_device_status(struct wireless_device *wdev, struct blob_buf *b);
139 void wireless_device_get_validate(struct wireless_device *wdev, struct blob_buf *b);
140 struct wireless_interface* wireless_interface_create(struct wireless_device *wdev, struct blob_attr *data, const char *section);
141 void wireless_vlan_create(struct wireless_device *wdev, char *vif, struct blob_attr *data, const char *section);
142 void wireless_station_create(struct wireless_device *wdev, char *vif, struct blob_attr *data, const char *section);
143 int wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data,
144                            struct ubus_request_data *req);
145 
146 void wireless_start_pending(void);
147 void wireless_init(void);
148 void wireless_device_hotplug_event(const char *name, bool add);
149 
150 #endif
151 

This page was automatically generated by LXR 0.3.1.  •  OpenWrt