]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Presence Announcement notification
authorAndrew Beltrano <anbeltra@microsoft.com>
Mon, 21 Sep 2020 13:48:32 +0000 (13:48 +0000)
committerJouni Malinen <j@w1.fi>
Wed, 7 Oct 2020 18:13:37 +0000 (21:13 +0300)
Define a control event with bootstrap id, frame source, frequency, and
chirp hash for receipt of Presence Announcement (chirp) frames.

Signed-off-by: Andrew Beltrano <anbeltra@microsoft.com>
src/common/dpp.c
src/common/dpp.h
src/common/wpa_ctrl.h

index 3922edb635d378a011948f8a199dbab3877cbded..552d7626c655eb28012fa98be8374346771bf624 100644 (file)
@@ -4317,6 +4317,7 @@ void dpp_global_deinit(struct dpp_global *dpp)
 
 
 #ifdef CONFIG_DPP2
+
 struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi)
 {
        struct wpabuf *msg;
@@ -4333,4 +4334,17 @@ struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi)
                        "DPP: Presence Announcement frame attributes", msg);
        return msg;
 }
+
+
+void dpp_notify_chirp_received(void *msg_ctx, int id, const u8 *src,
+                               unsigned int freq, const u8 *hash)
+{
+       char hex[SHA256_MAC_LEN * 2 + 1];
+
+       wpa_snprintf_hex(hex, sizeof(hex), hash, SHA256_MAC_LEN);
+       wpa_msg(msg_ctx, MSG_INFO,
+               DPP_EVENT_CHIRP_RX "id=%d src=" MACSTR " freq=%u hash=%s",
+               id, MAC2STR(src), freq, hex);
+}
+
 #endif /* CONFIG_DPP2 */
index 011098f032cc3103d6dbf45cb43051371366cf70..a39e87ed5f6560dd9cedebe707f2ee3d1087b6c9 100644 (file)
@@ -686,6 +686,8 @@ int dpp_tcp_init(struct dpp_global *dpp, struct dpp_authentication *auth,
                                         struct dpp_authentication *auth));
 
 struct wpabuf * dpp_build_presence_announcement(struct dpp_bootstrap_info *bi);
+void dpp_notify_chirp_received(void *msg_ctx, int id, const u8 *src,
+                               unsigned int freq, const u8 *hash);
 
 struct dpp_global_config {
        void *cb_ctx;
index 4e42c890fa2215e7a399a49164050279d306fead..52888d73061c2a257d501bd430c8c74efdcb00ca 100644 (file)
@@ -202,6 +202,7 @@ extern "C" {
 #define DPP_EVENT_MUD_URL "DPP-MUD-URL "
 #define DPP_EVENT_BAND_SUPPORT "DPP-BAND-SUPPORT "
 #define DPP_EVENT_CSR "DPP-CSR "
+#define DPP_EVENT_CHIRP_RX "DPP-CHIRP-RX "
 
 /* MESH events */
 #define MESH_GROUP_STARTED "MESH-GROUP-STARTED "