Lines Matching refs:pos

23 	const u16 *pos;
25 for (pos = buf; len >= 2; len -= 2)
26 sum += ntohs(*pos++);
28 sum += ntohs(*pos << 8);
39 u8 *pos, *end;
53 pos = wpabuf_mhead(sta->hlp_dhcp_discover);
54 end = pos + wpabuf_len(sta->hlp_dhcp_discover);
55 dhcp = (struct dhcp_data *) pos;
56 pos = (u8 *) (dhcp + 1);
57 pos += 4; /* skip magic */
58 while (pos < end && *pos != DHCP_OPT_END) {
61 opt = *pos++;
64 if (pos >= end)
66 olen = *pos++;
67 if (olen > end - pos)
73 *pos = DHCPREQUEST;
79 pos -= 2;
80 os_memmove(pos, pos + 2 + olen, end - pos - 2 - olen);
85 pos += olen;
87 if (pos >= end || *pos != DHCP_OPT_END) {
91 sta->hlp_dhcp_discover->used = pos - (u8 *) dhcp;
94 pos = (u8 *) (dhcpoffer + 1);
96 pos += 4; /* skip magic */
97 while (pos < end && *pos != DHCP_OPT_END) {
100 opt = *pos++;
103 if (pos >= end)
105 olen = *pos++;
106 if (olen > end - pos)
111 server_id = pos - 2;
114 pos += olen;
154 u8 buf[1500], *pos, *end, *end_opt = NULL;
190 pos = (u8 *) (dhcp + 1);
193 if (end - pos < 4 || WPA_GET_BE32(pos) != DHCP_MAGIC) {
197 pos += 4;
200 pos, end - pos);
201 while (pos < end && *pos != DHCP_OPT_END) {
204 opt = *pos++;
207 if (pos >= end)
209 olen = *pos++;
210 if (olen > end - pos)
216 msgtype = pos[0];
222 pos += olen;
224 if (pos < end && *pos == DHCP_OPT_END)
225 end_opt = pos;
252 pos = buf;
254 sizeof(*iph) + sizeof(*udph) + (end - pos) + 2);
264 iph->tot_len = htons(sizeof(*iph) + sizeof(*udph) + (end - pos));
272 udph->len = htons(sizeof(*udph) + (end - pos));
277 wpabuf_put_data(resp, pos, end_opt - pos);
282 wpabuf_put_data(resp, pos, end - pos);
329 const u8 *pos = msg, *end;
335 dhcp = (const struct dhcp_data *) pos;
336 end = pos + len;
341 pos += sizeof(*dhcp);
345 if (end - pos < 4)
347 if (WPA_GET_BE32(pos) != DHCP_MAGIC) {
351 pos += 4;
353 wpa_hexdump(MSG_DEBUG, "FILS: HLP - DHCP options", pos, end - pos);
354 while (pos < end && *pos != DHCP_OPT_END) {
357 opt = *pos++;
360 if (pos >= end)
362 olen = *pos++;
363 if (olen > end - pos)
369 msgtype = pos[0];
375 pos += olen;
475 const u8 *pos, size_t len)
483 iph = (const struct iphdr *) pos;
506 const u8 *pos, size_t len)
513 iph = (const struct iphdr *) pos;
527 return fils_process_hlp_udp(hapd, sta, dst, pos, len);
536 const u8 *pos, size_t len)
542 MAC2STR(sta->addr), MAC2STR(pos), MAC2STR(pos + ETH_ALEN),
544 if (os_memcmp(sta->addr, pos + ETH_ALEN, ETH_ALEN) != 0) {
547 MACSTR, MAC2STR(pos + ETH_ALEN));
551 end = pos + len;
552 pkt = pos + 2 * ETH_ALEN;
563 return fils_process_hlp_ip(hapd, sta, pos, pkt + 2,
572 const u8 *pos, int left)
574 const u8 *end = pos + left;
584 while (end - pos >= 2) {
585 if (2 + pos[1] > end - pos)
587 if (pos[0] == WLAN_EID_EXTENSION &&
588 pos[1] >= 1 + 2 * ETH_ALEN &&
589 pos[2] == WLAN_EID_EXT_FILS_HLP_CONTAINER)
591 pos += 2 + pos[1];
593 if (end - pos < 2)
596 tmp = os_malloc(end - pos);
600 while (end - pos >= 2) {
601 if (2 + pos[1] > end - pos ||
602 pos[0] != WLAN_EID_EXTENSION ||
603 pos[1] < 1 + 2 * ETH_ALEN ||
604 pos[2] != WLAN_EID_EXT_FILS_HLP_CONTAINER)
607 os_memcpy(tmp_pos, pos + 3, pos[1] - 1);
608 tmp_pos += pos[1] - 1;
609 pos += 2 + pos[1];
612 while (end - pos >= 2 && pos[0] == WLAN_EID_FRAGMENT &&
613 2 + pos[1] <= end - pos) {
614 os_memcpy(tmp_pos, pos + 2, pos[1]);
615 tmp_pos += pos[1];
616 pos += 2 + pos[1];