From patchwork Fri Jul 19 04:40:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivani Baranwal X-Patchwork-Id: 1962290 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=cqEysofm; 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=UcRF4uod; 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 4WQH7h6Swcz20Ms for ; Fri, 19 Jul 2024 14:41:36 +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=B6qY4WWkpVEy++53bGtya2Uuj7mutYmEZQsceHM5rkI=; b=cqEysofmVSfvRz yvJQBaFxzlLIM0VXwHJ8hbMVpzHgzdOe98+PLo/qwddF6r0EBq5RJPshAd8v0xR1yjrLm0EwCBdT4 sVCTs5uJJt3txvWHpySEIEuP8XAE+dLERcn3DVBVd7jgzdmiTqgC5DwbYdEzrK95EPeDTCaChbHDY zf+4cqUsRMELm3j5Gr20HYjoME5LcPkgp1Idx2An9Ei10HKmc1uQ1vHmeFSi/mW4rOBO5JsxGCvFj cuwlh7MjfKVNhnY8aozLsKV/hpAoRM1pAUq97ywllTCS9X5TzWB9wbm/3TNzHV7ASrs8SMwE6Glne uOkX1Im+65hCh/JcF1MQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUfQl-00000001XTP-2MKQ; Fri, 19 Jul 2024 04:41:19 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUfQX-00000001XLO-3hgP for hostap@lists.infradead.org; Fri, 19 Jul 2024 04:41:07 +0000 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46J0tSOV000387 for ; Fri, 19 Jul 2024 04:41:04 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=DfRP0VuAs4dJ9lG0O5m+Mhpg IcgWql3/ZBQhHSNTOSg=; b=UcRF4uodmllZOhhfyAvSSvv2KZ5mlSlKXl/FLJah Y1XAZ8qGDvIbV7o8IvXrdsEiGuN3+V36XQSs9WHFtFsiFS42I8Y5vJXYk74Xtvwy 1KzLDM93GkTmmUtQ65ZjGSPOJdkZZyt5luD9BSfBszvNvBgmPxYuSYhtCAiU3krS MTYm+ykScqglsMqPmGklf5IW0ooO0SNA1Yoz1I6mnTCxc6R29yyAXdUSroNvjqcB Omn/WII5Ved1um9kH8bYhqfcKDFZomgKa9lYoAUDFi/IOGWHid/dZEIKmHZhnb7K gBtwPRecWxKb5WA0dvHXTBIZFsI8SqqX77Uw9ZXx9J1tEw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40fe1d8ch3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jul 2024 04:41:04 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46J4f34W010027 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 19 Jul 2024 04:41:03 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; Thu, 18 Jul 2024 21:41:02 -0700 From: Shivani Baranwal To: CC: Subject: [PATCH v2 09/14] p2p: Add support for p2p2 set apis Date: Fri, 19 Jul 2024 10:10:01 +0530 Message-ID: <1721364006-21658-10-git-send-email-quic_shivbara@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1721364006-21658-1-git-send-email-quic_shivbara@quicinc.com> References: <1721364006-21658-1-git-send-email-quic_shivbara@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-GUID: 51yH_L1fHgZzl2KGnD3RvtGYMTnPhU6o X-Proofpoint-ORIG-GUID: 51yH_L1fHgZzl2KGnD3RvtGYMTnPhU6o 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-07-19_01,2024-07-18_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 clxscore=1015 spamscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407190035 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240718_214106_457978_DFCB4126 X-CRM114-Status: GOOD ( 15.52 ) 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: Signed-off-by: Shivani Baranwal --- src/p2p/p2p.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ src/p2p/p2p.h | 8 +++++++ wpa_supplicant/ctrl_iface.c | 36 ++++++++++++ [...] Content analysis details: (-2.1 points, 5.0 required) 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 -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 Signed-off-by: Shivani Baranwal --- src/p2p/p2p.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ src/p2p/p2p.h | 8 +++++++ wpa_supplicant/ctrl_iface.c | 36 +++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 0a9a04d..eaf873f 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -4863,6 +4863,62 @@ void p2p_set_managed_oper(struct p2p_data *p2p, int enabled) } +void p2p_set_pairing_setup(struct p2p_data *p2p, int pairing_setup) +{ + p2p_dbg(p2p, "Pairing Setup: %d", pairing_setup); + p2p->cfg->pairing_config.pairing_capable = pairing_setup; + p2p->cfg->pairing_config.enable_pairing_setup = pairing_setup; + if (p2p->pairing_info) + p2p->pairing_info->enable_pairing_setup = pairing_setup; +} + + +void p2p_set_pairing_cache(struct p2p_data *p2p, int pairing_cache) +{ + p2p_dbg(p2p, "Pairing Cache: %d", pairing_cache); + p2p->cfg->pairing_config.enable_pairing_cache = pairing_cache; + if (p2p->pairing_info) + p2p->pairing_info->enable_pairing_cache = pairing_cache; +} + + +void p2p_set_pairing_verification(struct p2p_data *p2p, int pairing_verification) +{ + p2p_dbg(p2p, "Pairing Verification: %d", pairing_verification); + p2p->cfg->pairing_config.enable_pairing_verification = + pairing_verification; +} + + +void p2p_set_bootstrapmethods(struct p2p_data *p2p, int bootstrap_methods) +{ + p2p_dbg(p2p, "Bootstraping methods: 0x%x", bootstrap_methods); + p2p->cfg->pairing_config.bootstrap_methods = bootstrap_methods; + if (p2p->pairing_info) + p2p->pairing_info->supported_bootstrap = bootstrap_methods; +} + + +void p2p_set_pasn_type(struct p2p_data *p2p, u8 pasn_type) +{ + p2p_dbg(p2p, "PASN type: 0x%x", pasn_type); + p2p->cfg->pairing_config.pasn_type = pasn_type; +} + + +void p2p_set_comeback_after(struct p2p_data *p2p, int comeback_after) +{ + p2p_dbg(p2p, "Comeback after: %d", comeback_after); + p2p->cfg->comeback_after = comeback_after; +} + + +void p2p_set_reg_info(struct p2p_data *p2p, u8 val) +{ + p2p->cfg->reg_info = val; +} + + int p2p_config_get_random_social(struct p2p_config *p2p, u8 *op_class, u8 *op_channel, struct wpa_freq_range_list *avoid_list, diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 3cfe0b2..09940b0 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -2594,6 +2594,14 @@ int p2p_channel_to_freq(int op_class, int channel); struct wpabuf * p2p_usd_elems(struct p2p_data *p2p); void p2p_process_usd_elems(struct p2p_data *p2p, const u8 *ies, u16 ies_len, const u8 *peer_addr, unsigned int freq); +void p2p_set_pairing_setup(struct p2p_data *p2p, int pairing_setup); +void p2p_set_pairing_cache(struct p2p_data *p2p, int pairing_cache); +void p2p_set_pairing_verification(struct p2p_data *p2p, int pairing_verification); +void p2p_set_bootstrapmethods(struct p2p_data *p2p, int bootstrap_methods); +void p2p_set_pasn_type(struct p2p_data *p2p, u8 pasn_type); +void p2p_set_comeback_after(struct p2p_data *p2p, int comeback_after); +void p2p_set_reg_info(struct p2p_data *p2p, u8 val); + int p2p_initiate_pasn_auth(struct p2p_data *p2p, const u8 *addr, int freq); int p2p_pasn_auth_rx(struct p2p_data *p2p, const struct ieee80211_mgmt *mgmt, size_t len, int freq); diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index fc7f32f..2acabf2 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -7702,6 +7702,42 @@ static int p2p_ctrl_set(struct wpa_supplicant *wpa_s, char *cmd) return 0; } + if (os_strcmp(cmd, "pairing_setup") == 0) { + p2p_set_pairing_setup(wpa_s->global->p2p, atoi(param)); + return 0; + } + + if (os_strcmp(cmd, "pairing_cache") == 0) { + p2p_set_pairing_cache(wpa_s->global->p2p, atoi(param)); + return 0; + } + + if (os_strcmp(cmd, "pairing_verification") == 0) { + p2p_set_pairing_verification(wpa_s->global->p2p, atoi(param)); + return 0; + } + + if (os_strcmp(cmd, "supported_bootstrapmethods") == 0) { + p2p_set_bootstrapmethods(wpa_s->global->p2p, atoi(param)); + return 0; + } + + if (os_strcmp(cmd, "pasn_type") == 0) { + p2p_set_pasn_type(wpa_s->global->p2p, atoi(param)); + return 0; + } + + if (os_strcmp(cmd, "comeback_after") == 0) { + p2p_set_comeback_after(wpa_s->global->p2p, atoi(param)); + return 0; + } + + + if (os_strcmp(cmd, "reginfo") == 0) { + p2p_set_reg_info(wpa_s->global->p2p, atoi(param)); + return 0; + } + wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown P2P_SET field value '%s'", cmd);