Lines Matching refs:pos
21 const u8 *pos, *end;
28 pos = wpabuf_head(wfd);
29 end = pos + wpabuf_len(wfd);
31 while (pos + 3 <= end) {
32 subelem = *pos++;
33 len = WPA_GET_BE16(pos);
34 pos += 2;
35 if (pos + len > end)
39 u16 info = WPA_GET_BE16(pos);
43 pos += len;
274 const u8 *pos = data;
297 dialog_token = *pos++;
302 if (*pos != WLAN_EID_ADV_PROTO) {
303 p2p_dbg(p2p, "Unexpected IE in GAS Initial Request: %u", *pos);
306 pos++;
308 slen = *pos++;
309 next = pos + slen;
314 pos++; /* skip QueryRespLenLimit and PAME-BI */
316 if (*pos != ACCESS_NETWORK_QUERY_PROTOCOL) {
318 *pos);
322 pos = next;
324 if (pos + 2 > end)
326 slen = WPA_GET_LE16(pos);
327 pos += 2;
328 if (pos + slen > end)
330 end = pos + slen;
333 if (pos + 4 > end)
335 if (WPA_GET_LE16(pos) != ANQP_VENDOR_SPECIFIC) {
336 p2p_dbg(p2p, "Unsupported ANQP Info ID %u", WPA_GET_LE16(pos));
339 pos += 2;
341 slen = WPA_GET_LE16(pos);
342 pos += 2;
343 if (pos + slen > end || slen < 3 + 1) {
348 if (WPA_GET_BE24(pos) != OUI_WFA) {
349 p2p_dbg(p2p, "Unsupported ANQP OUI %06x", WPA_GET_BE24(pos));
352 pos += 3;
354 if (*pos != P2P_OUI_TYPE) {
355 p2p_dbg(p2p, "Unsupported ANQP vendor type %u", *pos);
358 pos++;
360 if (pos + 2 > end)
362 update_indic = WPA_GET_LE16(pos);
364 pos += 2;
367 update_indic, pos, end - pos);
424 const u8 *pos = data;
458 dialog_token = *pos++;
460 status_code = WPA_GET_LE16(pos);
461 pos += 2;
462 comeback_delay = WPA_GET_LE16(pos);
463 pos += 2;
472 if (*pos != WLAN_EID_ADV_PROTO) {
473 p2p_dbg(p2p, "Unexpected IE in GAS Initial Response: %u", *pos);
476 pos++;
478 slen = *pos++;
479 next = pos + slen;
484 pos++; /* skip QueryRespLenLimit and PAME-BI */
486 if (*pos != ACCESS_NETWORK_QUERY_PROTOCOL) {
488 *pos);
492 pos = next;
494 if (pos + 2 > end) {
498 slen = WPA_GET_LE16(pos);
499 pos += 2;
501 if (pos + slen > end) {
505 end = pos + slen;
519 if (pos + 4 > end)
521 if (WPA_GET_LE16(pos) != ANQP_VENDOR_SPECIFIC) {
522 p2p_dbg(p2p, "Unsupported ANQP Info ID %u", WPA_GET_LE16(pos));
525 pos += 2;
527 slen = WPA_GET_LE16(pos);
528 pos += 2;
529 if (pos + slen > end || slen < 3 + 1) {
534 if (WPA_GET_BE24(pos) != OUI_WFA) {
535 p2p_dbg(p2p, "Unsupported ANQP OUI %06x", WPA_GET_BE24(pos));
538 pos += 3;
540 if (*pos != P2P_OUI_TYPE) {
541 p2p_dbg(p2p, "Unsupported ANQP vendor type %u", *pos);
544 pos++;
546 if (pos + 2 > end)
548 update_indic = WPA_GET_LE16(pos);
550 pos += 2;
570 pos, end - pos);
644 const u8 *pos = data;
681 dialog_token = *pos++;
683 status_code = WPA_GET_LE16(pos);
684 pos += 2;
685 frag_id = *pos & 0x7f;
686 more_frags = (*pos & 0x80) >> 7;
687 pos++;
688 comeback_delay = WPA_GET_LE16(pos);
689 pos += 2;
701 if (*pos != WLAN_EID_ADV_PROTO) {
703 *pos);
706 pos++;
708 slen = *pos++;
709 next = pos + slen;
714 pos++; /* skip QueryRespLenLimit and PAME-BI */
716 if (*pos != ACCESS_NETWORK_QUERY_PROTOCOL) {
718 *pos);
722 pos = next;
724 if (pos + 2 > end) {
728 slen = WPA_GET_LE16(pos);
729 pos += 2;
731 if (pos + slen > end) {
739 end = pos + slen;
750 if (pos + 4 > end)
752 if (WPA_GET_LE16(pos) != ANQP_VENDOR_SPECIFIC) {
753 p2p_dbg(p2p, "Unsupported ANQP Info ID %u", WPA_GET_LE16(pos));
756 pos += 2;
758 slen = WPA_GET_LE16(pos);
759 pos += 2;
765 if (pos + 4 > end)
768 if (WPA_GET_BE24(pos) != OUI_WFA) {
769 p2p_dbg(p2p, "Unsupported ANQP OUI %06x", WPA_GET_BE24(pos));
772 pos += 3;
774 if (*pos != P2P_OUI_TYPE) {
775 p2p_dbg(p2p, "Unsupported ANQP vendor type %u", *pos);
778 pos++;
780 if (pos + 2 > end)
782 p2p->sd_rx_update_indic = WPA_GET_LE16(pos);
784 pos += 2;
787 if (wpabuf_resize(&p2p->sd_rx_resp, end - pos) < 0)
789 wpabuf_put_data(p2p->sd_rx_resp, pos, end - pos);