18#ifndef __VSF_LINUX_HTTPD_H__
19#define __VSF_LINUX_HTTPD_H__
26#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
27# include "../../include/sys/socket.h"
28# include "../../include/netinet/in.h"
34#undef __VSF_LINUX_HTTPD_PUBLIC_CONST__
35#if defined(__VSF_LINUX_HTTPD_CLASS_IMPLEMENT)
36# define __VSF_CLASS_IMPLEMENT__
37# define __VSF_LINUX_HTTPD_PUBLIC_CONST__
38#elif defined(__VSF_LINUX_HTTPD_CLASS_INHERIT__)
39# define __VSF_CLASS_INHERIT__
40# define __VSF_LINUX_HTTPD_PUBLIC_CONST__
42# define __VSF_LINUX_HTTPD_PUBLIC_CONST__ const
53#ifndef VSF_LINUX_HTTPD_CFG_REQUEST_BUFSIZE
54# define VSF_LINUX_HTTPD_CFG_REQUEST_BUFSIZE 1024
56#ifndef VSF_LINUX_HTTPD_CFG_PRIV_SIZE
57# define VSF_LINUX_HTTPD_CFG_PRIV_SIZE 256
60#ifndef VSF_LINUX_HTTPD_CFG_FILESYSTEM
61# define VSF_LINUX_HTTPD_CFG_FILESYSTEM ENABLED
63#ifndef VSF_LINUX_HTTPD_CFG_WEBSOCKET
65# define VSF_LINUX_HTTPD_CFG_WEBSOCKET VSF_USE_MBEDTLS
117 VSF_LINUX_HTTPD_ENCODING_INVALID = 0,
118 VSF_LINUX_HTTPD_ENCODING_IDENTITY = VSF_LINUX_HTTPD_ENCODING_INVALID,
119 VSF_LINUX_HTTPD_ENCODING_GZIP,
120 VSF_LINUX_HTTPD_ENCODING_NUM = VSF_LINUX_HTTPD_ENCODING_GZIP,
126 VSF_LINUX_HTTPD_CHARSET_INVALID = 0,
127 VSF_LINUX_HTTPD_CHARSET_UTF8,
128 VSF_LINUX_HTTPD_CHARSET_NUM = VSF_LINUX_HTTPD_CHARSET_UTF8,
195#if VSF_LINUX_HTTPD_CFG_FILESYSTEM == ENABLED
198#if VSF_LINUX_HTTPD_CFG_WEBSOCKET == ENABLED
231#if VSF_LINUX_HTTPD_CFG_WEBSOCKET == ENABLED
258 vsf_bitmap(vsf_linux_httpd_mime_map_t) mime_map;
259 vsf_bitmap(vsf_linux_httpd_encoding_map_t) encoding_map;
264 bool is_stream_out_started;
267#if VSF_LINUX_HTTPD_CFG_WEBSOCKET == ENABLED
281#if VSF_LINUX_HTTPD_CFG_FILESYSTEM == ENABLED
284#if VSF_LINUX_HTTPD_CFG_WEBSOCKET == ENABLED
303 int fd_stream_out, fd_stream_in;
305 bool wait_stream_out, wait_stream_in;
313#if defined(VSF_LINUX_HTTPD_CFG_SESSION_POOL_SIZE) && (VSF_LINUX_HTTPD_CFG_SESSION_POOL_SIZE > 0)
329#if defined(VSF_LINUX_HTTPD_CFG_SESSION_POOL_SIZE) && (VSF_LINUX_HTTPD_CFG_SESSION_POOL_SIZE > 0)
330 vsf_pool(vsf_linux_httpd_session_pool) session_pool;
331 vsf_pool_item(vsf_linux_httpd_session_pool) sessions[VSF_LINUX_HTTPD_CFG_SESSION_POOL_SIZE];
353#undef __VSF_LINUX_HTTPD_CLASS_IMPLEMENT
354#undef __VSF_LINUX_HTTPD_CLASS_INHERIT__
vsf_err_t
Definition __type.h:42
void(* vsf_linux_httpd_websocket_onerror_t)(vsf_linux_httpd_request_t *req)
Definition __vsf_linux_urihandler_websocket.h:50
void(* vsf_linux_httpd_websocket_onmessage_t)(vsf_linux_httpd_request_t *req, const vsf_linux_httpd_urihandler_websocket_t *websocket_ctx, uint8_t *buf, uint32_t len)
Definition __vsf_linux_urihandler_websocket.h:51
void(* vsf_linux_httpd_websocket_onclose_t)(vsf_linux_httpd_request_t *req)
Definition __vsf_linux_urihandler_websocket.h:49
int(* vsf_linux_httpd_websocket_onopen_t)(vsf_linux_httpd_request_t *req)
Definition __vsf_linux_urihandler_websocket.h:48
Definition vsf_linux_httpd.h:251
Definition vsf_linux_httpd.h:297
Definition vsf_linux_httpd.h:318
Definition vsf_mem_stream.h:88
Definition vsf_simple_stream.h:254
vsf_stream_evt_t
Definition vsf_simple_stream.h:160
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_dcl_class
Definition ooc_class.h:46
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned int uint_fast32_t
Definition stdint.h:27
Definition vsf_list.h:888
Definition vsf_list.h:883
Definition __vsf_linux_urihandler_file.h:34
Definition vsf_linux_httpd.h:245
vsf_mem_stream_t stream
Definition vsf_linux_httpd.h:246
Definition vsf_linux_httpd.h:170
void(* stream_evthandler_fn)(vsf_stream_t *stream, void *param, vsf_stream_evt_t evt)
Definition vsf_linux_httpd.h:175
vsf_err_t(* fini_fn)(vsf_linux_httpd_request_t *req)
Definition vsf_linux_httpd.h:172
vsf_err_t(* init_fn)(vsf_linux_httpd_request_t *req, uint8_t *data, uint_fast32_t size)
Definition vsf_linux_httpd.h:171
vsf_err_t(* serve_fn)(vsf_linux_httpd_request_t *req)
Definition vsf_linux_httpd.h:173
Definition vsf_linux_httpd.h:208
vsf_linux_httpd_websocket_onmessage_t on_message
Definition vsf_linux_httpd.h:237
struct vsf_linux_httpd_urihandler_t::@836::@839 websocket
vsf_linux_httpd_websocket_onerror_t on_error
Definition vsf_linux_httpd.h:236
vsf_linux_httpd_websocket_onclose_t on_close
Definition vsf_linux_httpd.h:235
vsf_linux_httpd_websocket_onopen_t on_open
Definition vsf_linux_httpd.h:234
char * uri
Definition vsf_linux_httpd.h:214
char * target_uri
Definition vsf_linux_httpd.h:219
char * ext
Definition vsf_linux_httpd.h:213
uint32_t size
Definition vsf_linux_httpd.h:228
void * param
Definition vsf_linux_httpd.h:233
struct vsf_linux_httpd_urihandler_t::@836::@838 buffer
const vsf_linux_httpd_urihandler_op_t * op
Definition vsf_linux_httpd.h:217
vsf_linux_httpd_urihandler_type_t type
Definition vsf_linux_httpd.h:211
int(* poll_fn)(vsf_linux_httpd_request_t *req, fd_set *rset, fd_set *wset, bool prepare)
Definition vsf_linux_httpd.h:242
uint8_t * ptr
Definition vsf_linux_httpd.h:227
vsf_linux_httpd_urihandler_match_t match
Definition vsf_linux_httpd.h:210
Definition __vsf_linux_urihandler_websocket.h:33
#define dcl_vsf_bitmap(__name, __bit_size)
Definition vsf_bitmap.h:98
#define vsf_bitmap(__name)
Definition vsf_bitmap.h:93
const vsf_linux_httpd_urihandler_op_t vsf_linux_httpd_urihandler_buffer_op
Definition vsf_linux_httpd.c:264
#define VSF_LINUX_HTTPD_CFG_PRIV_SIZE
Definition vsf_linux_httpd.h:57
vsf_err_t vsf_linux_httpd_start(vsf_linux_httpd_t *httpd)
Definition vsf_linux_httpd.c:1072
vsf_linux_httpd_mime_t
Definition vsf_linux_httpd.h:89
@ VSF_LINUX_HTTPD_MIME_INVALID
Definition vsf_linux_httpd.h:90
@ VSF_LINUX_HTTPD_MIME_AUDIO_WAV
Definition vsf_linux_httpd.h:102
@ VSF_LINUX_HTTPD_MIME_IMAGE_GIF
Definition vsf_linux_httpd.h:95
@ VSF_LINUX_HTTPD_MIME_TEXT_HTML
Definition vsf_linux_httpd.h:91
@ VSF_LINUX_HTTPD_MIME_APP_TAR
Definition vsf_linux_httpd.h:106
@ VSF_LINUX_HTTPD_MIME_AUDIO_OGG
Definition vsf_linux_httpd.h:103
@ VSF_LINUX_HTTPD_MIME_IMAGE_SVG
Definition vsf_linux_httpd.h:98
@ VSF_LINUX_HTTPD_MIME_TEXT_XML
Definition vsf_linux_httpd.h:92
@ VSF_LINUX_HTTPD_MIME_APP_ZIP
Definition vsf_linux_httpd.h:107
@ VSF_LINUX_HTTPD_MIME_TEXT_PLAIN
Definition vsf_linux_httpd.h:94
@ VSF_LINUX_HTTPD_MIME_IMAGE_ICON
Definition vsf_linux_httpd.h:99
@ VSF_LINUX_HTTPD_MIME_APP_WASM
Definition vsf_linux_httpd.h:109
@ VSF_LINUX_HTTPD_MIME_NUM
Definition vsf_linux_httpd.h:111
@ VSF_LINUX_HTTPD_MIME_APP_JSON
Definition vsf_linux_httpd.h:108
@ VSF_LINUX_HTTPD_MIME_IMAGE_JPEG
Definition vsf_linux_httpd.h:97
@ VSF_LINUX_HTTPD_MIME_APP_PDF
Definition vsf_linux_httpd.h:104
@ VSF_LINUX_HTTPD_MIME_APP_JS
Definition vsf_linux_httpd.h:105
@ VSF_LINUX_HTTPD_MIME_ANY
Definition vsf_linux_httpd.h:110
@ VSF_LINUX_HTTPD_MIME_VIDEO_AVI
Definition vsf_linux_httpd.h:100
@ VSF_LINUX_HTTPD_MIME_TEXT_CSS
Definition vsf_linux_httpd.h:93
@ VSF_LINUX_HTTPD_MIME_IMAGE_PNG
Definition vsf_linux_httpd.h:96
@ VSF_LINUX_HTTPD_MIME_AUDIO_MPEG
Definition vsf_linux_httpd.h:101
void * vsf_linux_httpd_thread(void *param)
Definition vsf_linux_httpd.c:856
#define VSF_LINUX_HTTPD_CFG_REQUEST_BUFSIZE
Definition vsf_linux_httpd.h:54
vsf_linux_httpd_encoding_t
Definition vsf_linux_httpd.h:121
vsf_linux_httpd_urihandler_type_t
Definition vsf_linux_httpd.h:184
@ VSF_LINUX_HTTPD_URI_REMAP
Definition vsf_linux_httpd.h:186
@ VSF_LINUX_HTTPD_URI_OP
Definition vsf_linux_httpd.h:185
vsf_linux_httpd_urihandler_match_t
Definition vsf_linux_httpd.h:178
@ VSF_LINUX_HTTPD_URI_MATCH_EXT
Definition vsf_linux_httpd.h:179
@ VSF_LINUX_HTTPD_URI_MATCH_ANY
Definition vsf_linux_httpd.h:181
@ VSF_LINUX_HTTPD_URI_MATCH_URI
Definition vsf_linux_httpd.h:180
#define __VSF_LINUX_HTTPD_PUBLIC_CONST__
Definition vsf_linux_httpd.h:42
vsf_linux_httpd_response_t
Definition vsf_linux_httpd.h:136
@ VSF_LINUX_HTTPD_METHOD_NOT_ALLOWED
Definition vsf_linux_httpd.h:148
@ VSF_LINUX_HTTPD_BAD_REQUEST
Definition vsf_linux_httpd.h:143
@ VSF_LINUX_HTTPD_CONFLICT
Definition vsf_linux_httpd.h:152
@ VSF_LINUX_HTTPD_PROXY_AUTHENTICATION_REQUIRED
Definition vsf_linux_httpd.h:150
@ VSF_LINUX_HTTPD_REQUEST_TIME_OUT
Definition vsf_linux_httpd.h:151
@ VSF_LINUX_HTTPD_BAD_GATEWAY
Definition vsf_linux_httpd.h:164
@ VSF_LINUX_HTTPD_CONTINUE
Definition vsf_linux_httpd.h:137
@ VSF_LINUX_HTTPD_REQUEST_URI_TOO_LARGE
Definition vsf_linux_httpd.h:157
@ VSF_LINUX_HTTPD_NOT_FOUND
Definition vsf_linux_httpd.h:147
@ VSF_LINUX_HTTPD_FORBIDDEN
Definition vsf_linux_httpd.h:146
@ VSF_LINUX_HTTPD_NOT_IMPLEMENT
Definition vsf_linux_httpd.h:163
@ VSF_LINUX_HTTPD_GATEWAY_TIME_OUT
Definition vsf_linux_httpd.h:166
@ VSF_LINUX_HTTPD_NOT_ACCEPTABLE
Definition vsf_linux_httpd.h:149
@ VSF_LINUX_HTTPD_HTTP_VERSION_NOT_SUPPORTED
Definition vsf_linux_httpd.h:167
@ VSF_LINUX_HTTPD_SERVICE_UNAVAILABLE
Definition vsf_linux_httpd.h:165
@ VSF_LINUX_HTTPD_UNAUTHORIZED
Definition vsf_linux_httpd.h:144
@ VSF_LINUX_HTTPD_INTERNAL_SERVER_ERROR
Definition vsf_linux_httpd.h:162
@ VSF_LINUX_HTTPD_OK
Definition vsf_linux_httpd.h:139
@ VSF_LINUX_HTTPD_PRECONDITION_FAILED
Definition vsf_linux_httpd.h:155
@ VSF_LINUX_HTTPD_LENGTH_REQUIRED
Definition vsf_linux_httpd.h:154
@ VSF_LINUX_HTTPD_MULTIPLE_CHOICES
Definition vsf_linux_httpd.h:141
@ VSF_LINUX_HTTPD_UNSUPPORTED_MEDIA_TYPE
Definition vsf_linux_httpd.h:158
@ VSF_LINUX_HTTPD_EXPECTATION_FAILED
Definition vsf_linux_httpd.h:160
@ VSF_LINUX_HTTPD_PAYMENT_REQUIRED
Definition vsf_linux_httpd.h:145
@ VSF_LINUX_HTTPD_REQUESTED_RANGE_NOT_SATISFIABLE
Definition vsf_linux_httpd.h:159
@ VSF_LINUX_HTTPD_GONE
Definition vsf_linux_httpd.h:153
@ VSF_LINUX_HTTPD_REQUEST_ENITIY_TOO_LARGE
Definition vsf_linux_httpd.h:156
vsf_linux_httpd_request_method_t
Definition vsf_linux_httpd.h:74
@ VSF_LINUX_HTTPD_CONNECT
Definition vsf_linux_httpd.h:83
@ VSF_LINUX_HTTPD_POST
Definition vsf_linux_httpd.h:76
@ VSF_LINUX_HTTPD_TRACE
Definition vsf_linux_httpd.h:85
@ VSF_LINUX_HTTPD_PUT
Definition vsf_linux_httpd.h:81
@ VSF_LINUX_HTTPD_DELETE
Definition vsf_linux_httpd.h:82
@ VSF_LINUX_HTTPD_METHOD_NUM
Definition vsf_linux_httpd.h:77
@ VSF_LINUX_HTTPD_PATCH
Definition vsf_linux_httpd.h:86
@ VSF_LINUX_HTTPD_HEAD
Definition vsf_linux_httpd.h:80
@ VSF_LINUX_HTTPD_OPTIONS
Definition vsf_linux_httpd.h:84
@ VSF_LINUX_HTTPD_GET
Definition vsf_linux_httpd.h:75
vsf_linux_httpd_charset_t
Definition vsf_linux_httpd.h:129
vsf_linux_httpd_language_t
Definition vsf_linux_httpd.h:131
@ VSF_LINUX_HTTPD_ENGLISH
Definition vsf_linux_httpd.h:133
@ VSF_LINUX_HTTPD_LANGUAGE_INVALID
Definition vsf_linux_httpd.h:132
uint32_t size
Definition vsf_memfs.h:50
#define vsf_pool(__name)
Definition vsf_pool.h:258
#define vsf_pool_item(__name)
Definition vsf_pool.h:259
#define dcl_vsf_pool(__name)
Definition vsf_pool.h:264
#define def_vsf_pool(__name, __type)
Definition vsf_pool.h:271