Lines Matching refs:len

18 static int p2p_parse_attribute(u8 id, const u8 *data, u16 len,
27 if (len < 2) {
29 "attribute (length %d)", len);
38 if (len < ETH_ALEN) {
40 "attribute (length %d)", len);
48 if (len < 1) {
50 "attribute (length %d)", len);
58 if (len < 1) {
60 "attribute (length %d)", len);
67 if (len == 0) {
72 if (len < 5) {
74 "attribute (length %d)", len);
84 if (len == 0) {
89 if (len < 5) {
91 "Channel attribute (length %d)", len);
101 if (len < 3) {
103 "attribute (length %d)", len);
107 msg->channel_list_len = len;
115 msg->group_info_len = len;
119 if (len < ETH_ALEN + 2 + 8 + 1) {
121 "attribute (length %d)", len);
125 msg->p2p_device_info_len = len;
134 if (msg->num_sec_dev_types * 8 > data + len - pos) {
139 if (data + len - pos < 4) {
141 "length %d", (int) (data + len - pos));
152 if (data + len - pos < (int) nlen ||
155 "length %d (buf len %d)", (int) nlen,
156 (int) (data + len - pos));
176 if (len < 2) {
178 "Timeout attribute (length %d)", len);
185 if (len < ETH_ALEN) {
188 len);
196 if (len < ETH_ALEN) {
198 "attribute (length %d)", len);
206 if (len < ETH_ALEN || len > ETH_ALEN + SSID_MAX_LEN) {
208 "attribute length %d", len);
212 msg->group_id_len = len;
220 if (len < 1) {
222 "Flag attribute (length %d)", len);
230 if (len < 1) {
232 "attribute (length %d)", len);
240 if (len < 2) {
242 "Absence attribute (length %d)", len);
246 msg->noa_len = len;
250 if (len < 4) {
252 "Timing attribute (length %d)", len);
262 if (len < 1) {
264 "Code attribute (length %d)", len);
272 if (len < 6) {
274 "Channel attribute (length %d)", len);
285 if (len < P2PS_HASH_LEN) {
288 len);
291 msg->service_hash_count = len / P2PS_HASH_LEN;
293 wpa_hexdump(MSG_DEBUG, "P2P: * Service Hash(s)", data, len);
297 msg->session_info_len = len;
299 len, data);
302 if (len < 1) {
305 len);
313 if (len < 10) {
316 len);
325 if (len < 8) {
328 len);
332 msg->adv_service_instance_len = len;
333 if (len <= 255 + 8) {
338 if (namelen > len - 7)
350 if (len < sizeof(u32) + ETH_ALEN) {
353 len);
362 if (!len) {
365 len);
369 msg->feature_cap_len = len;
370 wpa_printf(MSG_DEBUG, "P2P: * Feature Cap (length=%u)", len);
374 if (len < ETH_ALEN || len > ETH_ALEN + SSID_MAX_LEN) {
377 len);
382 msg->persistent_ssid_len = len - ETH_ALEN;
392 "(length %d)", id, len);
431 "(len=%u left=%d)",
504 * @len: Length of data buffer in octets
514 int p2p_parse_ies(const u8 *data, size_t len, struct p2p_message *msg)
518 ieee802_11_parse_elems(data, len, &elems, 0);
524 msg->wps_attributes = ieee802_11_vendor_ie_concat(data, len,
532 msg->p2p_attributes = ieee802_11_vendor_ie_concat(data, len,
547 data, len, WFD_IE_VENDOR_TYPE);
561 * @len: Length of data buffer in octets
568 int p2p_parse(const u8 *data, size_t len, struct p2p_message *msg)
572 if (len < 1) {
579 return p2p_parse_ies(data + 1, len - 1, msg);