Skip to content
Snippets Groups Projects
Commit f14e6c65 authored by Janusz Dziedzic's avatar Janusz Dziedzic
Browse files

hostapd: ubus: bsta report connected freq


Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@iopsys.eu>
parent 04aca1e3
No related branches found
No related tags found
1 merge request!543hostapd: ubus: bsta report connected freq
......@@ -962,7 +962,7 @@
+static void hostapd_ubus_dfs(struct hostapd_data *hapd, int level,
+ enum wpa_msg_type type, const char *txt,
+ size_t len)
+{
{
+ if (!str_starts(txt, "DFS-"))
+ return;
+
......@@ -1074,7 +1074,7 @@
+
+void hostapd_ubus_mgmt_rx(struct hostapd_data *hapd, const u8 *buf, size_t len,
+ struct hostapd_frame_info *fi)
{
+{
+ struct ieee80211_mgmt *mgmt;
+ char service[] = "wifi.iface";
+ char event[128] = {};
......@@ -1171,7 +1171,7 @@
return;
}
@@ -514,6 +1647,348 @@ hostapd_notify_response(struct ubus_cont
@@ -498,6 +1631,348 @@ hostapd_notify_response(struct ubus_cont
}
enum {
......@@ -1520,8 +1520,8 @@
DEL_CLIENT_ADDR,
DEL_CLIENT_REASON,
DEL_CLIENT_DEAUTH,
@@ -1701,6 +3176,12 @@ static const struct ubus_method bss_meth
UBUS_METHOD("wnm_disassoc_imminent", hostapd_wnm_disassoc_imminent, wnm_disassoc_policy),
@@ -1698,6 +3173,12 @@ static const struct ubus_method bss_meth
#ifdef CONFIG_WNM_AP
UBUS_METHOD("bss_transition_request", hostapd_bss_transition_request, bss_tr_policy),
#endif
+ UBUS_METHOD_NOARG("event_mask_get", hostapd_event_mask_get),
......@@ -1533,7 +1533,7 @@
};
static struct ubus_object_type bss_object_type =
@@ -1722,13 +3203,14 @@ void hostapd_ubus_add_bss(struct hostapd
@@ -1719,13 +3200,14 @@ void hostapd_ubus_add_bss(struct hostapd
return;
#endif
......@@ -1549,7 +1549,7 @@
obj->name = name;
obj->type = &bss_object_type;
obj->methods = bss_object_type.methods;
@@ -1810,9 +3292,10 @@ static struct ubus_object_type daemon_ob
@@ -1807,9 +3289,10 @@ static struct ubus_object_type daemon_ob
void hostapd_ubus_add(struct hapd_interfaces *interfaces)
{
struct ubus_object *obj = &interfaces->ubus;
......@@ -1597,9 +1597,9 @@
};
void hostapd_ubus_add_iface(struct hostapd_iface *iface);
@@ -66,6 +89,9 @@ int hostapd_ubus_notify_bss_transition_q
struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, u8 reason,
const u8 *candidate_list, u16 candidate_list_len);
@@ -68,6 +91,9 @@ int hostapd_ubus_notify_bss_transition_q
void hostapd_ubus_notify_authorized(struct hostapd_data *hapd, struct sta_info *sta,
const char *auth_alg);
+struct hostapd_frame_info;
+void hostapd_ubus_mgmt_rx(struct hostapd_data *hapd, const u8 *buf, size_t len,
......@@ -1607,7 +1607,7 @@
#else
struct hostapd_ubus_bss {};
@@ -134,6 +160,12 @@ static inline void hostapd_ubus_free(str
@@ -136,6 +162,12 @@ static inline void hostapd_ubus_free(str
{
}
......@@ -1622,7 +1622,7 @@
const u8 *candidate_list, u16 candidate_list_len)
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -1132,6 +1132,7 @@ enum hostapd_chan_status acs_init(struct
@@ -1153,6 +1153,7 @@ enum hostapd_chan_status acs_init(struct
return HOSTAPD_CHAN_INVALID;
acs_cleanup(iface);
......@@ -1632,7 +1632,7 @@
return HOSTAPD_CHAN_INVALID;
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -6238,6 +6238,8 @@ int ieee802_11_mgmt(struct hostapd_data
@@ -6278,6 +6278,8 @@ int ieee802_11_mgmt(struct hostapd_data
if (len < 24)
return 0;
......@@ -1722,7 +1722,7 @@
+#endif /* UBUS_COMMON_H */
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -179,6 +179,7 @@ endif
@@ -186,6 +186,7 @@ endif
ifdef CONFIG_UBUS
CFLAGS += -DUBUS_SUPPORT
OBJS += ubus.o
......@@ -1740,7 +1740,7 @@
#include "wpa_supplicant_i.h"
#include "wps_supplicant.h"
#include "ubus.h"
@@ -52,6 +53,168 @@ static void wpas_ubus_connection_lost(st
@@ -52,6 +53,172 @@ static void wpas_ubus_connection_lost(st
eloop_register_timeout(1, 0, ubus_reconnect_timeout, ctx, NULL);
}
......@@ -1813,6 +1813,10 @@
+
+ if (blobmsg_add_string(&b, "ssid", wpa_ssid_txt(wpa_s->current_ssid->ssid, wpa_s->current_ssid->ssid_len)))
+ goto exit;
+
+ if (blobmsg_add_u32(&b, "freq", wpa_s->assoc_freq))
+ goto exit;
+
+ blobmsg_close_table(&b, data);
+ ubus_send_event(ctx, service, b.head);
+exit:
......@@ -1909,7 +1913,7 @@
static bool wpas_ubus_init(void)
{
if (ctx)
@@ -61,6 +224,8 @@ static bool wpas_ubus_init(void)
@@ -61,6 +228,8 @@ static bool wpas_ubus_init(void)
if (!ctx)
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment