[484cd8d] | 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 O_BINARY 0 |
---|
| 24 | #define ERRNO errno |
---|
| 25 | |
---|
| 26 | /* RTEMS version is Thread Safe */ |
---|
| 27 | #define InitializeCriticalSection(x) rtems_semaphore_create( \ |
---|
| 28 | rtems_build_name('H','T','P','X'), \ |
---|
| 29 | 1, /* Not Held Yet.*/ \ |
---|
| 30 | RTEMS_FIFO | \ |
---|
| 31 | RTEMS_BINARY_SEMAPHORE, \ |
---|
| 32 | 0, \ |
---|
| 33 | x); |
---|
| 34 | #define EnterCriticalSection(x) rtems_semaphore_obtain(*(x),RTEMS_WAIT,RTEMS_NO_TIMEOUT) |
---|
| 35 | #define LeaveCriticalSection(x) rtems_semaphore_release(*(x)) |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | #ifdef __cplusplus |
---|
| 40 | extern "C" { |
---|
| 41 | #endif |
---|
| 42 | |
---|
| 43 | typedef void (*rtems_shttpd_addpages)(struct shttpd_ctx *ctx); |
---|
| 44 | typedef void (*rtems_shttpd_init)(void); |
---|
| 45 | |
---|
| 46 | rtems_status_code rtems_initialize_webserver(rtems_task_priority initial_priority, |
---|
[4847f6b1] | 47 | size_t stack_size, |
---|
[484cd8d] | 48 | rtems_mode initial_modes, |
---|
| 49 | rtems_attribute attribute_set, |
---|
| 50 | rtems_shttpd_init init_callback, |
---|
| 51 | rtems_shttpd_addpages addpages_callback, |
---|
| 52 | char *webroot |
---|
| 53 | ); |
---|
| 54 | void rtems_terminate_webserver(void); |
---|
| 55 | int rtems_webserver_ok(void); |
---|
| 56 | |
---|
| 57 | #ifdef __cplusplus |
---|
| 58 | } |
---|
| 59 | #endif |
---|
| 60 | #endif |
---|