aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Zaborowski <andrew.zaborowski@intel.com>2020-03-19 22:12:16 +0100
committerDenis Kenzior <denkenz@gmail.com>2020-03-20 10:21:04 -0500
commit264ab685babcf387add1b9d9492d3b5bfc563c21 (patch)
tree1ba6219618ec32c28143224a4cbb781f2a9eebd5
parent430ccf87141ca9cbe4c9d8951b209d5e843c90e7 (diff)
downloadiwd-264ab685babcf387add1b9d9492d3b5bfc563c21.tar.gz
ie: Add ie_tlv_extract_wfd_payload
-rw-r--r--src/ie.c17
-rw-r--r--src/ie.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/ie.c b/src/ie.c
index f120c89eb..8d212ea01 100644
--- a/src/ie.c
+++ b/src/ie.c
@@ -201,6 +201,23 @@ void *ie_tlv_extract_p2p_payload(const unsigned char *ies, size_t len,
}
/*
+ * Wi-Fi Display Technical Specification v2.1.0, Section 5.1.1:
+ * "More than one WFD IE may be included in a single frame. If multiple WFD
+ * IEs are present, the complete WFD subelement data consists of the
+ * concatenation of the WFD subelement fields of the WFD IEs. The WFD
+ * subelements field of each WFD IE may be any length up to the maximum
+ * (251 octets). The order of the concatenated WFD subelement data shall be
+ * preserved in the ordering of the WFD IEs in the frame. All of the WFD IEs
+ * shall fit within a single frame and shall be adjacent in the frame."
+ */
+void *ie_tlv_extract_wfd_payload(const unsigned char *ies, size_t len,
+ ssize_t *out_len)
+{
+ return ie_tlv_vendor_ie_concat(wifi_alliance_oui, 0x0a,
+ ies, len, true, out_len);
+}
+
+/*
* Encapsulate & Fragment data into Vendor IE with a given OUI + type
*
* Returns a newly allocated buffer with the contents of encapsulated into
diff --git a/src/ie.h b/src/ie.h
index 12a664b50..47dc9eff3 100644
--- a/src/ie.h
+++ b/src/ie.h
@@ -431,6 +431,9 @@ void *ie_tlv_extract_p2p_payload(const uint8_t *ies, size_t len,
void *ie_tlv_encapsulate_p2p_payload(const uint8_t *data, size_t len,
size_t *out_len);
+void *ie_tlv_extract_wfd_payload(const unsigned char *ies, size_t len,
+ ssize_t *out_len);
+
bool ie_tlv_builder_init(struct ie_tlv_builder *builder, unsigned char *buf,
size_t len);
bool ie_tlv_builder_set_length(struct ie_tlv_builder *builder,