1 | /** |
---|
2 | * @file rtems/rtems-shttpd.h |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef _rtems_rtems_webserver_h |
---|
6 | #define _rtems_rtems_webserver_h |
---|
7 | |
---|
8 | #include "shttpd.h" |
---|
9 | |
---|
10 | #include <rtems.h> |
---|
11 | #include <sys/socket.h> |
---|
12 | #include <netinet/in.h> |
---|
13 | #include <dirent.h> |
---|
14 | |
---|
15 | /* RTEMS is an Real Time Embedded operating system, for operation in hardware. |
---|
16 | It does not have SSL or CGI support, as it does not have dynamic library |
---|
17 | loading or sub-processes. */ |
---|
18 | #define EMBEDDED |
---|
19 | #define NO_SSL |
---|
20 | #define NO_CGI |
---|
21 | |
---|
22 | #define DIRSEP '/' |
---|
23 | #define IS_DIRSEP_CHAR(c) ((c) == '/') |
---|
24 | #define O_BINARY 0 |
---|
25 | #define closesocket(a) close(a) |
---|
26 | #define ERRNO errno |
---|
27 | |
---|
28 | /* RTEMS version is Thread Safe */ |
---|
29 | #define InitializeCriticalSection(x) rtems_semaphore_create( \ |
---|
30 | rtems_build_name('H','T','P','X'), \ |
---|
31 | 1, /* Not Held Yet.*/ \ |
---|
32 | RTEMS_FIFO | \ |
---|
33 | RTEMS_BINARY_SEMAPHORE, \ |
---|
34 | 0, \ |
---|
35 | x); |
---|
36 | #define EnterCriticalSection(x) rtems_semaphore_obtain(*(x),RTEMS_WAIT,RTEMS_NO_TIMEOUT) |
---|
37 | #define LeaveCriticalSection(x) rtems_semaphore_release(*(x)) |
---|
38 | |
---|
39 | |
---|
40 | |
---|
41 | #ifdef __cplusplus |
---|
42 | extern "C" { |
---|
43 | #endif |
---|
44 | |
---|
45 | typedef void (*rtems_shttpd_addpages)(struct shttpd_ctx *ctx); |
---|
46 | typedef void (*rtems_shttpd_init)(void); |
---|
47 | |
---|
48 | rtems_status_code rtems_initialize_webserver(rtems_task_priority initial_priority, |
---|
49 | size_t stack_size, |
---|
50 | rtems_mode initial_modes, |
---|
51 | rtems_attribute attribute_set, |
---|
52 | rtems_shttpd_init init_callback, |
---|
53 | rtems_shttpd_addpages addpages_callback, |
---|
54 | char *webroot |
---|
55 | ); |
---|
56 | void rtems_terminate_webserver(void); |
---|
57 | int rtems_webserver_ok(void); |
---|
58 | |
---|
59 | #ifdef __cplusplus |
---|
60 | } |
---|
61 | #endif |
---|
62 | #endif |
---|