/third_party/libwebsockets/minimal-examples/secure-streams/minimal-secure-streams-alexa/ |
H A 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 in callback_audio() [all...] |
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-tx/ |
H A 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 in thread_spam() 138 struct per_vhost_data__minimal *vhd = sul_connect_attempt() local 161 struct per_vhost_data__minimal *vhd = callback_minimal_broker() local [all...] |
/third_party/libwebsockets/minimal-examples/client-server/minimal-ws-proxy/ |
H A 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 in sul_connect_attempt() 94 struct per_vhost_data__minimal *vhd = callback_minimal() local [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/ |
H A D | protocol_lws_minimal.c | 64 * Access is serialized by vhd->lock_ring. 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 in thread_spam() 152 struct per_vhost_data__minimal *vhd = callback_minimal() local [all...] |
/third_party/libwebsockets/plugins/acme-client/ |
H A D | protocol_lws_acme_client.c | 112 * the vhd is allocated for every vhost using the plugin. 622 lws_acme_finished(struct per_vhost_data__lws_acme_client *vhd) in lws_acme_finished() argument 626 if (vhd->ac) { in lws_acme_finished() 627 if (vhd->ac->vhost) in lws_acme_finished() 628 lws_vhost_destroy(vhd->ac->vhost); in lws_acme_finished() 629 if (vhd->ac->alloc_privkey_pem) in lws_acme_finished() 630 free(vhd->ac->alloc_privkey_pem); in lws_acme_finished() 631 free(vhd->ac); in lws_acme_finished() 634 lws_genrsa_destroy(&vhd->rsactx); in lws_acme_finished() 635 lws_jwk_destroy(&vhd in lws_acme_finished() 658 lws_acme_load_create_auth_keys(struct per_vhost_data__lws_acme_client *vhd, int bits) lws_acme_load_create_auth_keys() argument 690 lws_acme_start_acquisition(struct per_vhost_data__lws_acme_client *vhd, struct lws_vhost *v) lws_acme_start_acquisition() argument 767 struct per_vhost_data__lws_acme_client *vhd = callback_acme_client() local [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads/ |
H A D | protocol_lws_minimal.c | 60 * Access is serialized by vhd->lock_ring. 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 in thread_spam() 149 struct per_vhost_data__minimal *vhd = callback_minimal() local [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threads-smp/ |
H A D | protocol_lws_minimal.c | 60 * Access is serialized by vhd->lock_ring. 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 in thread_spam() 149 struct per_vhost_data__minimal *vhd = callback_minimal() local [all...] |
/third_party/libwebsockets/plugins/ |
H A 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 in callback_raw_test() [all...] |
H A D | protocol_lws_openmetrics_export.c | 81 struct vhd { struct 102 struct vhd *bind_partner_vhd; 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_secret); in omc_connect_client() 146 lws_strncpy(url, vhd->ws_server_uri, sizeof(url)); in omc_connect_client() 150 vhd in omc_connect_client() 549 omc_lws_om_get_other_side_pss_client(struct vhd *vhd, struct pss *pss) omc_lws_om_get_other_side_pss_client() argument 576 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get( callback_lws_openmetrics_prox_agg() local 751 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get( callback_lws_openmetrics_prox_server() local 945 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get( callback_lws_openmetrics_prox_client() local [all...] |
H A 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 in callback_lws_status() [all...] |
/third_party/libwebsockets/minimal-examples/http-server/minimal-http-server-sse-ring/ |
H A 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 in thread_spam() 156 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get( callback_sse() local [all...] |
/third_party/libwebsockets/minimal-examples/raw/minimal-raw-audio/ |
H A 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 in callback_raw_test() [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-ring/ |
H A 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() 95 * vhd pss list early. (This is safe to repeat 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 [all...] |
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-echo/ |
H A 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 in sul_connect_attempt() 105 struct vhd_minimal_client_echo *vhd = (struct vhd_minimal_client_echo *) callback_minimal_client_echo() local [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-pmd/ |
H A 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() 85 /* add ourselves to the list of live pss held in the vhd */ 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 in callback_minimal() [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server/ |
H A 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() 85 /* add ourselves to the list of live pss held in the vhd */ 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 in callback_minimal() [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-broker/ |
H A 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() 116 /* add subscribers to the list of live pss held in the vhd */ in callback_minimal() [all...] |
/third_party/libwebsockets/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/ |
H A 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 in callback_minimal_pmd_bulk() [all...] |
/third_party/libwebsockets/minimal-examples/raw/minimal-raw-serial/ |
H A 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 in callback_raw_test() [all...] |
/third_party/libwebsockets/plugins/ssh-base/ |
H A 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 in lws_callback_raw_telnet() [all...] |
/third_party/libwebsockets/minimal-examples/dbus-server/minimal-dbus-ws-proxy/ |
H A D | protocol_lws_minimal_dbus_ws_proxy.c | 82 struct vhd_dbus_proxy *vhd; member 91 * Because the listener ctx is composed in the vhd, we can always get a 92 * pointer to the outer vhd from a pointer to ctx_listener inside. 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() 521 create_dbus_listener(struct vhd_dbus_proxy *vhd, int tsi) create_dbus_listener() argument 609 destroy_dbus_server_listener(struct vhd_dbus_proxy *vhd) destroy_dbus_server_listener() argument 637 struct vhd_dbus_proxy *vhd = (struct vhd_dbus_proxy *) callback_minimal_dbus_wsproxy() local [all...] |
/third_party/libwebsockets/plugins/deaddrop/ |
H A 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 in scan_upload_dir() 380 struct vhd_deaddrop *vhd = (struct vhd_deaddrop *) callback_deaddrop() local [all...] |
/third_party/libwebsockets/plugin-standalone/ |
H A 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 in callback_dumb_increment() [all...] |
/third_party/libwebsockets/minimal-examples/ws-server/minimal-ws-server-threadpool/ |
H A 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 in callback_minimal() [all...] |
/third_party/libwebsockets/minimal-examples/raw/minimal-raw-vhost/ |
H A 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 in callback_raw_test() [all...] |