Ulfius: include/u_private.h Source File

Ulfius HTTP Framework for REST Applications in C

u_private.h
Go to the documentation of this file.
1
26#ifndef __U_PRIVATE_H__
27#define __U_PRIVATE_H__
28
29#include "ulfius.h"
30
32#define UNUSED(x) (void)(x)
33
38#ifdef U_WITH_FREERTOS
39 #include <FreeRTOS_Sockets.h>
40 #define sockaddr freertos_sockaddr
41 typedef unsigned long int socklen_t;
42#else
43 #ifdef U_WITH_LWIP
44 #include <lwip/sockets.h>
45 #endif // U_WITH_LWIP
46#endif // U_WITH_FREERTOS
47
48
49/**********************************
50 * Internal functions declarations
51 **********************************/
52
59struct _u_endpoint ** ulfius_endpoint_match(const char * method, const char * url, struct _u_endpoint * endpoint_list);
60
66int ulfius_parse_url(const char * url, const struct _u_endpoint * endpoint, struct _u_map * map, int check_utf8);
67
73int ulfius_set_response_header(struct MHD_Response * response, const struct _u_map * response_map_header);
74
80int ulfius_set_response_cookie(struct MHD_Response * mhd_response, const struct _u_response * response);
81
101const unsigned char * utf8_check(const char * s_orig, size_t len);
102
103#ifndef U_DISABLE_WEBSOCKET
104
105#define _U_W_BUFF_LEN 256
106#define _U_W_EXT_DEFLATE "permessage-deflate"
107#define _U_W_EXT_DEFLATE_S_CTX "server_no_context_takeover"
108#define _U_W_EXT_DEFLATE_C_CTX "client_no_context_takeover"
109
110void ulfius_free_websocket_extension_pointer_list(void * extension);
111
112void ulfius_free_websocket_extension(struct _websocket_extension * websocket_extension);
113
114int ulfius_init_websocket_extension(struct _websocket_extension * websocket_extension);
115
123void ulfius_start_websocket_cb (void *cls,
124 struct MHD_Connection *connection,
125 void *con_cls,
126 const char *extra_in,
127 size_t extra_in_size,
128 MHD_socket sock,
129 struct MHD_UpgradeResponseHandle *urh);
130
134int ulfius_generate_handshake_answer(const char * key, char * out_digest);
135
141int ulfius_check_list_match(const char * source, const char * match, const char * separator, char ** result);
142
148int ulfius_check_first_match(const char * source, const char * match, const char * separator, char ** result);
149
154int ulfius_init_websocket_message_list(struct _websocket_message_list * message_list);
155
159void ulfius_clear_websocket_message_list(struct _websocket_message_list * message_list);
160
165int ulfius_push_websocket_message(struct _websocket_message_list * message_list, struct _websocket_message * message);
166
170int ulfius_clear_websocket(struct _websocket * websocket);
171
175void ulfius_clear_websocket_manager(struct _websocket_manager * websocket_manager);
176
180int ulfius_close_websocket(struct _websocket * websocket);
181
185int ulfius_instance_add_websocket_active(struct _u_instance * instance, struct _websocket * websocket);
186
190int ulfius_instance_remove_websocket_active(struct _u_instance * instance, struct _websocket * websocket);
191
196int ulfius_init_websocket(struct _websocket * websocket);
197
202int ulfius_init_websocket_manager(struct _websocket_manager * websocket_manager);
203
207int ulfius_check_handshake_response(const char * key, const char * response);
208
209#endif // U_DISABLE_WEBSOCKET
210
211#endif // __U_PRIVATE_H__
_u_endpoint
Contains all informations needed for an endpoint.
Definition: ulfius.h:294
_u_instance
Contains the needed data for an ulfius instance to work.
Definition: ulfius.h:311
_u_map
Definition: ulfius.h:199
_u_response
definition of the parameters available in a struct _u_response
Definition: ulfius.h:268
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:231
utf8_check
const unsigned char * utf8_check(const char *s_orig, size_t len)
Definition: ulfius.c:1768
ulfius_set_response_cookie
int ulfius_set_response_cookie(struct MHD_Response *mhd_response, const struct _u_response *response)
Definition: u_response.c:175
ulfius_set_response_header
int ulfius_set_response_header(struct MHD_Response *response, const struct _u_map *response_map_header)
Definition: u_response.c:156
ulfius_endpoint_match
struct _u_endpoint ** ulfius_endpoint_match(const char *method, const char *url, struct _u_endpoint *endpoint_list)
Definition: u_request.c:174
ulfius_generate_handshake_answer
int ulfius_generate_handshake_answer(const char *key, char *out_digest)
Definition: u_websocket.c:1211
ulfius_clear_websocket
int ulfius_clear_websocket(struct _websocket *websocket)
Definition: u_websocket.c:1600
ulfius_init_websocket_manager
int ulfius_init_websocket_manager(struct _websocket_manager *websocket_manager)
Definition: u_websocket.c:1676
ulfius_instance_add_websocket_active
int ulfius_instance_add_websocket_active(struct _u_instance *instance, struct _websocket *websocket)
Definition: u_websocket.c:1370
ulfius_clear_websocket_message_list
void ulfius_clear_websocket_message_list(struct _websocket_message_list *message_list)
Definition: u_websocket.c:1626
ulfius_clear_websocket_manager
void ulfius_clear_websocket_manager(struct _websocket_manager *websocket_manager)
Definition: u_websocket.c:1724
ulfius_check_handshake_response
int ulfius_check_handshake_response(const char *key, const char *response)
Definition: u_websocket.c:1194
ulfius_init_websocket
int ulfius_init_websocket(struct _websocket *websocket)
Definition: u_websocket.c:1642
ulfius_close_websocket
int ulfius_close_websocket(struct _websocket *websocket)
Definition: u_websocket.c:1348
ulfius_check_first_match
int ulfius_check_first_match(const char *source, const char *match, const char *separator, char **result)
Definition: u_websocket.c:1308
ulfius_init_websocket_message_list
int ulfius_init_websocket_message_list(struct _websocket_message_list *message_list)
Definition: u_websocket.c:1237
ulfius_check_list_match
int ulfius_check_list_match(const char *source, const char *match, const char *separator, char **result)
Definition: u_websocket.c:1271
ulfius_instance_remove_websocket_active
int ulfius_instance_remove_websocket_active(struct _u_instance *instance, struct _websocket *websocket)
Definition: u_websocket.c:1395
ulfius_init_websocket_extension
int ulfius_init_websocket_extension(struct _websocket_extension *websocket_extension)
Definition: u_websocket.c:72
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:1148
ulfius_free_websocket_extension_pointer_list
void ulfius_free_websocket_extension_pointer_list(void *extension)
Definition: u_websocket.c:60
ulfius_free_websocket_extension
void ulfius_free_websocket_extension(struct _websocket_extension *websocket_extension)
Definition: u_websocket.c:64
ulfius_push_websocket_message
int ulfius_push_websocket_message(struct _websocket_message_list *message_list, struct _websocket_message *message)
Definition: u_websocket.c:1251
ulfius.h
Ulfius framework.