diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2011-04-28 16:14:35 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-09-29 22:18:23 +0300 |
commit | 206e1f422f42e5dec7cfaa27fd7c098703143c0b (patch) | |
tree | 01be0a25987ffda2f5ac84be7b9d35e78ddc50f7 /src/p2p | |
parent | fc6997b345d97c80965725b12c52b0d225f32a1a (diff) | |
download | external_wpa_supplicant_8_ti-206e1f422f42e5dec7cfaa27fd7c098703143c0b.zip external_wpa_supplicant_8_ti-206e1f422f42e5dec7cfaa27fd7c098703143c0b.tar.gz external_wpa_supplicant_8_ti-206e1f422f42e5dec7cfaa27fd7c098703143c0b.tar.bz2 |
P2P: Provide mechanism for figuring out p2p_scan_ie() buffer need
The new function, p2p_scan_ie_buf_len(), can be used to figure out
how large a buffer needs to be allocated for p2p_scan_ie() use. This
makes it easier to add new data into the buffer without forcing all
callers to be updated to use a larger buffer.
Diffstat (limited to 'src/p2p')
-rw-r--r-- | src/p2p/p2p.c | 6 | ||||
-rw-r--r-- | src/p2p/p2p.h | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 816196a..3cb8f4d 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -2462,6 +2462,12 @@ void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies) } +size_t p2p_scan_ie_buf_len(struct p2p_data *p2p) +{ + return 100; +} + + int p2p_ie_text(struct wpabuf *p2p_ie, char *buf, char *end) { return p2p_attr_text(p2p_ie, buf, end); diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 4cab3da..31e83d5 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -1344,6 +1344,13 @@ int p2p_assoc_req_ie(struct p2p_data *p2p, const u8 *bssid, u8 *buf, void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies); /** + * p2p_scan_ie_buf_len - Get maximum buffer length needed for p2p_scan_ie + * @p2p: P2P module context from p2p_init() + * Returns: Number of octets that p2p_scan_ie() may add to the buffer + */ +size_t p2p_scan_ie_buf_len(struct p2p_data *p2p); + +/** * p2p_go_params - Generate random P2P group parameters * @p2p: P2P module context from p2p_init() * @params: Buffer for parameters |