From patchwork Mon Aug 5 09:33:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivani Baranwal X-Patchwork-Id: 1968971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=i4udVIBF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=FRAC0nve; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WcrrD740jz1yZb for ; Mon, 5 Aug 2024 19:34:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Yn+2/VoKHs1TleWSybY4LdTxeWcFwRyzHImmYHgZ7I0=; b=i4udVIBFQlXb8X wdLsPke0kdMHRrF5E9B4lbzeeXCyX/NWvZNapsVYdFu6bUlrXjzbkKLaeb8h+S0IV6tl71cmCrbgj 8CPy8vhTHWY3g1ZqUwiFsUikzhLMn6Yu50NSy93kaYjhsRhc/fDB3sj5a9jIkySoEXIOMXvizG+1u mhHPy4IY0ML34jBTPsRB96BiEdNMIXCc6WQKe5TZtfLNYSyKtsW7krMjEUdZ8/KqttjEI9fapEz5g 6T3KjSiySHncWPl1bZy2IyEe13TXQNLUJXysJmhTI7dTyPBlMISWrdJyz/nhe/DjmMOstfyTXeJ4P DobfoxqCq0gHnSD9NFMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sau6m-0000000FIlj-45lS; Mon, 05 Aug 2024 09:34:30 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sau6e-0000000FIgc-1n9Q for hostap@lists.infradead.org; Mon, 05 Aug 2024 09:34:22 +0000 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4752VeoV019224 for ; Mon, 5 Aug 2024 09:34:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=2bmPUBh70Ba/GKBKf332s1Qe wMOutRbkufa0uAaGL8M=; b=FRAC0nvehh1+9RwgBWuAdNVsXdSSjSsgxcaFn0Pi mEhKdRKKQ5OE9+IqsU5Wb3KSrBJ81kDJp/YGnkTlZtjT1o//qsCTLH+iaF6loq5T 08Qufm1xksfTwyB7aSj+xUwOU2n2tiwz+fsuAsW9jy4Aup8IT4NY9QxF+lNqk6ZL QMHBxQETMmWewVOcrFQzAOK5I5o0JSPg+4k4Lpg30NCaKJNQuzQWEvjbewQN6jP0 lrx2cLYJg81HKBJQFjvXzCOVVqsYAhX9D7EAllV2NXj42KZ59Ugxf+ozx9kWrjYb W/43qp1neyqmxc5BqMDDPTVXoQk5VM0Lq7SDz4A4K98NEA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40scs2ueem-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 05 Aug 2024 09:34:19 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 4759YJff022374 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 5 Aug 2024 09:34:19 GMT Received: from hu-shivbara-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 5 Aug 2024 02:34:17 -0700 From: Shivani Baranwal To: CC: Subject: [PATCH v3 06/25] P2P: Add freq list to subscriber to search for publisher on mutli channels Date: Mon, 5 Aug 2024 15:03:04 +0530 Message-ID: <1722850403-8852-7-git-send-email-quic_shivbara@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1722850403-8852-1-git-send-email-quic_shivbara@quicinc.com> References: <1722850403-8852-1-git-send-email-quic_shivbara@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: xuh3ejfLefE0oX6OawiTdorC5nFPXg3C X-Proofpoint-GUID: xuh3ejfLefE0oX6OawiTdorC5nFPXg3C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-04_14,2024-08-02_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 mlxlogscore=657 phishscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408050067 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_023420_557647_F55CCAF4 X-CRM114-Status: GOOD ( 19.36 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add freq list to active NAN USD subscriber to search for a publisher on multiple channels. These are the publish channel list used by the subscriber to periodically search for a service on these chann [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.220.168.131 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.220.168.131 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.220.168.131 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add freq list to active NAN USD subscriber to search for a publisher on multiple channels. These are the publish channel list used by the subscriber to periodically search for a service on these channels. In P2P2 seeker is an active subscriber looking for advertiser on list of publish channels. Signed-off-by: Shivani Baranwal --- src/common/nan_de.c | 11 +++++++++++ src/common/nan_de.h | 3 +++ wpa_supplicant/ctrl_iface.c | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/common/nan_de.c b/src/common/nan_de.c index 5a68cc9..938a357 100644 --- a/src/common/nan_de.c +++ b/src/common/nan_de.c @@ -1355,6 +1355,17 @@ int nan_de_subscribe(struct nan_de *de, const char *service_name, if (nan_de_derive_service_id(srv) < 0) goto fail; os_memcpy(&srv->subscribe, params, sizeof(*params)); + + if (params->freq_list) { + size_t len; + + len = (int_array_len(params->freq_list) + 1) * sizeof(int); + srv->freq_list = os_memdup(params->freq_list, len); + if (!srv->freq_list) + goto fail; + } + srv->subscribe.freq_list = NULL; + srv->srv_proto_type = srv_proto_type; if (ssi) { srv->ssi = wpabuf_dup(ssi); diff --git a/src/common/nan_de.h b/src/common/nan_de.h index bdac284..73f6c9c 100644 --- a/src/common/nan_de.h +++ b/src/common/nan_de.h @@ -125,6 +125,9 @@ struct nan_subscribe_params { /* Selected frequency */ unsigned int freq; + /* Multi-channel frequencies (publishChannelList) */ + const int *freq_list; + /* Query period in ms; 0 = use default */ unsigned int query_period; }; diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index f3d74a8..5588e79 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -12373,6 +12373,7 @@ static int wpas_ctrl_nan_subscribe(struct wpa_supplicant *wpa_s, char *cmd, struct wpabuf *ssi = NULL; int ret = -1; enum nan_service_protocol_type srv_proto_type = 0; + int *freq_list = NULL; bool p2p = false; os_memset(¶ms, 0, sizeof(params)); @@ -12399,6 +12400,27 @@ static int wpas_ctrl_nan_subscribe(struct wpa_supplicant *wpa_s, char *cmd, continue; } + if (os_strncmp(token, "freq_list=", 10) == 0) { + char *pos = token + 10; + + if (os_strcmp(pos, "all") == 0) { + os_free(freq_list); + freq_list = wpas_nan_usd_all_freqs(wpa_s); + params.freq_list = freq_list; + continue; + } + + while (pos && pos[0]) { + int_array_add_unique(&freq_list, atoi(pos)); + pos = os_strchr(pos, ','); + if (pos) + pos++; + } + + params.freq_list = freq_list; + continue; + } + if (os_strncmp(token, "srv_proto_type=", 15) == 0) { srv_proto_type = atoi(token + 15); continue;