[PATCH 13/50] common: Split ieee8021_parse_elems()
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Wed Feb 15 15:08:27 PST 2023
From: Ilan Peer <ilan.peer at intel.com>
As a preparation to parse management frames that include
ML elements with per station profiles, split the function
to an helper function that would not memset the elements
structure.
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
src/common/ieee802_11_common.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index 7741a8df8d..d1e8bae897 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -409,22 +409,20 @@ static int ieee802_11_parse_extension(const u8 *pos, size_t elen,
/**
- * ieee802_11_parse_elems - Parse information elements in management frames
+ * __ieee802_11_parse_elems - Parse information elements in management frames
* @start: Pointer to the start of IEs
* @len: Length of IE buffer in octets
* @elems: Data structure for parsed elements
* @show_errors: Whether to show parsing errors in debug log
* Returns: Parsing result
*/
-ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
- struct ieee802_11_elems *elems,
- int show_errors)
+static ParseRes __ieee802_11_parse_elems(const u8 *start, size_t len,
+ struct ieee802_11_elems *elems,
+ int show_errors)
{
const struct element *elem;
int unknown = 0;
- os_memset(elems, 0, sizeof(*elems));
-
if (!start)
return ParseOK;
@@ -676,6 +674,16 @@ done:
}
+ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
+ struct ieee802_11_elems *elems,
+ int show_errors)
+{
+ os_memset(elems, 0, sizeof(*elems));
+
+ return __ieee802_11_parse_elems(start, len, elems, show_errors);
+}
+
+
int ieee802_11_ie_count(const u8 *ies, size_t ies_len)
{
const struct element *elem;
--
2.38.1
More information about the Hostap
mailing list