3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

ie: add ie_rsn_cipher_suite_to_string

This commit is contained in:
Denis Kenzior 2022-10-20 14:13:08 -05:00
parent 150856c315
commit 8040826079
2 changed files with 25 additions and 0 deletions

View File

@ -437,6 +437,30 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite)
} }
} }
const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite)
{
switch (suite) {
case IE_RSN_CIPHER_SUITE_CCMP:
return "CCMP-128";
case IE_RSN_CIPHER_SUITE_TKIP:
return "TKIP";
case IE_RSN_CIPHER_SUITE_WEP40:
return "WEP-40";
case IE_RSN_CIPHER_SUITE_WEP104:
return "WEP-104";
case IE_RSN_CIPHER_SUITE_BIP_CMAC:
return "BIP-CMAC-128";
case IE_RSN_CIPHER_SUITE_GCMP:
return "GCMP-128";
case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC:
return "NO-TRAFFIC";
case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER:
break;
}
return NULL;
}
/* 802.11, Section 8.4.2.27.2 */ /* 802.11, Section 8.4.2.27.2 */
static bool ie_parse_cipher_suite(const uint8_t *data, static bool ie_parse_cipher_suite(const uint8_t *data,
enum ie_rsn_cipher_suite *out) enum ie_rsn_cipher_suite *out)

View File

@ -587,6 +587,7 @@ unsigned char *ie_tlv_builder_finalize(struct ie_tlv_builder *builder,
size_t *out_len); size_t *out_len);
uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite); uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite);
const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite);
int ie_parse_rsne(struct ie_tlv_iter *iter, struct ie_rsn_info *info); int ie_parse_rsne(struct ie_tlv_iter *iter, struct ie_rsn_info *info);
int ie_parse_rsne_from_data(const uint8_t *data, size_t len, int ie_parse_rsne_from_data(const uint8_t *data, size_t len,