[RFC 04/13] NAN: Pass the entire frame in follow up receive callbacks
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Tue Dec 23 03:57:16 PST 2025
Follow up frames may be used outside of DE to carry additional
attributes. For example using NPBA for bootstrapping etc.
Extend the receive callback so the entire frame buffer is provided.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
src/ap/nan_usd_ap.c | 3 ++-
src/common/nan_de.c | 8 +++++---
src/common/nan_de.h | 3 ++-
wpa_supplicant/nan_supplicant.c | 3 ++-
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/ap/nan_usd_ap.c b/src/ap/nan_usd_ap.c
index 18c70be485..37ff9f1291 100644
--- a/src/ap/nan_usd_ap.c
+++ b/src/ap/nan_usd_ap.c
@@ -129,7 +129,8 @@ static void hostapd_nan_de_subscribe_terminated(void *ctx, int subscribe_id,
static void hostapd_nan_de_receive(void *ctx, int id, int peer_instance_id,
const u8 *ssi, size_t ssi_len,
- const u8 *peer_addr)
+ const u8 *peer_addr,
+ const u8 *buf, size_t len)
{
struct hostapd_data *hapd = ctx;
char *ssi_hex;
diff --git a/src/common/nan_de.c b/src/common/nan_de.c
index 9d24d87091..3b8687a5c3 100644
--- a/src/common/nan_de.c
+++ b/src/common/nan_de.c
@@ -1235,7 +1235,8 @@ offload:
static bool nan_de_rx_follow_up(struct nan_de *de, struct nan_de_service *srv,
const u8 *peer_addr, const u8 *a3,
- u8 instance_id, const u8 *ssi, size_t ssi_len)
+ u8 instance_id, const u8 *ssi, size_t ssi_len,
+ const u8 *buf, size_t len)
{
/* Follow-up function processing of a receive Follow-up message for a
* Subscribe or Publish instance */
@@ -1258,7 +1259,7 @@ static bool nan_de_rx_follow_up(struct nan_de *de, struct nan_de_service *srv,
if (de->cb.receive)
de->cb.receive(de->cb.ctx, srv->id, instance_id, ssi, ssi_len,
- peer_addr);
+ peer_addr, buf, len);
return true;
}
@@ -1479,7 +1480,8 @@ static bool nan_de_rx_sda(struct nan_de *de, const u8 *peer_addr, const u8 *a3,
break;
case NAN_SRV_CTRL_FOLLOW_UP:
ret |= nan_de_rx_follow_up(de, srv, peer_addr, a3,
- instance_id, ssi, ssi_len);
+ instance_id,
+ ssi, ssi_len, buf, len);
break;
}
}
diff --git a/src/common/nan_de.h b/src/common/nan_de.h
index dd6ff73549..7af4850012 100644
--- a/src/common/nan_de.h
+++ b/src/common/nan_de.h
@@ -55,7 +55,8 @@ struct nan_callbacks {
void (*receive)(void *ctx, int id, int peer_instance_id,
const u8 *ssi, size_t ssi_len,
- const u8 *peer_addr);
+ const u8 *peer_addr,
+ const u8 *buf, size_t len);
void (*process_p2p_usd_elems)(void *ctx, const u8 *buf,
u16 buf_len, const u8 *peer_addr,
diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c
index d101f31dc2..024412617c 100644
--- a/wpa_supplicant/nan_supplicant.c
+++ b/wpa_supplicant/nan_supplicant.c
@@ -2610,7 +2610,8 @@ static void wpas_nan_usd_offload_cancel_subscribe(void *ctx, int subscribe_id)
static void wpas_nan_de_receive(void *ctx, int id, int peer_instance_id,
const u8 *ssi, size_t ssi_len,
- const u8 *peer_addr)
+ const u8 *peer_addr,
+ const u8 *buf, size_t len)
{
struct wpa_supplicant *wpa_s = ctx;
--
2.49.0
More information about the Hostap
mailing list