u_private.h
Go to the documentation of this file.
#ifndef __U_PRIVATE_H__
#define __U_PRIVATE_H__
#define UNUSED(x) (void)(x)
#ifdef U_WITH_FREERTOS
#include <FreeRTOS_Sockets.h>
#define sockaddr freertos_sockaddr
typedef unsigned long int socklen_t;
#else
#ifdef U_WITH_LWIP
#include <lwip/sockets.h>
#endif // U_WITH_LWIP
#endif // U_WITH_FREERTOS
#include <ulfius.h>
/**********************************
* Internal functions declarations
**********************************/
struct _u_endpoint ** ulfius_endpoint_match(const char * method, const char * url, struct _u_endpoint * endpoint_list);
int ulfius_parse_url(const char * url, const struct _u_endpoint * endpoint, struct _u_map * map, int check_utf8);
int ulfius_set_response_header(struct MHD_Response * response, const struct _u_map * response_map_header);
int ulfius_set_response_cookie(struct MHD_Response * mhd_response, const struct _u_response * response);
const unsigned char * utf8_check(const char * s_orig, size_t len);
#ifndef U_DISABLE_WEBSOCKET
#define _U_W_BUFF_LEN 256
#define _U_W_EXT_DEFLATE "permessage-deflate"
#define _U_W_EXT_DEFLATE_S_CTX "server_no_context_takeover"
#define _U_W_EXT_DEFLATE_C_CTX "client_no_context_takeover"
void ulfius_free_websocket_extension_pointer_list(void * extension);
void ulfius_free_websocket_extension(struct _websocket_extension * websocket_extension);
int ulfius_init_websocket_extension(struct _websocket_extension * websocket_extension);
void ulfius_start_websocket_cb (void *cls,
struct MHD_Connection *connection,
void *con_cls,
const char *extra_in,
size_t extra_in_size,
MHD_socket sock,
struct MHD_UpgradeResponseHandle *urh);
int ulfius_generate_handshake_answer(const char * key, char * out_digest);
int ulfius_check_list_match(const char * source, const char * match, const char * separator, char ** result);
int ulfius_check_first_match(const char * source, const char * match, const char * separator, char ** result);
#ifndef U_DISABLE_WS_MESSAGE_LIST
int ulfius_init_websocket_message_list(struct _websocket_message_list * message_list);
void ulfius_clear_websocket_message_list(struct _websocket_message_list * message_list);
int ulfius_push_websocket_message(struct _websocket_message_list * message_list, struct _websocket_message * message);
#endif
int ulfius_clear_websocket(struct _websocket * websocket);
void ulfius_clear_websocket_manager(struct _websocket_manager * websocket_manager);
int ulfius_close_websocket(struct _websocket * websocket);
int ulfius_instance_add_websocket_active(struct _u_instance * instance, struct _websocket * websocket);
int ulfius_instance_remove_websocket_active(struct _u_instance * instance, struct _websocket * websocket);
int ulfius_init_websocket(struct _websocket * websocket);
int ulfius_init_websocket_manager(struct _websocket_manager * websocket_manager);
int ulfius_check_handshake_response(const char * key, const char * response);
#endif // U_DISABLE_WEBSOCKET
#endif // __U_PRIVATE_H__
_u_endpoint
Contains all informations needed for an endpoint.
Definition ulfius.h:299
_u_instance
Contains the needed data for an ulfius instance to work.
Definition ulfius.h:316
_u_map
Definition ulfius.h:204
_u_response
definition of the parameters available in a struct _u_response
Definition ulfius.h:273
ulfius_generate_handshake_answer
int ulfius_generate_handshake_answer(const char *key, char *out_digest)
Definition u_websocket.c:1245
ulfius_clear_websocket
int ulfius_clear_websocket(struct _websocket *websocket)
Definition u_websocket.c:1667
ulfius_init_websocket_manager
int ulfius_init_websocket_manager(struct _websocket_manager *websocket_manager)
Definition u_websocket.c:1746
ulfius_instance_add_websocket_active
int ulfius_instance_add_websocket_active(struct _u_instance *instance, struct _websocket *websocket)
Definition u_websocket.c:1409
ulfius_clear_websocket_message_list
void ulfius_clear_websocket_message_list(struct _websocket_message_list *message_list)
Definition u_websocket.c:1694
ulfius_parse_url
int ulfius_parse_url(const char *url, const struct _u_endpoint *endpoint, struct _u_map *map, int check_utf8)
Definition u_request.c:196
utf8_check
const unsigned char * utf8_check(const char *s_orig, size_t len)
Definition ulfius.c:1769
ulfius_clear_websocket_manager
void ulfius_clear_websocket_manager(struct _websocket_manager *websocket_manager)
Definition u_websocket.c:1800
ulfius_check_handshake_response
int ulfius_check_handshake_response(const char *key, const char *response)
Definition u_websocket.c:1228
ulfius_set_response_cookie
int ulfius_set_response_cookie(struct MHD_Response *mhd_response, const struct _u_response *response)
Definition u_response.c:177
ulfius_init_websocket
int ulfius_init_websocket(struct _websocket *websocket)
Definition u_websocket.c:1711
ulfius_close_websocket
int ulfius_close_websocket(struct _websocket *websocket)
Definition u_websocket.c:1385
ulfius_check_first_match
int ulfius_check_first_match(const char *source, const char *match, const char *separator, char **result)
Definition u_websocket.c:1345
ulfius_init_websocket_message_list
int ulfius_init_websocket_message_list(struct _websocket_message_list *message_list)
Definition u_websocket.c:1273
ulfius_check_list_match
int ulfius_check_list_match(const char *source, const char *match, const char *separator, char **result)
Definition u_websocket.c:1308
ulfius_instance_remove_websocket_active
int ulfius_instance_remove_websocket_active(struct _u_instance *instance, struct _websocket *websocket)
Definition u_websocket.c:1434
ulfius_init_websocket_extension
int ulfius_init_websocket_extension(struct _websocket_extension *websocket_extension)
Definition u_websocket.c:76
ulfius_start_websocket_cb
void ulfius_start_websocket_cb(void *cls, struct MHD_Connection *connection, void *con_cls, const char *extra_in, size_t extra_in_size, MHD_socket sock, struct MHD_UpgradeResponseHandle *urh)
Definition u_websocket.c:1182
ulfius_free_websocket_extension_pointer_list
void ulfius_free_websocket_extension_pointer_list(void *extension)
Definition u_websocket.c:64
ulfius_free_websocket_extension
void ulfius_free_websocket_extension(struct _websocket_extension *websocket_extension)
Definition u_websocket.c:68
ulfius_set_response_header
int ulfius_set_response_header(struct MHD_Response *response, const struct _u_map *response_map_header)
Definition u_response.c:153
ulfius_endpoint_match
struct _u_endpoint ** ulfius_endpoint_match(const char *method, const char *url, struct _u_endpoint *endpoint_list)
Definition u_request.c:139
ulfius_push_websocket_message
int ulfius_push_websocket_message(struct _websocket_message_list *message_list, struct _websocket_message *message)
Definition u_websocket.c:1287
ulfius.h
Ulfius framework.