source: rtems/cpukit/shttpd/compat_rtems.h @ 83ca6077

4.104.114.84.95
Last change on this file since 83ca6077 was 83ca6077, checked in by Joel Sherrill <joel.sherrill@…>, on 07/12/07 at 20:01:35

2007-07-12 Joel Sherrill <joel.sherrill@…>

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