mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Configure the following without vif reload: Tx power probe_response_threshold client disconnect threshold Beacon and multicast rates Signed-off-by: Chaitanya Godavarthi <chaitanya.kiran@netexperience.com>
66 lines
2.1 KiB
Diff
66 lines
2.1 KiB
Diff
Index: hostapd-2020-06-08-5a8b3662/src/ap/ubus.c
|
|
===================================================================
|
|
--- hostapd-2020-06-08-5a8b3662.orig/src/ap/ubus.c
|
|
+++ hostapd-2020-06-08-5a8b3662/src/ap/ubus.c
|
|
@@ -1486,7 +1486,60 @@ static int hostapd_get_bss_list(struct u
|
|
return 0;
|
|
}
|
|
|
|
+enum {
|
|
+ MOD_IFACE,
|
|
+ MOD_PARAM,
|
|
+ MOD_PARAM_VAL,
|
|
+ __PARAM_MAX
|
|
+};
|
|
+
|
|
+static const struct blobmsg_policy mod_param_policy[__PARAM_MAX] = {
|
|
+ [MOD_IFACE] = { "iface", BLOBMSG_TYPE_STRING },
|
|
+ [MOD_PARAM] = { "param", BLOBMSG_TYPE_STRING },
|
|
+ [MOD_PARAM_VAL] = { "param_val", BLOBMSG_TYPE_STRING },
|
|
+};
|
|
+
|
|
+static int
|
|
+hostapd_param_modify(struct ubus_context *ctx, struct ubus_object *obj,
|
|
+ struct ubus_request_data *req, const char *method,
|
|
+ struct blob_attr *msg)
|
|
+{
|
|
+ struct blob_attr *tb[__PARAM_MAX];
|
|
+ struct hapd_interfaces *interfaces = NULL;
|
|
+ struct hostapd_data *hapd_bss = NULL;
|
|
+ struct hostapd_config *iconf = NULL;
|
|
+ struct hostapd_iface *iface = NULL;
|
|
+ size_t i = 0;
|
|
+
|
|
+ interfaces = get_hapd_interfaces_from_object(obj);
|
|
+ blobmsg_parse(mod_param_policy, __PARAM_MAX, tb, blob_data(msg),
|
|
+ blob_len(msg));
|
|
+ if (!tb[MOD_PARAM] || !tb[MOD_IFACE] || !tb[MOD_PARAM_VAL])
|
|
+ return UBUS_STATUS_INVALID_ARGUMENT;
|
|
+
|
|
+ wpa_printf(MSG_DEBUG, "Modifyint %s=%s for %s",
|
|
+ blobmsg_get_string(tb[MOD_PARAM]),
|
|
+ blobmsg_get_string(tb[MOD_PARAM_VAL]),
|
|
+ blobmsg_get_string(tb[MOD_IFACE]));
|
|
+
|
|
+ hapd_bss = hostapd_get_iface(interfaces,
|
|
+ blobmsg_get_string(tb[MOD_IFACE]));
|
|
+
|
|
+ if (hapd_bss) {
|
|
+ iconf = hapd_bss->iconf;
|
|
+ if (os_strcmp(blobmsg_get_string(tb[MOD_PARAM]),
|
|
+ "rssi_ignore_probe_request") == 0) {
|
|
+ iconf->rssi_ignore_probe_request = atoi(blobmsg_get_string(tb[MOD_PARAM_VAL]));
|
|
+
|
|
+ }
|
|
+ }
|
|
+
|
|
+ return UBUS_STATUS_OK;
|
|
+}
|
|
+
|
|
+
|
|
static const struct ubus_method daemon_methods[] = {
|
|
+ UBUS_METHOD("param_mod", hostapd_param_modify, mod_param_policy),
|
|
UBUS_METHOD("config_add", hostapd_config_add, config_add_policy),
|
|
UBUS_METHOD("config_remove", hostapd_config_remove, config_remove_policy),
|
|
UBUS_METHOD_NOARG("get_bss_list", hostapd_get_bss_list),
|