From patchwork Tue Dec 4 07:39:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeonghwan Yoon X-Patchwork-Id: 1007470 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lge.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SICYtDY1"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 438DLr2ykZz9s3l for ; Tue, 4 Dec 2018 18:41:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QuoCsIWg2SvyhCiltDiEV74u1HmdSf7ajxPea8v2Ee8=; b=SICYtDY15I83t7bg+RMlVle+NH xYh9veSd1JtGq4+WXzBQr7tslSWqfvi/m0gMKxfobMD/ssA3zrMQefXpWQbZVCopwLLIXF8F4Qkkt 4Jtgrybo0EPTbgJFyoTdXoW7/bPsPtBMumF6wZme4JhlKnTJo4wrYfh7fX4cpIG6P83/WM69LSe1h r7Zx9xNr4/XUrBwrx1xln6ic8/8Q+SwE8Lr0HoKGgaegLnoQhCFWnnh9u1cftuwGbO2OlV1JDXYm5 lRpxxDuTZJsKmHsaB9rlICl4j59pp3uewf1Xo5gmq0BuLVTXNVQZ8+lverO6UScclkOarh2sbLDZO mD/AV/ew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gU5K7-0004nd-Gu; Tue, 04 Dec 2018 07:40:51 +0000 Received: from lgeamrelo13.lge.com ([156.147.23.53] helo=lgeamrelo11.lge.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gU5Jd-0003zU-45 for hostap@lists.infradead.org; Tue, 04 Dec 2018 07:40:25 +0000 Received: from unknown (HELO lgeamrelo01.lge.com) (156.147.1.125) by 156.147.23.53 with ESMTP; 4 Dec 2018 16:40:03 +0900 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: jeonghwan.yoon@lge.com Received: from unknown (HELO localhost.localdomain) (10.177.172.164) by 156.147.1.125 with ESMTP; 4 Dec 2018 16:40:03 +0900 X-Original-SENDERIP: 10.177.172.164 X-Original-MAILFROM: jeonghwan.yoon@lge.com From: Jeonghwan Yoon To: hostap@lists.infradead.org Subject: [PATCH v2 2/3] dbus: Enabled dpp functions Date: Tue, 4 Dec 2018 16:39:59 +0900 Message-Id: <20181204074000.19749-2-jeonghwan.yoon@lge.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204074000.19749-1-jeonghwan.yoon@lge.com> References: <20181204074000.19749-1-jeonghwan.yoon@lge.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181203_234021_671372_3842DFC5 X-CRM114-Status: GOOD ( 12.59 ) X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [156.147.23.53 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jeonghwan Yoon , hg.cho@lge.com, taesung.lim@lge.com, byungjoo.lee@lge.com, youngjun4724@lge.com MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Added dbus signals to report general dpp process. Signed-off-by: Jeonghwan Yoon --- doc/dbus.doxygen | 65 +++++++++++++++ wpa_supplicant/dbus/dbus_new.c | 139 ++++++++++++++++++++++++++++++++ wpa_supplicant/dbus/dbus_new.h | 33 +++++++- wpa_supplicant/dpp_supplicant.c | 18 +++++ wpa_supplicant/notify.c | 24 +++++- wpa_supplicant/notify.h | 10 ++- 6 files changed, 284 insertions(+), 5 deletions(-) diff --git a/doc/dbus.doxygen b/doc/dbus.doxygen index 1f754e3f2..610b44cda 100644 --- a/doc/dbus.doxygen +++ b/doc/dbus.doxygen @@ -1426,6 +1426,71 @@ Interface for performing DPP (Device Provisioning Protocol) Device operations. + +\subsection dbus_dppdevice_signals Signals + +
    +
  • +

    DppTx ( s : dst mac, u : frequency, i : type )

    +

    Transmission of the dpp action frame was successful.

    +

    Arguments

    +
    +
    s : dst mac
    +
    destination mac address.
    +
    +
    +
    u : frequency
    +
    operating frequency.
    +
    +
    +
    i : type
    +
    type number of the transmitted public frame
    +
    +
  • +
  • +

    DppTxStatus ( s : dst mac, u : frequency, s : status )

    +

    Transmission of the dpp action frame was successful.

    +

    Arguments

    +
    +
    s : dst mac
    +
    destination mac address.
    +
    +
    +
    u : frequency
    +
    operating frequency.
    +
    +
    +
    s : result
    +
    transmission status : "SUCCESS", "no-ACK", "FAILED"
    +
    +
  • +
  • +

    DppRx ( s : src mac, u : frequency, i : type )

    +

    Received the dpp action frame.

    +

    Arguments

    +
    +
    s : src mac
    +
    source mac address.
    +
    +
    +
    u : frequency
    +
    operating frequency.
    +
    +
    +
    i : type
    +
    type number of the transmitted public frame
    +
    +
  • +

    DppFailed ( s : message )

    +

    Failed in dpp process.

    +

    Arguments

    +
    +
    s : message
    +
    reason of failed.
    +
    + +
