{"id":2218859,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2218859/?format=json","project":{"id":22,"url":"http://patchwork.ozlabs.org/api/1.0/projects/22/?format=json","name":"HostAP Development","link_name":"hostap","list_id":"hostap.lists.infradead.org","list_email":"hostap@lists.infradead.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260401220220.4418-68-andrei.otcheretianski@intel.com>","date":"2026-04-01T22:02:16","name":"[67/71] NAN: Implement bootstrapping","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"debd20c3234450d39089ab828bfd2a960faccff8","submitter":{"id":62065,"url":"http://patchwork.ozlabs.org/api/1.0/people/62065/?format=json","name":"Andrei Otcheretianski","email":"andrei.otcheretianski@intel.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/hostap/patch/20260401220220.4418-68-andrei.otcheretianski@intel.com/mbox/","series":[{"id":498402,"url":"http://patchwork.ozlabs.org/api/1.0/series/498402/?format=json","date":"2026-04-01T22:01:09","name":"NAN Data Path and Bootstrapping support","version":1,"mbox":"http://patchwork.ozlabs.org/series/498402/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2218859/checks/","tags":{},"headers":{"Return-Path":"\n <hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=2ihdR6I3;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=iEKTak3O;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmK2N2DvQz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 09:11:24 +1100 (AEDT)","from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w83lr-0000000GGnc-3lqL;\n\tWed, 01 Apr 2026 22:10:49 +0000","from mgamail.intel.com ([198.175.65.20])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w83i9-0000000G9xK-3YVK\n\tfor hostap@lists.infradead.org;\n\tWed, 01 Apr 2026 22:07:04 +0000","from fmviesa003.fm.intel.com ([10.60.135.143])\n  by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Apr 2026 15:06:21 -0700","from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com)\n ([10.167.28.6])\n  by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Apr 2026 15:06:20 -0700"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=evbOXXmQyrRvecK+sEAibgHzSEPPswrxdhr/BsgJLj8=; b=2ihdR6I3ToQRlW\n\tkpkM2Cf18zeI4VG3V8hB5K3MYRKTtsqGHemhocSts+DdOw8PpravBs6A4o5SZzhl0FtRO4veKPXCi\n\txv08TZ9TYFVy6Zpq8YWIQwihUGTT9Ioz9lVRTKefmFfJgra6IBSEWMt3JF7LH2mLDnKJuNGdc0/+d\n\tXu9G0s5dIMy9iKHsmdwTg6KnuLx+d4xzXSBifWheXti+P5yq9DsMZjnzX4Z66u8WRui3Qlo+c8B0Y\n\t97Oz5YKFrmx2mOfSsWhefnFJnOuYs+7GVIzgtpDzH2oh/vK+s09TjcvFztZbXSa8rVdaGQp50jBxh\n\t7uzFfUTIze3MpJqOHV+Q==;","v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1775081214; x=1806617214;\n  h=from:to:subject:date:message-id:in-reply-to:references:\n   mime-version:content-transfer-encoding;\n  bh=fQCigVpHEdNlvswaDXpKcUnd46uB5k21BW4AKbe8ztQ=;\n  b=iEKTak3Orp+hggoRZFEKdgcbBVzyWlupcSYYo9ENaAIJZmRfz+E6GZHW\n   GOBHN7MMGHhQPKB3t5Z15zrzLIW5LdJDjdlXr3eA/NfAl4CRV3otYvpr3\n   DwSVaOsdiUWL5Xu6TVdDZfTBwMwnxcbPTs7gSu4Wk5y8RMQwO3HgHuFA9\n   NATAEh9qvbn6Q8HW7noQNtiQqgkNwaxM5lGHDuZNtwjNUC7fW+Fb9/9qJ\n   mkPDtneP1/AeC7JWTl2TroQQ+QmqQBXsYUNKDxXdicCpyYTyhKdiRHk9c\n   9CXgWKPgXEuTFsVhpiHu54tFKLdbUji6AGLjfHRHR2iO86q63VNy08b7u\n   A==;"],"X-CSE-ConnectionGUID":["iEXCaSTVT3ut8L7c5tIeVg==","Z5/dQ4d3QoSeY1z+ou+lAw=="],"X-CSE-MsgGUID":["s83yNZAVQL21qBwmGX5mvQ==","pKOxA+ufTmyFlgtkSKfF/g=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11746\"; a=\"75851690\"","E=Sophos;i=\"6.23,153,1770624000\";\n   d=\"scan'208\";a=\"75851690\""],"X-ExtLoop1":"1","From":"Andrei Otcheretianski <andrei.otcheretianski@intel.com>","To":"hostap@lists.infradead.org","Subject":"[PATCH 67/71] NAN: Implement bootstrapping","Date":"Thu,  2 Apr 2026 01:02:16 +0300","Message-ID":"<20260401220220.4418-68-andrei.otcheretianski@intel.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260401220220.4418-1-andrei.otcheretianski@intel.com>","References":"<20260401220220.4418-1-andrei.otcheretianski@intel.com>","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20260401_150654_162259_82FA0FB2 ","X-CRM114-Status":"GOOD (  23.79  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Implement boostrapping handshake: - Add support for\n processing\n    followup messages that might hold the NPBA attribute. - Add support for\n initiating\n    bootstrapping with a peer. - As initiator,\n internally handle bootstrap comeback\n    from a p [...]\n Content analysis details:   (-1.9 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,\n                             medium trust\n                             [198.175.65.20 listed in list.dnswl.org]\n  1.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [198.175.65.20 listed in\n bl.score.senderscore.com]\n  1.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n                             query to Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                          [198.175.65.20 listed in\n sa-trusted.bondedsender.org]\n  1.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [198.175.65.20 listed in sa-accredit.habeas.com]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n -0.5 DKIMWL_WL_HIGH         DKIMwl.org - High trust sender","X-BeenThere":"hostap@lists.infradead.org","X-Mailman-Version":"2.1.34","Precedence":"list","List-Id":"<hostap.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/hostap/>","List-Post":"<mailto:hostap@lists.infradead.org>","List-Help":"<mailto:hostap-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"Hostap\" <hostap-bounces@lists.infradead.org>","Errors-To":"hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"Implement boostrapping handshake:\n\n- Add support for processing followup messages that might\n  hold the NPBA attribute.\n- Add support for initiating bootstrapping with a peer.\n- As initiator, internally handle bootstrap comeback\n  from a peer.\n\nSigned-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>\nSigned-off-by: Ilan Peer <ilan.peer@intel.com>\n---\n src/nan/nan.c           |  38 +++\n src/nan/nan.h           |   6 +\n src/nan/nan_bootstrap.c | 686 ++++++++++++++++++++++++++++++++++++++++\n src/nan/nan_i.h         |  36 +++\n wpa_supplicant/Makefile |   1 +\n 5 files changed, 767 insertions(+)\n create mode 100644 src/nan/nan_bootstrap.c","diff":"diff --git a/src/nan/nan.c b/src/nan/nan.c\nindex 202731c3f0..a0c058ce7c 100644\n--- a/src/nan/nan.c\n+++ b/src/nan/nan.c\n@@ -130,6 +130,7 @@ static void nan_del_peer(struct nan_data *nan, struct nan_peer *peer)\n \t\tnan_ndp_setup_stop(nan, peer);\n \t}\n \n+\tnan_bootstrap_reset(nan, peer);\n \tdl_list_del(&peer->list);\n \tnan_peer_flush_avail(&peer->info);\n \tnan_peer_flush_dev_capa(&peer->info);\n@@ -1267,6 +1268,43 @@ static int nan_configure_peer_schedule(struct nan_data *nan,\n }\n \n \n+/**\n+ * nan_process_followup - Process a received NAN Followup action frame\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @addr: Source address of the received frame\n+ * @buf: Buffer containing the received frame\n+ * @len: Length of the received frame in octets\n+ * @req_instance_id: Instance ID of the request that triggered this followup\n+ * @handle: Service handle of the service associated with this followup\n+ *\n+ * Returns: true if the frame was processed successfully, false on failure\n+ */\n+bool nan_process_followup(struct nan_data *nan, const u8 *addr, const u8 *buf,\n+\t\t\t  size_t len, u8 req_instance_id, int handle)\n+{\n+\tstruct nan_attrs attrs;\n+\tbool ret;\n+\n+\tif (nan_parse_attrs(nan, buf, len, &attrs)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Followup: Failed parsing attributes\");\n+\t\treturn false;\n+\t}\n+\n+\tif (!attrs.bpba || !attrs.bpba_len) {\n+\t\tnan_attrs_clear(nan, &attrs);\n+\t\treturn false;\n+\t}\n+\n+\tret = nan_bootstrap_handle_rx(nan, addr, attrs.bpba, attrs.bpba_len,\n+\t\t\t\t      buf, len, handle, req_instance_id);\n+\n+\tnan_attrs_clear(nan, &attrs);\n+\treturn ret;\n+}\n+\n+\n static void nan_peer_state_timeout(void *eloop_ctx, void *timeout_ctx)\n {\n \tstruct nan_data *nan = eloop_ctx;\ndiff --git a/src/nan/nan.h b/src/nan/nan.h\nindex 74e1c646e3..904af0fdf4 100644\n--- a/src/nan/nan.h\n+++ b/src/nan/nan.h\n@@ -591,6 +591,12 @@ void nan_flush(struct nan_data *nan);\n \n int nan_add_peer(struct nan_data *nan, const u8 *addr,\n \t\t const u8 *device_attrs, size_t device_attrs_len);\n+bool nan_process_followup(struct nan_data *nan, const u8 *addr, const u8 *buf,\n+\t\t\t  size_t len, u8 req_instance_id, int handle);\n+int nan_bootstrap_request(struct nan_data *nan, int handle,\n+\t\t\t  const u8 *peer_addr, u8 req_instance_id, u16 pbm,\n+\t\t\t  bool auth);\n+int nan_bootstrap_peer_reset(struct nan_data *nan, const u8 *peer_nmi);\n \n bool nan_publish_instance_id_valid(struct nan_data *nan, u8 instance_id,\n \t\t\t\t   u8 *service_id);\ndiff --git a/src/nan/nan_bootstrap.c b/src/nan/nan_bootstrap.c\nnew file mode 100644\nindex 0000000000..561fea5ebc\n--- /dev/null\n+++ b/src/nan/nan_bootstrap.c\n@@ -0,0 +1,686 @@\n+/*\n+ * Wi-Fi Aware - NAN Bootstrap\n+ * Copyright (C) 2025 Intel Corporation\n+ *\n+ * This software may be distributed under the terms of the BSD license.\n+ * See README for more details.\n+ */\n+\n+#include \"includes.h\"\n+#include \"common.h\"\n+#include \"eloop.h\"\n+#include \"nan_i.h\"\n+\n+#define NAN_BOOTSTRAP_RETRY_TIMEOUT_US (1 * 1000 * 1000) /* 1 second */\n+#define NAN_BOOTSTRAP_COOKIE_LEN 4\n+\n+static void nan_bootstrap_timeout(void *eloop_data, void *user_ctx);\n+\n+/*\n+ * nan_complement_pbm - Get complement pairing bootstrapping method\n+ *\n+ * @pbm: Pairing bootstrapping method\n+ * Returns: Complement pairing bootstrapping method\n+ */\n+static u16 nan_complement_pbm(u16 pbm)\n+{\n+\tif (pbm == NAN_PBA_METHOD_OPPORTUNISTIC)\n+\t\treturn NAN_PBA_METHOD_OPPORTUNISTIC;\n+\tif (pbm == NAN_PBA_METHOD_PIN_DISPLAY)\n+\t\treturn NAN_PBA_METHOD_PIN_KEYPAD;\n+\tif (pbm == NAN_PBA_METHOD_PASSPHRASE_DISPLAY)\n+\t\treturn NAN_PBA_METHOD_PASSPHRASE_KEYPAD;\n+\tif (pbm == NAN_PBA_METHOD_QR_DISPLAY)\n+\t\treturn NAN_PBA_METHOD_QR_SCAN;\n+\tif (pbm == NAN_PBA_METHOD_NFC_TAG)\n+\t\treturn NAN_PBA_METHOD_NFC_READER;\n+\tif (pbm == NAN_PBA_METHOD_PIN_KEYPAD)\n+\t\treturn NAN_PBA_METHOD_PIN_DISPLAY;\n+\tif (pbm == NAN_PBA_METHOD_PASSPHRASE_KEYPAD)\n+\t\treturn NAN_PBA_METHOD_PASSPHRASE_DISPLAY;\n+\tif (pbm == NAN_PBA_METHOD_QR_SCAN)\n+\t\treturn NAN_PBA_METHOD_QR_DISPLAY;\n+\tif (pbm == NAN_PBA_METHOD_NFC_READER)\n+\t\treturn NAN_PBA_METHOD_NFC_TAG;\n+\tif (pbm == NAN_PBA_METHOD_SERVICE_MANAGED)\n+\t\treturn NAN_PBA_METHOD_SERVICE_MANAGED;\n+\tif (pbm == NAN_PBA_METHOD_HANDSHAKE_SKIPPED)\n+\t\treturn NAN_PBA_METHOD_HANDSHAKE_SKIPPED;\n+\n+\treturn 0;\n+}\n+\n+\n+/*\n+ * nan_bootstrap_reset - Reset bootstrap state\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @peer: Peer to reset bootstrap state\n+ */\n+void nan_bootstrap_reset(struct nan_data *nan, struct nan_peer *peer)\n+{\n+\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: Reset state\");\n+\n+\teloop_cancel_timeout(nan_bootstrap_timeout, nan, peer);\n+\tos_free(peer->bootstrap.cookie);\n+\n+\t/*\n+\t * Do not use memset to reset all data, to preserve the peer's\n+\t * supported bootstrap methods\n+\t */\n+\tpeer->bootstrap.cookie = NULL;\n+\tpeer->bootstrap.cookie_len = 0;\n+\tpeer->bootstrap.initiator = false;\n+\tpeer->bootstrap.dialog_token = 0;\n+\tpeer->bootstrap.requested_pbm = 0;\n+\tpeer->bootstrap.authorized = 0;\n+\tpeer->bootstrap.status = 0;\n+\tpeer->bootstrap.comeback_required = false;\n+\tpeer->bootstrap.in_progress = false;\n+\tpeer->bootstrap.reason_code = 0;\n+\tpeer->bootstrap.handle = -1;\n+\tpeer->bootstrap.req_instance_id = 0;\n+}\n+\n+\n+/*\n+ * nan_bootstrap_build_npba - Build NAN Pairing Bootstrap Attribute\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @peer: Peer for which to build the attribute\n+ */\n+static struct wpabuf * nan_bootstrap_build_npba(struct nan_data *nan,\n+\t\t\t\t\t\tstruct nan_peer *peer)\n+{\n+\tstruct wpabuf *buf;\n+\tu16 pbm = peer->bootstrap.requested_pbm;\n+\tu8 type_and_status;\n+\tu8 *len;\n+\n+\t/*\n+\t * Allocate max possible size: header (3) + dialog token (1) + type and\n+\t * status (1) + reason (1) + comeback (2 + 1 + comeback token) + pbm (2)\n+\t */\n+\tbuf = wpabuf_alloc(11 + peer->bootstrap.cookie_len);\n+\tif (!buf)\n+\t\treturn NULL;\n+\n+\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: Build NPBA attribute\");\n+\n+\tif (peer->bootstrap.initiator) {\n+\t\ttype_and_status = NAN_PBA_TYPE_RESPONSE;\n+\t\tif (peer->bootstrap.status)\n+\t\t\tpbm = 0;\n+\t} else {\n+\t\ttype_and_status = NAN_PBA_TYPE_REQUEST;\n+\t}\n+\n+\ttype_and_status |= (peer->bootstrap.status << NAN_PBA_STATUS_POS);\n+\n+\twpabuf_put_u8(buf, NAN_ATTR_BPBA);\n+\tlen = wpabuf_put(buf, 2);\n+\n+\twpabuf_put_u8(buf, peer->bootstrap.dialog_token);\n+\twpabuf_put_u8(buf, type_and_status);\n+\twpabuf_put_u8(buf, peer->bootstrap.reason_code);\n+\n+\tif (peer->bootstrap.status == NAN_PBA_STATUS_COMEBACK) {\n+\t\tif (peer->bootstrap.initiator)\n+\t\t\twpabuf_put_le16(buf, peer->bootstrap.comeback_after);\n+\n+\t\twpabuf_put_u8(buf, peer->bootstrap.cookie_len);\n+\t\tif (peer->bootstrap.cookie)\n+\t\t\twpabuf_put_data(buf, peer->bootstrap.cookie,\n+\t\t\t\t\tpeer->bootstrap.cookie_len);\n+\t}\n+\n+\twpabuf_put_le16(buf, pbm);\n+\tWPA_PUT_LE16(len, wpabuf_len(buf) - 3);\n+\n+\treturn buf;\n+}\n+\n+\n+/*\n+ * nan_bootstrap_timeout - Bootstrap timeout handler\n+ *\n+ * @eloop_data: NAN module context from nan_init()\n+ * @user_ctx: Peer for which the timeout occurred\n+ */\n+static void nan_bootstrap_timeout(void *eloop_data, void *user_ctx)\n+{\n+\tstruct nan_data *nan = eloop_data;\n+\tstruct nan_peer *peer = user_ctx;\n+\tstruct wpabuf *attr;\n+\n+\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: timeout. status=%u\",\n+\t\t   peer->bootstrap.status);\n+\n+\tattr = nan_bootstrap_build_npba(nan, peer);\n+\tif (!attr) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Failed to build attribute\");\n+\n+\t\tnan_bootstrap_reset(nan, peer);\n+\n+\t\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t      0, false,\n+\t\t\t\t\t      NAN_REASON_UNSPECIFIED_REASON);\n+\t\treturn;\n+\t}\n+\n+\tif (nan->cfg->transmit_followup(nan->cfg->cb_ctx, peer->nmi_addr, attr,\n+\t\t\t\t\tpeer->bootstrap.handle,\n+\t\t\t\t\tpeer->bootstrap.req_instance_id)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Failed to transmit followup\");\n+\n+\t\tnan_bootstrap_reset(nan, peer);\n+\n+\t\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t      0, false,\n+\t\t\t\t\t      NAN_REASON_UNSPECIFIED_REASON);\n+\t}\n+\n+\twpabuf_free(attr);\n+\n+\t/* If the peer didn't reply, try again */\n+\tif (peer->bootstrap.status != NAN_PBA_STATUS_COMEBACK)\n+\t\teloop_register_timeout(0, NAN_BOOTSTRAP_RETRY_TIMEOUT_US,\n+\t\t\t\t       nan_bootstrap_timeout, nan, peer);\n+}\n+\n+\n+/*\n+ * nan_bootstrap_handle_rx_request - Process received bootstrap request\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @peer: Peer from which the request was received\n+ * @dialog_token: Dialog token from the request\n+ * @pbm: Pairing bootstrapping method bitmap from the request\n+ * @cookie: Comeback cookie from the request (if any)\n+ * @cookie_len: Length of the comeback cookie\n+ * @status: Status field from the request\n+ * @handle: Follow up handle\n+ * @req_instance_id: Follow up instance ID\n+ */\n+static void nan_bootstrap_handle_rx_request(struct nan_data *nan,\n+\t\t\t\t\t    struct nan_peer *peer,\n+\t\t\t\t\t    u8 dialog_token, u16 pbm,\n+\t\t\t\t\t    const u8 *cookie,\n+\t\t\t\t\t    u8 cookie_len, u8 status,\n+\t\t\t\t\t    int handle, u8 req_instance_id)\n+{\n+\tstruct wpabuf *attr = NULL;\n+\tu16 supported_methods;\n+\n+\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: RX request\");\n+\n+\tif (peer->bootstrap.initiator && peer->bootstrap.comeback_required) {\n+\t\tif (status != NAN_PBA_STATUS_COMEBACK) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: Missing comeback cookie. Ignore\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tif (cookie_len != peer->bootstrap.cookie_len ||\n+\t\t    !!cookie ^ !!peer->bootstrap.cookie ||\n+\t\t    (cookie && os_memcmp(cookie, peer->bootstrap.cookie,\n+\t\t\t\t\t cookie_len) != 0)) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: Invalid comeback cookie. Ignore\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tif (dialog_token != peer->bootstrap.dialog_token) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: Invalid dialog token. Ignore\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tif (handle != peer->bootstrap.handle ||\n+\t\t    req_instance_id != peer->bootstrap.req_instance_id) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: Invalid handle or instance ID\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Valid comeback request(pbm=0x%04x) authorized=0x%04x\",\n+\t\t\t   pbm, peer->bootstrap.authorized);\n+\n+\t\tif (peer->bootstrap.authorized == nan_complement_pbm(pbm)) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: Peer bootstrap authorized. Accept.\");\n+\n+\t\t\tpeer->bootstrap.status = NAN_PBA_STATUS_ACCEPTED;\n+\t\t\tpeer->bootstrap.reason_code = 0;\n+\t\t\tpeer->bootstrap.comeback_required = false;\n+\t\t\tpeer->bootstrap.requested_pbm = nan_complement_pbm(pbm);\n+\t\t}\n+\n+\t\tgoto send_response;\n+\t}\n+\n+\twpa_printf(MSG_DEBUG,\n+\t\t   \"NAN: Bootstrap: New bootstrap request. pbm=0x%04x\", pbm);\n+\n+\tnan_bootstrap_reset(nan, peer);\n+\n+\tpeer->bootstrap.initiator = true;\n+\tpeer->bootstrap.dialog_token = dialog_token;\n+\tpeer->bootstrap.requested_pbm = nan_complement_pbm(pbm);\n+\tpeer->bootstrap.in_progress = true;\n+\tpeer->bootstrap.handle = handle;\n+\tpeer->bootstrap.req_instance_id = req_instance_id;\n+\tsupported_methods =\n+\t\tnan->cfg->get_supported_bootstrap_methods(nan->cfg->cb_ctx,\n+\t\t\t\t\t\t\t  handle);\n+\n+\tif (!(supported_methods & peer->bootstrap.requested_pbm)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: No supported bootstrap methods in request\");\n+\n+\t\tpeer->bootstrap.status = NAN_PBA_STATUS_REJECTED;\n+\t\tpeer->bootstrap.reason_code =\n+\t\t\tNAN_REASON_PAIR_BOOTSTRAP_REJECTED;\n+\t\tgoto send_response;\n+\t}\n+\n+\tif (peer->bootstrap.requested_pbm &\n+\t    nan->cfg->auto_accept_bootstrap_methods) {\n+\t\tpeer->bootstrap.authorized = peer->bootstrap.requested_pbm;\n+\t\tpeer->bootstrap.status = NAN_PBA_STATUS_ACCEPTED;\n+\t\tgoto send_response;\n+\t}\n+\n+\tpeer->bootstrap.status = NAN_PBA_STATUS_COMEBACK;\n+\tpeer->bootstrap.comeback_required = true;\n+\tpeer->bootstrap.cookie_len = NAN_BOOTSTRAP_COOKIE_LEN;\n+\tpeer->bootstrap.cookie = os_malloc(peer->bootstrap.cookie_len);\n+\n+\tif (peer->bootstrap.cookie)\n+\t\tos_get_random(peer->bootstrap.cookie,\n+\t\t\t      peer->bootstrap.cookie_len);\n+\telse\n+\t\tpeer->bootstrap.cookie_len = 0;\n+\n+\tpeer->bootstrap.comeback_after =\n+\t\tnan->cfg->bootstrap_comeback_timeout;\n+\n+\tif (nan->cfg->bootstrap_request)\n+\t\tnan->cfg->bootstrap_request(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t    peer->bootstrap.requested_pbm);\n+\n+send_response:\n+\tattr = nan_bootstrap_build_npba(nan, peer);\n+\tif (!attr) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Failed to build bootstrap attribute\");\n+\t\tgoto done;\n+\t}\n+\n+\tif (nan->cfg->transmit_followup(nan->cfg->cb_ctx, peer->nmi_addr, attr,\n+\t\t\t\t\thandle, req_instance_id)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Failed to transmit bootstrap followup\");\n+\n+\t\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t      0, false,\n+\t\t\t\t\t      NAN_REASON_UNSPECIFIED_REASON);\n+\t\tgoto done;\n+\t}\n+\n+\n+\tif (peer->bootstrap.status == NAN_PBA_STATUS_COMEBACK) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Wait for comeback bootstrap request\");\n+\n+\t\twpabuf_free(attr);\n+\t\treturn;\n+\t}\n+\n+\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx,\n+\t\t\t\t      peer->nmi_addr,\n+\t\t\t\t      peer->bootstrap.requested_pbm,\n+\t\t\t\t      peer->bootstrap.status ==\n+\t\t\t\t      NAN_PBA_STATUS_ACCEPTED,\n+\t\t\t\t      peer->bootstrap.reason_code);\n+done:\n+\twpabuf_free(attr);\n+\tnan_bootstrap_reset(nan, peer);\n+}\n+\n+\n+/*\n+ * nan_bootstrap_supported - Check if bootstrap operations are supported\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * Returns: true if all required bootstrap operations are supported\n+ */\n+static bool nan_bootstrap_supported(struct nan_data *nan)\n+{\n+\treturn nan->cfg->bootstrap_completed &&\n+\t\tnan->cfg->bootstrap_request &&\n+\t\tnan->cfg->transmit_followup &&\n+\t\tnan->cfg->get_supported_bootstrap_methods;\n+}\n+\n+\n+/*\n+ * nan_bootstrap_handle_rx - Process received bootstrap follow up\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @peer_nmi: Peer address from which the follow up was received\n+ * @npba: Pointer to the NPBA attribute in the follow up\n+ * @npba_len: Length of the NPBA attribute\n+ * @buf: Complete follow up frame\n+ * @len: Length of the complete follow up frame\n+ * @handle: Follow up handle\n+ * @req_instance_id: Follow up instance ID\n+ * Returns: true if the follow up was processed, false on error\n+ */\n+bool nan_bootstrap_handle_rx(struct nan_data *nan, const u8 *peer_nmi,\n+\t\t\t     const u8 *npba, u16 npba_len,\n+\t\t\t     const u8 *buf, size_t len,\n+\t\t\t     int handle, u8 req_instance_id)\n+{\n+\tconst u8 *cookie = NULL;\n+\tu8 dialog_token, type, status, reason_code, cookie_len = 0;\n+\tu16 pbm, comeback_after = 0;\n+\tstruct nan_peer *peer;\n+\n+\tif (!nan_bootstrap_supported(nan)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Not all bootstrap operations are supported. Ignore\");\n+\t\treturn false;\n+\t}\n+\n+\tdialog_token = *npba++;\n+\ttype = *npba & NAN_PBA_TYPE_MSK;\n+\tstatus = (*npba++ >> NAN_PBA_STATUS_POS) & NAN_PBA_STATUS_MSK;\n+\treason_code = *npba++;\n+\tnpba_len -= 3;\n+\n+\tif (type == NAN_PBA_TYPE_ADVERTISE) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: type == Advertise. Ignore\");\n+\t\treturn false;\n+\t}\n+\n+\tif (type != NAN_PBA_TYPE_REQUEST &&\n+\t    type != NAN_PBA_TYPE_RESPONSE) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Unknown NPBA type %u\", type);\n+\t\treturn false;\n+\t}\n+\n+\tif (status == NAN_PBA_STATUS_COMEBACK) {\n+\t\tif (type == NAN_PBA_TYPE_RESPONSE) {\n+\t\t\tif (npba_len < 2) {\n+\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t   \"NAN: Bootstrap: Response too short for comeback after\");\n+\t\t\t\treturn false;\n+\t\t\t}\n+\n+\t\t\tcomeback_after = WPA_GET_LE16(npba);\n+\t\t\tnpba += 2;\n+\t\t\tnpba_len -= 2;\n+\t\t}\n+\n+\t\tif (npba_len < 1) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: Response too short for comeback cookie length\");\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tcookie_len = *npba++;\n+\t\tnpba_len -= 1;\n+\t\tif (cookie_len > npba_len) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Bootstrap: comeback field is too long\");\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tcookie = npba;\n+\t\tnpba += cookie_len;\n+\t\tnpba_len -= cookie_len;\n+\t}\n+\n+\tif (npba_len < 2) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Buffer too short for PBM\");\n+\t\treturn false;\n+\t}\n+\n+\tpbm = WPA_GET_LE16(npba);\n+\tpeer = nan_get_peer(nan, peer_nmi);\n+\n+\t/* Handle NAN bootstrap request */\n+\tif (type == NAN_PBA_TYPE_REQUEST) {\n+\t\tif (!peer) {\n+\t\t\tnan_add_peer(nan, peer_nmi, buf, len);\n+\t\t\tpeer = nan_get_peer(nan, peer_nmi);\n+\n+\t\t\tif (!peer) {\n+\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t   \"NAN: Bootstrap: Failed alloc peer from bootstrap request\");\n+\t\t\t\treturn false;\n+\t\t\t}\n+\t\t}\n+\n+\t\tnan_bootstrap_handle_rx_request(nan, peer, dialog_token,\n+\t\t\t\t\t\tpbm, cookie, cookie_len,\n+\t\t\t\t\t\tstatus, handle,\n+\t\t\t\t\t\treq_instance_id);\n+\t\treturn true;\n+\t}\n+\n+\t/* Handle NAN bootstrap response */\n+\tif (!peer || !peer->bootstrap.in_progress ||\n+\t    peer->bootstrap.initiator) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Unexpected bootstrap response\");\n+\t\treturn false;\n+\t}\n+\n+\tif (dialog_token != peer->bootstrap.dialog_token) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Response with invalid dialog token. Ignore\");\n+\t\treturn false;\n+\t}\n+\n+\tif (handle != peer->bootstrap.handle ||\n+\t    req_instance_id != peer->bootstrap.req_instance_id) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Response with invalid handle or instance ID. Ignore\");\n+\t\treturn false;\n+\t}\n+\n+\tpeer->bootstrap.status = status;\n+\tpeer->bootstrap.reason_code = reason_code;\n+\tpeer->bootstrap.comeback_required = (status == NAN_PBA_STATUS_COMEBACK);\n+\tpeer->bootstrap.comeback_after = comeback_after;\n+\n+\tif (cookie && cookie_len) {\n+\t\tos_free(peer->bootstrap.cookie);\n+\t\tpeer->bootstrap.cookie = os_memdup(cookie, cookie_len);\n+\n+\t\tif (!peer->bootstrap.cookie) {\n+\t\t\tnan_bootstrap_reset(nan, peer);\n+\t\t\treturn false;\n+\t\t}\n+\t\tpeer->bootstrap.cookie_len = cookie_len;\n+\t}\n+\n+\tif (status == NAN_PBA_STATUS_ACCEPTED &&\n+\t    nan_complement_pbm(pbm) == peer->bootstrap.requested_pbm) {\n+\t\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: Accepted. Complete.\");\n+\n+\t\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx,\n+\t\t\t\t\t      peer->nmi_addr,\n+\t\t\t\t\t      peer->bootstrap.requested_pbm,\n+\t\t\t\t\t      true, 0);\n+\t\tnan_bootstrap_reset(nan, peer);\n+\t} else if (status == NAN_PBA_STATUS_REJECTED) {\n+\t\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: Rejected. Complete\");\n+\n+\t\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t      0, false, reason_code);\n+\t\tnan_bootstrap_reset(nan, peer);\n+\t} else if (status == NAN_PBA_STATUS_COMEBACK) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Comeback required. Schedule timeout for %u TU\",\n+\t\t\t   peer->bootstrap.comeback_after);\n+\n+\t\teloop_cancel_timeout(nan_bootstrap_timeout, nan, peer);\n+\t\teloop_register_timeout(peer->bootstrap.comeback_after / 1024,\n+\t\t\t\t       (peer->bootstrap.comeback_after % 1024) * 1000,\n+\t\t\t\t       nan_bootstrap_timeout, nan, peer);\n+\t} else {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Unknown status=%u. Abort.\",\n+\t\t\t   status);\n+\n+\t\tnan->cfg->bootstrap_completed(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t      0, false,\n+\t\t\t\t\t      NAN_REASON_UNSPECIFIED_REASON);\n+\t\tnan_bootstrap_reset(nan, peer);\n+\t}\n+\n+\treturn true;\n+}\n+\n+\n+/*\n+ * nan_bootstrap_request - Initiate NAN bootstrap request to a peer\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @handle: Follow up handle\n+ * @peer_nmi: Peer address to which to send the bootstrap request\n+ * @req_instance_id: Follow up instance ID\n+ * @pbm: Pairing bootstrapping method bitmap to use\n+ * @auth: If true, authorize the bootstrap request for the peer instead of\n+ *        sending the request\n+ * Returns: 0 on success, -1 on failure\n+ */\n+int nan_bootstrap_request(struct nan_data *nan, int handle,\n+\t\t\t  const u8 *peer_nmi, u8 req_instance_id, u16 pbm,\n+\t\t\t  bool auth)\n+{\n+\tstruct nan_peer *peer;\n+\tstruct wpabuf *npba;\n+\tint ret;\n+\n+\tif (!nan || !nan->nan_started)\n+\t\treturn -1;\n+\n+\tif (!nan_bootstrap_supported(nan)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Not all bootstrap operations are supported. Ignore\");\n+\t\treturn -1;\n+\t}\n+\n+\twpa_printf(MSG_DEBUG,\n+\t\t   \"NAN: Bootstrap: Request bootstrap to peer \" MACSTR\n+\t\t   \" pbm=0x%x auth=%d\",\n+\t\t   MAC2STR(peer_nmi), pbm, auth);\n+\n+\tpeer = nan_get_peer(nan, peer_nmi);\n+\tif (!peer) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Request for unknown peer\");\n+\t\treturn -1;\n+\t}\n+\n+\tif (!(pbm & nan->cfg->supported_bootstrap_methods)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Unsupported method=0x%x (local support=0x%x)\",\n+\t\t\t   pbm, nan->cfg->supported_bootstrap_methods);\n+\t\treturn -1;\n+\t}\n+\n+\tif (pbm & (pbm - 1)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Multiple bootstrap methods=0x%x in request\",\n+\t\t\t   pbm);\n+\t\treturn -1;\n+\t}\n+\n+\tif (auth) {\n+\t\twpa_printf(MSG_DEBUG, \"NAN: Bootstrap: Authorize request\");\n+\n+\t\tpeer->bootstrap.authorized = pbm;\n+\t\treturn 0;\n+\t}\n+\n+\tif (peer->bootstrap.in_progress) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: already in progress with the peer\");\n+\t\treturn -1;\n+\t}\n+\n+\tif (!(nan_complement_pbm(pbm) & peer->bootstrap.supported_methods)) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Peer doesn't support method=0x%x\",\n+\t\t\t   pbm);\n+\t\treturn -1;\n+\t}\n+\n+\twpa_printf(MSG_DEBUG, \"NAN: Prepare bootstrap request\");\n+\n+\tnan_bootstrap_reset(nan, peer);\n+\n+\tpeer->bootstrap.dialog_token = nan_get_next_dialog_token(nan);\n+\tpeer->bootstrap.requested_pbm = pbm;\n+\tpeer->bootstrap.in_progress = true;\n+\tpeer->bootstrap.handle = handle;\n+\tpeer->bootstrap.req_instance_id = req_instance_id;\n+\n+\tnpba = nan_bootstrap_build_npba(nan, peer);\n+\tif (!npba) {\n+\t\tnan_bootstrap_reset(nan, peer);\n+\t\treturn -1;\n+\t}\n+\n+\tret = nan->cfg->transmit_followup(nan->cfg->cb_ctx, peer->nmi_addr,\n+\t\t\t\t\t  npba, handle, req_instance_id);\n+\twpabuf_free(npba);\n+\tif (ret) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Failed to transmit followup\");\n+\n+\t\tnan_bootstrap_reset(nan, peer);\n+\t\treturn -1;\n+\t}\n+\n+\teloop_register_timeout(0, NAN_BOOTSTRAP_RETRY_TIMEOUT_US,\n+\t\t\t       nan_bootstrap_timeout, nan, peer);\n+\treturn ret;\n+}\n+\n+\n+/*\n+ * nan_bootstrap_peer_reset - Reset bootstrap state for a peer\n+ *\n+ * @nan: NAN module context from nan_init()\n+ * @peer_nmi: Peer address for which to reset the bootstrap state\n+ * Returns: 0 on success, -1 on failure\n+ */\n+int nan_bootstrap_peer_reset(struct nan_data *nan, const u8 *peer_nmi)\n+{\n+\tstruct nan_peer *peer;\n+\n+\tif (!nan || !nan->nan_started)\n+\t\treturn -1;\n+\n+\tpeer = nan_get_peer(nan, peer_nmi);\n+\tif (!peer) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Bootstrap: Reset for unknown peer\");\n+\t\treturn -1;\n+\t}\n+\n+\tnan_bootstrap_reset(nan, peer);\n+\treturn 0;\n+}\ndiff --git a/src/nan/nan_i.h b/src/nan/nan_i.h\nindex ac1b6fb857..8ed66cfa97 100644\n--- a/src/nan/nan_i.h\n+++ b/src/nan/nan_i.h\n@@ -408,9 +408,40 @@ struct nan_ndl {\n  *\n  * @supported_methods: Bitmap of supported bootstrap methods. See\n  *     &enum nan_pairing_bootstrapping_method.\n+ * @initiator: True iff this device is the initiator.\n+ * @requested_pbm: Bitmap of requested bootstrap methods. See\n+ *     &enum nan_pairing_bootstrapping_method.\n+ * @dialog_token: Dialog token of the bootstrap exchange.\n+ * @status: Status of the bootstrap exchange. See &enum nan_pba_status.\n+ * @reason_code: Reason code for the bootstrap exchange. See &enum nan_reason.\n+ * @comeback_required: True iff the peer requested a comeback.\n+ * @comeback_after: Time after which the comeback is requested.\n+ * @cookie: Pointer to the cookie received from the peer.\n+ * @cookie_len: Length of the cookie.\n+ * @authorized: Authorized bootstrap method. See &enum\n+ *     nan_pairing_bootstrapping_method.\n+ * @in_progress: True iff a bootstrap exchange is in progress.\n+ * @handle: Follow up context handle for the ongoing bootstrap request.\n+ * @req_instance_id: Instance ID of the bootstrap request.\n  */\n struct nan_bootstrap {\n \tu16 supported_methods;\n+\tbool initiator;\n+\tu16 requested_pbm;\n+\tu8 dialog_token;\n+\tu8 status;\n+\tu8 reason_code;\n+\n+\tbool comeback_required;\n+\tu16 comeback_after;\n+\tu8 *cookie;\n+\tu8 cookie_len;\n+\n+\tu16 authorized;\n+\tbool in_progress;\n+\n+\tint handle;\n+\tu8 req_instance_id;\n };\n \n /**\n@@ -648,4 +679,9 @@ int nan_sec_get_tk(struct nan_data *nan, struct nan_peer *peer,\n \t\t   u8 *tk, size_t *tk_len, enum nan_cipher_suite_id *csid);\n void nan_add_dev_capa_ext_attr(struct nan_data *nan, struct wpabuf *buf);\n \n+void nan_bootstrap_reset(struct nan_data *nan, struct nan_peer *peer);\n+bool nan_bootstrap_handle_rx(struct nan_data *nan, const u8 *peer_nmi,\n+\t\t\t     const u8 *npba, u16 npba_len,\n+\t\t\t     const u8 *buf, size_t len,\n+\t\t\t     int handle, u8 req_instance_id);\n #endif /* NAN_I_H */\ndiff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile\nindex 5c93ab69ec..a802d4d77d 100644\n--- a/wpa_supplicant/Makefile\n+++ b/wpa_supplicant/Makefile\n@@ -337,6 +337,7 @@ OBJS += ../src/nan/nan_ndp.o\n OBJS += ../src/nan/nan_ndl.o\n OBJS += ../src/nan/nan_crypto.o\n OBJS += ../src/nan/nan_sec.o\n+OBJS += ../src/nan/nan_bootstrap.o\n endif\n \n ifdef CONFIG_PR\n","prefixes":["67/71"]}