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 bool config_update; 44 45 struct wireless_driver *drv; 46 struct vlist_tree interfaces; 47 char *name; 48 49 struct netifd_process script_task; 50 struct uloop_timeout timeout; 51 struct uloop_timeout poll; 52 53 struct list_head script_proc; 54 struct uloop_fd script_proc_fd; 55 struct uloop_timeout script_check; 56 57 struct ubus_request_data *kill_request; 58 59 struct blob_attr *prev_config; 60 struct blob_attr *config; 61 struct blob_attr *data; 62 63 bool autostart; 64 bool disabled; 65 bool retry_setup_failed; 66 67 enum interface_state state; 68 enum interface_config_state config_state; 69 bool reconf; 70 bool cancel; 71 int retry; 72 73 int vif_idx; 74 }; 75 76 struct wireless_interface { 77 struct vlist_node node; 78 const char *section; 79 char *name; 80 81 struct vlist_tree vlans; 82 struct vlist_tree stations; 83 struct wireless_device *wdev; 84 85 struct blob_attr *config; 86 struct blob_attr *data; 87 88 const char *ifname; 89 struct blob_attr *network; 90 struct blob_attr *network_vlan; 91 bool proxyarp; 92 bool isolate; 93 bool bridge_isolate; 94 bool ap_mode; 95 int multicast_to_unicast; 96 int vlan_idx; 97 int sta_idx; 98 bool disabled; 99 100 int network_ifindex; 101 }; 102 103 struct wireless_vlan { 104 struct vlist_node node; 105 const char *section; 106 char *name; 107 108 struct blob_attr *config; 109 struct blob_attr *data; 110 111 const char *ifname; 112 struct blob_attr *network; 113 struct blob_attr *network_vlan; 114 int multicast_to_unicast; 115 bool isolate; 116 bool bridge_isolate; 117 118 int network_ifindex; 119 }; 120 121 struct wireless_station { 122 struct vlist_node node; 123 const char *section; 124 char *name; 125 126 struct blob_attr *config; 127 struct blob_attr *data; 128 }; 129 130 struct wireless_process { 131 struct list_head list; 132 133 const char *exe; 134 int pid; 135 136 bool required; 137 bool keep; 138 }; 139 140 void wireless_device_create(struct wireless_driver *drv, const char *name, struct blob_attr *data); 141 void wireless_device_set_up(struct wireless_device *wdev); 142 void wireless_device_set_down(struct wireless_device *wdev); 143 void wireless_device_reconf(struct wireless_device *wdev); 144 void wireless_device_status(struct wireless_device *wdev, struct blob_buf *b); 145 void wireless_device_get_validate(struct wireless_device *wdev, struct blob_buf *b); 146 struct wireless_interface* wireless_interface_create(struct wireless_device *wdev, struct blob_attr *data, const char *section); 147 void wireless_vlan_create(struct wireless_interface *vif, struct blob_attr *data, const char *section); 148 void wireless_station_create(struct wireless_interface *vif, struct blob_attr *data, const char *section); 149 int wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data, 150 struct ubus_request_data *req); 151 152 void wireless_check_network_enabled(void); 153 void wireless_start_pending(int timeout); 154 void wireless_init(void); 155 void wireless_device_hotplug_event(const char *name, bool add); 156 157 #endif 158
This page was automatically generated by LXR 0.3.1. • OpenWrt