[PATCH 10/92] NAN: Add pairing capability indication attribute to NAN IE
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Wed Apr 22 05:23:01 PDT 2026
From: Avraham Stern <avraham.stern at intel.com>
Add a function for adding the NAN pairing indication attribute
to the NAN IE. Currently only the Device Capability Extension
attribute (DCEA) is added, more attributes will be added in later
patches.
Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
src/nan/nan.h | 9 +++++++++
src/nan/nan_pairing.c | 32 ++++++++++++++++++++++++++++++++
wpa_supplicant/Makefile | 3 +++
3 files changed, 44 insertions(+)
create mode 100644 src/nan/nan_pairing.c
diff --git a/src/nan/nan.h b/src/nan/nan.h
index 66e078a621..f012d43638 100644
--- a/src/nan/nan.h
+++ b/src/nan/nan.h
@@ -659,5 +659,14 @@ int nan_set_bootstrap_configuration(struct nan_data *nan,
u16 supported_bootstrap_methods,
u16 auto_accept_bootstrap_methods,
u16 bootstrap_comeback_timeout);
+#ifdef CONFIG_PASN
+int nan_pairing_add_attrs(struct nan_data *nan_data, struct wpabuf *buf);
+#else
+static inline int nan_pairing_add_attrs(struct nan_data *nan_data,
+ struct wpabuf *buf)
+{
+ return 0;
+}
+#endif /* CONFIG_PASN */
#endif /* NAN_H */
diff --git a/src/nan/nan_pairing.c b/src/nan/nan_pairing.c
new file mode 100644
index 0000000000..49cfa17073
--- /dev/null
+++ b/src/nan/nan_pairing.c
@@ -0,0 +1,32 @@
+/*
+ * Wi-Fi Aware - NAN pairing module
+ * Copyright (C) 2025 Intel Corporation
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#include "includes.h"
+#include "common.h"
+#include "nan/nan_i.h"
+
+/*
+ * nan_pairing_add_attrs - Add NAN pairing attributes to a buffer
+ *
+ * @nan: Pointer to NAN data structure containing configuration
+ * @buf: Pointer to wpabuf where attributes will be added
+ *
+ * This function adds NAN attributes that indicate pairing capabilities
+ * to the provided buffer.
+ *
+ * Returns: 0 on success, -1 otherwise
+ */
+int nan_pairing_add_attrs(struct nan_data *nan, struct wpabuf *buf)
+{
+ if (!nan || !buf)
+ return -1;
+
+ nan_add_dev_capa_ext_attr(nan, buf);
+
+ return 0;
+}
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 1a862d627c..67f337df33 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -338,6 +338,9 @@ OBJS += ../src/nan/nan_ndl.o
OBJS += ../src/nan/nan_crypto.o
OBJS += ../src/nan/nan_sec.o
OBJS += ../src/nan/nan_bootstrap.o
+ifdef CONFIG_PASN
+OBJS += ../src/nan/nan_pairing.o
+endif
endif
ifdef CONFIG_PR
--
2.53.0
More information about the Hostap
mailing list