DPP2: Presence Announcement notification

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>
This commit is contained in:
Andrew Beltrano 2020-09-21 13:48:32 +00:00 committed by Jouni Malinen
parent cf3d260c39
commit 8b667bfa14
3 changed files with 17 additions and 0 deletions

View 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 */

View 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;

View 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 "