libwebsockets
Lightweight C library for HTML5 websockets
Toggle main menu visibility
Loading...
Searching...
No Matches
lws-stub.h
Go to the documentation of this file.
1
/*
2
* libwebsockets - small server side websockets and web server implementation
3
*
4
* Copyright (C) 2010 - 2026 Andy Green <andy@warmcat.com>
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
* IN THE SOFTWARE.
23
*
24
* lws_stub - generalized API for spawning and communicating with root stubs
25
* via UDS and JSON-RPC
26
*/
27
28
#ifndef _LWS_STUB_H
29
#define _LWS_STUB_H
30
31
#if defined(LWS_WITH_STUB)
32
33
struct
lws_stub_manager;
34
35
struct
lws_stub_config {
36
struct
lws_context *cx;
37
struct
lws_vhost *vh;
38
const
char
*stub_name;
/* e.g. "distribution-client" */
39
const
char
*uds_path;
/* e.g. "/var/run/lws-cert-dist-stub.sock" */
40
const
struct
lws_protocols *protocols;
/* Protocol array for the UDS server vhost */
41
const
void
*extra_payload;
/* Optional extra data to write to child stdin */
42
size_t
extra_payload_len;
43
void
*user;
/* Opaque user pointer passed to vhost */
44
void (*connected_cb)(
struct
lws_stub_manager *mgr);
/* Called when UDS connects */
45
};
46
47
struct
lws_stub_manager;
48
58
LWS_VISIBLE
LWS_EXTERN
struct
lws_stub_manager *
59
lws_stub_spawn(
const
struct
lws_stub_config *config);
60
72
LWS_VISIBLE
LWS_EXTERN
int
73
lws_stub_server_init(
const
struct
lws_stub_config *config,
char
*secret_out,
void
*extra_out,
size_t
extra_len);
74
89
LWS_VISIBLE
LWS_EXTERN
int
90
lws_stub_request(
struct
lws_stub_manager *mgr,
91
const
char
*json,
92
const
char
*
const
*rx_paths,
93
size_t
rx_paths_count,
94
signed
char
(*rx_cb)(
struct
lejp_ctx
*ctx,
char
reason),
95
void
(*raw_cb)(
const
char
*in,
size_t
len,
void
*user),
96
void
*user);
97
105
LWS_VISIBLE
LWS_EXTERN
void
106
lws_stub_destroy(
struct
lws_stub_manager **_mgr);
107
108
109
LWS_VISIBLE
LWS_EXTERN
int
110
lws_callback_stub_client(
struct
lws *wsi,
enum
lws_callback_reasons
reason,
111
void
*user,
void
*in,
size_t
len);
112
113
#endif
/* LWS_WITH_STUB */
114
115
#endif
/* _LWS_STUB_H */
lws_callback_reasons
lws_callback_reasons
Definition
lws-callbacks.h:100
LWS_EXTERN
#define LWS_EXTERN
Definition
libwebsockets.h:296
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:291
lejp_ctx
Definition
lws-lejp.h:243
include
libwebsockets
lws-stub.h
Generated on
for libwebsockets by
1.18.0