/third_party/libwebsockets/minimal-examples/secure-streams/minimal-secure-streams-alexa/ |
D | audio.c | 207 struct raw_vhd *vhd = (struct raw_vhd *)lws_protocol_vh_priv_get( in callback_audio() local 221 avhd = vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_audio() 229 1.0, &vhd->porc); in callback_audio() 235 vhd->porc_spf = pv_porcupine_frame_length(); in callback_audio() 236 vhd->porcbuf = malloc(vhd->porc_spf * 2); in callback_audio() 239 vhd->porc_spf); in callback_audio() 241 vhd->rate = pv_sample_rate(); /* 16kHz */ in callback_audio() 245 if (set_hw_params(lws_get_vhost(wsi), &vhd->pcm_playback, in callback_audio() 253 if (set_hw_params(lws_get_vhost(wsi), &vhd->pcm_capture, in callback_audio() 267 if (!vhd) in callback_audio() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-tx/ |
D | minimal-ws-client.c | 78 struct per_vhost_data__minimal *vhd = in thread_spam() local 83 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++) in thread_spam() 84 if (pthread_equal(pthread_self(), vhd->pthread_spam[n])) in thread_spam() 89 if (!vhd->established) in thread_spam() 92 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */ in thread_spam() 95 n = (int)lws_ring_get_count_free_elements(vhd->ring); in thread_spam() 109 n = (int)lws_ring_insert(vhd->ring, &amsg, 1); in thread_spam() 118 lws_cancel_service(vhd->context); in thread_spam() 121 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */ in thread_spam() 126 } while (!vhd->finished); in thread_spam() [all …]
|
/third_party/libwebsockets/minimal-examples/client-server/minimal-ws-proxy/ |
D | protocol_lws_minimal.c | 68 struct per_vhost_data__minimal *vhd = in sul_connect_attempt() local 71 vhd->i.context = vhd->context; in sul_connect_attempt() 72 vhd->i.port = 443; in sul_connect_attempt() 73 vhd->i.address = "libwebsockets.org"; in sul_connect_attempt() 74 vhd->i.path = "/"; in sul_connect_attempt() 75 vhd->i.host = vhd->i.address; in sul_connect_attempt() 76 vhd->i.origin = vhd->i.address; in sul_connect_attempt() 77 vhd->i.ssl_connection = 1; in sul_connect_attempt() 79 vhd->i.protocol = "dumb-increment-protocol"; in sul_connect_attempt() 80 vhd->i.local_protocol_name = "lws-minimal-proxy"; in sul_connect_attempt() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/ |
D | protocol_lws_minimal.c | 87 struct per_vhost_data__minimal *vhd = in thread_spam() local 92 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++) in thread_spam() 93 if (pthread_equal(pthread_self(), vhd->pthread_spam[n])) in thread_spam() 97 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */ in thread_spam() 100 if (!vhd->pss_list) in thread_spam() 104 n = (int)lws_ring_get_count_free_elements(vhd->ring); in thread_spam() 116 "%s: spam tid: %d, msg: %d", vhd->config, in thread_spam() 119 n = (int)lws_ring_insert(vhd->ring, &amsg, 1); in thread_spam() 128 lws_cancel_service(vhd->context); in thread_spam() 131 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */ in thread_spam() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads/ |
D | protocol_lws_minimal.c | 83 struct per_vhost_data__minimal *vhd = in thread_spam() local 88 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++) in thread_spam() 89 if (pthread_equal(pthread_self(), vhd->pthread_spam[n])) in thread_spam() 94 if (!vhd->pss_list) in thread_spam() 97 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */ in thread_spam() 100 n = (int)lws_ring_get_count_free_elements(vhd->ring); in thread_spam() 112 "%s: tid: %d, msg: %d", vhd->config, in thread_spam() 115 n = (int)lws_ring_insert(vhd->ring, &amsg, 1); in thread_spam() 124 lws_cancel_service(vhd->context); in thread_spam() 127 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */ in thread_spam() [all …]
|
/third_party/libwebsockets/plugins/ |
D | protocol_lws_raw_test.c | 104 struct per_vhost_data__raw_test *vhd = in callback_raw_test() local 114 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_raw_test() 117 if (!vhd) in callback_raw_test() 119 vhd->context = lws_get_context(wsi); in callback_raw_test() 120 vhd->protocol = lws_get_protocol(wsi); in callback_raw_test() 121 vhd->vhost = lws_get_vhost(wsi); in callback_raw_test() 127 lws_strncpy(vhd->fifo_path, pvo->value, in callback_raw_test() 128 sizeof(vhd->fifo_path)); in callback_raw_test() 131 if (vhd->fifo_path[0] == '\0') { in callback_raw_test() 138 unlink(vhd->fifo_path); in callback_raw_test() [all …]
|
D | protocol_lws_openmetrics_export.c | 81 struct vhd { struct 102 struct vhd *bind_partner_vhd; argument 137 struct vhd *vhd = lws_container_of(sul, struct vhd, sul); in omc_connect_client() local 144 …lwsl_notice("%s: %s %s %s\n", __func__, vhd->ws_server_uri, vhd->metrics_proxy_path, vhd->ba_secre… in omc_connect_client() 146 lws_strncpy(url, vhd->ws_server_uri, sizeof(url)); in omc_connect_client() 150 vhd->ws_server_uri); in omc_connect_client() 154 i.context = vhd->cx; in omc_connect_client() 160 i.pwsi = &vhd->wsi; in omc_connect_client() 162 i.userdata = vhd; in omc_connect_client() 163 i.vhost = vhd->vhost; in omc_connect_client() [all …]
|
D | protocol_lws_status.c | 68 trigger_resend(struct per_vhost_data__lws_status *vhd) in trigger_resend() argument 71 vhd->live_pss_list) { in trigger_resend() 74 pss->walk_next = vhd->live_pss_list; in trigger_resend() 80 lws_callback_on_writable_all_protocol(vhd->context, vhd->protocol); in trigger_resend() 91 struct per_vhost_data__lws_status *vhd = in callback_lws_status() local 102 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_lws_status() 105 if (!vhd) { in callback_lws_status() 109 vhd->context = lws_get_context(wsi); in callback_lws_status() 110 vhd->protocol = lws_get_protocol(wsi); in callback_lws_status() 111 vhd->vhost = lws_get_vhost(wsi); in callback_lws_status() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads-smp/ |
D | protocol_lws_minimal.c | 83 struct per_vhost_data__minimal *vhd = in thread_spam() local 88 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++) in thread_spam() 89 if (pthread_equal(pthread_self(), vhd->pthread_spam[n])) in thread_spam() 94 if (!vhd->pss_list) in thread_spam() 97 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */ in thread_spam() 100 n = (int)lws_ring_get_count_free_elements(vhd->ring); in thread_spam() 112 "%s: spam tid: %d, msg: %d", vhd->config, in thread_spam() 115 n = (int)lws_ring_insert(vhd->ring, &amsg, 1); in thread_spam() 124 lws_cancel_service(vhd->context); in thread_spam() 127 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */ in thread_spam() [all …]
|
/third_party/libwebsockets/minimal-examples/http-server/minimal-http-server-sse-ring/ |
D | minimal-http-server-sse-ring.c | 51 struct vhd { struct 93 struct vhd *vhd = (struct vhd *)d; in thread_spam() local 97 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++) in thread_spam() 98 if (pthread_equal(pthread_self(), vhd->pthread_spam[n])) in thread_spam() 103 if (!vhd->pss_list) in thread_spam() 106 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */ in thread_spam() 109 n = (int)lws_ring_get_count_free_elements(vhd->ring); in thread_spam() 123 n = (int)lws_ring_insert(vhd->ring, &amsg, 1); in thread_spam() 132 lws_cancel_service(vhd->context); in thread_spam() 135 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */ in thread_spam() [all …]
|
/third_party/libwebsockets/minimal-examples/raw/minimal-raw-audio/ |
D | audio.c | 108 struct raw_vhd *vhd = (struct raw_vhd *)lws_protocol_vh_priv_get( in callback_raw_test() local 114 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_raw_test() 117 if (set_hw_params(lws_get_vhost(wsi), &vhd->pcm_playback, in callback_raw_test() 125 if (set_hw_params(lws_get_vhost(wsi), &vhd->pcm_capture, in callback_raw_test() 136 if (vhd && vhd->pcm_playback) { in callback_raw_test() 137 snd_pcm_drain(vhd->pcm_playback); in callback_raw_test() 138 snd_pcm_close(vhd->pcm_playback); in callback_raw_test() 139 vhd->pcm_playback = NULL; in callback_raw_test() 141 if (vhd && vhd->pcm_capture) { in callback_raw_test() 142 snd_pcm_close(vhd->pcm_capture); in callback_raw_test() [all …]
|
/third_party/libwebsockets/plugins/acme-client/ |
D | protocol_lws_acme_client.c | 631 lws_acme_finished(struct per_vhost_data__lws_acme_client *vhd) in lws_acme_finished() argument 635 if (vhd->ac) { in lws_acme_finished() 636 if (vhd->ac->vhost) in lws_acme_finished() 637 lws_vhost_destroy(vhd->ac->vhost); in lws_acme_finished() 638 if (vhd->ac->alloc_privkey_pem) in lws_acme_finished() 639 free(vhd->ac->alloc_privkey_pem); in lws_acme_finished() 640 free(vhd->ac); in lws_acme_finished() 643 lws_genrsa_destroy(&vhd->rsactx); in lws_acme_finished() 644 lws_jwk_destroy(&vhd->jwk); in lws_acme_finished() 646 vhd->ac = NULL; in lws_acme_finished() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-pmd/ |
D | protocol_lws_minimal.c | 68 struct per_vhost_data__minimal *vhd = in callback_minimal() local 76 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_minimal() 79 vhd->context = lws_get_context(wsi); in callback_minimal() 80 vhd->protocol = lws_get_protocol(wsi); in callback_minimal() 81 vhd->vhost = lws_get_vhost(wsi); in callback_minimal() 86 pss->pss_list = vhd->pss_list; in callback_minimal() 87 vhd->pss_list = pss; in callback_minimal() 89 pss->last = vhd->current; in callback_minimal() 95 ppss, vhd->pss_list) { in callback_minimal() 104 if (!vhd->amsg.payload) in callback_minimal() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server/ |
D | protocol_lws_minimal.c | 68 struct per_vhost_data__minimal *vhd = in callback_minimal() local 76 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_minimal() 79 vhd->context = lws_get_context(wsi); in callback_minimal() 80 vhd->protocol = lws_get_protocol(wsi); in callback_minimal() 81 vhd->vhost = lws_get_vhost(wsi); in callback_minimal() 86 lws_ll_fwd_insert(pss, pss_list, vhd->pss_list); in callback_minimal() 88 pss->last = vhd->current; in callback_minimal() 94 pss, vhd->pss_list); in callback_minimal() 98 if (!vhd->amsg.payload) in callback_minimal() 101 if (pss->last == vhd->current) in callback_minimal() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-ring/ |
D | protocol_lws_minimal.c | 54 cull_lagging_clients(struct per_vhost_data__minimal *vhd) in cull_lagging_clients() argument 56 uint32_t oldest_tail = lws_ring_get_oldest_tail(vhd->ring); in cull_lagging_clients() 58 int most = 0, before = (int)lws_ring_get_count_waiting_elements(vhd->ring, in cull_lagging_clients() 68 ppss, vhd->pss_list, pss_list) { in cull_lagging_clients() 102 pss_list, (*ppss), vhd->pss_list); in cull_lagging_clients() 114 m = (int)lws_ring_get_count_waiting_elements(vhd->ring, in cull_lagging_clients() 131 lws_ring_consume_and_update_oldest_tail(vhd->ring, in cull_lagging_clients() 133 vhd->pss_list, tail, pss_list); in cull_lagging_clients() 156 struct per_vhost_data__minimal *vhd = in callback_minimal() local 166 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_minimal() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-echo/ |
D | protocol_lws_minimal_client_echo.c | 59 struct vhd_minimal_client_echo *vhd = in sul_connect_attempt() local 64 lws_snprintf(host, sizeof(host), "%s:%u", *vhd->ads, *vhd->port); in sul_connect_attempt() 68 i.context = vhd->context; in sul_connect_attempt() 69 i.port = *vhd->port; in sul_connect_attempt() 70 i.address = *vhd->ads; in sul_connect_attempt() 71 i.path = *vhd->url; in sul_connect_attempt() 75 if ((*vhd->options) & 2) in sul_connect_attempt() 77 i.vhost = vhd->vhost; in sul_connect_attempt() 78 i.iface = *vhd->iface; in sul_connect_attempt() 80 i.pwsi = &vhd->client_wsi; in sul_connect_attempt() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/ |
D | protocol_lws_minimal_pmd_bulk.c | 86 struct vhd_minimal_pmd_bulk *vhd = in sul_connect_attempt() local 92 i.context = vhd->context; in sul_connect_attempt() 99 i.vhost = vhd->vhost; in sul_connect_attempt() 101 i.pwsi = &vhd->client_wsi; in sul_connect_attempt() 104 lws_sul_schedule(vhd->context, 0, &vhd->sul, in sul_connect_attempt() 114 struct vhd_minimal_pmd_bulk *vhd = (struct vhd_minimal_pmd_bulk *) in callback_minimal_pmd_bulk() local 123 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_minimal_pmd_bulk() 126 if (!vhd) in callback_minimal_pmd_bulk() 129 vhd->context = lws_get_context(wsi); in callback_minimal_pmd_bulk() 130 vhd->vhost = lws_get_vhost(wsi); in callback_minimal_pmd_bulk() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-broker/ |
D | protocol_lws_minimal.c | 82 struct per_vhost_data__minimal *vhd = in callback_minimal() local 93 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_minimal() 96 vhd->context = lws_get_context(wsi); in callback_minimal() 97 vhd->protocol = lws_get_protocol(wsi); in callback_minimal() 98 vhd->vhost = lws_get_vhost(wsi); in callback_minimal() 100 vhd->ring = lws_ring_create(sizeof(struct msg), 8, in callback_minimal() 102 if (!vhd->ring) in callback_minimal() 107 lws_ring_destroy(vhd->ring); in callback_minimal() 111 pss->tail = lws_ring_get_oldest_tail(vhd->ring); in callback_minimal() 117 lws_ll_fwd_insert(pss, pss_list, vhd->pss_list); in callback_minimal() [all …]
|
/third_party/libwebsockets/minimal-examples/raw/minimal-raw-serial/ |
D | minimal-raw-file.c | 50 struct raw_vhd *vhd = (struct raw_vhd *)lws_protocol_vh_priv_get( in callback_raw_test() local 62 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_raw_test() 64 vhd->filefd = lws_open(filepath, O_RDWR); in callback_raw_test() 65 if (vhd->filefd == -1) { in callback_raw_test() 71 tcflush(vhd->filefd, TCIOFLUSH); in callback_raw_test() 74 if (ioctl(vhd->filefd, TIOCGSERIAL, &s_s) == 0) { in callback_raw_test() 76 ioctl(vhd->filefd, TIOCSSERIAL, &s_s); in callback_raw_test() 83 if (tcgetattr(vhd->filefd, &tio)) { in callback_raw_test() 84 close(vhd->filefd); in callback_raw_test() 85 vhd->filefd = -1; in callback_raw_test() [all …]
|
/third_party/libwebsockets/plugins/deaddrop/ |
D | protocol_lws_deaddrop.c | 77 struct vhd_deaddrop *vhd; member 124 if (pss->vhd->lwsac_head) in start_sending_dir() 125 lwsac_reference(pss->vhd->lwsac_head); in start_sending_dir() 126 pss->lwsac_head = pss->vhd->lwsac_head; in start_sending_dir() 127 pss->dire = pss->vhd->dire_head; in start_sending_dir() 128 pss->filelist_version = pss->vhd->filelist_version; in start_sending_dir() 133 scan_upload_dir(struct vhd_deaddrop *vhd) in scan_upload_dir() argument 145 initial = strlen(vhd->upload_dir) + 1; in scan_upload_dir() 146 lws_strncpy(subdir[sp], vhd->upload_dir, sizeof(subdir[sp])); in scan_upload_dir() 147 dir[sp] = opendir(vhd->upload_dir); in scan_upload_dir() [all …]
|
/third_party/libwebsockets/minimal-examples/dbus-server/minimal-dbus-ws-proxy/ |
D | protocol_lws_minimal_dbus_ws_proxy.c | 82 struct vhd_dbus_proxy *vhd; member 253 assert(wspctx->vhd); in dmh_connect() 255 i.context = wspctx->vhd->context; in dmh_connect() 478 struct vhd_dbus_proxy *vhd = lws_container_of(d, in new_conn() local 481 assert(vhd->vhost == wspctx->ctx.vh); in new_conn() 494 conn_wspctx->vhd = vhd; /* let accepted connections also know the vhd */ in new_conn() 496 assert(conn_wspctx->vhd); in new_conn() 521 create_dbus_listener(struct vhd_dbus_proxy *vhd, int tsi) in create_dbus_listener() argument 527 vhd->dctx.ctx.tsi = tsi; in create_dbus_listener() 528 vhd->dctx.ctx.vh = vhd->vhost; in create_dbus_listener() [all …]
|
/third_party/libwebsockets/plugins/ssh-base/ |
D | telnet.c | 40 struct per_vhost_data__telnet *vhd; member 121 struct per_vhost_data__telnet *vhd = in lws_callback_raw_telnet() local 132 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in lws_callback_raw_telnet() 135 vhd->context = lws_get_context(wsi); in lws_callback_raw_telnet() 136 vhd->protocol = lws_get_protocol(wsi); in lws_callback_raw_telnet() 137 vhd->vhost = lws_get_vhost(wsi); in lws_callback_raw_telnet() 141 vhd->ops = (const struct lws_ssh_ops *)pvo->value; in lws_callback_raw_telnet() 146 if (!vhd->ops) { in lws_callback_raw_telnet() 153 pss->next = vhd->live_pss_list; in lws_callback_raw_telnet() 154 vhd->live_pss_list = pss; in lws_callback_raw_telnet() [all …]
|
/third_party/libwebsockets/minimal-examples/raw/minimal-raw-vhost/ |
D | minimal-raw-vhost.c | 51 struct raw_vhd *vhd = (struct raw_vhd *)lws_protocol_vh_priv_get( in callback_raw_test() local 68 lws_ll_fwd_insert(pss, pss_list, vhd->pss_list); in callback_raw_test() 73 lws_ll_fwd_remove(struct raw_pss, pss_list, pss, vhd->pss_list); in callback_raw_test() 78 vhd->len = (int)len; in callback_raw_test() 79 if (vhd->len > (int)sizeof(vhd->buf)) in callback_raw_test() 80 vhd->len = sizeof(vhd->buf); in callback_raw_test() 81 memcpy(vhd->buf, in, (unsigned int)vhd->len); in callback_raw_test() 82 lws_start_foreach_llp(struct raw_pss **, ppss, vhd->pss_list) { in callback_raw_test() 88 if (lws_write(wsi, vhd->buf, (unsigned int)vhd->len, LWS_WRITE_RAW) != in callback_raw_test() 89 vhd->len) { in callback_raw_test()
|
/third_party/libwebsockets/plugin-standalone/ |
D | protocol_example_standalone.c | 55 struct per_vhost_data__dumb_increment *vhd = lws_container_of(w, in uv_timeout_cb_dumb_increment() local 57 lws_callback_on_writable_all_protocol_vhost(vhd->vhost, vhd->protocol); in uv_timeout_cb_dumb_increment() 66 struct per_vhost_data__dumb_increment *vhd = in callback_dumb_increment() local 76 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_dumb_increment() 79 vhd->context = lws_get_context(wsi); in callback_dumb_increment() 80 vhd->protocol = lws_get_protocol(wsi); in callback_dumb_increment() 81 vhd->vhost = lws_get_vhost(wsi); in callback_dumb_increment() 82 uv_timer_init(lws_uv_getloop(vhd->context, 0), in callback_dumb_increment() 83 &vhd->timeout_watcher); in callback_dumb_increment() 84 uv_timer_start(&vhd->timeout_watcher, in callback_dumb_increment() [all …]
|
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threadpool/ |
D | protocol_lws_minimal_threadpool.c | 142 struct per_vhost_data__minimal *vhd = in sul_tp_dump() local 148 lws_threadpool_dump(vhd->tp); in sul_tp_dump() 149 lws_sul_schedule(vhd->context, 0, &vhd->sul, in sul_tp_dump() 158 struct per_vhost_data__minimal *vhd = in callback_minimal() local 174 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi), in callback_minimal() 177 if (!vhd) in callback_minimal() 180 vhd->context = lws_get_context(wsi); in callback_minimal() 190 vhd->config = pvo->value; in callback_minimal() 196 vhd->tp = lws_threadpool_create(lws_get_context(wsi), in callback_minimal() 199 if (!vhd->tp) in callback_minimal() [all …]
|