libwebsockets
Lightweight C library for HTML5 websockets
Toggle main menu visibility
class="ui-resizable-handle">
Loading...
Searching...
No Matches
lws-ws-ext.h
Go to the documentation of this file.
1
/*
2
* libwebsockets - small server side websockets and web server implementation
3
*
4
* Copyright (C) 2010 - 2019 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
34
35
/*
36
* NOTE: These public enums are part of the abi. If you want to add one,
37
* add it at where specified so existing users are unaffected.
38
*/
39
enum
lws_extension_callback_reasons
{
40
LWS_EXT_CB_CONSTRUCT
= 4,
41
LWS_EXT_CB_CLIENT_CONSTRUCT
= 5,
42
LWS_EXT_CB_DESTROY
= 8,
43
LWS_EXT_CB_PACKET_TX_PRESEND
= 12,
44
LWS_EXT_CB_PAYLOAD_TX
= 21,
45
LWS_EXT_CB_PAYLOAD_RX
= 22,
46
LWS_EXT_CB_OPTION_DEFAULT
= 23,
47
LWS_EXT_CB_OPTION_SET
= 24,
48
LWS_EXT_CB_OPTION_CONFIRM
= 25,
49
LWS_EXT_CB_NAMED_OPTION_SET
= 26,
50
51
/****** add new things just above ---^ ******/
52
};
53
55
enum
lws_ext_options_types
{
56
EXTARG_NONE
,
57
EXTARG_DEC
,
58
EXTARG_OPT_DEC
59
60
/* Add new things just above here ---^
61
* This is part of the ABI, don't needlessly break compatibility */
62
};
63
68
struct
lws_ext_options
{
69
const
char
*
name
;
70
enum
lws_ext_options_types
type
;
71
72
/* Add new things just above here ---^
73
* This is part of the ABI, don't needlessly break compatibility */
74
};
75
77
struct
lws_ext_option_arg
{
78
const
char
*
option_name
;
79
int
option_index
;
80
const
char
*
start
;
81
int
len
;
82
};
83
132
typedef
int
133
lws_extension_callback_function
(
struct
lws_context *context,
134
const
struct
lws_extension
*ext,
struct
lws *wsi,
135
enum
lws_extension_callback_reasons
reason,
136
void
*user,
void
*in,
size_t
len);
137
139
struct
lws_extension
{
140
const
char
*
name
;
141
lws_extension_callback_function
*
callback
;
142
const
char
*
client_offer
;
143
144
/* Add new things just above here ---^
145
* This is part of the ABI, don't needlessly break compatibility */
146
};
147
156
LWS_VISIBLE
LWS_EXTERN
int
157
lws_set_extension_option
(
struct
lws *wsi,
const
char
*ext_name,
158
const
char
*opt_name,
const
char
*opt_val);
159
170
LWS_VISIBLE
LWS_EXTERN
int
LWS_WARN_UNUSED_RESULT
171
lws_ext_parse_options
(
const
struct
lws_extension
*ext,
struct
lws *wsi,
172
void
*ext_user,
const
struct
lws_ext_options
*opts,
173
const
char
*o,
int
len);
174
187
LWS_VISIBLE
LWS_EXTERN
int
188
lws_extension_callback_pm_deflate
(
struct
lws_context *context,
189
const
struct
lws_extension
*ext,
190
struct
lws *wsi,
191
enum
lws_extension_callback_reasons
reason,
192
void
*user,
void
*in,
size_t
len);
193
194
/*
195
* The internal exts are part of the public abi
196
* If we add more extensions, publish the callback here ------v
197
*/
lws_ext_option_arg::option_name
const char * option_name
Definition
lws-ws-ext.h:78
lws_ext_option_arg::start
const char * start
Definition
lws-ws-ext.h:80
lws_ext_options::name
const char * name
Definition
lws-ws-ext.h:69
lws_extension::name
const char * name
Definition
lws-ws-ext.h:140
lws_extension::client_offer
const char * client_offer
Definition
lws-ws-ext.h:142
lws_ext_options::type
enum lws_ext_options_types type
Definition
lws-ws-ext.h:70
lws_ext_option_arg::len
int len
Definition
lws-ws-ext.h:81
lws_ext_option_arg::option_index
int option_index
Definition
lws-ws-ext.h:79
lws_extension::callback
lws_extension_callback_function * callback
Definition
lws-ws-ext.h:141
lws_ext_parse_options
LWS_VISIBLE LWS_EXTERN int LWS_WARN_UNUSED_RESULT lws_ext_parse_options(const struct lws_extension *ext, struct lws *wsi, void *ext_user, const struct lws_ext_options *opts, const char *o, int len)
lws_extension_callback_pm_deflate
LWS_VISIBLE LWS_EXTERN int lws_extension_callback_pm_deflate(struct lws_context *context, const struct lws_extension *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)
lws_extension_callback_function
int lws_extension_callback_function(struct lws_context *context, const struct lws_extension *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len)
Definition
lws-ws-ext.h:133
lws_ext_options_types
lws_ext_options_types
Definition
lws-ws-ext.h:55
lws_set_extension_option
LWS_VISIBLE LWS_EXTERN int lws_set_extension_option(struct lws *wsi, const char *ext_name, const char *opt_name, const char *opt_val)
lws_extension_callback_reasons
lws_extension_callback_reasons
Definition
lws-ws-ext.h:39
EXTARG_DEC
@ EXTARG_DEC
Definition
lws-ws-ext.h:57
EXTARG_OPT_DEC
@ EXTARG_OPT_DEC
Definition
lws-ws-ext.h:58
EXTARG_NONE
@ EXTARG_NONE
Definition
lws-ws-ext.h:56
LWS_EXT_CB_PAYLOAD_RX
@ LWS_EXT_CB_PAYLOAD_RX
Definition
lws-ws-ext.h:45
LWS_EXT_CB_NAMED_OPTION_SET
@ LWS_EXT_CB_NAMED_OPTION_SET
Definition
lws-ws-ext.h:49
LWS_EXT_CB_OPTION_DEFAULT
@ LWS_EXT_CB_OPTION_DEFAULT
Definition
lws-ws-ext.h:46
LWS_EXT_CB_PACKET_TX_PRESEND
@ LWS_EXT_CB_PACKET_TX_PRESEND
Definition
lws-ws-ext.h:43
LWS_EXT_CB_DESTROY
@ LWS_EXT_CB_DESTROY
Definition
lws-ws-ext.h:42
LWS_EXT_CB_CLIENT_CONSTRUCT
@ LWS_EXT_CB_CLIENT_CONSTRUCT
Definition
lws-ws-ext.h:41
LWS_EXT_CB_CONSTRUCT
@ LWS_EXT_CB_CONSTRUCT
Definition
lws-ws-ext.h:40
LWS_EXT_CB_OPTION_SET
@ LWS_EXT_CB_OPTION_SET
Definition
lws-ws-ext.h:47
LWS_EXT_CB_PAYLOAD_TX
@ LWS_EXT_CB_PAYLOAD_TX
Definition
lws-ws-ext.h:44
LWS_EXT_CB_OPTION_CONFIRM
@ LWS_EXT_CB_OPTION_CONFIRM
Definition
lws-ws-ext.h:48
lws_ext_option_arg
Definition
lws-ws-ext.h:77
lws_ext_options
Definition
lws-ws-ext.h:68
lws_extension
Definition
lws-ws-ext.h:139
LWS_EXTERN
#define LWS_EXTERN
Definition
libwebsockets.h:296
LWS_WARN_UNUSED_RESULT
#define LWS_WARN_UNUSED_RESULT
Definition
libwebsockets.h:292
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:291
include
libwebsockets
lws-ws-ext.h
Generated on
for libwebsockets by
1.18.0