mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 14:22:36 +01:00
ie: Add RSNE parser that works on raw data
This commit is contained in:
parent
2d8f1cca0b
commit
2be20e6644
16
src/ie.c
16
src/ie.c
@ -422,3 +422,19 @@ done:
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ie_parse_rsne_from_data(const uint8_t *data, size_t len,
|
||||||
|
struct ie_rsn_info *info)
|
||||||
|
{
|
||||||
|
struct ie_tlv_iter iter;
|
||||||
|
|
||||||
|
ie_tlv_iter_init(&iter, data, len);
|
||||||
|
|
||||||
|
if (!ie_tlv_iter_next(&iter))
|
||||||
|
return -EMSGSIZE;
|
||||||
|
|
||||||
|
if (ie_tlv_iter_get_tag(&iter) != IE_TYPE_RSN)
|
||||||
|
return -EPROTOTYPE;
|
||||||
|
|
||||||
|
return ie_parse_rsne(&iter, info);
|
||||||
|
}
|
||||||
|
2
src/ie.h
2
src/ie.h
@ -239,3 +239,5 @@ void ie_tlv_builder_finalize(struct ie_tlv_builder *builder,
|
|||||||
unsigned int *out_len);
|
unsigned int *out_len);
|
||||||
|
|
||||||
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,
|
||||||
|
struct ie_rsn_info *info);
|
||||||
|
Loading…
Reference in New Issue
Block a user