Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 2/4] ie: add ie_akm_suite_to_string
Date: Wed, 24 Mar 2021 15:25:57 -0700	[thread overview]
Message-ID: <20210324222559.577225-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20210324222559.577225-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2111 bytes --]

Converts ie_rsn_akm_suite values into strings
---
 src/ie.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 src/ie.h |  2 ++
 2 files changed, 48 insertions(+)

diff --git a/src/ie.c b/src/ie.c
index 46f7496e..b265b811 100644
--- a/src/ie.c
+++ b/src/ie.c
@@ -2636,3 +2636,49 @@ int ie_build_hs20_indication(uint8_t version, uint8_t *to)
 
 	return 0;
 }
+
+const char *ie_akm_suite_to_string(enum ie_rsn_akm_suite akm)
+{
+	switch (akm) {
+	case IE_RSN_AKM_SUITE_8021X:
+		return "802.1x";
+	case IE_RSN_AKM_SUITE_PSK:
+		return "PSK";
+	case IE_RSN_AKM_SUITE_FT_OVER_8021X:
+		return "FT-802.1x";
+	case IE_RSN_AKM_SUITE_FT_USING_PSK:
+		return "FT-PSK";
+	case IE_RSN_AKM_SUITE_8021X_SHA256:
+		return "802.1x-SHA256";
+	case IE_RSN_AKM_SUITE_PSK_SHA256:
+		return "PSK-SHA256";
+	case IE_RSN_AKM_SUITE_TDLS:
+		return "TDLS";
+	case IE_RSN_AKM_SUITE_SAE_SHA256:
+		return "SAE";
+	case IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256:
+		return "FT-SAE";
+	case IE_RSN_AKM_SUITE_AP_PEER_KEY_SHA256:
+		return "AP-PEER-KEY";
+	case IE_RSN_AKM_SUITE_8021X_SUITE_B_SHA256:
+		return "802.1x-Suite-B";
+	case IE_RSN_AKM_SUITE_8021X_SUITE_B_SHA384:
+		return "802.1x-Suite-B-SHA384";
+	case IE_RSN_AKM_SUITE_FT_OVER_8021X_SHA384:
+		return "FT-802.1x-SHA384";
+	case IE_RSN_AKM_SUITE_OWE:
+		return "OWE";
+	case IE_RSN_AKM_SUITE_FILS_SHA256:
+		return "FILS-SHA256";
+	case IE_RSN_AKM_SUITE_FILS_SHA384:
+		return "FILS-SHA256";
+	case IE_RSN_AKM_SUITE_FT_OVER_FILS_SHA256:
+		return "FT-FILS-SHA256";
+	case IE_RSN_AKM_SUITE_FT_OVER_FILS_SHA384:
+		return "FT-FILS-SHA384";
+	case IE_RSN_AKM_SUITE_OSEN:
+		return "OSEN";
+	}
+
+	return NULL;
+}
diff --git a/src/ie.h b/src/ie.h
index 995f0e4f..bed88de9 100644
--- a/src/ie.h
+++ b/src/ie.h
@@ -528,3 +528,5 @@ int ie_parse_hs20_indication_from_data(const uint8_t *data, size_t len,
 					uint8_t *version, uint16_t *pps_mo_id,
 					uint8_t *domain_id);
 int ie_build_hs20_indication(uint8_t version, uint8_t *to);
+
+const char *ie_akm_suite_to_string(enum ie_rsn_akm_suite suite);
-- 
2.26.2

  reply	other threads:[~2021-03-24 22:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 22:25 [PATCH 1/4] doc: document AKMSuite diagnostic value James Prestwood
2021-03-24 22:25 ` James Prestwood [this message]
2021-03-24 22:25 ` [PATCH 3/4] station: add AKMSuite to GetDiagnostics James Prestwood
2021-03-24 22:25 ` [PATCH 4/4] client: add AKMSuite to diagnostics James Prestwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210324222559.577225-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox