Home
last modified time | relevance | path

Searched refs:LWS_PRE (Results 1 - 25 of 88) sorted by relevance

1234

/third_party/libwebsockets/lib/core-net/
H A Ddummy-callback.c63 char buf[LWS_PRE + 6], *out = buf + LWS_PRE; in stream_close()
71 if (lws_write(wsi, (unsigned char *)buf + LWS_PRE, 0, in stream_close()
84 if (lws_write(wsi, (unsigned char *)buf + LWS_PRE, 5, in stream_close()
167 pkt = lws_zalloc(sizeof(*pkt) + LWS_PRE + len, __func__); in lws_callback_ws_proxy()
176 memcpy(((uint8_t *)&pkt[1]) + LWS_PRE, in, len); in lws_callback_ws_proxy()
189 LWS_PRE, pkt->len, (enum lws_write_protocol)lws_write_ws_flags( in lws_callback_ws_proxy()
211 pkt = lws_zalloc(sizeof(*pkt) + LWS_PRE + len, __func__); in lws_callback_ws_proxy()
220 memcpy(((uint8_t *)&pkt[1]) + LWS_PRE, in, len); in lws_callback_ws_proxy()
233 LWS_PRE, pk in lws_callback_ws_proxy()
362 LWS_PRE, 5, LWS_WRITE_HTTP); lws_callback_http_dummy() local
365 LWS_PRE, 0, lws_callback_http_dummy() local
703 lws_write(wsi, (unsigned char *)buf + LWS_PRE, 0, lws_callback_http_dummy() local
[all...]
/third_party/libwebsockets/lib/roles/mqtt/
H A Dops-mqtt.c284 uint8_t buf[LWS_PRE + 2]; in rops_handle_POLLOUT_mqtt()
295 buf[LWS_PRE] = LMQCP_CTOS_PINGREQ << 4; in rops_handle_POLLOUT_mqtt()
296 buf[LWS_PRE + 1] = 0; in rops_handle_POLLOUT_mqtt()
298 if (lws_write(wsi, (uint8_t *)&buf[LWS_PRE], 2, in rops_handle_POLLOUT_mqtt()
308 uint8_t buf[LWS_PRE + 4]; in rops_handle_POLLOUT_mqtt()
310 buf[LWS_PRE + 1] = 2; in rops_handle_POLLOUT_mqtt()
314 buf[LWS_PRE] = LMQCP_PUBREC << 4 | 0x2; in rops_handle_POLLOUT_mqtt()
316 lws_ser_wu16be(&buf[LWS_PRE + 2], in rops_handle_POLLOUT_mqtt()
322 buf[LWS_PRE] = LMQCP_PUBREL << 4 | 0x2; in rops_handle_POLLOUT_mqtt()
323 lws_ser_wu16be(&buf[LWS_PRE in rops_handle_POLLOUT_mqtt()
[all...]
/third_party/libwebsockets/plugins/ssh-base/
H A Dtelnet.c128 uint8_t buf[LWS_PRE + 800], *pu = in; in lws_callback_raw_telnet()
197 memcpy(buf + LWS_PRE, init, sizeof(init)); in lws_callback_raw_telnet()
207 pu = buf + LWS_PRE + 400; in lws_callback_raw_telnet()
209 (size_t)((int)sizeof(buf) - LWS_PRE - n - 401) / 2); in lws_callback_raw_telnet()
217 buf[LWS_PRE + n++] = 0xff; in lws_callback_raw_telnet()
218 buf[LWS_PRE + n++] = *pu++; in lws_callback_raw_telnet()
222 m = lws_write(wsi, (unsigned char *)buf + LWS_PRE, (unsigned int)n, in lws_callback_raw_telnet()
/third_party/libwebsockets/plugins/
H A Dprotocol_lws_openmetrics_export.c253 q = lwsac_use(&pss->ac, LWS_PRE + len + 2, LWS_PRE + len + 2); in lws_metrics_om_ac_stash()
259 q[LWS_PRE] = (char)((len >> 8) & 0xff); in lws_metrics_om_ac_stash()
260 q[LWS_PRE + 1] = (char)(len & 0xff); in lws_metrics_om_ac_stash()
261 memcpy(q + LWS_PRE + 2, buf, len); in lws_metrics_om_ac_stash()
389 char buf[1224], *start = buf + LWS_PRE, *p = start, in ome_prepare()
414 if (lws_metrics_om_ac_stash(pss, (const char *)buf + LWS_PRE, in ome_prepare()
415 lws_ptr_diff_size_t(p, buf + LWS_PRE))) in ome_prepare()
425 if (lws_metrics_om_ac_stash(pss, (const char *)buf + LWS_PRE, in ome_prepare()
426 lws_ptr_diff_size_t(p, buf + LWS_PRE))) in ome_prepare()
[all...]
H A Dprotocol_post_demo.c43 char result[LWS_PRE + LWS_RECOMMENDED_MIN_HEADER_SPACE];
131 p = (unsigned char *)pss->result + LWS_PRE; in format_result()
133 end = p + sizeof(pss->result) - LWS_PRE - 1; in format_result()
216 p = (unsigned char *)pss->result + LWS_PRE; in callback_post_demo()
218 end = p + sizeof(pss->result) - LWS_PRE - 1; in callback_post_demo()
H A Dprotocol_dumb_increment.c52 uint8_t buf[LWS_PRE + 20], *p = &buf[LWS_PRE]; in callback_dumb_increment()
76 n = lws_snprintf((char *)p, sizeof(buf) - LWS_PRE, "%d", in callback_dumb_increment()
/third_party/libwebsockets/lib/roles/mqtt/client/
H A Dclient-mqtt-handshake.c36 uint8_t b[256 + LWS_PRE], *start = b + LWS_PRE, *p = start; in lws_mqtt_client_send_connect()
170 if (lws_write(wsi, (unsigned char *)&b[LWS_PRE], lws_ptr_diff_size_t(p, start), in lws_mqtt_client_send_connect()
183 uint8_t b[256 + LWS_PRE], *start = b + LWS_PRE, *p = start; in lws_mqtt_client_send_disconnect()
192 if (lws_write(wsi, (unsigned char *)&b[LWS_PRE], lws_ptr_diff_size_t(p, start), in lws_mqtt_client_send_disconnect()
/third_party/libwebsockets/lib/abstract/protocols/smtp/
H A Dsmtp.c239 char b[256 + LWS_PRE], *p = b + LWS_PRE; in lws_smtpc_abs_writeable()
252 n = lws_snprintf(p, sizeof(b) - LWS_PRE, "HELO %s\n", c->helo); in lws_smtpc_abs_writeable()
257 n = lws_snprintf(p, sizeof(b) - LWS_PRE, "MAIL FROM: <%s>\n", in lws_smtpc_abs_writeable()
263 n = lws_snprintf(p, sizeof(b) - LWS_PRE, in lws_smtpc_abs_writeable()
269 n = lws_snprintf(p, sizeof(b) - LWS_PRE, "DATA\n"); in lws_smtpc_abs_writeable()
280 n = lws_snprintf(p, sizeof(b) - LWS_PRE, "quit\n"); in lws_smtpc_abs_writeable()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/
H A Dprotocol_lws_minimal.c110 amsg.payload = malloc((unsigned int)(LWS_PRE + len)); in thread_spam()
115 n = lws_snprintf((char *)amsg.payload + LWS_PRE, (unsigned int)len, in thread_spam()
158 char temp[LWS_PRE + 256]; in callback_minimal()
247 n = lws_snprintf(temp + LWS_PRE, sizeof(temp) - LWS_PRE, in callback_minimal()
249 (char *)pmsg->payload + LWS_PRE); in callback_minimal()
251 /* notice we allowed for LWS_PRE in the payload already */ in callback_minimal()
252 m = lws_write(wsi, (unsigned char *)temp + LWS_PRE, (unsigned int)n, in callback_minimal()
/third_party/libwebsockets/lib/system/ntpclient/
H A Dntpclient.c114 uint8_t pkt[LWS_PRE + 48]; in callback_ntpc()
267 memset(pkt + LWS_PRE, 0, sizeof(pkt) - LWS_PRE); in callback_ntpc()
268 pkt[LWS_PRE] = (LWSNTPC_LI_NONE << 6) | in callback_ntpc()
272 if (lws_write(wsi, pkt + LWS_PRE, sizeof(pkt) - LWS_PRE, 0) == in callback_ntpc()
273 sizeof(pkt) - LWS_PRE) in callback_ntpc()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads-smp/
H A Dprotocol_lws_minimal.c106 amsg.payload = malloc((unsigned int)(LWS_PRE + len)); in thread_spam()
111 n = lws_snprintf((char *)amsg.payload + LWS_PRE, (unsigned int)len, in thread_spam()
155 char temp[LWS_PRE + 256]; in callback_minimal()
236 n = lws_snprintf(temp + LWS_PRE, sizeof(temp) - LWS_PRE, in callback_minimal()
238 (char *)pmsg->payload + LWS_PRE); in callback_minimal()
240 /* notice we allowed for LWS_PRE in the payload already */ in callback_minimal()
241 m = lws_write(wsi, (unsigned char *)temp + LWS_PRE, (unsigned int)n, in callback_minimal()
/third_party/libwebsockets/test-apps/
H A Dtest-client.c128 char which_wsi[50], buf[80 + LWS_PRE]; in callback_dumb_increment()
228 char buffer[1024 + LWS_PRE]; in callback_dumb_increment()
229 char *px = buffer + LWS_PRE; in callback_dumb_increment()
230 int lenx = sizeof(buffer) - LWS_PRE; in callback_dumb_increment()
274 strcpy(buf + LWS_PRE, "text=hello&send=Send+the+form"); in callback_dumb_increment()
275 n = lws_write(wsi, (unsigned char *)&buf[LWS_PRE], in callback_dumb_increment()
276 strlen(&buf[LWS_PRE]), LWS_WRITE_HTTP); in callback_dumb_increment()
343 unsigned char buf[LWS_PRE + block_size], *p; in callback_lws_mirror()
401 buf[LWS_PRE + n] = lws_poly_rand(&tx); in callback_lws_mirror()
403 n = lws_write(wsi, &buf[LWS_PRE], block_siz in callback_lws_mirror()
[all...]
/third_party/libwebsockets/minimal-examples/http-server/minimal-http-server-custom-headers/
H A Dminimal-http-server-custom-headers.c26 char result[128 + LWS_PRE];
39 uint8_t buf[LWS_PRE + 2048], *start = &buf[LWS_PRE], *p = start, in callback_http()
42 char value[32], *pr = &pss->result[LWS_PRE]; in callback_http()
43 size_t e = sizeof(pss->result) - LWS_PRE; in callback_http()
/third_party/libwebsockets/lib/core/
H A Dbuflist.c63 len + LWS_PRE + 1, __func__); in lws_buflist_append_segment()
73 /* whoever consumes this might need LWS_PRE from the start... */ in lws_buflist_append_segment()
74 p = (uint8_t *)nbuf + sizeof(*nbuf) + LWS_PRE; in lws_buflist_append_segment()
133 *buf = ((uint8_t *)b) + sizeof(*b) + b->pos + LWS_PRE; in lws_buflist_next_segment_len()
188 memcpy(buf, ((uint8_t *)&p[1]) + LWS_PRE + ofs, s); in lws_buflist_linear_copy()
211 LWS_PRE + (*head)->pos, s); in lws_buflist_linear_use()
240 memcpy(buf, ((uint8_t *)((*head) + 1)) + LWS_PRE + (*head)->pos, s); in lws_buflist_fragment_use()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-raw-proxy/
H A Dminimal-ws-raw-proxy.c36 * ((uint8_t)&p[1]) + LWS_PRE.
38 * Notice we additionally take care to overallocate LWS_PRE before the
178 data = (uint8_t *)&msg[1] + LWS_PRE; in callback_proxy_ws_server()
180 /* notice we allowed for LWS_PRE in the payload already */ in callback_proxy_ws_server()
202 /* notice we over-allocate by LWS_PRE + rx len */ in callback_proxy_ws_server()
203 msg = (proxy_msg_t *)malloc(sizeof(*msg) + LWS_PRE + len); in callback_proxy_ws_server()
204 data = (uint8_t *)&msg[1] + LWS_PRE; in callback_proxy_ws_server()
311 /* notice we over-allocate by LWS_PRE + rx len */ in callback_proxy_raw_client()
312 msg = (proxy_msg_t *)malloc(sizeof(*msg) + LWS_PRE + len); in callback_proxy_raw_client()
313 data = (uint8_t *)&msg[1] + LWS_PRE; in callback_proxy_raw_client()
[all...]
/third_party/libwebsockets/lib/secure-streams/protocols/
H A Dss-raw.c37 uint8_t buf[LWS_PRE + 1520], *p = &buf[LWS_PRE], in secstream_raw()
152 if (lws_write(wsi, buf + LWS_PRE, lws_ptr_diff_size_t(p, buf + LWS_PRE), in secstream_raw()
153 LWS_WRITE_HTTP) != lws_ptr_diff(p, buf + LWS_PRE)) { in secstream_raw()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threadpool/
H A Dprotocol_lws_minimal_threadpool.c128 lws_snprintf(priv->result + LWS_PRE, in task_function()
129 sizeof(priv->result) - LWS_PRE, in task_function()
293 n = (int)strlen(priv->result + LWS_PRE); in callback_minimal()
294 m = lws_write(wsi, (unsigned char *)priv->result + LWS_PRE, in callback_minimal()
/third_party/libwebsockets/minimal-examples/http-client/minimal-http-client-custom-headers/
H A Dminimal-http-client-custom-headers.c98 char buffer[1024 + LWS_PRE]; in callback_http()
99 char *px = buffer + LWS_PRE; in callback_http()
100 int lenx = sizeof(buffer) - LWS_PRE; in callback_http()
/third_party/libwebsockets/minimal-examples/http-server/minimal-http-server-h2-long-poll/
H A Dminimal-http-server.c58 uint8_t buf[LWS_PRE + LWS_RECOMMENDED_MIN_HEADER_SPACE], in callback_http()
59 *start = &buf[LWS_PRE], *p = start, in callback_http()
88 n = lws_snprintf((char *)p, sizeof(buf) - LWS_PRE, "%llu", in callback_http()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-pmd/
H A Dprotocol_lws_minimal.c110 /* notice we allowed for LWS_PRE in the payload already */ in callback_minimal()
112 LWS_PRE, vhd->amsg.len, LWS_WRITE_TEXT); in callback_minimal()
126 /* notice we over-allocate by LWS_PRE */ in callback_minimal()
127 vhd->amsg.payload = malloc(LWS_PRE + len); in callback_minimal()
133 memcpy((char *)vhd->amsg.payload + LWS_PRE, in, len); in callback_minimal()
/third_party/libwebsockets/minimal-examples/http-client/minimal-http-client-hugeurl/
H A Dminimal-http-client-hugeurl.c103 char buffer[1024 + LWS_PRE]; in callback_http()
104 char *px = buffer + LWS_PRE; in callback_http()
105 int lenx = sizeof(buffer) - LWS_PRE; in callback_http()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-broker/
H A Dprotocol_lws_minimal.c135 /* notice we allowed for LWS_PRE in the payload already */ in callback_minimal()
136 m = lws_write(wsi, ((unsigned char *)pmsg->payload) + LWS_PRE, in callback_minimal()
178 /* notice we over-allocate by LWS_PRE */ in callback_minimal()
179 amsg.payload = malloc(LWS_PRE + len); in callback_minimal()
185 memcpy((char *)amsg.payload + LWS_PRE, in, len); in callback_minimal()
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server/
H A Dprotocol_lws_minimal.c104 /* notice we allowed for LWS_PRE in the payload already */ in callback_minimal()
106 LWS_PRE, vhd->amsg.len, LWS_WRITE_TEXT); in callback_minimal()
120 /* notice we over-allocate by LWS_PRE */ in callback_minimal()
121 vhd->amsg.payload = malloc(LWS_PRE + len); in callback_minimal()
127 memcpy((char *)vhd->amsg.payload + LWS_PRE, in, len); in callback_minimal()
/third_party/libwebsockets/lib/roles/ws/
H A Dclient-parser-ws.c347 * rx_ubuf_head + LWS_PRE in lws_ws_client_rx_sm()
350 wsi->ws->rx_ubuf[LWS_PRE + (wsi->ws->rx_ubuf_head++)] = c; in lws_ws_client_rx_sm()
385 pp = &wsi->ws->rx_ubuf[LWS_PRE]; in lws_ws_client_rx_sm()
424 memcpy(wsi->ws->ping_payload_buf + LWS_PRE, pp, in lws_ws_client_rx_sm()
463 memcpy(wsi->ws->pong_payload_buf + LWS_PRE, in lws_ws_client_rx_sm()
464 &wsi->ws->rx_ubuf[LWS_PRE], in lws_ws_client_rx_sm()
479 lwsl_hexdump_wsi_debug(wsi, &wsi->ws->rx_ubuf[LWS_PRE], in lws_ws_client_rx_sm()
517 pmdrx.eb_in.token = &wsi->ws->rx_ubuf[LWS_PRE]; in lws_ws_client_rx_sm()
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-spam/
H A Dminimal-ws-client-spam.c89 uint8_t ping[LWS_PRE + 125]; in callback_minimal_spam()
154 n = lws_snprintf((char *)ping + LWS_PRE, sizeof(ping) - LWS_PRE, in callback_minimal_spam()
157 m = lws_write(wsi, ping + LWS_PRE, (unsigned int)n, LWS_WRITE_TEXT); in callback_minimal_spam()

Completed in 13 milliseconds

1234