Lines Matching refs:buf
141 struct wpabuf *buf)
145 len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
146 wpabuf_put_be24(buf, OUI_WFA);
147 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
148 wpabuf_put_u8(buf, HS20_STYPE_CAPABILITY_LIST);
149 wpabuf_put_u8(buf, 0); /* Reserved */
150 wpabuf_put_u8(buf, HS20_STYPE_CAPABILITY_LIST);
152 wpabuf_put_u8(buf, HS20_STYPE_OPERATOR_FRIENDLY_NAME);
154 wpabuf_put_u8(buf, HS20_STYPE_WAN_METRICS);
156 wpabuf_put_u8(buf, HS20_STYPE_CONNECTION_CAPABILITY);
158 wpabuf_put_u8(buf, HS20_STYPE_NAI_HOME_REALM_QUERY);
160 wpabuf_put_u8(buf, HS20_STYPE_OPERATING_CLASS);
162 wpabuf_put_u8(buf, HS20_STYPE_OSU_PROVIDERS_LIST);
164 wpabuf_put_u8(buf, HS20_STYPE_ICON_REQUEST);
165 gas_anqp_set_element_len(buf, len);
171 struct wpabuf *buf)
175 len = gas_anqp_add_element(buf, ANQP_CAPABILITY_LIST);
176 wpabuf_put_le16(buf, ANQP_CAPABILITY_LIST);
178 wpabuf_put_le16(buf, ANQP_VENUE_NAME);
180 wpabuf_put_le16(buf, ANQP_NETWORK_AUTH_TYPE);
182 wpabuf_put_le16(buf, ANQP_ROAMING_CONSORTIUM);
184 wpabuf_put_le16(buf, ANQP_IP_ADDR_TYPE_AVAILABILITY);
186 wpabuf_put_le16(buf, ANQP_NAI_REALM);
188 wpabuf_put_le16(buf, ANQP_3GPP_CELLULAR_NETWORK);
190 wpabuf_put_le16(buf, ANQP_DOMAIN_NAME);
192 anqp_add_hs_capab_list(hapd, buf);
194 gas_anqp_set_element_len(buf, len);
198 static void anqp_add_venue_name(struct hostapd_data *hapd, struct wpabuf *buf)
203 len = gas_anqp_add_element(buf, ANQP_VENUE_NAME);
204 wpabuf_put_u8(buf, hapd->conf->venue_group);
205 wpabuf_put_u8(buf, hapd->conf->venue_type);
209 wpabuf_put_u8(buf, 3 + vn->name_len);
210 wpabuf_put_data(buf, vn->lang, 3);
211 wpabuf_put_data(buf, vn->name, vn->name_len);
213 gas_anqp_set_element_len(buf, len);
219 struct wpabuf *buf)
222 wpabuf_put_le16(buf, ANQP_NETWORK_AUTH_TYPE);
223 wpabuf_put_le16(buf, hapd->conf->network_auth_type_len);
224 wpabuf_put_data(buf, hapd->conf->network_auth_type,
231 struct wpabuf *buf)
236 len = gas_anqp_add_element(buf, ANQP_ROAMING_CONSORTIUM);
240 wpabuf_put_u8(buf, rc->len);
241 wpabuf_put_data(buf, rc->oi, rc->len);
243 gas_anqp_set_element_len(buf, len);
248 struct wpabuf *buf)
251 wpabuf_put_le16(buf, ANQP_IP_ADDR_TYPE_AVAILABILITY);
252 wpabuf_put_le16(buf, 1);
253 wpabuf_put_u8(buf, hapd->conf->ipaddr_type_availability);
258 static void anqp_add_nai_realm_eap(struct wpabuf *buf,
263 wpabuf_put_u8(buf, realm->eap_method_count);
267 wpabuf_put_u8(buf, 2 + (3 * eap->num_auths));
268 wpabuf_put_u8(buf, eap->eap_method);
269 wpabuf_put_u8(buf, eap->num_auths);
271 wpabuf_put_u8(buf, eap->auth_id[j]);
272 wpabuf_put_u8(buf, 1);
273 wpabuf_put_u8(buf, eap->auth_val[j]);
279 static void anqp_add_nai_realm_data(struct wpabuf *buf,
287 realm_data_len = wpabuf_put(buf, 2);
288 wpabuf_put_u8(buf, realm->encoding);
289 wpabuf_put_u8(buf, os_strlen(realm->realm[realm_idx]));
290 wpabuf_put_str(buf, realm->realm[realm_idx]);
291 anqp_add_nai_realm_eap(buf, realm);
292 gas_anqp_set_element_len(buf, realm_data_len);
297 struct wpabuf *buf,
370 realm_list_len = gas_anqp_add_element(buf, ANQP_NAI_REALM);
371 wpabuf_put_le16(buf, num_matching);
383 anqp_add_nai_realm_data(buf, realm, matches[i].realm_idx);
385 gas_anqp_set_element_len(buf, realm_list_len);
390 static void anqp_add_nai_realm(struct hostapd_data *hapd, struct wpabuf *buf,
397 len = gas_anqp_add_element(buf, ANQP_NAI_REALM);
398 wpabuf_put_le16(buf, hapd->conf->nai_realm_count);
404 realm_data_len = wpabuf_put(buf, 2);
405 wpabuf_put_u8(buf, realm->encoding);
406 realm_len = wpabuf_put(buf, 1);
409 wpabuf_put_u8(buf, ';');
410 wpabuf_put_str(buf, realm->realm[j]);
412 *realm_len = (u8 *) wpabuf_put(buf, 0) - realm_len - 1;
413 anqp_add_nai_realm_eap(buf, realm);
414 gas_anqp_set_element_len(buf, realm_data_len);
416 gas_anqp_set_element_len(buf, len);
418 hs20_add_nai_home_realm_matches(hapd, buf, home_realm,
425 struct wpabuf *buf)
428 wpabuf_put_le16(buf, ANQP_3GPP_CELLULAR_NETWORK);
429 wpabuf_put_le16(buf,
431 wpabuf_put_data(buf, hapd->conf->anqp_3gpp_cell_net,
437 static void anqp_add_domain_name(struct hostapd_data *hapd, struct wpabuf *buf)
440 wpabuf_put_le16(buf, ANQP_DOMAIN_NAME);
441 wpabuf_put_le16(buf, hapd->conf->domain_name_len);
442 wpabuf_put_data(buf, hapd->conf->domain_name,
451 struct wpabuf *buf)
456 len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
457 wpabuf_put_be24(buf, OUI_WFA);
458 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
459 wpabuf_put_u8(buf, HS20_STYPE_OPERATOR_FRIENDLY_NAME);
460 wpabuf_put_u8(buf, 0); /* Reserved */
465 wpabuf_put_u8(buf, 3 + vn->name_len);
466 wpabuf_put_data(buf, vn->lang, 3);
467 wpabuf_put_data(buf, vn->name, vn->name_len);
469 gas_anqp_set_element_len(buf, len);
475 struct wpabuf *buf)
478 u8 *len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
479 wpabuf_put_be24(buf, OUI_WFA);
480 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
481 wpabuf_put_u8(buf, HS20_STYPE_WAN_METRICS);
482 wpabuf_put_u8(buf, 0); /* Reserved */
483 wpabuf_put_data(buf, hapd->conf->hs20_wan_metrics, 13);
484 gas_anqp_set_element_len(buf, len);
490 struct wpabuf *buf)
493 u8 *len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
494 wpabuf_put_be24(buf, OUI_WFA);
495 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
496 wpabuf_put_u8(buf, HS20_STYPE_CONNECTION_CAPABILITY);
497 wpabuf_put_u8(buf, 0); /* Reserved */
498 wpabuf_put_data(buf, hapd->conf->hs20_connection_capability,
500 gas_anqp_set_element_len(buf, len);
506 struct wpabuf *buf)
509 u8 *len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
510 wpabuf_put_be24(buf, OUI_WFA);
511 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
512 wpabuf_put_u8(buf, HS20_STYPE_OPERATING_CLASS);
513 wpabuf_put_u8(buf, 0); /* Reserved */
514 wpabuf_put_data(buf, hapd->conf->hs20_operating_class,
516 gas_anqp_set_element_len(buf, len);
521 static void anqp_add_osu_provider(struct wpabuf *buf,
528 len = wpabuf_put(buf, 2); /* OSU Provider Length to be filled */
531 len2 = wpabuf_put(buf, 2);
534 wpabuf_put_u8(buf, 3 + s->name_len);
535 wpabuf_put_data(buf, s->lang, 3);
536 wpabuf_put_data(buf, s->name, s->name_len);
538 WPA_PUT_LE16(len2, (u8 *) wpabuf_put(buf, 0) - len2 - 2);
542 wpabuf_put_u8(buf, os_strlen(p->server_uri));
543 wpabuf_put_str(buf, p->server_uri);
545 wpabuf_put_u8(buf, 0);
548 count = wpabuf_put(buf, 1);
550 wpabuf_put_u8(buf, p->method_list[i]);
554 len2 = wpabuf_put(buf, 2);
567 wpabuf_put_le16(buf, icon->width);
568 wpabuf_put_le16(buf, icon->height);
569 wpabuf_put_data(buf, icon->language, 3);
570 wpabuf_put_u8(buf, os_strlen(icon->type));
571 wpabuf_put_str(buf, icon->type);
572 wpabuf_put_u8(buf, os_strlen(icon->name));
573 wpabuf_put_str(buf, icon->name);
575 WPA_PUT_LE16(len2, (u8 *) wpabuf_put(buf, 0) - len2 - 2);
579 wpabuf_put_u8(buf, os_strlen(p->osu_nai));
580 wpabuf_put_str(buf, p->osu_nai);
582 wpabuf_put_u8(buf, 0);
585 buf, 2);
588 wpabuf_put_u8(buf, 3 + s->name_len);
589 wpabuf_put_data(buf, s->lang, 3);
590 wpabuf_put_data(buf, s->name, s->name_len);
592 WPA_PUT_LE16(len2, (u8 *) wpabuf_put(buf, 0) - len2 - 2);
594 WPA_PUT_LE16(len, (u8 *) wpabuf_put(buf, 0) - len - 2);
599 struct wpabuf *buf)
603 u8 *len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
604 wpabuf_put_be24(buf, OUI_WFA);
605 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
606 wpabuf_put_u8(buf, HS20_STYPE_OSU_PROVIDERS_LIST);
607 wpabuf_put_u8(buf, 0); /* Reserved */
610 wpabuf_put_u8(buf, hapd->conf->osu_ssid_len);
611 wpabuf_put_data(buf, hapd->conf->osu_ssid,
615 wpabuf_put_u8(buf, hapd->conf->hs20_osu_providers_count);
619 buf, hapd->conf,
623 gas_anqp_set_element_len(buf, len);
629 struct wpabuf *buf,
650 len = gas_anqp_add_element(buf, ANQP_VENDOR_SPECIFIC);
651 wpabuf_put_be24(buf, OUI_WFA);
652 wpabuf_put_u8(buf, HS20_ANQP_OUI_TYPE);
653 wpabuf_put_u8(buf, HS20_STYPE_ICON_BINARY_FILE);
654 wpabuf_put_u8(buf, 0); /* Reserved */
662 wpabuf_put_u8(buf, 2); /* Download Status:
664 wpabuf_put_u8(buf, 0);
665 wpabuf_put_le16(buf, 0);
667 wpabuf_put_u8(buf, 0); /* Download Status: Success */
668 wpabuf_put_u8(buf, os_strlen(icon->type));
669 wpabuf_put_str(buf, icon->type);
670 wpabuf_put_le16(buf, data_len);
671 wpabuf_put_data(buf, data, data_len);
675 wpabuf_put_u8(buf, 1); /* Download Status: File not found */
676 wpabuf_put_u8(buf, 0);
677 wpabuf_put_le16(buf, 0);
680 gas_anqp_set_element_len(buf, len);
692 struct wpabuf *buf;
701 buf = wpabuf_alloc(len);
702 if (buf == NULL)
706 anqp_add_capab_list(hapd, buf);
708 anqp_add_venue_name(hapd, buf);
710 anqp_add_network_auth_type(hapd, buf);
712 anqp_add_roaming_consortium(hapd, buf);
714 anqp_add_ip_addr_type_availability(hapd, buf);
716 anqp_add_nai_realm(hapd, buf, home_realm, home_realm_len,
720 anqp_add_3gpp_cellular_network(hapd, buf);
722 anqp_add_domain_name(hapd, buf);
726 anqp_add_hs_capab_list(hapd, buf);
728 anqp_add_operator_friendly_name(hapd, buf);
730 anqp_add_wan_metrics(hapd, buf);
732 anqp_add_connection_capability(hapd, buf);
734 anqp_add_operating_class(hapd, buf);
736 anqp_add_osu_providers_list(hapd, buf);
738 anqp_add_icon_binary_file(hapd, buf, icon_name, icon_name_len);
741 return buf;
962 struct wpabuf *buf, *tx_buf;
964 buf = gas_serv_build_gas_resp_payload(hapd, qi->request,
969 buf);
970 if (!buf)
973 if (wpabuf_len(buf) > hapd->gas_frag_limit ||
990 wpabuf_free(buf);
996 di->sd_resp = buf;
1005 dialog_token, WLAN_STATUS_SUCCESS, 0, buf);
1006 wpabuf_free(buf);
1057 struct wpabuf *buf;
1063 buf = gas_build_initial_resp(
1066 if (buf == NULL)
1068 wpabuf_put_data(buf, adv_proto, 2 + slen);
1069 wpabuf_put_le16(buf, 0); /* Query Response Length */
1071 convert_to_protected_dual(buf);
1073 wpabuf_head(buf), wpabuf_len(buf));
1074 wpabuf_free(buf);
1132 struct wpabuf *buf, *tx_buf;
1167 buf = wpabuf_alloc_copy(wpabuf_head_u8(dialog->sd_resp) +
1169 if (buf == NULL) {
1178 more, 0, buf);
1179 wpabuf_free(buf);
1211 static void gas_serv_rx_public_action(void *ctx, const u8 *buf, size_t len,
1219 mgmt = (const struct ieee80211_mgmt *) buf;
1233 data = buf + IEEE80211_HDRLEN + 1;