+ \section dbus_p2pdevice fi.w1.wpa_supplicant1.Interface.P2PDevice Interface for performing P2P (Wi-Fi Peer-to-Peer) P2P Device operations. diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index d9edf7379..361fba9de 100644 --- a/wpa_supplicant/dbus/dbus_new.c +++ b/wpa_supplicant/dbus/dbus_new.c @@ -2108,6 +2108,145 @@ void wpas_dbus_signal_p2p_invitation_received(struct wpa_supplicant *wpa_s, #endif /* CONFIG_P2P */ +#ifdef CONFIG_DPP +void wpas_dbus_signal_dpp_tx(struct wpa_supplicant *wpa_s, + const u8 *dst, unsigned int freq, int type) +{ + DBusMessage *msg; + DBusMessageIter iter; + struct wpas_dbus_priv *iface; + char mac_dst[WPAS_DBUS_OBJECT_PATH_MAX], *mac_dst_p; + + iface = wpa_s->global->dbus; + + /* Do nothing if the control interface is not turned on */ + if (iface == NULL || !wpa_s->dbus_new_path) + return; + + os_snprintf(mac_dst, WPAS_DBUS_OBJECT_PATH_MAX, MACSTR, MAC2STR(dst)); + mac_dst_p = mac_dst; + + msg = dbus_message_new_signal(wpa_s->dbus_new_path, + WPAS_DBUS_NEW_IFACE_DPPDEVICE, + "DppTx"); + + if (msg == NULL) + return; + + dbus_message_iter_init_append(msg, &iter); + if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, + &mac_dst_p) || + !dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, &freq) || + !dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &type)) + wpa_printf(MSG_ERROR, "dbus: Failed to construct signal"); + else + dbus_connection_send(iface->con, msg, NULL); + + dbus_message_unref(msg); +} + +void wpas_dbus_signal_dpp_tx_status(struct wpa_supplicant *wpa_s, + const u8 *dst, unsigned int freq, const char *res) +{ + DBusMessage *msg; + DBusMessageIter iter; + struct wpas_dbus_priv *iface; + char mac_dst[WPAS_DBUS_OBJECT_PATH_MAX], *mac_dst_p; + + iface = wpa_s->global->dbus; + + /* Do nothing if the control interface is not turned on */ + if (iface == NULL || !wpa_s->dbus_new_path) + return; + + os_snprintf(mac_dst, WPAS_DBUS_OBJECT_PATH_MAX, MACSTR, MAC2STR(dst)); + mac_dst_p = mac_dst; + + msg = dbus_message_new_signal(wpa_s->dbus_new_path, + WPAS_DBUS_NEW_IFACE_DPPDEVICE, + "DppTxStatus"); + if (msg == NULL) + return; + + dbus_message_iter_init_append(msg, &iter); + + if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, + &mac_dst_p) || + !dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, + &freq) || + !dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, + &res)) + wpa_printf(MSG_ERROR, "dbus: Failed to construct signal"); + else + dbus_connection_send(iface->con, msg, NULL); + + dbus_message_unref(msg); +} + +void wpas_dbus_signal_dpp_rx(struct wpa_supplicant *wpa_s, + const u8 *src, unsigned int freq, int type) +{ + DBusMessage *msg; + DBusMessageIter iter; + struct wpas_dbus_priv *iface; + char mac_src[WPAS_DBUS_OBJECT_PATH_MAX], *mac_src_p; + + iface = wpa_s->global->dbus; + + /* Do nothing if the control interface is not turned on */ + if (iface == NULL || !wpa_s->dbus_new_path) + return; + + os_snprintf(mac_src, WPAS_DBUS_OBJECT_PATH_MAX, MACSTR, MAC2STR(src)); + mac_src_p = mac_src; + + msg = dbus_message_new_signal(wpa_s->dbus_new_path, + WPAS_DBUS_NEW_IFACE_DPPDEVICE, + "DppRx"); + if (msg == NULL) + return; + + dbus_message_iter_init_append(msg, &iter); + + if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, + &mac_src_p) || + !dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT32, + &freq) || + !dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, + &type)) + wpa_printf(MSG_ERROR, "dbus: Failed to construct signal"); + else + dbus_connection_send(iface->con, msg, NULL); + + dbus_message_unref(msg); +} + +void wpas_dbus_signal_dpp_failed(struct wpa_supplicant *wpa_s, const char *res) +{ + struct wpas_dbus_priv *iface; + DBusMessage *msg; + + iface = wpa_s->global->dbus; + + /* Do nothing if the control interface is not turned on */ + if (iface == NULL || !wpa_s->dbus_new_path) + return; + + msg = dbus_message_new_signal(wpa_s->dbus_new_path, + WPAS_DBUS_NEW_IFACE_DPPDEVICE, "DppFailed"); + if (msg == NULL) + return; + + if (dbus_message_append_args(msg, DBUS_TYPE_STRING, &res, + DBUS_TYPE_INVALID)){ + dbus_connection_send(iface->con, msg, NULL); + }else{ + wpa_printf(MSG_ERROR, "dbus: Failed to construct signal"); + } + + dbus_message_unref(msg); +} +#endif /* CONFIG_DPP */ /** * wpas_dbus_signal_prop_changed - Signals change of property diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h index 054afad85..e1962546e 100644 --- a/wpa_supplicant/dbus/dbus_new.h +++ b/wpa_supplicant/dbus/dbus_new.h @@ -253,7 +253,15 @@ void wpas_dbus_signal_mesh_peer_connected(struct wpa_supplicant *wpa_s, const u8 *peer_addr); void wpas_dbus_signal_mesh_peer_disconnected(struct wpa_supplicant *wpa_s, const u8 *peer_addr, int reason); - +#ifdef CONFIG_DPP +void wpas_dbus_signal_dpp_tx(struct wpa_supplicant *wpa_s, + const u8 *dst, unsigned int freq, int type); +void wpas_dbus_signal_dpp_tx_status(struct wpa_supplicant *wpa_s, + const u8 *dst, unsigned int freq, const char *res); +void wpas_dbus_signal_dpp_rx(struct wpa_supplicant *wpa_s, + const u8 *src, unsigned int freq, int type); +void wpas_dbus_signal_dpp_failed(struct wpa_supplicant *wpa_s, const char *res); +#endif /* CONFIG_DPP */ #else /* CONFIG_CTRL_IFACE_DBUS_NEW */ static inline int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s) @@ -592,7 +600,26 @@ void wpas_dbus_signal_mesh_peer_disconnected(struct wpa_supplicant *wpa_s, const u8 *peer_addr, int reason) { } - +#ifdef CONFIG_DPP +static inline +void wpas_dbus_signal_dpp_tx(struct wpa_supplicant *wpa_s, + const u8 *dst, unsigned int freq, int type) +{ +} +static inline +void wpas_dbus_signal_dpp_tx_status(struct wpa_supplicant *wpa_s, + const u8 *dst, unsigned int freq, const char *res) +{ +} +static inline +void wpas_dbus_signal_dpp_rx(struct wpa_supplicant *wpa_s, + const u8 *src, unsigned int freq, int type) +{ +} +static inline +void wpas_dbus_signal_dpp_failed(struct wpa_supplicant *wpa_s, const char *res) +{ +} +#endif /* CONFIG_DPP */ #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ - #endif /* CTRL_IFACE_DBUS_H_NEW */ diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index 7bc46610a..621ea3ef7 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -106,6 +106,7 @@ int wpas_dpp_qr_code(struct wpa_supplicant *wpa_s, const char *cmd) " freq=%u type=%d", MAC2STR(auth->peer_mac_addr), auth->curr_freq, DPP_PA_AUTHENTICATION_RESP); + wpas_notify_dpp_tx(wpa_s, auth->peer_mac_addr, auth->curr_freq, DPP_PA_AUTHENTICATION_RESP); offchannel_send_action(wpa_s, auth->curr_freq, auth->peer_mac_addr, wpa_s->own_addr, broadcast, @@ -321,6 +322,7 @@ static void wpas_dpp_auth_resp_retry_timeout(void *eloop_ctx, void *timeout_ctx) " freq=%u type=%d", MAC2STR(auth->peer_mac_addr), auth->curr_freq, DPP_PA_AUTHENTICATION_RESP); + wpas_notify_dpp_tx(wpa_s, auth->peer_mac_addr, auth->curr_freq, DPP_PA_AUTHENTICATION_RESP); offchannel_send_action(wpa_s, auth->curr_freq, auth->peer_mac_addr, wpa_s->own_addr, broadcast, wpabuf_head(auth->resp_msg), @@ -786,6 +788,7 @@ static int wpas_dpp_auth_init_next(struct wpa_supplicant *wpa_s) } wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(dst), freq, DPP_PA_AUTHENTICATION_REQ); + wpas_notify_dpp_tx(wpa_s, dst, freq, DPP_PA_AUTHENTICATION_REQ); auth->auth_req_ack = 0; os_get_reltime(&wpa_s->dpp_last_init); return offchannel_send_action(wpa_s, freq, dst, @@ -1065,6 +1068,7 @@ static void wpas_dpp_rx_auth_req(struct wpa_supplicant *wpa_s, const u8 *src, if (!r_bootstrap || r_bootstrap_len != SHA256_MAC_LEN) { wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL "Missing or invalid required Responder Bootstrapping Key Hash attribute"); + wpas_notify_dpp_failed(wpa_s, "Missing or invalid required Responder Bootstrapping Key Hash attribute"); return; } wpa_hexdump(MSG_MSGDUMP, "DPP: Responder Bootstrapping Key Hash", @@ -1075,6 +1079,7 @@ static void wpas_dpp_rx_auth_req(struct wpa_supplicant *wpa_s, const u8 *src, if (!i_bootstrap || i_bootstrap_len != SHA256_MAC_LEN) { wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL "Missing or invalid required Initiator Bootstrapping Key Hash attribute"); + wpas_notify_dpp_failed(wpa_s, "Missing or invalid required Responder Bootstrapping Key Hash attribute"); return; } wpa_hexdump(MSG_MSGDUMP, "DPP: Initiator Bootstrapping Key Hash", @@ -1107,12 +1112,14 @@ static void wpas_dpp_rx_auth_req(struct wpa_supplicant *wpa_s, const u8 *src, if (!own_bi) { wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL "No matching own bootstrapping key found - ignore message"); + wpas_notify_dpp_failed(wpa_s, "No matching own bootstrapping key found - ignore message"); return; } if (wpa_s->dpp_auth) { wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_FAIL "Already in DPP authentication exchange - ignore new one"); + wpas_notify_dpp_failed(wpa_s,"Already in DPP authentication exchange - ignore new one"); return; } @@ -1145,6 +1152,7 @@ static void wpas_dpp_rx_auth_req(struct wpa_supplicant *wpa_s, const u8 *src, wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(src), wpa_s->dpp_auth->curr_freq, DPP_PA_AUTHENTICATION_RESP); + wpas_notify_dpp_tx(wpa_s, src, freq, DPP_PA_AUTHENTICATION_RESP); offchannel_send_action(wpa_s, wpa_s->dpp_auth->curr_freq, src, wpa_s->own_addr, broadcast, wpabuf_head(wpa_s->dpp_auth->resp_msg), @@ -1515,6 +1523,7 @@ static void wpas_dpp_rx_auth_resp(struct wpa_supplicant *wpa_s, const u8 *src, wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(src), auth->curr_freq, DPP_PA_AUTHENTICATION_CONF); + wpas_notify_dpp_tx(wpa_s, src, auth->curr_freq, DPP_PA_AUTHENTICATION_CONF); offchannel_send_action(wpa_s, auth->curr_freq, src, wpa_s->own_addr, broadcast, wpabuf_head(msg), wpabuf_len(msg), @@ -1546,6 +1555,7 @@ static void wpas_dpp_rx_auth_conf(struct wpa_supplicant *wpa_s, const u8 *src, if (dpp_auth_conf_rx(auth, hdr, buf, len) < 0) { wpa_printf(MSG_DEBUG, "DPP: Authentication failed"); + wpas_notify_dpp_failed(wpa_s, "Authentication failed"); return; } @@ -1759,6 +1769,7 @@ static void wpas_dpp_pkex_retry_timeout(void *eloop_ctx, void *timeout_ctx) pkex->exch_req_tries); wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(broadcast), pkex->freq, DPP_PA_PKEX_EXCHANGE_REQ); + wpas_notify_dpp_tx(wpa_s, broadcast, pkex->freq, DPP_PA_PKEX_EXCHANGE_REQ); offchannel_send_action(wpa_s, pkex->freq, broadcast, wpa_s->own_addr, broadcast, wpabuf_head(pkex->exchange_req), @@ -1786,6 +1797,7 @@ wpas_dpp_tx_pkex_status(struct wpa_supplicant *wpa_s, freq, MAC2STR(dst), res_txt); wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX_STATUS "dst=" MACSTR " freq=%u result=%s", MAC2STR(dst), freq, res_txt); + wpas_notify_dpp_tx_status(wpa_s, dst, freq, res_txt); if (!pkex) { wpa_printf(MSG_DEBUG, @@ -1858,6 +1870,7 @@ wpas_dpp_rx_pkex_exchange_req(struct wpa_supplicant *wpa_s, const u8 *src, wait_time = 2000; wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(src), freq, DPP_PA_PKEX_EXCHANGE_RESP); + wpas_notify_dpp_tx(wpa_s, src, freq, DPP_PA_PKEX_EXCHANGE_RESP); offchannel_send_action(wpa_s, freq, src, wpa_s->own_addr, broadcast, wpabuf_head(msg), wpabuf_len(msg), @@ -1901,6 +1914,7 @@ wpas_dpp_rx_pkex_exchange_resp(struct wpa_supplicant *wpa_s, const u8 *src, wait_time = 2000; wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(src), freq, DPP_PA_PKEX_COMMIT_REVEAL_REQ); + wpas_notify_dpp_tx(wpa_s, src, freq, DPP_PA_PKEX_COMMIT_REVEAL_REQ); offchannel_send_action(wpa_s, freq, src, wpa_s->own_addr, broadcast, wpabuf_head(msg), wpabuf_len(msg), @@ -1976,6 +1990,7 @@ wpas_dpp_rx_pkex_commit_reveal_req(struct wpa_supplicant *wpa_s, const u8 *src, wait_time = 2000; wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(src), freq, DPP_PA_PKEX_COMMIT_REVEAL_RESP); + wpas_notify_dpp_tx(wpa_s, src, freq, DPP_PA_PKEX_COMMIT_REVEAL_RESP); offchannel_send_action(wpa_s, freq, src, wpa_s->own_addr, broadcast, wpabuf_head(msg), wpabuf_len(msg), @@ -2068,6 +2083,7 @@ void wpas_dpp_rx_action(struct wpa_supplicant *wpa_s, const u8 *src, } wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_RX "src=" MACSTR " freq=%u type=%d", MAC2STR(src), freq, type); + wpas_notify_dpp_rx(wpa_s, src, freq, type); switch (type) { case DPP_PA_AUTHENTICATION_REQ: @@ -2420,6 +2436,7 @@ skip_connector: wait_time = 2000; wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_TX "dst=" MACSTR " freq=%u type=%d", MAC2STR(bss->bssid), bss->freq, DPP_PA_PEER_DISCOVERY_REQ); + wpas_notify_dpp_tx(wpa_s, bss->bssid, bss->freq, DPP_PA_PEER_DISCOVERY_REQ); offchannel_send_action(wpa_s, bss->freq, bss->bssid, wpa_s->own_addr, broadcast, wpabuf_head(msg), wpabuf_len(msg), @@ -2503,6 +2520,7 @@ int wpas_dpp_pkex_add(struct wpa_supplicant *wpa_s, const char *cmd) " freq=%u type=%d", MAC2STR(broadcast), pkex->freq, DPP_PA_PKEX_EXCHANGE_REQ); + wpas_notify_dpp_tx(wpa_s, broadcast, pkex->freq, DPP_PA_PKEX_EXCHANGE_REQ); offchannel_send_action(wpa_s, pkex->freq, broadcast, wpa_s->own_addr, broadcast, wpabuf_head(msg), wpabuf_len(msg), diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index 83df04f39..82d75baf2 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -900,5 +900,27 @@ void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s, wpas_dbus_signal_mesh_peer_disconnected(wpa_s, peer_addr, reason_code); } - #endif /* CONFIG_MESH */ +#ifdef CONFIG_DPP +void wpas_notify_dpp_tx(struct wpa_supplicant *wpa_s, const u8 *dst, + unsigned int freq, int type) +{ + wpas_dbus_signal_dpp_tx(wpa_s, dst, freq, type); +} + +void wpas_notify_dpp_tx_status(struct wpa_supplicant *wpa_s, const u8 *dst, + unsigned int freq, const char *res) +{ + wpas_dbus_signal_dpp_tx_status(wpa_s, dst, freq, res); +} + +void wpas_notify_dpp_rx(struct wpa_supplicant *wpa_s, const u8 *dst, + unsigned int freq, int type) +{ + wpas_dbus_signal_dpp_rx(wpa_s, dst, freq, type); +} +void wpas_notify_dpp_failed(struct wpa_supplicant *wpa_s, const char *res) +{ + wpas_dbus_signal_dpp_failed(wpa_s, res); +} +#endif /* CONFIG_DPP */ diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h index 3ca933c76..7f0dfb587 100644 --- a/wpa_supplicant/notify.h +++ b/wpa_supplicant/notify.h @@ -151,5 +151,13 @@ void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s, const u8 *peer_addr); void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s, const u8 *peer_addr, int reason_code); - +#ifdef CONFIG_DPP +void wpas_notify_dpp_tx(struct wpa_supplicant *wpa_s, const u8 *dst, + unsigned int freq, int type); +void wpas_notify_dpp_tx_status(struct wpa_supplicant *wpa_s, const u8 *dst, + unsigned int freq, const char *res); +void wpas_notify_dpp_rx(struct wpa_supplicant *wpa_s, const u8 *src, + unsigned int freq, int type); +void wpas_notify_dpp_failed(struct wpa_supplicant *wpa_s, const char *res); +#endif /* CONFIG_DPP */ #endif /* NOTIFY_H */