Home | History | Annotate | Download | only in common

Lines Matching refs:buf

20 	struct wpabuf *buf;
22 buf = wpabuf_alloc(100 + size);
23 if (buf == NULL)
26 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC);
27 wpabuf_put_u8(buf, action);
28 wpabuf_put_u8(buf, dialog_token);
30 return buf;
51 struct wpabuf *buf;
53 buf = wpabuf_alloc(100 + size);
54 if (buf == NULL)
57 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC);
58 wpabuf_put_u8(buf, action);
59 wpabuf_put_u8(buf, dialog_token);
60 wpabuf_put_le16(buf, status_code);
62 wpabuf_put_u8(buf, frag_id | (more ? 0x80 : 0));
63 wpabuf_put_le16(buf, comeback_delay);
65 return buf;
90 * @buf: Buffer to which the element is added
99 static void gas_add_adv_proto_anqp(struct wpabuf *buf, u8 query_resp_len_limit,
103 wpabuf_put_u8(buf, WLAN_EID_ADV_PROTO);
104 wpabuf_put_u8(buf, 2); /* Length */
105 wpabuf_put_u8(buf, (query_resp_len_limit & 0x7f) |
108 wpabuf_put_u8(buf, ACCESS_NETWORK_QUERY_PROTOCOL);
114 struct wpabuf *buf;
116 buf = gas_build_initial_req(dialog_token, 4 + size);
117 if (buf == NULL)
120 gas_add_adv_proto_anqp(buf, 0, 0);
122 wpabuf_put(buf, 2); /* Query Request Length to be filled */
124 return buf;
131 struct wpabuf *buf;
133 buf = gas_build_initial_resp(dialog_token, status_code, comeback_delay,
135 if (buf == NULL)
138 gas_add_adv_proto_anqp(buf, 0x7f, 0);
140 wpabuf_put(buf, 2); /* Query Response Length to be filled */
142 return buf;
151 struct wpabuf *buf;
153 buf = gas_anqp_build_initial_resp(dialog_token, status_code,
156 if (buf == NULL)
160 wpabuf_put_buf(buf, payload);
162 gas_anqp_set_len(buf);
164 return buf;
172 struct wpabuf *buf;
174 buf = gas_build_comeback_resp(dialog_token, status_code,
176 if (buf == NULL)
179 gas_add_adv_proto_anqp(buf, 0x7f, 0);
181 wpabuf_put(buf, 2); /* Query Response Length to be filled */
183 return buf;
193 struct wpabuf *buf;
195 buf = gas_anqp_build_comeback_resp(dialog_token, status_code, frag_id,
198 if (buf == NULL)
202 wpabuf_put_buf(buf, payload);
204 gas_anqp_set_len(buf);
206 return buf;
212 * @buf: GAS message
217 void gas_anqp_set_len(struct wpabuf *buf)
223 if (buf == NULL || wpabuf_len(buf) < 2)
226 action = *(wpabuf_head_u8(buf) + 1);
241 if (wpabuf_len(buf) < offset + 2)
244 len = wpabuf_mhead_u8(buf) + offset;
245 WPA_PUT_LE16(len, (u8 *) wpabuf_put(buf, 0) - len - 2);
251 * @buf: GAS message
255 u8 * gas_anqp_add_element(struct wpabuf *buf, u16 info_id)
257 wpabuf_put_le16(buf, info_id);
258 return wpabuf_put(buf, 2); /* Length to be filled */
264 * @buf: GAS message
270 void gas_anqp_set_element_len(struct wpabuf *buf, u8 *len_pos)
272 WPA_PUT_LE16(len_pos, (u8 *) wpabuf_put(buf, 0) - len_pos - 2);