From patchwork Wed Jun 24 13:12:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1316206 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.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=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=F2Y8pn2m; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sNsL5B86z9sSS for ; Wed, 24 Jun 2020 23:14:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=gcXCYQHfFxeJHuIZ1UZFo+o/CP3H0Y9cIs4YLvOAVDM=; b=F2Y8pn2mlxXJ6lyFfL5V92s0Y XNCP/Mha0DmZ3fj06i26aE9udDXczo4qrwK3GJ0cEM1HXsStH9GTQLePI1ePkni676v+riTc9Maq0 EBQwG/ByCRk0MzvV1DE+XPi7HhmT9CF6Rw/PwNP8C6DUWu7PaZYcEzLEQw8499aALT7mknBapMZsw QSGRpU6aFHQzIxzsSFuVHd2SmDkiMjveqKnZYztv2gCATvV30G+Rt7w2fDmsann58Gp5c0n7Z8Kto I6cdtlG1Aka7qrE11O8OssDWIWu2OGiJJ3V8YUY5zG6Pi1laIXUrGHrzQMVXujHnYFr207c2w/fn8 RqR0rnYBQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo5CQ-0005pi-TC; Wed, 24 Jun 2020 13:12:22 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo5CJ-0005jC-Tk for hostap@lists.infradead.org; Wed, 24 Jun 2020 13:12:17 +0000 Received: from [95.81.3.211] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jo5CI-00084W-DC; Wed, 24 Jun 2020 15:12:14 +0200 From: John Crispin To: hostap@lists.infradead.org Subject: [PATCH 2/4] RNR: add bss_parameters to the neighbor_db Date: Wed, 24 Jun 2020 15:12:10 +0200 Message-Id: <20200624131212.2648129-3-john@phrozen.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200624131212.2648129-1-john@phrozen.org> References: <20200624131212.2648129-1-john@phrozen.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Crispin Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org P802.11ax/D4.0 9.4.2.170 (Reduced Neighbor Report element) described this field used inside reduced neighbor reports. It holds info about multiple bssid and 6G co-location which was not present in the existing neighbor reports. Signed-off-by: John Crispin --- hostapd/ctrl_iface.c | 16 +++++++++++++++- src/ap/hostapd.h | 1 + src/ap/neighbor_db.c | 6 ++++-- src/ap/neighbor_db.h | 3 ++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index b470c5643..9ef394273 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -3003,6 +3003,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) u8 bssid[ETH_ALEN]; struct wpabuf *nr, *lci = NULL, *civic = NULL; int stationary = 0; + int bss_parameters = 0; char *tmp; int ret; @@ -3087,9 +3088,22 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf) if (os_strstr(buf, "stat")) stationary = 1; + tmp = os_strstr(buf, "bss_parameter="); + if (tmp) { + bss_parameters = atoi(tmp + 14); + if (bss_parameters > 0xff) { + wpa_printf(MSG_ERROR, + "CTRL: SET_NEIGHBOR: Bad bss_parameters subelement"); + wpabuf_free(nr); + wpabuf_free(lci); + wpabuf_free(civic); + return -1; + } + } + set: ret = hostapd_neighbor_set(hapd, bssid, &ssid, nr, lci, civic, - stationary); + stationary, bss_parameters); wpabuf_free(nr); wpabuf_free(lci); diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index ae16a30bf..b84627bf5 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -138,6 +138,7 @@ struct hostapd_neighbor_entry { /* LCI update time */ struct os_time lci_date; int stationary; + u8 bss_parameters; }; struct hostapd_sae_commit_queue { diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c index 01bf88623..41d0d1d15 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c @@ -120,7 +120,8 @@ hostapd_neighbor_add(struct hostapd_data *hapd) int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, const struct wpa_ssid_value *ssid, const struct wpabuf *nr, const struct wpabuf *lci, - const struct wpabuf *civic, int stationary) + const struct wpabuf *civic, int stationary, + u8 bss_parameters) { struct hostapd_neighbor_entry *entry; @@ -152,6 +153,7 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, } entry->stationary = stationary; + entry->bss_parameters = bss_parameters; return 0; @@ -311,7 +313,7 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) wpabuf_put_u8(nr, center_freq2_idx); hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci, - hapd->iconf->civic, hapd->iconf->stationary_ap); + hapd->iconf->civic, hapd->iconf->stationary_ap, 0); wpabuf_free(nr); #endif /* NEED_AP_MLME */ diff --git a/src/ap/neighbor_db.h b/src/ap/neighbor_db.h index bed0a2f5f..992671b62 100644 --- a/src/ap/neighbor_db.h +++ b/src/ap/neighbor_db.h @@ -17,7 +17,8 @@ int hostapd_neighbor_show(struct hostapd_data *hapd, char *buf, size_t buflen); int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid, const struct wpa_ssid_value *ssid, const struct wpabuf *nr, const struct wpabuf *lci, - const struct wpabuf *civic, int stationary); + const struct wpabuf *civic, int stationary, + u8 bss_parameters); void hostapd_neighbor_set_own_report(struct hostapd_data *hapd); int hostapd_neighbor_remove(struct hostapd_data *hapd, const u8 *bssid, const struct wpa_ssid_value *ssid);