From patchwork Thu Sep 8 14:44:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veerendranath Jakkam X-Patchwork-Id: 1675666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=) 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=AYEl+yFE; 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=EQ5Au6RP; dkim-atps=neutral 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MNhkc1gWfz1yj1 for ; Fri, 9 Sep 2022 00:45:44 +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=0qKU+Gyt/BmMGI96hUaDOF2A7CI/VXyaKHVZk9q7g1g=; b=AYEl+yFE2+oJdt 8OVkaAUPgKeEb46/XAfR4g25/nF5AUOmFTJcEZA92y5I3TJ69oa7f9SPGikOwjaK3J5wr7MLwrL/J /nejTLhKG9A2sRAdNvjQ9lFIeuIMhy3NAAEk2PlGt+A7XvozxaM2UfGPeHZPDfY0bfx1gZSKggx7B 2Le3QMSZmfU26zQKxt4puBadOd6AdAdPsA8T3z/EGPjwuUVbtQ2RLl323y+HvaEO2chyW0LVN9SFb yFUudASOudkT6BKeALmlAi/JN9W5vSF0iO1kaqqogIGbPyY4qYPRubafHQkWgtDDSKUFAO3oIahnx Qw+V6jN+sOvCHS5Wf/ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWIlp-004qNt-V1; Thu, 08 Sep 2022 14:44:46 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWIll-004qIJ-Io for hostap@lists.infradead.org; Thu, 08 Sep 2022 14:44:43 +0000 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 288DYQpq015761 for ; Thu, 8 Sep 2022 14:44:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=JrqyHlASWQ52teGwLt3K8ybwWHaSLX9G8Q0STq0tBjI=; b=EQ5Au6RPQ/7V/pxwIaRBc/jrENn12D+cG5sGyitdjAnRsfXhQ/jDW8DjOUWYTE05bCa+ ugnwYCtTp7u1zhRC8B3aq7x6giLOPYDMG4hnVtPt81GH7vStej0P3GaIp63GEoSFM3MD umxta+YMhwdykwwc9JhGmat5AgnEDpzZgY4/9IzANaxUgxTY/B+2d7RY2CPJY4oh6kws xh2K0G8gGOyzgekWX+GiDXIYXE2oZots3uFFauyXwHsyb2h/k2hgrRJORD3bdJV7fLfk 7WfnjzwObH3Wz9OmnyhiBAAXIyIRoaiSy1+OLePH8yAltjN6yWJu+BD4ZvY4WCecWnfW PQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jfdxu8r29-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Sep 2022 14:44:39 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 288EicUT016645 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 8 Sep 2022 14:44:38 GMT Received: from cnss-mw-linux.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.986.29; Thu, 8 Sep 2022 07:44:36 -0700 From: Veerendranath Jakkam To: CC: Subject: [PATCH v2 02/17] Add API to get ML IE of specified type from IEs buffer Date: Thu, 8 Sep 2022 20:14:08 +0530 Message-ID: <20220908144423.2222859-3-quic_vjakkam@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908144423.2222859-1-quic_vjakkam@quicinc.com> References: <20220908144423.2222859-1-quic_vjakkam@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-GUID: yh6iiV0sAXQAx5EyobY0QzbaI0v-qfEr X-Proofpoint-ORIG-GUID: yh6iiV0sAXQAx5EyobY0QzbaI0v-qfEr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-08_10,2022-09-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209080053 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_074441_756773_0F94E901 X-CRM114-Status: GOOD ( 17.65 ) X-Spam-Score: -0.9 (/) 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 utitliy API to get specified type Multi-Link IE from IEs buffer Signed-off-by: Veerendranath Jakkam --- src/common/ieee802_11_common.c | 16 ++++++++++++++++ src/common/ieee802_11_common.h | 1 + 2 files changed, 17 insertions(+) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [205.220.180.131 listed in list.dnswl.org] -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_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 -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 utitliy API to get specified type Multi-Link IE from IEs buffer Signed-off-by: Veerendranath Jakkam --- src/common/ieee802_11_common.c | 16 ++++++++++++++++ src/common/ieee802_11_common.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index c8ee90cd7..0eac3f84c 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -2755,3 +2755,19 @@ struct wpabuf * ieee802_11_defrag(struct ieee802_11_elems *elems, return ieee802_11_defrag_data(elems, eid, eid_ext, data, len); } + +const u8 * get_ml_ie(const u8 *ies, size_t len, u8 type) +{ + const struct element *elem; + + if (!ies) + return NULL; + + for_each_element_extid(elem, WLAN_EID_EXT_MULTI_LINK, ies, len) { + if (elem->datalen >= 2 && + (elem->data[1] & MULTI_LINK_CONTROL_TYPE_MASK) == type) + return &elem->id; + } + + return NULL; +} diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h index 94e1d7b8b..bd2c9fbf5 100644 --- a/src/common/ieee802_11_common.h +++ b/src/common/ieee802_11_common.h @@ -343,5 +343,6 @@ struct wpabuf * ieee802_11_defrag_data(struct ieee802_11_elems *elems, const u8 *data, u8 len); struct wpabuf * ieee802_11_defrag(struct ieee802_11_elems *elems, u8 eid, u8 eid_ext); +const u8 * get_ml_ie(const u8 *ies, size_t len, u8 type); #endif /* IEEE802_11_COMMON_H */