bd347c61dd1a7ef9efd50e38da31f5aececc0eed
[openwrt/staging/stintel.git] / package / network / services / hostapd / README.md
1 # UBUS methods - hostapd
2
3 ## bss_mgmt_enable
4 Enable 802.11k/v features.
5
6 ### arguments
7 | Name | Type | Required | Description |
8 |---|---|---|---|
9 | neighbor_report | bool | no | enable 802.11k neighbor reports |
10 | beacon_report | bool | no | enable 802.11k beacon reports |
11 | link_measurements | bool | no | enable 802.11k link measurements |
12 | bss_transition | bool | no | enable 802.11v BSS transition support |
13
14 ### example
15 `ubus call hostapd.wl5-fb bss_mgmt_enable '{ "neighbor_report": true, "beacon_report": true, "link_measurements": true, "bss_transition": true
16 }'`
17
18
19 ## bss_transition_request
20 Initiate an 802.11v transition request.
21
22 ### arguments
23 | Name | Type | Required | Description |
24 |---|---|---|---|
25 | addr | string | yes | client MAC address |
26 | disassociation_imminent | bool | no | set Disassociation Imminent bit |
27 | disassociation_timer | int32 | no | disassociate client if it doesn't roam after this time |
28 | validity_period | int32 | no | validity of the BSS Transition Candiate List |
29 | neighbors | array | no | BSS Transition Candidate List |
30 | abridged | bool | no | prefer APs in the BSS Transition Candidate List |
31 | dialog_token | int32 | no | identifier for the request/report transaction |
32
33 ### example
34 `ubus call hostapd.wl5-fb bss_transition_request '{ "addr": "68:2F:67:8B:98:ED", "disassociation_imminent": false, "disassociation_timer": 0, "validity_period": 30, "neighbors": ["b6a7b9cbeebabf5900008064090603026a00"], "abridged": 1 }'`
35
36
37 ## config_add
38 Dynamically load a BSS configuration from a file. This is used by netifd's mac80211 support script to configure BSSes on multiple PHYs in a single hostapd instance.
39
40 ### arguments
41 | Name | Type | Required | Description |
42 |---|---|---|---|
43 | iface | string | yes | WiFi interface name |
44 | config | string | yes | path to hostapd config file |
45
46
47 ## config_remove
48 Dynamically remove a BSS configuration.
49
50 ### arguments
51 | Name | Type | Required | Description |
52 |---|---|---|---|
53 | iface | string | yes | WiFi interface name |
54
55
56 ## del_client
57 Kick a client off the network.
58
59 ### arguments
60 | Name | Type | Required | Description |
61 |---|---|---|---|
62 | addr | string | yes | client MAC address |
63 | reason | int32 | no | 802.11 reason code |
64 | deauth | bool | no | deauthenticates client instead of disassociating |
65 | ban_time | int32 | no | ban client for N milliseconds |
66
67 ### example
68 `ubus call hostapd.wl5-fb del_client '{ "addr": "68:2f:67:8b:98:ed", "reason": 5, "deauth": true, "ban_time": 10000 }'`
69
70
71 ## get_clients
72 Show associated clients.
73
74 ### example
75 `ubus call hostapd.wl5-fb get_clients`
76
77 ### output
78 ```json
79 {
80 "freq": 5260,
81 "clients": {
82 "68:2f:67:8b:98:ed": {
83 "auth": true,
84 "assoc": true,
85 "authorized": true,
86 "preauth": false,
87 "wds": false,
88 "wmm": true,
89 "ht": true,
90 "vht": true,
91 "he": false,
92 "wps": false,
93 "mfp": true,
94 "rrm": [
95 0,
96 0,
97 0,
98 0,
99 0
100 ],
101 "extended_capabilities": [
102 0,
103 0,
104 0,
105 0,
106 0,
107 0,
108 0,
109 64
110 ],
111 "aid": 3,
112 "signature": "wifi4|probe:0,1,45,127,107,191,221(0017f2,10),221(001018,2),htcap:006f,htagg:1b,htmcs:0000ffff,vhtcap:0f825832,vhtrxmcs:0000ffea,vhttxmcs:0000ffea,extcap:0000008000000040|assoc:0,1,33,36,48,45,127,191,221(0017f2,10),221(001018,2),221(0050f2,2),htcap:006f,htagg:1b,htmcs:0000ffff,vhtcap:0f825832,vhtrxmcs:0000ffea,vhttxmcs:0000ffea,txpow:14f9,extcap:0000000000000040",
113 "bytes": {
114 "rx": 1933667,
115 "tx": 746805
116 },
117 "airtime": {
118 "rx": 208863,
119 "tx": 9037883
120 },
121 "packets": {
122 "rx": 3587,
123 "tx": 2185
124 },
125 "rate": {
126 "rx": 866700,
127 "tx": 866700
128 },
129 "signal": -50,
130 "capabilities": {
131 "vht": {
132 "su_beamformee": true,
133 "mu_beamformee": false,
134 "mcs_map": {
135 "rx": {
136 "1ss": 9,
137 "2ss": 9,
138 "3ss": 9,
139 "4ss": -1,
140 "5ss": -1,
141 "6ss": -1,
142 "7ss": -1,
143 "8ss": -1
144 },
145 "tx": {
146 "1ss": 9,
147 "2ss": 9,
148 "3ss": 9,
149 "4ss": -1,
150 "5ss": -1,
151 "6ss": -1,
152 "7ss": -1,
153 "8ss": -1
154 }
155 }
156 }
157 }
158 }
159 }
160 }
161 ```
162
163
164 ## get_features
165 Show HT/VHT support.
166
167 ### example
168 `ubus call hostapd.wl5-fb get_features`
169
170 ### output
171 ```json
172 {
173 "ht_supported": true,
174 "vht_supported": true
175 }
176 ```
177
178
179 ## get_status
180 Get BSS status.
181
182 ### example
183 `ubus call hostapd.wl5-fb get_status`
184
185 ### output
186 ```json
187 {
188 "status": "ENABLED",
189 "bssid": "b6:a7:b9:cb:ee:bc",
190 "ssid": "fb",
191 "freq": 5260,
192 "channel": 52,
193 "op_class": 128,
194 "beacon_interval": 100,
195 "phy": "wl5-lan",
196 "rrm": {
197 "neighbor_report_tx": 0
198 },
199 "wnm": {
200 "bss_transition_query_rx": 0,
201 "bss_transition_request_tx": 0,
202 "bss_transition_response_rx": 0
203 },
204 "airtime": {
205 "time": 259561738,
206 "time_busy": 2844249,
207 "utilization": 0
208 },
209 "dfs": {
210 "cac_seconds": 60,
211 "cac_active": false,
212 "cac_seconds_left": 0
213 }
214 }
215 ```
216
217
218 ## link_measurement_req
219 Initiate an 802.11k Link Measurement Request.
220
221 ### arguments
222 | Name | Type | Required | Description |
223 |---|---|---|---|
224 | addr | string | yes | client MAC address |
225 | tx-power-used | int32 | no | transmit power used to transmit the Link Measurement Request frame |
226 | tx-power-max | int32 | no | upper limit of transmit power to be used by the client |
227
228
229 ## list_bans
230 List banned clients.
231
232 ### example
233 `ubus call hostapd.wl5-fb list_bans`
234
235 ### output
236 ```json
237 {
238 "clients": [
239 "68:2f:67:8b:98:ed"
240 ]
241 }
242 ```
243
244
245 ## notify_response
246 When enabled, hostapd will send a ubus notification and wait for a response before responding to various requests. This is used by e.g. usteer to make it possible to ignore probe requests.
247
248 :warning: enabling this will cause hostapd to stop responding to probe requests unless a ubus subscriber responds to the ubus notifications.
249
250 ### arguments
251 | Name | Type | Required | Description |
252 |---|---|---|---|
253 | notify_response | int32 | yes | disable (0) or enable (!0) |
254
255 ### example
256 `ubus call hostapd.wl5-fb notify_response '{ "notify_response": 1 }'`
257
258 ## reload
259 Reload BSS configuration.
260
261 :warning: this can cause problems for certain configurations:
262
263 ```
264 Mon May 16 16:09:08 2022 daemon.warn hostapd: Failed to check if DFS is required; ret=-1
265 Mon May 16 16:09:08 2022 daemon.warn hostapd: Failed to check if DFS is required; ret=-1
266 Mon May 16 16:09:08 2022 daemon.err hostapd: Wrong coupling between HT and VHT/HE channel setting
267 ```
268
269 ### example
270 `ubus call hostapd.wl5-fb reload`
271
272
273 ## rrm_beacon_req
274 Send a Beacon Measurement Request to a client.
275
276 ### arguments
277 | Name | Type | Required | Description |
278 |---|---|---|---|
279 | addr | string | yes | client MAC address |
280 | op_class | int32 | yes | the Regulatory Class for which this Measurement Request applies |
281 | channel | int32 | yes | channel to measure |
282 | duration | int32 | yes | compile Beacon Measurement Report after N TU |
283 | mode | int32 | yes | mode to be used for measurement (0: passive, 1: active, 2: beacon table) |
284 | bssid | string | no | filter BSSes in Beacon Measurement Report by BSSID |
285 | ssid | string | no | filter BSSes in Beacon Measurement Report by SSID|
286
287
288 ## rrm_nr_get_own
289 Show Neighbor Report Element for this BSS.
290
291 ### example
292 `ubus call hostapd.wl5-fb rrm_nr_get_own`
293
294 ### output
295 ```json
296 {
297 "value": [
298 "b6:a7:b9:cb:ee:bc",
299 "fb",
300 "b6a7b9cbeebcaf5900008095090603029b00"
301 ]
302 }
303 ```
304
305
306 ## rrm_nr_list
307 Show Neighbor Report Elements for other BSSes in this ESS.
308
309 ### example
310 `ubus call hostapd.wl5-fb rrm_nr_list`
311
312 ### output
313 ```json
314 {
315 "list": [
316 [
317 "b6:a7:b9:cb:ee:ba",
318 "fb",
319 "b6a7b9cbeebabf5900008064090603026a00"
320 ]
321 ]
322 }
323 ```
324
325 ## rrm_nr_set
326 Set the Neighbor Report Elements. An element for the node on which this command is executed will always be added.
327
328 ### arguments
329 | Name | Type | Required | Description |
330 |---|---|---|---|
331 | list | array | yes | array of Neighbor Report Elements in the format of the rrm_nr_list output |
332
333 ### example
334 `ubus call hostapd.wl5-fb rrm_nr_set '{ "list": [ [ "b6:a7:b9:cb:ee:ba", "fb", "b6a7b9cbeebabf5900008064090603026a00" ] ] }'`
335
336
337 ## set_vendor_elements
338 Configure Vendor-specific Information Elements for BSS.
339
340 ### arguments
341 | Name | Type | Required | Description |
342 |---|---|---|---|
343 | vendor_elements | string | yes | Vendor-specific Information Elements as hex string |
344
345 ### example
346 `ubus call hostapd.wl5-fb set_vendor_elements '{ "vendor_elements": "dd054857dd6662" }'`
347
348
349 ## switch_chan
350 Initiate a channel switch.
351
352 :warning: trying to switch to the channel that is currently in use will fail: `Command failed: Operation not supported`
353
354 ### arguments
355 | Name | Type | Required | Description |
356 |---|---|---|---|
357 | freq | int32 | yes | frequency in MHz to switch to |
358 | bcn_count | int32 | no | count in Beacon frames (TBTT) to perform the switch |
359 | center_freq1 | int32 | no | segment 0 center frequency in MHz (valid for HT and VHT) |
360 | center_freq2 | int32 | no | segment 1 center frequency in MHz (valid only for 80 MHz channel width and an 80+80 channel) |
361 | bandwidth | int32 | no | channel width to use |
362 | sec_channel_offset| int32 | no | secondary channel offset for HT40 (0 = disabled, 1 = HT40+, -1 = HT40-) |
363 | ht | bool | no | enable 802.11n |
364 | vht | bool | no | enable 802.11ac |
365 | he | bool | no | enable 802.11ax |
366 | block_tx | bool | no | block transmission during CSA period |
367 | csa_force | bool | no | restart the interface in case the CSA fails |
368
369 ## example
370 `ubus call hostapd.wl5-fb switch_chan '{ "freq": 5180, "bcn_count": 10, "center_freq1": 5210, "bandwidth": 80, "he": 1, "block_tx": 1, "csa_force": 0 }'`
371
372
373 ## update_airtime
374 Set dynamic airtime weight for client.
375
376 ### arguments
377 | Name | Type | Required | Description |
378 |---|---|---|---|
379 | sta | string | yes | client MAC address |
380 | weight | int32 | yes | airtime weight |
381
382
383 ## update_beacon
384 Force beacon frame content to be updated and to start beaconing on an interface that uses start_disabled=1.
385
386 ### example
387 `ubus call hostapd.wl5-fb update_beacon`
388
389
390 ## wps_status
391 Get WPS status for BSS.
392
393 ### example
394 `ubus call hostapd.wl5-fb wps_status`
395
396 ### output
397 ```json
398 {
399 "pbc_status": "Disabled",
400 "last_wps_result": "None"
401 }
402 ```
403
404
405 ## wps_cancel
406 Cancel WPS Push Button Configuration.
407
408 ### example
409 `ubus call hostapd.wl5-fb wps_cancel`
410
411
412 ## wps_start
413 Start WPS Push Button Configuration.
414
415 ### example
416 `ubus call hostapd.wl5-fb wps_start`